text
stringlengths
2.85k
2.55M
label
class label
11 classes
The Sample Complexity of Online One-Class Collaborative Filtering Reinhard Heckel 1 Kannan Ramchandran 1 Abstract arXiv:1706.00061v1 [cs.LG] 31 May 2017 We consider the online one-class collaborative filtering (CF) problem that consists of recommending items to users over time in an online fashion based on positive ratings only. This problem arises when users respond only occasionally to a recommendation with a positive rating, and never with a negative one. We study the impact of the probability of a user responding to a recommendation, pf , on the sample complexity, i.e., the number of ratings required to make ‘good’ recommendations, and ask whether receiving positive and negative ratings, instead of positive ratings only, improves the sample complexity. Both questions arise in the design of recommender systems. We introduce a simple probabilistic user model, and analyze the performance of an online user-based CF algorithm. We prove that after an initial cold start phase, where recommendations are invested in exploring the user’s preferences, this algorithm makes—up to a fraction of the recommendations required for updating the user’s preferences—perfect recommendations. The number of ratings required for the cold start phase is nearly proportional to 1/pf , and that for updating the user’s preferences is essentially independent of pf . As a consequence we find that, receiving positive and negative ratings instead of only positive ones improves the number of ratings required for initial exploration by a factor of 1/pf , which can be significant. 1. Introduction Recommender systems seek to identify the subset of a large collection of items that a user likes (Aggarwal, 2016). In practice, recommender systems often use collaborative filtering (CF) (Ekstrand et al., 2011) to identify items a given 1 University of California, Berkeley, California, USA. Correspondence to: Reinhard Heckel <[email protected]>. Proceedings of the 34 th International Conference on Machine Learning, Sydney, Australia, 2017. JMLR: W&CP. Copyright 2017 by the author(s). user likes, based on ratings that this user and a large number of other users have provided in the past. To this end, a user-based CF algorithm first identifies similar users, and then predicts the ratings of a given user from the ratings provided by similar users. In practice, recommender systems typically operate in an online fashion, i.e., items are recommended to users over time, and the ratings obtained in response to recommendations are used to improve future recommendations. However, in many application areas of recommender systems, users only occasionally rate what they ‘like’, and never what they ‘dislike’. E.g., in e-commerce, such as Amazon’s recommender system, an item (or a set of items) is recommended to a user, and the user either purchases the item, which indicates a ‘like’, or the user does not purchase the item. Not purchasing the item, however, does not necessarily indicate a ‘dislike’, since the user might not even have considered the recommendation. Other examples of such feedback include implicit ratings such as viewing a webpage and listening to a song (Hu et al., 2008), and business-to-business recommender systems (Heckel et al., 2017). The problem of generating recommendations based on positive ratings only is known as one-class CF (Pan et al., 2008). The lack of negative ratings is often considered to make this problem challenging (Pan et al., 2008). However, it is unclear whether it is fundamentally more difficult in the absence of negative ratings to identify the user’s preferences, in the sense that the sample complexity (i.e., the number of ratings required to make good recommendations) is fundamentally larger. Additionally, there is little theoretical understanding on how the probability of a user responding to a recommendation, pf , affects the sample complexity of a one-class CF algorithm and in particular its cold start time, i.e., the number of recommendations the algorithm needs to invest in learning the user’s preferences before being able to make good recommendations. In this paper, we address those two questions, that turn out to be closely related. To this end, we introduce a probabilistic model for a oneclass online recommender system and a corresponding online user-based CF algorithm, termed User-CF, and analyze its performance. Our model, and elements of our algorithm, are inspired by a related model and algorithm by Bresler et al. (2014) for the two-class CF problem, i.e., Online One-Class Collaborative Filtering for a setup where positive and negative ratings are available. In a nutshell, each user in our model has a latent probability preference vector which describes the extent to which she likes or dislikes each item. Similar users have similar preference vectors. At a given time step t = 0, 1, . . ., the User-CF algorithm recommends a single item to each user, typically different for each user. With probability specified by a corresponding preference vector, the user likes or dislikes the recommended item. If the user likes the item, the user rates it with probability pf , and if the user does not like the item, no rating is given. An item that has been rated cannot be recommended again, since a rating often corresponds to consuming an item, and there is little point in, e.g., recommending a product that has been previously purchased in the past for a second time. While in practice the probability pf could be different for each user, for ease of presentation, we assume that pf is constant over all users. The goal of the User-CF algorithm is to maximize the number of recommendations that a users likes. The User-CF algorithm consists of an exploitation step that recommends items that similar users have rated positively, and two kinds of exploration steps; one to learn the preferences of the users and the other to explore similarity between users. Our main result, stated in Section 4, guarantees that after a certain cold start time in which the User-CF algorithm 1 recommends the order of (log(N )/p2f ) 1−α items to each user, a fraction 1 − c/pf of the remaining recommendations given by the User-CF algorithm are optimal. Here, α is a learning rate that can be chosen very close to zero, N is the number of users, and c a numerical constant. The cold start time is required to identify similar users and learn their preferences regarding a few items. We also show that any algorithm has to make on the order of 1/p2f recommendations before it can make good recommendations, therefore the User-CF algorithm is near optimal. The fraction c/pf of the remaining time steps is associated with learning the preferences of the users. This ‘cost’ of c/pf does not have to be paid upfront, but is paid continuously: After the cold start time, the User-CF algorithm starts exploiting successfully. Again, a fraction of the recommendations proportional to 1/pf is necessary to learn the preference of the users. Our numerical results in Section 5 show that even if our data is not generated from the probabilistic model, but is based on real data, the cold start time and the fraction of time steps required to learn the preferences of the users are nearly proportional to 1/p2f and 1/pf , respectively. As a consequence of this result, we find that obtaining positive and negative ratings instead of only positive ones, improves the number of ratings required for the initial cold start period by a factor of pf . To see this, note that the ex- pected number of ratings obtained by a user in a given number of time steps or equivalently after a given number of recommendations is proportional to pf . Thus, the number of ratings required for the initial cold start time is inversely proportional to pf , and the number of ratings required for continuously learning the preferences is independent of pf . Since pf = 1 corresponds to users giving positive and negative feedback (no positive feedback implies dislike when pf = 1), the number of ratings required for the cold-start time is by a factor of 1/pf larger than the number of ratings required by a user-based CF algorithm that obtains positive and negative ratings. Those findings are relevant for the design of recommender systems, since both pf and whether positive, or negative and positive ratings are obtained can often be incorporated in the design of a recommender system. Therefore an understanding of the associated benefits and costs in terms of sample complexity, as provided in this paper, is important. We finally note that the goal of this paper is not to improve upon state-of-the art algorithms, but rather to inform the design of algorithms and what to expect in terms of sample complexity as a function of the various parameters involved. Related literature: While to the best of our knowledge, this is the first work that analytically studies one-class CF in an online setting, theoretical results have been established for the two or multiple class CF problems. One of the first analytical results on user-based CF algorithms, an asymptotic performance guarantee under a probabilistic model, was established by Biau et al. (2010). Most related to our approach is the Collaborative-Greedy algorithm studied by Bresler et al. (2014) for the online twoclass CF problem. The Collaborative-Greedy algorithm differs from our User-CF algorithm in selecting the nearest neighbors based on thresholding similarity, instead of selecting the k most similar users, and in the way preferences of the users are explored. This difference in the exploration steps is crucial for establishing that after the cold start period, our User-CF algorithm makes optimal recommendations in a fraction 1 − c/pf of the remaining time steps. Dabeer (2013) studies a probabilistic model in an online setup, and Barman & Dabeer (2012) study a probabilistic model in an offline setup, and state performance guarantees for a two-class user-based CF algorithm. Closely related to user-based CF is item-based CF. Item-based CF exploits similarity in item space by recommending items similar to those a given user has rated positively in the past. Our results do not extend trivially to item-based CF, since a corresponding analysis requires assumptions on the similarity in item space, and additionally the exploration strategies of item-based CF algorithms are considerably different. We do not discuss item based CF algorithms here, but refer to (Bresler et al., 2015) for a recent analysis of an item Online One-Class Collaborative Filtering based CF algorithm for the two-class CF problem. Next, we note that Deshpande & Montanari (2012) study recommender systems in the context of multi-armed bandits (Bubeck & Cesa-Bianchi, 2012). Specifically, Deshpande & Montanari (2012) consider a model where the (continuous) ratings are described by the inner product of a user and item feature vector, and assume the item feature vectors to be given. A conceptually related online learning problem are multiarmed bandits with dependent arms (Pandey et al., 2007). Specifically, in this variant of the multi-armed bandit problem, the arms are grouped into clusters, and the arms within each cluster are dependent. The assignments of arms to clusters are assumed known. In our paper, we assume that users cluster in user types that have similar distributions. Therefore, the learning problem in our paper can be viewed as an multi-armed bandit problem with dependent arms, but the assignment of the arms to clusters is unknown. Finally, we note that a class of learning problems reminiscent to that considered here is partial monitoring (Bartók et al., 2014). While partial monitoring has been studied in the context of recommender systems (Kveton et al., 2015), we are not aware of papers on partial monitoring in collaborative filtering. Outline: In Section 2, we formally specify our model, motivate it, and state the CF problem. Sections 3 and 4 contain the User-CF algorithm and corresponding performance guarantee, respectively. In Section 5 we provide numerical results on real data. The proof of our main result can be found in the supplementary material. 2. Model and learning problem In this section we introduce the probabilistic model and learning problem considered in this paper. As mentioned previously, this model is inspired by that in (Bresler et al., 2014) for the two-class CF problem. Model: Consider N users and M items. A user may like an item (+1), or dislike an item (−1). Associated with each user is an (unknown) latent preference vector pu ∈ [0, 1]M whose entries pui are the probabilities of user u liking item i. We assume that an item i is either “likable” for user u, i.e., pui > 1/2 + ∆, for some ∆ ∈ (0, 1/2], or “not likhidden able”, i.e., pui < 1/2 − ∆. The hidden ranking Rui is hidden obtained at random as Rui = 1 (like) with probability hidden pui , and Rui = −1 (dislike) with probability 1 − pui . The ratings are stochastic to model that users are not fully consistent in their rating; the parameter ∆ quantifies the inconsistency (or uncertainty or noise). The one-class aspect is incorporated in our model by assuming that users never reveal that they dislike an item. Specifically, an CF algorithm operates on the model as fol- lows. At each time step t = 0, 1, . . . the algorithm recommends a single item i = i(t, u) to each user u—typically this item is different for each user—and obtains an realization of the binary random variable ( hidden Zui ∼ Bernoulli(pf ), if Rui = 1, Rui = hidden 0, if Rui = −1 in response, independently across u and i. It follows that P [Rui = 1] = pui pf and P [Rui = 0] = 1 − pui pf ,. Here, pf corresponds to the probability of a user reporting a positive rating. As mentioned before, while one might treat the slightly more general case of the probability pf being different for each user, for ease of presentation, we assume that it is constant over the users. If Rui = 1, user u consumes item i, and i will not be recommended to u in subsequent time steps. Note that Rui = 0 means that either user hidden u does not like item i (Rui = −1), or user u did not respond to the recommendation. Therefore, if Rui = 0, i may be recommended to u again in subsequent time steps. Finally, observe that if pf = 1, the user provides positive hidden and negative ratings, since Rui = 0 implies Rui = −1 if pf = 1. In order to make recommendations based on the user’s preferences, we must assume some relation between the users. Following (Bresler et al., 2014), we assume that each user belongs to one of K < N user types. Two users u and v belong to the same type if they find the same items likable, i.e., if 1 {pui > 1/2 + ∆} = 1 {pvi > 1/2 + ∆}, for all items i. This does not require the preference vectors pu and pv of two users corresponding to the same user type to be equivalent. We note that this assumption could be relaxed by only assuming that users of the same type share a large fraction of the items that they find likable. We assume that the preference vectors belonging to the same type are more similar than those belonging to other types. Specifically, assume that for all u ∈ [N ], [N ] := {0, 1, . . . , N − 1}, and for some γ ∈ [0, 1), γ min hpu , pv i ≥ max hpu , pv i , v∈Tu v ∈T / u (1) where Tu ⊂ [N ] is the subset of all users that are of the same type as u. The smaller γ, the more distinct users of the same type are from users of another type. We further assume that each user likes at least a fraction ν of the items. This assumption is made to avoid degenerate situations were a user u does not like any item. Assuming that users cluster in the user-item space in different user types is common and is implicitly used by user-based CF algorithms (Sarwar et al., 2000), which perform well in practice. To further justify this assumption empirically, we plot in Figure 1 the clustering of user ratings of the Movielens 10 Million dataset (Harper & Konstan, 2015). Figure 1 shows that the user’s ratings cluster both in user and in item space. Online One-Class Collaborative Filtering and exploiting, i.e., recommending items predicted to be likable based on previous ratings. To this end, the UserCF algorithm, formally introduced below, performs at time t = 0, 1, . . ., either an preference exploration, similarity exploration, or exploitation step. Figure 1. The user-items rating matrix consisting of a subset of the Movielens 10 Million dataset corresponding to the 1000 most rated movies (columns) and the 1000 users (rows) that rated most movies. The Movielens dataset consists of 10 Million movie ratings in {1, 2, 3, 4, 5}; we took the ratings ≥ 4 as 1, ratings ≤ 3 as −1, and missing ratings as 0; depicted in black, white, and gray. Learning problem and reward: The goal of a CF algorithm is to maximize reward. A reasonable reward for the online CF problem is the expected number of recommendations that a user rates positively, i.e., the pseudo-reward −1 T −1 N X X   E Rui(u,t) . t=0 u=0 Here, i(u, t) is the item recommended to u at time t. In an e-commerce setting this corresponds to the number of recommended products that a user buys. Note that due to the uncertainty of a user liking an item (the random rating hidden Rui might be −1 even when i is likable by u), we cannot expect to do better than maximizing the pseudo-reward. In this paper our focus is on recommending likable items. Following (Bresler et al., 2014) we therefore consider the closely related accumulated reward defined as the expected total number of likable items (pui > 1/2) that are recommended by an algorithm up to time T : E [reward(T )] := T −1 N −1 X X   E Xui(u,t) . (2) t=0 u=0 Here, Xui(u,t) = 1 {pui > 1/2} is the indicator random variable that is equal to one if item i(u, t) recommended to user u at time t is likable and zero otherwise (note that item i is chosen by the CF algorithm as a function of the responses Ru0 i0 to recommendations (i0 , u0 ) made at previous time steps, and is therefore a random variable). 3. User-CF algorithm In this section we present our user-based CF algorithm (User-CF). In order to maximize reward the User-CF algorithm balances exploring, i.e., learning about the users, An exploitation step first identifies the k most similar users in terms of their rating vectors rv ∈ {0, 1}M , for a given user u. The rating vectors consist of the responses Rui of users to recommendations (u, i) made by the User-CF algorithm at previous time steps. The exploitation step proceeds by recommending the item that has received the largest number of positive ratings from the nearest neighbors of u in previous time steps. For an exploitation step to be successful, it is crucial to find similar users and learn their preferences effectively. This is accomplished with similarity exploration steps, that recommend the same items to all users, and preference exploration steps that recommend random items to certain subsets of the users. Before formally stating the User-CF algorithm, we illustrate its main steps using a toy example. Example 1 Consider N = 6 users and M = 5 items, with preference vectors pu and rating vectors ru at time t = 2 given by   T  p0 .9 .8 .9 .1 .1 pT1   .9 .8 .9 .2 .3    T  p2   .9 .8 .9 .1 .2    T =  p3   .1 .3 .1 .8 .7  ,   T  p4   .2 .2 .1 .9 .9  .1 .1 .3 .7 .8 pT5    T 0 1 0 0 0 r0   0 0 0 rT1   1 1  T   r2   1 1 0 0 0  T =  . r3   0 0 1 0 0  T    r4   1 0  0 0 0 rT5 0 0 0 0 0 Users 0, 1, 2 are of the same type as they find items 0, 1, 2 likable, and users 3, 4, 5 belong to a second type as they find items 3, 4 likable. The preference vectors are obtained by executing at time step 0 a preference exploration step, that recommends the randomly chosen items 4, 1, 1, 2, 3, 3 to users 0, 1, . . . , 5, respectively, and a similarity exploration step that recommends item 0 to all users. The responses Rui obtained from the similarity and preference exploration step are marked with rectangles and circles, respectively. Consider recommending an item to user 0 with an exploitation step at time 2. The k = 2 nearest neighbors of u = 0 are Nu = {1, 2} (hr0 , rv i = P 1 for v = 1, 2 and hr0 , rv i = 0 for v = 3, 4, 5). Since v∈Nu rvi is maximized for i = 1 (rvi is the i-th entry of ru ), item 1 is recommended to user u, which happens to be a likable Online One-Class Collaborative Filtering item, as desired. We next formally describe the User-CF algorithm, and explain the intuition behind the specific steps. Input parameters of the User-CF algorithm are learning rates α and η ∈ (0, 1) (e.g., η = 1/2) relevant for similarity and preference exploration steps, respectively, a batch size Q relevant for preference exploration steps, and finally the number of nearest neighbors k, relevant for exploitation steps. Our results guarantee that for a range of input parameters that depends on properties of the model such as the number of user types and pf , the User-CF algorithm performs essentially optimally. While we may or may not have prior knowledge of those model parameters, in practice, we can optimize for the hyper-parameters of the User-CF algorithm by using cross validation. At initialization, the User-CF algorithm generates a random permutation π of the items [M ] required by the similarity exploration step. Furthermore, it splits the item space into M/Q random, and equally sized1 subsets of cardinality Q (batches), denoted by Qq ⊂ [M ], q = 0, . . . , M/Q − 1. At time steps t = bηQqc, q = 0, . . . , M/Q − 1, the UserCF algorithm performs preference exploration steps. At 1 all other time steps, with probabilities pJ = (t−q) α,q = bt/(ηQ)c, and pE = 1 − pJ , the algorithm performs similarity exploration and exploitation steps, respectively. Similarity exploration step: For each user u, recommend the first item i in the permutation π that has not been recommended to user u in previous steps of the algorithm. This step explores the item space and its important for selecting ‘good’ neighborhoods. Performing a sufficient number of similarity exploration steps allows to guarantee that the nearest neighbors of a given user u are of the same type. Preference exploration step: At time t = bηQqc, recommend to each user u an item, chosen independently and uniformly at random from Qq , that has not been rated by u in previous time steps. This step is important to learn the preferences of users. Exploitation step: For all users u, estimate the probability of u liking a given item i as ( P 1 Rvi , if nui > 0, p̂ui = nui v∈Nu (3) 0, if nui = 0. Here, Rvi is the rating of user v for item i obtained in previous time steps (we use the convention Rvi = 0 if no rating was obtained at a previous time step). Next, Nu is the set of users corresponding to the k largest values of sim M rsim , v ∈ [N ]. Here, rsim is the vector u , rv u ∈ {0, 1} 1 We assume for simplicity that M is divisible by Q, if this is not the case, batch dM/Qe − 1 may simply contain less than Q items. containing only the responses Rui of user u to recommendations i given in previous similarity exploration steps up to time t, and is zero otherwise. Moreover, nui is the number of users in Nu that received recommendation i. Finally, for each user u, recommend an item i that maximizes p̂ui0 over all items i0 that have not been rated yet. The idea behind the User-CF algorithm is as follows. An exploitation step recommends likable items to u if a) most of the neighbors of u are of the same user type as u, and if b) the items are sufficiently well explored so that p̂ui indicates whether i is likable by u (i.e., pui > 1/2) or not, for all i. A large portion of the first few steps is likely to be spent on similarity exploration. This is sensible, as we need to ensure that a) is satisfied in order to make good recommendations. As time evolves, the User-CF algorithm randomly explores batches of items, one batch at a time, in order to estimate the preferences of the users regarding the items in the corresponding batches. Note that if the UserCF algorithm would explore the entire item space at once, e.g., by recommending an item chosen at random from all items, the time required for the algorithm to make ‘good’ recommendations would grow linearly in M , and M might be very large. By splitting the item space into batches Qq , the User-CF algorithm can start exploiting without having learned the preferences of the users regarding all items. Finally note that the User-CF algorithm may recommend the same item at several time steps (unless the item is rated by the user); this is sensible in particular if pf is small. 4. Main result Our main result, stated below, shows that after a certain cold start time, the User-CF algorithm produces essentially optimal recommendations. N users of the Theorem 1 Suppose that there are at least 2K same type, for all user types, and that condition (1) holds for some γ ∈ [0, 1], which ensures that user types are distinct. Moreover, assume that at least a fraction ν of all items is likable to a given user, for all users. Pick δ > 0 and suppose that there are sufficiently many users per user type: N c ≥ log(M/δ) log(4/δ). K νpf ∆2 (4) Set Tstart :=   1    c̃ log(N/δ) 1−α 1 K c log(M/δ) 1 − max , , p2f (1 − γ)2 ν) T N pf ∆2 where c̃ is a numerical constant. Then, for appropriate choices2 of the parameters η, k, and Q, the expected reward accumulated by the User-CF algorithm up to time 2 Specifically, η = c1 ν, k = N c2 K , and Q = Online One-Class Collaborative Filtering T ∈ [Tstart , 54 νM pf ] satisfies  E [reward(T )] Tstart + 1 (T − Tstart )1−α ≥ 1− − 2α NT T T (1 − α)  K c log(M/δ) (1 − δ). (5) − N pf ∆2 Theorem 1 states that after an initial cold start time on the order of Tstart , the User-CF algorithm recommends only c log(M/δ) likable items up to a fraction K of the time steps. N p f ∆2 This follows since a oracle that only recommends likable items obtains an reward of E [reward(T )] = N T . This yields the claim from the introduction, that after the cold start time, a fraction 1 − c/pf of all recommendations made by the User-CF algorithm are likable. Note that condition (4) allows the number of user types, K, to be near linear in the number of users, N . We note that the particular choice of the parameters of the User-CF algorithm in Theorem 1 is mainly out of expositional convenience; the supplementary material contains a more general statement. Theorem 1 is proven by showing that after the initial cold start time, exploration steps recommend likable items with very high probability. An exploration step recommends a likable item to user u provided that a) most of the nearest neighbors of u are of the same user type, and b) the items are sufficiently well explored so that the maximum of p̂ui over items not rated yet corresponds to a likable item. For a), we use that the user types are sufficiently distinct and that most of the nearest neighbors of u are of the same user type. The former is ensured by condition (1), and the latter holds after the initial cold start time which ensures that sufficiently many similarity exploration steps have been executed. After the initial cold start time, most of the nearest neighbors of u are of the same user type, and essentially no further cost is required to learn the neighborhoods. This is reflected in the lower bound (5), by the terms depending on T becoming negligible as T becomes large compared to Tstart . Note the dependence of Tstart on γ; the more similar the user types are (i.e., the closer γ is to 1), the longer it takes till User-CF is guaranteed to find good neighborhoods. 4.1. Dependence on pf is nearly optimal The cold start time of the User-CF algorithm guaranteed by 1 Theorem 1 is proportional to (1/p2f ) 1−α . For small learning rates α, this scaling can not be improved significantly, as the following results shows. 2 kpf ∆ c3 log(M/δ) , for numerical constants c1 , c2 , and c3 . Proposition 1 Suppose that there are more items than user types, i.e., M ≥ K. Fix λ ∈ (0, 1). Then there is a set of N users with at least 2K users of the same type, for each user type, with preference vectors such that for all T ≤ pλ2 , the f expected reward of any online algorithm is upper bounded )] 1 by E[reward(T ≤λ+ K . TN Proposition 1 shows that if the cold start time is significantly smaller than 1/p2f , then there are problem instances for which any algorithm mostly recommends non-likable items. The proposition is a consequence of the fact that after making on the order of 1/p2f recommendations, for many users we did not obtain any rating. A consequence of the proposition is that the cold start time of the User-CF algorithm is near optimal. Recall that even after the initial cold start time, a constant c log(M/δ) of the recommendations might be fraction of K N pf ∆2 non-likable. This fraction is the cost for establishing b). Specifically, in order to ensure b), the User-CF algorithm needs to recommend sufficiently many items to the k neighbors of u so that p̂ui indicates whether user u likes item i or not, or more precisely such that the maximum of p̂ui over items not rated yet corresponds to a likable item. This is established by showing that p̂ui > pf /2 for all likable items t i ∈ Qq , q = 0, . . . , ηQ − 1, and p̂ui < pf /2 for all other items. Since the expected number of positive ratings per recommendation is proportional to pf , the number of ratings required to ensure that pui > pf /2 is proportional to 1/pf . 4.2. One versus two class CF Recall that pf = 1 implies that users provide positive and negative ratings, and that the User-CF algorithm is nearly optimal in pf . Since the expected number of ratings obtained by a user in a given number of time steps is proportional to pf , a consequence of our result is that receiving positive and negative ratings instead of only positive ones improves the number of ratings required for initial exploration by a factor of 1/pf , which can be significant. We finally note that Bresler et al. (2014) proved a performance guarantee for a closely related two-class collaborative CF algorithm termed Collaborative-Greedy. Bresler et al. (2014) consider the regime where the number of users is much larger than the number of items, i.e., N = O(M C ), C > 1 and additionally the number of user types obeys (N = O(KM )). For this regime, Theorem 1 particularized to pf = 1 essentially reduces to Theorem 1 in (Bresler et al., 2014) (there are some further minor differences). However, our result particularized to the two-class case also holds when the number of items is much larger than the number of users, and allows the number of user types to be near linear in the number of users. This improvement is due to differences in the preference explo- Online One-Class Collaborative Filtering ration strategies of the algorithms. 5. Numerical results In this section, we simulate an online recommender system based on real-world data in order to understand whether the User-CF algorithm behaves as predicted by Theorem 1, even when the data is not generated by the probabilistic model, but is based on real data. While an ideal dataset to validate our algorithm would consist of the ratings from all users for all items, the vast majority of ratings in standard CF datasets such as the Netflix or Movielens dataset (consisting of movie ratings) are unknown. To obtain a dataset with a higher proportion of ratings, following (Bresler et al., 2014), we consider the subset of the Movielens dataset corresponding to frequently rated items and to users that have rated many items. The Movielens dataset consists of 10 Million movie ratings in {1, 2, 3, 4, 5}; we took the ratings ≥ 4 as 1, ratings ≤ 3 as −1, and missing ratings as 0. Many of the items (movies) in the dataset have a significant bias towards a positive or negative rating. To make sure our results are not due to exploiting such biases, we only select frequently rated items out of the (approximately) unbiased items. Note that a nearest neighbor based algorithm, like the User-CF algorithm, performs well in case the item ratings are very biased even when the neighborhoods are randomly selected. Of the resulting dataset, denoted by RML ∈ {−1, 0, 1}1000×500 , 18.1% of the ratings are 1, 17.1% are −1, and the remaining ones are unknown and therefore set to 0. One class versus two class CF: We start with comparing the qualitative behavior of the User-CF algorithm to a two-class version of the User-CF algorithm. The two-class version of the User-CF algorithm differs from the one-class version in taking into account the negative ratings. Specif- 40 acc-reward(T ) 4.3. Alternative exploration strategies While there are other sensible preference exploration strategies, the essential element of our approach is to split up the item space into subsets of items Q0 , Q1 , . . ., start by exploring Q0 , then allow for exploitation steps, continue with exploring Q1 , again allow for exploitation steps and so forth. If one explores instead the whole item space [M ] at the beginning, the learning time required for p̂ui to indicate whether an item is likable or not, is proportional to M , and can therefore be very large. To see this, consider a preference exploration step that recommends a single item to all users, chosen uniformly at random from the set of all items [M ]. The expected number of ratings obtained by executing Tr such preference exploration steps relevant for estimating whether pui > 1/2, is the expected number of neighbors of u to which i has been recommend, and is therefore proportional to Tr k/M . To ensure that this expectation is larger than 0, Tr has to be on the order or M (provided that the other parameters are fixed). 20 one-class two-class 0 0 100 200 300 400 500 T Figure 2. Comparison of one and two class recommenders. ically, the ratings Rvi in (3) for the two-class version or the User-CF algorithm are set to −1, 0, and 1, if a negative, none, or a positive rating was obtained as a response to a recommendation. We performed the following experiment. If the User-CF algorithm recommends item i to user u, it obtains the rating Rui = 1 in response provided that [RML ]ui = 1 ([RML ]ui denotes the (u, i)-th entry of RML ), and Rui = 0 otherwise, while the two-class User-CF algorithm obtains Rui = [RML ]ui in response. We allow both algorithms to only recommend an item to a given user once, so after M = 500 time steps, all items have been recommend to all users. We measure performance in terms of the accumulated reward, defined as acc-reward(T ) := T −1 X reward(t), t=0 reward(t) := N −1 1 X [RML ]ui(u,t) , N u=0 (6) where i(u, t) is the item recommended to user u by the corresponding variant of the User-CF algorithm. The results, depicted in Figure 3, show that the two-class recommender performs better, as expected, since it obtains significantly more ratings. Specifically, the expected number of ratings it obtains is almost twice the expected number of ratings the one-class User-CF algorithm obtains. After having recommend most of the likable items, mostly non-likable are left to recommend, which explains the inverse U -shape in Figure 3. Dependence of User-CF on pf : We next validate empirically that the cold start time and number of preference exploration steps (needed to learn the preferences of the users) scale as 1/p2f and 1/pf , respectively. We start with the former. To this end, we split the items into two random disjoint sets I1 ⊂ [M ] and I2 ⊂ [M ] of equal cardinality. We then perform the following experiment for Online One-Class Collaborative Filtering References reward(Tr ) reward(Ts ) Aggarwal, Charu C. Recommender systems: The textbook. Springer, 2016. 0.2 0.14 0.12 0.1 0.08 0.15 pf = 1 pf = 0.75 pf = 0.5 0.1 0.05 0.06 0 10 20 Ts /p2f 30 0 20 40 Tr /pf Figure 3. Left: Reward obtained from a single exploitation step, after performing Ts similarity exploration steps and a fixed number of preference exploration steps. Right: Reward obtained from a single exploration step, after performing Tr preference exploration steps and a fixed number of similarity exploration steps. pf ∈ {1, 0.75, 0.5}. We start by recommending 3M kpf items, chosen uniformly at random from I2 to each user, and, provided the corresponding rating is positive ([RML ]ui = 1), we provide this rating to the User-CF algorithm with probability pf . The expected number of positive ratings obtained is therefore independent of pf . Those preference exploration steps make sure that the preferences of the items in I2 are explored well. We then perform Ts similarity exploration steps on the items in the sets I1 = {i0 , . . . , iM/2−1 }, by recommending item it to user u at t = 0, . . . , Ts − 1. If [RML ]uit = 1 then we provide the rating [RML ]uit to the User-CF algorithm with probability pf . After Ts such similarity exploration steps, we perform an exploitation step. In Figure 3 we plot the reward defined in (6) obtained by the exploitation step, over Ts /p2f . The results confirm that the cold start time required to find ‘good’ neighborhoods scales inversely proportional to p2f , since all three curves lie on top of each other. Next, we demonstrate that the number of preference exploration steps required to learn the preferences of the users is proportional to 1/pf . To this end, we perform the same experiment as above, this time, however, we first perform Ts = 25/p2f similarity exploration steps on the items in the set I1 , and then perform Tr preference exploration steps by recommending Tr items, chosen uniformly at random from I2 to each user. As before, if [RML ]ui = 1, the rating [RML ]ui is provided to the algorithm with probability pf . In Figure 3 we plot the reward obtained from performing a single exploitation step after Tr such preference exploration steps over Tr /pf . The results indicate that, as predicted by our theory, the number of preference exploration steps required to learn the preferences is proportional to pf , as the curves for different pf lie on top of each other. As mentioned previously, this is not surprising, as the number of positive ratings obtained is proportional to pf . Bardenet, Rémi and Maillard, Odalric-Ambrym. Concentration inequalities for sampling without replacement. Bernoulli, 21(3):1361–1385, 2015. Barman, Kishor and Dabeer, Onkar. Analysis of a collaborative filter based on popularity amongst neighbors. IEEE Trans. Inf. Theory, 58(12):7110–7134, 2012. Bartók, Gábor, Foster, Dean P., Pál, Dávid, Rakhlin, Alexander, and Szepesvári, Csaba. Multi-armed bandit problems with dependent arms. Math. Oper. Res., 39(4): 967–997, June 2014. Biau, Gérard, Cadre, Benoît, and Rouvière, Laurent. Statistical analysis of k-nearest neighbor collaborative recommendation. Ann. Stat., 38(3):1568–1592, 2010. Bresler, Guy, Chen, George H, and Shah, Devavrat. A latent source model for online collaborative filtering. In Advances in Neural Information Processing Systems, pp. 3347–3355. 2014. Bresler, Guy, Shah, Devavrat, and Voloch, Luis F. Regret guarantees for item-item collaborative filtering. arXiv:1507.05371, 2015. Bubeck, Sébastien and Cesa-Bianchi, Nicolò. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5, 2012. Dabeer, O. Adaptive collaborating filtering: The low noise regime. In IEEE International Symposium on Information Theory, pp. 1197–1201, 2013. Deshpande, Yash and Montanari, Andrea. Linear bandits in high dimension and recommendation systems. In Annual Allerton Conference on Communication, Control, and Computing, pp. 1750–1754, October 2012. Ekstrand, Michael D., Riedl, John T., and Konstan, Joseph A. Collaborative filtering recommender systems. Found. Trends Hum.-Comput. Interact., 4(2):81– 173, 2011. Harper, F. Maxwell and Konstan, Joseph A. The MovieLens datasets: History and context. ACM Trans. Interact. Intell. Syst., 5(4):19:1–19:19, 2015. Heckel, Reinhard, Vlachos, Michail, Parnell, Thomas, and Dünner, Celestine. Scalable and interpretable product recommendations via overlapping co-clustering. In IEEE International Conference on Data Engineering, 2017. Online One-Class Collaborative Filtering Hu, Yifan, Koren, Yehuda, and Volinsky, Chris. Collaborative filtering for implicit feedback datasets. In IEEE International Conference on Data Mining, pp. 263–272, 2008. Kveton, Branislav, Szepesvari, Csaba, Wen, Zheng, and Ashkan, Azin. Cascading Bandits: Learning to Rank in the Cascade Model. In International Conference on Machine Learning, pp. 767–776, 2015. Pan, Rong, Zhou, Yunhong, Cao, Bin, Liu, N.N., Lukose, R., Scholz, M., and Yang, Qiang. One-class collaborative filtering. In IEEE International Conference on Data Mining, pp. 502–511, 2008. Pandey, Sandeep, Chakrabarti, Deepayan, and Agarwal, Deepak. Multi-armed Bandit Problems with Dependent Arms. In International Conference on Machine Learning, ICML ’07, pp. 721–728, New York, NY, USA, 2007. Sarwar, Badrul, Karypis, George, Konstan, Joseph, and Riedl, John. Analysis of recommendation algorithms for e-commerce. In ACM Conference on Electronic Commerce, pp. 158–167, 2000. Online One-Class Collaborative Filtering Supplementary Material for “The Sample Complexity of Online One-Class Collaborative Filtering” 6. Proof of Theorem 1 Theorem 1 follows immediately from the following result. N Theorem 2 Suppose that there are at least 2K users of the same type, for all user types, and assume that at least a fraction ν of all items is likable to a given user, for all users. Moreover, suppose that for some γ ∈ [0, 1), all users satisfy condition (1). Pick δ > 0 and suppose that the number of nearest neighbors k, the batch size Q, and the parameter η, are 9N , η ≤ ν/2, chosen such that k ≤ 40K k 64 log(8M/δ) , ≥ Q p f ∆2 (7) and Q≥ 10 log(4/δ). ν (8) Then the reward accumulated by the User-CF algorithm up to time T ∈ [Tstart , 45 νM pf ] with 1     1−α Q 88 , log 512 max log 4N k∆ δ    = 1 2 2 (3pf (1 − γ)2 ν) 1−α 1 − max T1 , ηQ  Tstart satisfies E [reward(T )] ≥ NT  Tstart (T − Tstart )1−α 1− − 2α − max T T (1 − α)  1 2 , T ηQ  (1 − δ). (9) Theorem 1 follows by choosing the parameter of the User-CF algorithm as follows: η= ν , 2 k= 9 N , 40 K and Q = k pf ∆2 . 64 log(8M/δ) To see this, note that by definition, the conditions (7) on Q are satisfied. By (4), condition (8)  on k and η and condition  0 4N Q 2 K c log(M/δ) 88 holds and ηQ = N pf ∆2 . Moreover, max log k∆ , log δ ≤ c̃ log(N/δ). 6.1. Proof of Theorem 2 Theorem 2 is proven by showing that at time t ≥ Tstart the following holds for all users u: i) the neighborhood of u is sufficiently well explored by similarity exploration steps so that most of the nearest neighbors of u are good, i.e., are of the same user type as u (similarly, neighbors are called bad if they are of a different user type than u), t − 1 correctly predict whether i is likable by u or not, ii) for t ≥ Tstart , the estimates p̂ui , for all i ∈ Qq , q = 0, . . . , ηQ and t iii) there exist items in the sets Qq , q = 0, . . . , ηQ − 1 that are likable by u and that have not been rated by u at previous times steps. Conditions i, ii, and iii guarantee that an exploitation step recommends a likable item. Formally, we start by defining the following events: Gβ (t) = {At time t, no more than βk of the k-nearest neighbors of u are bad}, (10) Online One-Class Collaborative Filtering L(t) ={at time t, there exists an item i ∈ Qq , q = 0, . . . , t/(ηQ) − 1 that is likable by u}, (11) and [ E(t) = Eq (t), (12) t q=0,..., ηQ −1 with Eq (t) ={Conditioned on G ∆ (t), for all i ∈ Qq , 4Q p̂ui > pf /2, if pui > 1/2 + ∆, and p̂ui < pf /2, if pui < 1/2 − ∆}. (13) For convenience, we omit in the notion of L(t), Gβ (t), E(t), and Eq (t) the dependence on u. The significance of those definitions is that if L(t), G ∆ (t), and E(t) hold simultaneously, then the recommendation made to user u by an exploitation 4Q step at time t is likable. We can therefore lower-bound the reward E [reward(T )] as follows: T −1 N −1  E [reward(T )] 1 XX  P Xui(u,t) = 1 = NT N T t=0 u=0 ≥ N −1 1 X N T u=0 T −1 X   P [exploitation at t] P Xui(u,t) = 1|exploitation at t (14) t=0,t∈{ηQq / : q=0,1,...} N −1 1 X ≥ N u=0   T −1   1 X 1 2 (1 − (2/t)α )P Xui(u,t) = 1|exploitation at t − max , T t=0 T ηQ !   N −1 T −1 1 2 1 X 1 X (1 − δ)(1 − (2/t)α ) − max , ≥ N u=0 T T ηQ t=Tstart    Tstart 1 2 (T − Tstart )1−α ≥ (1 − δ) 1 − − 2α − max , . T T (1 − α) T ηQ Here, (14) follows from   P Xui(u,t) = 1|preference exploration at t ≥ 0 ! (15) (16) (17)   and P Xui(u,t) = 1|similarity exploration at t ≥ 0. For (15) we used, for t 6= ηQq, P [exploration at t] = 1 − (t − bt/(ηQ)c)−α ≥ 1 − (t(1 − 1/(ηQ)))−α ≥ 1 − (2/t)α which follows from ηQ ≥ 2. Moreover we used for (15) that the fraction of preference exploration steps up to time T is at 2 ). To see that, note that at T ∈ {ηQq, . . . , ηQ(q + 1)} we have performed q + 1 preference exploration most max( T1 , ηQ q+1 2 steps. It follows that, for q ≥ 1, the fraction of preference exploration steps performed up to T is given by qηQ ≤ ηQ . 1 2 Thus, for any T ≥ 1, the fraction of preference exploration steps is ≤ max( T , ηQ ). Equality (16) follows from h i   P Xui(u,t) = 1|exploitation at t ≥ P E(t) ∩ G ∆ (t) ∩ L(t) 4Q ≥ 1 − δ. Here, inequality (18) holds for t ≥ Tstart and is established below. Finally, inequality (17) follows from T −1 X t−α ≤ Z T −1 Tstart −1 t=Tstart = t−α = 1 1−α T −1 t |t=Tstart −1 1−α (T − 1)1−α − (Tstart − 1)1−α (T − Tstart )1−α ≤ . 1−α 1−α (18) Online One-Class Collaborative Filtering It remains to establish (18). To this end, define for notational convenience    Q , log 256 max log 4N k∆ A := 2 3pf (1 − γ)2 ν 88 δ  , and let Ts be the number of similarity exploration steps executed up to time T . Inequality (18) follows by noting that, for all t ≥ Tstart , by the union bound, i h h i c P (E(t) ∩ G ∆ (t) ∩ L(t)) ≤ P [E c (t)] + P G c∆ (t) + P [Lc (t)] 4Q 4Q h i ≤ P [E c (t)] + P G c∆ (t)|Ts ≥ A + P [Ts ≤ A] + P [Lc (t)] (19) 4Q δ δ δ δ ≤ + + + = δ. 4 4 4 4 Here, inequality (19) follows since for two events C, B we have that (20) P [C] = P [C ∩ B] + P [C ∩ B c ] = P [C|B] P [B] + P [C|B c ] P [B c ] ≤ P [C|B] + P [B c ] . (21) Inequality (20) follows from h P G c∆ 4Q P [E c (t)] ≤ δ/4 i (t)|Ts ≥ A ≤ δ/4 (23) P [Ts ≤ A] ≤ δ/4 (24) P [Lc (t)] ≤ δ/4. (25) (22) In the remainder of this proof, we establish the inequalities (22)-(25). The key ingredient for these bounds are concentration inequalities, in particular a version of Bernstein’s inequality (Bardenet & Maillard, 2015). Proof of (22): By the union bound, we have, for all t = 0, . . . , M − 1, that M/Q−1 P [E c (t)] ≤ X q=0   δ P Eqc (t) ≤ 4   δQ as desired. Here, we used P Eqc (t) ≤ 4M , which follows from Lemma 1 stated below with δ 0 = that the assumption (26) of Lemma 1 is implied by the assumption (7) of Theorem 2). δQ 4M and Tr = 1 (note Lemma 1 (Preference exploration) Suppose we recommend Tr random items to each user, chosen uniformly at random from a set Q ⊆ [M ] of Q items. Suppose that pvi is ∆-bounded away from 1/2, for all i ∈ Q and for all v ∈ Nu , where 0 r Nu is a set of k users, of which no more than βk, with β ≤ ∆T 4Q , of the users are of a different type than u. Fix δ > 0. If Tr k pf ∆2 ≥1 Q 64 log(2Q/δ 0 ) then, with probability at least 1 − δ 0 , for all i ∈ Q, p̂ui > Proof of (23): neighbors. pf 2 if pui ≥ 1/2 + ∆ and p̂ui < (26) pf 2 if pui ≤ 1/2 − ∆. Inequality (23) follows from Lemma 2 below, which ensures that a user has many good and only few bad Lemma 2 (Many good and few bad neighbors) Let Tu be the subsets of all users [N ] that are of the same type of u and N suppose its cardinality satisfies ≥ 2K . Suppose that, for some constant γ ∈ [0, 1), condition (1) holds, and that the number 9N of nearest neighbors k satisfies k ≤ 40K . Choose β ∈ (0, 1), and suppose Ts ≥ 64 log(N/(βk)) 1 3p2f (1 − γ)2 M minv∈Tu hpu , pv i (27) 3 2 2 1 similarity exploration steps have been performed. Then, with probability at least 1 − 11e− 64 Ts pf (1−γ) M minv∈Tu hpu ,pv i , the set of nearest neighbors Nu of user u (defined in Section 3), contains no more than βk bad neighbors. Online One-Class Collaborative Filtering To see that inequality (23) follows from Lemma 2, we first note that Ts ≥ A guarantees that condition (27) of Lemma 2 is ∆ satisfied (with β = 4Q ). To see this, note that since each user likes at least a fraction ν of the items, we have 1 min hpu , pv i ≥ ν M v∈Tu  Lemma 2 therefore implies i h 2 2 1 3 P G c∆ (t)|Ts ≥ A ≤ 11e− 64 Ts pf (1−γ) M 1 +∆ 2 2 ≥ minv∈Tu hpu ,pv i ν . 4 (28) ≤ 11e− log(88/δ) = 4Q δ , 8 as desired. For the second inequality above we used (28) and Ts ≥ A. Proof of (24): We next establish the inequality P [Ts ≤ A] ≤ δ/4. To this end, recall that a similarity exploration step is carried out at t = 0, . . . , T − 1, t 6= ηQq, q = 0, 1, . . . with probability 1/(t − bt/(ηQ)c). Recall from the discussion 2 ). below inequality (17), that the fraction of time steps up to time T for which t = ηQq, for some q, is at most max( T1 , ηQ It follows that the number of similarity exploration steps, Ts , carried out after t ≥ Tstart steps of the User-CF algorithm, PT̃ 2 stochastically dominates the random variable S = t=1 Zt , T̃ = Tstart (1 − max( T1 , ηQ )), where Zt is a binary random α variable with P [Zt = 1] = 1/t . It follows that h i T̃ 1−α P [Ts ≤ A] = P Ts ≤ T̃ 1−α /2 ≤ e− 20 ≤ δ/4, (29) where the first inequality holds by definition of Tstart , i.e.,    1 1 2 , Tstart = (2A) 1−α / 1 − max , T ηQ and the second inequality holds by Lemma 3 stated below. Finally, the last inequality in (29) follows from 1 T̃ = (2A) 1−α ≥ 128 log(44/δ). 3 The following lemma appears in (Bresler et al., 2014). Lemma 3 Let S = PT̃ t=1 Zt where Zt is a binary random variable with P [Zt = 1] = 1/tα , α ∈ (0, 4/7). We have that h i T̃ 1−α P ST ≤ T̃ 1−α /2 ≤ e− 20 . Proof of (25): Suppose t < ηQ, consider user u, and let N0 be the total number of items likable by u in the set Q0 (recall that Q0 is choosen uniformly at random from the subset of items [M ] of cardinality Q). Note that N0 > ηQ implies that at t < ηQ, there exist items that are likable by u in Q0 that have not been recommended to u yet. Therefore, we can upper bound the probability that no likable items are left to recommend, for t < ηQ, by P [Lc (t)] ≤ P [N0 ≤ ηQ] ≤ P [N0 ≤ Qν/2] ≤ P [N0 ≤ E [N0 ] − Qν/2] ≤e −Q (ν/2)2 2ν(1−ν)+ 2 ν 3 2 =e −Q ν/4 2(1−ν)+ 1 3 ν ≤ e−Q 10 ≤ (30) δ . 4 (31) Here, the first inequality in (30) follows from η ≤ ν/2, by assumption; the second inequality in (30) follows from E [N0 ] ≥ νQ (since at least a fraction of ν of the items is likable by u), the first inequality in (31) follows from Bernstein’s inequality (Bardenet & Maillard, 2015), and finally the last inequality in (30) holds by assumption (8). We have established that P [Lc (t)] ≤ δ/4, for t < ηQ. Using the exact same line of arguments yields the same bound for t ∈ [ηQ, ηM ]. It remains to upper bound P [Lc (t)] for t ∈ [ηM, 45 νM pf ]. To this end, let Nuc (T ) be the number of (likable) items that have been rated by user u after T time steps, and note that if Nuc (T ) is strictly smaller than the (minimum) number of likable items, then there are likable items left to recommend. Formally, P [Lc (t)] ≤ P [Nuc (T ) ≥ νM ] (32) Online One-Class Collaborative Filtering where we used that for each user u, at least νM items are likable. Recall that with probability pui pf ≤ pf a likable item i is rated if it is recommended to u. Once rated, an item is not recommended again. Note that Nuc (T ) is statistically dominated by a sum of independent binary random variables Zt with P [Zt = 1] = pf . We therefore have that h T p2 Tstart p2 pf i δ f f (33) P [Nuc (T ) ≥ νM ] ≤ P Nuc (T ) ≥ T (pf + ) ≤ e− 2 ≤ e− 2 ≤ . 4 4 Here, the first inequality holds by the assumption T ≤ 54 νM pf , the second inequality follows by Hoeffding’s inequality, the third inequality follows by T ≥ Tstart , and the last inequality follows from Tstart ≥ p22 log(4/δ), which holds by definition f of Tstart . Application of (33) on (32) concludes the proof of P [Lc (t)] ≤ δ/4. 6.2. Proof of Lemma 2 M Recall that rsim is the vector containing the responses Rui of user u to previous similarity exploration steps up to u ∈ {0, 1} time t, and that we assume in Lemma 2, that Ts similarity exploration steps have been performed up to time t. To establish sim Lemma 2, we show that there are more than k users v that are of the same user type as u and satisfy T1s rsim ≥ θ, u , rv 1 sim sim and at the same time, there are fewer than kβ users of a different user type as u that satisfy Ts ru , rv ≥ θ for a certain threshold θ chosen below. This is accomplished by the following two lemmas. N users of the type as user u (including u), and suppose Lemma 4 (Many good neighbors) Suppose there are at least 2K that Ts similarity exploration steps have been performed. Then, with probability at least 1 − 10pgood , 2 3 pgood := e− 16 Ts pg (1−θ/pg ) , at least 9N 40K users v of the same user type as u obey 1 Ts pg := p2f 1 min hpu , pv i , M v∈Tu sim ≥ θ. rsim u , rv Lemma 5 (Few bad neighbors) Suppose that Ts similarity exploration steps have been performed. Then, with probability at least 1 − pbad , where T p (θ/pb −1)2 /4 1 − s b pbad = e 1+(θ/pb −1)/3 , pb := p2f max hpv , pu i , v ∈T / u M at most N pbad users v of a different user type than u obey 1 Ts sim ≥ θ. rsim u , rv We set pg + pb . 2 9N With this choice, by Lemma 4, there are more than 40K ≥ k (the inequality holds by assumption) users v of the same type 1 sim sim as u that satisfy Ts ru , rv ≥ θ, with probability at least 1 − 10pgood . By Lemma 5, there are no more than N pbad sim ≥ θ. Thus, by the union bound, Nu contains less than pbad N bad users v of a different type as u with T1s rsim u , rv neighbors with probability at least θ= 2 3 1 − 10pgood − pbad ≥ 1 − 11e− 64 Ts pg (1−γ) . Here, we used 2 3 2 3 pgood = e− 64 Ts pg (1−pb /pg ) ≤ e− 64 Ts pg (1−γ) where the inequality follows by pb /pg ≤ γ, by (1). Moreover, we used pbad = e − Ts pb (θ/pb −1)2 /4 1+(θ/pb −1)/3 =e − Ts pb (pg /pb −1)2 /16 1+(pg /pb −1)/6 √ =e − Ts p g ( √ pg /pb − pb /pg )2 /16 1+(pg /pb −1)/6 ≤ e− √ √ Ts pg ( 1/γ− γ)2 /16 1+(1/γ−1)/6 √ ≤ e− √ 2 Ts pg ( 1/γ− γ)2 /16 =e−Ts pg (1−γ) /16 1+(1/γ−1) . (34) Here, the first inequality follows from the absolute value of the exponent being decreasing in pb /pg , and from the assumption pb /pg ≤ γ, by (1). To conclude the proof, we needed to establish that the maximum number of bad neighbors N pbad satisfies N pbad ≤ βk. This follows directly by noting that, by assumption (27), the RHS of (34) is upper-bounded by βk N . Online One-Class Collaborative Filtering 6.2.1. P ROOF OF L EMMA 4 N Consider u and assume there are exactly 2K users from the same user type. There could be more, but it is sufficient to N sim consider 2K . Let v be of the same user type. We start by showing that T1s rsim ≥ θ with high probability. To u , rv P T −1 s sim this end, note that rsim , r = R R where π is the random permutation of the item space drawn by uπ(t) vπ(t) u v t=0 the User-CF algorithm at initialization, and Ruπ(t) Rvπ(t) is a binary random variable, independent across t, with success 1 probability p2f puπ(t) pvπ(t) . Setting a := p2f M hpu , pv i, for notational convenience, it follows that     1 sim sim 1 sim sim P ru , rv ≤ θ = P ru , rv ≤ a − (a − θ) (35) Ts Ts Ts (a−θ)2 /2 ≤ e− a+(a−θ)/3 =e ≤e (36) Ts a(1−θ/a)2 /2 − 1+(1−θ/a)/3 3 ≤ e− 8 Ts a(1−θ/a) − 38 Ts pg (1−θ/pg )2 2 (37) ≤ pgood . (38) Here, (36) follows from Bernstein’s inequality (Bardenet & Maillard, 2015), and for (38) we used that the RHS of (37) is decreasing in a. Next, consider the random variable W = X  Gv , Gv = 1 v∈Tu  1 sim sim r , rv ≥ θ , Ts u where Tu is the subset of all users [N ] that are of the same time as user u, as before. By Chebyshev’s inequality,   Var(W ) E [W ] P W − E [W ] ≤ − ≤ . 2 (E [W ] /2)2 Since there are at least N 2K users of the same type, the carnality of Tu is lower bounded by   N E [W ] ≥ (1 − pgood ) −1 . 2K Next, we upper bound the variance of W . We have X Var(W ) = Var(Gv ) + v∈Tu With Gv = G2v , X N 2K − 1. It follows with (38) that Cov(Gv , Gw ). v,w∈Tu ,v6=w   2 Var(Gv ) = E G2v − E [Gv ] = E [Gv ] (1 − E [Gv ]) ≤ 1 − E [Gv ] ≤ pgood . Similarly, Cov(Gv , Gw ) = E [Gv Gw ] − E [Gv ] E [Gw ] ≤ 1 − (1 − q)2 ≤ 2pgood . Thus, we obtain  Var(W ) ≤      2 N N N N − 1 pgood + −1 − 2 2pgood ≤ − 1 2pgood . 2K 2K 2K 2K Plugging this into (39) yields   E [W ] 8pgood P W − E [W ] ≤ − ≤ ≤ 10pgood , 2 (1 − pgood )2 for pgood ≤ 1/10. It follows that the number of good neighbors is larger than W ≥ E [W ] /2 ≥ (1 − pgood ) with probability at least 1 − 10pgood . N 9N ≥ 4K 40K (39) Online One-Class Collaborative Filtering 6.2.2. P ROOF OF L EMMA 5 Let u and v be two fixed users of different user types. Similarly as in the proof Lemma 4, we start by showing that PTof s −1 1 sim sim sim sim r , r ≤ θ with high probability. To this end, note that r , r = u v u v t=0 Ruπ(t) Rvπ(t) where π is a random Ts permutation of the item space and Ruπ(t) Rvπ(t) is a binary random variable, independent across t, with success probability 1 hpu , pv i, for notational convenience, it follows that p2f puπ(t) pvπ(t) . Setting a = p2f M     1 sim sim 1 sim sim P r , rv ≥ θ = P r , rv0 ≥ a + (θ − a) Ts u Ts u Ts (θ−a)2 /2 ≤ e− a+(θ−a)/3 ≤e T pb (θ/pb −1)2 /2 − s1+(θ/p b −1)/3 (40) = p2bad . (41) Here, (40) follows from Bernstein’s inequality. Specifically, we use that π is a random permutation of the item space as well as that Rui Rvi are binary random variables independent across i (note that Bernstein’s inequality also applies to sampling without replacement, see e.g., (Bardenet & Maillard, 2015)). Finally, for inequality (41), we used that a ≤ pb = 1 p2f maxv∈T / u M hpv , pu i. P 2 Set Nbad = v ∈T / u 1 {u and v are declared neighbors}. By inequality (41), we have E [Nbad ] ≤ pbad N. Thus, by Markov’s inequality, E [Nbad ] p2 N P [Nbad ≥ N pbad ] ≤ ≤ bad = pbad , N pbad N pbad which concludes the proof. 6.3. Proof of Lemma 1 (preference exploration) Assume w.l.o.g. that pui > 1/2 + ∆, for all i ∈ Q. The case where some of the pui satisfy pui < 1/2 −  ∆ is treated analogously. To prove Lemma 1, we may further assume that pui = 12 + ∆, for all i ∈ Q, since P p̂ui > p2f is increasing in pui . Consider a fixed item i ∈ Q, and let Nugood be the subset of Nu corresponding to users that are of the same type as u and to which additionally an recommendation has been made by drawing Tr items uniformly from Q for each user u. Let Ng   be the cardinality of Nugood . In order to upper-bound P p̂ui ≤ p2f , we first note that by (21), h h i pf i pf P p̂ui ≤ ≤ P p̂ui ≤ Ng ≥ ng + P [Ng ≤ ng ] . (42) 2 2 Here, we defined ng := Tr k (1/2 − β). Q We next upper bound the probabilities on the RHS of (42). We start with the first probability on the RHS of (42): "P # h i pf pf v∈Nugood Rvi 0 0 P p̂ui ≤ Ng = ng ≤ P ≤ Ng = n g 2 n0g + βk 2   X n0g + βk 1 p f = P 0 Rvi ≤ Ng = n0g  ng 2 n0g good v∈Nu       X 1 1 βk = P 0 Rvi ≤ pf + ∆ − pf ∆ − 0 Ng = n0g  ng 2 2ng good v∈Nu       X  1 βk = P Rvi − pf +∆ ≤ −n0g pf ∆ − 0 Ng = n0g  2 2n g good (43) (44) v∈Nu n0 p (∆−βk/(2n0 ))2 /2 ≤e g f g − (1/2+∆)+(∆−βk/(2n 0 ))/3 g (45) Online One-Class Collaborative Filtering where (44) follows from the number of users nui in Nu that received recommendation i being upper bounded by Ng + βk (recall that βk is the maximum number of bad neighbors in Nu ), and by assuming adversarially that all recommendations given to bad neighbors did yield Rvi = 0. Finally, (45) follows from Bernstein’s inequality; to apply Bernstein’s inequality, we used that E [Rvi ] = pf (1/2 + ∆), and that the variance of Rvi is upper bounded by pf (1/2 + ∆), for v ∈ Nugood . Next, note that by Bayes theorem, P [p̂ui ≤ 1/2|Ng ≥ ng ] = = P [{p̂ui ≤ 1/2} ∩ {Ng ≥ ng }] P [Ng ≥ ng ]     P 0 n0g ≥ng P p̂ui ≤ 1/2 Ng ≥ ng P Ng = ng ≤e ≤e P [Ng ≥ ng ] ng pf (∆−βk/(2n0g ))2 /2 − (1/2+∆)+(∆−βk/(2n 0 ))/3 g ng pf ∆2 /8 − 1/2+∆+∆/6 ≤e n pf ∆ 2 − g 16 (46) ≤e T kpf ∆2 − r Q64 . (47) Here, inequality (46) follows from inequality (45) and using that the RHS of inequality (45) is increasing in n0g . For inequality (47) we used the definition of ng in (43), and that βk = ng Here, the inequality (48) holds by β ≤ recommend each item at most once). ∆Tr 4Q , βk Tr k Q (1/2 − β) = Q β ≤ ∆. Tr 1/2 − β (48) by assumption, and β ≤ 1/4, due to ∆ ≤ 1/2 and Tr ≤ Q (since we We proceed with upper bounding P [Ng ≤ ng ] in (42). Recall that Ng is the number of times item i has been recommended to one of the ≥ (1 − β)k good neighbors in Nu . We will only consider the Tr random items recommended to each user; this yields an upper bound on P [Ng ≤ ng ]. Recall that those items are chosen from the Q items in Q, and that, by assumption, of the k neighbors at least (1 − β)k are good. By Bernstein’s inequality,   (1 − β)k Tr k − P [Ng ≤ ng ] = P Ng ≤ Tr Q 2Q − Tr k( 1 )2 /2 2Q 1−β 1−β (1− )+ 1 1 Q Q 3 2Q − Tr k( 1 )2 /2 2Q 1−β 1−β (1− )+ 1 1 Q Q 3 2Q ≤ e− Tr k 1 8Q 1+1/6 Tr k ≤ e− 10Q . (49) Application of inequalities (47) and (49) to inequality (42) together with a union bound yields   T kpf ∆2 Tr kpf ∆2 Tr k − 10Q − r Q64 P [p̂ui ≤ 1/2, for one or more i ∈ Q] ≤ Q e +e ≤ 2Qe− Q64 , (50) ≤e ≤e where we used that pf ∆2 ≤ 1. By (26), the RHS above is smaller than δ 0 . This concludes the proof. 7. Proof of Proposition 1 Consider a set of users with K user types that are non-overlapping in their preferences, specifically, consider a set of users where every user u belonging to the k-th user type has preference vector ( 1, if i ∈ [k(M − 1)/K, . . . , kM/K] [pu ]i = 0, otherwise. Consider a given user u. At time T , the expected number of ratings obtained by u is upper bounded by p2f . Thus, for all T ≤ pλ2 in at least a fraction λ of the runs of the algorithm, the algorithm has no information on the user u, and the f best it can do is to recommend a random item. For our choice of preference vectors, with probability at most 1/K, it will recommend a likable item. Therefore, an upper bound on the expected regret is given by (λ + 1/K)N T .
7cs.IT
arXiv:1705.01838v1 [math.AG] 4 May 2017 ON PERMUTATIONS INDUCED BY TAME AUTOMORPHISMS OVER FINITE FIELDS KEISUKE HAKUTA Abstract. The present paper deals with permutations induced by tame automorphisms over finite fields. The first main result is a formula for determining the sign of the permutation induced by a given elementary automorphism over a finite field. The second main result is a formula for determining the sign of the permutation induced by a given affine automorphism over a finite field. We also give a combining method of the above two formulae to determine the sign of the permutation induced by a given triangular automorphism over a finite field. As a result, for a given tame automorphism over a finite field, if we know a decomposition of the tame automorphism into a finite number of affine automorphisms and elementary automorphisms, then one can easily determine the sign of the permutation induced by the tame automorphism. 1. Introduction Let k be a field and let k[X1 , . . . , Xn ] be a polynomial ring in n indeterminates over k. An n-tuple of polynomials F = (f1 , . . . , fn ) is called a polynomial map, when fi belongs to k[X1 , . . . , Xn ] for all i, 1 ≤ i ≤ n. A polynomial map F = (f1 , . . . , fn ) can be viewed as a map from k n to itself by defining F (a1 , . . . , an ) = (f1 (a1 , . . . , an ), . . . , fn (a1 , . . . , an )) (1.1) n for (a1 , . . . , an ) ∈ k . The set of polynomial maps over k and the set of maps from k n to itself are denoted by MAn (k) and Maps(k n , k n ), respectively. Then by (1.1), we see that there exists a natural map π : MAn (k) → Maps(k n , k n ). MAn (k) (resp. Maps(k n , k n )) is a semi-group with respect to the composition of polynomial maps (resp. maps). Moreover, these two semi-groups are monoids with the identity maps as neutral elements, and the map π is a monoid homomorphism. Let GAn (k) be the subset of invertible elements in MAn (k). An element in GAn (k) is called a polynomial automorphism. A polynomial automorphism F = (f1 , . . . , fn ) is said to be affine when deg fi = 1 for i = 1, . . . , n. A polynomial map Eai of the form Eai = (X1 , . . . , Xi−1 , Xi + ai , Xi+1 , . . . , Xn ), ai ∈ k[X1 , . . . , X̂i , . . . , Xn ] = k[X1 , . . . , Xi−1 , Xi+1 , . . . , Xn ], (1.2) = E−ai . A polynomial automoris also a polynomial automorphism since Ea−1 i phism Eai of form (1.2) is said to be elementary. Let Aff n (k) denote the set of Date: May 4, 2017. 2010 Mathematics Subject Classification. Primary: 14R10; Secondary: 12E20, 20B25. Key words and phrases. Affine algebraic geometry, polynomial automorphism, tame automorphism, finite field, permutation. 1 all affine automorphisms, and let EAn (k) denote the set of all elementary automorphisms. Aff n (k) and EAn (k) are subgroups of GAn (k). We put TAn (k) := hAff n (k), EAn (k)i, where hH1 , H2 i is a subgroup of a group G generated by two subgroups H1 , H2 ⊂ G. Then TAn (k) is also a subgroup of GAn (k) and is called the tame subgroup. If τ ∈ TAn (k) then τ is called tame automorphism, and otherwise (i.e., τ ∈ GAn (k) \ TAn (k)) τ is called wild automorphism. A polynomial automorphism Ja,f of the form Ja,f = (a1 X1 + f1 (X2 , . . . , Xn ), a2 X2 + f2 (X3 , . . . , Xn ), . . . , an Xn + fn ) , ai ∈ k (i = 1, . . . , n) , fi ∈ k[Xi+1 , . . . , Xn ] (i = 1, . . . , n − 1) , fn ∈ k, is called de Jonquières automorphism (or triangular automorphism). From the definition, triangular automorphism is trivially polynomial automorphism. The set of all elements of the form Ja,f is denoted by BAn (k): BAn (k) := {Ja,f ∈ GAn (k) | ai ∈ k (i = 1, . . . , n) , fi ∈ k[Xi+1 , . . . , Xn ] (i = 1, . . . , n − 1) , fn ∈ k}. BAn (k) is a subgroup of GAn (k). BAn (k) is also a subgroup of TAn (k), and it is known that TAn (k) = hAff n (k), BAn (k)i (cf. [2, Exercises for § 5.1 – 1, 2]). The Tame Generators Problem asks whether GAn (k) = TAn (k), and is related to the famous Jacobian conjecture. Tame Generators Problem. GAn (k) = TAn (k)? For any field k, we denote the characteristic of the field k by p = char(k). If k is a finite field Fq with q elements (p = char(Fq ), q = pm , and m ≥ 1), we use the symbol πq instead of π: πq : MAn (Fq ) → Maps(Fnq , Fnq ). The map πq induces a group homomorphism πq : GAn (Fq ) → Sym(Fnq ), where Sym(S) is a symmetric group on a finite set S. Let sgn : Sym(S) → {±1} be the sign function. The sign function sgn is a group homomorphism, and Ker(sgn) = Alt(S), where Alt(S) is the alternating group on S. Recall that for any subgroup G ⊆ GAn (Fq ), πq (G) is a subgroup of Sym(Fnq ). In the case where k = Fq , we can consider a slightly different problem from the Tame Generators Problem, namely, it is natural to investigate the subgroup πq (G) of Sym(Fnq ). This problem has first been investigated in the case G = TAn (Fq ) by Maubach [3]. Indeed, Maubach proved the following theorem ([3, Theorem 2.3]) and proposed a following problem ([4, page 3, Problem]): Theorem 1. ([3, Theorem 2.3]) If n ≥ 2, then πq (TAn (Fq )) = Sym(Fnq ) if q is odd or q = 2. If q = 2m where m ≥ 2 then πq (TAn (Fq )) = Alt(Fnq ). Question 1. ([4, page 3, Problem]) For q = 2m and m ≥ 2, do there exist polynomial automorphisms such that the permutations induced by the polynomial automorphisms belong to Sym(Fnq ) \ Alt(Fnq )? 2 If there exists F ∈ GAn (F2m ) such that π2m (F ) ∈ Sym(Fn2m ) \ Alt(Fn2m ), then we must have F ∈ GAn (F2m ) \ TAn (F2m ), namely, F is a wild automorphism. Thus, Question 1 is a quite important problem for the Tame Generators Problem in positive characteristic. Furthermore, we refer the reader to [5, Section 1.2] for several questions related to [3, Theorem 2.3]. The present paper deals with permutations induced by tame automorphisms over finite fields. We address the following questions related to [3, Theorem 2.3] which is a little different from the questions in [5, Section 1.2]. Question 2. For a given tame automorphism φ ∈ TAn (Fq ), how to determine the sign of the permutation induced by φ? (how to determine sgn(πq (φ))?) Question 3. Suppose that G is a subgroup of GAn (Fq ). What are sufficient conditions on G such that the inclusion relation πq (G) ⊂ Alt(Fnq ) holds? Question 2 seems to be natural since if q 6= 2m (m ≥ 2), one can not determine the sign of the permutation induced by a given tame automorphism over a finite field from [3, Theorem 2.3]. The information about sign of the permutations might be useful for studying the Tame Generators Problem, Question 1, or other related questions such as [4, page 5, Conjecture 4.1], [4, page 5, Conjecture 4.2] and so on. Question 3 also seems to be natural since if q 6= 2m (m ≥ 2) and G 6= TAn (Fq ), one can not obtain any sufficient condition for the inclusion relation πq (G) ⊂ Alt(Fnq ) from [3, Theorem 2.3]. The contributions of the present paper are as follows. The first main result is a formula for determining the sign of the permutation induced by a given elementary automorphism over a finite field (Section 3, Main Theorem 1). Our method to determine the sign of the permutation induced by a given elementary automorphism over a finite field, is based on group theory. As a consequence of Main Theorem 1, one can derive a sufficient condition for the inclusion relation πq (EAn (Fq )) ⊂ Alt(Fnq ) (Section 3, Corollary 1). The second main result is a formula for determining the sign of the permutation induced by a given affine automorphism over a finite field (Section 4, Main Theorem 2). Our method to determine the sign of the permutation induced by a given affine automorphism over a finite field, is based on linear algebra. As a consequence of Main Theorem 2, one can also derive a sufficient condition for the inclusion relation πq (Aff n (Fq )) ⊂ Alt(Fnq ) (Section 4, Corollary 2). Section 5 gives a combining method of Main Theorem 1 and Main Theorem 2 to determine the sign of the permutation induced by a given triangular automorphism over a finite field (Section 5, Corollary 3). As a result, for a given tame automorphism over a finite field, if we know a decomposition of the tame automorphism into a finite number of affine automorphisms and elementary automorphisms, then one can easily determine the sign of the permutation induced by the tame automorphism (Section 5, Corollary 5). The rest of this paper is organized as follows. In Section 2, we fix our notation. In Section 3, we give a method to determine the sign of the permutation induced by a given elementary automorphism over a finite field. In Section 4, we give a method to determine the sign of the permutation induced by a given affine automorphism over a finite field. Section 5 deals with how to determine the sign of the permutation induced by a given triangular automorphism and a given tame automorphism over a finite field. 3 2. Notation Throughout this paper, we use the following notation. For any field k, we denote the characteristic of the field k by p = char(k). We denote the multiplicative group of a field k by k ∗ = k \ {0}. We use the symbols Z, C, Fq to represent the rational integer ring, the field of complex numbers, and a finite field with q elements (p = char(Fq ), q = pm , m ≥ 1). We denote the set of non-negative integers by Z≥0 . For a group G and g ∈ G, ordG (g) is the order of g, namely, ordG (g) is the smallest non-negative integer x that holds g x = 1G , where 1G is the identity element in the group G. We denote by GLn (k) the set of invertible matrices with entries in k. The polynomial ring n indeterminates over k is denoted by k[X1 , . . . , Xn ]. We denote the polynomial ring k[X1 , . . . , Xi−1 , Xi+1 , . . . , Xn ] (omit the indeterminate Xi ) by k[X1 , . . . , X̂i , . . . , Xn ]. Let MAn (k) be the set of polynomial maps over k. MAn (k) is a monoid with respect to the composition of polynomial maps, and the neutral elements of the monoid MAn (k) is the identity map. We denote the subset of invertible elements in MAn (k), the set of all affine automorphisms, the set of all elementary automorphisms, and the set of all triangular automorphisms by GAn (k), Aff n (k), EAn (k), and BAn (k), respectively. GAn (k) is a group with respect to the composition of polynomial automorphisms, and Aff n (k), EAn (k) are subgroups of GAn (k). Recall that Aff n (k) ∼ = GLn (k) ⋉ k n . (2.1) For a finite set S, we denote the cardinality of S by ♯S, and denote the symmetric group on S and the alternating group on S by Sym(S) and Alt(S), respectively. Let S = {s1 , . . . , sn }, ♯S = n, and σ ∈ Sym(S). For σ ∈ Sym(S),   s1 s2 ··· sn σ= , sσ(1) sσ(2) · · · sσ(n) means that σ (si ) = sσ(i) for 1 ≤ i ≤ n. For σ, τ ∈ Sym(S), we denote by τ ◦ σ the composition   s1 s2 ··· sn τ ◦σ = . sτ (σ(1)) sτ (σ(2)) · · · sτ (σ(n)) The permutation on S defined by S ∈ −→ ∈ S si si1 7−→ si 7−→ si2 .. . sir−1 sir 7−→ sir 7−→ si1 if i 6∈ {i1 , . . . , ir } is called the cycle of length r and is denoted by (i1 i2 . . . ir ). Let δ : R → R be a function satisfying that δ (x) = 0 when x = 0, and δ (x) = 1 when x 6= 0. Let χ : F∗q → C∗ be a non-trivial multiplicative character of order ℓ. We extend χ to Fq by defining χ (0) = 0. 4 3. Sign of permutations induced by elementary automorphisms In this section, we consider the sign of permutations induced by elementary automorphisms over finite fields. The main result of this section is as follows. (q) Main Theorem 1. (Sign of elementary automorphisms) Suppose that Eai is an elementary automorphism over a finite field, namely, = (X1 , . . . , Xi−1 , Xi + ai , Xi+1 , . . . , Xn ) ∈ EAn (Fq ) , Ea(q) i (3.1) and ai ∈ Fq [X1 , . . . , X̂i , . . . , Xn ]. If q is odd or q = 2m , m ≥ 2 then we have (q) πq Eai ∈ Alt(Fnq ). Namely, if q is odd or q = 2m , m ≥ 2 then    sgn πq Ea(q) = 1. (3.2) i    (q) depends only on the number of monomials of the If q = 2 then sgn πq Eai e e i+1 i−1 · · ·Xnen with c ∈ F∗q and e1 , . . . , en ≥ 1 appearing in the form cX1e1 · · ·Xi−1 Xi+1    (q) = (−1)Mai , where polynomial ai . More precisely, if q = 2 then sgn πq Eai e e i+1 i−1 · · ·Xnen with c ∈ F∗q Xi+1 Mai is the number of monomials of the form cX1e1 · · ·Xi−1 and e1 , . . . , en ≥ 1 appearing in the polynomial ai . Proof. It suffices to assume that ai ∈ Fq [X1 , . . . , X̂i , . . . , Xn ] is a monomial (Similar discussion can be found in [3, page 96, Proof of Theorem 5.2.1]). Let ci ∈ Fq , Nî := n−1 (e1 , . . . , eˆi , . . . , en ≥ {1, . . . , i − 1, i + 1, . . . , n}, and e := (e1 , . . . , eˆi , . . . , en ) ∈ Z≥0 Q ej 0). We put ai = ci 1≤j≤n Xj and j6=i Ec(q) i ,e := X1 , . . . , Xi−1 , Xi + ci Y e Xj j , Xi+1 , . . . , Xn 1≤j≤n j6=i = X1 , . . . , Xi−1 , Xi + ci Y e Xj j , Xi+1 , . . . , Xn j∈Nî ! ! ∈ EAn (Fq ) .    (q) In the following, we determine the value of sgn πq Eci ,e by decomposing the   (q) permutation πq Eci ,e as a product of transpositions. Let y1 , . . . , yi−1 , yi+1 , . . . , yn be elements of Fq . We put y = (y1 , . . . , yi−1 , yi+1 , . . . , yn ) ∈ Fqn−1 . For y ∈ Fqn−1 , (q) we define the map λci ,e,y as follows: Fnq Fnq ∈ −→ ∈ (q) λci ,e,y : (x1 , . . . , xn ) (x1 , . . . , xn ) 7−→ (x1 , . . . , xn ) if ∃j ∈ Nî s.t. xj 6= yj , (q) 7−→ Eci ,e (x1 , . . . , xn ) xj = yj for all j ∈ Nî . (q) It follows from the definition of the map λci ,e,y that λc(q) (x1 , . . . , xn ) = (x1 , . . . , xn ) i ,e,y for each (x1 , . . . , xn ) ∈ Fnq \ {(y1 , . . . , yi−1 , y, yi+1 , . . . , yn ) | y ∈ Fq } and λc(q) (x1 , . . . , xn ) = Ec(q) (x1 , . . . , xn ) i ,e,y i ,e 5 for each (x1 , . . . , xn ) ∈ {(y1 , . . . , yi−1 , y, yi+1 , . . . , yn ) | y ∈ Fq }. Thus the map (q) (q) (q) (q) λci ,e,y is bijective and the inverse of λci ,e,y is λ−ci ,e,y . Remark that λci ,e,y is the identity map if and only if e = (0, . . . , 0) and ci = 0, or there exists j ∈ Nî such that ej 6= 0 and yj = 0. Put   n o n (q) B λc(q) := (x , . . . , x ) ∈ F λ (x , . . . , x ) = 6 (x , . . . , x ) . 1 n n 1 n q ci ,e,y 1 i ,e,y Since     (q) B λc(q) ∩ B λ =∅ ′ ci ,e,y i ,e,y  ′ ′ 6 y, the permutation for any y′ = y1′ , . . . , yi−1 , yi+1 , . . . , yn′ ∈ Fqn−1 satisfying y′ =   (q) πq Eci ,e can be written as     Y  λc(q) = πq  πq Ec(q) i ,e,y i ,e y1 ,...,yi−1 ,yi+1 ,...,yn ∈Fq Y = y1 ,...,yi−1 ,yi+1 ,...,yn ∈Fq   , πq λc(q) ,e,y i (3.3) which is a composition of disjoint permutations on Fnq . We denote the number of distinct permutations other than the identity map in the right-hand side of Equation (3.3) by M1 . It is straightforward to check that M1 satisfies the equation Y ℓ M1 = χ (ci ) × (q − δ (ej )) . (3.4) j∈Nî   (q) Next, we decompose each permutation πq λci ,e,y as a composition of disjoint cycles on Fnq . In order to find such a decomposition, we define an equivalence relation ∼ on Fq : y ∈ Fq and y ′ ∈ Fq are equivalent  if and only if there exists Q ej ′ l ∈ {0, 1, . . . , p − 1} such that y = y + l ci j∈N yj . Note that the equivalence î relation ∼ depends on the choice of y1 , . . . , yi−1 , yi+1 , . . . , yn . Put Cy := {y ′ ∈ Fq | y ∼ y ′ }. We now choose a complete system of representatives R for the above equivalence relation ∼. Since R is a complete system of representatives, it follows that ♯R = q/p = pm /p = pm−1 . We write R := {w1 , . . . , wpm−1 } ⊂ Fq . For any ws ∈ R (1 ≤ s ≤ pm−1 ), we set yws := (y1 , . . . , yi−1 , ws , yi+1 , . . . , yn ). We (q) define the bijective map λci ,e,yws as follows: Fnq −→ (x1 , . . . , xn ) (x1 , . . . , xn ) ∈ Fnq ∈ (q) λci ,e,yws : 7−→ (x1 , . . . , xn ) if ∃j ∈ Nî s.t. xj 6= yj , or xi 6∈ Cws , (q) 7 → Eci ,e (x1 , . . . , xn ) − xj = yj for all j ∈ Nî and xi ∈ Cws . 6 (q) Note that the map λci ,e,yws is a cycle of length p, and the standard result from elementary group theory yields that its sign is (−1)p−1 , namely,    p−1 = (−1) . (3.5) sgn πq λc(q) i ,e,yws (q) We also remark that the map λci ,e,yws is the identity map if and only if e = (0, . . . , 0) and ci = 0, or there exists j ∈ Nî such that ej 6= 0 and yj = 0. If 1 ≤ s1 , s2 ≤ pm−1 and s1 6= s2 , then we have Cws1 ∩ Cws2 = ∅. This yields a decomposition of the permutation πq (λci ,y ) into a composition of disjoint cycles on Fnq :  m−1  m−1 pY pY     (q) (q) . (3.6) πq λc(q) λci ,e,yws  = πq λci ,e,y = πq  i ,e,yws s=1 s=1 We denote the number of disjoint cycles other than the identify map in Equation (3.6) by M2 . By counting the number of disjoint cycles appearing in Equation (3.6), we have ℓ M2 = χ (ci ) × pm−1 .  (3.7)  (q) Eci ,e . By Equation (3.3) Now we determine the sign of the permutation πq through Equation (3.7), we obtain    = (−1)M , sgn πq Ec(q) i ,e where M = M1 × M2 × (p − 1) ℓ = χ (ci ) × p m−1 × (p − 1) × Y j∈Nî  (q − δ (ej )) . (3.8) If q is odd (and thus p is odd) or q = 2m , m ≥ 2, we have M ≡ 0 mod 2 and Q ℓ if q = 2 (namely, p = 2 and m = 1), we have M ≡ χ (ci ) × j∈N δ (ej ) mod 2. î   (q) Therefore if q is odd or q = 2m , m ≥ 2 then πq Eci ,e ∈ Alt(Fnq ). Hence, we      (q) (q) = 1. On the other hand, if have πq Eai ∈ Alt(Fnq ), namely, sgn πq Eai       ℓ Q χ(ci ) × j∈N δ(ej ) (q) (q) î = −1 = (−1) . Thus, sgn πq Eci ,e q = 2 then sgn πq Eci ,e    Q (q) if and only if ci 6= 0 and j∈N δ (ej ) = 1, or more generally, sgn πq Eai = −1 î e e i+1 i−1 · · ·Xnen with if and only if the number of monomials of the form cX1e1 · · ·Xi−1 Xi+1 ∗ c ∈ Fq and e1 , . . . , en ≥ 1 appearing in the polynomial ai , is odd. This completes the proof.  Corollary 1. If q is odd or q = 2m , m ≥ 2 then we have πq (EAn (Fq )) ⊂ Alt(Fnq ). Remark 1. Let θ : Fq → C be a map satisfying that θ (c) = 0 when c = 0, and θ (c) = 1 when c ∈ F∗q . Then one can also prove Main Theorem 1 by replacing ℓ χ (ci ) with θ (ci ) in the proof of Main Theorem 1. Remark 2. Note that Main Theorem 1 is similar to [5, Lemma 6.4], but Main Theorem 1 is more general result than [5, Lemma 6.4]. 7 Example 1. Let ai := αX1 · · · Xi−1 Xi+1 · · · Xn , bi := βX12 X2 · · · Xi−1 Xi+1 · · · Xn ∈ Fq [X1 , . . . , X̂i , . . . , Xn ], and α, β ∈ F∗q . We consider the sign of the permutations induced by the following elementary automorphisms: = (X1 , . . . , Xi−1 , Xi + ai , Xi+1 , . . . , Xn ) ∈ EAn (Fq ) , Ea(q) i (q) Ebi = (X1 , . . . , Xi−1 , Xi + bi , Xi+1 , . . . , Xn ) ∈ EAn (Fq ) , and (q) Eai +bi = (X1 , . . . , Xi−1 , Xi + ai + bi , Xi+1 , . . . , Xn ) ∈ EAn (Fq ) . m We first assume q is odd or , m ≥ 2. Then by Main Theorem 1,  q = 2   that  (q) (q) = 1. By the fact that πq and sgn = sgn πq Ebi we have sgn πq Eai       (q) (q) × = sgn πq Eai are group homomorphisms, we also have sgn πq Eai +bi    (q) = 1. We next suppose that q = 2. Since α, β ∈ F∗q , we remark that sgn πq Ebi       (q) (q) = = sgn πq Ebi α = β = 1. From Main Theorem 1, we have sgn πq Eai −1.  Again, by the fact that πq and homomorphisms, we obtain   sgn are group (q) (q) (q) sgn πq Eai +bi = sgn πq Eai ×sgn πq Ebi = 1. We can directly prove      (q) (q) = 1 by using the fact that πq Eai +bi = πq ((X1 , . . . , Xn )). that sgn πq Eai +bi 4. Sign of permutations induced by affine automorphisms In this section, we consider the sign of permutations induced by affine automorg (q) phisms over finite fields. Suppose that Ab is an affine automorphism over a finite field, where, ! ! ! n n X X g (q) (4.1) an,i Xi + bn ∈ Aff n (Fq ) , a1,i Xi + b1 , . . . , Ab := i=1 i=1 and ai,j , bi ∈ Fq for 1 ≤ i, j ≤ n. We also assume that A(q) is the homogeneous part (linear automorphism) of the affine automorphism (4.1), namely, ! n n X X (4.2) an,i Xi ∈ Aff n (Fq ) . a1,i Xi , . . . , A(q) = i=1 i=1 By Equation (2.1) and by Main Theorem 1, we obtain       g (q) = sgn πq A(q) . sgn πq Ab (4.3) Thus, it is sufficient to consider the sign of affine automorphisms over finite field of the form (4.2). We put Ti,j := (X1 , . . . , Xi−1 , Xj , Xi+1 , . . . , Xj−1 , Xi , Xj+1 , . . . , Xn ) ∈ Aff n (Fq ) , (4.4) Di (c) := (X1 , . . . , Xi−1 , cXi , Xi+1 , . . . , Xn ) ∈ Aff n (Fq ) , (4.5) Ri,j (c) := (X1 , . . . , Xi−1 , Xi + cXj , Xi+1 , . . . , Xn ) ∈ Aff n (Fq ) , (4.6) and where c ∈ F∗q . It is easy to see that 2 Ti,j := Ti,j ◦ Ti,j = (X1 , . . . , Xn ) , 8 q−1 Di (c) := Di (c) ◦ · · · ◦ Di (c) = (X1 , . . . , Xn ) , | {z } q − 1 times and p Ri,j (c) := Ri,j (c) ◦ · · · ◦ Ri,j (c) = (X1 , . . . , Xn ) . {z } | p times Since each invertible matrix is a product of elementary matrices ([1, Proposition 2.18]), a linear automorphism can be written as a finite composition of linear automorphisms of form (4.4), (4.5), and (4.6). Namely, there exists ℓA ∈ Z≥0 and (A) (A) linear automorphisms M1 , . . . , MℓA such that (A) A(q) = M1 (A) ◦ · · · ◦ M ℓA , (4.7) (A) where Mi is a linear automorphism of form (4.4), (4.5), or (4.6) for each i (1 ≤ i ≤ ℓA ). We remark that the representation (4.7) is not unique in general. Since πq and sgn are group homomorphisms, we obtain   (q) sgn πq A  = ℓA Y i=1    (A) . sgn πq Mi (4.8) Therefore, it is sufficient to consider the sign of the permutation induced by a linear automorphism of form (4.4), (4.5), and (4.6). We use for the symbols NT (A), ND (A), and NR (A) to represent the number of linear automorphisms of form (4.4), (4.5), and (4.6) appearing in (4.7), respectively. Then we have NT (A) + ND (A) + NR (A) = ℓA . o n (A) (A) Furthermore, we suppose that i1 , . . . , iND (A) is the subset of {1, . . . , ℓA } satisfying the following two conditions:   (A) (A) (A) (A) (i): There exist uj ∈ {1, . . . , n} and cj ∈ F∗q such that M (A) = Du(A) cj ij j for 1 ≤ j ≤ ND (A). (A) (A) (A) (ii): For i ∈ {1, . . . , ℓA } \ {i1 , . . . , iND (A) }, Mi is of form (4.4) or (4.6). In the following, we determine the sign of permutations induced by the above three types of linear automorphisms of form (4.4), (4.5), and (4.6). Lemma 1. (Sign of πq (Ti,j )) Suppose that Ti,j ∈ Aff n (Fq ) is a linear automorphism of form (4.4). If n ≥ 2, then  (q = 2m , m ≥ 2 or q = 2, n ≥ 3) ,  1 (q = 2 and n = 2) , sgn (πq (Ti,j )) = −1 (4.9)  q−1  (−1) 2 (q is odd) . Proof. Put B (Ti,j ) := {(x1 , . . . , xn ) ∈ Fnq | Ti,j ((x1 , . . . , xn )) 6= (x1 , . . . , xn )} = {(x1 , . . . , xn ) ∈ Fnq | xi 6= xj }. Since B (Ti,j ) = Fnq \ {(x1 , . . . , xn ) ∈ Fnq | xi = xj }, 9 we have ♯B (Ti,j ) = q n − q n−2 × q = q n−1 (q − 1). Hence one can see that the permutation πq (Ti,j ) is a compositon of q n−1 (q − 1) /2 transpositions on Fnq . We write NTi,j = q n−1 (q − 1) /2. Case 1. q = 2m , m ≥ 2. Since q n−1 /2 = 2m(n−1)−1 ≥ 2, we have NTi,j ≡ 0 mod 2. Therefore, πq (Ti,j ) is an even permutation. Case 2. q = 2. In this case, we see that NTi,j = 2n−2 . If n ≥ 3, we obtain NTi,j ≡ 0 mod 2. Otherwise NTi,j = 1. Case 3. q is odd. If q is odd then q ≡ 1 mod 4 or q ≡ 3 mod 4. From this fact, we obtain ( 0 (q ≡ 1 mod 4) , q−1 ≡ NTi,j ≡ 2 1 (q ≡ 3 mod 4) . Thus, Equation (4.9) holds.  Lemma 2. (Sign of πq (Di (c))) Suppose that Di (c) ∈ Aff n (Fq ) is a linear automorphism of form (4.5). If n ≥ 2, then ( 1 (q is even) , sgn (πq (Di (c))) = (4.10) ordF∗ (c) q (−1) (q is odd) . Proof. Let us suppose that q is even. We assume that sgn (πq (Di (c))) = −1. Since sgn and πq are group homomorphisms, we have    q−1 q−1 q−1 = sgn (πq (Di (c))) = (−1) = −1. sgn πq Di (c) q−1 On the other hand, from Di (c) = (X1 , . . . , Xn ), we must have    q−1 = sgn (πq ((X1 , . . . , Xn ))) = 1. sgn πq Di (c) This is a contradiction. Therefore, sgn (πq (Di (c))) = 1. Next suppose that q is odd. We define the map Hc : Fq → Fq as follows: Hc : F q ∈ Fq ∈ −→ x 7−→ cx. The map Hc is bijective, and the inverse map is Hc−1 . Since we can regard the map Hc as a permutation on Fq , it is obious that sgn (πq (Di (c))) = sgn (Hc ) . Let g be a generator of the multiplicative group F∗q . We put c = g h , 0 ≤ h = ordF∗q (c) ≤ q − 2. If h = 0 then sgn (Hc ) = 1. We assume that h 6= 0. If h = 1 then  the map Hc is the length q − 1 cycle  g 0 g 1 · · · g q−2 as a permutation on Fq , and    hence Hc = g q−3 g q−2 ◦ g q−4 g q−3 ◦ · · · ◦ g 1 g 2 ◦ g 0 g 1 , the product of q − 2 transpositions as a permutation on Fq . This yields that for 1 ≤ h ≤ q− 2, the map Hc is the product of h copies of the length q − 1 cycle g 0 g 1 · · · g q−2 , namely, the product of h × (q − 2) transpositions as a permutation on Fq . Therefore, we obtain 10 h  sgn (Hc ) = (−1)h(q−2) . Since q is odd, it satisfies that (−1)h(q−2) = (−1)q−2 = h (−1) . Hence ordF∗ (c) q sgn (Hc ) = (−1)h = (−1) for c ∈ holds. F∗q , (4.11) c 6= 1. Equation (4.11) is obviously true for c = 1. Thus the assertion  Lemma 3. (Sign of πq (Ri,j (c))) Suppose that Ri,j (c) ∈ Aff n (Fq ) is a linear automorphism of form (4.6). If n ≥ 2, then sgn (πq (Ri,j (c))) = 1. (4.12) Proof. By Ri,j (c) ∈ Aff n (Fq ) ∩ EAn (Fq ) ⊂ EAn (Fq ), it follows immediately from Main Theorem 1.  We are now in the position to prove the main result of this section. Main Theorem 2. (Sign of affine automorphisms) With notation as above, the following assertions are hold: (1) If q = 2m , m ≥ 2 then    g (q) = 1. (4.13) sgn πq Ab (2) If q = 2 and n = 2 then    g (q) = (−1)NT (A) . sgn πq Ab (4.14)    g (q) = 1. sgn πq Ab (4.15) (3) If q = 2 and n ≥ 3 then (4) If q is odd then    PN (A)   (A) D g ordF∗ cj + q−1 (q) 2 NT (A) q = (−1) j=1 sgn πq Ab . In particular, if q ≡ 1 mod 4 then    P   ND (A) (A) g ordF∗ cj (q) q = (−1) j=1 sgn πq Ab . (4.16) (4.17) Proof. The assertions (1) through (4) follow immediately from Equation (4.3), Equation (4.7), and Lemma 1 through Lemma 3. This completes the proof.  Corollary 2. If q = 2m and m ≥ 2, or q = 2 and n ≥ 3 then we have πq (Aff n (Fq )) ⊂ Alt(Fnq ). Remark 3. One can see that Equation (4.14), (4.15), (4.16), and  (4.17)  depend on g (q) is uniquely the representation (4.7) which is not unique. However, since πq Ab    g (q) does not depend on the determined as a permutation on Fnq , sgn πq Ab representation (4.7). 11 Example 2. Let α, β ∈ F∗q . We consider the sign of the permutation induced by the affine automorphism A(q) := (X3 , X2 , αX1 + βX3 ) ∈ Aff 3 (Fq ). It is easy to see that A(q) = (X3 , X2 , X1 ) ◦ (X1 + βX3 , X2 , X3 ) ◦ (αX1 , X2 , X3 ) = T1,3 ◦ R1,3 (β) ◦ D1 (α).We remark that NT (A) = ND (A) = NR (A) = 1, ℓA = 3, and sgn πq A(q) = sgn (πq (T1,3 )) × sgn (πq (R1,3 (β))) × sgn (πq (D1 (α))). If p = 2 then by  Equation (4.13) and by Equation (4.15), one can easily see that sgn πq A(q) = 1. If q is odd then by Equation (4.16),    q−1 ord ∗ (α) = (−1) Fq × (−1) 2 . sgn πq A(q)  ord ∗ (α) In particular, if q ≡ 1 mod 4 then sgn πq A(q) = (−1) Fq , and if q ≡ 3 mod 4  ord ∗ (α) ord ∗ (α)+1 = (−1) Fq . then sgn πq A(q) = −1 × (−1) Fq 5. Sign of permutations induced by triangular automorphisms and tame automorphisms In this section, we consider the sign of permutations induced by triangular automorphisms and tame automorphisms over finite fields. By Main Theorem 1 and Main Theorem 2, we obtain the following corollary (Corollary 3). (q) Corollary 3. (Sign of triangular automorphisms) Suppose that Ja,f is a triangular automorphism over a finite field, namely, (q) Ja,f = (a1 X1 + f1 (X2 , . . . , Xn ), a2 X2 + f2 (X3 , . . . , Xn ), . . . , an Xn + fn ) ∈ BAn (Fq ), ai ∈ Fq (i = 1, . . . , n) , fi ∈ Fq [Xi+1 , . . . , Xn ] (i = 1, . . . , n − 1) , fn ∈ Fq . (5.1)   (q) If q = 2m , m ≥ 2 then πq Ja,f ∈ Alt(Fnq ). Namely, if q = 2m , m ≥ 2 then    (q) = 1. (5.2) sgn πq Ja,f If q is odd then    Pn ord ∗ (a ) (q) (5.3) = (−1) i=1 Fq i . sgn πq Ja,f    (q) depends only on the coefficients In other words, if q is odd then sgn πq Ja,f a1 , . . . , an . If q = 2 then    (q) M = (−1) f1 , (5.4) sgn πq Ja,f where Mf1 is the number of monomials of the form cX2e2 · · ·Xnen with c ∈ F∗q and e2 , . . . , en ≥ 1 appearing in the polynomial f1 ∈ Fq [X2 , . . . , Xn ]. Proof. By using the notation of Equation (3.1) and Equation (4.5), we have (q) (q) (q) Ja,f = Dn (an ) ◦ · · · D1 (a1 ) ◦ Ea−1 f ◦ · · · ◦ Ea−1 f . 1 1 n n Hence we obtain n n     Y   Y (q) (q) . sgn πq Ea−1 f sgn (πq (Di (ai ))) × = sgn πq Ja,f i=1 i=1 i i (5.5) By Equation (5.5), Main Theorem 1, and Main Theorem 2, we obtain the desired results.  12 (q) Corollary 4. (Sign of strictly triangular automorphisms) Suppose that Jf is a strictly triangular automorphism over a finite field, namely, (q) Jf = (X1 + f1 (X2 , . . . , Xn ), X2 + f2 (X3 , . . . , Xn ), . . . , Xn + fn ) ∈ BAn (Fq ), fi ∈ Fq [Xi+1 , . . . , Xn ] (i = 1, . . . , n − 1) , fn ∈ Fq . (5.6)  (q)  ∈ Alt(Fnq ). Namely, if q is odd or If q is odd or q = 2m , m ≥ 2 then πq Jf q = 2m , m ≥ 2 then    (q) = 1. (5.7) sgn πq Jf If q = 2 then    (q) M = (−1) f1 , sgn πq Jf cX2e2 · · ·Xnen where Mf1 is the number of monomials of the form e2 , . . . , en ≥ 1 appearing in the polynomial f1 ∈ Fq [X2 , . . . , Xn ]. (5.8) with c ∈ Proof. It follows immediately from Corollary 3. F∗q and  We recall that for any φ(q) ∈ TAn (Fq ), there exist l ∈ Z≥0 , ǫ1 , ǫ2 ∈ {0, 1} ⊂ Z, ^ (q) As,b(s) ∈ Aff n (Fq ) (1 ≤ s ≤ l + 1) of the form ! ! ! n n X X ^ (s) (s) (s) (q) (s) , an,i Xi + bn a1,i Xi + b1 , . . . , As,b(s) = i=1 i=1 and (q) Js,t(s) ,f (s) such that (q) φ ∈ BAn (Fq ) (1 ≤ s ≤ l) of the form   (q) (s) (s) (s) Js,t(s) ,f (s) = t1 X1 + f1 (X2 , . . . , Xn ), . . . , t(s) , n Xn + f n ^ (q) = A1,b(1) ǫ1 ◦ (q) J1,t(1) ,f (1) ǫ2 ^ ^ (q) (q) (q) ◦ · · · ◦ Al,b(l) ◦ Jl,t(l) ,f (l) ◦ Al+1,b(l+1) , (5.9) ^ (q) (q) As,b(s) 6∈ BAn (Fq ) for 2 ≤ s ≤ l + 1, and Js,t(s) ,f (s) 6∈ Aff n (Fq ) for 1 ≤ s ≤ l (for example, [2, Lemma 5.1.1]). (q) We use the symbol As to denote the homogeneous part (linear automorphism) ^ (q) of the affine automorphism As,b(s) (as in Equation (4.1) and Equation (4.2)) for 1 ≤ s ≤ l + 1. Furthermore, for each s (1 ≤ s ≤ l), we denote by Mf (s) the number 1 of monomials of the form cX2e2 · · ·Xnen with c ∈ F∗q and e2 , . . . , en ≥ 1 appearing in (s) the polynomial f1 ∈ Fq [X2 , . . . , Xn ]. The following corollary (Corollary 5) states that if we know Equation (5.9) for a given φ(q) ∈ TAn (Fq ), then one can easily compute the sign of the permutation induced by φ(q) ∈ TAn (Fq ). Corollary 5. (Sign of tame automorphisms) With notation as above, the following assertions are hold: (1) If q = 2m , m ≥ 2 then    = 1. (5.10) sgn πq φ(q) 13 (2) If q = 2 and n = 2 then P P    ǫ1 NT (A1 )+( ls=2 NT (As ))+ǫ2 NT (Al+1 )+ ℓs=1 M (s) (q) f 1 = (−1) . sgn πq φ (5.11) (3) If q = 2 and n ≥ 3 then Pℓ    s=1 Mf (s) 1 sgn πq φ(q) . = (−1) (5.12) (4) If q is odd then      Pl PND (As ) (A ) ordF∗ cj s q sgn πq φ(q) = (−1) s=2 j=1 ǫ1 PN (A ) 1 D ǫ2 PN (A D l+1 ) × (−1) × (−1) × (−1) j=1   (A ) ordF∗ cj 1 q  (A  ) ordF∗ cj l+1 q j=1 q−1 2 (ǫ1 NT (A1 )+ǫ2 NT (Al+1 )+   P (s) ti 1≤i≤n ordF∗ q × (−1) 1≤s≤l Pl s=2 NT (As )) . (5.13) In particular, if q ≡ 1 mod 4 then      Pl PND (As ) (A ) cj s ordF∗ q = (−1) s=2 j=1 sgn πq φ(q) ǫ1 P ND (A1 ) ǫ2 PN (A D l+1 ) × (−1) × (−1) j=1 P × (−1) j=1 1≤i≤n 1≤s≤l   (A ) ordF∗ cj 1 q  (A  ) ordF∗ cj l+1 q   (s) ordF∗ ti q . (5.14) Proof. By Equation (5.9), we obtain l ǫ1        Y   (q) (q) × sgn πq A1 sgn πq Ai = sgn πq φ(q) i=2 l    ǫ2 Y    (q) (q) sgn πq Ji,t(i) ,f (i) . × × sgn πq Al+1 (5.15) i=1 By Equation (5.15), Main Theorem 2, and Corollary 3, we obtain the desired results.  Remark 4. As in Remark 3, one can see that Equation (5.11), (5.12), (5.13), and (5.14) dependon the representations (4.7) and (5.9) which are not unique. However,  since πq φ(q) is uniquely determined as a permutation on Fnq , sgn πq φ(q) does not depend on the representations (4.7) and (5.9). Remark 5. Suppose that n is greater than or equal to two. Corollary 5 tells us that πq (TAn (Fq )) ⊂ Sym Fnq (this is a trivial inclusion relation) if q is odd or  q = 2, and πq (TAn (Fq )) ⊂ Alt Fnq if q = 2m and m ≥ 2. This indicates that Corollary 5 is strictly weaker than [3, Theorem 2.3]. However, Main Theorem 1, Main Theorem 2, Corollary 3, and Corollary 5 are useful for determining the sign of permutations induced by tame automorphisms over finite fields. The reasons are as follows. Firstly, for q = 2m and m ≥ 2, we prove that πq (TAn (Fq )) ⊂ Alt(Fnq ) 14 by directly showing that πq (EAn (Fq )) ⊂ Alt(Fnq ) and πq (Aff n (Fq )) ⊂ Alt(Fnq ). Secondly, if q is odd then one can not determine the sign of permutation induced by an elementary automorphisms over a finite field by using [3, Theorem 2.3]. In contrast to [3, Theorem 2.3], Main Theorem 1 tells us that if q is odd then each permutation induced by an elementary automorphism over a finite field is even. In other words, if q is odd then πq (EAn (Fq )) ⊂ Alt(Fnq ) (Corollary 1). Similarly, in contrast to [3, Theorem 2.3], Main Theorem 2 tells us that if q = 2 and n ≥ 3 then each permutation induced by an affine automorphism over a finite field is even. Namely, if q = 2 and n ≥ 3 then πq (Aff n (Fq )) ⊂ Alt(Fnq ) (Corollary 2). Thus, our results (Main Theorem 1, Main Theorem 2, Corollary 3, and Corollary 5) and [3, Theorem 2.3] are complementary to each other. Acknowledgements This work was supported by JSPS KAKENHI Grant-in-Aid for Young Scientists (B) 16K16066. References [1] M. Artin, Algebra, Prentice-Hall, 1991. [2] A. van den Essen, Polynomial Automorphisms and the Jacobian Conjecture, Progress in Mathematics, Vol.190, Birkhäuser Verlag, Basel-Boston-Berlin, 2000. [3] S. Maubach, Polynomial automorphisms over finite fields, Serdica Math. J., 27 (2001), no.4, 343–350. [4] S. Maubach, A problem on polynomial maps over finite fields, arXiv preprint (2008), arXiv:0802.0630. [5] S. Maubach and A. Rauf, The profinite polynomial automorphism group, J. Pure Appl. Algebra, 219 (2015), no.10, 4708–4727. Interdisciplinary Graduate School of Science and Engineering, Shimane University, 1060 Nishikawatsu-cho, Matsue, Shimane 690-8504, Japan E-mail address: hakuta(at)cis.shimane-u.ac.jp 15
0math.AC
1 Coarse-graining and the Blackwell Order Johannes Rauh∗ , Pradeep Kr. Banerjee∗ , Eckehard Olbrich∗ , Jürgen Jost∗ , Nils Bertschinger† , and David Wolpert‡§ ∗ Max Planck Institute for Mathematics in the Sciences, Leipzig, Germany {jrauh,pradeep,olbrich,jjost}@mis.mpg.de † Frankfurt Institute for Advanced Studies, Frankfurt, Germany arXiv:1701.07602v3 [cs.IT] 10 Nov 2017 [email protected] ‡ Santa Fe Institute, Santa Fe, NM, USA § MIT, Cambridge, MA, USA [email protected] Abstract Suppose we have a pair of information channels, κ1 , κ2 , with a common input. The Blackwell order is a partial order over channels that compares κ1 and κ2 by the maximal expected utility an agent can obtain when decisions are based on the channel outputs. Equivalently, κ1 is said to be Blackwell-inferior to κ2 if and only if κ1 can be constructed by garbling the output of κ2 . A related partial order stipulates that κ2 is more capable than κ1 if the mutual information between the input and output is larger for κ2 than for κ1 for any distribution over inputs. A Blackwell-inferior channel is necessarily less capable. However, examples are known where κ1 is less capable than κ2 but not Blackwell-inferior. We show that this may even happen when κ1 is constructed by coarse-graining the inputs of κ2 . Such a coarse-graining is a special kind of “pre-garbling” of the channel inputs. This example directly establishes that the expected value of the shared utility function for the coarse-grained channel is larger than it is for the non-coarse-grained channel. This contradicts the intuition that coarse-graining can only destroy information and lead to inferior channels. We also discuss our results in the context of information decompositions. Keywords: Channel preorders; Blackwell order; degradation order; garbling; more capable; coarse-graining I. I NTRODUCTION Suppose we are given the choice of two channels that both provide information about the same random variable, and that we want to make a decision based on the channel outputs. Suppose that our utility function depends on the joint value of the input to the channel and our resultant decision based on the channel outputs. Suppose as well that we know the precise conditional distributions defining the channels, and the distribution over channel inputs. Which channel should we choose? The answer to this question depends on the choice of our utility function as well as on the details of the channels and the input distribution. So for example, without specifying how we will use the channels, in general we cannot just compare their information capacities to choose between them. Nonetheless, for certain pairs of channels we can make our choice, even without knowing the utility functions or the distribution over inputs. Let us represent the two channels by two (column) stochastic matrices κ1 and κ2 , 2 respectively. Then if there exists another stochastic matrix λ such that κ1 = λ · κ2 , there is never any reason to strictly prefer κ1 ; for if we choose κ2 , we can always make our decision by chaining the output of κ2 through the channel λ and then using the same decision function we would have used had we chosen κ1 . This simple argument shows that whatever the three stochastic matrices are and whatever the decision rule we would use if we chose channel κ1 , we can always get the same expected utility by instead choosing channel κ2 with an appropriate decision rule. In this kind of situation, where κ1 = λ · κ2 , we say that κ1 is a garbling (or degradation) of κ2 . It is much more difficult to prove that the converse also holds true: Theorem 1 (Blackwell’s theorem [1]). Let κ1 , κ2 be two stochastic matrices representing two channels with the same input alphabet. Then the following two conditions are equivalent: 1) When the agent chooses κ2 (and uses the decision rule that is optimal for κ2 ), her expected utility is always at least as big as the expected utility when she chooses κ1 (and uses the optimal decision rule for κ1 ), independent of the utility function and the distribution of the input S. 2) κ1 is a garbling of κ2 . Blackwell formulated his result in terms of a statistical decision maker who reacts to the outcome of a statistical experiment. We prefer to speak of a decision problem instead of a statistical experiment. See [2], [3] for an overview. Blackwell’s theorem motivates looking at the following partial order over channels κ1 , κ2 with a common input alphabet: κ1  κ2 :⇐⇒   one of the two statements  in Blackwell’s theorem holds true. We call this partial order the Blackwell order (this partial order is called degradation order by other authors [4], [5]). If κ1  κ2 , then κ1 is said to be Blackwell-inferior to κ2 . Strictly speaking, the Blackwell order is only a preorder, since there are channels κ1 6= κ2 that satisfy κ1  κ2  κ1 (when κ1 arises from κ2 by permuting the output alphabet). However, for our purposes such channels can be considered as equivalent. We write κ1 ≺ κ2 if κ1  κ2 and κ1 6 κ2 . By Blackwell’s theorem this implies that κ2 performs at least as good as κ1 in any decision problem and that there exist decision problems in which κ2 outperforms κ1 . For a given distribution of S, we can also compare κ1 and κ2 by comparing the two mutual informations I(S; X1 ), I(S; X2 ) between the common input S and the channel outputs X1 and X2 . The data processing inequality shows that κ2  κ1 implies I(S; X2 ) ≥ I(S; X1 ). However, the converse implication does not hold. The intuitive reason is that for the Blackwell order, not only the amount of information is important. Rather, the question is how much of the information that κ1 or κ2 preserve is relevant for a given fixed decision problem (that is, a given fixed utility function). Given two channels κ1 , κ2 , suppose that I(S; X2 ) ≥ I(S; X1 ) for all distributions of S. In this case, we say that κ2 is more capable than κ1 . Does this imply that κ1  κ2 ? The answer is known to be negative in general [6]. In Proposition 3 we introduce a new surprising example of this phenomenon with a particular structure. In fact, in this example, κ1 is a Markov approximation of κ2 by a deterministic function, in the following sense: Consider another 3 random variable f (S) that arises from S by applying a (deterministic) function f . Given two random variables S, X, denote by X ← S the channel defined by the conditional probabilities PX|S (x|s), and let κ2 := (X ← S) and κ1 := (X ← f (S)) · (f (S) ← S). Thus, κ1 can be interpreted as first replacing S by f (S) and then sampling X according to the conditional distribution PX|S (x|f (s)). Which channel is superior? Using the data processing inequality, it is easy to see that κ1 is less capable than κ2 . However, as Proposition 3 shows, in general κ1 6 κ2 . We call κ1 a Markov approximation, because the output of κ1 is independent of the input S given f (S). The channel κ1 can also be obtained from κ2 by “pre-garbling” (Lemma 5); that is, there is another stochastic matrix λf that satisfies κ1 = κ2 · λf . It is known that pre-garbling may improve the performance of a channel (but not its capacity) as we recall in Section II. What may be surprising is that this can happen for pre-garblings of the form λf , which have the effect of coarse-graining according to f . The fact that the more capable preorder does not imply the Blackwell order shows that “Shannon information,” as captured by the mutual information, is not the same as “Blackwell information,” as needed for the Blackwell decision problems. Indeed, our example explicitly shows that even though coarse-graining always reduces Shannon information, it need not reduce Blackwell information. Finally, let us mention that there are further ways of comparing channels (or stochastic matrices); see [5] for an overview. Proposition 3 builds upon another effect that we find paradoxical: Namely, there exist random variables S, X1 , X2 and there exists a function f : S → S 0 from the support of S to a finite set S 0 such that the following holds: 1) S and X1 are independent given f (S). 2) (X1 ← f (S))  (X2 ← f (S)). 3) (X1 ← S) 6 (X2 ← S). Statement 1) says that everything X1 knows about S, it knows through f (S). Statement 2) says that X2 knows more about f (S) than X1 . Still, 3) says that we cannot conclude that X2 knows more about S than X1 . The paradox illustrates that it is difficult to formalize what it means to “know more.” Understanding the Blackwell order is an important aspect of understanding information decompositions; that is, the quest to find new information measures that separate different aspects of the mutual information I(S; X1 , . . . , Xk ) of k random variables X1 , . . . , Xk and a target variable S (see the other contributions of this special issue and references therein). In particular, [7] argues that the Blackwell order provides a natural criterion when a variable X1 has unique information about S with respect to X2 . We hope that the examples we present here are useful in developing intuition on how information can be shared among random variables and how it behaves when applying a deterministic function, such as a coarse-graining. Further implications of our examples on information decompositions are discussed in [8]. In the converse direction, information decomposition measures (such as measures of unique information) can be used to study the Blackwell order and deviations from the Blackwell order. We illustrate this idea in Example 4. The remainder of this work is organized as follows: In Section II, we recall how pre-garbling can be used to improve the performance of a channel. We also show that the pre-garbled channel will always be less capable 4 and that simultaneous pre-garbling of both channels preserves the Blackwell order. In Section III, we state a few properties of the Blackwell order, and we explain why we find these properties counter-intuitive and paradoxical. In particular, we show that coarse-graining the input can improve the performance of a channel. Section IV contains a detailed discussion of an example that illustrates these properties. In Section V we use the unqiue information measure from [7], which has properties similar to the Le Cam’s deficiency, to illustrate deviations from the Blackwell relation. II. P RE - GARBLING As discussed above (and as made formal in Blackwell’s theorem (Theorem 1)), garbling the output of a channel (“post-garbling”) never increases the quality of a channel. On the other hand, garbling the input of a channel (“pre-garbling”) may increase the performance of a channel, as the following example shows. Example 1. Suppose that an agent can choose an action from a finite set A. She then receives a utility u(a, s) that depends both on the chosen action a ∈ A and on the value s of a    0.9 0 0  and κ2 = κ1 ·  κ1 =  0.1 1 1 random variable S. Consider the channels    1 0 0.9 = , 0 1 0.1 and the utility function s 0 0 1 1 a 0 1 0 1 u(s, a) 2 0 0 1 For uniform input the optimal decision rule for κ1 is a(0) = 0, a(1) = 1 and the opposite a(0) = 1, a(1) = 0 for κ2 . The expected utility with κ1 is 1.4, while using κ2 , it is slightly higher, 1.45. It is also not difficult to check that neither of the two channels is a garbling of the other (cf. Prop. 3.22 in [5]). The intuitive reason for the difference in the expected utilities is that the channel κ2 transmits one of the states without noise and the other state with noise. With a convenient pre-processing, it is possible to make sure that the relevant information for choosing an action and for optimizing expected utility is transmitted with less noise. Note the symmetry of the example: Each of the two channels arises from the other by a convenient pre-processing, since the pre-processing is invertible. Hence, the two channels are not comparable by the Blackwell order. In contrast, two channels that only differ by an invertible garbling of the output are equivalent with respect to the Blackwell order. The pre-garbling in Example 1 is invertible, and so it is more aptly described as a pre-processing. In general, though, pure pre-garbling and pure pre-processing are not easily distinguishable, and it is easy to perturb Example 1 5 by adding noise without changing the conclusion. In Section III, we will present an example in which the pregarbling consists of coarse-graining. It is much more difficult to understand how coarse-graining can be used as sensible pre-processing. Even though pre-garbling can make a channel better (or, more precisely, more suited for a particular decision problem at hand), pre-garbling cannot invert the Blackwell order: Lemma 1. If κ1 ≺ κ2 · λ, then κ1 6 κ2 . Proof. Suppose that κ1 ≺ κ2 · λ. Then the capacity of κ1 is less than the capacity of κ2 · λ, which is bounded by the capacity of κ2 . Therefore, the capacity of κ1 is less than the capacity of κ2 . Also, it follows directly from Blackwell’s theorem that κ1  κ2 implies κ1 · λ  κ2 · λ for any channel λ, where the input and output alphabets of λ equal the input alphabet of κ1 , κ2 . Thus, pre-garbling preserves the Blackwell order when applied to both channels simultaneously. Finally, let us remark that certain kinds of simultaneous pre-garbling can also be “hidden” in the utility function: Namely, in Blackwell’s theorem, it is not necessary to vary the distribution of S, as long as the support of the (fixed) input distribution has full support S (that is, every state of the input alphabet of κ1 and κ2 appears with positive probability). In this setting, it suffices to look only at different utility functions. When the input distribution is fixed, it is more convenient to think in terms of random variables instead of channels, which slightly changes the interpretation of the decision problem. Suppose we are given random variables S, X1 , X2 and a utility function u(a, s) depending on the value of S and an action a ∈ A as above. If we cannot look at both X1 and X2 , should we rather look at X1 or at X2 to take our decision? Theorem 2 (Blackwell’s theorem for random variables [7]). The following two conditions are equivalent: 1) Under the optimal decision rule, when the agent chooses X2 , her expected utility is always at least as big as the expected utility when she chooses X1 , independent of the utility function. 2) (X1 ← S)  (X2 ← S). III. P RE - GARBLING BY COARSE - GRAINING In this section we present a few counter-intuitive properties of the Blackwell order. Proposition 2. There exist random variables S, X1 , X2 and a function f : S → S 0 from the support of S to a finite set S 0 such that the following holds: 1) S and X1 are independent given f (S). 2) (X1 ← f (S)) ≺ (X2 ← f (S)). 3) (X1 ← S) 6 (X2 ← S). 6 This result may at first seem paradoxical. After all, property 3) implies that there exists a decision problem involving S for which it is better to use X1 than X2 . Property 1) implies that any information that X1 has about S is contained in X1 ’s information about f (S). One would therefore expect that, from the viewpoint of X1 , any decision problem in which the task is to predict S and to react on S looks like a decision problem in which the task is to react to f (S). But property 2) implies that for such a decision problem, it may in fact be better to look at X2 . Proof of Proposition 2. The proof is by Example 2, which will be given in Section IV. This example satisfies 1) S and X1 are independent given f (S). 2) (X1 ← f (S))  (X2 ← f (S)). 3) (X1 ← S) 6 (X2 ← S). It only remains to show that it is possible to also achieve the strict relation (X1 ← f (S)) ≺ (X2 ← f (S)) in the second statement. This can easily be done by adding a small garbling to the channel X1 ← f (S) (e.g. by adding a binary symmetric channel with sufficiently small noise parameter ). This ensures (X1 ← f (S)) ≺ (X2 ← f (S)), and if the garbling is small enough, this does not destroy the property (X1 ← S) 6 (X2 ← S). The example from Proposition 2 also leads to the following paradoxical property: Proposition 3. There exist random variables S, X and there exists a function f : S → S 0 from the support of S to a finite set S 0 such that the following holds: (X ← f (S)) · (f (S) ← S) 6 X ← S. Let us again give a heuristic argument why we find this property paradoxical. Namely, the combined channel (X ← f (S)) · (f (S) ← S) can be seen as a Markov chain approximation of the direct channel X ← S that corresponds to replacing the conditional distribution PX|S (x|s) = X PX|Sf (S) (x|s, f (s))Pf (S)|S (f (s)|s). f (s) by X PX|f (S) (x|f (s))Pf (S)|S (f (s)|s). f (s) Proposition 3 together with Blackwell’s theorem states that there exist situations where this approximation is better than the correct channel. Proof of Proposition 3. Let S, X1 , X2 be as in Example 2 in Section IV that also proves Proposition 2, and let X = X2 . In that example, the two channels X1 ← f (S) and X2 ← f (S) are equal. Moreover, X1 and S are independent given f (S). Thus, (X ← f (S)) · (f (S) ← S) = (X1 ← S). Therefore, the statement follows from (X1 ← S) 6 (X2 ← S). On the other hand, the channel (X ← f (S)) · (f (S) ← S) is always less capable than X ← S: 7 Lemma 4. For any random variables S, X, and function f : S → S, the channel (X ← f (S)) · (f (S) ← S) is less capable than X ← S. Proof. For any distribution of S, let X 0 be the output of the channel (X ← f (S)) · (f (S) ← S). Then, X 0 is independent of S given f (S). On the other hand, since f is a deterministic function, X 0 is independent of f (S) given S. Together, this implies I(S; X 0 ) = I(f (S); X 0 ). Using the fact that the joint distributions of (X, f (S)) and (X 0 , f (S)) are identical and applying the data processing inequality gives I(S; X 0 ) = I(f (S); X 0 ) = I(f (S); X) ≤ I(S; X). The setting of Proposition 3 can also be understood as a specific kind of pre-garbling. Namely, consider the channel λf defined by λfs0 ,s := PS|f (S) (s0 |f (s)). The effect of this channel can be characterized as a randomization of the input: The precise value of S is forgotten, and only the value of f (S) is preserved. Then a new value s0 is sampled for S according to the conditional distribution of S given f (S). Lemma 5. (X ← f (S)) · (f (S) ← S) = (X ← S) · λf . Proof. X PX|S (x|s1 )PS|f (S) (s1 |f (s)) = X s1 PX|S (x|s1 )PS|f (S) (s1 |t)Pf (S)|S (t|s) s1 ,t = X PX|f (S) (x|t)Pf (S)|S (t|s), t where we have used that X − S − f (S) forms a Markov chain. While it is easy to understand that pre-garbling can be advantageous in general (since it can work as preprocessing), we find surprising that this can also happen in the case where the pre-garbling is done in terms of a function f ; that is, in terms of a channel λf that does coarse-graining. IV. E XAMPLES Example 2. Consider the joint distribution f (s) s x1 x2 Pf (S)SX1 X2 0 0 0 0 1/4 0 1 0 1 1/4 0 0 1 0 1/8 0 1 1 0 1/8 1 2 1 1 1/4 and the function f : {0, 1, 2} → {0, 1} with f (0) = f (1) = 0 and f (2) = 1. Then X1 and X2 are independent uniform binary random variables, and f (S) = A ND(X1 , X2 ). By symmetry, the joint distributions of the pairs 8 (f (S), X1 ) and (f (S), X2 ) are identical, and so the two channels X1 ← f (S) and X2 ← f (S) are identical. In particular (X1 ← f (S))  (X2 ← f (S)). On the other hand, consider the utility function s a u(s, a) 0 0 0 0 1 0 1 0 1 1 1 0 2 0 0 2 1 1 To compute the optimal decision rule, let us look at the conditional distributions: s x1 PS|X1 (s|x1 ) s x2 PS|X2 (s|x2 ) 0 0 1/2 0 0 3/4 1 0 1/2 1 0 1/4 0 1 1/4 0 1 0 1 1 1/4 1 1 1/2 2 1 1/2 2 1 1/2 The optimal decision rule for X1 is a(0) = 0, a(1) = 1, with expected utility uX1 := 1/2 · 1/2 + 1/2 · 1/2 = 1/2. The optimal decision rule for X2 is a(0) = 0, a(1) ∈ {0, 1} (this is not unique in this case), with expected utility uX2 := 1/2 · 1/4 + 1/2 · 1/2 = 3/8 < 1/2. How can we understand this example? Some observations: • It is easy to see that X2 has more irrelevant information than X1 : namely, X2 can determine relatively precisely when S = 0. However, since S = 0 gives no utility independent of the action, this information is not relevant. It is more difficult to understand why X2 has less relevant information than X1 . Surprisingly, X1 can determine more precisely when S = 1: If S = 1, then X1 “detects this” (in the sense that X1 chooses action 0) with probability 2/3. For X2 , the same probability is only 1/3. • The conditional entropies of S given X2 are smaller than the conditional entropies of S given X1 : H(S|X1 = 0) = log(2), H(S|X2 = 0) = 2 log(2) − • H(S|X1 = 1) = 3 2 log(3) ≈ 0.4150375 log(2), 3 2 log(2), H(S|X2 = 1) = log(2). One can see in which sense f (S) captures the relevant information for X1 , and indeed for the whole decision problem: knowing f (S) is completely sufficient in order to receive the maximal utility for each state of S. However, when information is incomplete, it matters how the information about the different states of S is 9 mixed, and two variables X1 , X2 that have the same joint distribution with f (S) may perform differently. It is somewhat surprising that it is the random variable that has less information about S and that is conditionally independent of S given f (S) which actually performs better. Example 2 is different from the pre-garbling Example 1 discussed in Section II. In the latter, both channels had the same amount of information (mutual information) about S, but for the given decision problem the information provided by κ2 was more relevant than the information provide by κ1 . The first difference in Example 2 is that X1 has less mutual information about S than X2 (Lemma 4). Moreover, both channels are identical with respect to f (S), i.e. they provide the same information about f (S), and for X1 it is the only information it has about S. So, one could argue that X2 has additional information, that does not help though, but decreases the expected utility instead. We give another example which shows that X2 can also be chosen a deterministic function of S. Example 3. Consider the joint distribution f (s) s x1 x2 Pf (S)SX1 X2 0 0 0 0 1/6 0 0 1 0 1/6 0 1 0 1 1/6 0 1 1 1 1/6 1 2 1 1 1/3 The function f is as above, but now also X2 is a function of S. Again, the two channels X1 ← f (S) and X2 ← f (S) are identical, and X1 is independent of S given f (S). Consider the utility function s a u(s, a) 0 0 0 0 1 0 1 0 0 1 1 1 2 0 0 2 1 −1 One can show that it is optimal for agent who relies on X2 to always choose action 0, which brings no reward (and no loss). However, when the agent knows that X1 is zero, he may safely choose action 1 and has a positive probability of receiving a positive reward. To add another interpretation to the last example, we visualize the situation in the following Bayesian network: X ← S → f (S) → X 0 , where, as in Proposition 3 and its proof, we let X = X2 , and we consider X 0 = X1 as an approximation of X. Then S denotes the state of the system that we are interested in, and X denotes a given set of observables of 10 interest. f (S) can be considered as a “proxy” in situations where it is difficult to observe X directly. For example, in neuroimaging, instead of directly measuring the neural activity X, one might look at an MRI signal f (S). In economic and social sciences, monetary measures like the GDP are used as a proxy for prosperity. A decision problem can always be considered as a classification problem defined by the utility u(s, a) by considering the optimal action as the class label of state S. Proposition 3 now says that there exist S, X, f (S) and a classifcation problem u(s, a), such that the approximated features X 0 (simulated from f (S)) allow for a better classification (higher utility) than the original features X. In such a situation, looking at f (S) will always be better than looking at either X or X 0 . Thus, the paradox will only play a role in situations where it is not possible to base the decision on f (S) directly. For example, f (S) might still be too large, or X might have a more natural interpretation, making it easier to interpret for the decision taker. But, when it is better to base a decision on a proxy rather than directly on the observable of interest, this interpretation may be erroneous. V. I NFORMATION DECOMPOSITION AND L E C AM DEFICIENCY Given two channels κ1 , κ2 , how can one decide whether or not κ1  κ2 ? The easiest way is to check whether the equation κ1 = λ · κ2 has a solution λ that is a stochastic matrix. In the finite alphabet case, this amounts to checking feasibility of a linear program, which is considered computationally easy. However, when the feasibility check returns a negative result, this approach does not give any more information, e.g. how far κ1 is away from being a garbling of κ2 . A function that quantifies how far κ1 is away from being a garbling of κ2 is given by the (Le Cam) deficiency and its various generalizations [9]. Another such function is given by U I defined in [7] that takes into account that the channels we consider are of the form κ1 = (X1 ← S) and κ2 = (X2 ← S), that is, they are derived from conditional distributions of random variables. In contrast to the deficiencies, U I depends on the input distribution to these channels. Let PSX1 X2 be a joint distribution of S and the outputs X1 and X2 . Let ∆P be the set of all joint distributions of the random variables S, X1 , X2 (with the same alphabets) that are compatible with the marginal distributions of PSX1 X2 for the pairs (S, X1 ) and (S, X2 ), i.e.,  ∆P := QSX1 X2 ∈ ∆ : QSX1 = PSX1 , QSX2 = PSX2 . In other words, ∆P consists of all joint distributions that are compatible with κ1 and κ2 and that have the same distribution for S as PSX1 X2 . Consider the function U I(S; X1 \X2 ) := min IQ (S; X1 |X2 ), Q∈∆P where IQ denotes the conditional mutual information evaluated with respect to the the joint distribution Q. This function has the following property: U I(S; X1 \X2 ) = 0 if and only if κ1  κ2 [7]. Computing U I is a convex optimization problem. However, the condition number can be very bad, which makes the problem difficult in practice. U I is interpreted in [7] as a measure of the unique information that X1 conveys about S (with respect to X2 ). So, for instance, with this interpretation Example 2 can be summarized as follows: Neither X1 nor X2 has unique 11 ·10−2 UI UI 1 5 0.15 0.8 0.6 0.1 b 0.15 0 0.1 b 0.4 0.05 0.05 0.2 −5 −0.1 0 a 0.0 0.1 0 0 0.2 0.4 0.6 0.8 1 0.0 a (a) (b) Fig. 1: Heatmaps for the function U I in (a) Example 4, and (b) Example 5. information about f (S). However, both variables have unique information about S, although X1 is conditionally independent of S given f (S) and thus, in contrast to X2 , contains no “additional” information about S. We now apply U I to a parameterized version of the A ND gate in Example 2. Example 4. Figure 1a shows a heat map of U I computed on the set of all distributions of the form f (s) s x1 x2 0 0 0 0 1/8 + 2b 0 1 0 0 1/8 − 2b 0 0 0 1 1/8 +a 0 1 0 1 1/8 −a 0 0 1 0 1/8 + a/2 + b 0 1 1 0 1/8 − a/2 − b 1 2 1 1 Pf (S)SX1 X2 1/4 where −1/8 ≤ a ≤ 1/8 and −1/16 ≤ b ≤ 1/16. This is the set of distributions of S, X1 , X2 that satisfy the following constraints: 1) X1 , X2 are independent; 2) f (S) = A ND(X1 , X2 ), where f is as in Example 2; and 3) X1 is independent of S given f (S). Along the secondary diagonal b = a/2, the marginal distributions of the pairs (S, X1 ) and (S, X2 ) are identical. In such a situation, the channels (X1 ← S) and (X2 ← S) are Blackwell-equivalent, and so U I vanishes. Furtheraway from the diagonal, the marginal distributions differ, and U I grows. The maximum value is achieved at the corners for (a, b) = (−1/8, 1/16), (1/8, −1/16). At the upper left corner (a, b) = ±(−1/8, 1/16), we recover Example 2. 12 Example 5. Figure 1b shows a heat map of U I computed on the set of all distributions of the form f (s) s x1 x2 Pf (S)SX1 X2 0 0 0 0 a2/(a+b) 0 0 1 0 ab/(a+b) 0 1 0 1 ab/(a+b) 0 1 1 1 b2/(a+b) 1 2 1 1 1−a−b where a, b ≥ 0 and a + b ≤ 1. This extends Example 3, which is recovered for a = b = 1/3. This is the set of distributions of S, X1 , X2 that satisfy the following constraints: 1) X2 is a function of S, where the function is as in Example 3. 2) X1 is independent of S given f (S). 3) The channels X1 ← f (S) and X2 ← f (S) are identical. R EFERENCES [1] D. Blackwell, “Equivalent comparisons of experiments,” The Annals of Mathematical Statistics, vol. 24, no. 2, pp. 265–272, 1953. [2] E. Torgersen, Comparison of Statistical Experiments. Cambridge University Press, 1991. [3] L. Le Cam, “Comparison of experiments – a short review,” Statistics, Probability and Game Theory, vol. 30, pp. 127 – 138, 1996. [4] P. Bergmans, “Random coding theorem for broadcast channels with degraded components,” IEEE Transactions on Information Theory, vol. 19, no. 2, pp. 197–207, March 1973. [5] J. Cohen, J. Kemperman, and G. Zbăganu, Comparisons of Stochastic Matrices with applications in information theory, statistics, economics, and population sciences. Birkhäuser, 1998. [6] J. Körner and K. Marton, “Comparison of two noisy channels,” in Topics in information theory. Keszthely (Hungary): Colloquia Mathematica Societatis János Bolyai, 1975, vol. 16, pp. 411–423. [7] N. Bertschinger, J. Rauh, E. Olbrich, J. Jost, and N. Ay, “Quantifying unique information,” Entropy, vol. 16, no. 4, pp. 2161–2183, 2014. [8] J. Rauh, P. K. Banerjee, E. Olbrich, J. Jost, and N. Bertschinger, “On extractable shared information,” arXiv:1701.07805, 2017. [9] M. Raginsky, “Shannon meets blackwell and le cam: Channels, codes, and statistical experiments,” in 2011 IEEE International Symposium on Information Theory Proceedings, July 2011, pp. 1220–1224.
7cs.IT
Complete Context Calculus Design and Implementation in GIPSY arXiv:1002.4392v1 [cs.FL] 23 Feb 2010 Xin Tong, Joey Paquet, Serguei A. Mokhov 1455 De Maisonneuve Blvd. W. Computer Science and Software Engineering Concordia University Montreal, Quebec, Canada H3G 1M8 Email {x_ton,paquet,mokhov}@cse.concordia.ca Abstract This paper presents the integration into the GIPSY of Lucx’s context calculus defined in Wan’s PhD thesis. We start by defining different types of tag sets, then we explain the concept of context, the types of context and the context calculus operators. Finally, we present how context entities have been abstracted into Java classes and embedded into the GIPSY system. Keywords: Context-driven computation, Intensional programming, Context calculus, Tag set 1 Introduction Lucid [18, 1, 4, 2, 3] represents a family of intensional programming languages that has several dialects all sharing a generic counterpart, which we call the Generic Intensional Programming Language (GIPL) [12, 20, 15, 10]. The GIPL is a functional programming language whose semantics was defined according to Kripke’s possible worlds semantics [7]. Following this semantics, the notion of context is a core concept, as the evaluation of expressions in intensional programming languages relies on the implicit context of utterance [12]. In earlier versions of Lucid, contexts could not be explicitly defined or used in expressions, nor used as first-class values in the language. A new dialect of Lucid, which is called Lucx (Lucid Enriched With Context) was introduced by Wan [19]. Lucx embraced the idea of context as first-class value and it also had a collection of context calculus operators defined, coalesced into a well-defined context calculus. However, the operational details of integrating Lucx into the GIPSY have not yet been defined, so these latest very important results are not integrated in our operational system. Problem Statement In her PhD thesis, Wan has set the basis of a context calculus and demonstrated how it could be integrated into the existing implementation of the GIPSY through the expression of context calculus operators as Lucid functions, and the simulation of contexts using Lucid finite streams. Such an implementation, though it provided a nice proof of concept, would eventually lead to a notoriously inefficient implementation. What we need is to fully integrate the context calculus into the syntax of the GIPL, as well as to integrate its semantics into the run-time system. Achieving this would bring forth the first intensional language implemented to include contexts as first class value in its syntax and semantics. Proposed Solution Based on Wan’s theory and the current architecture of the GIPSY framework [10, 14] we refined and implemented the context calculus including the new syntactical constructs required for the language to be more expressive in terms of implicit and explicit context manipulation, and we embedded a context data type together with the corresponding tag set types into the GIPSY type system [11]. 1 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov The introduction of such new constructs required adaptive modifications to our existing implementation, which are described in this paper. 2 Tag Sets A context is essentially a relation between dimensions and tags, the latter being indexes used to refer to points in the context space defined over these dimensions. In Lucx, such a relation is represented using a collection of <dimension:tag> pairs [19]. In such a pair, the current position of the dimension is marked by the tag value, while properties of the tags, such as what are valid tags in this dimension, are bound to the dimension they index. When a context is declared, a semantic check should be performed to determine whether a tag is valid in the dimension it is used. Therefore, we introduce the notion of a tag set, as a collection of all possible tags attached to a particular dimension, i.e. we introduce the notion of tag types. In earlier versions of Lucid programming languages, the tag set was assumed to be the ordered infinite set of natural numbers, and was never explicitly declared as such. However, as we explore more domains of application, natural numbers can no longer represent tag values sufficiently. For example, assume that we want to compute the gravity of certain planets in the solar system. We could define planet as our dimension; #planet returns the current tag in the planet dimension. We use the square brackets notation [planet:#planet] to represent a simple context [19], as a collection of <dimension:tag> pairs. The result of the program should be a stream of gravity values. The evaluation of specific values in this stream depends on the specific context of utterance, such as gravity@[planet:3]. If we set our focus onto the planets inside the current solar system, then up to our knowledge now, there is a finite number of planets, i.e. the tag set for the planet dimension is [1..8]. We could also make the tag set of this dimension into the set {Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune}, where the tags are no longer integers representing the order of proximity to the Sun, but strings representing the names of the planets. Note that such a tag set could still be ordered by the order of proximity to the Sun, as represented here, or alphabetically. If we extend the dimension to all possible planets in the universe, then the number of tags would be infinite, and thus could not be enumerated. Note also that the order defined on the tag set is of importance, as basic operators such as fby and next rely on an ordered tag set. It should thus be possible to define an order on tag sets, and declaring a tag set as unordered would then restrict the set of operators applicable to streams defined on a dimensions with an unordered tag set. It is thus clear that the properties of natural numbers set–ordered and infinite–are not sufficient to include all the possibilities for all possible tag set types. Additionally, the tag value can actually be of string or other types, not only int. Thus, it is necessary to introduce the keywords “ordered/unordered”, “finite/infinite” to determine the types of tag set associated with dimensions upon declaration. Note that more keywords might also be included in the future, here we only present those to the scope of our knowledge and the current application. Following are the definitions for those keywords when they are used to determine the type of a tag set. As tag sets are in fact sets, we define the following terms as of set theory [8, 5]: Definition 1. Ordered Set: A set on which a relation R satisfies the following three properties : 1. Reflexive: For any a ∈ S, we have aRa 2. Antisymmetric: If aRb and bRc, then a = b 3. Transitive: If aRb and bRc, then aRc Definition 2. Unordered Set: A set which is not ordered is called an unordered set. 2 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov Definition 3. Finite Set: A set I is called finite and more strictly, inductive, if there exists a positive integer n such that I contains just n members. The null-set 0/ is also called finite. Definition 4. Infinite Set: A set, which is not finite is called an infinite set. Out of backwards compatibility with previous versions of Lucid, we assume that the default tag set is the integers, and its order is as with the order of natural numbers. If other tag sets are to be applied, the programmer must specify them by explicitly specifying and/or enumerating the tag set and its order, as discussed further in this section. 2.1 Tag Set Types In the following sections, the actual types of tag sets are rendered by providing their syntax in Lucx’s implementation, followed by the applicability for these syntax rules, then some examples, and finally the implementation of set inclusion routines applicable to all these tag types. 2.1.1 Ordered Finite Tag Set For this type, tags inside the tag set are ordered and finite. Here we use Z to denote the set of all integers; S to denote the tag set. We define l, u, p, e ∈ Z as integers to denote the lower boundary (l), upper boundary (u), step (p) and any element (e) of the tag set when describing it syntactically. Also note that prev(e) returns the element previous to the current element under discussion. Syntax Rule 1. dimension <id>: ordered finite {<string>, . . . , <string>} • All the tag values inside the tag set are enumerated and their order is implicitly defined as the order in which they are enumerated. Syntax Rule 2. dimension <id>: ordered finite {l to u} • S ⊂ Z = {e|e − prev(e) = 1 ∧ l ≤ e ≤ u} Syntax Rule 3. dimension <id>: ordered finite {l to u step p} • S ⊂ Z = {e|e − prev(e) = p ∧ l ≤ e ≤ u ∧ p > 0} • S ⊂ Z = {e|e − prev(e) = p ∧ u ≤ e ≤ l ∧ p < 0} Example 1. The following examples correspond to the syntactic expressions listed above, respectively. • dimension d : ordered finite {rat, bull, tiger, rabbit} • dimension d : ordered finite {1 to 100} • dimension d : ordered finite {2 to 100 step 2} Set Inclusion • If it is in the first format of expression, then set inclusion returns true if and only if the given parameter is equal to one of the tag values inside the tag set as extensionally enumerated. • If the tag set is declared using the second format, then set inclusion returns true if and only if the given parameter is greater than or equal to the lower boundary and smaller than or equal to the upper boundary. 3 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov • If the third expression is applied, then set inclusion returns true if the given parameter para is greater than or equal to the lower boundary, and smaller than or equal to the upper boundary, if the step is possitive; or smaller than or equal to the lower boundary and greater than or equal to the upper boundary if the step is negative; and that ((para − l) mod p) = 0 in both cases. 2.1.2 Ordered Infinite Tag Set For this type, tags inside the tag set are ordered and infinite. Since the tag set is infinite, it cannot be enumerated. For now, we only consider subsets of integers. Note, in what follows INF- and INF+ stand for minus infinity (−∞) and plus infinity (+∞) respectively. Syntax Rule 4. dimension <id>: ordered infinite {l to INF+} • S ⊂ Z = {e|e − prev(e) = 1 ∧ l ≤ e} Syntax Rule 5. dimension <id>: ordered infinite {l to INF+ step p} • S ⊂ Z = {e|e − prev(e) = p ∧ l ≤ e ∧ p > 0} Syntax Rule 6. dimension <id>: ordered infinite {INF- to u} • S ⊂ Z = {e|e − prev(e) = 1 ∧ e ≤ u} Syntax Rule 7. dimension <id>: ordered infinite {INF- to u step p} • S ⊂ Z = {e|e − prev(e) = p ∧ e ≤ u ∧ p > 0} Syntax Rule 8. dimension <id>: ordered infinite {INF- to INF+} • This represents the whole stream of integers, from minus infinity to plus infinity. Note that the default tag set is N+ , which is also within this type. Either by leaving the tag set declaration part empty or specifying {0 to INF+}, they both refer to the set of natural numbers. Example 2. The following examples correspond to the syntactic expressions listed above, respectively. • dimension d : ordered infinite {2 to INF+} • dimension d : ordered infinite {2 to INF+ step 2} • dimension d : ordered infinite {INF- to 100} • dimension d : ordered infinite {INF- to 100 step 2} • dimension d : ordered infinite {INF- to INF+} Set Inclusion Although we call this type of set ‘infinite’, in the actual implementation, there should be a way to handle this ‘infinity’ to make it ‘infinite’ allowed by the available storage resources. For now we only consider Integer as the type for a tag value, thus the infinity is actually represented by either Integer.MIN VALUE of Java for minus infinity or Integer.MAX VALUE for plus infinity. The set inclusion method is defined and implemented as the following: • If the first expression is applied: then set inclusion method returns true if and only if the given parameter is greater than or equal to the lower boundary and less than or equal to Integer.MAX VALUE. 4 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov • If it is in the second format: then set inclusion method returns true if and only if the given parameter para is greater than or equal to the lower boundary and less than or equal to Integer.MAX VALUE and that ((para − l) mod p) = 0. • If the third expression is used: then set inclusion method returns true if and only if the given parameter is less than or equal to the upper boundary and greater than or equal to Integer.MIN VALUE. • If it is declared in the forth format: then set inclusion method returns true if and only if the given parameter para is less than or equal to the upper boundary and greater than or equal to Integer.MIN VALUE and that ((u − para) mod p) = 0. • Finally, if it is in the fifth expression: then the set inclusion method returns true if and only if the given parameter is greater than or equal to Integer.MIN VALUE and less than or equal to Integer.MAX VALUE. 2.1.3 Unordered Finite Tag Set Tags of this type are unordered and finite. Syntax Rule 9. dimension <id>: unordered finite {<string>, . . . , <string>} Example 3. The following example correspond to the syntactical expression above. • dimension d: unordered finite {red, yellow, blue} Set Inclusion The set inclusion method returns true if and only if the given parameter is equal to one of the tag values inside the tag set. 2.1.4 Unordered Infinite Tag Set Tags of this type are unordered and infinite. Syntax Rule 10. dimension <id>: unordered infinite {<E>} The <E> could be either intensional functions generating unordered infinite elements or imperative procedures such as Java methods to generate such elements. See the example below for a discussion. Example 4. Assume that we have a device to collect sound waves and it has a software interface to computers. And we have a getWave() method defined somewhere, which returns all the sound waves that can be detected by the device. If we want to set the device working ‘infinitely’ (ideally) in the sea in order to filter the sound waves of sperm whales to keep track of their conditions, we would define our tag set as: { while(true) { getWave(); } } As this type of tag set is unordered and infinite, it’s impossible to enumerate all the tag values in the tag set. The programmer has to provide a function to define all the possible tag values. Since some random number generator functions can also be considered valid for this type, the set inclusion can only be determined by the type of tag value. For example, if the random function generates only integers, then a tag value specified as any other type in the program should not be inside the tag set. 5 Complete Context Calculus Design and Implementation in GIPSY 3 Tong, Paquet, and Mokhov Context Calculus Context calculus operators are a set of operators performed on contexts. All the following definitions are recited from Wan’s PhD thesis. We present here only an overview of the theory underlying the notion of context and its calculus for the unaware readers. For a complete description please refer to [19]. Definition 5. Context: A context c is a finite subset of the relation: c ⊂ {(d, x)|d ∈ DIM ∧ x ∈ T }, where DIM is the set of all possible dimensions, and T is the set of all possible tags. 3.1 Types of Context According to [19], context can be classified into two categories, which are simple context and a context set. 3.1.1 Simple Context A simple context is a collection of <dimension : tag> pairs, where there are no two such pairs having the same dimension component. Conceptually, a simple context represents a point in the context space. A simple context having only one pair of <dimension : tag> is called a micro context. It is the building block for all the context types [17, 13]. Syntax Rule 11. [ <E>:<E>, . . . , <E>:<E>] Example 5. 3.1.2 • [d:1,e:2] Context Set A context set is a set of simple contexts. Context sets are also often named non-simple contexts. Context sets represent regions of the context space, which can be seen as a set of points in the context space, considering that the context space is discrete. Formally speaking, a non-simple context is a set of <d : x> mappings that are not defined by a function [16]. The semantics of context set has not been integrated into the Lucid programming language, yet, informally, as a context set can be viewed as a set of simple context, the semantic rules will apply on each element individually. Syntax Rule 12. {[<E>:<E>, . . . , <E>:<E>], . . . , [<E>:<E>, . . . , <E>:<E>]} Example 6. 3.2 • {[x:3,y:4,z:5],[x:3,y:1,z:5]} Context Calculus Operators In the following section, we provide the formal definition for the context calculus operators on simple context and context set; and the algorithm for implementing those operators. The operators are isSubContext, difference, intersection, projection, hiding, override, and union. Definition 6. isSubContext • If C1 and C2 are simple contexts and every micro context of C1 is also a micro context of C2 , then C1 isSubContext C2 returns true: C1 = {m1 , . . . , mi } where mi is any micro context inside C1 . If mi ∈ C2 , then C1 isSubContext C2 returns true. Note that an empty simple context is the subcontext of any simple context. Also note that as the concept of subset in set theory, C1 could be the proper subset of C2 , or C1 could be equal to C2 . 6 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov • If S1 and S2 are context sets and every simple context of S1 is also a simple context of S2 , then S1 isSubContext S2 returns true. S1 = {C1 , . . . ,Ci } where Ci is any simple context inside S1 . If Ci ∈ S2 , then S1 isSubContext S2 returns true. Note that an empty context set is the sub-context of any context set. Also note that as the concept of subset in set theory, S1 could be the proper subset of S2 , or S1 could be equal to S2 . Example 7. Example for isSubContext on both simple context and context set. • [d:1,e:2] isSubContext [d:1,e:2,f:3] = true • [d:1,e:2] isSubContext [d:1,e:2] = true • 0/ isSubContext [d:1,e:2]= true • {[d:1,e:2],[f:3]} isSubContext {[d:1,e:2],[f:3],[g:4]} = true • {[d:1,e:2],[f:3]} isSubContext {[d:1,e:2],[f:3]} = true. b o o l e a n i s S u b C o n t e x t ( S i m p l e C o n t e x t c1 , S i m p l e C o n t e x t c2 ) { i f ( c1 . s i z e == 0 ) return true ; else{ boolean f l a g ; f o r ( i n t i = 0 ; i < c1 . s i z e ; i ++) { flag=false ; f o r ( i n t j = 0 ; j < c2 . s i z e ; j ++) { i f ( c2 . m i c r o c o n t e x t ( j ) == c1 . m i c r o c o n t e x t ( i ) ) { f l a g =true ; break ; } } i f ( f l a g == f a l s e ) break ; } return f l a g ; } } Listing 1: Algorithm for implementing isSubContext on simple context Definition 7. difference: • If C1 and C2 are simple contexts, then C1 difference C2 returns a simple context that is the collection of all micro contexts which are members of C1 , but not members of C2 : C1 = {m1 , . . . mi } where mi is any micro context inside C1 . C1 difference C2 = {mi |mi ∈ / C2 }. Note that if C1 isSubContext C2 is true, then the returned simple context should be the empty context. Also note that it is valid to “differentiate” two simple contexts that have no common micro context; the returned simple context is simply C1 . • If S1 and S2 are context sets, this operator returns a context set S, where every simple context C ∈ S is computed as C1 difference C2 , C1 ∈ S1 , C2 ∈ S2 : S = S1 difference S2 = {C1 difference C2 |C1 ∈ S1 ∧C2 ∈ S2 }. 7 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov b o o l e a n i s S u b C o n t e x t ( C o n t e x t S e t s1 , C o n t e x t S e t s 2 ) { i f ( s 1 . s i z e == 0 ) return true ; else{ boolean f l a g ; f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { flag=false ; f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { i f ( s 2 . s i m p l e c o n t e x t ( j ) == s 1 . s i m p l e c o n t e x t ( i ) ) { f l a g =true ; break ; } } i f ( f l a g == f a l s e ) break ; } return f l a g ; } } Listing 2: Algorithm for implementing isSubContext on context set Example 8. Example for difference on both simple context and context set. • [d:1,e:2] difference [d:1,f:3] = [e:2] • [d:1,e:2] difference [d:1,e:2,f:3] = 0/ • [d:1,e:2] difference [g:4,h:5] = [d:1,e:2] • {[d:1,e:2,f:3],[g:4,h:5]} difference {[g:4,h:5],[e:2]} = {[d:1,e:2,f:3],[d:1,f:3],[g:4,h:5]] S i m p l e C o n t e x t d i f f e r e n c e ( S i m p l e C o n t e x t c1 , S i m p l e C o n t e x t c2 ) { S i m p l e C o n t e x t r e s u l t = c1 . c l o n e ( ) ; f o r ( i n t i = 0 ; i < c1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < c2 . s i z e ; j ++) { i f ( c2 . m i c r o c o n t e x t ( j ) == c1 . m i c r o c o n t e x t ( i ) ) { r e s u l t . remove ( c1 . m i c r o c o n t e x t ( i ) ) ; } } } return r e s u l t ; } Listing 3: Algorithm for implementing difference on simple context Definition 8. intersection • If C1 and C2 are simple contexts, then C1 intersection C2 returns a new simple context, which is the collection of those micro contexts that belong to both C1 and C2 : C1 = {m1 , . . . mi } where mi is any micro context inside C1 : C1 intersection C2 = {mi |mi ∈ C1 ∧ mi ∈ C2 }. Note that if C1 and C2 have no common micro contexts, the result is an empty simple context. 8 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov C o n t e x t S e t d i f f e r e n c e ( C o n t e x t S e t s1 , C o n t e x t S e t s 2 ) { ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { SimpleContext tempResult = d i f f e r e n c e ( s1 . s i m p l e c o n t e x t ( i ) , s2 . s i m p l e c o n t e x t ( j ) ); i f ( tem pRes ult . s i z e != 0) r e s u l t . add ( t e m p R e s u l t ) ; } } return r e s u l t ; } Listing 4: Algorithm for implementing difference on context set • If S1 and S2 are context sets, then the resulting intersection set S = S1 intersection S2 = {C1 intersection C2 |C1 ∈ S1 ∧C2 ∈ S2 } Example 9. Example for intersection on both, simple context and context set: • [d:1,e:2] intersection [d:1] = [d:1] • [d:1,e:2] intersection [g:4,h:5] = 0/ • {[d:1,e:2,f:3],[g:4,h:5]} intersection {[g:4,h:5],[e:2]} = {[e:2],[g:4,h:5]} S i m p l e C o n t e x t i n t e r s e c t i o n ( S i m p l e C o n t e x t c1 , S i m p l e C o n t e x t c2 ) { r e t u r n d i f f e r e n c e ( c1 , d i f f e r e n c e ( c1 , c2 ) ) ; } Listing 5: Algorithm for implementing intersection on simple context C o n t e x t S e t i n t e r s e c t i o n ( C o n t e x t S e t s1 , C o n t e x t S e t s 2 ) { ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { SimpleContext tempResult = i n t e r s e c t i o n ( s1 . s i m p l e c o n t e x t ( i ) , s2 . s i m p l e c o n t e x t ( j)); i f ( tem pRes ult . s i z e != 0) r e s u l t . add ( t e m p R e s u l t ) ; } } return r e s u l t ; } Listing 6: Algorithm for implementing intersection on context set Definition 9. projection: 9 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov • If C is a simple context and D is a set of dimensions, this operator filters only those micro contexts in C that have their dimensions in set D. C projection D = {m|m ∈ C ∧ dim(m) ∈ D}. Note that if there’s no micro context having the same dimension as in the dimension set, the result would be an empty simple context. dim(m) returns the dimension of micro context m. • The projection of a context set and a dimension set is a context set, which is a collection of all the simple contexts project the dimension set. If S is a context set, D is a dimension set; S projection D = {n|n = C projection D ∧C ∈ S}. Note that if there’s no common dimension in every simple context and the dimension set, the result is an empty context set. Example 10. Example of projection on both simple context and context set: • [d:1,e:2,f:3] projection {d,f} = [d:1,f:3] • {[d:1,e:2,f:3],[g:4,h:5],[f:4]} projection {e,f,h} = {[e:2,f:3],[h:5],[f:4]} SimpleContext p r o j e c t i o n ( SimpleContext c , DimensionSet dimSet ) { SimpleContext r e s u l t ; f o r ( i n t i = 0 ; i < d i m S e t . s i z e ; i ++) { f o r ( i n t j = 0 ; j < c . s i z e ; j ++) { i f ( c . m i c r o c o n t e x t ( j ) . d i m e n s i o n == d i m S e t . d i m e n s i o n ( i ) ) r e s u l t . add ( c . m i c r o c o n t e x t ( j ) ) ; } } return r e s u l t ; } Listing 7: Algorithm for implementing projection on simple context Co nte xt Set p r o j e c t i o n ( Co nt ext Set s , DimensionSet dimSet ) { ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < s . s i z e ; i ++) { SimpleContext tempResult = p r o j e c t i o n ( s . s i m p l e c o n t e x t ( i ) , dimSet ) ; i f ( tem pRes ult . s i z e != 0) r e s u l t . add ( t e m p R e s u l t ) ; } return r e s u l t ; } Listing 8: Algorithm for implementing projection on context set Definition 10. hiding: • If C is a simple context and D is a dimension set, this operator is to remove all the micro contexts in C whose dimensions are in D: C hiding D = {m|m ∈ C ∧ dim(m) ∈ / D}. Note that C projection S D C hiding D = C. • For context set S, and dimension set D, the hiding operator constructs a context set S0 where S0 is obtained by hiding each simple context in S on the dimension set D: S0 = S hiding D = {C hiding D|C ∈ S}. 10 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov Example 11. Example for hiding on both simple context and context set: • [d:1,e:2,f:3] hiding {d,e} = [f:3] • [d:1,e:2,f:3] hiding {g,h} = [d:1,e:2,f:3] • [d:1,e:2,f:3] hiding {d,e,f} = 0/ • {[d:1,e:2,f:3],[g:4,h:5],[e:3]} hiding {d,e} = {[f:3],[g:4,h:5]} SimpleContext h i d i n g ( SimpleContext c , DimensionSet dimSet ) { return ( d i f f e r e n c e ( c , p r o j e c t i o n ( c , dimSet ) ) ) ; } Listing 9: Algorithm for implementing hiding on simple context Co nte xt Set h i d i n g ( Co nt ext Set s , DimensionSet dimSet ) { ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < s . s i z e ; i ++) { SimpleContext tempResult = h i d i n g ( s . s i m p l e c o n t e x t ( i ) , dimSet ) ; i f ( tem pRes ult . s i z e != 0) r e s u l t . add ( t e m p R e s u l t ) ; } return r e s u l t ; } Listing 10: Algorithm for implementing hiding on context set Definition 11. override: • If C1 and C2 are simple contexts, then C1 override C2 returns a new simple context C, which is the result of the conflict-free union of C1 and C2 , as defined below: C = C1 override C2 = {m|(m ∈ C1 ∧ dim(m) ∈ / dim(C2 )) ∨ m ∈ C2 }. • For every pair of context sets S1 , S2 , this operator returns a set of contexts S, where every context C ∈ S is computed as C1 override C2 ; C1 ∈ S1 , C2 ∈ S2 : S = S1 override S2 = {C1 override C2 |C1 ∈ S1 ∧C2 ∈ S2 }. Example 12. Example of override on both simple context and context set: • [d:1,e:2,f:3] override [e:3] = [d:1,e:3,f:3] • [d:1,e:2,f:3] override [e:3,g:4] = [d:1,e:3,f:3,g:4] • {[d:1,e:2],[f:3],[g:4,h:5]} override {[d:3],[h:1]} = {[d:3,e:2],[d:1,e:2,h:1],[f:3,d:3], [f:3,h:1],[g:4,h:5,d:3],[g:4,h:1]} Definition 12. union: 11 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov S i m p l e C o n t e x t o v e r r i d e ( S i m p l e C o n t e x t c1 , S i m p l e C o n t e x t c2 ) { SimpleContext r e s u l t ; boolean f l a g = f a l s e ; / / k e e p t h e m i c r o c o n t e x t s whose d i m e n s i o n s i s i n c2 , b u t n o t i n c1 S i m p l e C o n t e x t uniqueMCInC2= c2 . c l o n e ( ) ; f o r ( i n t i = 0 ; i < c1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < c2 . s i z e ; j ++) { i f ( c1 . m i c r o c o n t e x t ( i ) . d i m e n s i o n == c2 . m i c r o c o n t e x t ( j ) . d i m e n s i o n ) { f l a g =true ; r e s u l t . add ( c2 . m i c r o c o n t e x t ( j ) ) ; uniqueMCInC2 . remove ( c2 . m i c r o c o n t e x t ( j ) ) ; } } i f ( f l a g == f a l s e ) / / Add t h e m i c r o c o n t e x t s i n c1 w i t h u n i q u e d i m e n s i o n s r e s u l t . add ( c1 . m i c r o c o n t e x t ( i ) ) ; flag=false ; } f o r ( i n t k = 0 ; k < uniqueMCInC2 . s i z e ; k ++) { / / Add t h e m i c r o c o n t e x t s i n c2 w i t h u n i q u e d i m e n s i o n s r e s u l t . add ( uniqueMCInC2 . m i c r o c o n t e x t ( k ) ) ; } return r e s u l t ; } Listing 11: Algorithm for implementing override on simple context C o n t e x t S e t o v e r r i d e ( C o n t e x t S e t s1 , C o n t e x t S e t s 2 ) { ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { SimpleContext tempResult = o v e r r i d e ( s1 . s i m p l e c o n t e x t ( i ) , s2 . s i m p l e c o n t e x t ( j ) ) ; i f ( tem pRes ult . s i z e != 0) r e s u l t . add ( t e m p R e s u l t ) ; } } return r e s u l t ; } Listing 12: Algorithm for implementing override on context set • If C1 and C2 are simple contexts, then C1 union C2 returns a new simple context C, for every micro context m in C: m is an element of C1 or m is an element of C2 : C1 union C2 = {m|m ∈ C1 ∨ m ∈ C2 ∧ m ∈ / C1 }. Note that if there is at least one pair of micro contexts in C1 and C2 sharing the same dimension and these two micro contexts are not equal then the result is a non-simple context, which can be translated into context set: For a non-simple context C, we construct the set Y = {yd = C projection {d}|d ∈ dim(C)}. Denoting the elements of set Y as y1 , . . . , y p , we construct the set S(C) of simple contexts: S(C) = {m1 override m2 override . . . override m p |m1 ∈ y1 ∧ m2 ∈ y2 ∧ . . . m p ∈ y p }, The non-simple context is viewed as the set S(C). It is easy to see that S(C) = {s ∈ S|dim(s) = dim(C) ∧ s ⊂ C} • As described earlier for the union operator performing on simple contexts, the result could be a non-simple context. If we simply compute union for each pair of simple context inside both context sets, the result may be a set of sets, in other words, higher-order sets [19]. Due to unnecessary 12 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov semantic complexities, we should avoid the occurrence of such sets, thus we define the union of two context sets as following to eliminate the possibility of having a higher-order set. If C1 and C2 are context sets, then C = C1 union C2 is computed as follows: D1 = {dim(m) ∧ m ∈ C1 }, D2 = T {dim(m) ∧ m ∈ C2 }, D3 = D1 D2 . 1. Compute X1 : X1 = {mi (m j hiding D3 ) ∧ mi ∈ C1 ∧ m j ∈ C2 } S 2. Compute X2 : X2 = {m j (mi hiding D3 ) ∧ mi ∈ C1 ∧ m j ∈ C2 } S 3. The result is: C = X1 X2 S Example 13. Example of union on both simple context and context set: • [d:1,e:2] union [f:3,g:4] = [d:1,e:2,f:3,g:4] • [d:1,e:2] union [d:3,f:4] = [d:1,d:3,f:4] ⇔ {[d:1,f:4],[d:3,f:4]} • {[d:1,e:2],[g:4,h:5]} union {[g:4,h:5],[e:3]} = {[d:1,e:2],[g:4,h:5],[g:4,h:5,d:1],[e:3,d:1],[e:3]} 4 Implementation of Context Calculus in the GIPSY In order to execute a Lucid program, all the SIPL (Specific Intensional Programming Language) [20, 10] ASTs (abstract syntax tree) are translated into their GIPL counterparts using semantic translation rules establishing the specific-to-generic equivalence between the two languages [12, 20, 15, 10]. The translated AST, together with the dictionary [20, 10] are then fed to the Execution Engine, namely the GEE [12, 10, 9] for the runtime execution. However, this translation approach cannot be easily adopted by Lucx. There’s no such object as a context in GIPL and also the translation for context calculus operators would inevitably involve in recursive function calls, which are flattened before processing by the GEE. As the notion of context is actually an essential concept for the Lucid programming language and we already have a type system in the GIPSY [11], it is necessary and possible to keep the context as one of the GIPSY types in the type system. By defining this class, the context calculus operators can be implemented as member methods, which are going to be called at runtime by the GEE as it traverses the AST of Lucx and encounters those operators. In order to call those methods, the engine has to instantiate the context objects first. As stated earlier, a context is a collection of <dimension : tag> pairs. During the instantiation, a semantic checking must be performed to verify if the tag is within the valid range of the dimension tag set. Thus, in order to implement the context calculus operators, we first have to introduce the tag set classes into the GIPSY. 4.1 Adding Tag Set Types into the GIPSY Type System As stated earlier in Section 2, there are four kinds of tag sets. They are organized as shown in Figure 1. The TagSet class is an abstract class and it’s the parent of all of tag set classes. It has several data fields to keep the general attributes of tag sets, and it also has place-holder methods for certain common operators among all the tag sets such as equality method equals() and the set inclusion method isInTagSet(). There is also a group of interfaces for keeping the type information, for example, the class OrderedFiniteTagSet should implement the IOrdered and IFinite interfaces. Such mechanism also provides the facility of adding and defining proper operators into the proper tag set classes. Such as getNext(poTag), which takes a tag object as parameter and returns the next tag value in the dimension, should be valid only for ordered sets. Then only the tag set classes implement the ordered interface should give the concrete implementation for this method. 13 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov C o n t e x t u n i o n ( S i m p l e C o n t e x t c1 , S i m p l e C o n t e x t c2 ) { / / Note t h a t t h e r e t u r n t y p e i s g e n e r i c / / Assume [ f : 1 , e : 1 , d : 2 ] u n i o n [ e : 2 , d : 1 , t : 4 ] SimpleContext r e s u l t 1 ; ContextSet r e s u l t 2 ; boolean i s C o n t e x t S e t = f a l s e ; f o r ( i n t i = 0 ; i < c1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < c2 . s i z e ; j ++) { i f ( c1 . m i c r o c o n t e x t ( i ) . d i m e n s i o n == c2 . m i c r o c o n t e x t ( j ) . d i m e n s i o n && c1 . m i c r o c o n t e x t ( i ) ! = c2 . m i c r o c o n t e x t ( j ) ) { / / [ e :1 , d :2] union [ e :1] i s a simple c o n t e x t : [ e :1 , d :2] isContextSet =true ; break ; } } i f ( i s C o n t e x t S e t == t r u e ) break ; } i f ( i s C o n t e x t S e t == f a l s e ) { / / No d i m e n s i o n i s common , r e s u l t i s t h e c o m b i n a t i o n c1 and c2 . f o r ( i n t i = 0 ; i < c1 . s i z e ; i ++) { r e s u l t 1 . add ( c1 . m i c r o c o n t e x t ( i ) ) ; } f o r ( i n t j = 0 ; j < c2 . s i z e ; j ++) { r e s u l t 1 . add ( c2 . m i c r o c o n t e x t ( j ) ) ; } / / remove d u p l i c a t e s e . g . [ e : 1 , e : 1 , d : 1 ] becomes [ e : 1 , d : 1 ] r e s u l t 1 . removeDuplicateContext ( ) ; return r e s u l t 1 ; } else{ / / T h e r e a r e common d i m e n s i o n s , t h e r e s u l t i s a non−s i m p l e c o n t e x t / / A function is called to t r a n s l a t e i t into a context set r e s u l t 2 = t r a n s l a t e C o n t e x t S e t ( c1 , c2 ) ; r e s u l t 2 . removeDuplicateContext ( ) ; return r e s u l t 2 ; } } Listing 13: Algorithm for implementing union on simple context 4.2 Adding Context into the GIPSY Type System As described in Section 2, there are simple context and context set under the generic context type. We have iContextType data field in the GIPSYContext class to keep this information. oSet is the actual container of either micro contexts (for simple context) or simple contexts (for context set). The Dimension class has an object of type of GIPSYIdentifier called oDimensionName to specify its name and oTagSet to keep the information of the tag set attached to it. It also has a reference oCurrentTag, which is set to the current tag value inside the dimension, by adding this field, the notion of micro context can be expressed, since micro context is nothing but a pair of <dimension : tag> and if we introduce another type of micro context, there would be data redundancy because it is going to be used only when constructing a simple context. Therefore, to sum up, a simple context is represented by a collection of Dimension with oCurrentTag specified and a context set is represented by a collection of GIPSYContext objects, with the iContextType set to SIMPLECONTEXT. Figure 2 shows the structure of the GIPSYContext and related classes. 14 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov C o n t e x t S e t t r a n s l a t e C o n t e x t S e t ( S i m p l e C o n t e x t pC1 , S i m p l e C o n t e x t pC2 ) { / / c o l l e c t i o n o f m i c r o c o n t e x t s i n pC1 h a v i n g common d i m e n s i o n s V e c t o r commonMC1 , commonMC2 ; / / c o l l e c t i o n o f m i c r o c o n t e x t s i n pC1 h a v i n g no common d i m e n s i o n V e c t o r uniqueMC1 , uniqueMC2 ; / / [ e : 1 , e : 2 ] or [ d : 1 , d : 2 ] Vector i n t e r M i c r o C o n t e x t i ; / / c o l l e c t i o n o f i n t e r M i c r o C o n t e x t i : {[ e : 1 , e : 2 ] , [ d : 1 , d : 2 ] } Vector interMicroContext ; / / {[ e : 1 , d : 1 ] , [ e : 1 , d : 2 ] , [ e : 2 , d : 1 ] , [ e : 2 , d : 2 ] } C o n t e x t S e t commonCombination ; / / {[ f : 1 , e : 1 , d : 1 , t : 4 ] . . . } ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < pC1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < pC2 . s i z e ; j ++) { i f ( pC1 . m i c r o c o n t e x t ( i ) . d i m e n s i o n ==pC2 . m i c r o c o n t e x t ( j ) . d i m e n s i o n ) { commonMC1 . add ( pC1 . m i c r o c o n t e x t ( i ) ) ; commonMC2 . add ( pC2 . m i c r o c o n t e x t ( j ) ) ; i n t e r M i c r o C o n t e x t i . add ( pC1 . m i c r o c o n t e x t ( i ) ) ; i n t e r M i c r o C o n t e x t i . add ( pC2 . m i c r o c o n t e x t ( j ) ) ; i n t e r M i c r o C o n t e x t . add ( i n t e r M i c r o C o n t e x t i ) ; break ; } } } / / b u i l d commonCombination {[ e : 1 , d : 1 ] , [ e : 1 , d : 2 ] . . . } / / p o i n t e r f o r combining a l l th e p o s s i b l e micro c o n t e x t s in i n t e r M i c r o C o n t e x t i n t i n i p o s i t i o n =0; / / any s i m p l e c o n t e x t e l e m e n t o f t h e c o n t e x t s e t commonCombination SimpleContext midReslt ; buildCommonCombination ( i n t e r M i c r o C o n t e x t , commonCombination , m i d R e s u l t , iniposition ) ; uniqueMC1= getUniqueMCs ( c1 , commonMC1 ) ; uniqueMC2= getUniqueMCs ( c2 , commonMC2 ) ; / / b u i l d t h e f i n a l r e s u l t {[ f : 1 , e : 1 , d : 1 , t : 4 ] . . . } r e s u l t = b u i l d A l l C o m b i n a t i o n ( uniqueMC1 , uniqueMC2 , commonCombination ) ; return r e s u l t ; } Listing 14: Algorithm for implementing helping method translateContextSet for union on simple context 4.3 Semantic Checking for Context Type The GIPSY is equipped with both static (compile-time) and dynamic (run-time) type checking mechanisms. With the addition of the above-defined GIPSYContext, Dimension and TagSet classes, the existing static and dynamic semantic checkers are extended in the occurence of these types being computed by the compiled/executed Lucx programs. The sections that follow provide discussions related to the introduction of such static/dynamic semantic checks in the compiler and run-time system. 4.3.1 Validity of Tag Value Inside a Context A context is a relation between a dimension and a tag. When a context expression is specified, it always contains one or more [dimension:tag] pairs. As the tag is the index of a dimension to mark a particular position for evaluation, it is necessary to check first if the tag is part of the valid tags for this dimension, 15 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov v o i d buildCommonCombination ( V e c t o r p I n t e r M i c r o C o n t e x t , C o n t e x t S e t r e s u l t , SimpleContext pMidResult , i n t p P o s i t i o n ) { / / P a s s i n g by r e f e r e n c e i s used , t h u s v o i d t h e r e t u r n t y p e i f ( p P o s i t i o n == p I n t e r M i c r o C o n t e x t . s i z e ) { / / F i n i s h one p a t h o f c o m b i n a t i o n : eg . [ e : 1 , d : 2 ] r e s u l t . add ( p M i d R e s u l t . c l o n e ( ) ) ; / / P r e p a r e t o s t a r t a n o t h e r way o f c o m b i n a t i o n : / / eg . i f p M i d R e s u l t =[ e : 1 , d : 1 ] , t h e n a f t e r t h i s , p M i d R e s u l t =[ e : 1 ] / / w a i t i n g f o r t h e c o n s t r u c t i o n o f p M i d R e s u l t =[ e : 1 , d : 2 ] pMidResult . removeElement ( pMidResult . l a s t E l e m e n t ( ) ) ; return ; } else{ / / Constructing the possible combination V e c t o r tempSC= p I n t e r M i c r o C o n t e x t . e l e m e n t A t ( p o s i t i o n ) ; p o s i t i o n ++; f o r ( i n t i = 0 ; i < tempSC . s i z e ; i ++) { M i c r o C o n t e x t tempMC = tempSC . e l e m e n t A t ( i ) ; p M i d R e s u l t . add ( tempMC ) ; / / C a l l bu il dCo mm on Com bi na ti on t o f i n i s h one p a t h o f c o m b i n a t i o n / / eg : i f p M i d R e s u l t =[ e : 1 ] , t h e c a l l would add [ d : 1 ] , / / t h u s making p M i d R e s u l t =[ e : 1 , d : 1 ] buildCommonCombination ( p I n t e r M i c r o C o n t e x t , r e s u l t , p M i d R e s u l t , p P o s i t i o n ) ; } i f ( pMidResult . s i z e !=0) { / / I f no m i c r o c o n t e x t l e f t , t h e r e c u r s i v e c a l l e n d s . / / Preparing for the next combination : / / eg . i f p M i d R e s u l t =[ e : 1 ] , t h i s o p e r a t i o n c l e a r s i t , / / waiting for the next path of [ e : 2 , . . . ] pMidResult . removeElement ( pMidResult . l a s t E l e m e n t ( ) ) ; return ; } } } Listing 15: Algorithm for implementing helping method buildCommonCombination for union on simple context in other words, that it is an element of the tag set attached to this dimension. This can be resolved by calling the set inclusion method defined for each tag set. When the tag expression is simply a constant or a literal, this checking is performed at compile time by traversing the AST and calling the set inclusion method. When the tag expression is complex, the semantic checking should be delayed to runtime by the execution engine to compute the resulting values and subsequently do the semantic checking when it tries to instantiate the corresponding GIPSYContext object. 4.3.2 Validity of Operands for Context Calculus Operators As defined earlier, the context calculus operators have some semantic restrictions on what are the valid operands, such as the union operator requires its operands either to be both of simple contexts or both of context sets. When the tag expressions are constants or literals, such checking is to be performed at compile time by traversing the AST and get the type of contexts. If the tag expressions are complex, this checking is deferred to runtime by the engine. 16 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov C o n t e x t S e t b u i l d A l l C o m b i n a t i o n ( V e c t o r pUniqueMC1 , V e c t o r pUniqueMC2 , C o n t e x t S e t pCommonCombination ) { ContextSet r e s u l t ; f o r ( i n t i = 0 ; i < pCommonCombination . s i z e ; i ++) { S i m p l e C o n t e x t tempSC=pCommonCombination . s i m p l e c o n t e x t ( i ) ; f o r ( i n t p = 0 ; p < pUniqueMC1 . s i z e ; p ++) { / / eg . tempMC=[ f : 1 ] M i c r o C o n t e x t tempMC=pUniqueMC1 . e l e m e n t A t ( p ) ; / / i n s e r t [ f :1] before [d :1 , e :1] etc . tempSC . i n s e r t E l e m e n t A t ( tempMC , p ) ; } f o r ( i n t q = 0 ; q < pUniqueMC2 . s i z e ; q ++) { / / eg . tempMC=[ t : 4 ] M i c r o C o n t e x t tempMC=pUniqueMC2 . e l e m e n t A t ( q ) ; / / append [ t : 4 ] a f t e r [ d : 1 , e : 1 ] e t c . tempSC . add ( tempMC ) ; } r e s u l t . add ( tempSC ) ; } return r e s u l t ; } Listing 16: Algorithm for implementing helping method buildAllCombination for union on simple context V e c t o r getUniqueMCs ( S i m p l e C o n t e x t pSC , V e c t o r p M i c r o C o n t e x t p ) { Vector microContext l ; boolean picked = f a l s e ; f o r ( i n t p = 0 ; p < pSC . s i z e ; p ++) { M i c r o C o n t e x t tempMC1=pSC . m i c r o c o n t e x t ( p ) ; f o r ( i n t q = 0 ; q < p M i c r o C o n t e x t p . s i z e ; q ++) { M i c r o C o n t e x t tempMC2= p M i c r o C o n t e x t p . e l e m e n t A t ( q ) ; i f ( tempMC1 == tempMC2 ) { picked=true ; break ; } } i f ( p i c k e d == f a l s e ) { m i c r o C o n t e x t l . add ( tempMC1 ) ; } else picked= f a l s e ; } return microContext l ; } Listing 17: Algorithm for implementing helping method getUniqueMCs for union on simple context 5 Conclusion By introducing contexts as first-class values, a set of context calculus operators are allowed to be performed on the context objects to provide us the facility of constructing and manipulating contexts in different application domains in the GIPSY. As we abstract the context into an object, the essential relation of dimension and tag is also properly and more completely defined by introducing tag set types. Since we have the GIPSY type system containing all the possible data types in Lucid, context, as one 17 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov C o n t e x t S e t u n i o n ( C o n t e x t S e t s1 , C o n t e x t S e t s 2 ) { DimensionSet interDimSet ; f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { f o r ( i n t k = 0 ; k < s 1 . s i m p l e c o n t e x t ( i ) . s i z e ; k ++) { f o r ( i n t l = 0 ; l < s 2 . s i m p l e c o n t e x t ( j ) . s i z e ; l ++) { i f ( s 2 . s i m p l e c o n t e x t ( j ) . m i c r o c o n t e x t ( l ) == s 1 . s i m p l e c o n t e x t ( i ) . micro context (k) ) i n t e r D i m S e t . add ( s 1 . s i m p l e c o n t e x t ( i ) . m i c r o c o n t e x t ( k ) ) ; } } } } C o n t e x t S e t X1 ; f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { X1 . add ( u n i o n ( s 1 . s i m p l e c o n t e x t ( i ) , h i d i n g ( s 2 . s i m p l e c o n t e x t ( j ) , i n t e r D i m S e t ) ) ) ; } } C o n t e x t S e t X2 ; f o r ( i n t j = 0 ; j < s 2 . s i z e ; j ++) { f o r ( i n t i = 0 ; i < s 1 . s i z e ; i ++) { X2 . add ( u n i o n ( s 2 . s i m p l e c o n t e x t ( j ) , h i d i n g ( s 1 . s i m p l e c o n t e x t ( i ) , i n t e r D i m S e t ) ) ) ; } } f o r ( i n t t = 0 ; t < X2 . s i z e ; t ++) { X1 . add ( X2 . s i m p l e c o n t e x t ( t ) ) ; } X1 . r e m o v e D u p l i c a t e C o n t e x t ( ) ; r e t u r n X1 ; } Listing 18: Algorithm for implementing union on context set of the first class objects, is taken as a standard member of the type system. By giving the Java class representation for context, the context calculus operators have been implemented as member functions inside the GIPSYContext class. 6 Future Work The context calculus operators implemented in the GIPSYContext class have already been fully tested using JUnit [6]. The next step is to make them completely executable at run-time on the GEE side. The GEE evaluates Lucid expressions by traversing the ASTs provided by the compilers. Thus, in order to compute the context calculus, we have to make the context and context calculus nodes are recognizable by the engine. When a context calculus node is encountered, it can be evaluated by instantiating a context object and calling the member function defined. 18 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov Figure 1: Tag Set Type Classes Figure 2: GIPSYContext class References [1] E. A. Ashcroft, A. Faustini, R. Jagannathan, and W. W. Wadge. Multidimensional, Declarative Programming. Oxford University Press, London, 1995. 19 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov [2] E. A. Ashcroft and W. W. Wadge. Lucid – a formal system for writing and proving programs. SIAM J. Comput., 5(3), 1976. [3] E. A. Ashcroft and W. W. Wadge. Erratum: Lucid – a formal system for writing and proving programs. SIAM J. Comput., 6((1):200), 1977. [4] E. A. Ashcroft and W. W. Wadge. Lucid, a nonprocedural language with iteration. Communication of the ACM, 20(7):519–526, July 1977. [5] A. A. Fraenkel. Abstract set theory. New York, Amsterdam : North-Holland Pub. Co., fourth revised edition, 1976. [6] E. Gamma and K. Beck. JUnit. Object Mentor, Inc., 2001–2004. http://junit.org/. [7] S. A. Kripke. Semantical considerations on modal logic. Journal of Symbolic Logic, 34(3):501, 1969. [8] S. Lipschutz. Schaum’s Outlines of Theory and Problems of Set Theory and Related Topics. New York : McGraw-Hill, second edition, 1998. [9] B. Lu, P. Grogono, and J. Paquet. Distributed execution of multidimensional programming languages. In Proceedings of the 15th IASTED International Conference on Parallel and Distributed Computing and Systems (PDCS 2003), volume 1, pages 284–289. International Association of Science and Technology for Development, Nov. 2003. [10] S. A. Mokhov. Towards hybrid intensional programming with JLucid, Objective Lucid, and General Imperative Compiler Framework in the GIPSY. Master’s thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, Oct. 2005. ISBN 0494102934. [11] S. A. Mokhov, J. Paquet, and X. Tong. Hybrid intensional-imperative type system for intensional logic support in GIPSY. Unpublished, 2008. [12] J. Paquet. Scientific Intensional Programming. PhD thesis, Department of Computer Science, Laval University, Sainte-Foy, Canada, 1999. [13] J. Paquet, S. A. Mokhov, and X. Tong. Design and implementation of context calculus in the GIPSY environment. In Proceedings of the 32nd Annual IEEE International Computer Software and Applications Conference (COMPSAC), pages 1278–1283, Turku, Finland, July 2008. IEEE Computer Society. [14] J. Paquet and A. H. Wu. GIPSY – a platform for the investigation on intensional programming languages. In Proceedings of the 2005 International Conference on Programming Languages and Compilers (PLC 2005), pages 8–14, Las Vegas, USA, June 2005. CSREA Press. [15] C. L. Ren. General intensional programming compiler (GIPC) in the GIPSY. Master’s thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, 2002. [16] The GIPSY Research and Development Group. The GIPSYwiki: Online GIPSY collaboration platform. Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, 2005–2009. http://newton.cs.concordia.ca/~gipsy/gipsywiki, last viewed November 2009. 20 Complete Context Calculus Design and Implementation in GIPSY Tong, Paquet, and Mokhov [17] X. Tong. Design and implementation of context calculus in the GIPSY. Master’s thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, Apr. 2008. [18] W. W. Wadge and E. A. Ashcroft. Lucid, the Dataflow Programming Language. Academic Press, London, 1985. [19] K. Wan. Lucx: Lucid Enriched with Context. PhD thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, 2006. [20] A. H. Wu. Semantic checking and translation in the GIPSY. Master’s thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, 2002. 21
6cs.PL
EURETILE 2010-2012 summary: first three years of activity of the European Reference Tiled Experiment. Pier Stanislao Paolucci, Iuliana Bacivarov, Gert Goossens, Rainer Leupers, Frédéric Rousseau, Christoph Schumacher, Lothar Thiele, Piero Vicini www.euretile.eu Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing ACKNOWLEDGMENT The authors summarized in this document the work performed by the EURETILE team during the first three years of the project. During the period 2010-2012 the full team was composed by: Istituto Nazionale di Fisica Nucleare - sezione di Roma (INFN) Roberto Ammendola, Andrea Biagioni, Ottorino Frezza, Michela Giovagnoli, Francesca Lo Cicero, Alessandro Lonardo, Pier Stanislao Paolucci, Francesco Simula, Davide Rossetti, Laura Tosoratto, Piero Vicini RWTH Aachen University – ISS & SSS (RWTH) Jovana Jovic, Rainer Leupers, Luis Murillo, Christoph Schumacher, Jan Henrik Weinstock ETH Zurich - The Swiss Federal Institute of Technology Zurich (ETHZ) Iuliana Bacivarov, Devendra Rai, Lars Schor, Lothar Thiele, Hoeseok Yang Université Joseph Fourier – Grenoble Institute of Technology - TIMA Laboratories (UJF/INP TIMA) Ashraf El Antably, Ikbel Belaid, Clément Deschamps, Nicolas Fournel, Mohamad Jaber, Julian Michaud, Etienne Ripert, Frédéric Rousseau Target Compiler Technologies (TARGET) Gert Goossens, Werner Geurts This publication is a derivative of the EURETILE 2010-2012 Publishable Executive Summary. All project deliverable documents have been peer reviewed by a committee of four experts of the field. The EURETILE project is funded by the European Commission, through the Grant Agreement no. 247846, Call: FP7-ICT-2009-4 Objective FET-ICT-2009.8.1 Concurrent Tera-device Computing. www.euretile.eu Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing Table of Contents 1. Abstract .......................................................................................................................................... 5 1.1. Participating Institutions ...................................................................................................... 6 2. Structure of the Document ............................................................................................................. 6 2.1. Bibliographical Notes .......................................................................................................... 6 3. Publishable summary – 2010-2012 revision .................................................................................. 9 3.1. Project Objectives and Expected Final Results ................................................................... 9 3.1.1. Software Tool-Chain ........................................................................................................ 9 3.1.2. Experimental Hardware and Simulation Platforms for Embedded Systems and HPC .. 12 3.1.3. Definition of a Hierarchical Brain-Inspired Many-Tile Many-Process Architecture .... 13 3.1.4. Fault-Tolerance and Scalability ..................................................................................... 14 3.1.5. Versatile Distributed Network Processor ....................................................................... 14 3.1.6. ASIP Design ................................................................................................................... 14 3.1.7. Application Benchmarks ................................................................................................ 15 3.1.8. Main expected final results ............................................................................................ 16 3.1.9. Work-packages............................................................................................................... 16 3.2. Work Performed and Achieved Results in 2010 (First Year)............................................ 17 3.2.1. HW Architecture Design ................................................................................................ 17 3.2.2. DNP Design ................................................................................................................... 17 3.2.3. LQCD and PSNN ASIP Design ..................................................................................... 18 3.2.4. System-Level Programming Framework ....................................................................... 18 3.2.5. Scalable Simulation Environment .................................................................................. 18 3.2.6. Hardware-Dependent Software ...................................................................................... 19 3.3. Work Performed and Achieved Results in 2011 (Second Year) ....................................... 20 3.3.1. Definition of Fault Aware Architecture ......................................................................... 20 3.3.2. Challenging Application Benchmarks ........................................................................... 20 3.3.3. Innovation on HW Intellectual Properties and design tools .......................................... 21 3.3.4. System-Level Programming Framework (DAL) ........................................................... 23 3.3.5. Scalable Embedded Computing Simulation Environment (VEP) ................................. 24 3.3.6. AED integration with DNP driver software ................................................................... 25 3.3.7. Hardware-Dependent Software (HdS) ........................................................................... 25 3 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.4. Work Performed and Achieved Results in 2012 (Third Year) .......................................... 27 3.4.1. System-Level Programming Framework (DAL) ........................................................... 27 3.4.2. Hardware-Dependent Software (HdS) ........................................................................... 27 3.4.3. Scalable Embedded Computing Simulation Environment (VEP) ................................. 28 3.4.4. HW support to Fault Awareness .................................................................................... 29 3.4.5. DNP and APENet+ Innovations .................................................................................... 29 3.4.6. ASIP support to RDMA ................................................................................................. 30 3.4.7. ASIP Design Tool Improvement.................................................................................... 31 3.4.8. HW Experimental Platform Prototype (QUonG)........................................................... 31 3.4.9. DPSNN-STDP: Distributed Polychronous and Plastic Spiking Neural Net .................. 32 3.5. Plans for 2013 - 2014 activities ......................................................................................... 33 3.6. The SHAPES Project Background (2006-2009) ............................................................... 34 3.6.1. 2006 SHAPES Project Abstract ..................................................................................... 34 3.6.2. Investigation of the tiled HW paradigm ......................................................................... 34 3.6.3. Experimentation of real-time, communication aware system SW ................................. 35 3.6.4. DIOPSIS940HF MPSOC and SHAPES RISC + mAgic VLIW DSP + DNP Tile. ....... 37 4. Dissemination............................................................................................................................... 39 4.1. Papers - Posters - Technical Press – Newsletters .............................................................. 39 4.2. Books/Book Chapters ........................................................................................................ 42 4.3. Presentations ...................................................................................................................... 42 4.4. CASTNESS’11 .................................................................................................................. 44 CASTNESS’11 Agenda ............................................................................................................... 44 5. APPENDIX: Euretile Project Glossary........................................................................................ 47 References ............................................................................................................................................ 50 4 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 1. Abstract This is the summary of first three years of activity of the EURETILE FP7 project 247846. EURETILE investigates and implements brain-inspired and fault-tolerant foundational innovations to the system architecture of massively parallel tiled computer architectures and the corresponding programming paradigm. The execution targets are a many-tile HW platform, and a many-tile simulator. A set of SW process - HW tile mapping candidates is generated by the holistic SW toolchain using a combination of analytic and bio-inspired methods. The Hardware dependent Software is then generated, providing OS services with maximum efficiency/minimal overhead. The many-tile simulator collects profiling data, closing the loop of the SW tool chain. Fine-grain parallelism inside processes is exploited by optimized intra-tile compilation techniques, but the project focus is above the level of the elementary tile. The elementary HW tile is a multi-processor, which includes a fault tolerant Distributed Network Processor (for inter-tile communication) and ASIP accelerators. Furthermore, EURETILE investigates and implements the innovations for equipping the elementary HW tile with high-bandwidth, low-latency brain-like inter-tile communication emulating 3 levels of connection hierarchy, namely neural columns, cortical areas and cortex, and develops a dedicated cortical simulation benchmark: DPSNN-STDP (Distributed Polychronous Spiking Neural Net with synaptic Spiking Time Dependent Plasticity). EURETILE leverages on the multi-tile HW paradigm and SW tool-chain developed by the FET-ACA SHAPES Integrated Project (2006-2009). The APE Parallel Computing Lab of INFN Roma is in charge of the EURETILE HW Design (QUonG system/APENet+ board/DNP (Distributed Network Processor) and Scientific Application Benchmarks. The Computer Engineering and Networks Laboratory (TIK) of ETH Zurich (Swiss Federal Institute of Technology) designs the high-level explicit parallel programming and automatic mapping tool (DOL/DAL) and a set of “Embedded Systems” benchmarks. The Software for Systems on Silicon (SSS) of the ISS institute of RWTH Aachen, investigates and provides the parallel simulation technology and scalable simulation-based profiling/debugging support. The TIMA Laboratory of the University Joseph Fourier in Grenoble explores and deploys the HdS (Hardware dependent Software) including the distributed OS architecture. TARGET Compiler Technologies, the Belgian leading provider of retargetable software tools and compilers for the design, programming, and verification of application-specific processors (ASIPs), is in charge of the HW/SW Co-design tools for custom components of the EURETILE architecture. Grant Agreement no. 247846 Call: FP7-ICT-2009-4 Objective FET-ICT-2009.8.1 Concurrent Teradevice Computing Scientific Coordinator: Pier Stanislao Paolucci, Istituto Nazionale di Fisica Nucleare, Roma, Italy Administrative Coordinator: Michela Giovagnoli, Istituto Nazionale di Fisica Nucleare, Roma, Italy 5 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 1.1.Participating Institutions      INFN (Istituto Nazionale di Fisica Nucleare) Sezione di Roma (coordinator): the APE Parallel Computing Lab; The Computer Engineering and Networks Laboratory (TIK) of ETH Zurich (Swiss Federal Institute of Technology); The Software for Systems on Silicon (SSS) of the ISS institute of RWTH Aachen; UJF-TIMA: the TIMA Laboratory of the University Joseph Fourier in Grenoble; TARGET Compiler Technologies 2. Structure of the Document This document summarizes the activities of the European Reference Tiled Experiment, the EURETILE FET (Future Emerging Technologies) FP7 project 247836, during its first three years of activity (2010-2012). The document should provide a global view of the project framework, and it should simplify the reading of individual publications produced during the project time frame. Another purpose is to create an historical record of the project development flow. Therefore, individual sections are dedicated to each year of activity, and they describe the project status as reported at the end of 2010, 2011 and 2012. As the EURETILE project is an evolution of the SHAPES FP7 project, we inserted also a short summary of the SHAPES results that has been relevant for the EURETILE project. 2.1.Bibliographical Notes The “References” section at the end of the document is composed of four groups of citations. The first group contains a restricted set of “prior art” publications produced by other groups before 2010, the start date of the EURETILE project. Without any claim for completeness, we list a few publications that surely contributed to define the starting point of the project. The second group contains a selection of publications produced by members of our team before the start of the project, mainly during the time frame of the SHAPES project (2006-2009). The third group is a selection of publications produced by other groups during the 2010-2012 period about topics that are similar to those investigated by the EURETILE project. The last set is a selection of the publications produced by the members of the EURETILE team as a result of the project activities. The complete list of presentations and publication produced by the project is included in the “Dissemination” section. 6 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing The software design for specific platforms follows the methodologies described in the reference paper from Sangiovanni-Vincentelli, Martin (2001). The software is generated from a flow that respects the Y-chart approach proposed by Kienhuis and all (2002), taking into account the architecture specification. It includes few layers, and the lowest layer is called the Hardware dependant Software (HdS) as it is related to hardware access from the software. HdS development process is described in Schirner , Domer and Gerstlauer (2009). The Kahn process networks model of computation (Khan 1974) is used to express the computational kernels that constitute the lower levels of hierarchy of EURETILE applications, leveraging on the Distributed Operating Layer (DOL) (Thiele, Bacivarov, Haid, Huang, 2007). developed in the framework of the SHAPES project (Paolucci, Jerraya, Leupers, Thiele, Vicini., 2006). The KPN model explicitly separates computation and communication in the parallel application specification: an application kernel is expressed as a set of concurrently executing processes that only communicate via point-to-point FIFO channels. In EURETILE, the individual KPN processes are specified in C/C++, while the topology of the KPN is described using XML-based formats (Haid et al. 2009), that specify the instantiation of processes, their connection by FIFO channels, and their mapping onto the target platforms. This way, the processes that compose the KPN can be compiled for any processor for which a C/C++ compiler is available. Moreover, the specification of the mapping in an XML file rather than in the source code of processes makes the description of the application kernel more platform-independent. The expression of dynamic application scenarios and the specification of upper level of application hierarchies are among the targets addressed by the development of the EURETILE Distributed Application Layer (DAL) (see section 3.1.1). In the multi-tile context, one challenge is to manage as much efficiently as possible the communication between tiles. We focus the work in EURETILE on the software driver development for HdS generation, while some other works focus on the mapping quality (Lin, Gerstlauer, Evan, 2012) in order to reduce the impact on performances. Our software driver generation depends highly on the hardware architecture, which is a costly approach when dealing with many-tile system with several kinds of tiles. One way to facilitate the re-use of existing drivers is probably the use of virtualization environment (Heiser, 2011). Such a virtualization environment may help as well for multi-application support. The simulation of the EURETILE many-tile system is a key aspect of the project. The work “Exploiting parallelism and structure to accelerate the simulation of chip multi-processors” experiments with a custom parallel simulation framework (Penry et al., 2006). It discusses the impact of varying system sizes and accompanying cache effects on the simulation host machine, and suggests taking these cache effects into account for the scheduling of logical processes to simulation host cores. Ezudheen et al (2009) “Parallelizing SystemC kernel for fast hardware simulation on SMP machines” is one of the early works describing parallel SystemC simulation that relies on parallel execution of process executions within a delta-cycle. Various methods to schedule SystemC logical processes to physical simulation host OS threads are discussed. Lu et al. (2008) “Learning from mistakes: A comprehensive study on real world concurrency bug characteristics” presented an exhaustive analysis and classification of concurrency bugs (e.g., atomicity violations, order violations) observed in mature real-world parallel applications, as well as a set of conclusions and facts which set a precedent and a guide for research on modern debug methodologies and tools for parallel systems. 7 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing One of the goals of EURETILE is to develop the DPSNN-STDP benchmark (Distributed Polychronous Spiking Neural Net with synaptic Spiking Time Dependent Plasticity). The recent paper “Cognitive Computing” (Modha et al., 2011) optimally describes the boundaries of the arena where we intend to play. We resume here a few key references that contributed to define the startingpoint of our work. Song (2000) “Competitive Hebbian learning through spike-timing-dependent synaptic plasticity” described the importance of precise time ordering between pre and post-synaptic spiking as a way to capture causal/anti-causal relations between pairs of neurons and decide if to potentiate or depress an individual synapse. In our opinion, this is one of the key features to be captured if brain-inspired model of computations have to be applied to real-world problems. The importance of polychronization, i.e. the relevance of individual axonal delays on computation, is described by Izhikevich (2006). This is another feature that we deemed essential in our cortical simulation benchmark, to create an interconnection topology that could inspire advanced models of hardware interconnection and brain-inspired computational models. We followed Izhikevich (2003, 2004, 2006) also for what concern the model of the spiking neuron. We surely acknowledge the importance of the SpiNNaker Massively-Parallel Neural Net Simulator (Steve Furber et al. 2008) as source of thought about the characteristics of a brain-inspired hardware interconnection systems. As the EURETILE project is a continuation of the SHAPES project (2006-2009), we listed a few key references about the SHAPES hardware and software tool-chain architecture (Thiele et al, 2006, 2007; Paolucci et al. 2006, Rousseau, Jerraya et al. 2008). The simulation techniques developed in the SHAPES time-framework are summarized by a few papers (Kraemer, Leupers et al., 2007; Schumacher, Leupers et al. 2010). A key role in the hardware architecture of the SHAPES tile has been played by Diopsis MPSOC (Paolucci et al. 2003, 2006) architecture and by the mAgic VLIW DSP (Paolucci et al. 2001, 2002, 2004, 2008). 8 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3. Publishable summary – 2010-2012 revision 3.1.Project Objectives and Expected Final Results The EURETILE project (http://www.euretile.eu) investigates brain-inspired, foundational innovations to the software and hardware architecture of future fault-tolerant and dynamic many-tile systems, to be applied to those Embedded Systems and High Performance Computers requiring extreme numerical and DSP computation capabilities. The project will deliver:  Experimental Many-Tile Platforms for the study of many-tile systems in the scenarios of Embedded Systems and HPC (QUonG Hardware Platform and VEP-EX simulation platform);  A many-tile programming/optimization environment, to be applied to dynamic, fault-tolerant, many-process numerical/DSP applications, with foundational innovations;  A set of application benchmarks, representative of both HPC and Embedded System domains, coded using the new programming environment. 3.1.1. Software Tool-Chain From a software perspective, EURETILE aims at providing a scalable and efficient extensive programming framework for many-tile platforms, by exploiting the underlying parallelism and investigating some key brain-inspired architectural enhancements specific to EURETILE. The proposed programming environment is based on a new model of computation that explicitly exposes the coarse-grain and fine-grain parallelism present in applications. Then, automatic tools are aiming at obtaining predictable and efficient system implementations by optimally matching the concurrency and parallelism present in applications, with the underlying many-tile hardware. The figure sketches the envisioned software EURETILE tool-chain. The software tool-chain follows the well-known Ychart approach and in EURETILE each design phase will be enriched with novel concepts for programming efficiently the three layers of hierarchy present in EURETILE platform. The proposed software tool-chain aims at optimizing issues related to system throughput while still guaranteeing real-time constraints for applications that operate under such restrictions. Additionally, faulttolerance aspects are considered, from system-level programming. The way of representing parallelism, concurrency, and fault tolerance at system level, the implementation of the distributed real-time operating system, and the efficient fast simulation environment have all a strong impact on the overall optimality of the system implementation. The proposed programming framework developed by ETHZ is based on a new model of computation that matches well the many-tile EURETILE architecture. We have identified three levels of hierarchy in the “network of processes” describing the structure of the application, in analogy to three levels identified in the cortical-inspired organization of the hardware, i.e., 1-cortical columns, 2-cortical areas, and 3-neo cortex. The two upper levels of hierarchy in the network of processes are used to represent the coarse-grain concurrency. The first level is associated to finer grain parallelism. Practically, the concept of a distributed operation layer (DOL), applied with success to the multi-tile SHAPES platform (see SHAPES FP6 project http://apegate.roma1.infn.it/SHAPES and http://www.tik.ee.ethz.ch/~shapes) will be extended to describe the tremendous concurrency of different sets of parallel applications running simultaneously (dependently or independently) on the new brain-inspired many-tile architecture. In SHAPES, DOL was applied to describe static streamoriented applications and for mapping only a single application to a multi-core architecture. In other 9 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing words, the third level of hierarchy as described above was missing. Moreover, in EURETILE we aim at executing concurrently several dynamic applications, taking advantage of the many-tile distributed platform. applications scenarios FSM scenario 3 scenario 1 internal event scenario 2 external event scenario 3 scenario 2 scenario 1 many-core platform dynamic applications event dynamic selection of mappings (cf. FSM scenarios) Dynamic remapping: - semi-dynamic (intra-cluster) - static (processorlevel duplication) - fully dynamic fault fault event mapping 3 mapping 2 mapping 1 fault-tolerance (dynamic) remapping design space exploration software synthesis virtual platform simulation/ hardware emulation Figure 3-1. Schematic View of the Holistic and Scalable EURETILE Software Tool-Chain. 10 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing To answer all these challenges, the DOL programming environment needs to be enriched with innovative concepts. First, a new programming model that we will call Distributed Application Layer (DAL) is being developed at ETHZ, corresponding to the third level of hierarchy of EURETILE platform. This adds one level of hierarchy above the current process network layer in DOL, allowing the application programmer to specify concurrent execution of several dynamically instantiated applications on the same hardware. Second, the DOL programming model, which still relates to the first two levels of hierarchy in the architecture, needs to match well the underlying brain-inspired hardware platform. In particular, planned and unplanned internal and external events will be considered as initiators of dynamic remapping, exploiting the hierarchical nature of the underlying execution platform and the dynamism and concurrency inherent to the applications. (Semi-) automated off-line and efficient on-line mapping methods are to be investigated, including run-time monitoring and optimizations that consider timing predictability of individual applications as well as efficiency in terms of system throughput and accelerated executions. Then, in addition, fault tolerance needs to be part of all aspects of the EURETILE system, i.e., hardware platform, programming model, compilation, hardware-dependent software, operating system, and many-tile simulation. Fault-tolerance aspects are concretely taken into consideration starting from system-level, in the EURETILE programming environment and dynamic mapping strategies on many-tiles. In this sense, the DAL environment allows designers expressing faulttolerance aware mechanisms by dedicated programmable routines. 11 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.1.2. Experimental Hardware and Simulation Platforms for Embedded Systems and HPC The project develops two platforms, which will be used to experiment innovations to future many-tile software and hardware architectures:   VEP-EX, Embedded Systems many-tile simulation platform. The simulation framework will be developed by RWTH-AACHEN and will include multiple RISCs networked through a custom interconnect mesh composed of INFN DNPs (Distributed Network Processors). The QUonG Hardware Platform for scientific high performance computing. The hardware platform is networked through a custom interconnect mesh composed of DNPs hosted on FPGA boards (APENet+, providing innovative fault-awareness and fault-injection features). The platform includes off-the-shelf boards mounting INTEL multi-core CPUs. INFN will also explore the addition of GPGPUs. Figure 3-2. Simplified view of the EURETILE platforms (VEP and QUonG), which will be used for experiments on hardware and software innovations on future many-tile Embedded Systems (VEP) and HPC (QUonG). The project will also explore the addition of software programmable hardware accelerators in the form of ASIPs, using the framework developed by TARGET Compiler Technologies. 12 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.1.3. Definition of a Hierarchical Brain-Inspired Many-Tile Many-Process Architecture The plan is to match the coarse-grain and fine-grain concurrency of applications with that of the underlying hardware platform, to obtain predictable and efficient systems. Figure 3-3 Hierarchical Brain-Inspired Architecture: Conceptual View, applied to the Embedded System case. At the first (bottom) level of hierarchy, the elementary tile includes the DNP (Distributed Network Processor) for inter-tile communications, general-purpose processor(s) and local memories. Depending on the target application domains, the tile can include DSP(s) and ASIP(s). Upper levels of the hierarchy are constructed according to the distributed memory paradigm. In particular, we will research on reflecting the three levels of hierarchy of the brain-inspired architecture (1-cortical columns, 2-cortical areas, 3-neo cortex), in the dynamic network of processes that describes the structure of the application.  First level of the hierarchy: "Cortical columns" vs. EURETILE elementary tile. The computational kernel carried on by each process can access in read/write mode all the variables stored in the tile memories, in analogy with the “columnar computation” enabled by the all-to-all network among the neurons inside the column. The fine-grain concurrency (instruction-level parallelism and shared-memory threads) will be exploited at the level of abstraction corresponding to complex numerical computations, elementary signal or image processing operators, filters, small scale FFT or matrix computations, inversions, state machines or any other single-thread of computation, including the simulation of a set of neighbouring neurons.  Second level of the hierarchy: "Cortical areas" vs. EURETILE arrays of hardware tiles and processes. In EURETILE computations, it will be possible to declare arbitrary small and large-scale communication patterns between processes (such as n-dimensional arrays of 13 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing  message-passing connected computational processes), which will then be mapped on arrays of computational hardware tiles. This kind of n-dimensional decomposition of data-structures into smaller domains is a classical strategy of DSP and numerical algorithms. Third level of the hierarchy: “Neo-cortex” vs. EURETILE hardware system and complex software application description. On EURETILE, it will be possible to program a broad range of complex numerical, DSP and control applications coding them as a network of high abstraction computational models, as described in the second level of hierarchy. Several of these mostly independent, but possibly communicating applications, will be concurrently executed and share the hardware platform. This layer is dynamic in the sense that applications may dynamically enter or exit the system. The figure graphically represents the different levels of brain-inspired hierarchy and the associated concepts in concurrency management, applied to the Embedded System case. 3.1.4. Fault-Tolerance and Scalability Elementary processors are designed to guarantee a failure rate low enough to sustain the execution of platforms based on few components. The scaling to many processor systems requires the management of more frequent failures. Current parallel systems manage faults with a primitive approach based on period check-pointing (i.e. periodically saving the full state of the application on external storage) managed by the application programmer. If a hardware fault happens, the hardware is repaired or excluded, and the previous checkpoint is reloaded, as soon as the hardware system or a partition is available. In EURETILE, the aim is to automate the handling of the faults. From hardware point-of-view, the DNP (Distributed Network Processor) will be able to discover critical events, faulty lines and/or faulty tiles, and to inject synthetic critical and fault events, stimulating a systemic fault-management reaction. The DNP will monitor the system behaviour, and will signal the failure to the software environment, for automation of higher-level strategies. We will also investigate the routing of messages around faulty components. A key topic is the investigation of the scaling behaviour of the brain inspired system to many-tile configurations. To such purpose it will be useful to raise the level of abstraction and use a simulator capable to show the behaviour of high abstraction models of DNPs and processors under different kind of synthetic traffic workloads and failures. 3.1.5. Versatile Distributed Network Processor The DNP will be compatible with the platforms above described through appropriate processor interfaces. A more flexible software-programmable DNP can be designed in the form of an ASIP (using TARGET’s ASIP design tool-suite). The hardware prototype delivered by EURETILE will be integrated using a custom interconnection integrated on FPGAs. In principle, DAL (ETHZ) will be compatible with all proposed platforms, due to the platform-independent characteristics of this system-level environment. However, in order to apply DAL to effectively programming EURETILE platforms, fundamental platform-specific support need to be implemented in the hardware-dependent software (UJF-TIMA), and ensued by simulation capabilities of the fast simulation environment. 3.1.6. ASIP Design The HW/SW co-design tools operate at the level of elementary tiles in the brain-inspired many-tile architecture. Its work is based on its retargetable tools-suite for the design and programming of 14 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing Application-Specific Processors (ASIPs). Building on this technology, Target contributes to the project in two major ways. First, new software-programmable accelerators will become part of the elementary tiles. These accelerators take the form of ASIPs optimised for the typical numerical kernels of the applications envisaged in the project. Architectural exploration is based on profiling of application code in the retargetable SDK. In addition, the tools generate efficient RTL hardware models of the ASIP, enabling a quick implementation on FPGAs. Secondly, Software Development Kits (SDKs) will be developed for any processors in the elementary tiles that are intended for numerical data processing, which may include existing DSPs or new ASIP accelerators. Key elements of these SDKs are an efficient C compiler and an on-chip debugger. Third, ASIP will contribute to the acceleration of the DNP/APENet+ interconnection system. 3.1.7. Application Benchmarks A few characteristics of the project determined the selection of the set of benchmarks:  The software environment and the hardware architecture conceived by EURETILE should be qualitatively and quantitatively driven by the solution of problems selected from both the embedded systems and scientific computing scenarios;  EURETILE is about future many-tile architectures applied to dynamic scenarios that include numerically intensive digital signal processing and scientific kernels, individually represented by Kahn many-processes networks;  We should explore dynamism and fault-tolerance of many-processes applications;  We also expected to exploit hints coming from the brain architecture, a system capable of extreme parallelism and low power operation. We decided to fix the following set of benchmarks, selected from 3 application domains: 1. Dataflow oriented / digital signal processing benchmarks. The new DAL environment will be used to describe the expected dynamism (changing scenarios, e.g. for mobile appliances), using an explicitly tiled description of the available parallelism. This set of benchmarks is developed by ETHZ, a partner with a consolidated experience in the solution of optimization techniques for embedded systems. 2. The DPSNN-STDP (Distributed Polychronous Spiking Neural Net with synaptic Spiking Time Dependent Plasticity). cortical simulation benchmark, used with 3 purposes: a. as a source of requirements and architectural inspiration towards extreme parallelism; b. as a parallel/distributed coding challenge; c. as a scientific grand challenge. The study of the brain simulation benchmark will be developed under the direct responsibility of the coordinator (Pier Stanislao Paolucci – INFN Roma). 3. LQCD (Lattice Quantum Chromo Dynamics), a classic HPC grand challenge, which since 1983 had been driving the development of several generations of massive parallel/distributed computers. This benchmark will be maintained by the APE group (INFN Roma). The Brain Benchmark will be coded during the temporal framework of the EURETILE project both using a standard C/C++ plus MPI environment, as well as using the C/C++ plus XML DAL environment. This will allow to compare the features of the new environment in comparison to a classical environment on a benchmark which will be coded “from scratch” using an explicit description of parallelism. 15 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.1.8. Main expected final results To achieve this goal, our main expected final results are:       The definition of a hierarchical, scalable many-tile HW architecture, taking inspiration from the cortical structure, and searching for brain-inspired and fault-tolerant foundational innovations; A hardware prototype (QUonG) integrating at least 64 tiles and 128 cores, with support for fault awareness and tolerance; A scalable and flexible simulator, enabling the exploration of behaviour under faults and an easier debugging of many-process applications; A set of highly representative benchmarks: LQCD (Lattice Quantum Chromo Dynamics), PSNN (Polychronous Spiking Neural Networks), multi-dimensional FFT (Fast Fourier Transforms) and DSP/Data Flow Oriented, demonstrating the potential of EURETILE architecture on a broad class of numerical, DSP, and control applications on both scenarios (Embedded Systems and HPC); A many-tile programming environment, where applications can be expressed as dynamic network of processes and can be dynamically and mapped and controlled in an efficient manner on the 3-levels brain-inspired architecture (cortical columns, cortical areas, neocortex); The implementation of many-tile awareness of critical events and faults, and fault-tolerance at system-level through the support of all software and architecture layers. 3.1.9. Work-packages The project is structured in ten work-packages: WP1 WP2 WP3 WP4 WP5 WP6 WP7 WP8 WP9 WP10 Brain-Inspired Many-Process System Software Requirements Many-Tile Hardware Architecture Specification Foundational Many-Process Programming Environment Distributed Hardware Dependent Software Generation Many-Tile Simulation/Profiling Innovations on Hardware Intellectual Properties Challenging Tiled Applications Software Tool-Chain Integration Training, Exploitation and Dissemination Management 16 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.2.Work Performed and Achieved Results in 2010 (First Year) This section is a record of activities and results obtained during the first year of the project, and the technical content has been maintained as in the original yearly reports to maintain an historical track of the project flow. Next sections (3.3. and 3.4) describe the project evolution in 2011 and 2012. 3.2.1. HW Architecture Design During the first year the HW Architecture design has been performed by INFN in cooperation with the consortium partners. WP2 led by INFN and including contributions from other partners, started and concluded during this first period and results are reported in the deliverable D2.1. The overall objective of WP2 was to produce a preliminary system specification of the EURETILE many-tile hardware platforms. The collaboration decided to go for 2 parallel and synergic development lines: the first in the area of embedded systems while the other in the area of HPC systems. From the software point of view, the unifying elements are the common software tool-chain (from the high level programming mechanism to the HDS) and the simulation framework while the main hardware related developments is in the area of scalable, fault tolerant, brain-inspired network capable to be interfaced to custom ASIP, optimized for specific scientific applications (specifically for LQCD and PSSN in the EURETILE case studies), and/or commodities computing accelerators. 3.2.2. DNP Design This area of activity is covered by INFN. In particular, in the area of DNP enhancement main goals for 2010 were:  Design of a DNP-based 3D Torus network for HPC systems through: o VHDL Coding of DNP interface to HPC PCI Express based host system o DNP-uP integration to optimize RDMA support for INTEL-based host system  Porting of DNP 3D Torus network controller on FPGA platform  Design of a 6 channel FPGA-based electronic card for HPC system During 2010, DNP activities were executed in collaboration with the APEnet+ project. The INFN initiative called APEnet aims to build high performances custom networks for HPC commodities PC Clusters using ideas, know-how and IPs developed in the framework of the APE project. APEnet+ is the last generation of NIC boards (FPGA based) implementing a 3D Torus network for PC Cluster. During 2010, we progressed toward the EURETILE HPC platform, which foresees the development of an FPGA-based network card (a 3D Torus network router using the DNP architecture) to interconnect commodities PC clusters. During this first year, we synthesized the current DNP on the target FPGA ALTERA STRATIX IV EP4SGX 290 device obtaining preliminary but encouraging results (clock Figure 3-4. DNP test board (APEnet+) developed during frequency and footprint). Then, we redesigned 2010. the DNP serial-link interface to be compliant 17 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing with the target Ser/Des, for a total speed of 34Gbps per toroidal link. The DNP-PCI Express interface was developed and a preliminary test of integration of microprocessor for better support RDMA operations was performed. A complete design of the APEnet+ prototype board was the result. 3.2.3. LQCD and PSNN ASIP Design During the first year of activity, the ASIP SDK technology has been extended by TARGET with new methods for checking the suitability of a processor model for C compiler support, advanced on-chip debugging capabilities and a new graphical integrated development environment. Then, an initial feasibility study was made on the design of two ASIPs for the scientific numerical processing tasks envisaged in the project (LQCD and PSNN). 3.2.4. System-Level Programming Framework In 2010, DAL and its main concepts have been specified and the corresponding DAL API has been established. The DAL specification document, including the basic DAL description, API, and interfaces with other work-packages has been sent to all partners, and the key issues are summarized in deliverable D1.1 “Report on Brain-Inspired Many-Process System SW Requirements” (delivered at M12). During 2010, we developed a first implementation in a distributed functional SystemC simulation that can check the correct functionality of multiple concurrent applications, dynamic mapping and re-mapping strategies, as well as some fault-tolerance features. For the following EURETILE project periods, (i.e. starting from 2011) we planned an advanced implementation of the distributed functional simulation to be used by all partners, as basis for a bug-free application development, support for the final HdS implementation, and source of first results in terms of performance analysis and system optimization. 3.2.5. Scalable Simulation Environment This area of activity is led by RWTH, in cooperation with the other partners. The main target of the scalable simulation environment is to support the development and validation of system hardware/software and applications. This activity comprises four different areas: Abstract simulation, parallel simulation, debugging support and fault injection. Since the beginning of the project, work on the following topics has been performed: Abstract simulation: The Hybrid Processor Simulation (HySim) has initially been deployed on ARM and magic processors within the SHAPES project. In the meantime, the HySim engine has been restructured for easier porting and improved to support more complex applications, such as those that will be part of EURETILE. In addition, an extension to this concept for the purpose of fast Network-on-Chip simulation has been investigated on an exemplary tiled platform. A satisfactory initial model has been tested and a full integration in the simulation flow will follow. Parallel simulation: In 2010, research on parallel simulation that was started during the FP7 SHAPES project has been continued. Furthermore, a mixed-level parallelized simulation of a tiled computing platform has been created. It consists of basic tiles with processing elements and local memory, which are connected by packet routers. The simulation was exhibited at DAC 2010, and the technical details were presented at CODES/ISSS 2010. Debugging support: Novel debugging techniques to lower the complexity of MPSoC software development on the EURETILE system were specified and presented to the project partners. Such techniques are based on the advanced visibility, controllability and determinism of virtual prototyping, and aim at finding software malfunctions caused by concurrent inter-tile and intra-tile 18 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing activity. The implementation of debugging support to cope with current simulation technology used in EURETILE will be covered during next project stages. Fault injection: Discussions are on going with hardware and system software partners, regarding which kinds of faults can be handled by the EURETILE system. These faults will then be modelled and supported for injection using the system simulator implemented. 3.2.6. Hardware-Dependent Software UJF-TIMA is responsible of providing HdS for the SW tool-chain able to generate binary codes for processors on the HW platform. We define hardware-dependent software (HdS) to be “software directly dependent on the underlying hardware.” UJF-TIMA is in charge of providing HdS, which includes OS services and low-level software. The main challenges for HdS generation come from the brain-inspired paradigm and the hierarchical architecture. This may imply some dynamic changes during execution, such as new task running on processor for new application or a failure detected somewhere in the architecture, as the brain is naturally fault-tolerant with redundancy. For that reason, we are dealing with fault tolerance aware software services provided by HdS and real time properties as well as new control mechanisms. New control mechanisms concern the overall architecture and control organization: distributed, centralized or a hybrid version. In 2010, this has been still an on-going work. An emerging solution for fault tolerance seems tasks migration. But this is really challenging in NUMA architecture, non-SMP, and in a hierarchical architecture. Task to be migrated is supposed to have reached a specific point of execution, and a copy of all what is needed to restart this task on another processor (stack, registers, memory, task code, cache?) will be sent. The starting point of EURETILE is an in-house OS (called DNA-OS developed for the previous FP6 SHAPES project) running on each processor of the architecture. During 2010, DNA-OS has been extended to include all what was missing for SMP system and task migration, that was the first step to move forward the EURETILE context. DNA-OS is running on ARM processors, as well as other architectures (SPARC V8, MIPS R3000, mAgicV,) Control mechanisms and task migration are based on an efficient communication infrastructure and SW drivers. This has been consolidated with an automatic driver selection and specialization regarding communication protocol selected and requirements. 19 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.3.Work Performed and Achieved Results in 2011 (Second Year) This section is a record of activities and results obtained during the second year of the project, and the technical content has been maintained as in the original yearly reports to maintain an historical track of the project flow. Next sections (3.4) describe the project evolution in 2012. 3.3.1. Definition of Fault Aware Architecture During 2011, INFN proposed to the consortium a novel HW design paradigm, named “LO|FA|MO”, which creates a systemic awareness of faults and critical events, thanks to a distributed approach that uses additional hardware components on each DNP, and needs dedicated software components running on each tile to create a local awareness of faults and critical events. This local awareness is then propagated along the system hierarchy. Onto such local and systemic fault awareness, a software approach to fault reactivity can be grounded, which has been proposed by ETHZ at the end of 2011. From a system-level perspective, two fault reactivity strategies have been investigated in WP3 and first ideas have been implemented in the Distributed Application Layer (DAL), namely fault recovery and fault tolerance. Figure 3-5 - The Network Processor of each leaf in the many-tile HW system is equipped with its own LO|FA|MO components. The Local Awareness of faults and critical events is propagated towards the upper hierarchy levels, creating Systemic Awareness. Reactions to faults and critical events could be autonomously initiated by sub-system controllers or could require a systemic response. 3.3.2. Challenging Application Benchmarks We have three benchmarking areas: DSP/Data Flow Oriented, PSNN-Brain Simulation and Lattice Quantum Chromo Dynamics. 20 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing During 2011, several application benchmarks have been implemented as distributed application layer (DAL) specifications. About DSP/Data Flow Oriented, at ETH Zurich, several DAL-compliant applications have been specified, of which the most significant are a picture-in-picture application consisting of two parallel MJPEG decoders, and the kernels of a fast-Fourier transformation, and matrix multiplication. These applications are included in the DAL distribution and can be downloaded from http://www.tik.ee.ethz.ch/~euretile. Topologically, the applications consist of a task-level parallel specification in the form of individual process networks and an application-level parallel specification, expressing dynamic application scenarios, in the form of a finite state machine. The DAL framework is then capable of deciding on the mapping or remapping of applications/processes as well as to investigate some key features related to application’s fault management. In particular, case studies of the picture-in-picture application have been designed to demonstrate the parallel execution of multiple applications, as well as basic DAL actions such as starting, stopping, pausing, and resuming the different videos, together with the implementation of the control infrastructure. Moreover, distributed mapping and remapping of individual component processes are investigated. Basic fault management can be illustrated at mapping level, where applications residing on damaged cores are smoothly redirected towards reserved healthy cores. These investigations open the way for further research and design options, such as process level redundancy for critical applications, and the on-line exploitation of pre-calculated performance tradeoffs. PSNN. About the study of Brain Simulation, used as benchmark and as a drive source of architectural concepts, during 2011 we produced a first version of D-PSNN, the natively Distributed – Polychronous Spiking Neural Network Benchmark. The benchmark has been compiled and run to initialization a “toy-scale” network in two frameworks: the DAL environment (C++ plus XML) and a “standard” C++ plus MPI context. The coding has been executed after: 1- The production of a list of “computationally Inspiring” review of biological facts from experimental and theoretical neuroscience; 2- A complete “reverse engineering” of a sequential reference PSNN code, to grasp all details and understand the blocking point against parallelization. LQCD. The INFN team has a multi-decennial experience on Lattice Quantum Chromo Dynamics, and a multi-process representation of the problem available. Starting from 2012, LQCD will be used to validate the new features associated to dynamism and fault tolerance developed by ETHZ in 2011. During this year, we performed a quantitative reassessment of bandwidth and latency requirements, taking in account the characteristics of the EURETILE HW platform. 3.3.3. Innovation on HW Intellectual Properties and design tools In 2011, in addition to the definition and first implementation of the LO|FA|MO fault awareness system, INFN main achievements were the delivery of a refined DNP component and the introduction of APENet+ and QUonG hardware prototypes. On the ASIP development side TARGET designed a specific ASIP architectures, optimised for application domains targeted by the project. The DNP released at the end of 2011 is a powerful, robust and faster design thanks to the introduction of specialized hardware to speed-up PCIe side transactions as well as the 3DTorus transfers. The APENet+ final board, integrating the last release of DNP IP, was produced in pre-series (4 boards) and validated with extensive test sessions. 21 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing Figure 3-6. APENet+ Board produced in 2011. INFN also put in production a reduced prototype of QUonG system, the hybrid parallel cluster selected as the HPC Euretile platform. 3.3.3.1. DNP Innovation. During 2011 INFN executed several refinements of the DNP IP in order to get a more robust and faster design. In particular we focused on the optimization and improvement of the “network interface” block adding dedicated hardware logic to improve RDMA tasks execution and speeding-up the recently introduced hardware block implementing GPU peer-to-peer protocol (a very brand new concept for the current commercial network cards). Some work was also devoted to the enhancement of physical links interface and to the optimization of the FPGA embedded microprocessor (NIOSII) firmware. In addition we also started to define the architecture and planning the design of the hardware blocks required to implement the LO-FAMO fault tolerant mechanism in the EURETILE platform demonstrator. APEnet+ innovation. INFN introduced the first release of the APEnet+ board, the DNP-based, PCIe board implementation of the 3D Torus network, featuring 6 fully bidirectional links with 34 Gbps of raw bandwidth per direction. With the integration of the P2P Enabled DNP into its high-end FPGA, APEnet+ is the first non-NVidia device with specialized hardware blocks to support the NVidia GPU direct peer-to-peer inter-GPU protocol. During the 2011 we produced and tested a set of 4 APEnet+ prototypes on which we performed a preliminary bandwidth and latency analysis obtaining very good results in terms of access latency reduction. QUonG innovation. QUonG, the successor of the former APE supercomputer and the prototype of the HPC EURETILE platform, is a hybrid INTEL server x86-based cluster accelerated using NVidia GPUs and interconnected by APEnet+ 3D Torus network. 22 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing In 2H11 we initiated the procurement phase of QUonG reduced prototype (25 TFlops) to be upgraded to a full “QUonG tower” system, capable of a peak performance of ~65 TFlops, during 2012 and 2013. The QUonG tower will be made available to the Euretile collaboration to perform tests and software development. 3.3.3.2. ASIP Design Tool Improvement. The Euretile consortium’s approach towards the design of ASIP is to use a retargetable tool-suite based on a processor description language. The tool-suite supports architectural exploration, the generation of a software development kit, and the generation of an RTL hardware implementation of the ASIP. TARGET’s IP Designer tool-suite is used for this purpose. In project year 2011, TARGET has developed a number of new extensions and optimizations for its retargetable tool-suite. These activities are part of WP6. These developments focussed on two main topics:  A new methodology has been defined to model memory and communication interfaces of ASIPs.  New techniques have been developed and implemented to provide enhanced feedback to users of the retargetable tool-suite during the architectural optimisation process. 3.3.3.3. LQCD ASIP Design. In project year 2011, we started the development of specific ASIP architectures, optimised for application domains targeted by the project. These activities are part of WP6, and were carried out by TARGET in cooperation with INFN. More specifically, an efficient ASIP for LQCD has been designed using the IP Designer tool-suite. The ASIP has been named “VCFLX” (referring to Vector Complex Floating-point – Flexible”). Benchmarking shows that a single VCFLX ASIP can implement LQCD 33x faster than a 32-bit floating-point CPU and 4x faster than the mAgicV DSP. About 50 instances of the VCFLX ASIP can fit on a single Virtex-7 FPGA, thus speeding up LQCD even further, provided that the FPGA’s RapidIO fast communication channels can be used to achieve a sufficiently high communication bandwidth. 3.3.4. System-Level Programming Framework (DAL) During 2011, in the frame of WP3 led by ETHZ, the second complete prototype of the distributed application layer (DAL) has been implemented and the consolidation of DAL underlying concepts has been done in line with all project work-packages and tools. Distributed application layer (DAL) is a system-level programming environment for many-core architectures that considers dynamic application scenarios, i.e. applications that may appear and disappear dynamically at runtime. At the same time, the approach allows designers to handle at system-level faults that occur at runtime. In particular, besides mapping optimization of applications to the EURETILE platform, DAL provides the environment for remapping or restarting applications in case of changes in the application scenarios or in case of permanent system faults. However, providing timing guarantees for applications remapped/restarted due to faults that occur arbitrarily at runtime is hard. Therefore, in DAL additional methods are investigated such that specification, generation, and analysis of redundant task graphs for so-called critical applications with real-time constraints. As a result of 2011 efforts, the second DAL prototype has been made available including the complete specification, a functional simulation that is automatically generated from the initial specification, several case studies demonstrating the capabilities of DAL, and a complete 23 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing documentation, see http://www.tik.ee.ethz.ch/~euretile. As well, to make the tool-chain complete, basic tools are included for performance analysis, search in the design space, and mapping optimization under specific platform constraints. The key challenges encountered by application programmers when designing applications using DAL are in a fist instance exposing the process-level parallelism in the application, and second, exposing application-level concurrency and dynamism in a formal programming model. Additional challenges are in exposing fault-awareness of the system early in the design and deciding among proposed fault management strategies. To answer all these challenges, the DAL functional simulator has been developed as a tool for application programmers, to test and profile their applications early in the design, on top of an ordinary computer system. Technically, the DAL functional simulator version made available at the end of 2011 has been running on top of Linux and uses POSIX threads to execute DAL processes that simply communicate via the shared memory of the Linux system. Additionally, a specific process network designed for the hierarchical control of application-level dynamism is first computed out of the specification, automatically generated during the synthesis step, together with the functional simulator, and then loaded when the system is booting-up. The design space exploration tool provides the mapping information. It consists of a set of mappings, each one valid for a set of application states. This set is compiled into the master controller that provides the basic process management instructions for the slave controller, such as starting, pausing or restarting a task as well as installing communication channels and the corresponding memory. In the proposed functional simulator virtually all main DAL concepts can easily be tested. Therefore, such a functional simulator is enabling the fast development and test before porting the DAL design to the target EURETILE platform. Moreover, such a fast development prototype is opening the way for further research in the areas of performance analysis, mapping/remapping optimization, and faultawareness offering all functional capabilities of the EURETILE system, and hiding all low-level details and parallel development of the hardware-dependant software. 3.3.5. Scalable Embedded Computing Simulation Environment (VEP) During 2011, work has been performed by RWTH related to the simulation environment on the following topics: VEP-EX simulator: The base version of the VEP-EX simulator has been realized and distributed to the partners. The VEP-EX simulator offers two different selectable computing elements: Either the IRISC processor instruction set simulator is used, or alternatively an abstract execution device (AED) is employed. The AED is a SystemC module that can load host-compiled shared libraries containing code to execute inside the simulator environment. This mechanism is used to ramp up DNP drivers and test software before the actual tool-chain for the RISC processor becomes available. Introducing the AED is additional effort not originally part of the project plan. It has become necessary as a bridging solution until the RISC software tool-chain becomes available. Debugging support: A debug technique for concurrent software running on heterogeneous multicore systems was developed in order to set the grounds for a preliminary debugger framework for the EURETILE system. This new technique, named Event-based Bug Pattern Descriptions (EBPD), adds automation for debugging by using assertional techniques similar to those in formal verification and can be easily retargeted to cover different programming models and systems. Some building blocks of the underlying debugger architecture, like the BPD grammar, the BPD compiler, the Event Monitor (EV) and the Sequential Consistency Analyser (SCA), were developed and evaluated in 24 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing simpler multi-core systems. Common bug patterns in concurrent software were also described using the BPD grammar in order to start populating a database of well-known patterns. Abstract simulation: The HySim technology, legacy of SHAPES, has been enhanced in two ways. Firstly, the framework has been redesigned to support a class of conceptually different processor architectures, namely customizable cores, and a more profound way of processor state synchronization between the native and the target processors has been introduced. Secondly, a time synchronization mechanism has been introduced, to enable the support for multi-core or any platforms relying on timing, like those including watchdogs or timeouts. Apart from that, some preliminary experiments were conducted on a multi-core TLM2.0 platform, to evaluate the hybrid NoC simulation. Parallel simulation: In collaboration with Synopsys, Inc., parallel simulation has been further researched, with focus on applicability to systems currently used by industry. Fault injection: Faults possible to simulate have been investigated and identified, and there are no known conflicts with other work packages. As a first step, packet probe blocks have been introduced into the VEP-EX simulation model. Such probes allow dropping or corrupting packets on links between two given DNPs in a custom fashion. 3.3.6. AED integration with DNP driver software During 2011, RWTH and INFN ported DNP device drivers previously written by INFN to the AED. First, the basic DNP RDMA API was ported, which enabled AED software to conduct DNP PUT/GET/SEND operations. After the low-level RDMA API was put into place, the next-higher level Presto communication API has also been ported to the AED, which now enables AED software to conduct synchronous blocking send and receive operations using the DNP 3D torus network. Communication partners are addressed by their respective communication rank in the Presto API. Further on, being able to run DNP driver code natively on the host using the AED simplifies debugging of such driver code. This is especially true in the event of many cores communicating with each other simultaneously. AED test applications are currently used as software to further develop the fault-aware DNP model. 3.3.7. Hardware-Dependent Software (HdS) We can split the TIMA contribution and work in 2011 in two main points: port of DNA-OS on top of the target processors and platforms, and specification of research development to reach the overall objective of EURETILE. Port of DNA-OS: We have ported DNA-OS on top of two new processors: iRiSC (RISC) and x86 (CISC). The port on top of the iRiSC has been started in the last quarter of 2011, after getting development tools from Synopsys for the iRiSC processor, including compiler, linker, simulator, As no architecture has already been provided during 2011, only the kernel of DNA-OS has been ported. C library and peripherals (drivers) are still an on-going work and remain to be done in 2012. For x86, the kernel has been ported on the x86 architecture with standard peripherals like timers. Standard library is also de facto available after re-writing specific functions (printf,) to fit with peripherals. Moreover, we manage to provide a booting version on USB stick or on x86 simulator (QEMU based) with a simple application using semaphores, multi-threading, timers Regarding TIMA main contribution on EURETILE, providing task migration on top of NUMA (and non-SMP) architectures, we are looking at virtualization to provide multi-application support as well as other features previously planned for this project. We are following two different tracks: improving DNA-OS to support virtualization, or using an existing virtualization solution (OKL4 25 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing provided by NICTA-lab, Sydney, Australia) and adapting it to our requirements. Unfortunately, the OKL4 version we found freely available in 2011 has been an old version that needs an old software tool chain version and it runs only on ARM. As a conclusion, we are heading for a modification of DNA-OS, to provide virtualization support, as well as support for the DAL API described in the deliverable D_WP1_R1. The integration of DAL API for task migration support was still under development at the end of 2011. 26 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.4.Work Performed and Achieved Results in 2012 (Third Year) 3.4.1. System-Level Programming Framework (DAL) During 2012, in the frame of WP3 led by ETHZ, the distributed application layer (DAL) has been finalized and its key concepts published. DAL is a scenario-based design flow that supports design, optimization, and simultaneous execution of multiple applications targeting heterogeneous manycore systems. In particular, the deliverable document produced by WP3 provides detailed insights in the high-level specification model for dynamic systems targeting many-core systems. Afterwards, a multi-objective mapping optimization algorithm is proposed for DAL. As the optimization problems seen in dynamic systems are relatively complex, the proposed technique uses problem decomposition to provide scalability. As many-core systems are prone to high chip temperatures, providing guarantees on maximum temperature is as important as functional correctness and timeliness when designing many-core systems. Thus, two thermal analysis methods for many-core systems are proposed in the WP3 2012 deliverable document. The first method estimates the temperature based on a set of application-specific calibration runs and associated temperature measurements using available built-in sensors. The second method is a formal worst-case real-time analysis method to provide safe bounds on the execution time and the maximum chip temperature. Finally, a hierarchical control mechanism is proposed and it is shown how the hierarchical control mechanism can be used to implement an automatic fault recovery mechanism. All the discussed concepts have been implemented in a prototype of the distributed application layer. In order to model the high-level specification, DALipse, a software development environment for DAL, has been developed in the frame of WP3. As a result of the 2012 efforts, DALipse is available as a plug-in for Eclipse. In addition, SADEXPO, a state- and architecture-based decomposition framework for mapping optimization is integrated in DALipse. In order to execute applications specified using the DAL paradigm on a distributed Linux cluster, a run-time environment has been implemented using the message-passing interface (MPI) as a communication layer. Finally, a software tool-chain has been developed that uses as input the high-level specification of a DAL benchmark and automatically generates code for the selected target architecture, i.e., a distributed Linux cluster. 3.4.2. Hardware-Dependent Software (HdS) The HdS activity during 2012 could be split in 3 different parts: basic architecture features (for x86based QUONG architecture and iRiSC-based VEP architecture), the DAL2binary tool chain generation code, and the state of the art of task migration for embedded systems. We can summarize in few words the main differences between the 2 architectures: - x86-based QUONG platform: This architecture is based on Intel multi-core x86 architecture. The DNP is accessible through the PCIe interface, as well as peripherals. This supposes the support of PCIe for our own operating system DNA-OS. - iRiSC based VEP architecture: This architecture is based on the iRiSC processor, with one processor per tile. Each tile includes the DNP, which allows connecting several tiles. There is no PCIe anymore, so the driver for the DNP is directly called by DNA-OS. For the x86-based QUONG platform, we have done several developments in 2012. - DNA-OS is now able to boot on multi-core Intel x86 processor. 27 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing - The PCIe support is now available in that context. We have developed a command interface (as an added DNA-OS service) to facilitate debugging or in-line command in a terminal. This includes a keyboard management. We have implemented of the DAL API: start, stop, pause, resume allowing to start, stop, pause and resume task on one processor. The support of Ethernet connection has been validated for x86 architecture in DNA-OS. It includes the lightweight IP (open source TCP/IP stack for embedded). Interrupt management support by DNA-OS for x86 standard architecture. 1 other specific development for the demos: graphical windows on bare metal x86 hardware architecture used by DNA-OS for frame buffer management of video screen. For the iRiSC-based VEP architecture, we have done one important development in 2012 as well. - DNA has been ported on iRiSC architecture and validated. - The DNP driver has been developed and validated on the iRiSC-based architecture. It is worth mentioning that this driver has been first validated on our own ARM-based simulation platform that includes DNP for multi-tile simulation environment. During 2012, the first version of the DAL2binary tool chain has been provided. This tool chain takes as input the DAL model, and depending on the target, it generates C code that should be compiled with DNA-OS and requested services to get the final binary code for each processor. Finally, the state of the art regarding the task migration for embedded system has been done as well to fit with the requirements of the EURETILE project depending on the target architecture. 3.4.3. Scalable Embedded Computing Simulation Environment (VEP) During 2012, research activities in simulation and debugging technologies were carried out that improved the VEP environment in terms of efficiency, scalability and usability for the project. The following concrete activities were performed in the simulation ecosystem: VEP-EX: On one hand, the VEP was extended to facilitate the validation of EURETILE’s main brain-inspired concepts. The simulator has been provisioned with a service network that completes the necessary artefacts to develop fault monitoring and awareness features across different EURETILE layers (i.e. DNP and HdS). On the other hand, new features to improve the VEP’s usability during software development tasks were added. User-configurable loggers and a visualization interface have been developed in order to provide better tracing, analysis and visualization of the software under execution and its output. Finally, some internal components of the VEP-EX were optimized in order to achieve higher simulation speed. Included optimizations help to avoid overhead of unnecessary events inside the SystemC kernel and data transactions in intercomponent communication routines. With these new optimizations alone the simulator executes ca. 2.2X faster than the previous version. Fault Injection: A fault injection framework has been created and coupled to the VEP-EX. The framework allows users to inject faults to the system with specific temporal and spatial characteristics, while avoiding the manipulation of complex simulator source code. By using a formalized XML specification of faults, it is possible to force the manifestation of the same faults 28 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing repeatedly across different simulation executions. This guarantees deterministic faulty scenarios and facilitates the development of fault aware components in different EURETILE layers. Parallel Simulation: The parSC kernel, which was conceived in SHAPES and matured during the previous years of EURETILE, has been used together with the VEP-EX in order to accelerate its execution speed. The use of parSC in EURETILE posed new challenges to guarantee the simulator determinism and its compatibility with legacy sequential models. New technologies were developed (i) to facilitate the integration of legacy models in a practical way and (ii) analyse nondeterministic traits in SystemC code that might lead to functional anomalies (i.e., the SCandal tool). These new technologies were presented in FDL’12 and HLDVT’12, and a joint paper by RWTH, INFN and Synopsys was accepted for publication at VIPES’13. After guaranteeing the simulator determinism, the VEP-EX with parSC was found to achieve a speed-up of ca. 7.77X over the previous version (including the other speed optimizations added to the VEP). Debugging and Profiling: The event-based multi-tile debugger architecture developed in previous years was improved to attain higher retargetability and scalability. Event monitoring in the framework was re-designed as a new component-based system, which facilitates the definition of custom monitors for different OSs and target processors. A well-defined event-based intermediate representation (EIR) was also developed that facilitates the abstraction of complex low-level details of target hardware and OSs into events at a level of abstraction useful for systematic debug. To attain higher scalability, the debugger’s structure was organized into a tree-like network of event monitors that allows distributing and parallelizing the debugger itself when dealing with massively parallel systems. Some of the components of the debugger infrastructure have been ported to target the VEPEX processing components. The new multi-core debugger architecture was presented in S4D’12. Additionally, a new scriptable, interactive command line interface (CLI) was added to the VEP-EX to allow defining custom automatic debug and profiling tasks. The CLI allows extending basic debug and inspection APIs of the VEP through the TCL programming language. 3.4.4. HW support to Fault Awareness Fault-tolerance issues has been addressed in EURETILE since 2011 with the LO|FA|MO HW/SW approach, whose principles presented in deliverable D6.1 (to be published) have been applied in the DNP SystemC model and lately demonstrated over the VEP simulator at the 2012 review meeting (activity reported by D5.2). The “fault awareness” activities in 2012 focused on the implementation of LO|FA|MO mechanism for the EURETILE HPC experimental platform, and resulted in a consolidated specification of the LO|FA|MO approach, the integration of the VHDL code of DNP Fault Manager in APEnet+ hardware, the introduction of a controller of the diagnostic messages flow over the 3D Torus Network (the Link Fault Manager, LiFaMa), and the first implementation of the Host Fault Manager as a Linux daemon. In the current implementation the Nios II micro-controller performs the reading process of the FPGA sensors over the Avalon Bus and we foresee to implement a technique to transfer the information to the DNP status registers. The new functional blocks were also verified through an extensive test session. 3.4.5. DNP and APENet+ Innovations During 2012, the integration of the complete DNP IP in APEnet+ hardware system allowed real tests of APEnet+ architecture in the final environment. 29 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing First, INFN released a library of test programs based on synthetic and real application kernels and performed extensive test sessions to measure bandwidth and latency in different conditions. Benchmark results were used to optimize specific hardware blocks impacting on system performances. In particular we executed some re-design activities on 3D links sensible obtaining channel bandwidth enhancement and a more robust transfer protocol. Further activities were also devoted to optimization of the APEnet+ host interface where the PCIe protocol shows high latency that has to be controlled and minimized: the Host Interface TX block has been completely re-designed and the software interface accelerated moving some critical tasks to FPGA custom hardware blocks. In cooperation with TARGET, preliminary evaluation of effects of introduction on RX RDMA path of a TLB (Translation Look aside Buffer) for virtual to physical address translation has been performed. The P2P GPU interface was improved and heavily tested achieving good results in terms of bandwidth enhancement and small packets latency reduction. In order to explore future systems development activities in 2012 we executed the porting of our DNP IP design on state-of-the-art FPGA devices that, built using a 28nm silicon process, show impressive amount of internal user-available resources and huge number of high speed transceivers. The preliminary evaluation and synthesis activities showed very encouraging results: the DNP logic occupation is limited to 15% of a medium size devices (allowing architecture improvement through introduction of new computing/specialized hardware) while its I/O throughput can double thanks to the use of the 28nm devices improved transceivers. Software activities focused on system software bug fixing, performance optimization and development of new modules supporting hardware innovations. Highlights here are the release of a VEP interface for Presto programming environment and the development of APEnet+ API OpenMPI layer to support DAL on APEnet+ platform. Furthermore, in collaboration with UJF, a DNA-OS prototype driver specific to the APEnet+ hardware has been analysed and a simple program produced by the DNA-OS tool chain, running on x86 and setting selected APEnet+ board registers through the PCIe was coded. Several exploitation activities are also in place from 2012. In particular we demonstrated the advantages of DNP/APEnet+ architecture introduction in high-level trigger systems of the current and future High Energy Physics colliders. In this framework the APEnet+ features, one for all the GPU Direct P2P mechanism assuring low access latency to numerical accelerators, and its implementation FPGA-based allowing IP re-configurability and specialization, can reduce data transport overheads and can increase the time budget for trigger computing. 3.4.6. ASIP support to RDMA EURETILE’s many-core platforms critically depend on efficient packet-based communication between tiles in the 3D network. Efficiency refers to both high bandwidth and low latency. Our observation for the HPC platform is that the current DNP implementation, which includes firmware running on a NIOS soft-core from Altera, offers high-bandwidth communication, but with a too high latency. To reduce the latency, a significant acceleration of networking functions (e.g. buffer search, virtual-to-physical address translation) is needed. During 2012, TARGET in cooperation with INFN started the development of a softwareprogrammable DNP architecture using ASIP technology. These activities are part of WP6. A first version of a DNP ASIP has been modelled and optimised, using the IP Designer tool-suite. The basic 30 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing architecture is a 32-bit microprocessor. Adding dedicated hardware and instructions to accelerate the buffer-search functionality for RDMA tasks has further optimised the architecture. As a result, the cycle count of typical buffer-search firmware programs has been reduced by more than 85% compared to the existing implementation on NIOS. Currently the clock frequency of the ASIP is still lower than that of NIOS. Nonetheless, buffer search already executes significantly faster on the ASIP compared to NIOS, and moreover further cycle-time improvements are within reach. 3.4.7. ASIP Design Tool Improvement. EURETILE’s approach towards the design of ASIPs is to use a retargetable tool-suite based on a processor description language. The tool-suite supports architectural exploration, the generation of a software development kit, and the generation of an RTL hardware implementation of the ASIP. TARGET’s IP Designer tool-suite is used for this purpose. During 2012, TARGET developed new extensions and optimisations for the retargetable tool-suite, with specific relevance to the other Euretile activities. These tool development activities are part of WP6. In particular, we focussed on the following topics:  We continued the work on the development of advanced capabilities for modelling and synthesis of I/O interfaces of ASIPs. While the basic concepts behind this new approach were already reported last year, this year we have delivered a first implementation of the new concepts, and tested it by modelling and synthesising first example I/O interfaces.  The tools have been extended with capabilities to model multithreaded architectures. This includes the generation of hardware support for storing the context of a thread upon a context switch, as well as C programming aspects. Finally we developed and implemented additional capabilities to provide feedback to users of the retargetable tool-suite during the ASIP architectural optimisation process. Specifically, the tools can now analyse and report about connectivity issues within an ASIP architecture. 3.4.8. HW Experimental Platform Prototype (QUonG) During 2012, INFN completed the procurement and assembly phase of a 16 nodes QUonG system, a 16K core, 32 TFlops peak single precision computing platform with a 4x2x2 topology. All required servers and GPU accelerators were procured from H1-2012 while a batch of 15 APEnet+ boards were delivered in September 2012 and put in Figure 3-7. 16 nodes QUonG prototype in 2012 31 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing place in H2-2012. Furthermore, a 12 APEnet+ boards addictive production was launched in H2-2012 and the boards will be delivered in February 2013. In parallel a reduced QUonG platform prototype (8 nodes, 2x2x2 topology) was heavily tested to validate systems hardware and software and to provide a prototype system to develop applications. In addition to the EURETILE scientific applications and benchmarks, the QUonG prototype (with and without APEnet+ network) was validated through the successful execution of several grand challenges application kernels among them the Heisenberg Spin Glass code (HSG), the Graph500 benchmark, Laser-Plasma Interaction simulation and preliminary HEP trigger related algorithms. 3.4.9. DPSNN-STDP: Distributed Polychronous and Plastic Spiking Neural Net Figure 3-8. Collective spiking rastergram and individual neuron activity produced by DPSNN-STDP. 32 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing During 2012, we designed and implemented the C++ code of a complete prototype of the DPSNNSTDP simulator (Distributed Polychronous Spiking Neural Net with synaptic Spiking Time Dependent Plasticity). Then we run the full simulation cycle (initialization and dynamic phases of a network including 10^5 synapses) in the C++ plus MPI environment on a QUONG prototype, using an industry standard interconnection system (InfiniBand switched fabric), reproducing an identical behavior with different number of processes. We ported and run the initialization phase of the DPSNN-STDP code under the DAL plus C++ environment, and executed it on a prototype environment where two QUONG nodes were interconnected by two APENet+ card. We used the same C++ classes as building blocks to construct the DAL and MPI network of processes. This will permit, during 2013, to start a comparison activity between the APENet+ interconnect system and the InfiniBand system, and among the performances offered by the DNA-OS, MPI and Presto message passing software layers, when applied to the DPSNN-STDP benchmark. Then we will identify the middleware and hardware bottlenecks, and derive architectural improvements for future generations of interconnect systems. 3.5.Plans for 2013 - 2014 activities The prototypes of the Experimental hardware platform (QUonG), of the simulator (VEP), and of the integrated software tool-chain based on the DAL programming environment and on the EURETILE HdS should be delivered before the end of 2013. By the end of the 2013, each work-package will have demonstrated working prototypes about fault management, description of application dynamism and support of scalability. During 2013, the consortium will elaborate a more complete picture about those subjects and, taking as example the fault management area, reduce the distance between what each partner is doing to detect and manage faults and what is actually done at integrated level. By the end of 2013, we plan to have completed the porting of the full DPSNN-STDP cortical simulator on the EURETILE platform and started a campaign of measurements to identify the most promising areas of architectural improvements. A possible extension of the project end until September 2014 is under evaluation. At project level, we foresee a few main topics that should be covered during 2014:  Qualitative assessments and quantitative measurements. The availability of the integrated EURETILE system would enable a more extensive campaign of qualitative evaluations and quantitative measurements of our integrated software and hardware platforms and development environment. This way, the consortium could elaborate about the main EURETILE merits and further developments that we perceive necessary on the bases of an adequate temporal period dedicated to the evaluation of the platform developed.  Better integration of management’s methods of fault, application dynamism and scalability. During 2014, the existing demonstrators would be improved toward greater system integration. We will also develop benchmarks dedicated to show application dynamism and use the benchmarks to highlight the fault-tolerant behaviours.  Brain-Inspired enhancements. During 2014, we will start experiments about hardware and software improvements derived from the experience gained thanks to the run of the DPSNNSTDP benchmark. 33 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.6. The SHAPES Project Background (2006-2009) As the EURETILE project is an evolution of the SHAPES FP7 project, we insert here a summary of the features of that project that has been relevant for the EURETILE project. 3.6.1. 2006 SHAPES Project Abstract There is no processing power ceiling for low consumption, low cost, dense Numerical Embedded Scalable Systems dedicated to future human-centric applications, which will manage multichannel audio, video and multi-sensorial input/outputs. Nanoscale systems on chip will integrate billion-gate designs. The challenge is to find a scalable HW/SW design style for future CMOS technologies. The main HW problem is wiring, which threatens Moore’s law. Tiled architectures suggest a possible HW path: “small” processing Figure 3-9. SHAPES Architecture template tiles connected by “short wires”. A second HW problem is the management of the design complexity of billion gate designs. A tiled design style extensively reuses processing tiles, each tile composed of stable Intellectual Properties requiring only a few million gates: a manageable complexity. The SW challenge is to provide a simple and efficient programming environment for a (massive) tiled parallel architecture. The proposed approach must be experimented through applications. 3.6.2. Investigation of the tiled HW paradigm SHAPES investigated a ground-breaking HW/SW architecture paradigm. A typical heterogeneous SHAPES tile is composed of a VLIW floating-point DSP (Digital Signal Processor), a RISC controller, a DNP (Distributed Network Processor), distributed on chip memory, a POT (a set of Peripherals On Tile) plus an interface for DXM (Distributed External Memory). Each Tile includes a few million gates, for optimal balance among parallelism, local memory, and IP reuse on future technologies. The SHAPES routing fabric connects on-chip and off-chip tiles, weaving a distributed packet switching network. 3D next-neighbours engineering methodologies have been studied for off-chip 34 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing networking and maximum system density, see the Figure 3 on previous page. SHAPES opened the path towards new density records, with multi-Teraflops single-board Tiled computers and Petaflops systems. 3.6.3. Experimentation of real-time, communication aware system SW SHAPES adopted layered system software, which does not destroy the information about algorithmic parallelism, data and workload distribution and real-time requirements provided by the programmer. The system software should be fully aware of the tiled hardware paradigm. For efficiency and predictability, the system software manages intra-tile and inter-tile latencies, bandwidths, computing resources, using application- and architecture-level profiling. (a) Application description using the Process Network formalism and a simplified representation of the SHAPES tile. (b) Mapping of the application process network on the SHAPES tile The application is described, using a model based approach, in terms of a network of actors, with explicit realtime constraints. Figure 4a shows an illustration of the application description). The application is mapped to the SHAPES architecture by an iterative automated (or semi- Figure 3-10. (a) Application description using the Process Network automated) multi-objective formalism and a sumplified representation of the SHAPES tile. (b) optimization. The mapping procedure Mapping og the application process network onthe SHAPES tile. uses performance estimations obtained at different levels of abstraction, i.e. system-level analytic predictions based on results of the low-level simulation environment. Figure 4b shows a mapping representation. The layered structure of the software separates the application code from the Hardware-dependent Software (HdS). Therefore it is possible to debug the application and system software layers independently and obtain higher simulation speeds. The application can be debugged using a virtual architecture, which is agnostic of the HdS details and the real hardware properties. The HdS generator refines the system software, first through a transaction-accurate step, and then down to the virtual prototype level (i.e. using the virtual Shapes platform – VSP), where the generated system software contains all the details needed in order to be executed on the actual hardware platform.Figure 5 shows the different components of the SHAPES SW environment as well as their interactions. In EURETILE, this concept of the SW environment, the interfaces between the various tools and the software design flow will be adapted towards the new challenges imposed by the threelayer hierarchy and the dynamic adaptation capabilities. 35 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing application analysis, mapping, code generation Model Compiler Functional Simulator mapping information Analytic Estimator trace information component interaction, properties and constraints Exploration HdS Generator component source code Virtual Shapes Platform HdS source code memory mapping source code binary Compiler Link Dispatch OS services binary libraries composed binary optimised compilation, simulation Figure 3-11. SHAPES software environment: overview. The software accesses on-chip and off-chip networks through a homogeneous interface. The same hardware and software interface can be adopted for integration with signal acquisition and reconfigurable logic tiles. Generation after generation, the number of tiles on a single-chip will grow, but the application will be portable. The SHAPES HW and SW platform has been benchmarked through a set of applications characterized by a large inherent parallelism and, with one exception, by real-time constraints: wave field synthesis for array of sound sources reproduced by large arrays of loud-speakers, treatment of audio signals acquired by arrays of microphones, Ultrasound Scanners, and simulation of Theoretical Physics (Lattice Quantum-Chromo Dynamics). SHAPES proposed a programmable, high performance, low power, dense system solution designed for interfacing with reconfigurable logic and signal acquisition and generation systems. The architecture is designed to scale from:  low end single module hosting 1-8 tiles for mass market applications  classic digital signal processing systems like radar and medical equipment (2 K tiles)  high-end systems requiring massive numerical computation (32 K tiles) 36 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 3.6.4. DIOPSIS940HF MPSOC and SHAPES RISC + mAgic VLIW DSP + DNP Tile. ATMEL ROMA, partner of the SHAPES project, delivered (2008) the DIOPSIS940HF 130 nm CMOS silicon (RISC + mAgicV VLIW DSP MPSoC) and development board, which constituted the HW reference model for the SW simulator of the computational tile and led place & route trials on advanced technology (65 and/or 45 nm) to assess the scalability toward HW multi-tiling. During 2009, the consortium finalized the tape-out trial of an eight tiles chip using a 45 nm CMOS target technology, Figure 3-14. The SHAPES elementary tile: RISC + VLIW DSP + Distributed this way getting final Network Processor. figures for Area (56 mm2), Computational Power (25 GigaFlops), and Power Consumption (2.9 W). Each elementary hardware tile is a multi-processor, which includes a distributed network processor (for inter-tile communications), a floating-point Figure 3-13. Board mounting the DIOPSIS 940 HF RISC + mAgic VLIW DSP multi-processor. Figure 3-12. Eight SHAPES tiles placed&routed in 45 nm. VLIW processor (for numerical intensive computations) and a RISC processor (for control, user interface and sequential computations). The SHAPES Hardware tile was a joint design effort of the APE team of INFN (the Italian Istituto Nazionale di Fisica Nucleare) and ATMEL Roma (here, we take to opportunity to acknowledge the work of Federico Aglietti, Antonio Cerruto, Antonio Costa, Maurizio Cosimi, Andrea Michelotti, 37 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing Elena Pastorelli, Andrea Ricciardi and of all the designers of the DIOPSIS design center). University of Roma (Prof. Alessandro Trifiletti and Giuseppe Scotti, among the others) played a key role in the place & route on the target 45 nm CMOS technology of the 8 tiles SHAPES chip shown in the picture. ST Microelectronics (Marcello Coppola and his team), University of Cagliari (prof. Luigi Raffo and his team) and Pisa (Prof. Luca Fanucci and his team), evolved the Spidergon Network-onChip to be used for inter-tile communication, attached to the Distributed Network Processor designed by INFN. 38 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 4. Dissemination During this period, the EURETILE project produced:  A set of publications and presentations describing the EURETILE results, listed by the first sections of this chapter;  The CASTNESS’11 workshop (Roma, 17-18 January 2011). Twenty speakers, representing the four Teradevice Computing projects (EURETILE, TERAFLUX, TRAMS and SooS) presented their activities to about 60 researchers. The last section of this document details the lists of presentations and participants. 4.1. Papers - Posters - Technical Press – Newsletters ETHZ             P. Kumar, and L. Thiele. Behavioural Composition: Constructively Built Server Algorithms. Proc. 5th Workshop on Compositional Theory and Technology for Real-Time Embedded Systems, San Juan, Puerto Rico, p. 9-12, Dec. 2012. P. Kumar and L. Thiele. Quantifying the Effect of Rare Timing Events with Settling-Time and Overshoot. Proc. IEEE Real-Time Systems Symposium (RTSS), San Juan, Puerto Rico, p. 149-160, Dec. 2012. S.-H. Kang, H. Yang, L. Schor, I. Bacivarov, S. Ha, and L. Thiele. Multi-Objective Mapping Optimization via Problem Decomposition for Many-Core Systems. Proc. IEEE Symposium on Embedded Systems for Real-Time Multimedia (ESTIMedia), Tampere, Finland, p. 28-37, Oct. 2012. L. Schor, I. Bacivarov, D. Rai, H. Yang, S.-H. Kang, and L. Thiele. Scenario-Based Design Flow for Mapping Streaming Applications onto On-Chip Many-Core Systems. Proc. Int'l Conf. on Compilers Architecture and Synthesis for Embedded Systems (CASES), Tampere, Finland, p. 71-80, Oct. 2012. D. Rai, H. Yang, I. Bacivarov, and L. Thiele. Power Agnostic Technique for Efficient Temperature Estimation of Multicore Embedded Systems. Proc. Int'l Conf. on Compilers Architecture and Synthesis for Embedded Systems (CASES), Tampere, Finland, p. 61-70, Oct. 2012. L. Schor, H. Yang, I. Bacivarov, and L. Thiele. Thermal-Aware Task Assignment for Real-Time Applications on Multi-Core Systems. Proc. Int'l Symposium on Formal Methods for Components and Objects (FMCO) 2011, Turin, Italy, Volume 7542 of LNCS, p. 294-313, Oct. 2012. L. Schor, H. Yang, I. Bacivarov, and L. Thiele. Worst-Case Temperature Analysis for Different Resource Models. IET Circuits, Devices & Systems, Volume 6, Issue 5, p. 297-307, Sep. 2012. K. Huang, W. Haid, I. Bacivarov, M. Keller, L. Thiele. Embedding Formal Performance Analysis into the Design Cycle of MPSoCs for Real-time Streaming Applications. ACM Transactions in Embedded Computing Systems (TECS Journal), ACM, Volume 11, Issue 1, p. 8:1-8:23, 2012. L. Schor, I. Bacivarov, H. Yang, and L. Thiele. Fast Worst-Case Peak Temperature Evaluation for Real-Time Applications on Multi-Core Systems. Proc. IEEE Latin American Test Workshop (LATW), Quito, Ecuador, p. 1-6, Apr. 2012. L. Schor, I. Bacivarov, H. Yang, and L. Thiele. Worst-Case Temperature Guarantees for Real-Time Applications on Multi-Core Systems. Proc. IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), Proc. IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), Beijing, China, p. 87-96, Apr. 2012. P. Kumar and L. Thiele. Timing Analysis on a Processor with Temperature-Controlled Speed Scaling. Proc. IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), Beijing, China, p. 77-86, Apr. 2012. I. Bacivarov, I. Belaid, A. Biagioni, A. El Antably, N. Fournel, O. Frezza, J. Jovic, R. Leupers, F. Lo Cicero, A. Lonardo, L. Murillo, P.S. Paolucci, D. Rai, D. Rossetti, F. Rousseau, L. Schor, C. Schumacher, F. Simula, L. Thiele, L. Tosoratto, P. Vicini, H. Yang – “DAL: Programming Efficient and Fault-Tolerant Applications for Many-Core Systems” - Poster at HIPEAC12 - Jan 23-25, 2012 Paris, France 39 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing          P. Kumar, J.-J. Chen, and L. Thiele. Demand Bound Server: Generalized Resource Reservation for Hard Real-Time Systems. Proc. Int'l Conference on Embedded Software (EMSOFT), pages 233-242, Oct. 2011. L. Schor, H. Yang, I. Bacivarov, and L. Thiele. Worst-Case Temperature Analysis for Different Resource Availabilities: A Case Study. Proc. Workshop on Power and Timing Modeling, Optimization and Simulation (PATMOS), Lecture Notes on Computer Science (LNCS), Springer, Vol. 6951, pages 288-297, Sep. 2011. P. Kumar, J.-J. Chen, L. Thiele, A. Schranzhofer, and G. C. Buttazzo. Real-Time Analysis of Servers for General Job Arrivals. Proc. Intl. Conf. on Embedded and Real-Time Computing Systems and Applications (RTCSA), pages 251258, Aug. 2011. L. Thiele, L. Schor, H. Yang, and I. Bacivarov. Thermal-Aware System Analysis and Software Synthesis for Embedded Multi-Processors. Proc. Design Automation Conference (DAC), pages 268-273, Jun. 2011. D. Rai, H. Yang, I. Bacivarov, JJ. Chen, L. Thiele. Worst-Case Temperature Analysis for Real-Time Systems. In Proceedings of Design, Automation and Test in Europe (DATE), Grenoble, France, March 2011. S. Perathoner, K. Lampka, L. Thiele. Composing Heterogeneous Components for System-wide Performance Analysis. In Proceedings of Design, Automation and Test in Europe (DATE), Grenoble, France, March 2011 (invited paper). I. Bacivarov, H. Yang, L. Schor, D. Rai, S. Jha, L. Thiele, Poster: Distributed Application Layer - Towards Efficient and Reliable Programming of Many-Tile Architectures. Design, Automation and Test in Europe (DATE) Friday Workshop, Grenoble, France, March 2011. K. Huang, L. Santinelli, JJ. Chen, L. Thiele, and G. C. Buttazzo. Applying Real-Time Interface and Calculus for Dynamic Power Management in Hard Real-Time Systems. Real-Time Systems Journal, Springer Netherlands, Vol. 47, No. 2, pages 163-193, Mar. 2011. A. Schranzhofer, JJ. Chen, L. Thiele. Dynamic Power-Aware Mapping of Applications onto Heterogeneous MPSoC Platforms. IEEE Transactions on Industrial Informatics, IEEE, Vol. 6, No. 4, pages 692 -707, November, 2011. RWTH             C. Schumacher, J. H. Weinstock, R. Leupers, G. Ascheid, L. Tossorato, A. Lonardo, D. Petras, T. Groetker. “legaSCi: Legacy SystemC Model Integration into Parallel SystemC Simulators”. 1st Workshop on Virtual Prototyping of Parallel and Embedded Systems (ViPES), 2013, Boston, USA (accepted for publication). C. Schumacher, J. H. Weinstock, R. Leupers and G. Ascheid: Cause and effect of nondeterministic behavior in sequential and parallel SystemC simulators. IEEE International High Level Design Validation and Test Workshop (HLDVT'12). Nov 2012, Huntington Beach (California-USA). C. Schumacher, J. H. Weinstock, R. Leupers and G. Ascheid: Scandal: SystemC Analysis for NonDeterminism AnomaLies. Forum on Specification and Design Languages (FDL '12), Sep 2012, Vienna (Austria) L. G. Murillo, J. Harnath, R. Leupers and G. Ascheid: Scalable and Retargetable Debugger Architecture for Heterogeneous MPSoCs. System, Software, SoC and Silicon Debug Conference (S4D '12), Sep 2012, Vienna (Austria) L. G. Murillo, J. Eusse, J. Jovic, S. Yakoushkin, R. Leupers and G. Ascheid: Synchronization for Hybrid MPSoC Full-System Simulation. Design Automation Conference (DAC '12), Jun 2012, San Francisco (USA) R. Leupers: More Real Value for Virtual Platforms. Design, Automation and Test in Europe (DATE '12), Mar 2012, Dresden (Germany) J. Jovic, S. Yakoushkin, L. G. Murillo, J. Eusse, R. Leupers and G. Ascheid: Hybrid Simulation for Extensible Processor Cores. Design, Automation and Test in Europe (DATE '12), Mar 2012, Dresden (Germany) S. Kraemer, R. Leupers, D. Petras, T. Philipp, A. Hoffmann: Checkpointing SystemC-Based Virtual Platforms. International Journal of Embedded and Real-Time Communication Systems (IJERTCS), vol. 2, no. 4, 2011 L. G. Murillo, W. Zhou, J. Eusse, R. Leupers, G. Ascheid: Debugging Concurrent MPSoC Software with Bug Pattern Descriptions. System, Software, SoC and Silicon Debug Conference (S4D '11), Oct 2011, Munich (Germany) R. Leupers, G. Martin, N. Topham, L. Eeckhout, F. Schirrmeister, X. Chen: Virtual Manycore Platforms: Moving Towards 100+ Processor Cores. Design Automation & Test in Europe (DATE), Mar 2011, Grenoble (France) J. Castrillon, A. Shah, L. G. Murillo, R. Leupers, G. Ascheid: Backend for Virtual Platforms with Hardware Scheduler in the MAPS Framework. 2nd IEEE Latin America Symp. on Circuits and Systems, Feb 2011, Bogota (Colombia) S. Kraemer, Design and analysis of efficient MPSoC simulation techniques, dissertation, 2011, Aachen, Germany (http://darwin.bth.rwth-aachen.de/opus3/frontdoor.php?source_opus=3769&la=de) 40 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing  C. Schumacher, R. Leupers, D. Petras and A. Hoffmann. parSC: Synchronous Parallel SystemC Simulation on MultiCore Host Architectures. In proceedings of CODES/ISSS '10, October, 2010, Scottsdale, Arizona, USA (http://dx.doi.org/10.1145/1878961.1879005) TIMA  A. Chagoya-Garzon, F. Rousseau, F. Pétrot, Multi-Device Driver Synthesis Flow for Heterogeneous Hierarchical Systems, Euromicro Conference on Digital System Design, Sept 2012, pp. 389 – 396, Izmir, Turkey.  Ashraf Elantably, Frédéric Rousseau, Task migration in multi-tiled MPSoC: Challenges, state-of-the-art and preliminary solutions, Journée National du Réseau Doctoral en Microélectronique, Marseille, France, June 2012, Poster and 4 pages paper (in English)  Chagoya-Garzon, N. Poste, F. Rousseau, Semi-Automation of Configuration Files Generation for Heterogeneous Multi-Tile Systems, Computer Software and Application Conference (COMPSAC 2011), Munich, Germany, 18-21 July 2011.  H. Chen, G. Godet-Bar, F. Rousseau, F. Petrot, Me3D : A Model-driven Methodology expediting Embedded Device Driver Development, International Symposium on Rapid System Prototyping (IEEE RSP 2011), pp. 171-177, May 2011, Karlsruhe, Germany. INFN  Roberto Ammendola, Andrea Biagioni, Ottorino Frezza, Francesca Lo Cicero, Alessandro Lonardo, Pier Stanislao Paolucci, Davide Rossetti, Francesco Simula, Laura Tosoratto, Piero Vicini - QUonG: A GPU-based HPC System Dedicated to LQCD Computing - Application Accelerators in High-Performance Computing, Symposium on, pp. 113-122, 2011 Symposium on Application Accelerators in High-Performance Computing, 2011 [[1]]  Pier Stanislao Paolucci - FP7 EURETILE Project: EUropean REference TILed architecture Experiment - HipeacInfo, Quarterly Newsletter, Number 24, page 11, October 2010 (http://www.Hipeac.net/newsletter) File:PaolucciEuretileHipeacInfo24October2010.pdf  Roberto Ammendola, Andrea Biagioni, Ottorino Frezza, Francesca Lo Cicero, Alessandro Lonardo, Pier Paolucci, Roberto Petronzio, Davide Rossetti, Andrea Salamon, Gaetano Salina, Francesco Simula, Nazario Tantalo, Laura Tosoratto, Piero Vicini - APEnet+: a 3D toroidal network enabling Petaflops scale Lattice QCD simulations on commodity clusters - High Energy Physics - Lattice 2010 (hep-lat); Distributed, Parallel, and Cluster Computing (cs.DC) arXiv:1012.0253v1 [hep-lat] (proceedings)  R. Ammendola, A. Biagioni, O. Frezza, F. Lo Cicero, A. Lonardo, P.S. Paolucci, D. Rossetti, A. Salamon, G. Salina, F. Simula, L. Tosoratto, P. Vicini - apeNET+: High Bandwidth 3D Torus Direct Network for PetaFLOPS Scale Commodity Clusters, International Conference on Computing in High Energy and Nuclear Physics (CHEP), October 2010, Taipei, Taiwan - Proceedings on J. Phys.: Conf. Ser. 331 052029 doi:10.1088/1742-6596/331/5/052029  R. Ammendola, A. Biagioni, O. Frezza, F. Lo Cicero, A. Lonardo, P.S. Paolucci, D. Rossetti, A. Salamon, G. Salina, F. Simula, L. Tosoratto, P. Vicini - Mastering multi-GPU computing on a torus network - GPU Technology Conference 2010 (GTC) - http://www.nvidia.com/content/GTC/posters/2010/I09-Mastering-Multi-GPU-Computingon-a-Torus-Networki.pdf (poster)  R. Ammendola, A. Biagioni, G. Chiodi, O. Frezza, A.Lonardo, F. Lo Cicero, R. Lunadei, D. Rossetti, A. Salamon, G. Salina, F. Simula, L. Tosoratto, P. Vicini - High speed data transfer with FPGAs and QSFP+ modules - Topical Workshop on Electronics for Particle Physics, Aachen, Germany / September 20-24, 2010 - Proceedings on JINST 5 C12019 doi:10.1088/1748-0221/5/12/C12019  R. Ammendola et al. - High speed data transfer with FPGAs and QSFP+ modules - Nuclear Science Symposium Conference Record (NSS/MIC) 2010 IEEE, Publication Year: 2010, Page(s): 1323 1325, November 2010, Knoxville, Tennessee. DOI: 10.1109/NSSMIC.2010.5873983 41 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 4.2. Books/Book Chapters ETHZ  Book chapter: I. Bacivarov, W. Haid, K. Huang, L. Thiele. Methods and Tools for Mapping Process Networks onto Multi-Processor Systems-On-Chip. Handbook of Signal Processing Systems, Springer, pages 1007-1040, October, 2010. RWTH  Book: R. Leupers and O. Temam (Eds.), Processor and System-On-Chip Simulation, Springer, September 2010, ISBN 978-1441961747  Book: T. Kempf, G. Ascheid, R. Leupers: Multiprocessor Systems on Chip: Design Space Exploration, Springer, Feb 2011, ISBN 978-1441981523 TIMA  Katalin Popovici, Frederic Rousseau, Ahmed A. Jerraya, Marilyn Wolf: Embedded Software Design and Programming of Multiprocessor System-on-Chip, Simulink and SystemC Case Studies, Springer, April 2010, ISBN 978-1-4419-5566-1  Book chapter: Xavier Guerin, Frederic Petrot, Operating System Support for Applications targeting Heterogeneous Multi-Core System)on-Chip in the book Multi-Core Embedded Systems, CRC Press, Chapter 9, 24 pages, April 2010. 4.3. Presentations ETHZ  Iuliana Bacivarov, Thermal-Aware Design of Real-Time Multi-Core Embedded Systems, Invited talk at Mapping Applications to MPSoCs, Jun. 2011.  Iuliana Bacivarov, Temperature Predictability in Multi-Core Real-Time Systems, Invited talk at DAC Workshop on Multiprocessor System-on-Chip for Cyber Physical Systems: Programmability, Run-Time Support, and Hardware Platforms for High Performance Embedded Applications, Jun. 2011.  Iuliana Bacivarov, Distributed Application Layer – Towards Seamless Programming of Many-Tile Architectures, CASTNESS 2011, 17 and 18 January 2011, Rome, Italy,http://euretile.roma1.infn.it/mediawiki/img_auth.php/8/88/EURETILE-2-IulianaBacivarov.pdf.  Iuliana Bacivarov, Distributed Operation Layer: An Efficient and Predictable KPN-Based Design Flow, invited talk at Workshop on Compiler-Assisted System-On-Chip Assembly 2010, in conjunction with Embedded Systems Week, Scottsdale, AZ, US, October 2010, http://www12.cs.fau.de/ws/casa10.  Iuliana Bacivarov, Efficient Execution of Kahn Process Networks on CELL BE, invited talk at Summer School on Models for Embedded Signal Processing Systems at Lorentz Center, Leiden, Netherlands, 30 Aug - 3 Sep 2010, http://www.lorentzcenter.nl/lc/web/2010/427/presentations/Iuliana-cell.pdf.  Iuliana Bacivarov, Distributed Operation Layer: A Practical Perspective, tutorial at Summer School on Models for Embedded Signal Processing Systems at Lorentz Center, Leiden, Netherlands, 30 Aug - 3 Sep 2010, http://www.lorentzcenter.nl/lc/web/2010/427/presentations/Iuliana-demo.pdf.  Iuliana Bacivarov, Distributed Operation Layer: Efficient Design Space Exploration of Scalable MPSoC, invited talk at Combinatorial Optimization for Embedded System Design workshop 2010 in conjunction with CPAIOR2010, 7th International Conference on Integration of Artificial Intelligence and Operations Research techniques in Constraint Programming, Bologna, Italy, June 2010, http://www.artist-embedded.org/artist/Overview,2022.html.  Iuliana Bacivarov, invited talk at Efficient Execution of Kahn Process Networks on MPSoC, Mapping Applications to MPSoCs 2010, June 29-30, 2010, St. Goar, Germany, http://www.artist-embedded.org/artist/Program,1822.html. RWTH  Jovana Jovic, Simulation Challenges in the EURETILE Project, CASTNESS 2011, January 17-18, 2011, Rome, Italy  Special session at DATE 2011: Virtual Manycore Platforms: Moving Towards 100+ Processor Cores, organized by R. Leupers and G. Martin 42 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing              R. Leupers, H. Meyr: Embedded Processor Design, Block lecture, ALARI, Lugano, Feb 2011 ICT Technology Transfer Workshop targeting Horizon 2020, Brussels, Apr 2011, organized by R. Leupers S. Yakoushkin: Advanced Simulation Techniques, Joint RWTH/TU Tampere Seminar, June 2011 R. Leupers: SoC Design Research in the UMIC Excellence Cluster, Seminar, TU Berlin, Sep 2011 Juan Eusse: Hybrid Simulation Technology for Extensible Cores and Full System Simulation of Complex MPSoCs, Nov 2011 (Presentation at HiPEAC Computing Systems Week) Rainer Leupers, HiPEAC Cluster Meeting (Design and Simulation Cluster), October 2010, Barcelona, Spain Rainer Leupers, MPSoC Design for Wireless Multimedia, Tutorial, MIXDES, June 2010, Wroclaw, Poland Rainer Leupers, Cool MPSoC Design, ASCI Winter School on Embedded Systems, March 2010, Soesterburg, Netherlands Rainer Leupers, Design Technologies for Wireless Systems-On-Chip, Huawei ESL Symposium, September 2010, Shenzhen, People's Republic of China Rainer Leupers, Embedded Processor Design and Implementation, course in MSc in Embedded Systems track at ALaRI Institute, March 1-4, 2010, University of Lugano, Switzerland Stefan Kraemer, Advanced Simulation Techniques for Virtual Platforms, May 26, 2010, Imperial College London, London, United Kingdom Christoph Schumacher, Stefan Kraemer and Rainer Leupers, demonstration at DAC 2010 exhibition: parSC: parallel SystemC simulation, deterministic, accurate, fast, June 14-16, 2010, Anaheim, USA Christoph Schumacher, Virtual Platform Technologies for Multi-core Platforms, UMIC Day, 19 October, 2010, RWTH Aachen INFN  P. Vicini, QUonG: A GPU-based HPC System Dedicated to LQCD Computing - Symposium on Application Accelerators in High-Performance Computing, Knoxville, TN - USA, July 2011http://doi.ieeecomputersociety.org/10.1109/SAAHPC.2011.15  D. Rossetti, Remote Direct Memory Access between NVIDIA GPUs with the APEnet 3D Torus Interconnect - SC11 - International Conference for High Performance Computing, Networking, Storage and Analysis - Seattle, WA http://nvidia.fullviewmedia.com/fb/nv-sc11/tabscontent/archive/304-wed-rossetti.html  P.S. Paolucci, EURETILE: Brain-Inspired many-tile SW/HW Experiment, CASTNESS 2011, 17 and 18 January 2011, Rome, Italy,http://euretile.roma1.infn.it/mediawiki/img_auth.php/3/3a/EURETILE-1PierStanislaoPaolucci.pdf  P. Vicini, EURETILE: The HPC and Embedded Experimental HW Platform, CASTNESS 2011, 17 and 18 January 2011, Rome, Italy,http://euretile.roma1.infn.it/mediawiki/img_auth.php/6/69/EURETILE-6-PieroVicini.ppt  R. Ammendola, apeNET+: a 3D toroidal network enabling petaFLOPS scale Lattice QCD simulations on commodity clusters, Lattice 2010, THE XXVIII INTERNATIONAL SYMPOSIUM ON LATTICE FIELD THEORY, Villasimius, Italy, June 2010, http://agenda.infn.it/contributionDisplay.py?contribId=335&sessionId=70&confId=2128  D. Rossetti, apeNET+ Project Status, Lattice 2010, THE XXIX INTERNATIONAL SYMPOSIUM ON LATTICE FIELD THEORY, Squaw Village, Lake Tahoe, CA, USA, July 2011 - to be published on https://latt11.llnl.gov/html/proceedings.php Target  W. Geurts, G. Goossens, "Ideas for the Design of an ASIP for LQCD", CASTNESS 2011, Rome (Italy), January 1718, 2011,http://euretile.roma1.infn.it/mediawiki/img_auth.php/3/3c/EURETILE-5-WernerGeurts.ppt  G. Goossens, “Why Compilation Tools are the Catalyst for Multicore SoC Design”, Electronic Design and Solutions Fair, Yokohama (Japan), January 27-28, 2011.  G. Goossens, “Why Compilation Tools are a Catalyst for Multicore SoC Design”, Third Friday Workshop on Designing for Embedded Parallel Computing Platforms: Architectures, Design Tools, and Applications, Design Automation and Test in Europe (DATE-2011), Grenoble (France), March 18, 2011.  G. Goossens, P. Verbist, “Enabling the Design and Programming of Application-Specific Processors”, SophiaAntipolis Micro-Electronics Conference (SAME-2011), Sophia-Antipolis (France), October 12-13, 2011.  G. Goossens, “Building Multicore SoCs with Application-Specific Processors”, Electronic Design and Solutions Fair, Yokohama (Japan), November 16-18, 2011. 43 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing        P. Verbist, “Building software-programmable accelerators for ARM-based subsystems”, ARM Technical Symposium, Taipei and Hsinchu (Taiwan), November 17-18, 2011. G. Goossens, “Building Multicore SoCs with Application-Specific Processors”, Intl. Conf. on IP-Based SoC Design (IP-SoC-2011), Grenoble (France), December 7-8, 2011. G. Goossens, “Design Tools for Building Software-Programmable Accelerators in Multicore SoCs”, Workshop on Tools for Embedded System Design, Sint-Michielsgestel (Netherlands), December 13, 2011. G. Goossens, E. Brockmeyer, W. Geurts, “Application-Specific Instruction-set Processors (ASIPs) and related design tools for tiled systems”, CASTNESS 2012, Paris (France), January 26, 2012. G. Goossens, "How ASIP Technology can Make your RTL Blocks More Flexible", Electronic Design and Solutions Fair, Yokohama (Japan), January 28-29, 2010. S. Cox, G. Goossens, "Hardware Accelerator Performance in a Programmable Context: Methodology and Case Study", Embedded Systems Conference, San Jose (CA, USA), April 26-29, 2010. G. Goossens, "Design of Programmable Accelerators for Multicore SoCs", First Artemis Technology Conference, Budapest (Hungary), June 29-30, 2010. TIMA  Frédéric Rousseau, Requirements in Communication Synthesis for EURETILE: The use of Communication Path Formalization, CASTNESS 2012, January 26th, 2012, Paris, France  Frédéric Rousseau, presentation of the EURETILE project in front of the Board of directors of the University Joseph Fourier, March 2011, Grenoble, France  Frédéric Rousseau, Communication Synthesis in Low Level Software for Hierarchical Heterogeneous Systems, CASTNESS 2011, January 17-18, 2011, Rome, Italy 4.4. CASTNESS’11 A key action conducted during this period in the framework of WP9 has been the organization of the CASTNESS’11 Workshop (Computer Architectures, Software tools and nano-Technologies for Numerical and Embedded Scalable Systems), hosted in Roma on 17-18 January 2011 at the Frentani Conference Center. http://www.congressifrentani.it Twenty speakers, representing the four Teradevice Computing projects (EURETILE, TERAFLUX, TRAMS and SooS) presented their activities to about 60 researchers. An archive, hosting all the presentations, is available for public access, hosted on the http://www.euretile.eu web site. CASTNESS’11 Agenda Monday 17 January 2011: Day 1 Event Speaker Name Affiliation REGISTRATION OPENING and WELCOME SOOS: Scaling Issues in Current OS Architectures and Approaches to Overcome them Duration Start End 00:40 13:00 13:40 Speranza Falciano INFN Roma 00:20 13:40 14:00 Daniel Rubio Bonilla USTUTT-HLRS, Stuttgart 00:20 14:00 14:20 44 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing SOOS: Composition vs Concurrency Mihai Letia EPFL, Lausanne SHORT BREAK SOOS: Issues in Large Scale Scheduling of Distributed Applications SOOS: Resource Discovery and Modelling in Heterogeneous Computing Environments 00:20 14:20 14:40 00:20 14:40 15:00 Tommaso Cucinotta Scuola Superiore Sant'Anna, Pisa 00:20 15:00 15:20 Christiaan Baaij University of Twente 00:20 15:20 15:40 00:20 15:40 16:00 SHORT BREAK TRAMS: Introduction to the TRAMS Project Objectives Antonio Rubio UPC Barcelona 00:20 16:00 16:20 TRAMS Variability at Device Level Andrew Brown University of Glasgow 00:20 16:20 16:40 00:30 16:40 17:10 COFFEE BREAK TRAMS: New Tools and Methods in Robust SRAM Design Paul Zuber Imec 00:20 17:10 17:30 TRAMS: Temperature, Voltage and Process Variations in SRAMs Shrikanth Ganapathy UPC Barcelona 00:13 17:30 17:43 TRAMS: Robustness of SRAM Memories Ioana Vatajelu UPC Barcelona 00:13 17:43 17:56 TRAMS: Carbon Nanotub Technology an Alternative in Future RAM Memories Carmen Garcia UPC Barcelona 00:14 17:56 18:10 SOCIAL DINNER 20:30 Tuesday 18 January 2011: Day 2 Event Speaker Name Affiliation Duration Start End Pier S. Paolucci INFN Roma 00:20 09:00 09:20 EURETILE: Distributed Application Layer - Towards Seamless Programming of Many-Tiles Architectures Iuliana Bacivarov ETH Zurich 00:20 09:20 09:40 EURETILE: Simulation Challenges in the EURETILE Project Jovana Jovic RWTH Aachen 00:20 09:40 10:00 00:30 10:00 10:30 EURETILE: Brain-Inspired many-tile SW/HW Experiment COFFEE BREAK 45 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing EURETILE: Communication Synthesis in Low Level Software for Hierarchical Heterogeneous Systems EURETILE: Ideas for the design of an ASIP for LQCD Frederic Rousseau TIMA/UJF Grenoble 00:20 10:30 10:50 Werner Geurts TARGET Leuven 00:20 10:50 11:10 00:20 11:10 11:30 SHORT BREAK EURETILE: The HPC and Embedded Experimental HW Platform Piero Vicini INFN Roma 00:20 11:30 11:50 TERAFLUX: Intro Roberto Giorgi Università di Siena 00:20 11:50 12:10 TERAFLUX: OS Doron Shamia Microsoft 00:20 12:10 12:30 01:40 12:30 14:10 LUNCH TERAFLUX: On Transactional Memory in TERAFLUX Berham Khan University of Manchester 00:20 14:10 14:30 TERAFLUX: On Computational Models Salman Khan University of Manchester 00:20 14:30 14:50 00:20 14:50 15:10 SHORT BREAK TERAFLUX: On State-of-theart and Plans on the Loop Nest Optimization Konrad Trifunovic INRIA Saclay, France 00:20 15:10 15:30 FET Plans Jean-Marie Auger EU FET Officer 00:20 15:30 15:50 CLOSURE 15:50 46 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing 5. APPENDIX: Euretile Project Glossary A       ABI - Application Binary Interface ALUT - Adaptive LookUp Table AED - Abstract Execution Device API - Application Programming Interface APEnet+ - An FPGA-based card for low latency, high bandwidth direct network interconnection based on the DNP ASIP - Application Specific Instruction Set Processor     BER - Bit Error Rate BML - Byte Management Layer, framework of the OpenMPI library BPDLang - Bug Pattern Description Language BTL - Byte Transfer Layer, framework of the OpenMPI library      CA - Cycle Accurate CDR - Clock Data Recovery CLI - Command Line Interface CQ - Completion Queue CRC - Cyclic Redundancy Check         DAL - Distributed Application Layer DFM - DNP Fault Manager DMI - Direct Memory Interface DNAOS - DNA is Not just Another Operating System DNP - Distributed Network Processor DOL - Distributed Operating Layer DPSNN-STDP - Distributed Polychronous Spiking Neural Networks with synaptic Spiking Time Dependent Plasticity(a PSNN-STDP code natively redesigned and rewritten to exploit parallel/distributed computing systems) DWARF - Debugging with Attributed Record Formats, a standard format for debug information in a binary object DWR - DNP Watchdog Register    ECC - Error correcting code EIR - Event-based Intermediate Representation for multi-core debugging EURETILE - EUropean REference TILed architecture Experiment - (all)    FIT - Failure In Time FM - Fault manager FPGA - Field-Programmable Gate Array  GUI - Graphic User Interface         HAL - Hardware Abstraction Layer HdS - Hardware dependent Software HFM - Host Fault Manager HLEM - High-level Event Monitor for multi-core debugging HPC - High Performance Computing HyNoC - Hybrid NoC simulation technology HySim - Hybrid Simulation technology HWR - Host Watchdog Register B C D  E F G H 47 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing I         IA - Instruction Accurate ICE - Institute for Communication technologies and Embedded systems IDE - Integrated Development Environment (tools to develop and debug embedded software, integrated in a GUI) IMC - Interface Method Call INFN - Istituto Nazionale di Fisica Nucleare (National Institute for Nuclear Physics) I/O - Input/Output IOCTL - Input/Output Control, is a system call for device-specific input/output operations and other operations which cannot be expressed by regular system calls. IP - Intellectual Property IP Designer - TARGET's tool-suite for the design and programming of ASIPs IRISC - ICE Reduced Instruction Set Computer (RWTH's proprietary processor with that name) ISR - Interrupt Service Routine ISS - Instruction Set Simulator  JIT - Just-in-time compilation  KPN – Khan Process Network             LDM - LiFaMa Diagnostic Message LiFaMa - Link Fault Manager LISA - Language for Instruction Set Architecture Design LO|FA|MO - Local Fault Monitor LP - Logical Process LQCD - Lattice Quantum-ChromoDynamics LSB - Least Significant Bit LTD - Long Term synaptic Depression LTL - Linear Temporal Logic LTP - Long Term synaptic Potentiation LUT - Look-Up Table LwIP - Lightweight IP      MM - Memory Management MMU - Memory Management Unit MPI - Message Passing Interface MSB - Most Significant Byte MTL - Matching Transport Layer, framework of the OpenMPI library    NIC - Network Interface Controller NIOS II - 32-bit microprocessor available as soft-core in Altera FPGAs (often shorthanded as "NIOS") nML - Not a Modelling Language (a processor architectural description language)        OMPI - Open MPI, an implementation of the MPI standard. OPAL - Open Portability Access Layer, part of the OpenMPI library OpenGL - The Open Graphics Library multi-platform API for rendering computer graphics ORTE - Open Run-time Environment, part of the OpenMPI library OS - Operating System OSCI - Open SystemC Initiative OSI - Open Systems Interconnection  parSC - parallel SystemC (a parallelizing SystemC execution engine)     J K L M N O P 48 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing            Q   PCI/PCIe - Peripheral Component Interconnect - TIMA/UJF PCS - Physical Coding Sublayer -INFN PDC - Pin-Down Cache - INFN PEO - Process Execution Order PIC - Programmable Interrupt Controller PMA - Physical Medium Attachment PML - Point-to-point Message Layer, framework of the OpenMPI library PRBS - Pseudorandom Binary Sequence Presto - MPI-like library for APEnet+/DNP PSB - Peripheral Subsystem Bus in the VEP-EX PSNN - Polychronous Spiking Neural Network (A neural network which takes in consideration the delay introduced by the axonal arborization, in principle different for each synapse, and reproduces the spiking behaviour of a neural network) Python - A general-purpose interpreted programming language P2P - peer-to-peer  QUonG - LQCD on GPU platform        RB - Ring Buffer RDMA - Remote Direct Memory Access RDMA GET - RDMA READ operation that implies an handshake between the sender and the receiver RDMA PUT - RDMA WRITE operation that implies an handshake between the sender and the receiver RTE - Runtime Environment - RWTH RTL - Register Transfer Level (also used to refer to register-transfer languages, such as VHDL or Verilog) RWTH - Rheinisch-Westfaelische Technische Hochschule Aachen      SC - SystemC SCandal - SystemC Analysis for NonDeterminism Anomalies SCML - SystemC Modelling Language (a collection of convenience modelling objects for SystemC) SIMD - Single Instruction Multiple Data (also known as vector processing, a processor architectural concept to implement data-level parallelism) SNDNP - Service Network DNP SNET - Service Network STDP - synaptic Spiking Time Dependent Plasticity (a mechanism of synaptic evolution that depends on the relative timing between the spike incoming to a neuron, and the spike that the neuron emits. The synapses can be potentiated or depressed) SIP - Software Interface Protocol    TCL - Tool Command Language, a general-purpose interpreted programming language TLM - Transaction Level Modelling TSBE - Target-specific Back-end for multi-core debugging       V2P - Virtual to Physical VBE - VESA BIOS Extensions VEP - Virtual EURETILE Platform VEP-Ex - Virtual EURETILE Platform Experimental VHDL - VHSIC Hardware Description Language VLIW - Very Long Instruction Word (a processor architectural concept to implement instruction-level parallelism)  WD - WatchDog   XML - Extensible Markup Language XSD - XML Schema Definition R S    T V W X 49 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing References A. Sangiovanni-Vincentelli, G. Martin, Platform-based design and software design methodology for embedded systems. IEEE Design & Test 18, 6, pp. 23–33, 2001. G. Kahn, “The semantics of a simple language for parallel programming,” in Proc. IFIP Congr.,Stockholm, Sweden, Aug. 1974, pp. 471–475. E. A. Lee and A. Sangiovanni-Vincentelli, “A framework for comparing models of computation,” IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst., vol. 17, no. 12, pp. 1217–1229, Dec. 1998. S. Edwards, L. Lavagno, E. A. Lee, and A. Sangiovanni-Vincentelli, “Design of embedded systems: Formal models, validation, and synthesis,” Proc. IEEE, vol. 85, no. 3, pp. 366–390, Mar. 1997. B. Kienhuis, Ed F. Deprettere, P. Van der Wolf, and K. Vissers, A methodology to design programmable embedded systems - the Y-Chart approach. In Proceedings of the International Conference on Embedded Computer Systems: Architectures, Modeling, and Simulation, pages 18–37. Springer-Verlag, 2002. G. Schirner, R. Dömer, A. Gerstlauer, High level development, modeling and automatic generation of hardware-dependent software, Hardware-dependent Software Principles and Practice, Springer 2009, Chapter 8, pp. 203-231. Lothar Thiele, Iuliana Bacivarov, Wolfgang Haid, and Kai Huang. 2007. Mapping Applications to Tiled Multiprocessor Embedded Systems. In Proceedings of the Seventh International Conference on Application of Concurrency to System Design (ACSD '07). IEEE Computer Society, 29-40. DOI = 10.1109/ACSD.2007.53 http://dx.doi.org/10.1109/ACSD.2007.53 Paolucci, P.S.; Jerraya, A.A.; Leupers, R.; Thiele, L.; Vicini, P., "SHAPES:: a tiled scalable software hardware architecture platform for embedded systems, "Hardware/Software Codesign and System Synthesis, 2006. CODES+ISSS '06. Proceedings of the 4th International Conference , pp.167,172, 22-25 Oct. 2006 doi: 10.1145/1176254.1176297 Jing Lin, Andreas Gerstlauer, Brian L. Evans, Communication-aware Heterogeneous Multiprocessor Mapping for Real-time Streaming Systems. Signal Processing Systems 69(3): 279-291 (2012) Gernot Heiser, Virtualizing embedded systems: why bother? DAC 2011, pp. 901-905 P. Ezudheen, P. Chandran, J. Chandra, B. P. Simon, and D. Ravi, "Parallelizing SystemC kernel for fast hardware simulation on SMP machines," workshop on principles of advanced and distributed simulation, PADS 2009 S. Lu, S. Park, E. Seo, and Y. Zhou, "Learning from mistakes: A comprehensive study on real world concurrency bug characteristics," in proceedings of the 13th international conference on Architectural support for programming languages and operating 50 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing systems, ASPLOS, 2008. D. A. Penry, D. Fay, D. Hodgdon, R. Wells, G. Schelle, D. I. August, and D. Connors. "Exploiting parallelism and structure to accelerate the simulation of chip multi-processors," in proceedings of the 12th international symposium on high-performance computing architecture, HPCA, 2006 Song, S. et al. Competitive Hebbian learning through spike-timing-dependent synaptic plasticity. Nature Neuroscience 3, 919-926, (2000). Izhikevich, E. “Polychronization: Computation with Spikes.” Neural Computation, 18, 245-282 (2006) . Izhikevich, E. Dynamical Systems in Neuroscience: the Geometry of Excitability and Bursting. Cambridge, MA: The MIT Press (2006) . Izhikevich, E. M. Simple Model of Spiking Neurons. IEEE Transactions on Neural Networks, Vol. 14, No. 6, November 2003 . Izhikevich, E. M. Which Model to use for cortical spiking neurons? IEEE Transaction on Neural Networks, 15, no. 5 1063-1070 (2004) . Xin Jun, Steve B. Furber, John V. Woods. Efficient Modelling of Spiking Neural Networks on a Scalable Chip Multi-processor. Int. Joint Conf. on Neural Networks 2008 (IJCNN 2008), 28122819 (2008) . L. A. Plana, J. B. An On-Chip and Inter-Chip Communications Network for the SpiNNaker Massively-Parallel Neural Net Simulator. IEEE 2008. Paolucci, P.S. "The Diopsis Multiprocessor Tile of SHAPES," MPSOC'06, 6th Int.Forum on Application-Specific MPSoC, 2006. Katalin Popovici, Xavier Guerin, Frédéric Rousseau Pier Stanislao Paolucci, Ahmed Amine Jerraya: Platform-based software design flow for heterogeneous MPSoC. ACM Trans. Embedded Comput. Syst. 7(4) (2008) DOI=10.1145/1376804.1376807 Xavier Guerin, Frédéric Pétrot: A System Framework for the Design of Embedded Software Targeting Heterogeneous Multi-core SoCs. ASAP 2009: pp. 153-160 W. Haid, K. Huang, I. Bacivarov, and L. Thiele, “Multiprocessor SoC Software Design Flows”, in IEEE Signal Processing Magazine, 26(6):64—71, Nov. 2009. W. Haid, M. Keller, K. Huang, I. Bacivarov, and L. Thiele, “Generation and Calibration of Compositional Performance Analysis Models for Multi-Processor Systems”, in Proc. Int'l Conf. on Embedded Computer Systems: Architectures, Modeling and Simulation (SAMOS), pages 92—99, Samos, Greece, July 2009. - awarded the Stamatis Vassiliadis Best Paper Award. 51 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing T. Sporer, M. Beckinger, A. Franck, I. Bacivarov, W. Haid, K. Huang, L. Thiele, P. S. Paolucci, P. Bazzana, P. Vicini, J. Ceng, S. Kraemer, and R. Leupers, “SHAPES — A Scalable Parallel HW/SW Architecture Applied to Wave Field Synthesis”, in Proc. Audio Engineering Society (AES) Int'l Conference, pages 175-187, Hillerød, Denmark, Sept. 2007. C. Schumacher, R. Leupers, D. Petras and A. Hoffmann. “parSC: Synchronous Parallel SystemC Simulation on Multi-Core Host Architectures”, in proceedings of international conference on hardware/software codesign and system synthesis (CODES+ISSS) 2010, October, 2010, Scottsdale, Arizona, USA S. Kraemer, L. Gao, J. H. Weinstock, R. Leupers, G. Ascheid and Meyr H., “HySim: A Fast Simulation Framework for Embedded Software Development,” in proceedings of the 5th Conference on Hardware/Software Codesign (CODES+ISSS '07) and System Synthesis (Salzburg, Austria), 2007. Chagoya-Garzon, A.; Guerin, X.; Rousseau, F.; Petrot, F.; Rossetti, D.; Lonardo, A.; Vicini, P.; Paolucci, P.S., "Synthesis of Communication Mechanisms for Multi-tile Systems Based on Heterogeneous Multi-processor System-On-Chips," Rapid System Prototyping, 2009. RSP '09. IEEE/IFIP International Symposium on , vol., no., pp.48,54, 23-26 June 2009 doi:10.1109/RSP.2009.12 P. S. Paolucci et al. "Complex Domain Floating Point VLIW DSP WithData/Program Bus Multiplexer and Microprocessor Interface", US Patent 7437540, (2008) Popovici, K.; Guerin, X.; Rousseau, F.; Paolucci, P.S.; Jerraya, A., "Efficient Software Development Platforms for Multimedia Applications at Different Abstraction Levels," Rapid System Prototyping, 2007. RSP 2007. 18th IEEE/IFIP International Workshop on, pp.113,122, 28-30 May 2007 doi: 10.1109/RSP.2007.21 Paolucci, P.S. “Apparatus and Method for Dynamic Program Decompression”, US Patent 6766439 (2004), filed 2002. P. S. Paolucci, P. Kajfasz, P. Bonnot, B. Candaele, D. Maufroid, E. Pastorelli, A. Ricciardi, Y. Fusella, and E. Guarino, “mAgic-FPU and MADE: A customizable VLIW core and the modular VLIW processor architecture description environment,” Computer Physics Communications, vol. 139, no. 1, pp. 132–143, September 2001. P.S. Paolucci et al. “Janus: A gigaflop VLIW+RISC Soc Tile”, Hot Chips 15 IEEE Stanford Conference (2003). http://www.hotchips.org (note: Janus was the development name of Diopsis). G. Mariani, P. Avasare, G. Vanmeerbeeck, C. Ykman-Couvreur, G. Palermo, C. Silvano, V. Zaccaria, “An Industrial Design Space Exploration Framework for Supporting Run-Time Resource Management on Multi-Core Systems”, in Proc. DATE , pages 196–201, 2010 S. Stuijk, M. Geilen, Twan Basten, “A Predictable Multiprocessor Design Flow for Streaming Applications with Dynamic Behaviour”, in Proc. DSD, pages 548–555, 2010 52 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing P. van Stralen and A. Pimentel, “Scenario-Based Design Space Exploration of MPSoCs”, in Proc. ICCD, pages 305-312, 2010. Z. Wang and J. Henkel: “HyCoS: hybrid compiled simulation of embedded software with target dependent code,” in proceedings of the 8th Conference on Hardware/software codesign and system synthesis (CODES+ISSS '12), Oct 2012, Tampere (Finland) W. Chen, X. Han, and R. Domer, "Out-of-order parallel simulation for ESL design," Design, Automation and Test in Europe Conference and Exhibition (DATE), 2012 Modha, S. D., & al. (2011). Cognitive Computing. Communications of the ACM , 54 (08 (pag. 6271)). I. Bacivarov, W. Haid, K. Huang, and L. Thiele, “Methods and Tools for Mapping Process Networks onto Multi-Processor Systems-On-Chip”, in “Handbook of Signal Processing Systems”, Springer, pages 1007-1040, Oct. 2010 L. Schor, H. Yang, I. Bacivarov, and L. Thiele, “Worst-Case Temperature Analysis for Different Resource Models”, in IET Circuits, Devices & Systems Journal, Volume 6, Issue 5, p. 297-307, Sep. 2012 K. Huang, W. Haid, I. Bacivarov, M. Keller, and L. Thiele, “Embedding Formal Performance Analysis into the Design Cycle of MPSoCs for Real-time Multimedia Applications”, in ACM Transactions on Embedded Computing Systems (TECS), Volume 11, Issue 1, p. 8:1-8:23, 2012 S.-H. Kang, H. Yang, L. Schor, I. Bacivarov, S. Ha, and L. Thiele, “Multi-Objective Mapping Optimization via Problem Decomposition for Many-Core Systems”, in Proc. IEEE Symposium on Embedded Systems for Real-Time Multimedia (ESTIMedia), Tampere, Finland, p. 28-37, Oct. 2012 L. Schor, I. Bacivarov, D. Rai, H. Yang, S.-H. Kang, and L. Thiele, “Scenario-Based Design Flow for Mapping Streaming Applications onto On-Chip Many-Core Systems”, in Proc. Int'l Conf. on Compilers Architecture and Synthesis for Embedded Systems (CASES), Tampere, Finland, p. 7180, Oct. 2012 D. Rai, H. Yang, I. Bacivarov, and L. Thiele, “Power Agnostic Technique for Efficient Temperature Estimation of Multicore Embedded Systems”, in Proc. Int'l Conf. on Compilers Architecture and Synthesis for Embedded Systems (CASES), Tampere, Finland, p. 61-70, Oct. 2012 – best paper award Katalin Popovici, Frédéric. Rousseau, Ahmed Jerraya, Marilyn Wolf, editors et authors, Embedded Software Design and Programming of Multiprocessor System-on-Chip: Simulink and SystemC Case Studies, Springer, p 290, ISBN-13: 978-1441955661, april 2010. Alexandre Chagoya-Garzon, Nicolas Poste, Frédéric Rousseau: Semi-automation of Configuration 53 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing Files Generation for Heterogeneous Multi-tile Systems. COMPSAC 2011, pp. 157-166 Alexandre Chagoya-Garzon, Frédéric Rousseau, Frédéric Pétrot: Multi-device Driver Synthesis Flow for Heterogeneous Hierarchical Systems, DSD 20012, pp. 389-396. C. Schumacher, J. H. Weinstock, R. Leupers, G. Ascheid, L. Tossorato, A. Lonardo, D. Petras, T. Groetker: "legaSCi: Legacy SystemC Model Integration into Parallel SystemC Simulators". 1st Workshop on Virtual Prototyping of Parallel and Embedded Systems (ViPES), 2013, Boston, USA (accepted for publication) L. G. Murillo, J. Eusse, J. Jovic, S. Yakoushkin, R. Leupers and G. Ascheid: “Synchronization for Hybrid MPSoC Full-System Simulation,” Design Automation Conference (DAC '12), Jun 2012, San Francisco (USA) L. G. Murillo, J. Harnath, R. Leupers and G. Ascheid: “Scalable and Retargetable Debugger Architecture for Heterogeneous MPSoCs,” System, Software, SoC and Silicon Debug Conference (S4D '12), Sep 2012, Vienna (Austria) Roberto Ammendola, Andrea Biagioni, Ottorino Frezza, Francesca Lo Cicero, Alessando Lonardo, Pier Stanislao Paolucci, Davide Rossetti, Francesco Simula, Laura Tosoratto, Piero Vicini. APEnet+: a 3D Torus network optimized for GPU-based HPC Systems 2012 J. Phys.: Conf. Ser. 396 042059 doi:10.1088/1742-6596/396/4/042059 Andrea Biagioni, Francesca Lo Cicero, Alessandro Lonardo, Pier Stanislao Paolucci, Mersia Perra, Davide Rossetti, Carlo Sidore, Francesco Simula, Laura Tosoratto, Piero Vicini. The Distributed Network Processor: a novel off-chip and on-chip interconnection network architecture http://arxiv.org/abs/1203.1536 (2012) Roberto Ammendola, Andrea Biagioni, O Prezza, F Lo Cicero, Alessandro Lonardo, Pier Stanislao Paolucci, Davide Rossetti, Andrea Salamon, Gaetano Salina, Francesco Simula, Laura Tosoratto, Piero Vicini. APEnet+: high bandwidth 3D torus direct network for petaflops scale commodity clusters 2011 J. Phys.: Conf. Ser. 331 052029 doi:10.1088/1742-6596/331/5/052029, http://iopscience.iop.org/1742-6596/331/5/052029 Ammendola, R.; Biagioni, A.; Frezza, O.; Lo Cicero, F.; Lonardo, A.; Paolucci, P.S.; Rossetti, D.; Simula, F.; Tosoratto, L.; Vicini, P., "QUonG: A GPU-based HPC System Dedicated to LQCD Computing," Application Accelerators in High-Performance Computing (SAAHPC), 2011 Symposium on , vol., no., pp.113,122, 19-21 July 2011 doi: 10.1109/SAAHPC.2011.15, IEEE 2011 Davide Rossetti, Roberto Ammendola, Piero Vicini, Andrea Biagioni, Ottorino Frezza, Francesco Lo Cicero, Alessandro Lonardo, Pier Stanislao Paolucci, Francesco Simula, Laura Tosoratto. APEnet+ project status. Proceedings of the XXIX International Symposium on Lattice Field Theory (Lattice 2011). July 10-16, 2011. Squaw Valley, Lake Tahoe, California, id.45 Online at http://pos.sissa.it/cgi-bin/reader/conf.cgi?confid=139 54 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing Ammendola, R.; Biagioni, A.; Chiodi, G.; Frezza, O.; Lo Cicero,F.; Lonardo, A.; Lunadei, R.; Paolucci, P.S.; Rossetti, D.; Salamon, A.; Salina, G.; Simula, F.; Tosoratto, L.; Vicini. P., “Highspeed data transfer with FPGAs and QSFP+ modules”, 2010 JINST 5 C12019 doi:10.1088/17480221/5/12/C12019 55 of 56 Project: EURETILE – European Reference Tiled Architecture Experiment Grant Agreement no.: 247846 Call: FP7-ICT-2009-4 Objective: FET - ICT-2009.8.1 Concurrent Tera-device Computing EURETILE 2010-2012 summary: first three years of activity of the European Reference Tiled Experiment. Pier Stanislao Paolucci, Iuliana Bacivarov, Gert Goossens, Rainer Leupers, Frédéric Rousseau, Christoph Schumacher, Lothar Thiele, Piero Vicini The EURETILE project is funded by the European Commission through the Grant Agreement no. 247846 Call: FP7-ICT-2009-4 Objective FET-ICT-2009.8.1 Concurrent Tera-device Computing. www.euretile.eu
9cs.NE
Text Extraction and Retrieval from Smartphone Screenshots: Building a Repository for Life in Media Agnese Chiatti† Mu Jung Cho** Anupriya Gagneja** Xiao Yang* Miriam Brinberg* Katie Roehrick** Sagnik Ray Choudhury† Nilam Ram* Byron Reeves** C. Lee Giles† arXiv:1801.01316v1 [cs.IR] 4 Jan 2018 † Information Sciences and Technology, Pennsylvania State University, {azc76,szr163,giles}@ist.psu.edu *Human Development and Family Studies, Pennsylvania State University, {xfy5031,mjb6504,nur5}@psu.edu **{Department of Communication, Department of Computer Science}, Stanford University, {mujung.cho,anupriya,kroehr,reeves}@stanford.edu Abstract— Daily engagement in life experiences is increasingly interwoven with mobile device use. Screen capture at the scale of seconds is being used in behavioral studies and to implement ”just-in-time” health interventions. The increasing psychological breadth of digital information will continue to make the actual screens that people view a preferred if not required source of data about life experiences. Effective and efficient Information Extraction and Retrieval from digital screenshots is a crucial prerequisite to successful use of screen data. In this paper, we present the experimental workflow we exploited to: (i) pre-process a unique collection of screen captures, (ii) extract unstructured text embedded in the images, (iii) organize image text and metadata based on a structured schema, (iv) index the resulting document collection, and (v) allow for Image Retrieval through a dedicated vertical search engine application. The adopted procedure integrates different open source libraries for traditional image processing, Optical Character Recognition (OCR), and Image Retrieval. Our aim is to assess whether and how state-of-the-art methodologies can be applied to this novel data set. We show how combining OpenCV-based pre-processing modules with a Long short-term memory (LSTM) based release of Tesseract OCR, without ad hoc training, led to a 74% character-level accuracy of the extracted text. Further, we used the processed repository as baseline for a dedicated Image Retrieval system, for the immediate use and application for behavioral and prevention scientists. We discuss issues of Text Information Extraction and Retrieval that are particular to the screenshot image case and suggest important future work. I. INTRODUCTION Individuals increasingly record, share, and search through their daily activities and behaviors through digital means. Given the breadth of current technologies, this ”life in media” (i.e., daily experiences captured by technology) is fragmented across multiple devices and applications. Fastpaced switching - as quickly as every 19 seconds on laptop computers [1] - often occurs between either loosely-related or radically different content. However, holistic examination of individuals’ mediatized lives remains largely unexplored. In this scenario, digital screenshots of individuals’ devices represent an ideal target to (i) ensure in situ collection of diverse data that are normally tackled within separate domains (e.g., examining use of all social media, rather than only a particular site), (ii) investigate the interdependencies and fragmentation of activities over time, forming a valuable data set for behavioral scientists and intervention implementation, and (iii) more broadly, test theory, specifically with respect to digital life (e.g., social interactions, learning, news consumption). Frequent screen capture as a data collection method has the potential for providing more fine-grained, longitudinal data than traditional URL, query logging and app usage tracking methods. The extraction, representation and effective retrieval of screenshot textual contents are then crucial steps eliciting the application of these analyses to a number of use cases [2], including: medical diagnosis and early detection of disease, behavioral studies interrogating on the nature and shape of human development in the digital era, models of task switching and its implications for attention and memory, mining of political attitudes and voting across social media and news media, assessments of the role of fake news in democratic settings and so forth. As discussed in [3], screenshots provide a unique combination of graphic and scene text, motivating the evaluation of state-of-the-art OCR methods on this particular data set. Further, Information Extraction from digital screenshots raises the need for developing a general purpose framework that handles a variety of fonts and layouts, disambiguates icons and graphical contents from purely textual segments, while dealing with text embedded in advertisements, logos, or video frames. In order to move from miscellaneous information fragments to a more structured and interactive repository for further Knowledge Discovery, it is important to consider the organization and accessibility of the extracted data. We particularly focus on the retrieval of screenshot images based on their textual content and metadata, by describing the search engine architecture developed to this aim. This paper presents a complete workflow (from Image Preprocessing to Image Retrieval) integrating existing opensource methods and tools. The reviewed literature and related background concepts are presented in Section 2. Section 3 illustrates the design and characteristics of the data set at hand, while also describing the Image Processing and Retrieval steps. Results from the evaluation of the recognized raw text are discussed in Section 4. We conclude with future research directions in Section 5. II. BACKGROUND Text in imagery is typically characterized as either machine-printed (graphic) or scene text, i.e. captured on objects and native scenes [4]. The overarching goal of Text Information Extraction [4], in both cases, is to first assess the presence of any textual contents, to localize them, and to ultimately recognize the string counterpart of each provided glyph. Even though Text Detection and Optical Character Recognition (OCR) have reached optimal performance on scanned documents (with recognition rates exceeding 99%), the processing of more complex or degraded images is still gathering research interest [4], particularly in the context of natural scene images, ancient manuscripts, and handwritten pieces [5], [6], [7], where accuracy tends to drop around 60%. In the case of screenshots, some traditional issues are mitigated, e.g., diverse text orientation and uneven illumination, due to the high occurrence of ”graphic text” over ”scene text”. However, other challenges apply, such as cooccurrence of icons and text and the variability in fonts and layouts [4]. Further, screenshots represent a hybrid case study, mixing graphic and scene test in varying proportions over time, hence motivating the evaluation of existing techniques on a novel collection. Ultimately, the extracted text and the associated metadata constitute the basis to represent and retrieve information within the discussed corpus. Image Retrieval can generally be based on the visual elements embedded in the image (i.e., Content-based Image Retrieval or CBIR) or on its textual metadata, e.g. tags, surrounding captions or headings. This latter branch of Information Retrieval is also known as Concept-based Image Retrieval and, when built over categorical labels, traditionally requires significant manual annotation effort, as opposed to the increased computation complexity implied by CBIR. Multimedia content recognition and indexing is being already applied: for biomedical imagery cataloging and to assist future diagnosis based on past clinical data [8], [9]; for word matching over scanned and printed document images [10]; for similarity search over large video collections [11]. The work presented in [12] shares some similarities with our current pipeline, however Yeh et al. focus on GUI subelements of screenshots, from a user interaction standpoint and without evaluating the OCR robustness in the case of screenshots. Recent work [13] has focused on extracting news articles metadata from smartphone screenshots and exploit those as search parameters, to return the document full text for users to consume at a later stage. To our knowledge, none of the surveyed applications has exploited a combination of text extraction and indexing to retrieve smartphone screenshots of heterogeneous source, offering a diverse range of textual contents (e.g. social media posts, news, articles, health-related threads, text messages, video captions and so forth), and, thus, enabling countless free-text search combinations, over the archived media behaviors. III. DATASET AND PROCESS WORKFLOW A. Dataset The procedures described in this paper were applied to a set of over one million images collected from 54 individuals participating in an on-going study of media behavior. Software was installed on participants’ Android smartphones and/or personal laptops to monitor media exposure and use during a 10 day to 1 month period. Screenshots were taken every 5 seconds, encrypted, bundled, and transmitted to secure, cloud-based research servers. The interval between screenshots, and resulting volume, variety, and velocity of images, ensures sufficient granularity for time-series and mathematical modeling of these data [14], [1]. Further, device use has consolidated towards smartphones over time and offers access to a significant portion of daily activities, motivating our focus on smartphone screenshots. The data are unique and, after information extraction, have highvalue potential for many research- and consumer-oriented applications. For purposes of the current paper, we selected a subset of screenshots for study, testing, and refinement of text extraction procedures. Specifically, we partitioned a random subsample of 17 participants and applied reservoir sampling to randomly select 150 images from each day, thus accommodating the fact that the size of each daily collection of screenshots is not known a priori. The analysis set here consists of 13,172 smartphone screenshots representative of a typical user’s behavior. B. Image Pre-processing To enhance the quality of extracted text, we setup a procedure to process the raw screenshots and feed the OCR engine with graphic segments where the textual content could be more easily distinguished from the background. This data preparation routine was built on top of the OpenCV library for Image Processing [15]. The overall workflow is depicted in Figure 1, with pre-processing consisting of conversion to gray scale, binarization, and segmentation respectively. 1) Conversion to grayscale: Conversion of the images from RGB to grayscale is a prerequisite to binarization, which ultimately leads to better discrimination of the foreground from the background (i.e., the end goal of text/object detection). 2) Binarization: Binarization methods are conceived to transform grayscale images to binary format (i.e., black and white). The association of each pixel to black or white pixel sets can typically follow a global or a local approach to adaptive thresholding [16]. In the former case, the cutoff is constant within the same image, whereas in the latter case the threshold value can vary based on the local illumination conditions of the image. Since we could assume a uniform illumination relative to each screenshot, we applied a combination of simple inverse thresholding with Otsu’s global binarization. Finally, we skipped the skew estimation step, given the predominantly horizontal layout of the target text, thus leading to a more scalable pre-processing of the incoming images. Fig. 1: Overall Architecture for Smartphone Screenshot Processing, Indexing and Retrieval. 3) Segmentation: This step identified rectangular bounding boxes wrapping the textual content of the images, i.e., the standard shape format used by existing OCR engines for text detection [17]. We adopted a Connected Component based approach (similar to the methodology followed in [18]): (i) the white pixels were first dilated to create more organic white regions (Figure 1), (ii) the uniform regions were then detected, and (iii) a rectangle was drawn around the identified area. To limit the duplicated recognition of the same regions (i.e., when a smaller rectangle is completely enclosed in a larger area), we included an additional check to filter out the innermost rectangles. However, overlapping rectangles were still identified (Figure 4d), leading to partially duplicated text, when bounding boxes were ultimately passed to the OCR engine. C. Optical Character Recognition (OCR) After pre-processing, each segmented region was fed to the OCR engine, using the Python wrapper for Tesseract. Tesseract recognizes text in a ”two-pass process” [19] that integrates character segmentation with the recognition module, and uses backtracking to improve the quality of the output. First, attempts are made to recognize single words separately. Second, part of the words (based on a quality evaluation) are then passed to an adaptive classifier as training data. This increases the ability of the classifier to recognize the remainder of the text in the page. We relied on the stable release of Tesseract (v. 3.03) for our first OCR run, but the alpha release of Tesseract 4.0 was also tested on the considered sample set. The timing of our analysis provided an opportunity to compare the baseline engine with an updated approach, which integrates a LSTM-based module for line recognition in the pipeline, in a similar fashion to the OCRopus framework [20]. We were then able to assess the improvement introduced by a Neural-Net component, without increasing the computation and time expenses. Tesseract 4 has already been trained on approximately 400,000 lines of text that include 4,500 fonts. We exploited the pre-trained OCR architecture as-is, without re-training. For each screenshot, we obtain a Unicode text file formatted for easy comparison with the ground truth data. D. Ground Truth Data Collection Gold standard text was needed to ultimately evaluate the quality of the text extracted from the screenshots. Gold standard data is often collected through crowdsourced transcription services (e.g., Amazon Mechanical Turk), or, in some cases, through third-party commercial APIs for text extraction (e.g., Microsoft Cogntive Services). However, as our data are highly sensitive and require privacy protection, we customized a free, and open-source localturk tool [21] and involved three human annotators trained in human subjects research and confidentiality. The human annotators securely accessed a dedicated Virtual Machine hosting the transcription tool. Figure 2 showcases the GUI interface used for transcribing the images. The GUI’s left side showed the full screenshot, annotated with a set of bounding boxes produced by our Image Pre-processing module, while the individual boxes requiring transcription Fig. 2: GUI of manual transcription tool (illustrative screenshots). tion task [22], we obtained complete transcriptions of 1,360 screenshots. In sum, comprehensive ground truth data to evaluate our text extraction pipeline was produced for 10 percent of the analysis sample. E. Extracted Text Evaluation To evaluate the quality of our generated text against the gold standard transcribed text, we defined OCR accuracy both at the character and at the word level, as a complement of the error rates, and further discriminating between order-dependent and order-independent error rate at the word-level evaluation. Word Error Rate (WER) is based on the Levehnstein distance [23] between the provided text and the reference text: iw + sw + dw (1) W ER = nw were displayed on the right side. Bounding boxes were presented to annotators in the same scanning order followed by our Image Pre-processing module when detecting the rectangular segments to be passed to the OCR engine, i.e., from top to bottom and from left to right. This precaution ensured consistency between the collected ground truth text and the generated text to be evaluated. The annotators followed detailed instructions to complete the transcription tasks. Specifically, annotators were instructed to preserve capitalization and punctuation, use special character marks to disambiguate icons and graphic contents from text, and notate locations where text spanned beyond the segmentation cuts. The complete image with bounding boxes allowed annotators to check and note if any portions of text had been missed by the bounding box procedure and were not included in the transcription request. Similarly, partially overlapping boxes could arise in the set (Figure 4d). Annotators were instructed to take the full picture as reference, to transcribe the overlapping text only once, and to mark any cases that were not covered by the instructions. These checks (i.e., ordering of bounding boxes, handling of overlapping bounding boxes, updating transcription rules dynamically, unanticipated situations) facilitated the subsequent analysis of segmentation inaccuracies. In this first experimental setup, each annotator transcribed an independent set of images. In other words, agreement across different annotated sets was not evaluated. However, after a first run of evaluation and error analysis, the ground truth collection was cross-checked and manually corrected. This validation step supported the later assessment of the degree of human-error embedded in the process. Leveraging quality with the expensiveness of the transcrip- where iw , sw and dw refer to the number of words to be inserted, substituted and deleted to transform the given text into the reference text. Among all the possible permutations, the values that minimize the sum iw + sw + dw are actually chosen. The resulting number of transformations is then normalized by the number of words in the reference text (nw ). Character Error Rate (CER). Similarly, the same metric can be defined at the single character level: i+s+d (2) n where word counts are replaced by character counts, following the same rationale defined for the WER metric. Thus, the error rate will typically be higher at the word level, as failures in recognizing single characters ultimately impact the recognition of words as a whole. CER = Position-independent WER (PER) is based on a bagof-words approach that does not take the provided order of words into account when evaluating the word-level error rate. Hence, this metric loosens one of the constraints of the standard WER. As a result, this metric tends to overestimate the actual word-level accuracy. Hence, improving the accuracy of our text extraction framework essentially translates into minimizing the error rates, both at the character and at the word level. Furthermore, we prioritize the improvement on the standard WER over its positional-independent counterpart, with the intent to preserve the syntactic and semantic attributes of the extracted text, and support meaningful Natural Language Processing and Topic Evolution analyses of the obtained documents. To record these three metrics, we used the ocrevalUAtion open source tool [24]. Besides the described metrics, this tool also reports error rates by character, and aligned bitext for each document match, facilitating the comparison of the generated output against the reference text [24]. We set up the evaluation so that punctuation and case differences were counted as well, when calculating the scores. Finally, computational time was recorded and evaluated as an additional factor contributing to the overall process efficiency. F. Image Retrieval System 1) Document Parsing: To provide an organized structure to the data set and to link the extracted contents with each source image file, we mapped the image features and metadata into a defined XML schema, consisting of: (i) a unique identifier (i.e., obtained by concatenating each subject ID with the date and time of screen capture), (ii) a timestamp marking the date and time when the screenshot was taken, (iii) the text extracted from the images through OCR (Section 3.4), when present, (iv) an optional category describing the activity depicted by the considered frame (i.e., whenever the considered image had been manually classified), and (v) two file paths linking to previous and next image on the same subject’s timeline. The parsing module was developed in Python, exploiting the built-in ElementTree library. XML documents we formatted in a compliant format with Apache Solr, the open source software used to index our collection. An example of resulting data structure is as follows: <add> <doc> <field <field <field <field <field <field </doc> </add> name="id"></field> name="timestamp"></field> name="category"></field> name="text"></field> name="previous_image"></field> name="next_image"></field> 2) Indexing: The XML documents produced in the previous step were then indexed through the Apache Solr 6.3 distribution, which follows an inverse indexing approach. As opposed to a forward index, an inverted index consists of keyword-centric entries, referencing the document containing each considered term. While all data fields listed in Section 3.6.1 were stored within the Solr engine, only the textual content embedded in the images and their attached categorical labels were indexed to enable textual search over those attributes. 3) Similarity Scoring and Ranking: Once the index is built, user queries are compared against the collection based on a pre-determined similarity definition, ultimately impacting the returned results. In this application, we computed the similarity between the input textual queries and the inverted index entries through the Okapi BM25 term-weighting scheme [25]. For a document D and query Q containing qi ,...,qn keywords, the score is then defined as: score(D, Q) = n X i=1 idf (qi ) · f (qi , D) · (k1 + 1) f (qi , D) + k1 · (1 − b + b · |D| ) avdl (3) where avdl is the average document length and k1 and b are free parameters (kept to default built-in values in this case). Equation 3 is based on the same underlying principles of the term frequency- inverse document frequency (tf-idf ) heuristic, when determining the relevancy of words within each considered document. Particularly, the idf score recipient, for each keyword qi is computed as: idf (qi ) = log N − n(qi ) + 0.5 n(qi ) + 0.5 (4) where n(qi ) represents the number of documents containing qi and N is the total size of the corpus. Tf-idf increases proportionally with the frequency of occurrence of a term within a document and is normalized based on the term occurrence throughout the whole corpus. However, BM25 has been proven more effective than tf-idf in mirroring the user’s perceived relevancy towards returned contents, due to the introduced regularization parameters [25]. Further, the aforementioned approach was combined with Solr built-in Query Boosting function, to purposefully increase the ranking of term-matching on categorical fields over term-matching on the screenshot embedded contents. For instance, if the user provided the keyword ”Web”, multiple candidate documents might be selected, solely based on the BM25 scores. However, if one document was labeled with the term ”Web”, that document would obtain a higher ranking in the returned result list. 4) Search engine GUI: The results were presented to the users through a dedicated interface, integrating the Solrbased back-end with the Python-based Django Web framework. Snippets of the developed Graphic User Interface are shown in Figure 3. For each retrieved image, certain metadata are listed, including the id, timestamp and category. Each thumbnail can be expanded to full-size resolution, aiding further exploration of the retrieved textual content. Links to the previous and following frame on the same subject’s timeline emphasize the potential for temporal zooming and longitudinal analyses offered by this novel data set [2], which provides domain-independent elements of sequence, context and interdependence. IV. OCR R ESULTS AND DISCUSSION As introduced in Section 3.4, we compared the performance of two different releases of the Tesseract OCR engine before and after validating the manually transcribed text. This experimental setup aimed to quantify the improvement introduced by a NeuralNet-based module for line recognition (i.e., the additional component introduced with Tesseract 4 compared to Tesseract 3.03) when the other parameters were kept constant. First, we compared the two Tesseract-based solutions, applied as-is, with our framework, which added the aforementioned Image Pre-processing steps upfront. As illustrated in Tables I and II, the Image Pre-processing framework proposed here improved the overall accuracy, both at the character and word level [3]. Hence, this improvement justifies the additional computational steps implied by the proposed solution. After a careful inspection and error analysis of the outputs TABLE I: Comparison of baseline Tesseract 3 and 4: before and after applying the noise removal heuristic. Approach Baseline Tesseract 3 Baseline Tesseract 3 + heuristic Baseline Tesseract 4 Baseline Tesseract 4 + heuristic Character-level ER Accuracy ER Word-level Accuracy PER Accuracy 36.13% 33.45% 33.68% 31.73% 47.21% 43.42% 41.54% 38.38% 52.79% 56.58% 58.46% 61.62% 61.22% 63.99% 66.07% 68.54% 63.87% 66.55% 66.32% 68.27% 38.78% 36.01% 33.93% 31.46% TABLE II: Comparison of Tesseract 3 and 4 with Image Pre-processing: before and after applying the noise removal heuristic. Approach ImgProc+Tesseract 3 ImgProc+Tesseract 3 + heuristic ImgProc+Tesseract 4 ImgProc+Tesseract 4 + heuristic Character-level ER Accuracy ER Word-level Accuracy PER Accuracy 33.02% 31.95% 31.15% 30.68% 44.50% 41.26% 40.27% 38.95% 55.50% 58.74% 59.73% 61.05% 60.37% 62.67% 64.44% 64.94% 66.98% 68.05% 68.85% 69.32% Fig. 3: Search Engine Graphic User Interface(illustrative screenshots). produced in the two cases, we identified a lower robustness of the pre-processing framework in the presence of peculiar fonts chosen as a default on users’ phones (an example of such cases is shown in Figure 4a ), as opposed to the baseline (i.e., non pre-processed) alternatives. This observation suggested that the binarization and segmentation parameters can be further fine-tuned to improve the handling and recognition of font sets that are used by particular individuals. On the other hand, the proposed framework enhanced the recognition of text that is embedded in video frames (as depicted in Figure 4b), when compared to the baseline performance of the two Tesseract releases. Further, we wanted to discriminate between the accuracy deficiencies caused by the human error inherent to the transcription process and the error rates directly associated with the adopted Image Processing framework. Table II shows the results obtained when applying Tesseract 3.03 and Tesseract 4 to the pre-processed smartphone screenshots, i.e., after 39.63% 37.33% 35.56% 35.06% segmenting the regions of interest that were candidates for carrying fragments of textual content. The introduction of the LSTM-based line-recognition component slightly improved the OCR accuracy both at the single-character and word level. Analysis of the returned errors showed that the most prominent faults seem associated with: (i) the presence of icons and other graphic features in line with the text, (ii) defects in the reference transcriptions, (iii) presence of peculiar fonts, (iv) textual contents that are difficult to distinguish from their backgrounds (e.g., both are a light color), and (v) partially overlapping segmented regions leading to duplicated characters (as described in Section 3.3.3 - Figure 4d). To quantify the incidence of the first category of errors, we developed a naive heuristic to post-process our text and filter out the first line when it matches specific regular expressions that plausibly represent the top banner of smartphone displays. An example of the critical regions and text generated by the OCR engine when text was mixed with icons is provided by Figure 4c. Specifically, top lines were removed only when other textual content besides the upper banner was found. This process elicited a better measure of net accuracy on the textual contents of interest, by eliminating marginal and noisy content. However, when the top banner (i.e., typically icons, clock and battery level) was the only textual information included in the screenshot, it was not filtered out. Overall, applying this heuristic provided a more reliable proxy of the actual accuracy obtained by the current framework. Inherent human error associated with our manual transcription procedures also contributed to quality loss. Thus, the produced transcriptions were manually validated and the evaluation step repeated after correction. The results, depicted in Table III, demonstrate the significant incidence of inadequate reference text on the overall scores, when compared to Table II. Typical transcription faults include the occurrence of typos or oversights leading to a partial transcription of text that was actually present on the image. As a result of partial transcriptions, text, which was TABLE III: Comparison of Tesseract 3 and 4 with Image Pre-processing, after correcting the human-annotated scripts Approach ImgProc+Tesseract 3 ImgProc+Tesseract 3 + heuristic ImgProc+Tesseract 4 ImgProc+Tesseract 4 + heuristic Character-level ER Accuracy ER Word-level Accuracy PER Accuracy 27.42% 27.35% 25.16% 25.69% 39.12% 37.67% 33.85% 34.38% 60.88% 62.33% 66.15% 65.62% 66.19% 67.91% 71.23% 71.24% 72.58% 72.65% 74.84% 74.31% 33.81% 32.09% 28.77% 28.76% (a) (b) (c) (d) Fig. 4: Examples of discovered patterns after error analysis (illustrative screenshots): (a) fancy fonts, (b) text embedded in videos is extracted more effectively when integrating the pre-processing routine, (c) smartphone upper banners add marginal noise, (d) inaccurate segmentation can lead to overlapping bounding boxes. correctly recognized by the OCR engine, was absent from the reference text, artificially increasing the error rate. These inaccuracies were corrected through a posterior validation check. Please note, part of the error and burden related to transcriptions, was caused by the transcription tool’s GUI and procedural instructions, which need further refinement, based on the observations collected during this exploratory phase. After removing the transcription error effect from the set, the solution which integrates an LSTM-based linerecognition system still provided the highest performance. Tests with Tesseract 3.03 and 4 were run in parallel on two identical Debian, quad-core Virtual Machines. The computation times to process the sample (i.e., 13,172 phone screenshots), without applying ad hoc training in either of the two cases, were comparable for all pipelines. In sum, there were not any notable tradeoffs between Tesseract 3.03 and 4.0 in terms of process efficiency. V. CONCLUSIONS AND FUTURE WORK This paper introduced a complete workflow for text extraction and retrieval from smartphone screenshots. The pipeline is based on OpenCV image-processing and Tesseract OCR modules. We evaluated the quality of the extracted text, and showed how word and character accuracy improved through refinement of image pre-processing procedures and NeuralNet based line-recognition system introduced in the newly released Tesseract 4.0. Detailed analysis of word and character errors suggest that further improvements are possible, both generally and in the data production process. Additional error analyses identified and isolated the most prominent factors contributing to quality loss. Ultimately, a search engine application was developed based on the inherent characteristics of the data at hand, for the immediate use for the involved analysts. Human error embedded in the ground truth data production process was present and unanticipated. The findings that correction of human errors provided improvements in accuracy that were of similar size as other technical refinements suggests some reconsideration of how ground truth (and training) data are produced for new data streams. Given the costs, in terms of time and accuracy, there is much incentive to develop iterative solutions that reduce human involvement in the loop to correction of automaticallygenerated transcriptions (following a similar approach to the one described in [22] for video annotations). Future work on the more technical aspects of the text extraction process for screenshots include fine-tuning and sensitivity analysis of the Image Pre-processing parameters, which should increase the solution’s robustness in the presence of diverse fonts, embedded icons, and mixed graphic contents. Preprocessing may be particularly important for text extraction from laptop screens, for which the method is generalized, due to the possibility that multiple windows may be visible in a laptop screenshot. Problematically, each window might have different background and foreground contrasts, thus significantly introducing marginal noise. Thus, methods that effectively and accurately partition and segment the main active window will need to be developed and refined. As well, the results of this study suggest there is some need for re-training Tesseract-based solutions so that they better handle characters and words that only appear in specific sub-portions of the data (e.g., individual users’ device preferences and idiosyncratic font use). These additions and accommodations will expand computation complexity and time and therefore need to be evaluated with respect to added value. We further intend to make our data and experimental procedures as accessible as possible. Given inherent the privacy concerns, we will evaluate and use Web-scraping technologies to form a publicly-available sample data set for testing the implemented workflow. In sum, this paper describes the procedures followed for extracting and indexing text from a new kind of document - digital screenshots - that appears to hold high value for studying human behavior. As the pioneer exploration into extracting useful information from the first screenshot repository, the application of Image Pre-processing, OCR and CBIR tools was successful. While we are only at the beginning of learning what these data hold, these initial results are promising and produce excitement about how Information Extraction methods may be adapted for these data and contribute to new knowledge about how, when, and why individuals engage with digital life. ACKNOWLEDGMENTS The authors would like to acknowledge the Center for Advanced Study of Behavioral Science at Stanford University where the project was initially developed and the direct funders of this project: the Stanford University Cyber Social Initiative, the Knight Foundation, and the Pennsylvania State University Colleges of Informations Sciences & Technology and Health & Human Development. R EFERENCES [1] L. Yeykelis, J. J. Cummings, and B. Reeves, “Multitasking on a single device: Arousal and the frequency, anticipation, and prediction of switching between media content on a computer,” Journal of Communication, no. 64, pp. 167–192, 2014. [2] B. Reeves, N. Ram, T. N. Robinson, J. J. Cummings, L. Giles, J. Pan, A. Chiatti, M. Cho, K. Roehrick, X. Yang, A. Gagneja, M. Brinberg, D. Muise, Y. Lu, M. Luo, A. Fitzgerald, and L. Yeykelis, “Screenomics: A framework to capture and analyze personal life experiences and the ways that technology shapes them,” In review, 2017. [3] A. Chiatti, X. Yang, M. Brinberg, M. J. Cho, A. Gagneja, N. Ram, B. Reeves, and C. L. Giles, “Text extraction from smartphone screenshots to archive in situ media behavior,” in Proceedings of the 9th International Conference on Knowledge Capture (K-CAP 2017). ACM, 2017. [4] Q. Ye and D. Doermann, “Text detection and recognition in imagery: A survey,” IEEE transactions on pattern analysis and machine intelligence, vol. 37, no. 7, pp. 1480–1500, 2015. [5] T. Wang, D. J. Wu, A. Coates, and A. Y. Ng, “End-to-end text recognition with convolutional neural networks,” in Proceedings of the 21ist International Conference on Pattern Recognition (ICPR’12). IEEE, 2012, pp. 3304–3308. [6] W. Huang, D. He, X. Yang, Z. Zhou, D. Kifer, and C. L. Giles, “Detecting arbitrary oriented text in the wild with a visual attention model,” in Proceedings of the 2016 ACM on Multimedia Conference (MM ’16). ACM, 2016, pp. 551–555. [7] K. Wang and S. Belongie, “Word spotting in the wild,” in European Conference on Computer Vision. Springer, 2010, pp. 591–604. [8] A. V. Faria, K. Oishi, S. Yoshida, A. Hillis, M. I. Miller, and S. Mori, “Content-based image retrieval for brain mri: An image-searching engine and population-based analysis to utilize past clinical data for future diagnosis,” NeuroImage: Clinical, vol. 7, pp. 367–376, 2015. [9] B. K. Jung, S. Y. Shin, W. Wang, H. D. Choi, and J. K. Pack, “Similar mri object retrieval based on modified contour to centroid triangulation with arc difference rate,” in Proceedings of the 29th Annual ACM Symposium on Applied Computing, ser. SAC ’14. New York, NY, USA: ACM, 2014, pp. 31–32. [10] M. Meshesha and C. V. Jawahar, “Matching word images for contentbased retrieval from printed document images,” International Journal of Document Analysis and Recognition (IJDAR), vol. 11, no. 1, pp. 29–38, Oct 2008. [11] H. B. da Silva, R. P. de Almeida, G. B. da Fonseca, C. Caetano, D. Vieira, Z. K. G. do Patrocı́nio, Jr., A. de Albuquerque Araújo, and S. J. F. Guimarães, “Video similarity search by using compact representations,” in Proceedings of the 31st Annual ACM Symposium on Applied Computing, ser. SAC 16. New York, NY, USA: ACM, 2016, pp. 80–83. [12] T. Yeh, T. Chang, and R. C. Miller, “Sikuli: using gui screenshots for search and automation,” in Proceedings of the 22nd annual ACM symposium on User interface software and technology. ACM, 2009, pp. 183–192. [13] K. Umemoto, R. Song, J.-Y. Nie, X. Xie, K. Tanaka, and Y. Rui, “Search by screenshots for universal article clipping in mobile apps,” ACM Transactions on Information Systems (TOIS), vol. 35, no. 4, p. 34, 2017. [14] N. Ram, D. Conroy, A. L. Pincus, A. Lorek, A. H. Rebar, M. J. Roche, J. Morack, M. Coccia, J. Feldman, and D. Gerstorf, “Examining the interplay of processes across multiple time-scales: Illustration with the intraindividual study of affect, health, and interpersonal behavior (isahib),” Research in Human Development, no. 11, pp. 142–160, 2014. [15] Itseez, “Open source computer vision library,” https://github.com/ itseez/opencv, 2015. [16] O. D. Trier and A. K. Jain, “Goal-directed evaluation of binarization methods,” IEEE transactions on Pattern analysis and Machine Intelligence, vol. 17, no. 12, pp. 1191–1201, 1995. [17] Y. Lu, “Machine printed character segmentation: An overview,” Pattern recognition, vol. 28, no. 1, pp. 67–80, 1995. [18] K. H. Talukder and T. Mallick, “Connected component based approach for text extraction from color image,” in Computer and Information Technology (ICCIT), 2014 17th International Conference on. IEEE, 2014, pp. 204–209. [19] R. Smith, “An overview of the tesseract ocr engine,” in Document Analysis and Recognition, 2007. ICDAR 2007. Ninth International Conference on, vol. 2. IEEE, 2007, pp. 629–633. [20] T. M. Breuel, “The ocropus open source ocr system,” in Electronic Imaging 2008. International Society for Optics and Photonics, 2008, pp. 68 150F–68 150F. [21] D. Vanderkam, “localturk,” https://github.com/danvk/localturk. [22] J. Schöning, P. Faion, and G. Heidemann, “Semi-automatic ground truth annotation in videos: An interactive tool for polygon-based object annotation and segmentation,” in Proceedings of the 8th International Conference on Knowledge Capture, ser. K-CAP 2015. New York, NY, USA: ACM, 2015, pp. 17:1–17:4. [Online]. Available: http://doi.acm.org/10.1145/2815833.2816947 [23] V. I. Levenshtein, “Binary Codes Capable of Correcting Deletions, Insertions and Reversals,” Soviet Physics Doklady, vol. 10, p. 707, Feb. 1966. [24] R. C. Carrasco, “An open-source ocr evaluation tool,” in Proceedings of the First International Conference on Digital Access to Textual Cultural Heritage. ACM, 2014, pp. 179–184. [25] S. E. Robertson, S. Walker, S. Jones, M. M. Hancock-Beaulieu, M. Gatford et al., “Okapi at trec-3,” Nist Special Publication Sp, vol. 109, p. 109, 1995.
1cs.CV
arXiv:1710.02078v1 [stat.ME] 5 Oct 2017 Inference of forex and stock-index financial networks based on the normalised mutual information rate Yong Kheng Goh∗1, Haslifah M. Hasim 1 †2 , and Chris G. Antonopoulos ‡2 Centre for Mathematical Sciences, Universiti Tunku Abdul Rahman, Malaysia Department of Mathematical Sciences, University of Essex, United Kingdom 2 Abstract In this paper we study data from financial markets using an information-theory tool that we call the normalised Mutual Information Rate and show how to use it to infer the underlying network structure of interrelations in foreign currency exchange rates and stock indices of 14 countries world-wide and the European Union. We first present the mathematical method and discuss about its computational aspects, and then apply it to artificial data from chaotic dynamics and to correlated random variates. Next, we apply the method to infer the network structure of the financial data. Particularly, we study and reveal the interrelations among the various foreign currency exchange rates and stock indices in two separate networks for which we also perform an analysis to identify their structural properties. Our results show that both are small-world networks sharing similar properties but also having distinct differences in terms of assortativity. Finally, the consistent relationships depicted among the 15 economies are further supported by a discussion from the economics view point. Introduction Financial markets can be thought of as complex systems, and are treated as such by the Economics community [10, 15, 32, 33]. Economists however, approach financial markets from an economics view point, without frequently using information and tools available in other disciplines, such as in Physics and Mathematics [15]. Treating financial markets as a complex system helps in realising the relation to other complex systems and to common approaches in studying them. The performance and interaction of the individual components of such systems are expected to follow a non-linear, chaotic, rather than random, pattern of interaction with each other. It makes thus sense to study the system from the perspective of complex systems theory. Particularly, in this paper we consider data from financial markets world-wide and the European Union (EU). Financial markets consist of components, such ∗ [email protected] [email protected][email protected] † 1 as stock prices and currency exchange ratess. The connectivity between these components is usually unknown but highly desirable. The components form a network of nodes and connections, where the nodes are the individual index values, and the connections the interactions among them, usually non-linear and unknown! Here, we use a recently published information-mathematical theory for network inference based on the Mutual Information Rate (MIR) [9] to infer the structure of financial networks coming from recorded data from financial markets. MIR is a measure of the amount of information per unit of time that can be transferred between any two nodes in a network or system [5, 9]. When network engineers need to infer the topology of a given computer network, they ping individual nodes to map the layout. In financial markets, the analogue to pinging is to using financial time-series data, whereby each component is recorded and tracked regularly in time. We then want to study these data to understand how information flows from node to node in the network and ultimately, its structure, with the links being in general either direct or indirect. MIR was first introduced by Shannon in 1948 as a “rate of actual transmission” [36] and, it was redefined more rigorously in [13] and even later in [17]. It represents the mutual information (MI) exchanged per unit of time between two dynamical, correlated, variables and is based on mutual information which quantifies linear and non-linear interdependencies between two systems or data sets. It is essentially a measure of how much information two systems or two data sets share. Even though MI is a very important quantity to understand various complex systems ranging from the brain [2] to chaotic systems, there are three main difficulties that need to be overcome: (a) MI in random memoryless processes does not consider the degree of memory that financial markets are proved to contain [11,15,27], (b) it is necessary to determine what is considered as significant event in the complex system under study as probabilities of significant events often need to be known prior to the calculation of MI, (c) due to the usually limited size of data sets, it is complicated to calculate these probabilities accurately. This might lead to a biased calculation of MI [37]. To overcome these challenges, it has been proposed in [4, 15] to calculate the amount of information exchanged per unit of time between two nodes in a dynamical network, aka MIR. This rate permits a more reliable measure of the hierarchical dependency in networks. Other limitations are related to the market structure, that is to sectors and sub-sectors of economic activities for stock markets and geographical locations for market indices and foreign exchange markets. More information can be extracted when studying the causal relationships between markets, either by lead-lag effect (asymmetric correlations) or partial correlations. Another limitation is introduced by the use of linear measures for the relation between market elements, ignoring the complexity in such systems and the fact that financial markets present a non-linear behaviour with regard to stock returns. In [16, 41], the authors have overcome the above limitations by performing a network analysis of financial markets based on partial mutual information. In this paper, we are interested in identifying interdependencies between nodes in the said financial networks and not in inferring the directionality of information flow, i.e. which node is driving which (i.e. causality). We thus assume through out the paper that all networks are undirected, i.e., each connection between two nodes is bidirectional. The existence of such a connection means there is a bidirectional connection between them due to their interaction. The purpose of this work is focused on demonstrating how one can use a quantity based on MIR [9] that we call the normalised MIR to infer the network structure in financial data. Particularly, we show how one can infer the underlying network connectivity among the nodes of the network of financial time-series data, such as foreign currency exchange rates and stock indices. We first 2 apply a normalisation to the MIR using artificial data with given properties, compare the new methodology to work already done in [9] and then apply it to financial market data based on [15] for the economies of 14 world-wide countries and the EU. Our results show consistent relationships and structural properties among the 15 economies and, an explanation from the Economics view point is given that further supports these findings. Materials and methods Information and network connectivity As is well-known, a system can produce information which can be transferred among its different components [1,2,4,24,25,30,35]. When information is transferred, there are at least two components involved that are physically interacting by either direct or indirect ways. These components can be either time-series data, modes, or related functions, and from the mathematical view point, they are defined on subspaces or projections of the state space of the system [1,4]. In this work, we will use a quantity based on MIR, the normalised MIR, to study the amount of information transferred per unit of time between any two components of a system, namely to determine whether a link between these components exists. Such an existence means there is an undirected connection between them attributed to their interaction. MIR measures the rate of information exchanged per unit of time between any two non-random, correlated variables. Since variables in complex systems are not purely random, MIR is an appropriate quantity to measure the amount of information exchanged per unit of time among nodes in such systems. Its application to time-series data and to their functions is of primordial importance to our work and will be used to determine if an (undirected) link exists between any two nodes in the system. In this framework, the strength of such connections can also be inferred, in the sense that they will be compared to those from all other pairs of nodes in the network, so long as the available data collected from the financial markets are sufficient to allow for a discrimination between stronger and weaker connections. Mutual information MI and MIR were originally introduced by Shannon in 1948 [36]. Particularly, the MI of two random variables X and Y is a measure of their mutual dependence and quantifies the “amount of information” obtained about one random variable X(Y ), after observing the other random variable Y (X). It is defined by [23, 36] IXY (N) = HX + HY − HXY , (1) where N is the total number of random events in variables X and Y . HX and HY are the marginal entropies of X and Y (i.e. the Shannon entropies) respectively, defined by HX = − N X PX (i) log PX (i) i=1 3 (2) and HY = − N X PY (j) log PY (j), (3) j=1 where PX (i) is the probability of a random event i happening in X, and PY (j) is the probability of a random event j happening in Y . The joint entropy, HXY in Eq. (1) measures how much uncertainty there is in X and Y when taken together. It is defined as HXY = − N X N X PXY (i, j) log PXY (i, j), (4) i=1 j=1 where PXY (i, j) is the joint probability of both events i and j occurring simultaneously in variables X and Y . Equivalently, we can define MI by IXY (N) = N X N X PXY (i, j) log i=1 j=1  PXY (i, j) PX (i)PY (i)  . (5) This equation provides a measure of the strength of the dependence between the two random variables, and the amount of information X contains about Y , and vice versa [23]. When MI is zero, IXY = 0, the strength of the dependence is null and thus X and Y are independent: knowing X does not give any information about Y and vice-versa. Note that MI is also symmetric, i.e. IXY = IY X . The computation of IXY (N) from time-series data requires the calculation of probabilities in an appropriately defined probabilistic space on which a partition can be defined (see for example Eqs. (4) and (5)). The probabilistic space is defined based on the X, Y variables. IXY can be computed for any two components, or nodes X and Y of the same network and can then be compared with IXY of any other pair of nodes in the same network. However, IXY is not suited to compare between different systems as it is possible for different systems to have different correlation decay-times and time-scales [3, 14, 31] in their dynamical evolution. There are various methods to compute MI, depending on the method used to calculate the probabilities in Eq. (5). The main methods are the binning (histogram) method [26], the densitykernel method [28], and the estimation of probabilities from distances between closest neighbours [21]. In this work, we use the binning (histogram) method [9]. Binning tends to overestimate MI because of the finite length of recorded time-series data, and the finite resolution of nonMarkovian partitions [12, 37]. However, these errors are systematic and always present for any given non-Markovian partition. To avoid such errors, we apply a normalisation as proposed in [9] when dealing with MIR, utilising the binning method to calculate the probabilities in Eq. (5). Mutual Information Rate The Mutual Information Rate came about as a method to bypass problems associated with the resolution of non-Markovian partitions, specifically in calculating MI for such partitions. In [4], it was shown how to calculate MIR for two finite length time-series irrespective of the partitions 4 in the probabilistic space. MIR is invariant with respect to the resolution of the partition and is defined by MIRXY L−1 X IXY (i + 1, N) − IXY (i, N) = lim lim N →∞ L→∞ L i=1 IXY (L, N) − IXY (1, N) N →∞ L→∞ L = lim lim IXY (L, N) , N →∞ L→∞ L = lim lim (6) where IXY (L, N) represents the MI of Eq. (1) between two random variables X and Y , considering trajectories of length L that follow an itinerary over cells in an N × N grid of equally sized boxes defined in the probabilistic space. Note that the term IXY (1, N) /L tends to zero in the limit of infinitely long trajectories, (i.e. L → ∞). For finite-length time-series X and Y , the definition in Eq. (6) can be further reduced, as demonstrated in [4], to IXY (N) MIRXY = , (7) T (N) where IXY (N) is defined as in Eqs. (1) and (5), and N is the total number of cells in a Markov partition of order T for a particular grid-size N. It is important to note that while T and N are both finite quantities, for statistically significant results, a sufficiently large number of points is required to ensure that the length of the time-series is sufficiently larger than T , and thus a more saturated distribution of data across the probabilistic space and its partitions can be achieved. Demonstration of the method We first demonstrate the usefulness of the method to infer the structure of networks where the dynamics in each node is given by a chaotic map, before applying it to financial-markets data. Particularly, we apply the proposed methodology to networks with known structure given by their adjacency matrices, and different maps for the dynamics of their nodes, and assess the obtained results by comparing the inferred network with the original networks, i.e. by comparing their adjacency matrices to decide whether the inference was successful in terms of the number of correctly inferred connections expressed as a percentage. For example, 100% successful inference means that the proposed methodology was able to infer all connections in the original network used to produce the recorded data with no spurious connections appearing. We first generate time-series data using discrete-time dynamics for the nodes of networks with given binary adjacency matrices. For these data and for each considered system, we then calculate the normalised MIR for each pair of nodes in the network, and subsequently its adjacency matrix based on the computed values and an appropriately defined inference threshold. Finally, we compare the adjacency matrix of the inferred network with that of the initially used network to estimate the percentage of successful inference. 5 Circle map network Following [9], we first apply the methodology to the case of a topology, which we refer to as the circle map network (CMN) (see Fig 1a). The network is composed of 16 coupled nodes with dynamics given by [20] xin+1 = (1 − α) f xin , r  M  αX + Aij f xjn , r , ki j=1 (8) where M = 16 is the total number of nodes, xin is the n-th iterate of map i (where i = 1, 2, . . . , M) and α ∈ [0, 1] is the coupling strength. (Aij ) is the binary adjacency matrix of connectivities, containing entries of either 1 when there is a connection between nodes i and j, or 0 when there is no such connection. Moreover, it is a symmetric matrix as we consider a connection between any M X two nodes to be undirected (i.e. bidirectional). ki = Aij is the node-degree, r the parameter j=1 of each map, and f (xn , r) the circle map, defined by f (xn , r) = xn + r − K sin (2πxn ) 2π mod 1. (9) For the parameters in Eq. (8), we follow [9] and use α = 0.03 to create a weakly interacting system, and r = 0.35 and K = 6.9115 that correspond to fully developed chaos for each individiual map. xi0 is initialised randomly, and the first 1,000 iterations are discarded so that a random seed can be used to start the next 100,000 iterations generated from the dynamics in the network, which we recorded as the time-series data. Fig 1a shows the network topology described by the adjacency matrix A with the 16 nodes. 6 Fig 1. The CMN, distribution of data points and expansion of points in Ω. Panel (a): The CMN is composed of 16 coupled nodes as shown by its network. The dynamics in each node is given by Eqs. (8) and (9). Panel (b): The distribution of points in Ω obtained from Eqs. (8) and (9), plotted in a 10 × 10 grid of equally sized cells. Panel (c): The points belong initially to a cell of the same grid and expand to a larger portion of Ω after three iterations, occupying more than one cells. δ is the maximum distance in the initial cell and ∆ the maximum distance after the points have expanded to a larger extend of Ω. We then calculate MI and MIR for a pair of nodes X, Y by defining a 2-dimensional probability space Ω formed by the time-series data recorded for that pair (see Fig 1b). Ω is partitioned into a grid of N × N fixed-sized cells where the probability of an event i in X is PX (i) = number of data points in column i , total number of data points in Ω (10) and the probability of an event j in Y is PY (j) = number of data points in column j . total number of data points in Ω (11) Similarly, the joint probability can be defined by the ratio of points in cell (i, j) of the same 7 partition in Ω and is expressed by PXY (i, j) = number of data points in cell (i, j) . total number of data points in Ω (12) MI therefore can be calculated from Eq. (5) for different values of grid sizes N. To ensure there is always a sufficiently large number of data points in the cells of the N × N partition of Ω, we require the average number of points in all occupied cells to be sufficiently larger than the number of occupied cells, hN0 (N)i ≥ Noc , (13) where Noc is the number of occupied cells and hN0 (N)i is the average number of points in all occupied cells in Ω. For the CMN, we have used a data set of 100,000 points which guarantee that this condition is satisfied for grid sizes up to Nmax = 19 and, thus we have calculated IX,Y for grid sizes ranging from 0.2Nmax to Nmax . In order to compute MIR, as in Eq. (7), to infer the topology of the network, we first need to estimate T (N), i.e. the correlation decay time. T (N) can be calculated in many ways, e.g. by using the diameter of an associated itinerary graph G [9], or the Lyapunov exponents of the dynamics or the largest expansion rates [4]. All these different ways of estimating T (N) exploit the fact that the dynamics is chaotic and uses thus the assumption that the points expand to the whole extend of Ω after about T (N) time. For the itinerary graph G, each cell in Ω occupied by at least one point is represented as a node in G. If Gij = 1, there is at least one point that can move from node i to node j. If Gij = 0, then there is no such point. The diameter of G is the minimum distance (hops) required to cover the entire network. The correlation decay time, T (N), is then the minimum time for points in any cell of Ω to spread to its whole extend, and can be expressed as the diameter of G. A drawback of this approach however is that the resulting correlation-decay time is integer and thus not as good approximation as the correlation-decay time estimated by the largest Lyapunov exponent or expansion rate, with profound consequences in the calculation of MIR. Consequently, in this work, we estimate T (N) by the largest expansion rate which is computed from the recorded data. Particularly, T (N) ≈ 1 1 log , λ1 N (14) where λ1 is the largest positive Lyapunov exponent of the dynamics [7]. However, in a system or for recorded data sets for which λ1 cannot be estimated or computed, it can be replaced by the largest expansion rate e1 , defined by Noc 1 1 X log Li1 (t) , e1 = Noc i=1 t (15) with e1 ≤ λ1 in general. The equality holds when the system has constant Jacobian, is uniformly hyperbolic, and has a constant natural measure [4]. In Eq. (15), Li1 (t) is the largest distance between pairs of points in cell i at time t divided by 8 the largest distance between pairs of points in cell i at time 0, and is expressed as Li1 (t) = = ∆ δ largest distance between pairs of point in cell i at time t . largest distance between pairs of point in cell i at time 0 (16) In Fig 1c and Fig 1d we present an example of the expansion of points for the CMN that initially belong to a single cell (Fig 1c) and after three iterations of the dynamics, they expand to a larger portion of Ω (Fig 1d). In Fig 1c, we denote by δ the maximum distance for a pair of points in the initial cell and in Fig 1d by ∆ the maximum distance after they have expanded to a larger extend of Ω. In the calculation of MIR, since we are using partitions of fixed-size cells which are nonMarkovian, errors will populate, causing a systematically biased computation towards larger MIR values. In such cases, MIR is partition-dependent, and we thus calculate it in a way that makes it partition-independent, following [9]. Particularly, there is a systematic error coming from the non-Markovian nature of the equally-sized cells in the considered grids as a smaller N is likely to create a partition which is significantly different to a Markovian one than a larger grid size N. Moreover, using the fact that MIRXY = MIRY X and MIRXX = 0, we can narrow the number of X, Y pairs from M 2 to M (M − 1) /2. The method presented in [9] to avoid such errors is to normalise MIR for each grid size N as follows: For fixed N, MIRXY (N) is first computed for all M(M − 1)/2 pairs of nodes and is normalised with respect to their minimum and maximum values. The reason is that for unconnected pairs of nodes, MIR is numerically very close to zero, and doing [ XY in Eq. (17) will be in the interval [0, 1]. This normalisation can be achieved by so the new MIR [ XY (N) = MIR MIRXY (N) − min {MIRXY (N)} , max {MIRXY (N)} − min {MIRXY (N)} (17) where MIRXY (N) is the MIR calculated for nodes X and Y , min {MIRXY (N)} is the minimum MIR of all M(M − 1)/2 pairs, and similarly max {MIRXY (N)} is the maximum MIR over all MIR [ XY (N) for a range of grid sizes N, we can values of the M(M − 1)/2 pairs. Since we use MIR [ XY by [9] further normalise MIR MIRXY P [ i MIRXY (Ni ) o nP , = [ XY (Ni ) max MIR i (18) where the maximum is now taken over the Ni grid sizes considered in [0.2Nmax , Nmax ]. This normalisation ensures again that MIRXY values are in [0, 1]. To reconstruct a network using Eq. (18), we fix a threshold τ ∈ [0, 1] and consider the pair XY as connected if MIRXY ≥ τ . If so, then the corresponding entry in the adjacency matrix Ac of the reconstructed network becomes 1, i.e. AcXY = 1 or 0 if MIRXY < τ as the pair is considered as unconnected. Choosing τ appropriately is crucial in successfully depicting the structure of the original network from the recorded data. If τ is set too high, real connections among nodes might be missed, while if set too low, spurious connections between nodes might appear in the inferred network. To address 9 this, we follow [34] and determine τ by first sorting all MIRXY values in ascending order, and then identifying the first XY pair for which MIRXY increases more than 0.1 - which accounts for an abrupt change in MIRXY values - and then set the threshold τ as the middle value of the MIRXY for the identified pair and that for the immediately previous pair. This is based on the observation that there two main groups of MIRXY values, i.e. for the connected and unconnected nodes (see Fig 2b). Fig 2. Estimation of the threshold τ for the inference of CMN. Panel (a) is the plot of the MIRXY values before ordering in ascending order and (b) after being ordered. Following the approach in the text, τ ≈ 0.21 plotted by the red dash line in both panels. We demonstrate the application of this approach for network inference in Fig 2. Particularly, in panel (a) we plot the MIRXY values for all pairs XY before ordering them in ascending order and in (b) the same values ordered. It is evident in panel (b) that there two groups of MIRXY values, namely one for the unconnected pairs (left side of the plot with relatively low values) and another one for the group of connected pairs (right side of the plot with relatively big value), separated by an abrupt change in MIRXY values in between. Following the proposed methodology, we have estimated that τ ≈ 0.21 (plotted by the red dash line in both panels) which crosses the bar for which there is this abrupt change. This then leads to the 100% successful inference of the original network shown in Fig 1a. Inferring networks using data from additional sources Introducing an additional node with uniform, uncorrelated, random data One of the main difficulties in inferring the structure of a network is the estimation of τ . The notion of an abrupt change might be subjective (more than one abrupt changes) or even not clearcut, especially when dealing with data from real experiments and/or when the number of nodes in the network is big. Here, we introduce another approach to improve network inference by setting τ according to the MIRXY value of a pair of, disconnected from the network, nodes with data with known properties. This MIRXY value will then be used to set the threshold for network inference. To demonstrate this, we will use uniformly random, uncorrelated, data as the additional source. One would expect that the MIRXY and correlation decay time, T (N), between any two nodes of a 10 network of such data would be close to zero and one, respectively. This idea can be appreciated by using a network of isolated nodes. To this end, we set α = 0 in Eq. (8), N = 6 nodes and f (xn , r) be the logistic map in its chaotic regime (i.e. r = 4),   fi xin , r = rxin 1 − xin . (19) The normalisation process casts the MIRXY values in [0, 1] for all pairs of nodes XY . Often, the resulting ordered MIRXY values do not allow for a clear determination of τ as evidenced in Fig 3a. Without the use of an additional source of uniformly random, uncorrelated data for a pair of nodes disconnected from the rest of the network, one would compute τ ≈ 0.27 and would result in the inferred network in panel (b) which is clearly not the original one which consists of only isolated, disconnected nodes! In contrast, when using the idea of introducing uniformly random, uncorrelated data for a pair of nodes disconnected from the rest of the network, and applying the same methodology, panel (c) shows an abrupt change in the ordered MIRXY values that can be exploited to infer the network structure. In this case, τ ≈ 0.5 and leads to the successful network inference shown in panel (d). The black bars correspond to the MIRXY values for the pair of introduced nodes with other nodes in the network. 11 Fig 3. Results for the case of an additional source of data from a pair of nodes with uniformly random, uncorrelated data. Panel (a) shows the estimation of τ ≈ 0.27 based on the ordered MIRXY values for a network of 6 isolated nodes without the introduction of the pair of nodes with uniformly random, uncorrelated data. Panel (b) is the unsuccessfully inferred network based on panel (a). Panel (c) shows the ordered MIRXY values for the same network with the nodes of random data added. The black bars are the MIRXY values that come from the pair of additional nodes. Panel (d) shows the resulting successfully inferred network of isolated, disconnected nodes. In panels (a) and (c), we plot τ by a red dash line where τ ≈ 0.27 in (a) and τ ≈ 0.5 in (c). Indirect information exchange and bidirectional connections Next, we will examine a network of six weakly coupled that corresponds to the following adjacency matrix  0 1 0 0 1 0 1 0  0 1 0 0 (Aij ) =  0 0 0 0  0 0 0 1 0 0 0 0 12 (α = 0.1) logistic maps (19) seen in Fig 4a 0 0 0 1 0 1  0 0  0 . 0  1 0 This network consists of two triplets of nodes which are disconnected from each other. In each triplet, the two end nodes do not exchange information directly, but only indirectly through the intermediate nodes (i.e. 2 and 5, respectively). Applying the proposed methodology for network inference without the use of any additional nodes will result in picking up the indirect exchange of information as a direct one, where τ ≈ 0.16, depicted as the red dash line in Fig 4b, leading thus to a spurious direct connection between the end point nodes (see Fig 4c). Fig 4. Network inference in the case of two, disconencted from each other, triplets of nodes. Panel (a) shows the network of weakly coupled (α = 0.1) logistic maps. Nodes 1 and 3 interact indirectly through node 2, and similarly, nodes 4 and 6 through node 5 only. Panel (b) shows the ordered MIRXY and threshold τ (red dash line) when no additional nodes are introduced to the network. The red dash line corresponds to τ ≈ 0.16. Panel (c) shows the unsuccessfully inferred network when using only the data from the network in panel (a). Panel (d) shows the ordered MIRXY values for the same network as in (a) with the additional data from the pair of directed nodes (see text). The blue dash line represents the threshold computed for the pair of directed nodes (τ ≈ 0.69) and the red dash line corresponds to τ ≈ 0.16 from panel (b). Finally, panel (e) shows the successfully inferred network by considering as connected nodes only those with MIRXY bigger than the blue dash threshold. The addition of a new pair of nodes with uniformly random, uncorrelated data disconnected from the rest of the network will not help either in inferring the network structure successfully in this case as the chaotic dynamics data for which we want to infer the network structure are also uncorrelated in time. An alternative approach is to add a pair of directed nodes to the network, again disconnected from the main network. These nodes will be represented by chaotic logistic 13 maps (i.e. with r = 4 and α = 0.1 in Eq. (19)) with  0 (Aij ) = 0 the adjacency matrix  1 . 0 Only the second node is coupled to the first and, thus, the information exchange is unidirectional from the second to the first, and the MIRXY would not be as high as for a bidirectional connection between them. Consequently, we may assume that any information exchange value smaller than the MIRXY value for this particular pair will not be considered as a connection and will be represented by 0 in the corresponding inferred adjacency matrix (see Fig 4d where the new threshold, depicted as the blue dash line, is now set at τ ≈ 0.69 and the old one is represented by the red dash line at τ ≈ 0.16). Following the proposed methodology for network inference for the augmented data and for τ ≈ 0.69, we arrive at the 100% successfully inferred network in Fig 4e which is the same as in Fig 4a. Application to correlated normal variates data An interesting application of the proposed methodology is to correlated normal variates data. In most cases, data collected from real-world applications have no obvious dynamical system equations to help relate the different variables involved. For example, global financial markets of different countries are correlated, however the underlying dynamics are not known [19]. The proposed method would be able to provide clues on the interrelations among the financial markets. To demonstrate this, we generated three groups of correlated normal variates data. Each group i = 1, 2, 3 consists of three correlated normal variates specified by a covariance matrix Σi and the three groups are uncorrelated with each other. Fig 5a shows the scatter matrix of the three groups of data (first group: x1,. . .,x3, second group: x4,. . .,x6 and third group: x7,. . .,x9) with covariance matrices       3.40 −2.75 −2.00 1.0 0.5 0.3 1.40 −2.75 −2.00 1.50 , Σ2 = 0.5 0.5 0.3, Σ3 = −2.75 5.50 −1.00 . Σ1 = −2.75 5.50 −2.00 1.50 1.25 0.3 0.3 0.3 −2.00 −1.00 3.25 A circular pattern for a pair of data sets indicates they are independent (or weakly correlated), whereas an elongated one strong correlation among them, either positive or negative depending on the orientation. For example, in Fig 5a data sets x8 and x9 are weakly correlated and thus one would not expect to see a connection between them in the inferred network. In contrast, since data sets x1 and x3 are strongly anti-correlated, one would expect to see a connection in the inferred network. This is a case where there is a clear distinction between correlated and non correlated pairs as the data have been constructed as such. This can then be exploited further to set the threshold τ to identify connectivity in terms of the correlated pairs. Particularly, we set τ for MIRXY so as to depict all correlated pairs of nodes in the data. The results in Fig 5c show that MIRXY can be used to infer successfully the network from correlated normal variates. One can see that the data are successfully classified into three distinct groups, and that, the connection between nodes x8 and x9 is missing as they are weakly correlated and the connection between nodes x1 and x3 is present as they are strongly anti-correlated. Since, this pair is also the strongest correlated among 14 all, its MIRXY value is also maximal and corresponds to the highest bar in Fig 5b which is equal to 1! Here, we have shown that the MIRXY can depict correctly the number and pairs of correlated data and thus, infer successfully the underlying network structure. Since, global financial data of different economies and countries are also found to be correlated [19], we will use a similar approach in the next section to infer the network structure of currency exchange rates to USD and stock indices for 14 countries world-wide and the EU. Fig 5. Application of the proposed method to correlated normal variates data. Panel (a) shows the scatter matrix of nine data sets split into three groups (first group: x1,. . .,x3, second group: x4,. . .,x6 and third group: x7,. . .,x9). Each group consists of three correlated normal variates with zero correlation among the groups. Fig 5a shows the scatter matrix of the three groups of data (x1,. . .,x9) . The circular pattern indicates that the two nodes are independent (or weakly correlated), whereas an elongated one shows strong correlation, either positive or negative depending on the slope. Panel (b) is the ordered MIRXY for the correlated variates. The red dash line corresponds to τ ≈ 0.06. Panel (c) shows the successfully inferred networ resulting from (b). Application to financial data So far, we have demonstrated the applicability of the method to infer successfully the network structure for artificial data, and we now use it to infer the connectivity in networks of financialmarkets data. 15 Particularly, we have applied the proposed methodology to infer the financial relations among 14 countries world-wide and the EU using the currency exchange rates to US Dollar (USD) and stock indices. The information for the local currencies and stock indices for the 14 countries and the EU are shown in Table 1. The data used are daily exchange rates of the local currencies to USD, ranging from January 2000 to August 2016 (taken from the Datastream, Thomson Reuters, database) and stock-indices data, ranging from January 2000 to December 2016 (taken from Bloomberg). We have transformed the daily data points pt from exchange rates and stock indices to log-return values rt = ln(pt /pt−1 ) where t is the index of the data point in the time-series, as this is a common assumption and practise in Quantitative Finance [18]. Label Countries/Economies Local currencies Stock indices 1 JPN - Japan Yen Nikkei 225 2 EUR - European Union Euro Euro Stoxx 50 3 CAN - Canada Canadian Dollar S&P/TSX Composite Index 4 TWN - Taiwan New Taiwan Dollar TSEC weighted Index 5 CHE - Switzerland Swiss Franc SMI Index 6 IND - India Rupee Bombay BSE 30 7 KOR - South Korea Won Seoul Composite KS11 8 BRA - Brazil Brazilian Real Bovespa 9 MEX - Mexico Mexican Peso MXX Bolsa Index 10 NOR - Norway Norwegian Krone Oslo OBX Index 11 SWE - Sweden Swedish Krona OMX Stockholm 30 Index 12 SGP - Singapore Singaporean Dollar Straits Times Index 13 ZAF - South Africa Rand FTSE/JSE All-Share Index 14 THA - Thailand Thai Baht SET Index 15 DNK - Denmark Danish Krone OMX Copenhagen 20 Table 1. The local currencies and stock-indices information for the 14 countries and the EU. The first column is the node labels, the second the corresponding 14 countries and the EU (second row), the third their local currency exchange rates with USD and the fourth, the stock indices. Notice that the first column is the node label seen in the networks in Fig 6e and 6f. Fig 6a and 6b present the scatter plots for the daily log-returns of the exchange rates and stockindices based on the 15 economies, respectively. In both scatter plots, the strongest correlated pair is the EU-Sweden (EUR-SWE) pair. This strong interrelation is manifested by the highest bars in the ordered MIRXY plots in Fig 6c and 6d. The second highest, and rest of the bars in Fig 6c do not correspond to the same pairs in Fig 6d, indicating that the connectivity in the two inferred networks for the exchange rates and indices will be different. To infer the networks from the MIRXY plots, we need to set the thresholds appropriately in Fig 6c and 6d. Since for the financial data, there is no clear-cut distinction between correlated and non correlated pairs (see Fig 6a and 6b), we use the same idea as for the indirect information exchange data and introduce an additional pair of unidirectional interacting nodes with chaotic logistic map dynamics to the financial data nodes. The pair is the same for both the forex and stock-indices data and is disconnected from the financial data networks to avoid indirect influences. Again, we assume that any pair of nodes with MIRXY bigger than the MIRXY of the unidirectional interacting nodes can be regarded as connected. Following this approach, we have found that 16 τ ≈ 0.03 and 0.05 for the exchange-rates and stock-indices data, respectively. The difference in the two thresholds comes from the normalisation in Eq. (17) as the maximum values of MIRXY for the forex and stock-indices data are different and they are representing information exchange in different networks. Subsequently, in Fig 6e and 6f we present the resulting inferred networks for the daily exchange rates and indices based on the MIRXY values for the 105(= 15(15 − 1)/2) possible, unique pairs of world-wide economies. Doing so, we have been able to infer most of the weakly and all strongly correlated pairs of economies in both financial data-sets. To complement our analysis, we have performed a structural analsyis to shed light on the properties of the two inferred networks. Particularly, we have found that both are small-world networks with small-world measures [2, 6] of σ ≈ 5 for the exchange rates and σ ≈ 3 for the stockindices, respectively. The higher is σ from unity, the better it displays the small-world property, with values of σ < 1 indicating a random network. In our case, we find that the stock-indices network is closer to a random network than the exchange-rates network. We have also found that the exchange rates network is a dissasortative (mixing by degree) network (with coefficient of assortativity r ≈ −0.17) whereas the stock-indices network is assortative with r ≈ 0.1. Assortative mixing by degree is the tendency of nodes with high degree to connect to others with high degree, and similarly for low degree, whereas dissasortative mixing by degree is the tendency of nodes with high degree to connect to other nodes with low degree [29]. This is a qualitative difference between the two networks as economies well-connected in terms of their exchange rates prefer to connect with economies less well-connected in terms of the exchange rates as opposed to the stockindices behaviour where the preference is toward the well connected nodes! Interestingly, our study also reveals that there are 32 bidirectional connections with non-trivial information exchange in the exchange-rates network and 49 in the stock-indices network. Moreover, both networks have a relatively small modularity (i.e. Q ≈ 0.12 and Q ≈ 0.14 for the exchange rates and stock indices, repsectively) indicating that the strength of division of both networks into modules is small, meaning that both networks have sparse connections between the nodes within modules and denser connections between nodes in different modules. 17 Fig 6. The scatter plots and inferred networks for the financial-markets data. Panels (a), (c) and (e) show the scatter matrix, ordered MIRXY values and network of the 15 currency exchange rates. Panels (b), (d) and (f) similarly for the 15 stock indices. The red dash line in (c) corresponds to τ ≈ 0.03 and in (d) to τ ≈ 0.05. Note that in panels (e) and (f), the nodes represent the currency exchange rates and stock indices for the 15 economies, respectively, as in Table 1. The results in Fig 6e show that the Indian Rupee is not connected to any currency because it is a non-convertible currency, also known as a blocked currency, where the currency cannot be freely traded on the international exchange market, generally as a result of government restrictions. A similar pattern is evident in other non-convertible currencies in this study, namely South 18 Korean Won, Taiwan Dollar and Brazilian Real. The results show that the South Korean Won has no connection with other currencies, except with regional neighbour’s currency, Taiwan Dollar. Emerging market currencies, especially those in the same region, tend to mirror each other [22]. The Brazilian Real and the Mexican Peso have come to epitomise this kind of relationship. Other than Mexican Peso, the Brazilian Real is also connected to South Africa Rand, a fully convertible currency with excellent connection with most currencies around the world. Our results also confirm that the Euro is the predominant currency in Europe, including countries not in the European Union such as Norway and Switzerland. Two of the three Nordic currencies under study, namely the Swedish Krone and Norwegian Krone, and the Swiss Franc form a network of connections among other and the Euro. The Euro-Swedish Krone pair has the highest MIRXY value, close to 1. All Nordic countries considered in this study and Switzerland, are nonetheless intrinsically linked to the European socio-economic and political situations. Another interesting finding is that, the Danish Krone, the only Nordic currency evaluated in this study, is not connected with the Euro, although Denmark is a member of the European Union. One reason that can explain this finding could be that Danish Krone is pegged to the Euro, so there is no currency risk that may be affected by economic, monetary or political developments in Europe. In effect, this meant that there are no bidirectional connections in the cases with pegged currency regimes. This can be appreciated in view of Brexit, where the Euro, Swedish Krone, Norwegian Krone and Swiss Franc are slumped against most other currencies, while the Danish Krone, which is pegged to the Euro, is strengthening post-Brexit [39]. Moreover, our results confirm past studies [8, 40] that most of the world’s major stock indices are integrated into international markets. Fig 6f shows that some of the largest stock-market indices (by market capitalisation) under study, i.e., Nikkei 225 (Japan), Euro Stoxx 50 (European Union) and SMI Index (Switzerland) are connected with most other stock indices. Euro Stoxx 50 and OMX Stockholm 30 Index (Sweden) pair of stock indices has the closest MIRXY value to 1 and hence, share the largest rate of information exchange. The Straits Time Index (Singapore) is also well connected with other stock indices internationally, because it is one of the world’s most diversified benchmark indices with a mix of stocks that are both domestic and globally focused. The results also show that the SET Index (Thailand) is only connected with one stock index. This is not surprising given that a study by [38] found no cointegration between stock prices indices of Thailand and its major trading partners. These networks of currency exchange-rates and stock-indices are relevant for risk managers to use as an investment strategy employed in portfolio management as they give an indication of the mix of assets to hold in order to form a well-diversified portfolio. Conclusions In this paper, we used the normalised Mutual Information Rate to infer the network structure in artificial and financial data ranging from 2000 to 2016. Particularly, we showed how the underlying network connectivity among the nodes of financial time-series data, such as foreign currency exchange-rates and stock-indices can be inferred. We first demonstrated the applicability of the method by applying it to artificial data from chaotic dynamics and to cases of correlated normal variates. Our results for the artificial data showed that the method can be used to successfully infer the underlying network structures with only using the data recorded from the coupled dynamics 19 assuming no previous knowledge of the adjacency matrices but only to estimate the percentage of successful network inference. We then applied the method to infer the underlying connectivity structure of currency exchange rates and stock market indices for the economies of 14 worldwide countries and the European Union and, performed an analysis for both networks to identify their structural properties. Our results showed that both are small-world networks with the stock-indices network being assortative by mixing degree and closer to a random network than the exchange-rates network, which was found to be dissasortative by mixing degree. This is a qualitative difference between the two networks as well-connected economies in terms of their exchange rates prefer to connect with economies less well-connected in terms of the exchange rates as opposed to the stock-indices behaviour where the preference is toward the well connected nodes! Interestingly, our study also revealed that both networks have a relatively small modularity, suggesting that both networks have sparse connections between the nodes within modules and denser connections between nodes in different modules. Our analysis showed that the normalised Mutual Information Rate is a mathematical method that can be used to infer the network structure in complex systems. Since variables in complex systems are not purely random, it is a method to estimate the amount of information exchanged among nodes in systems such as financial markets and identify their connectivity. In our study, the method allowed us to infer two networks and how the world-wide economies are connected to each other and the structural properties of the inferred networks. The currency exchange-rates and stock-indices networks are relevant for risk managers to use as an investment strategy employed in portfolio management as they give an indication of the mix of assets to hold in order to form a well-diversified portfolio. References 1. Chris G Antonopoulos, Ezequiel Bianco-Martinez, and Murilo S Baptista. Production and transfer of energy and information in hamiltonian systems. PloS one, 9(2):e89585, 2014. 2. Chris G Antonopoulos, Shambhavi Srivastava, Sandro E de S Pinto, and Murilo S Baptista. Do brain networks evolve by maximizing their information flow capacity? PLoS Comput Biol, 11(8):e1004372, 2015. 3. Murilo S Baptista, Josué X De Carvalho, and Mahir S Hussein. Finding quasi-optimal network topologies for information transmission in active networks. PloS one, 3(10):e3479, 2008. 4. Murilo S Baptista, Rero M Rubinger, Emilson R Viana, José C Sartorelli, Ulrich Parlitz, and Celso Grebogi. Mutual information rate and bounds for it. PLoS One, 7(10):e46745, 2012. 5. Murilo S. Baptista, Rero M. Rubinger, Emilson R. Viana, José C. Sartorelli, Ulrich Parlitz, and Celso Grebogi. Mutual information rate and bounds for it. PLOS ONE, 7(10):1–10, 10 2012. 6. D. S. Basett and E. Bullmore. Small-world brain networks. Neuroscientist, 12:512–523, 2006. 20 7. G. Benettin, L. Galgani, A. Giorgilli, and J-M. Strelcyn. Lyapunov characteristic exponents for smooth dynamical systems and for Hamiltonian systems: A method for computing all of them. Part 1: Theory and Lyapunov characteristic exponents for smooth dynamical systems and for Hamiltonian systems: A method for computing all of them. Part 2: Numerical application. Meccanica, 15:9–20, 21–30, 1980. 8. Malay Bhattacharyya and Ashok Banerjee. Integration of global capital markets: an empirical exploration. International journal of theoretical and applied finance, 7(04):385–405, 2004. 9. E Bianco-Martinez, N Rubido, Ch G Antonopoulos, and MS Baptista. Successful network inference from time-series data using mutual information rate. Chaos: An Interdisciplinary Journal of Nonlinear Science, 26(4):043102, 2016. 10. Giovanni Bonanno, Fabrizio Lillo, and Rosario N Mantegna. Levels of complexity in financial markets. Physica A: Statistical Mechanics and its Applications, 299(1):16–27, 2001. 11. Silvano Bordignon, Massimiliano Caporin, and Francesco Lisi. Periodic long-memory garch models. Econometric Reviews, 28(1-3):60–82, 2008. 12. Atul J Butte and Isaac S Kohane. Mutual information relevance networks: functional genomic clustering using pairwise entropy measurements. In Pac Symp Biocomput, volume 5, pages 418–429, 2000. 13. R. L. Dobrushin. General formulation of shannon?s main theorem of information theory. Usp. Mat. Nauk., transl: Amer. Math. Soc. Translations: series 2 33: 323?438, 14:3–104, 1959. 14. J-P Eckmann and David Ruelle. Ergodic theory of chaos and strange attractors. Reviews of modern physics, 57(3):617, 1985. 15. P. Fiedor. Mutual information rate-based networks in financial markets. Physical Review E, 89(5):052801, 2014. 16. Pawel Fiedor. Partial mutual information analysis of financial networks. arXiv preprint arXiv:1403.2050, 2014. 17. R. M. Gray and J. C. Kieffer. Asymptotically mean stationary measures. IEEE Translations on Information theory IT, 26:412–421, 1980. 18. Robert S Hudson and Andros Gregoriou. Calculating and comparing security returns is harder than you think: A comparison between logarithmic and simple returns. International Review of Financial Analysis, 38:151–162, 2015. 19. Leonidas Sandoval Junior, Asher Mullokandov, and Dror Y Kenett. Dependency relations among international stock market indices. Journal of Risk and Financial Management, 8(2):227–265, 2015. 20. Kunihiko Kaneko. Clustering, coding, switching, hierarchical ordering, and control in a network of chaotic elements. Physica D: Nonlinear Phenomena, 41(2):137–172, 1990. 21 21. Alexander Kraskov, Harald Stögbauer, and Peter Grassberger. Estimating mutual information. Physical review E, 69(6):066138, 2004. 22. Adam Kritzer. Forex: A comprehensive guide to profiting from the global currency markets. Apress, 2013. 23. S. Kullback. Information theory and statistics. Dover Publications, 2 edition, 1968. 24. Dibyendu Mandal, HT Quan, and Christopher Jarzynski. Maxwell’s refrigerator: An exactly solvable model. Physical review letters, 111(3):030602, 2013. 25. MA Marchiori, Ricardo Fariello, and MAM de Aguiar. Energy transfer dynamics and thermalization of two oscillators interacting via chaos. Physical Review E, 85(4):041119, 2012. 26. Rudy Moddemeijer. On estimation of entropy and mutual information of continuous distributions. Signal processing, 16(3):233–248, 1989. 27. Shapour Mohammadi and Ahmad Pouyanfar. Behaviour of stock markets’ memories. Applied Financial Economics, 21(3):183–194, 2011. 28. Young-Il Moon, Balaji Rajagopalan, and Upmanu Lall. Estimation of mutual information using kernel density estimators. Physical Review E, 52(3):2318, 1995. 29. M. E. Newman. Mixing patterns in networks. Phys. Rev. E, 67(2):026126, 2003. 30. Milan Paluš. Coarse-grained entropy rates for characterization of complex time series. Physica D: Nonlinear Phenomena, 93(1):64–77, 1996. 31. Paulo RF Pinto, MS Baptista, and Isabel S Labouriau. Density of first poincaré returns, periodic orbits, and kolmogorov–sinai entropy. Communications in Nonlinear Science and Numerical Simulation, 16(2):863–875, 2011. 32. Vasiliki Plerou, Parameswaran Gopikrishnan, Bernd Rosenow, Luis AN Amaral, and H Eugene Stanley. Econophysics: financial time series from a statistical physics point of view. Physica A: Statistical Mechanics and its Applications, 279(1):443–456, 2000. 33. Dean Rickles. Econophysics and the complexity of financial markets. Handbook of the Philosophy of Science, 10:133–152, 2008. 34. Nicolás Rubido, Arturo C Martı́, Ezequiel Bianco-Martı́nez, Celso Grebogi, Murilo S Baptista, and Cristina Masoller. Exact detection of direct links in networks of interacting dynamical units. New Journal of Physics, 16(9):093010, 2014. 35. Thomas Schreiber. Measuring information transfer. Physical review letters, 85(2):461, 2000. 36. C.E. Shannon. A mathematical theory of communication. Bell System Technical Journal, 27(3):379–423, 1948. 37. Ralf Steuer, Jürgen Kurths, Carsten O Daub, Janko Weise, and Joachim Selbig. The mutual information: detecting and evaluating dependencies between variables. Bioinformatics, 18(suppl 2):S231–S240, 2002. 22 38. Abbas Valadkhani and Surachai Chancharat. Dynamic linkages between thai and international stock markets. Journal of Economic Studies, 35(5):425–441, 2008. 39. Christian Wienberg and Peter Levring. Currencies in aaa scandinavia torn apart as brexit now a reality. Bloomberg, Jun 2016. 40. Chunchi Wu and Youg-Chern Su. Dynamic relations among international stock markets. International Review of Economics & Finance, 7(1):63–84, 1998. 41. Tao You, Pawel Fiedor, and Artur Holda. Network analysis of the shanghai stock exchange based on partial mutual information. Journal of Risk and Financial Management, 8(2):266– 284, 2015. 23
7cs.IT
G RAYING THE BLACK BOX : U NDERSTANDING DQN S Graying the black box: Understanding DQNs Tom Zahavy* TOMZAHAVY @ CAMPUS . TECHNION . AC . IL Nir Baram* NIRB @ TX . TECHNION . AC . IL arXiv:1602.02658v4 [cs.LG] 24 Apr 2017 Shie Mannor SHIE @ EE . TECHNION . AC . IL D EPARTMENT OF E LECTRICAL E NGINEERING T HE T ECHNION , I SRAEL I NSTITUTE OF T ECHNOLOGY H AIFA , 32000, I SRAEL *T HESE AUTHORS HAVE CONTRIBUTED EQUALLY. Editor: Abstract In recent years there is a growing interest in using deep representations for reinforcement learning. In this paper, we present a methodology and tools to analyze Deep Q-networks (DQNs) in a non-blind matter. Moreover, we propose a new model, the Semi Aggregated Markov Decision Process (SAMDP), and an algorithm that learns it automatically. The SAMDP model allows us to identify spatio-temporal abstractions directly from features and may be used as a sub-goal detector in future work. Using our tools we reveal that the features learned by DQNs aggregate the state space in a hierarchical fashion, explaining its success. Moreover, we are able to understand and describe the policies learned by DQNs for three different Atari2600 games and suggest ways to interpret, debug and optimize deep neural networks in reinforcement learning. 1. Introduction In the Reinforcement Learning (RL) paradigm, an agent autonomously learns from experience in order to maximize some reward signal. Learning to control agents directly from high-dimensional inputs like vision and speech is a long-standing problem in RL, known as the curse of dimensionality. Countless solutions to this problem have been offered including linear function approximators (Tsitsiklis and Van Roy, 1997), hierarchical representations (Dayan and Hinton, 1993), state aggregation (Singh et al., 1995) and options (Sutton et al., 1999). These methods rely upon engineering problem-specific state representations, hence, reducing the agent’s flexibility and making the learning more tedious. Therefore, there is a growing interest in using nonlinear function approximators, that are more general and require less domain specific knowledge, e.g., TD-gammon (Tesauro, 1995). Unfortunately, such methods are known to be unstable or even to diverge when used to represent the action-value function (Tsitsiklis and Van Roy, 1997; Gordon, 1995; Riedmiller, 2005). . This paper was done with the support of the Intel Collaborative Research institute for Computational Intelligence (ICRI-CI) and is part of the ’Why & When Deep Learning works looking inside Deep Learning’ ICRI-CI paper bundle. Some of the results in this paper were originally published in (Zahavy et al., 2016; Ben Zrihem et al., 2016; Baram et al., 2016) 1 Z AHAVY, BARAM AND M ANNOR The Deep Q-Network (DQN) algorithm (Mnih et al., 2015) increased training stability by introducing the target network and by using Experience Replay (ER) (Lin, 1993). Its success was demonstrated in the Arcade Learning Environment (ALE) (Bellemare et al., 2012), a challenging framework composed of dozens of Atari games used to evaluate general competency in AI. DQN achieved dramatically better results than earlier approaches, showing a robust ability to learn representations. While using Deep Learning (DL) in RL seems promising, there is no free lunch. Training a Deep Neural Network (DNNs) is a complex two-levels optimization process. At the inner level, we fix a hypothesis class and learn it using some gradient descent method. The optimization of the outer level addresses the choice of network architecture, setting hyper-parameters, and even the choice of the optimization algorithm. While the optimization of the inner level is analytic to a high degree, the optimization of the outer level is far from being so. Currently, most practitioners tackle this problem by either a trial and error methodology, or by exhaustively searching over the space of possible configurations. Moreover, in Deep Reinforcement Learning (DRL) we also need to choose how to model the environment as a Markov Decision Process (MDP), i.e., to choose the discount factor, the amount of history frames that represent a state, and to choose between the various algorithms and architectures (Nair et al., 2015; Van Hasselt et al., 2015; Schaul et al., 2015; Wang et al., 2015; Bellemare et al., 2015). A key issue in RL is that of representation, i.e., allowing the agent to locally generalize the policy across similar states. Unfortunately, spatially similar states often induce different control rules (”labels”) in contrast to other machine learning problems that enjoy local generalization. In fact, in many cases the optimal policy is not a smooth function of the state, thus using a linear approximation is far from being optimal. For example, in the Atari2600 game Seaquest, whether or not a diver has been collected (represented by a few pixels) controls the outcome of the submarine surface action (with: fill air, without: loose a life) and therefore the optimal policy. Another cause for control discontinuities is that for a given problem, two states with similar representations may, in fact, be far from each other in terms of the number of state transitions required to reach one from the other. This observation can also explain the lack of pooling layers in DRL architectures (Mnih et al., 2015, 2013; Levine et al., 2015). Different methods that focus on the temporal structure of the policy, has also been proposed. Such methods decompose the learning task into simpler subtasks using graph partitioning (Menache et al., 2002; Mannor et al., 2004; Şimşek et al., 2005) and path processing mechanisms (Stolle, 2004; Thrun, 1998). Given a good temporal representation of the states, varying levels of convergence guarantees can be promised (Dean and Lin, 1995; Parr, 1998; Hauskrecht et al., 1998; Dietterich, 2000). Our main observation in this work is that DQN is learning an internal model (Francis and Wonham, 1975; Sontag, 2003) of the domain without explicitly being trained to. We discover the internal model by identifying spatio-temporal abstractions directly from the learned representation in two different ways: (1) manually clustering the state space using hand crafted features, and (2), the Semi Aggregated Markov Decision Process (SAMDP), an approximation of the true MDP that is learned automatically from data. We show that by doing so we can offer an interpretation of learned policies 2 G RAYING THE BLACK BOX : U NDERSTANDING DQN S and discover the policy hierarchy. In particular, our main contributions are: • Understanding: We show that DQNs are learning temporal abstractions of the state space such as hierarchical state aggregation and options. Temporal abstractions were known to the RL community before as mostly manual tools to tackle the curse of dimensionality; however, we observe that a DQN is finding abstractions automatically. Thus, we believe that our analysis explains the success of DRL from a reinforcement learning research perspective. • Interpretability: We give an interpretation of the agent’s policy in a clear way, thus allowing to understand what are its weaknesses and strengths. • Debugging: We propose debugging methods that help to reduce the hyper parameters grid search of DRL. Examples are given on game modeling, termination and initial states and score over-fitting. 2. Background and Related Work 2.1 RL The goal of RL agents is to maximize its expected total reward by learning an optimal policy (mapping states to actions). At time t the agent observes a state st , selects an action at , and receives a reward rt , following the agents decision it observes the next state st+1 . We consider infinite horizon problems where the P cumulative return is discounted by a factor of γ ∈ [0, 1] and the return at 0 time t is given by Rt = Tt0 =t γ t −t rt , where T is the termination step. The action-value function Qπ (s, a) measures the expected return when choosing action at at state st , and following policy π: Q(s, a) = E[Rt |st = s, at = a, π] afterwards. The optimal action-value obeys a fundamental recursion known as the Bellman equation,   ∗ ∗ 0 Q (st , at ) = E rt + γmax Q (st+1 , a ) 0 a 2.2 Deep Q Networks (Mnih et al., 2015, 2013) approximate the optimal Q function using a Convolutional Neural Network (CNN). The training objective is to minimize the expected TD error of the optimal Bellman equation: Est ,at ,rt ,st+1 kQθ (st , at ) − yt k22  rt   st+1 is terminal 0 yt = otherwise rt + γmaxQθtarget st+1 , a a’ Notice that this is an off-line algorithm, meaning that the tuples {st, at , rt , st+1 , γ} are collected from the agents experience, stored in the ER and later used for training. The reward rt is clipped to the range of [−1, 1] to guarantee stability when training DQNs over multiple domains with different reward scales. The DQN algorithm maintains two separate Q-networks: one with parameters θ, and a second with parameters θtarget that are updated from θ every fixed number of iterations. In order to capture the game dynamics, the DQN algorithm represents a state by a sequence of history 3 Z AHAVY, BARAM AND M ANNOR frames and pads initial states with zero frames. 2.3 Visualization The goal behind visualization of DNNs is to give a better understanding of these inscrutable black boxes. While some approaches study the type of computation performed at each layer as a group (Yosinski et al., 2014), others try to explain the function computed by each individual neuron (similar to the ”Jennifer Aniston Neuron” (Quiroga et al., 2005)). Dataset-centric approaches display images from the data set that cause high activations of individual units. For example, the deconvolution method (Zeiler and Fergus, 2014) highlights the areas of a particular image that are responsible for the firing of each neural unit. Network-centric approaches investigate a network directly without any data from a dataset, e.g., (Erhan et al., 2009) synthesized images that cause high activations for particular units. Other works used the input gradient to find images that cause strong activations (e.g., (Simonyan and Zisserman, 2014); (Nguyen et al., 2014); (Szegedy et al., 2013)). Since RL research had been mostly focused on linear function approximations and policy gradient methods, we are less familiar with visualization techniques and attempts to understand the structure learned by an agent. (Wang et al., 2015), suggested to use saliency maps and analyzed which pixels affect network predictions the most. Using this method they compared between the standard DQN and their dueling network architecture. (Engel and Mannor, 2001) learned an embedded map of Markov processes and visualized it on two dimensions. Their analysis is based on the state transition distribution while we will focus on distances between the features learned by DQN. t-SNE is a non-linear dimensionality reduction method used mostly for visualizing high dimensional data. The technique is easy to optimize, and it has been proven to outperform linear dimensionality reduction methods and non-linear embedding methods such as ISOMAP (Tenenbaum et al., 2000) in several research fields including machine learning benchmarks and hyper-spectral remote sensing data (Lunga et al., 2014). t-SNE reduces the tendency to crowd points together in the center of the map by employing a heavy-tailed Student-t distribution in the low dimensional space. It is known to be particularly good at creating a single map that reveals structure at many different scales, which is particularly important for high-dimensional data that lies on several lowdimensional manifolds. This enables us to visualize the different sub-manifolds learned by the network and interpret their meaning. 2.4 Abstractions An abstraction is an important tool that enables an agent to focus less on the lower level details of a task and more on solving the task at hand. Many real-world domains can be modeled using some form of abstraction. The Semi MDP (SMDP) and the Aggregated MDP (AMDP) models are two important examples that extend the standard MDP formulation by using temporal and spatial abstractions respectively. 4 G RAYING THE BLACK BOX : U NDERSTANDING DQN S SMDP. (Sutton et al., 1999), extends the MDP action space A and allows the agent to plan with skills Σ (also known as options, macro-actions and temporally-extended actions) . A skill is defined by a triplet: σ =< I, π, β >, where I defines the set of states where the skill can be initiated, π is the intra-skill policy, and β is the set of termination probabilities determining when a skill will stop executing. β is typically either a function of state s or time t. Planning with skills can be performed by learning for each state the value of choosing each skill. More formally, an SMDP can be defined by a five-tuple < S, Σ, P, R, γ >, where S is the set of states, Σ is the set of skills, P is the SMDP transition matrix, γ is the discount factor and the SMDP reward is defined by: Rsσ = E[rsσ ] = E[rt+1 + γrt+2 + · · · + γ k−1 rt+k |st = s, σ] (1) Analyzing policies using the SMDP model shortens the planning horizon and simplifies the analysis. However, there are two drawbacks with this approach. First, one must consider the high complexity of the state space, and second, the SMDP model requires to identify a set of skills, a challenging problem with no easy solution (Mankowitz et al., 2016). AMDP. Another approach is to analyze a policy using spatial abstractions in the state space. If there is a reason to believe that groups of states share common attributes such as similar policy or value function, it is possible to use State Aggregation (Moore, 1991). State Aggregation is a wellstudied problem that typically involves identifying clusters as the new states of an AMDP, where the set of clusters C replaces the MDP states S. Doing RL on aggregated states is potentially advantageous because the transition probability matrix P , the reward signal R and the policy π dimensions are decreased, e.g., (Singh et al., 1995). The AMDP modeling approach has two drawbacks. First, the action space A is not modified and therefore the planning horizon is still intractable. Second, AMDPs are not necessarily Markovian (Bai et al.). 3. Methods 3.1 Manual clustering Figure 1 presents our Visualization tool. Each state is represented as a point in the t-SNE map (Left). The color of the points is set manually using global features (Top right) or game specific hand crafted features (Middle right). Clicking on each data point displays the corresponding game image and saliency map (Bottom right). It is possible to move between states along the trajectory using the F/W and B/W buttons. Feature extraction: During the DQN run, we collect statistics for each state such as Q values estimates, generation time, the termination signal, reward and played action. We also extract handcrafted features, directly from the emulator raw frames, such as player position, enemy position, the number of lives, and so on. We use these features to color and filter points on the t-SNE map. The filtered images reveal insightful patterns that cannot be seen otherwise. From our experience, hand-crafted features are very powerful, however, the drawback of using them is that they require manual work. In all the figures below we use a heat color map (red corresponds to high values and blue to low ones). 5 Z AHAVY, BARAM AND M ANNOR Figure 1: Graphical user interface for our methodology. Similar to (Engel and Mannor, 2001) we visualize the dynamics (state transitions) of the learned policy. To do so we use a 3D t-SNE state representation wich we found insightfull. The transitions are displayed with arrows using Mayavi (Ramachandran and Varoquaux, 2011). t-SNE: We apply the t-SNE algorithm directly on the collected neural activations, similar to (Mnih et al., 2015). The input X ∈ R120k×512 consists of 120k game states with 512 features each (size of the last layer). Since these data are relatively large, we pre-processed it using Principal Component Analysis to dimensionality of 50 and used the Barnes-Hut t-SNE approximation (Van Der Maaten, 2014). Saliency maps: We generate Saliency maps (similar to (Simonyan and Zisserman, 2014)) by computing the Jacobian of the network with respect to the input and presenting it above the input image itself (Figure 1, bottom right). These maps helps to understand which pixels in the image affect the value prediction of the network the most. Analysis: Using these features we are able to understand the common attributes of a given cluster (e.g, Figure 19 in the appendix). Moreover, by analyzing the dynamics between clusters we can identify a hierarchical aggregation of the state space. We define clusters with a clear entrance and termination areas as options and interpret the agent policy there. For some options we are able to derive rules for initiation and termination (i.e., landmark options, (Sutton et al., 1999; Mann et al., 2015)). To summarize, the manual clustering methodology comprises the following steps: 1. Train a DQN. 6 G RAYING THE BLACK BOX : U NDERSTANDING DQN S Low Temporal Hierarchy 𝐶3 𝐶2 𝐶1 Cluster Action State Skill 𝑆, 𝐴, 𝑃𝑆𝐴 , 𝑅𝑆𝐴 , 𝛾 State Aggregation 𝜎1,3 𝜎1,2 MDP Low Spatial Hierarchy High Spatial Hierarchy AMDP 𝐶, 𝐴, 𝑃𝐶𝐴 , 𝑅𝐶𝐴 , 𝛾 High Temporal Hierarchy Skill Identification 𝝋(𝑺) SMDP 𝑆, Σ, 𝑃𝑆Σ , 𝑅𝑆Σ , 𝛾 State Aggregation SAMDP 𝐶, Σ, 𝑃𝐶Σ , 𝑅𝐶Σ , 𝛾 Figure 2: Left: Illustration of state aggregation and skills. Primitive actions (orange arrows) cause transitions between MDP states (black dots) while skills (red arrows) induce transitions between SAMDP states (blue circles). Right: Modeling approaches for analyzing policies. 2. Evaluate the DQN. For each visited state record: (a) activations of the last hidden layer, (b) the gradient information and (c) the game state (raw pixel frame). 3. Apply t-SNE on the activations data. 4. Visualize the data. 5. Analyze the policy manually. 3.2 The Semi Aggregated MDP In this paper, we propose a model that combines the advantages of the SMDP and AMDP approaches and denote it by SAMDP. Under SAMDP modeling, aggregation defines both the states and the set of skills, allowing analysis with spatio-temporal abstractions (the state-space dimensions and the planning horizon are reduced). However, SAMDPs are still not necessarily Markovian. We summarize the different modeling approaches in Figure 2. The rest of this section is devoted to explaining the five stages of building an SAMDP model: (0) Feature selection, (1) State Aggregation, (2) Skill identification, (3) Inference, and (4) Model Selection. (0) Feature selection. We define the mapping from MDP states to features, by a mapping function φ : s → s0 ⊂ Rm . The features may be raw (e.g., spatial coordinates, frame pixels) or higher level abstractions (e.g., the last hidden layer of a NN). The feature representation has a significant effect on the quality of the resulting SAMDP model and visa versa, good model can point out a good feature representation. (1) Aggregation via Spatio-temporal clustering. The goal of Aggregation is to find a mapping (clustering) from the MDP feature space S 0 ⊂ Rm to the AMDP state space C. Typically, clustering algorithms assume that the data is drawn from an i.i.d distribution. However, in our problem the data is generated from an MDP and therefore violates this assumption. We alleviate this problem 7 Z AHAVY, BARAM AND M ANNOR using two different approaches. First, we decouple the clustering step with the SAMDP model. This is done by creating an ensemble of clustering candidates and building an SAMDP model for each (following stages 2 and 3). In stage 4, we will explain how to run a non-analytic outer optimization loop to choose between these candidates based on spatio-temporal evaluation criteria. Second, we introduce a novel extension of the celebrated K-means algorithm (MacQueen et al., 1967), that enforces temporal coherency along trajectories. In the vanilla K-means algorithm, a cluster ci with mean µi is assigned to a point xt such that the cluster with the closest mean to the point xt is chosen (please refer to the supplementary material for more details). We modified this step as follows:  2 2 c(xt ) = ci : Xt − µi F ≤ Xt − µj F , ∀j ∈ [1, K] . Here, F stands for the Frobenius norm, K is the number of clusters, t is the time index of xt , and Xt  is a set of 2w + 1 centered at xt from the same trajectory: xj ∈ Xt ⇐⇒ j ∈ [t − w, t + w] . The dimensions of µ correspond to a single point, but it is expanded to the dimensions of Xt . In this way, a point xt is assigned to a cluster ci , if its neighbors along the trajectory are also close to µi . Thus, enforcing temporal coherency. We have also experienced with other clustering methods such as spectral clustering, hierarchical agglomerative clustering and entropy minimization (please refer to the supplementary material for more details). (2) Skill identification. We define an SAMDP skill σi,j ∈ Σ uniquely by a single initiation state ci ∈ C and a single termination state cj ∈ C : σij =< ci , πi,j , cj > . More formally, at time t the agent enters an AMDP state ci at an MDP state st ∈ ci . It chooses a skill according to its SAMDP policy and follows the skill policy πi,j for k time steps until it reaches a state st+k ∈ cj , s.t i 6= j. We do not define the skill length k a-priori nor the skill policy but infer the skill length from the data. As for the skill policies, our model does not define them explicitly but we will observe later that our model successfully identifies skills that are localized in time and space. (3) Inference. Given the SAMDP states and skills, we infer the skill length, the SAMDP reward and the SAMDP probability transition matrix from observations. The skill length, is inferred for a skill σi,j by averaging the number of MDP states visited since entering SAMDP state ci and until leaving for SAMDP state cj . The skill reward is inferred similarly using Equation 1. The inference of the SAMDP transition matrices is a bit more puzzling, since the probability of seeing the next SAMDP state depends both on the MDP dynamics and the agent policy in the MDP state space. We now turn to discuss how to infer these matrices by observing transitions in the MDP state space. Our goal is to infer two quantities: (a) The SAMDP transition probability matriσ∈Σ ces PΣ : Pi,j = P r(cj |ci , σ), measures the probability of moving from state ci to cj given that skill σ is chosen. These matrices are defined uniquely by our definition of skills as deterministic probability matrices. (b) The probability of moving from state ci to cj given that skill σ is chosen π = P r(c |c , σ = π(c )). This quantity involves both according to the agent SAMDP policy: Pi,j j i i the SAMDP transition probability matrices and the agent policy. However, since SAMDP transition probability matrices are deterministic, this is equivalent to the agent policy in the SAMDP state space. Therefore by inferring transitions between SAMDP states we directly infer the agent’s SAMDP policy. Given an MDP with a deterministic environment and an agent with a nearly deterministic MDP policy (e.g., a deterministic policy that uses an -greedy exploration (  1)), it is intuitive to assume 8 G RAYING THE BLACK BOX : U NDERSTANDING DQN S that we would observe a nearly deterministic SAMDP policy. However, there are two sources that increase the stochasticity of the SAMDP policy: (1) Stochasticity is accumulated along skill trajectories. (2) The aggregation process is only an approximation. A given SAMDP state may contain more than one ”real” state and therefore more than one skill. Performing inference, in this case, we will simply observe a stochastic policy that chooses between those skills at random. Thus, it is very likely to infer a stochastic SAMDP transition matrix, although the SAMDP transition probability matrices are deterministic and even if the MDP environment is deterministic and the MDP policy is near deterministic. (4) Model selection. So far we explained how to build an SAMDP from observations. In this stage we explain how to choose between different SAMDP model candidates. There are two advantages for choosing between multiple SAMDPs. First, there are different hyper parameter to tune. Two examples are the number of SAMDP states (K) and the window size (w) for the clustering algorithm. Second, there is randomness in the aggregation step. Hence, clustering multiple times and picking the best result will potentially yield better models. We therefore developed evaluation criteria that allow us to select the best model, motivated by Hallak et al. (2013). We follow the Occams Razor principle, and aim to find the simplest model which best explains the data. (i) Value Mean Square Error(VMSE), measures the consistency of the model with the observations. The estimator is given by V M SE = kv − vSAM DP k kvk (2) where v stands for the SAMDP value function of the given policy, and vSAM DP is given by: vSAM DP = (I + γ k P )−1 r, where P is measured under SAMDP policy. (ii) Inertia, the KPthe n means algorithm objective function, is given by : I = i=0 minµj ∈C (||xj − µi ||2 ). Inertia measures the variance inside clusters and encourages spatial coherency. Motivated by Ncut and spectral clustering (Von Luxburg, 2007), we define (iii) The Intensity Factor as the fraction of out/in cluster transitions. However, we define edges between states that are connected along the trajectory (a transition between them was observed) and give them equal weights (instead of defining the edges by euclidean distances as in spectral clustering). Minimizing the intensity factor encourages longer duration Pskills. (iv) P Entropy, is defined on the SAMDP probability transition matrix as follows: e = − i {|Ci | · j Pi,j log Pi,j }. Low entropy encourages clusters to have less skills, i.e., clusters that are localized both in time and space. 4. Experiments In this section, we demonstrate our method on a Gridword domain as well as on three ATARI games: Pacman (a game where DQN performs very well), Seaquest (from the opposite reason) and Breakout (a popular game). For each domain we: (1) provide a short description of the domain and the optimal policy, (2) detail the hand-crafted features we designed for the domain, (3) analyze the DQN’s policy using the manual approach and the SAMDP model and derive conclusions. We then analyze two cross-domain observations: the representation of initial and terminal states and the influence of score pixels in Atari. We finish with additional experiments on the SAMDP model. We show that it is consistent and suggest a novel shared autonomy application. 9 Z AHAVY, BARAM AND M ANNOR (a) MDP (b) SMDP (c) AMDP (d) SAMDP Figure 3: State-action diagrams for a gridworld problem. a. MDP diagram: relate to individual states and primitive actions. b. SMDP diagram: Edge colors represent different skills. c. AMDP diagram: clusters are formed using spatial aggregation in the original state. d. SAMDP diagram: clusters are found after transforming the state space. intra-cluster transitions (dashed arrows) can be used to explain the skills, while inter-cluster transitions (big red arrows) loyaly explain the governing policy. 4.1 Gridworld Description. An agent is placed at the origin (marked in X), where the goal is to reach the green ball and return. Hand-crafted features. The state s ∈ R3 is given by: s = {x, y, b}, where (x, y) are the coordinates and b ∈ {0, 1} indicates whether the agent has reached the ball or not. The policy is trained to find skills following Mankowitz et al. (2014). Analysis. We visualize the learned policy using the maze coordinates with the different modeling approaches. The MDP graph (Figure 3a), consists of a large number of states. It is also difficult to understand which skills the agent is using. In the SMDP graph (Figure 3b), the number of states remain high, however coloring the edges by the skills, helps to understand the agent’s behaviour. Unfortunately, producing this graph is seldom possible because we rarely receive information about the skills. On the other hand, abstracting the state space can be done more easily using state aggregation. However, in the AMDP graph (Figure 3c), the clusters are not aligned with the played skills because the routes leading to and from the ball overlap. SAMDP. We use the following state representation: ( (x, y), if b is 0 φ(x, y) = (2L − x, y), if b is 1 where L is the maze width. The transformation φ flips and translates the states where b = 1. Now that the routes to and from the ball are disentangled, the clusters are aligned with the skills. Understanding the behaviour of the agent is now possible by examining inter-cluster and intra10 G RAYING THE BLACK BOX : U NDERSTANDING DQN S cluster transitions (Figure 3d). The key observation from the gridworld domain is that under the correct representation, the hirerchy of the MDP is discovered by the SAMDP model. In the next experiments we will show that DQN is capable to learn such a representation automatically. 4.2 Setup for Atari Data collection. We record the neural activations of the last hidden layer and the DQN value estimations for 120k game states (indexed by visitation order). t-SNE is applied on the neural activations data, a non-linear dimensionality reduction method that is particularly good at creating a single map that reveals structure at many different scales. The result is a compact, well-separated representation, that is easy and fast to cluster. SAMDP algorithm details. Feature selection. We use the t-SNE coordinates and a value coordinate (three coordinates in total). Each coordinate is normalized to have zero mean and unit variance. We also experimented with other configurations such as using the activations without t-SNE and different normalization. However, we found that this configuration is fast and gives nice results. SAMDP clustering and skill identification follow Section 3.2 with no additional details. SAMDP inference. We use two approximations in the inference stage which we found to work well: we overlook transitions with small skill length (shorter than 2) and we truncate transitions that have less than 0.1 probability. SAMDP model Selection. We perform a grid search on two parameters: i) number of clusters K ∈ [15, 25]. ii) window size w ∈ [1, 7]. We found that models larger (smaller) than that are too cumbersome (simple) to analyze. We select the best model in the following way: we first sort all models by the four evaluation criteria (SAMDP Section, stage 4) from best to worst. Then, we iteratively intersect the p-prefix of all sets (i.e., the first p elements of each set) starting with 1-prefix. We stop when the intersection is non-empty and choose the configuration at the intersection. We also measure the p-value of the chosen model. For the null hypothesis, we choose the SAMDP model constructed with random clusters. We tested 10000 random SAMDP models, none of which scored better than the chosen model (for all the evaluation criteria). 11 Z AHAVY, BARAM AND M ANNOR 7 6 9 5 2 3 5 8 1 4 9 Figure 4: Breakout aggregated states on the t-SNE map. 4.3 Breakout Description. In Breakout, a layer of bricks lines the top of the screen. A ball travels across the screen, bouncing off the top and side walls. When a brick is hit, the ball bounces away, the brick is destroyed and the player receives a reward. The player loses a turn when the ball touches the bottom of the screen. To prevent this from happening, the player has a movable paddle to bounce the ball upward, keeping it in play. The highest score achievable for one player is 896; this is done by eliminating exactly two screens of bricks worth 448 points each. A good strategy for Breakout is leading the ball above the bricks by digging a tunnel on one side of the bricks block. Doing so enables the agent to achieve high reward while being safe from losing the ball. By introducing a discount factor to Breakout’s MDP, this strategy becomes even more favorable since it achieves high immediate reward. Hand-crafted features. We extract features for the player (paddle) position, ball’s position, balls direction of movement, number of missing bricks, and a tunnel feature (a tunnel exists when there is a clear path between the area below the bricks and the area above it, and we approximate this event by looking for at least one clear column of bricks). Analysis. Figure 4 presents the t-SNE of Breakout. The agent learns a hierarchical policy: (a) carve a tunnel in the left side of the screen and (b) keep the ball above the bricks as long as possible. In clusters (1-3) the agent is carving the left tunnel. Once the agent enters those clusters, it will not exit until the tunnel is carved (see Figure 18). We identify these clusters as a landmark option. The clusters are separated from each other by the ball position and direction. In cluster 1 the ball is 12 G RAYING THE BLACK BOX : U NDERSTANDING DQN S Figure 5: Breakout tunnel digging option. Left: states that the agent visits once it entered the option clusters (1-3 in Figure 4) until it finishes to carve the left tunnel are marked in red. Right: Dynamics is displayed by arrows above a 3d t-SNE map. The option termination zone is marked by a black annotation box and corresponds to carving the left tunnel. All transitions from clusters 1-3 into clusters 4-7 pass through a singular point. heading toward the tunnel, in cluster 2 the ball is on the right side and in cluster 3 the ball bounces back from the tunnel after hitting bricks. As fewer bricks remain in the tunnel the value is gradually rising till the tunnel is carved where the value is maximal (this makes sense since the agent is enjoying high reward rate straight after reaching it). Once the tunnel is carved, the option is terminated and the agent moves to clusters 4-7 (dashed red line), differentiated by the ball position with regard to the bricks (see Figure 4). In cluster 4 and 6 the ball is above the bricks and in 5 it is below them. Clusters 8 and 9 represent termination and initial states respectively (see Figure 18 in the appendix for examples of states along the option path). Cluster 7 is created due to a bug in the emulator that allows the ball to pass the tunnel without completely carving it. The agent learned to represent this incident to its own cluster and assigned it high-value estimates (same as the other tunnel clusters). This observation is interesting since it indicates that the agent is learning a representation based on the game dynamics and not only on the pixels. By coloring the t-SNE map by time, we can identify some policy downsides. States with only a few remaining bricks are visited for multiple times along the trajectory (see Figure 17 in the appendix). In these states, the ball bounces without hitting any bricks which causes a fixed reflection pattern, indicating that the agent is stuck in local optima. We discuss the inability of the agent to perform well on the second screen of the game in Section 4.7. SAMDP. Figure 6 presents the resulted SAMDP for the game Breakout. First, we can observe that the algorithm managed to identify most of the policy hierarchy automatically and that the clusters are consistent with our manual clusters. We can also observe that the transitions between the clusters are sparse, which implies low entropy SAMDP. Finally, inspecting the mean image of each cluster reveals insights about the nature of the skills hiding within and uncovers the policy hierarchy. 13 Z AHAVY, BARAM AND M ANNOR Figure 6: SAMDP visualization for Breakout. Each MDP state is represented on the map by its two t-SNE coordinates and colored by its value estimate (low values in blue and high in red). SAMDP states are visualize by their mean state (with frame pixels) at the mean t-SNE coordinate. An Edge between two SAMDP states represent a skill (bold side indicate terminal state), and the numbers above the edges correspond to the inferred SAMDP policy. 14 G RAYING THE BLACK BOX : U NDERSTANDING DQN S 9 2 1 1 8 5 4 6 3 1 10 7 2 11 1 Figure 7: Seaquest aggregated states on the t-SNE map, colored by value function estimate. 4.4 Seaquest Description. In Seaquest, the player’s goal is to retrieve as many treasure-divers, while dodging and blasting enemy subs and killer sharks before the oxygen runs out. When the game begins, each enemy is worth 20 points and a rescued diver worth 50. Every time the agent surface with six divers, killing an enemy (rescuing a diver) is increased by 10 (50) points up to a maximum of 90 (1000). Moreover, the agent is awarded an extra bonus based on its remaining oxygen level. However, if it surfaces with less than six divers the oxygen fills up with no bonus, and if it surfaces with none it loses a life. DQN’s performance on Seaquest (∼5k) is inferior to human experts (∼100k). What makes Seaquest hard for DQN is that shooting enemies is rewarded immediately while rescuing divers is rewarded only once six divers are collected and rescued to sea level. Moreover, the bonus points for collecting 6 divers is diminished by reward clipping. This sparse and delayed reward signal requires much longer planning that is harder to learn. Hand-crafted features. We extract features for player position, direction of movement (ascent/descent), oxygen level, number of enemies, number of available divers to collect, number of available divers to use, and number of lives. Analysis. Figure 7 shows the t-SNE map divided into different clusters. We notice two main partitions of the t-SNE clusters: (a) by oxygen level (low: clusters 4-10, high: cluster 3 and other unmarked areas), and (b) by the amount of collected divers (clusters 2 and 11 represent having a diver). We also identified other partitions between clusters such as refuelling clusters (1: pre-episode 15 Z AHAVY, BARAM AND M ANNOR 2b 3b 3 3b 1b 1 1b 3 2 3b Figure 8: Seaquest refuel option. Left: Option path above the t-SNE map colored by the amount of remaining oxygen. Shaded blue mark the clusters with a collected diver, and red arrows mark the direction of progress. Right: 3d t-SNE with colored arrows representing transitions. All transitions from cluster 3 are leading to cluster 3b in order to reach the refuel cluster (1b), thus indicating a clear option termination structure. Figure 9: Salincy maps of states with available diver. Left: A diver is noticed in the saliency map but misunderstood as an enemy and being shot at. Center: Both diver and enemy are noticed by the network. Right: The diver is unnoticed by the network. and 2: in-episode), various termination clusters (8: agent appears in black and white, 9: agent’s figure is replaced with drops, 10: agent’s figure disappears) and low oxygen clusters characterized by flickering in the oxygen bar (4 and 7). While the agent distinguishes states with a collected diver, Figure 9 implies that the agent did not understand the concept of collecting a diver and sometimes treats it as an enemy. Moreover, we see that the clusters share a similar value estimate that is highly correlated with the amount of re16 G RAYING THE BLACK BOX : U NDERSTANDING DQN S maining oxygen and the number of present enemies. However, states with an available or collected diver do not raise the value estimates nor do states that are close to refueling. Moreover, the agent never explores the bottom of the screen, nor collects more than two divers. As a result, the agent’s policy is to kill as many enemies as possible while avoiding being shot. If it hasn’t collected a diver, the agent follows a sub-optimal policy and ascends near to sea level as the oxygen decreases. There, it continues to shoot at enemies but not collecting divers. However, it also learned not to surface entirely without a diver. If the agent collects a diver it moves to the blue shaded clusters (all clusters in this paragraph refer to Figure 8), where we identify a refuel option. We noticed that the option can be initiated from two different zones based on the oxygen level but has a singular termination cluster (3b). If the diver is taken while having a high level of oxygen, then it enters the option at the northern (red) part of cluster 1. Otherwise, it will enter a point further along the direction of the option (red arrows). In cluster 1, the agent keeps following the normal shooting policy. Eventually, the agent reaches a critical level of oxygen (cluster 3) and ascends to sea level. From there the agent jumps to the fueling cluster (area 1b). The fueling cluster is identified by its rainbow appearance because the level of oxygen is increasing rapidly. However, the refuel option was not learned perfectly. Area 2 is another refuel cluster, there, the agent does not exploit its oxygen before ascending to get air (area 2b). 17 Z AHAVY, BARAM AND M ANNOR 6 5 10 10 1 4 7 10 9 3 8 2 7 Figure 10: Pacman aggregated states on the t-SNE map colored by value function estimates. 4.5 Pacman Description. In Pacman, an agent navigates in a maze while being chased by two ghosts. The agent is positively rewarded (+1) for collecting bricks. An episode ends when a predator catches the agent, or when the agent collects all bricks. There are also 4 bonus bricks, one at each corner of the maze. The bonus bricks provide a larger reward (+5), and more importantly, they make the ghosts vulnerable for a short period of time, during which they cannot kill the agent. Occasionally, a bonus box appears for a short time providing high reward (+100) if collected. Hand-crafted features. We extract features for the player position, direction of movement, number of left bricks to eat, minimal distance (L1) between the player and the predators, number of lives, ghost mode that indicates that the predators are vulnerable, and bonus box feature that indicate when the highly valued box appears. Analysis. Figure 10 shows the t-SNE colored by value function, while Figure 11 shows the tSNE colored by the number of left bricks with examples of states from each cluster. We can see that the clusters are well partitioned by the number of remaining bricks and value estimates. Moreover, examining the states in each cluster (Figure 11) we see that the clusters share specific bricks pattern and agent location. From Figure 12 we also learn that the agent collects the bonus bricks at very specific times and order. Thus, we conclude that the agent has learned a location-based policy that is focused on collecting the bonus bricks (similar to maze problems) while avoiding the ghosts. 18 G RAYING THE BLACK BOX : U NDERSTANDING DQN S Figure 11: t-SNE for Pacman colored by the number of left bricks with state examples from each cluster. Figure 12: Histogram showing the time passed until each bonus brick is collected. 19 Z AHAVY, BARAM AND M ANNOR Figure 13: SAMDP visualization for Pacman. The agent starts at cluster 1, heading for the bottom-left bonus brick and collecting it in cluster 2. Once collected, it moves to cluster 3 where it is heading to the top-right bonus brick and collects it in cluster 4. The agent is then moving to clusters 5 and 6 where it is taking the bottom-right and top-left bonus bricks respectively. We also identified cluster 7 and 9 as termination clusters and cluster 8 as a hiding cluster in which the agent hides from the ghosts in the top-left corner. The effects of reward-clipping can be clearly seen in the case of the bonus box. Cluster 10 comprises of states with a visible bonus box. However, these states are assigned with a lower value. SAMDP. Figure 13 presents the resulted SAMDP for the game Pacman. The sparsity of the transitions between the clusters indicates that the agent is spatio-temporally located, meaning that it spends long times in defined areas of the state space as suggested by Figure 12. 20 G RAYING THE BLACK BOX : U NDERSTANDING DQN S 4.6 Enviroment modeling The DQN algorithm requires specific treatment for initial (padded with zero frames) and terminal (receive target value of zero) states, however, it is not clear how to check if this treatment works well. Therefore we show t-SNE maps for different games with a focus on termination and initial states in Figure 14. We can see that all terminal states are mapped successfully into a singular zone, however, initial states are also mapped to singular zones and assigned with wrong value predictions. Following these observations, we suggest to investigate different ways to model initial states, i.e., replicating a frame instead of feeding zeros and test it. Figure 14: Terminal and initial states. Top: All terminal states are mapped into a singular zone(red). Bottom: Initial states are mapped into singular zones (pointed by colored arrows from the terminal zone) above the 3d t-SNE dynamics representation. 4.7 Score pixels Some Atari2600 games include multiple repetitions of the same game. Once the agent finished the first screen it is presented with another one, distinguished only by the score that was accumulated in the first screen. Therefore, an agent might encounter problems with generalizing to the new screen if it over-fits the score pixels. In Breakout, for example, the current state of the art architectures achieves a game score of around 450 points while the maximal available points are 896 suggesting that the agent is somehow not learning to generalize for the new level. We investigated the effect 21 Z AHAVY, BARAM AND M ANNOR that score pixels have on the network predictions. Figure 15 shows the saliency maps of different games supporting our claim that DQN is basing its estimates using these pixels. We suggest to further investigate this, for example, we suggest to train an agent that does not receive those pixels as input. Figure 15: Saliency maps of score pixels. The input state is presented in gray scale while the value input gradients are displayed above it in red. 22 G RAYING THE BLACK BOX : U NDERSTANDING DQN S 4.8 SAMDPs Model Evaluation. We perform three simulations to evaluate the SAMDP model. First, we measure the VMSE criteria, as defined in Equation 2. Since the true value function v is unknown, we approximate it by averaging the DQN value estimates in each cluster: v DQN (cj ) = 1 X DQN v (si ), |Cj | i:si ∈cj and evaluate VSAM DP as defined in Section 3.2. Examining Figure 16, top, we observe that DQN values and the SAMDP values are very similar, indicating that the SAMDP model fits the data well. Second, we evaluate the greedy policy with respect to the SAMDP value function by: πgreedy (ci ) = argmax{Rσi,j + γ kσi,j vSAM DP (cj )}. We measure the correlation between the greedy policy decij sions and the trajectory reward. For a given trajectory j we measure Pij : the empirical distribution of choosing the greedy policy at state ci and the cumulative reward Rj . Finally, we present the correlation between these two measures in each state: corri = corr(Pij , Rj ) in (Figure 16, center). Positive correlation indicates that following the greedy policy leads to high reward. Indeed for most of the states we observe positive correlation, supporting the consistency of the model. The third evaluation is close in spirit to the second one. We partition the data to train and test. We evaluate the greedy policy based on the train set and create two transition matrices T + , T − using k top and bottom rewarded trajectories respectively from the test set. We measure the correlation of the greedy policy T G with each of the transition matrices for different values of k (Figure 16 bottom). As clearly seen, the correlation of the greedy policy and the top trajectories is higher than the correlation with the bottom trajectories. Eject Button: The motivation for this experiment stems from the idea of shared autonomy (Pitzer et al., 2011). There are domains where errors are not permitted and performance must be as high as possible. The idea of shared autonomy is to allow an operator to intervene in the decision loop in critical times. For example, it is known that in 20% of commercial flights, the auto-pilot returns the control to the human pilots. In the following experiment, we show how the SAMDP model can help to identify where agent’s behavior deteriorates. Setup. (a) Evaluate a DQN agent, create a trajectory data set, and evaluate the features for each state (stage 0). (b) Divide the data between train (100 trajectories) and test (60) and build an SAMDP model (stages 1-4) on the train data. (c) Split the train data to k top and bottom rewarded trajectories T + , T − and re-infer the model parameters separately for each (stage 3). (d) Project the test data on the SAMDP model (each state is mapped to the nearest SAMDP state). (e) Once it becomes more likely that the agent transitions are coming from T − rather then from T + , we eject (inspired by option interruption (Sutton et al., 1999)). (f) We average the trajectory reward on (i) the entire test set, and (ii) the un-ejected trajectories subset. We measure 36%, 20%, and 4.7% performance gain for Breakout Seaquest and Pacman, respectively. The eject experiment indicates that the SAMDP model can be used to robustify a given DQN policy by identifying when the agent is not going to perform well and return control to a human operator or some other AI agent. 23 Z AHAVY, BARAM AND M ANNOR DQN value vs. SAMDP value Value 4 0 20 5 Correlation 10 15 Cluster index 20 25 20 25 Correlation between greedy policy and trajectory reward 1 0 10 5 10 15 Cluster index Greedy policy weight in good/bad trajectories 0.5 Weight DQN SAMDP 2 0.4 0.3 0.2 0.00 0.02 0.04 0.06 0.08 Percentage of extermum trajectories used 0.10 High reward trajs Low reward trajs 0.12 0.14 Figure 16: Model Evaluation. Top: VMSE. Center: greedy policy correlation with trajectory reward. Bottom: top (blue), least (red) rewarded trajectories. 5. Conclusions In this work, we showed that the features learned by DQN map the state space to different submanifolds, in each, different features are present. By analyzing the dynamics in these clusters and between them we were able to identify hierarchical structures. In particular, we were able to identify options with defined initial and termination rules. State aggregation gives the agent the ability to learn specific policies for the different regions, thus giving an explanation to the success of DRL agents. The ability to automatically detect sub-goals and skills can also be used in the future as a component of an hierarchical DRL algorithm (Tessler et al., 2017; Kulkarni et al., 2016). Another possibility is to use the aggregation mechanism in order to allocate learning resources between clusters better, for example by using a prioritized experience replay (Schaul et al., 2015). Similar to Neuro-Science, where reverse engineering methods like fMRI reveal structure in brain activity, we demonstrated how to describe the agent’s policy with simple logic rules by processing the network’s neural activity. We believe that interpretation of policies learned by DRL agents is of particular importance by itself. First, it can help in the debugging process by giving the designer qualitative understanding of the learned policies. Second, there is a growing interest in applying DRL solutions to a real-world problem such as autonomous driving and medicine. We believe that before we can reach that goal we will have to gain greater confidence on what the agent is learning. Lastly, understanding what is learned by DRL agents, can help designers develop better algorithms by suggesting solutions that address policy downsides. To conclude, when a deep network is not performing well it is hard to understand the cause and even harder to find ways to improve it. Particularly in DRL, we lack the tools needed to analyze what an agent has learned and therefore left with black box testing. In this paper we showed how to gray the black box: understand better why DQNs work well in practice, and suggested a methodology to interpret the learned policies. 24 G RAYING THE BLACK BOX : U NDERSTANDING DQN S In the Eject experiment, we showed how SAMDP model can help to improve the policy at hand without the need to re-train it. It would be even more interesting to use the SAMDP model to improve the training phase itself. Acknowledgement This research was supported in part by the European Communitys Seventh Framework Programme (FP7/2007-2013) under grant agreement 306638 (SUPREL) and the Intel Collaborative Research Institute for Computational Intelligence (ICRI-CI). 25 Z AHAVY, BARAM AND M ANNOR References Aijun Bai, Siddharth Srivastava, and Stuart Russell. Markovian state and action abstractions for mdps via hierarchical mcts. Nir Baram, Tom Zahavy, and Shie Mannor. Spatio-temporal abstractions in reinforcement learning through neural encoding. European Workshop on Reinforcement Learning (EWRL), 2016. Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. arXiv preprint arXiv:1207.4708, 2012. Marc G Bellemare, Georg Ostrovski, Arthur Guez, Philip S Thomas, and Rémi Munos. Increasing the action gap: New operators for reinforcement learning. arXiv preprint arXiv:1512.04860, 2015. Nir Ben Zrihem, Tom Zahavy, and Shie Mannor. Visualizing dynamics: from t-sne to semi-mdps. Workshop on Human Interpretability in Machine Learning (ICML), 2016. Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. pages 271–271. Morgan Kaufmann Publishers, 1993. Thomas Dean and Shieu-Hong Lin. Decomposition techniques for planning in stochastic domains. 1995. Thomas G Dietterich. Hierarchical reinforcement learning with the MAXQ value function decomposition. J. Artif. Intell. Res.(JAIR), 13:227–303, 2000. Yaakov Engel and Shie Mannor. Learning embedded maps of markov processes. In in Proceedings of ICML 2001. Citeseer, 2001. Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. Dept. IRO, Université de Montréal, Tech. Rep, 4323, 2009. Bruce A Francis and William M Wonham. The internal model principle for linear multivariable regulators. Applied mathematics and optimization, 2(2), 1975. Geoffrey J Gordon. Stable function approximation in dynamic programming. 1995. Assaf Hallak, Dotan Di-Castro, and Shie Mannor. Model selection in markovian processes. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2013. Milos Hauskrecht, Nicolas Meuleau, Leslie Pack Kaelbling, Thomas Dean, and Craig Boutilier. Hierarchical solution of Markov decision processes using macro-actions. In Proceedings of the Fourteenth conference on Uncertainty in artificial intelligence, pages 220–229. Morgan Kaufmann Publishers Inc., 1998. Tejas D Kulkarni, Karthik R Narasimhan, Ardavan Saeedi, and Joshua B Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. arXiv preprint arXiv:1604.06057, 2016. 26 G RAYING THE BLACK BOX : U NDERSTANDING DQN S Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. arXiv preprint arXiv:1504.00702, 2015. Long-Ji Lin. Reinforcement learning for robots using neural networks. Technical report, DTIC Document, 1993. Dalton Lunga, Santasriya Prasad, Melba M Crawford, and Ozan Ersoy. Manifold-learning-based feature extraction for classification of hyperspectral data: a review of advances in manifold learning. Signal Processing Magazine, IEEE, 31(1):55–66, 2014. James MacQueen et al. Some methods for classification and analysis of multivariate observations. 1967. Daniel J Mankowitz, Timothy A Mann, and Shie Mannor. Time regularized interrupting options. Internation Conference on Machine Learning, 2014. Daniel J Mankowitz, Timothy A Mann, and Shie Mannor. Adaptive skills, adaptive partitions (asap). Advances in Neural Information Processing Systems (NIPS-30), 2016. Timothy A Mann, Shie Mannor, and Doina Precup. Approximate value iteration with temporally extended actions. Journal of Artificial Intelligence Research, 53(1):375–438, 2015. Shie Mannor, Ishai Menache, Amit Hoze, and Uri Klein. Dynamic abstraction in reinforcement learning via clustering. In Proceedings of the twenty-first international conference on Machine learning, page 71. ACM, 2004. Ishai Menache, Shie Mannor, and Nahum Shimkin. Q-cutdynamic discovery of sub-goals in reinforcement learning. In Machine Learning: ECML 2002, pages 295–306. Springer, 2002. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540), 2015. Andrew Moore. Variable resolution dynamic programming: Efficiently learning action maps in multivariate real-valued state-spaces. In L. Birnbaum and G. Collins, editors, Machine Learning: Proceedings of the Eighth International Conference. Morgan Kaufmann, June 1991. Arun Nair, Praveen Srinivasan, Sam Blackwell, Cagdas Alcicek, Rory Fearon, Alessandro De Maria, Vedavyas Panneershelvam, Mustafa Suleyman, Charles Beattie, Stig Petersen, et al. Massively parallel methods for deep reinforcement learning. arXiv preprint arXiv:1507.04296, 2015. Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. arXiv preprint arXiv:1412.1897, 2014. 27 Z AHAVY, BARAM AND M ANNOR Ronald Parr. Flexible decomposition algorithms for weakly coupled Markov decision problems. In Proceedings of the Fourteenth conference on Uncertainty in artificial intelligence, pages 422– 430. Morgan Kaufmann Publishers Inc., 1998. Benjamin Pitzer, Michael Styer, Christian Bersch, Charles DuHadway, and Jan Becker. Towards perceptual shared autonomy for robotic mobile manipulation. In IEEE International Conference on Robotics Automation (ICRA), 2011. R Quian Quiroga, Leila Reddy, Gabriel Kreiman, Christof Koch, and Itzhak Fried. Invariant visual representation by single neurons in the human brain. Nature, 435(7045):1102–1107, 2005. P. Ramachandran and G. Varoquaux. Mayavi: 3D Visualization of Scientific Data. Computing in Science & Engineering, 13(2):40–51, 2011. ISSN 1521-9615. Martin Riedmiller. Neural fitted Q iteration–first experiences with a data efficient neural reinforcement learning method. In Machine Learning: ECML 2005, pages 317–328. Springer, 2005. Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. Özgür Şimşek, Alicia P Wolfe, and Andrew G Barto. Identifying useful subgoals in reinforcement learning by local graph partitioning. In Proceedings of the 22nd international conference on Machine learning, pages 816–823. ACM, 2005. Satinder P Singh, Tommi Jaakkola, and Michael I Jordan. Reinforcement learning with soft state aggregation. Advances in neural information processing systems, pages 361–368, 1995. Eduardo D Sontag. Adaptation and regulation with signal detection implies internal model. Systems & control letters, 50(2):119–126, 2003. Martin Stolle. Automated discovery of options in reinforcement learning. PhD thesis, McGill University, 2004. Richard S Sutton, Doina Precup, and Satinder Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1):181–211, 1999. Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500), 2000. Gerald Tesauro. Temporal difference learning and TD-Gammon. Communications of the ACM, 38 (3):58–68, 1995. 28 G RAYING THE BLACK BOX : U NDERSTANDING DQN S Chen Tessler, Shahar Givony, Tom Zahavy, Daniel J Mankowitz, and Shie Mannor. A deep hierarchical approach to lifelong learning in minecraft. Conference on Artificial Intelligence (AAAI), 2017. Sebastian Thrun. Learning metric-topological maps for indoor mobile robot navigation. Artificial Intelligence, 99(1):21–71, 1998. John N Tsitsiklis and Benjamin Van Roy. An analysis of temporal-difference learning with function approximation. Automatic Control, IEEE Transactions on, 42(5):674–690, 1997. Laurens Van Der Maaten. Accelerating t-SNE using tree-based algorithms. The Journal of Machine Learning Research, 15(1):3221–3245, 2014. Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. arXiv preprint arXiv:1509.06461, 2015. Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007. Ziyu Wang, Nando de Freitas, and Marc Lanctot. Dueling network architectures for deep reinforcement learning. arXiv preprint arXiv:1511.06581, 2015. Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? pages 3320–3328, 2014. Tom Zahavy, Nir Ben Zrihem, and Shie Mannor. Graying the black box: Understanding dqns. Proceedings of the 33 rd International Conference on Machine Learning (ICML-16), JMLR: volume48, 2016. Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. pages 818–833, 2014. 29 Z AHAVY, BARAM AND M ANNOR 6. Appendix Figure 17: t-SNE for Breakout colored by time, with examples of states that are repeated by the agent multiple times. 30 G RAYING THE BLACK BOX : U NDERSTANDING DQN S 12 13 11 14 10 9 1 8 2 7 6 3 5 4 Figure 18: Breakout t-sne colored by value. Example of trajectory along the t-sne map. 31 Z AHAVY, BARAM AND M ANNOR a b c d e f Figure 19: Seaquest states partitioned on the t-SNE map by different measure. a: Number of taken divers = 1. b: Number of taken divers = 2. c: Agent is next to sea level (filter by vertical position < 60). d: Agent is never visiting the lower 1/3 part of the frame. We mark the state of maximal diving depth (filter by vertical position > 128). e: Oxygen level < 0.05. f: Oxygen level > 0.98. 32
2cs.AI
Improving Naive Bayes for Regression with Optimised Artificial Surrogate Data Michael Mayo1 and Eibe Frank2 1,2 Department of Computer Science, University of Waikato, Hamilton, New Zealand Corresponding author: Michael Mayo1 Email address: [email protected] arXiv:1707.04943v2 [cs.AI] 10 Oct 2017 ABSTRACT Can we evolve better training data for machine learning algorithms? To investigate this question we use population-based optimisation algorithms to generate artificial surrogate training data for naive Bayes for regression. We demonstrate that the generalisation performance of naive Bayes for regression models is enhanced by training them on the artificial data as opposed to the real data. These results are important for two reasons. Firstly, naive Bayes models are simple and interpretable but frequently underperform compared to more complex “black box” models, and therefore new methods of enhancing accuracy are called for. Secondly, the idea of using the real training data indirectly in the construction of the artificial training data, as opposed to directly for model training, is a novel twist on the usual machine learning paradigm. INTRODUCTION The typical pipeline for a supervised machine learning project involves firstly the collection of a significant sample of labelled examples typically referred to as training data. Depending on whether the labels are continuous or categorical, the supervised learning task is known as regression or classification respectively. Next, once the training data is sufficiently clean and complete, it is used to directly build a predictive model using the machine learning algorithm of choice. The predictive model is then used to label new unlabelled examples, and if the labels of the new examples are known a priori by the user (but not used by the learning algorithm) then the predictive accuracy of the model can be evaluated. Different models can therefore be directly compared. In the usual case, the training data is “real”, i.e. the model is learned directly from labelled examples that were collected specifically for that purpose. However, quite frequently, modifications are made to the training data after it is collected. For example, it is standard practice to remove outlier examples and normalise numeric values. Moreover, the machine learning algorithm itself may specify modifications to the training data. For example, the widely known bagging algorithm (Breiman, 1996) repeatedly resamples the training data with replacement, with each resample being used to train one of multiple models. Similarly the random forest algorithm (Breiman, 2001) repeatedly “projects” the training data in a random fashion in order to produce diverse decision trees. In our own previous work (Mayo and Sun, 2014) we introduced the idea of creating entirely new training data for a predictive model using an evolutionary algorithm. In that paper, we performed a very preliminary evaluation in the context of classification. In this paper, we focus specifically on the problem of regression using the naive Bayes for regression (NBR) model (Frank et al., 2000) and perform a much stronger evaluation. In order to create the artificial training data, the recently proposed competitive swarm optimisation (CSO) algorithm (Cheng and Jin, 2015) is applied. This algorithm optimises a fixed-length numeric vector – a “particle” – such that a given fitness function is minimised. In our approach, particles correspond to artificial training datasets and the fitness function is the error that a NBR model achieves after being trained on the artificial data and tested against the training data. When the optimisation process is complete, the resulting NBR model – trained on the best artificial dataset – is tested accordingly against held-out test data. We also evaluate an NBR model trained directly on the real training data (i.e., using the “normal” machine learning process) and evaluate it against the same test data. Our results show that for many benchmark machine learning problems, training an NBR model indirectly on optimised artificial training data significantly improves generalisation performance compared to direct training. Furthermore, the artificial training datasets themselves can be quite small, e.g., containing only three or ten examples, compared to the original training datasets, which may have hundreds or thousands of examples. The remainder of this paper is structured as follows. In the next section, we briefly survey the two main algorithms used in the research, specifically NBR and CSO. We also briefly touch on previous work in artificial data generation. In the section following that, we describe our new approach more formally, and then we we present results from two rounds of experimentation. The final sections of the paper concern firstly an analysis of an artificial dataset produced by our approach on a small 2D problem, followed by a conclusion. BACKGROUND Naive Bayes for Regression Naive Bayes is a popular approach to classification because it is fast and often surprisingly accurate. The naive Bayes approach employs Bayes’ rule by assuming conditional independence. Given a set of m categorical random variables {X1 , X2 , ..., Xm } and another categorical random variable Y whose value we want to predict, Bayes’ rule is given by P(Y = y|X1 = x1 , X2 = x2 , ..., Xm = xm ) = P(X1 = x1 , X2 = x2 , ..., Xm = xm |Y = y)P(Y = y) ∑y P(X1 = x1 , X2 = x2 , ..., Xm = xm |Y = y)P(Y = y) Assuming that the Xi are conditionally independent given Y , this yields the naive Bayes model: P(Y = y|X1 = x1 , X2 = x2 , ..., Xm = xm ) = ∏m i=1 P(Xi = xi |Y = y)P(Y = y) ∑y ∏m i=1 P(Xi = xi |Y = y)P(Y = y) With categorical data, it is trivial to estimate the conditional probabilities P(Xi = xi |Y = y). The prior class probability P(Y = y) is based on relative frequencies of corresponding events in the training data. If a predictor variable Xi is continuous rather than categorical, it is common to discretise it. Alternatively, one can compute a normal density estimate or a kernel density estimate for Xi for each different value of the categorical target variable Y . The assumption of conditional independence is rarely correct in practical applications of this model on real-world data. However, accurate classification does not necessarily require accurate posterior probability estimates P(Y |X1 , X2 , ..., Xm ): to achieve high classification accuracy, it is sufficient for the correct class value Y to receive maximum probability; the absolute value of this probability is irrelevant as long as it is larger than the probability for any of the other (incorrect) class values. In this paper, we consider the NBR algorithm (Frank et al., 2000), which applies to situations with a continuous target variable Y . The basic model in the regression case remains the same as the classification case described above. However, estimation of the required conditional densities f (Xi = xi |Y = y), as opposed to the conditional probabilities P(Xi = xi |Y = y), is more challenging. We provide a brief explanation here. Further details can be found in (Frank et al., 2000). Assume that Xi as well as Y is continuous. We can apply the definition of conditional density to yield f (Xi = xi |Y = y) = f (Xi = xi ,Y = y) f (Y = y) Both f (Xi = xi ,Y = y) and f (Y = y) can then be estimated using a kernel density estimator. In Frank et al. (2000), a Gaussian kernel is used in the kernel density estimates and the bandwidths of the kernels are estimated by minimising leave-one-out-cross-validated cross-entropy on a grid of possible bandwidth values. The bandwidths for Xi and Y are optimised jointly for f (Xi = xi ,Y = y). The obtained bandwidth for Y is used to estimate both f (Xi = xi ,Y = y) and f (Y = y). When Xi is categorical rather than continuous, we can apply Bayes’ rule to obtain P(Xi = xi |Y = y) = f (Y = y|Xi = xi )P(Xi = xi ) ∑xi f (Y = y|Xi = xi )P(X j = xi ) Here, f (Y = y|Xi = xi ) can be estimated using a different kernel density estimator for each value xi of the categorical variable Xi . The bandwidth for each of these estimators f (Y = y|Xi = xi ) is again obtained using leave-one-out-cross-validated cross-entropy. The probability P(Xi = xi ) can be estimated by counting events in the training set. 2/20 The ultimate goal of naive Bayes for regression is prediction based on the posterior density f (Y = y|X1 = x1 , X2 = x2 , ..., Xm = xm ), which is given by ∏m i=1 q(Xi = xi |Y = y) f (Y = y) m y ∏i=1 q(Xi = xi |Y = y) f (Y = y) f (Y = y|X1 = x1 , X2 = x2 , ..., Xm = xm ) = R where  q(Xi = xi |Y = y) = P(Xi = xi |Y = y) if Xi is categorical f (Xi = xi |Y = y) if Xi is continuous The integral in the denominator can be obtained using a discrete approximation. In this paper, we use the mode of the density as the predicted value, found using a recursive grid search. Note that the location of the mode can be determined without computing the denominator because its value does not depend on Y . Competitive Swarm Optimisation Competitive swarm optimisation (CSO) is a recently proposed (Cheng and Jin, 2015) metaheuristic optimisation algorithm derived from particle swarm optimisation (PSO; Kennedy et al., 2001; Bonyadi and Michalewicz, 2017). The PSO family of algorithms are distinguished from other optimisation algorithms by (i) not requiring a gradient function, which enables them to tackle ill-defined problems that are otherwise challenging; and (ii) by performing a goal-directed mutation on solutions (or “particles”), in which several components from the search process (such as various best solutions found so far) contribute to the search procedure. Similarly to traditional PSO, CSO represents solution vectors as particles. For each particle in CSO, the following information is stored: (i) a position vector X(t) representing a potential solution to the current problem and (ii) a velocity vector V (t) storing X(t)’s trajectory through the solution space. Parameter t is the iteration index and corresponds to time. Both algorithms maintain a single set of particles P(t) comprising s particles in memory. This set is called the swarm. CSO varies from traditional PSO in several important ways. Firstly, CSO does not maintain a “personal best” memory per particle. Nor does it maintain an explicit “global best” memory for the entire swarm. Instead, the algorithm takes an elitist approach and runs a series of s/2 fitness competitions between random pairs of particles in the swarm. Whichever particle in each competition has the best fitness wins the competition. Winners are not updated for the next iteration. Conversely, the losing particle’s velocity and position is updated. Since the global best particle will never lose a fitness competition (at least until it is improved upon), the algorithm will always maintain the global best particle in P(t). A second key distinction between CSO and PSO is its convergence behaviour. Standard PSO algorithms potentially suffer from unbounded particle velocity increases, i.e., particles may travel off “to infinity” along one or more dimensions and therefore the algorithm will not reach an equilibrium. Practical workarounds for this problem are either to limit particle velocities to some maximum magnitude or to carefully select PSO’s parameters such that the algorithm converges (Bonyadi and Michalewicz, 2017). CSO requires neither of these workarounds: Cheng and Jin (2015) proved that as long as the key parameter ϕ is non-negative, then the particles will eventually converge on some solution y∗ , which may not be the global optimum but is none-the-less an equilibrium state for the algorithm. Complete pseudocode for CSO, adapted from Cheng and Jin (2015), is given in Algorithm 1. The pseudocode assumes that a fitness function f over particles, to be minimised, is provided. Essentially, CSO consists of two loops: an outer loop over iterations defined at line 3, and an inner loop over fitness competitions per iteration defined at line 6. The fitness values are computed on line 8. Line 14 shows how the winner of the current competition passes through to the next iteration unchanged. The rules for updating the velocity and position of each losing particle are specified in lines 15–17. The first of these lines creates three random vectors. These are used to mix three different components together in order to compute a new velocity for the particle being updated. The three components are (i) the particle’s original velocity which provides an element of inertia to the velocity updates; (ii) the difference between the particle’s current position and the position of the particle that it just lost to; and (iii) the difference between the particle and the swarm mean X̄(t). The updated velocity is then added to the losing particle’s position so that the particle moves to a new position in search space. A key aspect of the algorithm is that the influence of the swarm mean is controlled by the parameter ϕ. When ϕ = 0, the swarm mean does not need to be computed and is effectively ignored; when ϕ > 0, however, the swarm mean has an increasingly attractive effect on the particles. Overall, 3/20 Algorithm 1: Competitive Swarm Optimiser (CSO) for large scale optimisation. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 initialize P(0) with s particles, each particle having a random initial position vector Xi (0) and a zero initial velocity vector Vi (0); t = 0; while t < tmax do calculate the fitness of new or updated particles in P(t); U = P(t), P(t + 1) = φ ; while U 6= φ do randomly remove two particles X1 (t), X2 (t) from U; calculate the cost function f (X(t)) for X1 (t) and X2 (t); if f (X1 (t)) ≤ f (X2 (t)) then Xw (t) = X1 (t), Xl (t) = X2 (t); else Xw (t) = X2 (t), Xl (t) = X1 (t); end set Xw (t + 1) = Xw (t) and add Xw (t + 1) to P(t + 1); create three random vectors, R1 (t), R2 (t) and R3 (t), with elements drawn uniformly from [0, 1]; set Vl (t + 1) = R1 (t)Vl (t) + R2 (t)(Xw (t) − Xl (t)) + ϕR3 (t)(X̄(t) − Xl (t)); set Xl (t + 1) = Xl (t) +Vl (t + 1); add Xl (t + 1) to P(t + 1); end t = t + 1; end the algorithm has fewer parameters than other similar algorithms. Besides ϕ, the only other critical parameters are s, the number of particles in the swarm, and tmax , the number of iterations to perform. In the general case, tmax can be changed to an alternative stopping criterion. Prior evaluations (Cheng and Jin, 2015) have shown that CSO outperforms other population-based metaheuristic algorithms on standard high-dimensional benchmark optimisation functions. Therefore, due to its simplicity and excellent performance, we adopt CSO for this research. Prior Work on Artificial Example Generation The creation of artificial training data for testing new machine learning algorithms (as opposed to training the models) has a long history. The basic idea is to create training data that has known patterns or properties, and then observe the algorithm’s performance. For example, does the algorithm correctly detect known patterns that exist in the artificial data? Answering these questions can lead to insight about how well the algorithm will perform in with real datasets. A well-known example of an artificial dataset generator is the “people” data generator described by Agrawal et al. (1993). Another class of artificial training data generation is used for speeding up nearest neighbour classifiers. Nearest neighbour classification can be computationally expensive if the number and/or dimensionality of the examples is high. A suite of algorithms for optimising the set of possible neighbours therefore exists in the literature: see Triguero et al. (2011) for a comprehensive survey. In most cases these algorithms focus on example selection from the real data rather than the generation of new examples. However, algorithms have been proposed for both modifying existing examples (e.g., via compression as performed by Zhong et al. (2017)) and also for creating entirely new examples, such as in the work by Impedovo et al. (2014) which describes a method for digit prototype generation. Escalante et al. (2013) also describe a method of example generation in which genetic programming is applied. Artificial data generation techniques can be used to address the class imbalance problem. Many machine learning algorithms for classification fail to work effectively when the classes are severely imbalanced. In the classic machine learning literature, Chawla et al. (2002) developed the synthetic minority over-sampling technique (SMOTE) to artificially increase the size of the minority class, (producing better class balance in the data) while correspondingly preserving the examples in the majority class. Similarly, Lòpez et al. (2014) developed a new technique based on evolutionary algorithms for generating minority class examples. It is worth mentioning here the significant number of works in the literature showing that corrupting training data with noise improves the resulting generalisation performance of models. This 4/20 idea is common in the neural network literature. For example, Guozhong (1996) found that input data corruption improved neural network generalisation for both classification and regression tasks. More recently, stacked denoising autoencoders (Vincent et al., 2008), which are based on the idea of corrupting inputs to learn more robust features in deep networks, have seen considerable success. Likewise, in the evolutionary machine learning literature, dataset corruption has been demonstrated to be an effective strategy for learning both classifier systems (Urbanowicz et al., 2011) and symbolic discriminant analysis models (Greene et al., 2009). These approaches do not strictly generate artificial examples; rather they are based on perturbing the real training data. Finally, we briefly mention generative adversarial nets (GANs) proposed by Goodfellow et al. (2014). These are a type of paired neural network in which one network “generates” artificial data examples by passing random noise through the network, and the other network “discriminates” between the examples in order to to determine if the examples are from the real training dataset or are fakes. The purpose of this process is to construct better generative models from the data. In contrast, the work we present in this paper extends and build on work originally reported in Mayo and Sun (2014). Rather than aiming to generate fake data that is indistinguishable from real data, we aim to produce artificial data maximising the performance of the resulting classifier when it is trained on the artificial data. Therefore, the artificial data may (or may not) be easily distinguishable from the real data. In fact, in some cases the artificial data is easily distinguishable from the real data. For example, an artificial dataset depicted discussed shortly has negative values for the prediction target: such values do not occur in the corresponding real data. The approach proposed in this paper is therefore quite different in nature to the GAN approach. To summarise, prior work has explored many variations on the theme of perturbing the training data in different ways in order to improve model performance, or focussed on example generation strategies for specific purposes (such as balancing the data). Mayo and Sun (2014) is the only prior work investigating the generation of completely new artificial training datasets. In that work, naive Bayes for classification was shown to perform well with the optimised artificial data. In this paper, we significantly extend that work by (i) applying the same basic approach to naive Bayes for regression; (ii) updating the metaheuristic algorithm used for the optimisation to CSO, a more modern algorithm designed specifically for high dimensional problems; and (iii) testing against a wide range of varied regression problems. EVOLVING ARTIFICIAL DATA FOR REGRESSION In this section, we precisely outline our approach to constructing artificial training data for regression problems using CSO. The classical approach to machine learning is to start with some tabular training data Dtrain , comprising r rows or examples, and d attributes. One of the attributes, typically the first or last one, is the target to predict and the other attributes are predictor variables. Given this training data, we can think of a machine learning algorithm such as NBR as a function of the training data, i.e., m1 = mNBR (Dtrain ) where m1 is a predictive model and mNBR is a function encapsulating a machine learning algorithm that trains an NBR model given some training dataset. The performance of the model on a test dataset can similarly be stated as a function e1 = eval(m1 , Dtest ) with e1 being a standard metric for regression error such as root mean squared error (RMSE). Our approach is based on defining a corresponding fitness function f (X(t)) for CSO. In order to evaluate f (X(t)), we must first convert particle X(t) into a tabular dataset with n examples where n is small and fixed. This we will refer to as DX(t) . Typically we will have n  r unless r itself is very small. Since the entire dataset DX(t) has dn unique values, then the dimensionality of the particles X(t) is dn. The process of converting X(t) to DX(t) is fairly straightforward: for numeric attributes, the values are copied directly from the particle into the correct position in DX(t) without modification. For categorical (i.e., discrete) attributes, the process is complicated by the fact that CSO optimises continuous values only. We correct for this by rounding individual values from X(t) to the nearest legal discrete value when they are copied across to DX(t) . The original values in X(t) remain unmodified. 5/20 Random particle initialisation (line 1 of Algorithm 1), is performed by an examination of Dtrain : each variable is initialised to a random uniform value between the minimum and maximum values of the corresponding attribute in Dtrain . Thus, we can define the fitness function to minimise as the error some model m2 yields on the training data: f (X(t)) = eval(m2 , Dtrain ) where m2 is not trained on the original training data, but instead on the artificial dataset that is derived from the current particle X(t) being evaluated, i.e. m2 = mNBR (g(X(t))) = mNBR (DX(t) ) where the function g converts the one-dimensional particle X(t) into a tabular dataset DX(t) using the procedure outlined above. After the optimisation process is complete, we can evaluate m2 against the test data to get the test error e2 = eval(m2 , Dtest ) This will enable us to perform a direct comparison with e1 , the test error achieved using the traditional machine learning approach. In terms of computational time complexity, the significant cost of this algorithm is the fitness function evaluation. Evaluating the fitness of a particle involves firstly converting the particle to a dataset; secondly, training a regression model using the dataset; and thirdly, evaluating that model against the real dataset. The training and testing steps clearly have the most significant complexity in this operation. Since CSO needs at least a few hundred iterations to find good solutions, this implies that our approach may not be feasible with models that are very time consuming to train or test, which may be due to either the specific learning algorithm’s own complexity or the real dataset being very large in size. Measures may therefore need to be taken (e.g. replacing the algorithm with a more efficient one, or only using a subset of the real data for fitness evaluations) in these cases. As mentioned, we have chosen a direct representation in which variables being optimised map directly to attribute values in the artificial dataset. A consequence of this is that different particles (the equivalent of “genotypes” in evolutionary computing) may result in identical models (i.e., the equivalent of “phenotypes”) if the learning algorithm ignores the order of the examples in the data. For example, the datasets {x1 , x2 , x3 } and {x2 , x3 , x1 }, where xi is an example, produce the same NBR model. This observation is not necessarily a drawback of our approach. In fact, in many other approaches, multiple genotypes mapping onto a single phenotype is a deliberate feature as it enables neutral mutations. For example, linear genetic programming (LGP), proposed by Brameier and Banzhaf (2007), evolves sequential programs. Since the order of any two instructions is often not dependent (e.g., initialising two different variables), the same issue arises: different programs map to the same behaviours. However, this does suggest that future research could investigate alternative particle/dataset mapping functions to determine if efficiencies are possible over the approach we use here. INITIAL EVALUATION We conducted an initial evaluation of our proposed algorithm on benchmark regression datasets used in Frank et al. (2000) 1 . Although small, these datasets do represent a diverse range of prediction problems and have been acquired from several different sources. To illustrate the diversity, the “fruit fly” dataset consists of observations describing male fruit fly sexual behaviour and is used to build a model predicting fly longevity. Conversely, the “cpu” dataset is used to construct a predictive model for CPU performance given various technical features of a CPU. Finally, the “pollution” dataset is used to predict the age-adjusted mortality rate of a neighbourhood given various metrics such as the amount of rainfall and the degree of presence of various pollutants. Overall, there are 35 distinct regression datasets in the collection, with between 38 to 625 examples per dataset. The dimensionality of the datasets ranges from 3 to 26. Table 1 gives the exact properties of each dataset. 1 Original datasets available from http://prdownloads.sourceforge.net/weka/datasets-numeric. jar 6/20 Table 1. Dataset characteristics used in the experiments. The third column shows the total number of features, with the total number of numeric features in parentheses. Dataset auto93 autoHorse autoMpg autoPrice baskball bodyfat bolts cholesterol cleveland cloud cpu detroit echoMonths elusage fishcatch fruitfly gascons housing hungarian longley lowbwt mbagrade meta pbc pharynx pollution pwLinear quake schlvote sensory servo sleep strike veteran vineyard #Examples 93 205 398 159 96 252 40 303 303 108 209 13 130 55 158 125 27 506 294 16 189 61 528 418 195 60 200 2178 38 576 167 62 625 137 52 #Features 22(16) 25(17) 7(4) 15(15) 4(4) 14(14) 7(7) 13(6) 13(6) 6(4) 7(6) 13(13) 9(6) 2(1) 7(5) 4(2) 4(4) 13(12) 13(6) 6(6) 9(2) 2(1) 21(19) 18(10) 11(1) 15(15) 10(10) 3(3) 5(4) 11(0) 4(0) 7(7) 6(5) 7(3) 3(3) 7/20 Table 2. Initial experiment results on the small datasets. Shown are the test errors. To enhance readability, an asterisk (∗ ) indicates the best result in an LR vs. NBR vs. CSO-NBR(mean) comparison, while bold indicates the best result in a NBR vs. CSO-NBR(mean) comparison. Dataset auto93 autoHorse autoMpg autoPrice baskball bodyfat bolts cholesterol cleveland cloud cpu detroit echoMonths elusage fishcatch fruitfly gascons housing hungarian longley lowbwt mbagrade meta pbc pharynx pollution pwLinear quake schlvote sensory servo sleep strike veteran vineyard LR 11.08 13.87 ∗ 3.15 2640.96 ∗ 0.08 0.72 11.29 ∗ 50.95 ∗ 0.79 ∗ 0.31 93.75 ∗ 48.24 ∗ 11.21 ∗ 12.94 104.76 ∗ 14.32 40.27 5.20 ∗ 0.30 803.03 ∗ 496.61 ∗ 0.30 398.92 ∗ 970.26 429.51 ∗ 46.29 2.45 0.20 1795017.06 ∗ 0.79 ∗ 0.84 ∗ 2.79 ∗ 662.13 ∗ 155.44 1.80 NBR ∗ 5.41 ∗ 12.92 3.43 2375.45 0.11 1.68 ∗ 7.92 61.76 1.05 0.43 114.65 89.18 12.67 17.73 209.45 19.80 17.63 6.32 0.36 ∗ 552.15 559.99 ∗ 0.30 378.52 1049.74 354.80 62.31 2.49 0.27 1956688.47 0.94 1.04 4.09 696.60 164.17 ∗ 1.33 CSO-NBR(mean) 5.91 ± 1.89 13.00 ± 2.59 3.55 ± 0.12 ∗ 2261.03 ± 218.19 0.09 ± 0.01 ∗ 0.53 ± 0.09 11.46 ± 8.35 56.92 ± 3.81 0.80 ± 0.04 0.37 ± 0.12 ∗ 43.70 ± 6.85 52.24 ± 20.06 12.89 ± 1.70 17.52 ± 1.26 ∗ 63.68 ± 18.68 16.94 ± 0.70 ∗ 3.23 ± 0.76 ∗ 3.92 ± 0.14 0.33 ± 0.02 755.90 ± 428.00 550.26 ± 47.09 0.34 ± 0.02 ∗ 365.57 ± 121.54 1016.99 ± 49.78 ∗ 327.16 ± 15.86 55.84 ± 8.78 ∗ 2.04 ± 0.05 ∗ 0.19 ± 0.00 ∗ 1096037.48 ± 67480.04 0.82 ± 0.02 0.88 ± 0.05 3.49 ± 0.55 680.04 ± 29.17 181.64 ± 31.27 2.72 ± 0.56 p value 0.7880 0.5401 0.9926 0.0658 0.0007 0.0000 0.8938 0.0015 0.0000 0.0881 0.0000 0.0001 0.6526 0.3002 0.0000 0.0000 0.0000 0.0000 0.0001 0.9168 0.2649 1.0000 0.3719 0.0336 0.0002 0.0224 0.0000 0.0000 0.0000 0.0000 0.0000 0.0038 0.0531 0.9444 1.0000 CSO-NBR(best) 3.92 9.26 3.32 1894.58 0.08 0.41 7.52 51.63 0.74 0.31 28.37 21.79 11.32 16.12 45.83 15.67 2.17 3.70 0.30 282.72 501.34 0.33 217.87 922.27 301.58 42.64 1.96 0.19 1023308.85 0.79 0.82 2.81 663.30 155.39 2.16 Certainly, the datasets themselves are not “high dimensional” datasets by any standard. However, when the proposed optimisation algorithm is applied to evolve artificial datasets with, e.g., ten examples, then the dimensionality for the optimisation problem ranges between 30 and 260 depending on the dataset. Thus, the dimensionality of the optimisation problem high-dimensional. To prepare the datasets for our evaluation, we split each dataset into a training portion (consisting of a randomly selected 66% of the examples) and a held-out test portion (consisting of the remaining examples). Maintaining a fixed test set was necessary so that the variability in the results produced by our stochastic search method could be assessed properly. The key parameters for CSO, specifically ϕ, tmax and s were set of 0.1, 1000, and 100 respectively. For evaluating the models, the fitness function to be minimised was RMSE, and we fixed the size of the artificial datasets to n = 10. These initial parameter values were chosen after some initial exploratory tests on one of the datasets. Because CSO is a heavily randomised search algorithm and will therefore give different results each time it is run, we ran our algorithm ten times for on each train/test split. Thus, we executed a total of 350 runs of our algorithm overall. Table 2 gives the results by dataset. The column “NBR” in the table gives the baseline testing performance of NBR trained using the traditional process. We further include in the table the results achieved using linear regression (LR; implemented in WEKA 3.8.0 (Frank et al., 2016)). This implementation of LR performs attribute selection using the M50 method (Wang and Witten, 1997), which usually outperforms standard LR. The error metrics on the test splits achieved by our experimental algorithm are given in the columns “CSO-NBR(mean)” and “CSO-NBR(best)”, 8/20 which give the average (± the standard deviation) and best errors achieved respectively over the ten repetitions. Finally, we also performed a single-sample, one-sided t-test comparing the results of our experimental algorithm with the single result achieved by traditional NBR. The p value for the test is given as well in Table 2. Overall, we can see NBR accuracy performance is improved significantly in most cases when CSO-NBR is used to train the model. If we consider the strong condition that p < 0.01 (i.e., 99% confidence), then NBR’s performance is improved in 18/35 cases. If the condition is weakened to p < 0.05 (95% confidence), then a further two more significant improvements can be added to that total. Also interesting is the comparison of NBR, LR, and our experimental algorithm. NBR in its original form tends to underperform LR on most of the problems; in fact, on 25/35 LR has a lower error than NBR. However, when we compare the mean performance of CSO-NBR to LR, the number of wins for LR decreases to 21/35. If we furthermore consider the error of the best single run of our experimental algorithm, then the number of LR wins drops to only 8/35 datasets. We note that considering the best-of-ten-runs result (i.e., the “CSO-NBR(best)” column) is an optimistic strategy, and it has consequently been de-emphasized in Table 2. However, it is worth including these results because in practice, if only one model is required but CSO-NBR is run multiple times (which it should be), then only the best single model during testing is likely to be used for subsequent analysis (e.g., for inspecting model, or for use in live production). In terms of individual dataset performance, the difference between NBR and CSO-NBR is quite variable. For example, the “gascons” dataset appears to be very difficult to model for both NBR and LR, which achieve test set errors of 17.63 and 40.27 respectively. CSO-NBR, on the other hand, generalises quite well, achieving a mean testing error of only 3.23. A similar example is the “bodyfat” problem, in which test errors of 1.68 and 0.72 for NBR and LR respectively can be compared to the 0.53 mean test error that CSO-NBR achieves. Conversely, there are also datasets where CSO-NBR performs extremely poorly: for example, the “longley” dataset is modelled well by NBR but poorly by both LR and CSO-NBR. Similarly for the “vineyard” dataset. There appears to be no clear-cut single best algorithm overall. Also interesting is a pattern that is clearly evident in the table of results. If one considers the cases where CSO-NBR is statistically significantly better than NBR, it appears to also be the case (in all but one instance) that LR also shows a large reduction in error compared to NBR. This suggests that those datasets have properties that NBR cannot model well by itself, without being embedded inside CSO. This certainly warrants future investigation, perhaps in the context of using synthetic data to determine which patterns NBR and CSO-NBR can and cannot detect. Finally, we were also interested in a comparison of CSO to a more traditional PSO variant. This was to determine if CSO was really a suitable optimiser for this problem. To that end, we selected the standard PSO algorithm (SPSO) described by Bonyadi and Michalewicz (2017). SPSO has three main parameters: an inertia parameter, a cognitive constant, and a social constant. Following the recommendation by (Bonyadi and Michalewicz, 2017, pp. 11) we set these parameters to 0.6, 1.7 and 1.7 respectively. A fundamental difference between the CSO and SPSO is that SPSO updates all particles in the swarm at each iteration whereas CSO updates only half of the particles (the losers) per iteration. Similarly, particles in CSO have no personal memory; particles in SPSO on the other hand each have a memory for their “personal best” position additional to their current position. Therefore it is unfair to directly compare SPSO and CSO with the same swarm size and same number of iterations, as SPSO would be performing approximately twice the number of function evaluations, and furthermore, it would use twice the amount of memory as CSO. To make comparisons fairer, we gave each algorithm approximately the same number of fitness function evaluations, since the fitness function is the main contributor to the algorithm complexity. There are two ways of making the number of fitness evaluations performed by SPSO approximately equal to those performed by CSO: halving the swarm size or halving the number of iterations. We tested both variants, i.e., we defined one version of SPSO-NBR with a s = 50 and tmax = 1000, and another with s = 100 and tmax = 500. The latter version of SPSO uses the twice the amount of memory as the other two algorithms. The SPSO results are given in the tables in the appendix. A comparison of these tables with the CSO-NBR results in Table 2 show that in most cases, CSO-NBR outperforms SPSO-NBR. Specifically, the s = 50,tmax = 1000 variant of SPSO-NBR outperforms CSO-NBR on only six of the datasets while the s = 100,tmax = 500 variant (using twice as much memory) outperforms CSO-NBR 9/20 Table 3. Datasets used in the experiment. Dataset Wine Quality – Red (Cortez et al., 2009) Wine Quality – White (Cortez et al., 2009) Energy Efficiency – Heating (Tsanas and Xifara, 2012) Energy Efficiency – Cooling (Tsanas and Xifara, 2012) Parkinson’s – Motor (Tsanas et al., 2010) Parkinson’s – Total (Tsanas et al., 2010) Appliance Energy (Candanedo et al., 2017) Survival (Lenz et al., 2008; Wang, 2015) #Examples 1,599 4,898 768 768 5,875 5,875 19,373 181 (train)/233 (test) #Features 11 11 8 8 18 18 26 3,833 on twelve of the datasets. We continue in the next section using CSO only, as (i) it has been shown that CSO generally outperforms SPSO on the same problems, or is at least in the same ballpark; and (ii) CSO requires less parameter tuning compared to SPSO. To summarise, our initial experiments indicate that our experimental algorithm – training an NBR model on artificial training data optimised in a supervised fashion using CSO – is an effective approach for constructing more robust naive Bayes regression models for certain machine learning problems. We therefore proceed to a more challenging set of problems in the next round of experiments. PARAMETER STUDY WITH MODERN DATASETS In this set of experimental runs, we consider the effect of various key parameters on the artificial data optimisation process, in particular CSO’s ϕ parameter, and n, the size of the artificial dataset. We ran experiments with ϕ ∈ {0.0, 0.1, 0.5, 1.0} and n ∈ {3, 10, 20} to evaluate the effect on the generalisation error of the resulting NBR model. The remaining parameters, specifically s, the swarm size, and tmax , the number of iterations, were held at constant values (100 and 1000 respectively) so that the total number of function evaluations was a constant. Recall that each function evaluation consists of one run of NBR on the artificial data to train the model followed by a testing procedure to measure the RMSE on the real training data. We chose eight new regression problems for this round of experiments. These datasets are larger than those used in the previous round of experiments, and also much more recently published. Table 3 summarises the datasets, giving their name and the overall dimensionality of the data in terms of number of examples and number of predictive features excluding the target value. In brief, the wine quality datasets (Cortez et al., 2009) contains data about various Portuguese “Vinho Verde” wines. The features are physiochemical statistics about each wine (e.g., the pH value) and the target to predict is the subjective quality of the wine, which ranges on a scale from 0 to 10. The data is divided into two separate prediction problems, one for red wine and one for white wine with the white wine dataset being considerably larger in size. The building energy efficiency datasets (Tsanas and Xifara, 2012), in contrast, concerns predicting the heating and/or cooling load of a building, given various properties of the building’s design. The buildings are simulated, and while each building has the same volume, the surface areas, dimensions, and the materials used to construct the buildings vary. There are eight predictive features in total, and for each example there are two separate prediction targets: (i) the total heating load and (ii) the total cooling load. Accurately predicting the loads of the buildings without running full (and highly computationally complex) building simulations is an important problem in the optimisation of energy efficient buildings. The fifth and sixth problems deal with the remote diagnosis of Parkinson’s disease (Tsanas et al., 2010). The aim of this data is to learn a model that can predict the Unified Parkinson’s Disease Rating Scale (UPDRS) for a patient. Normally, the UPDRS score is determined by trained medical personnel in the clinic using a costly physical exam. In contrast, the dataset constructed for this problem uses statistical features extracted via the signal processing of recorded speech alone. Thus, UPDRS assessment can be performed remotely instead of in-person if the predictions are accurate enough. Similar to the previous problem, this prediction problem has two predictive targets per example: the total UPDRS score, ranging from 0 (healthy) to 176 (total disability); and the motor UPDRS score, which has a smaller range of 0 to 108. The seventh problem, like the building energy prediction problems, is concerned with energy usage (Candanedo et al., 2017). Unlike those problems, however, this dataset is derived from real data rather than a simulation and is much larger: there are nearly twenty thousand examples in 10/20 Table 4. Experiment results (test errors) on the Wine Quality – Red dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 0.8522 CSO-NBR(mean) 0.6735 ± 0.0037 0.6745 ± 0.0079 0.6885 ± 0.0164 0.6703 ± 0.0066 0.6751 ± 0.0098 0.6756 ± 0.0072 0.6757 ± 0.0066 0.6668 ± 0.0090 0.6711 ± 0.0072 0.6775 ± 0.0090 0.6705 ± 0.0122 0.6664 ± 0.0099 CSO-NBR(best) 0.6670 0.6651 0.6656 0.6613 0.6591 0.6630 0.6641 0.6543 0.6579 0.6620 0.6534 0.6519 Table 5. Experiment results (test errors) on the Wine Quality – White dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 1.2724 CSO-NBR(mean) 0.8270 ± 0.0095 0.8285 ± 0.0101 0.8624 ± 0.0734 0.8272 ± 0.0105 0.8202 ± 0.0069 0.8200 ± 0.0113 0.8319 ± 0.0098 0.8285 ± 0.0068 0.8246 ± 0.0093 0.8361 ± 0.0094 0.8256 ± 0.0083 0.8237 ± 0.0056 CSO-NBR(best) 0.8107 0.8144 0.8266 0.8138 0.8133 0.8042 0.8171 0.8202 0.8134 0.8210 0.8109 0.8152 total, and the dimensionality is higher as well. The problem is to predict the energy usage of appliances in a real house given features related to the environment, such as weather data and temperature/humidity readings from wireless sensors. The data is arranged into a time series with each example corresponding to data about the weather and household/appliance usage activity over a ten minute period. Finally, the eighth dataset we considered concerns building a regression model to predict survival time for cancer patients given gene expression data. The data was originally acquired by Lenz et al. (2008) and subsequently further processed and re-published by Wang (2015). The features in the dataset are measurements from probe sets obtained using a microarray device. Each measurement is an estimate of one particular gene’s degree of expression in a patient. The prediction target is the survival time of the patient. Because of the high dimensionality of the data, we performed our experiments on this data using a random subset of one hundred of the gene expressions measurements. Such an approach is commonly used elsewhere. For example, Kapur et al. (2016) used the same strategy when learning Bayesian network models for gene expression class prediction. In terms of the experimental setup, our experiments followed the same basic procedure that we applied previously: i.e., the data was split into training and test portions, and then both standard NBR and LR served as baselines. We ran CSO-NBR ten times to assess its average and best performance on each problem. With respect to splitting the data into training and test subsets, for the first six datasets, the ordering of the examples was randomised and the split sizes were two-thirds and one-third for the training and test sets respectively. The Appliance Energy data, however, forms a time series. Therefore we did not randomise the examples but instead preserved their order, which resulted in the training examples preceding the test examples in time. The split sizes were the same as before however. For the Survival data, the examples are already arranged into training and test subsets by Wang (2015), and we did not alter this. Tables 4 to 11 summarise the results. The column names have the same interpretation as previously, and for each table, the best achieved test set errors (both averaged over ten runs and for a single run) have been bolded. Firstly we examined the results in respect of the parameter values we were varying. The results 11/20 Table 6. Experiment results (test errors) on the Energy Efficiency – Heating dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 6.2906 CSO-NBR(mean) 3.9545 ± 0.4241 4.4217 ± 0.8192 4.9732 ± 0.9185 3.7849 ± 0.6211 3.9914 ± 0.4370 4.5730 ± 1.6502 4.3207 ± 0.8469 4.6647 ± 0.4799 4.4657 ± 1.0296 4.0320 ± 0.5351 5.0931 ± 0.9932 4.7041 ± 0.6888 CSO-NBR(best) 3.4115 3.1010 3.5728 2.5752 2.9801 2.8295 3.5456 3.6592 2.9383 3.3858 3.5922 3.8492 Table 7. Experiment results (test errors) on the Energy Efficiency – Cooling dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 5.5104 CSO-NBR(mean) 3.5554 ± 0.4713 4.0276 ± 0.5111 4.9107 ± 0.4092 3.5219 ± 0.3873 3.2015 ± 0.3916 4.4863 ± 2.4956 3.4576 ± 0.3586 3.4896 ± 0.5219 4.0933 ± 0.8163 3.4930 ± 0.2802 4.2263 ± 1.1971 3.7196 ± 0.4081 CSO-NBR(best) 2.8654 3.3790 4.1077 2.8390 2.5128 2.9844 2.9568 2.5689 3.1503 3.0616 3.1754 3.0461 Table 8. Experiment results (test errors) on the Parkinson’s – Motor dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 10.8869 CSO-NBR(mean) 7.8192 ± 0.1168 8.2723 ± 0.5394 7.6298 ± 0.8589 8.2869 ± 0.3250 8.4412 ± 0.3450 8.4356 ± 0.4726 7.9885 ± 0.2380 7.8277 ± 0.2719 8.0523 ± 0.4004 7.8931 ± 0.3850 7.7304 ± 0.3464 8.0553 ± 0.2759 CSO-NBR(best) 7.6027 7.4407 6.5968 7.8042 8.0629 7.9741 7.5894 7.2337 7.5780 7.3222 7.2379 7.6781 Table 9. Experiment results (test errors) on the Parkinson’s – Total dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 18.9802 CSO-NBR(mean) 9.6309 ± 0.1369 9.6215 ± 0.2970 9.6947 ± 0.3364 9.5537 ± 0.1006 9.9890 ± 0.1606 9.9324 ± 0.1307 9.5729 ± 0.1130 9.7709 ± 0.2050 9.8207 ± 0.1653 9.5969 ± 0.1199 9.6908 ± 0.2172 9.8576 ± 0.2160 CSO-NBR(best) 9.4488 9.1104 9.2157 9.3631 9.7112 9.7260 9.4543 9.4648 9.6467 9.4083 9.2791 9.3910 12/20 Table 10. Experiment results (test errors) on the Appliance Energy dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 96.1397 CSO-NBR(mean) 95.6540 ± 5.1323 98.6674 ± 10.4532 94.1240 ± 2.0230 92.5080 ± 2.3186 110.8083 ± 15.0077 119.6089 ± 26.7894 91.2650 ± 0.7496 116.4989 ± 20.3208 118.0088 ± 17.2667 90.9198 ± 1.1368 118.5223 ± 8.2297 123.2761 ± 11.2777 p value 0.3858 0.7680 0.0059 0.0004 0.9935 0.9891 0.0000 0.9943 0.9985 0.0000 1.0000 1.0000 CSO-NBR(best) 91.0486 90.2488 91.7284 88.9964 91.6589 92.8323 89.9534 95.5893 93.1136 89.9421 102.9101 109.8786 Table 11. Experiment results (test errors) on the Survival dataset. ϕ 0.0 0.0 0.0 0.1 0.1 0.1 0.5 0.5 0.5 1.0 1.0 1.0 n 3 10 20 3 10 20 3 10 20 3 10 20 NBR 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 3.2272 CSO-NBR(mean) 3.0148 ± 0.2732 2.9216 ± 0.3084 2.7333 ± 0.2110 4.0539 ± 0.9391 3.7990 ± 0.4212 3.5180 ± 0.5446 2.7568 ± 0.4411 3.7682 ± 0.7155 3.1950 ± 0.2570 2.7909 ± 0.3210 3.6973 ± 0.7256 3.4808 ± 0.4700 p value 0.0181 0.0060 0.0000 0.9894 0.9990 0.9372 0.0041 0.9798 0.3505 0.0010 0.9646 0.9389 CSO-NBR(best) 2.6715 2.2261 2.3555 3.5272 2.9585 2.8164 2.1783 2.5391 2.8708 2.3641 2.7918 2.6984 show that in most cases, a low value of ϕ (either 0.0 or 0.1) achieves the lowest mean test error. The only exceptions to this are the Red Wine dataset and the Appliance Energy dataset for which a higher ϕ of 1.0 leads to the best overall results. However, runs with lower ϕ still significantly outperform the baseline on the Appliance Energy dataset. The results are not as clear-cut with the dataset size parameter n however. There is no consistent pattern of optimal artificial dataset size across the problems. For example, the Survival dataset appears to require a large artificial dataset with n = 20. When n is reduced, performance degrades significantly. Conversely, for the Energy Efficiency – Heating dataset, a very small number of artificial examples (i.e. n = 3) is preferred and increasing this reduces accuracy. The takeaway from the analysis is that while there is no clearly optimal artificial dataset size, a low value of ϕ (either 0.0 or 0.1) appears to be a good default in most cases. Specific problems may benefit from gradually increasing ϕ if performance is not ideal. The next step in our examination was to perform statistical significance tests comparing NBR and CSO-NBR for a more rigorous comparison. Similar to the previous section, we performed single sample t-tests comparing the test set errors of CSO-NBR against the single result obtained by the deterministic NBR algorithm, for each set of ten runs. For the first six problems, the results of the tests unanimously showed CSO-NBR significantly outperforming NBR with exceptionally low p values (i.e. p  0.0001), but higher p values were exhibited in the cases of the latter two (Appliance Energy and Survival) problems. We therefore include p values in the tables of results only for the latter two regression problems, since these are the interesting results where the significance varies considerably. Finally, we also ran standard LR with default on the same datasets. The test set errors achieved by LR are shown in Table 12, and are mainly provided for context: the main focus of our comparison is between NBR and CSO-NBR in this section. To summarise, CSO-NBR significantly improves NBR’s performance, to the point that it is at least competitive with (and sometimes better than) LR. ANALYSIS In this section, we explore the performance of CSO-NBR on a very simple two dimensional dataset with known properties, in an attempt to understand the interaction between the original NBR algorithm 13/20 Table 12. Test error of linear regression (LR) on the datasets used in the experiment. Dataset Wine Quality – Red Wine Quality – White Energy Efficiency – Heating Energy Efficiency – Cooling Parkinson’s – Motor Parkinson’s – Total Appliance Energy Survival LR 0.6830 0.8333 3.7769 3.5457 7.0744 9.3309 92.5500 5.1632 3 25 2 20 1 y 15 0 10 −1 5 −2 −3 −3 0 −2 −1 0 x 1 2 3 Figure 1. Contour plot showing a two-dimensional distribution from which artificial data points 1 2 were sampled. The distribution is defined by the equation z = 25e− 2 r where r is the distance of each sample point (x, y) from the origin. and our enhanced version. The artificial dataset we employ in this section is generated using the “peak” algorithm in the R package MLBench (Leisch and Dimitriadou, 2010). Figure 1 depicts the ground truth from which the data is generated. The data is drawn from a two dimensional normal distribution centred on the origin and scaled to a maximum height of 25. Points are sampled uniformly from the distribution within a circle of radius three about the origin. To generate a training dataset, we sampled 100 such points. A test set was then generated from a further 100 random samples. Each example in the datasets is a tuple of the form (x, y, z) where z is the target to predict. We note the following points about this artificial regression problem: 1. The target variable z is a non-linear function of the two predictors x and y. This property of the data makes the problem difficult for simple linear model learners such as LR. This fact is demonstrated by the performance achieved using the LR algorithm to predict the z values on both the training and test datasets after model learning using the training data: LR achieves a very poor RMSE score of 8.4 on the training data and 8.7 on the test data. 2. The predictive features x and y are not conditionally independent given the predictive target z, which violates naive Bayes’ conditional independence assumption. Once z is known, the potential values for (x, y) are distributed around the perimeter of a circle centred on the origin. 14/20 3 25 ● ● 2 ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● 1 ● ● ● ● ● ● 0 ● ● ● y ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● 10 ● ● ● 15 ● ● ● ● ● ● ● ● ● −1 ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● 20 ● ●● ● ● ● ● ● ● ● ● ● ● ● −2 ● ● ● ● ● 5 ● ● ● −3 −3 0 −2 −1 0 x 1 2 3 Figure 2. Predicted distribution using the NBR algorithm trained using the 100 training examples. The examples are depicted in the figure as points, and were generated using the R package MLBench (Leisch and Dimitriadou, 2010). Thus, knowing the value of x limits the locations for y to two possible values. In contrast to LR, NBR achieves RMSE scores of 1.4 and 2.1 on the two data splits respectively, which is a major improvement but still not ideal. To visualise the model that NBR learns from the training data, we constructed the contour plot depicted in Figure 2. Data from the plot was generated by dividing the [−3 . . . 3] × [−3 . . . 3] square centred on the origin into a 120 × 120 grid. At each grid point, we used the NBR model to make a prediction. Thus, 121 × 121 predictions were made in total, and the contour plot shows the predicted values. Figure 2 also depicts the 100 randomly sampled training data points used to construct the model as points on the contour plot. Next, we ran the CSO-NBR algorithm ten times with the same settings as before (s = 100, ϕ = 0.1, tmax = 1000, n = 10) and selected the resulting single best artificial training dataset from across the ten runs. The average model achieved an RMSE of 0.7 ± 0.12 on the test data. The best model, on the other hand, achieved an RMSE score of 0.4 on the training data and 0.5 on the test data – both the average and best result are a substantial improvement on both LR and standard NBR. Figure 3 depicts the predictions made by the CSO-NBR model along with the (x, y) coordinates of the ten artificial data points in the best artificial datasets used to build the model. Table 13 further shows the actual artificial data points themselves. We can make several observations from the contour plots of the predictions and the table. Firstly, as Figure 2 clearly shows, the NBR algorithm by itself models the ground truth to a reasonable degree. The predicted z values are higher the closer that (x, y) is to the origin, which is what is expected. However, the circular symmetricity of the distribution in Figure 2 is not preserved well, as the contours have an obvious “squarish” appearance. There also appears to be a high degree of noise in the contours, suggesting that the model is not generalising well and instead overfitting the training data noise. In contrast, the CSO-NBR predictions as depicted in Figure 3 produce a much cleaner, more symmetric, and less noisy predicted distribution. The prediction agrees well with the ground truth distribution in Figure 1, which in turn explains the low RMSE scores achieved in the experiments we performed. Of interest is the layout of the artificial data points across the distribution of predictions. Clearly, the positions of the artificial points have been highly optimised with the majority of the points lying approximately on the negative diagonal y = −x and the remaining two points lying on 15/20 3 2 25 20 ● ● y 1 15 ● 0 10 ●● ● ● −1 5 ● ● −2 0 ● −3 −3 −5 −2 −1 0 x 1 2 3 Figure 3. Predicted distribution using the CSO-NBR algorithm trained using ten optimised artificial training examples. The examples are depicted in the figure as points. Table 13. Artificial data (rounded to 2 d.p.) used to train the model whose predictions are depicted in Figure 3. x 1.75 0.08 1.02 0.02 2.26 -0.88 0.37 1.76 -2.06 y -1.60 -0.09 -0.94 -0.06 -2.15 0.87 -0.48 1.82 2.01 z 0.72 30.89 9.87 -2.81 -5.22 11.73 17.51 1.58 -2.91 16/20 the opposite diagonal. This configuration of points, when used as training data for the NBR algorithm, produces superior predictions and indicates that only a small amount of training data is required to effectively model this problem. CONCLUSION In summary, we have described a method for enhancing the predictive accuracy of naive Bayes for regression. The approach employs “real” training data only indirectly in the machine learning pipeline, as part of a fitness function that in turn is used to optimise a small artificial surrogate training dataset. The naive Bayes model is constructed using the artificial data instead of the real training data. Our evaluation has demonstrated that the method often produces superior regression models in terms of generalisation error. The primary advantages of this idea are twofold. In its original formulation, naive Bayes typically underperforms other regression models. However, the algorithm does have certain specific advantages such as being simple and interpretable, and interpretable models are important in many areas (e.g. medicine) where understanding the rules used for prediction is important. Finding new methods to enhance the accuracy of naive Bayesian models is therefore important, and we have described one means of doing so. Several interesting questions are raised by this research, which may form a basis for future work. For example, how hard is this problem when framed as an optimisation problem, from a fitness landscape perspective? “Easy” problems in evolutionary computation are usually those with a high correlation between the fitness of solutions and their distance to the global optima. “Hard” problems, on the other hand, have a much lower or even negative (in the case of deception) correlation. Another question concerns the behaviour of our proposed algorithm when a base algorithm quite different to NBR is employed. How exactly does CSO’s behaviour change with the base model? Can we replace NBR with a full Bayesian network or a decision tree ensemble and still get generalisation improvements? Do we need to use larger or smaller artificial datasets to make our approach work with other base algorithms? There is also the issue of how to select the optimal artificial dataset size for the problem at hand. Our results indicate that there is no single value of n that is a good default in most cases. Some problems require a larger n, and others a smaller n. How, then, can the correct n be chosen? A potential but expensive answer to this question is to run the algorithm multiple times with different artificial dataset sizes and attempt to hone in on the best one. However, other more intelligent approaches (for example, greedily adding one optimised example to the artificial dataset at a time until no more improvements are possible) are certainly possible and may work. Finally, our results raise an interesting fundamental question: why is it possible to drastically reduce the number of training examples from hundreds or thousands to just a few, while at the same time maintaining comparable (or better) accuracy? In other words, is there some theoretical reason why our approach works? Is information from the real data being somehow “compressed” into the artificial data, and how/why does this happen? Is it possible that useful information might be discovered in these small highly-optimised artificial datasets, in the same way that rules and other knowledge can be typically discovered by inspecting normal machine learning models? REFERENCES Agrawal, R., Imielinski, T., and Swami, A. (1993). Database mining: A performance perspective. IEEE Transactions on Knowledge and Data Engineering, 5(6):914–925. Bonyadi, M. and Michalewicz, Z. (2017). Particle swarm optimization for single objective continuous space problems: A review. Evolutionary Computation, 25(1):1–54. Brameier, M. and Banzhaf, W. (2007). Linear Genetic Programming. Springer. Breiman, L. (1996). Bagging predictors. Machine Learning, 24(2):123–140. Breiman, L. (2001). Random forests. Machine Learning, 45(1):5–32. Candanedo, L., Feldheim, V., and Deramix, D. (2017). Data driven prediction models of energy use of applicances in a low energy house. Energy and Buildings, 140:81–97. Chawla, N., Bowyer, K., Hall, L., and Kegelmeyer, W. (2002). Synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16:321–357. Cheng, R. and Jin, Y. (2015). A competitive swarm optimizer for large scale optimization. IEEE Transactions on Cybernetics, 45(2):191–204. Cortez, P., Cerdeira, A., Almeida, F., Matos, T., and Reis, J. (2009). Modeling wine preferences by data mining from physicochemical properties. Decision Support Systems, 47(4):547–553. 17/20 Escalante, H., Mendoza, K., Graff, M., and Morales-Reyes, A. (2013). Genetic Programming of Prototypes for Pattern Classification, pages 100–107. Springer Berlin Heidelberg, Berlin, Heidelberg. Frank, E., Hall, M., and Witten, I. (2016). The WEKA Workbench. Online Appendix for “Data Mining: Practical Machine Learning Tools and Techniques”. Morgan Kaufmann, 4th edition. Frank, E., Trigg, L., Holmes, G., and Witten, I. (2000). Naive Bayes for regression. Machine Learning, 41:5–25. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. arXiv:1406.2661. Greene, C., Hill, D., and Moore, J. (2009). Environmental noise improves epistasis models of genetic data discovered using a computational evolution system. In Proc. GECCO’09, pages 1785–1786. Guozhong, A. (1996). The effects of adding noise during backpropagation training on generalisation performance. Neural Computation, 8(3):643–674. Impedovo, S., Mangini, F., and Barbuzzi, D. (2014). A novel prototype generation technique for handwriting digit recognition. Pattern Recognition, 47(3):1002 – 1010. Kapur, A., Marwah, K., and Alterovitz, G. (2016). Gene expression prediction using low-rank matrix completion. BMC Bioinformatics, 17:243. Kennedy, J., Eberhart, R., and Shi, Y. (2001). Swarm Intelligence. The Morgan Kaufmann Series in Artificial Intelligence. Morgan Kauffman. Leisch, F. and Dimitriadou, E. (2010). MLbench: Machine Learning Benchmark Problems, v. 2.1-1 edition. Lenz, G., Wright, G., Dave, S., Xiao, W., Powell, J., Zhao, H., Xu, W., Tan, B., Goldschmidt, N., Iqbal, J., Vose, J., Bast, M., Fu, K., Weisenburger, D., Greiner, T., Armitage, J., Kyle, A., May, L., Gascoyne, R., Connors, J., Troen, G., Holte, H., Kvaloy, S., Dierickx, D., Verhoef, G., Delabie, J., Smeland, E., Jares, P., Martinez, A., Lopez-Guillermo, A., Montserrat, E., Campo, E., Braziel, R., Miller, T., Rimsza, L., Cook, J., Pohlman, B., Sweetenham, J., Tubbs, R., Fisher, R., Hartmann, E., Rosenwald, A., Ott, G., Muller-Hermelink, H.-K., Wrench, D., Lister, T., Jaffe, E., Wilson, W., Chan, W., and Staudt, L. (2008). Stromal gene signatures in large-b-cell lymphomas. New England Journal of Medicine, 359(22):2313–2323. PMID: 19038878. Lòpez, V., Triguero, I., Carmona, C., Garcia, S., and Herrara, F. (2014). Addressing imbalanced classification with instance generation techniques: IPADE-ID. Neurocomputing, 126(15-28). Mayo, M. and Sun, Q. (2014). Evolving artificial datasets to improve interpretable classifiers. In 2014 IEEE Congress on Evolutionary Computation (CEC), pages 2367–2374. Triguero, I., Derrac, J., Garcia, S., and Herrera, F. (2011). A taxonomy and experimental study on prototype generation for nearest neighbor classification. IEEE Trans. on Systems, Man and Cybernetics – Part C: Applications and Reviews, 42(1):86–100. Tsanas, A., Little, M., McSharry, P., and Ramig, L. (2010). Accurate telemonitoring of Parkinson’s disease progression by non-invasive speech tests. IEEE Transactions on Biomedical Engineering, 57:884–893. Tsanas, A. and Xifara, A. (2012). Accurate quantitative estimation of energy performance of residential buildings using statistical machine learning tools. Energy and Buildings, 49:560–567. Urbanowicz, R., Sinnot-Armstrong, N., and Moore, J. (2011). Random artificial incorporation of noise in a learning classifier system environment. In Proc. GECCO’11, pages 369–374. Vincent, P., Larochelle, H., Bengio, Y., and Manzagol, P. (2008). Extracting and composing robust features with denoising autoencoders. Proc. 25th International Conference on Machine Learning (ICML’08). Wang, Y. and Witten, I. (1997). Induction of model trees for predicting continuous classes. In Poster papers of the 9th European Conference on Machine Learning. Springer. Wang, Z. (2015). bujar: Buckly-James regression for survival data with high dimensional covariates. Technical report. Zhong, K., Guo, R., Kumar, S., Yan, B., S., D., and Dhillon, I. (2017). Fast classification with binary prototypes. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54, pages 1255–1263. PMLR. ACKNOWLEDGEMENTS We thank the reviewers for their helpful comments on earlier drafts of this manuscript. APPENDIX 18/20 Table 14. Results of running SPSO and SPSO-NBR on the datasets used in the first experiment with s = 50 and tmax = 1000. Shown are the test errors. Bolded figures in the SPSO-NBR(mean) column indicate a better result than the corresponding CSO-NBR(mean) result. Dataset auto93 autoHorse autoMpg autoPrice baskball bodyfat bolts cholesterol cleveland cloud cpu detroit echoMonths elusage fishcatch fruitfly gascons housing hungarian longley lowbwt mbagrade meta pbc pharynx pollution pwLinear quake schlvote sensory servo sleep strike veteran vineyard NBR 5.41 12.92 3.43 2375.45 0.11 1.68 7.92 61.76 1.05 0.43 114.65 89.18 12.67 17.73 209.45 19.80 17.63 6.32 0.36 552.15 559.99 0.30 378.52 1049.74 354.80 62.31 2.49 0.27 1956688.47 0.94 1.04 4.09 696.60 164.17 1.33 SPSO-NBR(mean) 7.28 ± 2.53 19.53 ± 2.84 3.56 ± 0.28 2418.18 ± 217.03 0.10 ± 0.01 1.33 ± 1.24 9.48 ± 2.22 52.80 ± 2.04 0.86 ± 0.07 0.55 ± 0.20 56.95 ± 32.54 63.51 ± 21.85 12.20 ± 1.14 17.84 ± 2.32 80.08 ± 16.97 16.89 ± 0.93 5.54 ± 2.63 4.53 ± 0.87 0.34 ± 0.02 910.21 ± 504.25 479.54 ± 30.36 0.33 ± 0.02 511.75 ± 243.39 1026.42 ± 46.36 330.98 ± 31.81 66.89 ± 26.40 2.24 ± 0.17 0.20 ± 0.00 1222473.32 ± 297248.95 0.82 ± 0.02 0.88 ± 0.18 11.43 ± 20.98 672.86 ± 10.21 191.26 ± 45.31 2.35 ± 0.25 SPSO-NBR(best) 4.46 16.56 3.04 2171.16 0.08 0.70 5.82 49.40 0.79 0.37 19.48 38.91 10.74 14.93 53.79 15.40 3.04 3.95 0.32 408.73 455.66 0.31 184.12 964.19 303.07 43.90 2.04 0.19 1028636.70 0.78 0.67 2.43 656.73 145.96 1.91 19/20 Table 15. Results of running SPSO and SPSO-NBR on the datasets used in the first experiment with s = 100 and tmax = 500. Shown are the test errors. Bolded figures in the SPSO-NBR(mean) column indicate a better result than the corresponding CSO-NBR(mean) result. Dataset auto93 autoHorse autoMpg autoPrice baskball bodyfat bolts cholesterol cleveland cloud cpu detroit echoMonths elusage fishcatch fruitfly gascons housing hungarian longley lowbwt mbagrade meta pbc pharynx pollution pwLinear quake schlvote sensory servo sleep strike veteran vineyard NBR 5.41 12.92 3.43 2375.45 0.11 1.68 7.92 61.76 1.05 0.43 114.65 89.18 12.67 17.73 209.45 19.80 17.63 6.32 0.36 552.15 559.99 0.30 378.52 1049.74 354.80 62.31 2.49 0.27 1956688.47 0.94 1.04 4.09 696.60 164.17 1.33 SPSO-NBR(mean) 6.58 ± 1.23 17.08 ± 2.74 3.55 ± 0.22 2524.65 ± 536.17 0.10 ± 0.04 0.70 ± 0.10 9.11 ± 3.41 54.37 ± 2.47 0.84 ± 0.08 0.55 ± 0.16 77.61 ± 36.68 45.27 ± 11.89 11.89 ± 0.75 17.35 ± 2.30 92.72 ± 66.22 18.02 ± 1.25 5.93 ± 2.48 4.10 ± 0.13 0.34 ± 0.02 1061.36 ± 1367.85 522.28 ± 59.45 0.34 ± 0.03 566.25 ± 316.02 1009.47 ± 57.85 325.70 ± 44.74 57.13 ± 15.40 2.26 ± 0.27 0.20 ± 0.00 1157391.48 ± 201257.39 0.83 ± 0.02 0.76 ± 0.12 4.79 ± 3.24 668.92 ± 13.44 173.83 ± 30.15 2.61 ± 0.72 SPSO-NBR(best) 5.07 12.61 3.19 2217.93 0.08 0.53 5.12 50.80 0.75 0.34 25.26 28.58 11.25 13.38 55.98 16.48 2.39 3.92 0.31 372.86 466.73 0.32 97.00 919.29 272.44 44.13 2.01 0.19 1023514.27 0.80 0.60 2.55 655.56 140.91 2.11 20/20
2cs.AI
The Multi-layer Information Bottleneck Problem Qianqian Yang∗ , Pablo Piantanida† , Deniz Gündüz∗ ∗ Electrical arXiv:1711.05102v1 [stat.ML] 14 Nov 2017 and Electronic Engineering Department, Imperial College London, London SW7 2AZ, U.K. {q.yang14, d.gunduz}@imperial.ac.uk † Laboratoire des Signaux et Systémes, CentraleSupélec-CNRS-Université Paris-Sud, Gif-sur-Yvette, France [email protected] Abstract—The muti-layer information bottleneck (IB) problem, where information is propagated (or successively refined) from layer to layer, is considered. Based on information forwarded by the preceding layer, each stage of the network is required to preserve a certain level of relevance with regards to a specific hidden variable, quantified by the mutual information. The hidden variables and the source can be arbitrarily correlated. The optimal trade-off between rates of relevance and compression (or complexity) is obtained through a singleletter characterization, referred to as the rate-relevance region. Conditions of successive refinabilty are given. Binary source with BSC hidden variables and binary source with BSC/BEC mixed hidden variables are both proved to be successively refinable. We further extend our result to Guassian models. A counterexample of successive refinability is also provided. I. I NTRODUCTION A fundamental problem in statistical learning is to extract the relevant essence of data from high-dimensional, noisy, salient sources. In supervised learning (e.g., speaker identification in speech recognition), a set of properties or statistical relationships is pre-specified as relevant information of interest (e.g., name, age or gender of the speaker) targeted to be learned from data; while in unsupervised learning, clusters or low-dimensional representations play the same role. This can be connected to the lossy source compression problem in information theory, where an original source is compressed subject to specifically defined distortion (or loss) with regards to specified relevant information. A remarkable step towards understanding the information relevance problem using fundamental information theoretical concepts was made by Tishby et al. [1] with the introduction of the “information bottleneck ” (IB) method. The relevant information in an observable variable X is defined as the information X can provide about another hidden variable Y . The IB framework characterizes the trade-off between the information rates (or complexity) of the reproduction signal X̂, and the amount of mutual information it provides about Y . The IB method has been found useful in a wide variety of learning applications, e.g., word clustering [2], image clustering [3], etc. In particular, interesting connections have been recently made between deep learning [4] and the successively refined IB method [5]. Despite of the success of the IB method in the machine learning domain, less efforts have been invested in studying This work has been funded in part by the European Research Council (ERC) under Starting Grant BEACON (agreement 677854). it from an information theoretical view. Gilad-Bachrach et al. [6] characterize the optimal trade-off between the rates of information and relevance, and provide a single-letter region. As a matter of fact, the conventional IB problem follows as a special instance of the conventional noisy lossy source coding problem [7]. Extension of this information-theoretic framework address the collaborative IB problem by Vera et al. [8], and the distributed biclustering problem by Pichler et al. [9]. Further connections to the problem of joint testing and lossy reconstruction has been recently studied by Katz et al. [10]. Also in the information theoretic context, the IB problem is closely related to the pattern classification problem studied in [11]–[13]; which provides another operational meaning to IB. In this work, we introduce and investigate the multi-layer IB problem with non-identical hidden variables at each layer. This scenario is highly motivated by deep neural networks (DNN) and the recent work in [5]. Along the propagation of a DNN, each layer compresses its input, which is the output of the preceding layer, to a lower dimensional output, which is forwarded to the next layer. Another scenario may be the hierarchical, multi-layer network, in which information is propagated from higher layers to lower layers sequentially. Users in different layers may be interested in different properties of the original source. The main result of this paper is the full characterization of the rate-relevance region of the multi-layer IB problem. Conditions are provided for successive refinability in the sense of the existence of codes that asymptotically achieve the rate-relevance function, simultaneously at all the layers. Binary source with BSC hidden variables and binary source with mixed BSC\BEC hidden variables1 are both proved to successively refinable. The successive refinability is also shown for Guassian sources. We further present a counterexample for which successive refinability no longer holds. It is worth mentioning that the successive refinability of the IB problem is also investigated in [14], with identical hidden variables. The rest of the paper is organized as follows. Section II provides the definitions and presents the main result, the achievability and converse proofs of which are provided in the Appendices. The definition and conditions of successive refinability are shown in Section III. Examples are presented in Section IV. Finally, we conclude the paper in Section V. 1 BSC hidden variables are obtained by passing the source through a binary symmetric channel, whereas BEC hidden variables are obtained through a binary erasure channel. Xn Z1 f1 I(Y1n ; Z1 ) f2 Z2 nµ1 I(Y2n ; Z2 ) ··· ZL 1 fL ZL I(YLn ; ZL ) nµ2 I(YLn 1 ; ZL 1) nµL nµL 1 Fig. 1. Illustration of the multi-layer IB problem. II. P ROBLEM FORMULATION Let (X be a sequence of n i.i.d. copies of discrete random variables (X, Y1 , . . . , YL ) taking values in finite alphabets X , Y1 , . . . , YL , jointly distributed according to p(x, y1 , . . . , yL ), where X is an observable variable, while Y1 , . . . , YL are hidden variables arbitrarily correlated with X. An (n, R1 , . . . , RL ) code for the L-layer IB problem, as illustrated in Fig. 1, consists of L encoding functions f1 , . . . , fL , defined as fl : Zl−1 → Zl , l = 1, . . . , L, where we set Z0 , X n , and Zl , [1 : 2nRl ], l = 1, . . . , L. That is, Rl is the rate of the l-th layer encoding function fl , l = 1, . . . , L, and we assume R1 ≥ R2 ≥ · · · ≥ RL . n , Y1n , . . . , YLn ) Definition 1. (Achievability) For some R1 ≥ · · · ≥ RL and non-negative µ1 , . . . , µL values, (R1 , . . . , RL , µ1 , . . . , µL ) is said to be achievable if, for every  > 0, there exists an (n, R1 , . . . , RL )-code s.t. 1 I(Yln ; Zl ) ≥ µl − , l = 1, . . . , L, (1) n for sufficiently large n, where Zl = fl (Zl−1 ), for l = 1, . . . , L, and Z0 , X n . The value of µl imposes a lower bound on I(Yln ; Zl ), i.e., the relevance with respect to the hidden variable Yl after llayer encoding of the observable sequence X n . Our goal is to characterize the rate-relevance region, R, which is the set of all achievable tuples (R1 , . . . , RL , µ1 , . . . , µL ). Theorem 1. The rate-relevance region, R, is characterized by the closure of the set of all tuples (R1 , . . . , RL , µ1 , . . . , µL ) that satisfy Rl ≥ I(X; Ul , . . . , UL ), l = 1, . . . , L, (2) for some probability p(x)p(u1 , . . . , uL |x) s.t. µl ≤ I(Yl ; Ul , . . . , UL ), l = 1, . . . , L. (3) Theorem 2. Source X is successively refinable for the Llayer IB problem with relevance constraints µ1 , . . . , µL with regards to hidden variables Y1 , . . . , YL , iff there exist random variables U1 , . . . , UL , satisfying UL − − · · · − − U1 − − X −− (Y1 , . . . , YL ), such that the following conditions hold simultaneously for l = 1, . . . , L: 1) RX→Yl (µl ) = I(X; Ul ), 2) µl ≤ I(Yl ; Ul ). Proof. Theorem 2 follows directly from Definition 2 and Theorem 1. IV. E XAMPLES A. Binary Source with Symmetric Hidden Variables We consider X = Yl = {0, 1}, l = 1, ..., L. The observable variable X has a Bernoulli distribution 21 (denoted as Bern ( 12 )), and the hidden variables are obtained by passing the source through independent BSCs, i.e., Yl = X ⊕ Nl , where Nl ∼ Bern(pl ), 0 ≤ pl ≤ 12 , is independent of X, and ⊕ denotes modulo-2 addition. We first derive the rate-relevance function RX→Yl (µl ). Denote by Ul any random variable for which I(Yl ; Ul ) ≥ µl , Ul −− X −− Yl . We have the following inequality: µl ≤ H(Yl ) − H(X ⊕ Nl |Ul ) ≤ 1 − Hb (pl ∗ = 1 − Hb (pl ∗ Hb−1 (H(X|Ul ))) Hb−1 (1 − I(X; Ul ))) (6a) (6b) (6c) where operation ∗ is defined as a ∗ b = a(1 − b) + b(1 − a), Hb (·) is the binary entropy function, defined as Hb (p) = 1 , and Hb−1 (·) is the inverse of the p log 1/p + (1 − p) log 1−p binary entropy function Hb (p) with p ∈ [0, 0.5]. (6b) follows from Mrs. Gerber’s Lemma and thefact that H(Yl  ) = 1. From Hb−1 (1−µl )−pl (6), we obtain I(X; Ul ) ≥ 1 − Hb . Thus, we 1−2pl   −1 Hb (1−µl )−pl . Note that by have RX→Yl (µl ) ≥ 1 − Hb 1−2pl letting Ul∗ =X ⊕ Ml , where M is independent of X and l  Hb−1 (1−µl )−pl ∗ , we have I(Yl ; Ul ) = µl and Ml ∼ Bern 1−2pl  −1  Hb (1−µl )−pl ∗ I(X; Ul ) = 1 − Hb . We can conclude that 1−2pl H −1 (1−µ )−p Proof. A proof is provided in the Appendices. RX→Yl (µl ) = 1 − Hb ( b 1−2pll l ) and Ul∗ given above is a rate-relevance function achieving auxiliary random variable. III. S UCCESSIVE R EFINABILITY OF M ULTI -L AYER IB The rate-relevance function for a single-layer setting with relevance constraint µ regarding the hidden variable Y is denoted by RX→Y (µ), and characterized in [6] as: Lemma 1. Binary sources as described above are always successively refinable for the L-layer IB problem if RX→Y1 (µ1 ) ≥ · · · ≥ RX→YL (µL ) and µl ≤ 1 − Hb (pl ), for l = 1, ..., L. RX→Y (µ) = min p(U |X): U − −X− −Y, I(Y ;U )≥µ I(X; U ). (4) Definition 2. Source X is said to be successively refinable for the L-layer IB problem with regards to correlated relevant hidden variables Y1 , . . . , YL with relevance constraints µ1 , . . . , µ2 , respectively, if (RX→Y1 (µ1 ), . . . , RX→YL (µL ), µ1 , . . . , µL ) ∈ R. (5) Proof. Since RX→Y1 (µ1 ) ≥ · · · ≥ RX→YL (µL ), we can find binary variables M1 , ..., ML , independent of each other and X, such that M1 ⊕ · · · ⊕ Ml ∼ Bern(Hb−1 (1 − RX→Yl (µl ))) for l = 1, ..., L. By choosing auxiliary random variables: Ul = X ⊕ M1 ⊕ · · · ⊕ Ml , we have I(X; Ul ) = RX→Yl (µl ) and I(Y ; Ul ) = µl , for l = 1, ..., L, and UL −− · · · −− U1 −− X − − (Y1 , ..., YL ). Together with Theorem 2, this conclude the proof of Lemma 1. Note that successive refinability is still achievable in this example despite the mixed hidden variables contrast to our expectation, since an auxiliary U in the form X ⊕ M achieves the rate-relevance function despite BEC hidden variable. C. Jointly Gaussian Source and Hidden Variables Fig. 2. Binary source with mixed hidden variables. B. Binary Source with Mixed Hidden Variables Here we consider a two-layer IB problem, i.e., L = 2. The joint distribution of (X, Y1 , Y2 ) is illustrated in Fig. 2, where X is a binary random variable of distribution Bernoulli 12 as in the previous example, but Y1 is the output of a BEC with erasure probability  ( ∈ [0, 1/2]) when X is the input, and Y2 is the output of a (BSC) with crossover probability p, p ∈ [0, 1/2]. A similar example can be found in [15] where the optimality of proposed coding scheme not always holds for their setting. We first derive the rate-relevance function RX→Y1 (µ1 ). Denote by U1 any random variable such that I(Y1 ; U1 ) ≥ µ1 , U1 − − X − − Y1 . We have the following inequality: H(Y1 |U1 ) = H(Y1 |U1 ) + H(X|U1 , Y1 ) − H(X|U1 , Y1 ) = H(Y1 , X|U1 ) − H(X|U1 , Y1 ) = H(X|U1 ) + H(Y1 |X, U1 ) − H(X|U1 , Y1 ) = 1 − I(X; U1 ) + H(Y1 |X)  − p(Y1 6= e)H(X|U1 , X) + p(Y1 = e)H(X|U1 , Y1 = e)  = 1 − I(X; U1 ) + Hb () − H(X|U1 ) = 1 + ( − 1)I(X; U1 ) −  + Hb (). It is not difficult to verify that the above achievability results are still valid for the Gaussian sources by employing a quantization procedure over the sources and appropriate test channels [16]. Let X and Yl , l = 1, ..., L, be jointly Gaussian zeromean random variables, such that Yl = X + Nl , where 2 X ∼ N (0, σx2 ) and Nl ∼ N (0, σN ), Nl ⊥ X. As in the l previous examples, we first derive a lower bound on the raterelevance function RX→Yl (µl ). Denote by Ul any random variable such that I(Yl ; Ul ) ≥ µl , Ul −− X −− Yl . We have the following sequence of inequalities: µl ≤ I(Yl ; Ul ) = h(Yl ) − h(X + Nl |Ul )   1 2 ) ≤ log 2πe(σx2 + σN l 2   1 2 − log 2πeσN + exp (2h(X|Ul )) l 2   1 2 = log 2πe(σx2 + σN ) l 2   1 2 − log 2πeσN + exp (2h(X) − 2I(X; U )) l l 2   1 2 2 = log 2πe(σx + σN ) l 2   1 2 2 − log 2πeσN + 2πeσ exp (−2I(X; U ) l , x l 2 (7a) (7b) (7c) (7f) Since µ1 ≤ I(Y1 , U1 ) = H(Y1 ) − H(Y1 |U1 ), where H(Y1 ) = He (), He () is defined as He () =  log 1/ + (1 − 2 b ()+1 ) log 1− , it follows that RX→Y1 (µ1 ) ≥ µ1 +Hb ()−H , 1− ∗ which can be achieved by setting U1 = X ⊕ M1 , where M1 ∼ Bern(RX→Y1 (µ1 )) is independent of X. We have  Hb−1 (1−µ2 )−p RX→Y2 (µ2 ) = 1 − Hb from Section. IV-A, 1−2p ∗ which can be achieved by setting U2 = X ⊕ M2 , where M2 ∼ Bern(RX→Y2 (µ2 )) is independent of X. Lemma 2. Binary source X with mixed BEC/BSC hidden variables as described above is always successively refinable for the L-layer IB problem if RX→Y1 (µ1 ) ≥ · · · ≥ RX→YL (µL ) and µl ≤ I(X; Yl ). Proof. The proof follows the same arguments as in the proof of Lemma 1. (8b) (8c) (8d) (8e) where (8d) follows from the conditional Entropy Power Inequality (EPI) (Section 2.2 in [16]). We can also obtain an outer bound on RX→Yl (µl ): RX→Yl (µl ) ≥ (7d) (7e) (8a) 22µl σx2 1 log 2 2 − 22µl σ 2 , 2 σx + σN Nl l (9) by setting Ul∗ = X + Pl , Pl ∼ N (0, σP2 l ), l = 1, ..., L, where σP2 l is given by: σP2 l = 2πeσx2 − 22RX→Yl (µl ) . 2πe(22RX→Yl (µl ) − 1) (10) Lemma 3. Gaussian sources as described above are always successively refinable for the L-layer IB problem if RX→Y1 (µ1 ) ≥ · · · ≥ RX→YL (µL ) and µl ≤ 1 2 log 2 2 2πe(σx +σN ) l 2 +1 2πeσN , for l = 1, ..., L. l D. Counterexample on successive refinability In this section, we show that the multi-layer IB problem is not always successively refinable. We consider a two-layer IB problem, i.e., L = 2. Let X = (X1 , X2 ), where X1 and X2 are two independent discrete random variables, and we have Y1 = X1 and Y2 = X2 . We first derive the rate-relevance function RX→Y1 (µ1 ). Denote by U1 any random variable such that I(Y1 ; U1 ) ≥ µ1 , U1 − X − Y1 . We have: I(X; U1 ) = I(X1 , X2 ; U1 ) ≥ I(X1 ; U1 ) ≥ µ1 . By setting U1∗ as ( µ1 X1 , with probability H(X , ∗ 1) U1 = µ1 0, with probability 1 − H(X1 ) , (11a) (11b) (11c) (12) we have I(Y1 ; U1∗ ) = I(X1 ; U1∗ ) = µ1 , and I(X; U1∗ ) = µ1 , which achieves the lower bound shown in (11). We can conclude that RX→Y1 (µ1 ) = µ1 , and any rate-relevance function achieving random variable U1∗ should satisfy I(X2 ; U1∗ |X1 ) = 0, since I(X; U1∗ ) = I(X1 ; U1∗ ) + I(X2 ; U1∗ |X1 ) = µ1 and I(X1 ; U1∗ ) = µ1 . Similarly, we can conclude that RX→Y2 (µ2 ) = µ2 , and any rate-relevance function achieving random variable U2∗ should satisfy I(X1 ; U2∗ |X2 ) = 0. Lemma 4. Source X with hidden variables Y1 and Y2 as described above is not successively refinable for the two-layer IB problem. Proof. For any rate-relevance function achieving random variables U1∗ and U2∗ , we have I(U2∗ ; X|U1∗ ) = I(U2∗ ; X1 , X2 |U1∗ ) = ≥ = = ≥ I(U2∗ ; X2 |U1∗ ) + I(U2∗ ; X1 |U1∗ , X2 ) I(U2∗ ; X2 |U1∗ ) I(U1∗ , U2∗ ; X2 ) − I(U1∗ ; X2 ) I(U2∗ ; X2 ) + I(U1∗ ; X2 |U2∗ ) I(U2∗ ; X2 ) ≥ µ2 , (13a) (13b) (13c) (13d) (13e) (13f) where (13e) is due to I(U1∗ ; X2 ) = 0, which follows from I(X1 ; X2 |U1∗ ) = I(X1 , U1∗ ; X2 ) = I(X2 ; X1 ) + = −I(U1∗ ; X2 ). − I(U1∗ ; X2 ) I(X2 ; U1∗ |X1 ) − (14a) I(U1∗ ; X2 ) (14b) (14c) If µ2 > 0, I(U2∗ ; X|U1∗ ) > 0, which implies U2∗ , U1∗ and X cannot form a Markov chain for any rate-relevance function achieving random variables U1∗ and U2∗ . With Theorem 2, we have proven Lemma 4. V. C ONCLUSION The multi-layer IB problem with non-identical relevant variables was investigated. A single-letter expression of the rate-relevance region was given. The definition and conditions of successive refinability were presented, which was further investigated for the binary sources and Guassian sources. A counterexample of successive refinability was also proposed. R EFERENCES [1] N. Tishby, F. C. Pereira, and W. Bialek, “The information bottleneck method,” in Proc. of Annu. Allerton Conf. Commun., Contr. Comput., Monticello, IL, Sep. 1999, pp. 368–377. [2] N. Slonim and N. Tishby, “Document clustering using word clusters via the information bottleneck method,” in Proc. of Annu. Conf. Research and Development in inform. retrieval, Athens, Greece, 2000, pp. 208– 215. [3] J. Goldberger, H. Greenspan, and S. Gordon, “Unsupervised image clustering using the information bottleneck method,” in Joint Pattern Recog. Symp., Zurich, Switzerland, Sep. 2002, pp. 158–165. [4] Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, May 2015. [5] N. Tishby and N. Zaslavsky, “Deep learning and the information bottleneck principle,” in 2015 IEEE Information Theory Workshop (ITW), April 2015, pp. 1–5. [6] R. Gilad-Bachrach, A. Navot, and N. Tishby, “An information theoretic tradeoff between complexity and accuracy,” in Proc. of Conf. Learning Theory (COLT), Washington, Aug. 2003, pp. 595–609. [7] R. Dobrushin and B. Tsybakov, “Information transmission with additional noise,” IRE Transactions on Information Theory, vol. 8, no. 5, pp. 293–304, September 1962. [8] M. Vera, L. R. Vega, and P. Piantanida, “Collaborative representation learning,” CoRR, vol. abs/1604.01433, 2016. [Online]. Available: http://arxiv.org/abs/1604.01433 [9] G. Pichler, P. Piantanida, and G. Matz, “Distributed informationtheoretic biclustering,” in 2016 IEEE International Symposium on Information Theory (ISIT), July 2016, pp. 1083–1087. [10] G. Katz, P. Piantanida, and M. Debbah, “Distributed binary detection with lossy data compression,” IEEE Transactions on Information Theory, vol. PP, no. 99, pp. 1–1, 2017. [11] J. G. F. Willems, T. Kalker and J.-P. Linnartz, “Successive refinement for hypothesis testing and lossless one-helper problem,” p. 82, Jun. 2003. [12] E. Tuncel, “Capacity/storage tradeoff in high-dimensional identification systems,” IEEE Trans. Inform. Theory, no. 5, 2009. [13] E. Tuncel and D. Gunduz, “Identification and lossy reconstruction in noisy databases,” IEEE Trans. Inform. Theory, no. 2, 2014. [14] C. Tian and J. Chen, “Successive refinement for hypothesis testing and lossless one-helper problem,” IEEE Trans. Inform. Theory, vol. 54, no. 10, pp. 4666–4681, 2008. [15] J. Villard and P. Piantanida, “Secure multiterminal source coding with side information at the eavesdropper,” IEEE Trans. Inform. Theory, vol. 59, no. 6, pp. 3668–3692, 2013. [16] A. E. Gamal and Y. H. Kim, Network Information Theory. New York, NY, USA: Cambridge University Press, 2012. A PPENDIX A ACHIVABILITY OF T HEOREM 1 Consider first the direct part, i.e., every tuple (R1 , . . . , RL , µ1 , . . . , µL ) ∈ R is achievable. Code generation. Fix a conditional probability mass function (pmf) p(u1 , . . . , uL |x) such that µl ≤ I(Yl ; Ul , . . . , UL ), for l = 1, . . . , L. First randomly generate 2nRL sequences unL (iL ), iL = [1 : 2nRL ], independent and identically distributed (i.i.d.) according to p(uL ); then for each unL (iL ) randomly generate 2(RL−1 −RL ) sequences unL−1 (iL , iL−1 ), iL−1 = [1 : 2n(RL−1 −RL ) ], conditionally i.i.d. according to p(uL−1 |uL ); and continue in the same manner, for each unL−j+1 (iL−j+1 ) randomly generate 2(RL−j −RL−j+1 ) sequences unL−j (iL , . . . , iL−j ), iL−j = [1 : 2n(RL−j −RL−j+1 ) ], conditionally i.i.d. according to p(uL−j |uL−j+1 , . . . , uL ), for j = [2 : L]. Encoding and Decoding After observing xn , the first encoder finds an index tuple (i1 , . . . , iL ) such that (xn , un1 (iL , . . . , i1 ), un2 (iL , . . . , i2 ), . . . , unL (iL )) is in the set Tn (X, U1 , . . . , UL ), which is the set of  jointly typical n vectors of random variables X, U1 , . . . , UL . If more than one such tuple exist, any one of them is selected. If no such tuple exists, we call it an error, and set (i1 , . . . , iL ) = (1, . . . , 1). Then the jth encoder outputs (ij , . . . , iL ), for j = 1, . . . , L, and sends to the j + 1 encoder, if j < L, the index tuple (ij , . . . , iL ) at a total rate of Rj . Given the index tuple (ij , . . . , iL ), the jth decoder declares un1 (iL , . . . , ij ) as its output, for j = 1, . . . , L. Relevance. First, we note that if there is no error in the encoding step, i.e., an index tuple (i1 , . . . , iL ) such that (xn , un1 (iL , . . . , i1 ), un2 (iL , . . . , i2 ), . . . , unL (iL )) ∈ Tn (X, U1 , . . . , U2 ) is found, then the relevance condition µl ≤ I(Y ; Ul , . . . , UL ), ∀ l = 1, . . . , L, is satisfied by the definition of Tn (X, U1 , . . . , UL ) and the Markov lemma. Then we focus on the analysis of the probability of error, i.e., the probability that such an index tuple cannot be found in the encoding step. An error occurs if one of the following events happens: E0 : xn ∈ / Tn (X); By setting ULi , (ZL , X i−1 ), and Uli , Zl , for i = [1 : n] and l = [1 : L − 1], where X i−1 = (X1 , . . . , Xi−1 ), we have nRl ≥ I(Zl , . . . , ZL ; X n ) n X = I(Uli , . . . , ULi ; Xi ) = nI(Ul , . . . , UL ; X), nµl ≤ I(Yln ; Zl ) n X = I(Yl,i ; Zl , ..., ZL , Yli−1 ) ≤ (15b) ≥ I(X; UL−l+1 |UL−l+2 , . . . , UL ), (16a) (16b) Next, we prove that every achievable tuple (R1 , . . . , RL , µ1 , . . . , µL ) must belong to R. The system achieving (R1 , . . . , RL , µ1 , . . . , µL ) is specified by the encoding functions {f1 , . . . , fL }, i.e., (17a) (17b) such that 1 log |Zl |; n 1 µl ≤ I(Yln ; Zl ), for l = 1, . . . , L. n Rl ≥ I(Yl,i ; Zl , ..., ZL , X i−1 ) (20d) (20e) (20f) (20g) where (20c) is due to the non-negativity of mutual information; and (20f) follows since Yl,i −− Zl , ..., ZL , X i−1 −− Yli−1 form a Markov chain, which can be proven as follows: I(Yl,i ; Yli−1 |Zl , ..., ZL , X i−1 ) = I(Yl,i ; Yli−1 |Zl , X i−1 ) = I(Yl,i , Zl ; Yli−1 |X i−1 ) − I(Zl ; Yli−1 |X i−1 ) I(Yl,i ; Yli−1 |X i−1 ) + I(Zl ; Yli−1 |X i−1 , Yl,i ) (21a) (21b) = 0, (21c) where I(Zl ; Yli−1 |X i−1 ) ≤ I(Zl−1 ; Yli−1 |X i−1 ) I(Z1 ; Yli−1 |X i−1 ) ≤ I(X n ; Yli−1 |X i−1 ) = 0, and, I(Zl ; Yli−1 |X i−1 , Yl,i ) = 0. A PPENDIX B C ONVERSE OF T HEOREM 1 l = 2, . . . , L, (20c) = nI(Yl ; Ul , ..., UL ), (15c) = fl : Zl−1 → Zl , I(Yl,i ; Zl , ..., ZL , Yli−1 , X i−1 ) i=1 for l = [1 : L]. f1 : X n → Z1 ; i=1 n X (20b) + I(Yl,i ; Yli−1 |Zl , ..., ZL , X i−1 ) n X = I(Yl,i ; Uli , ..., ULi ) n→∞ P(El ) → 0, if RL−l+1 − RL−l+2 = i=1 n X (20a) i=1 for l = 2, . . . , L. It is clear that P(E0 ) → 0 as n → ∞. Based on the properties of typical sequences: n→∞ (19c) where (19a) is due to the fact that Zl+1 , . . . , ZL are all deterministic function of Zl ; (19b) follows from the definitions of Uli , . . . , ULi ; and (19c) follows by defining Ul = (UlJ , J), . . . , UL = (ULJ , J), where J is a random variable independent of all other random variables, and uniformly distributed over the set {1, . . . , n}. We can also write n P(E1 ) → 0, if RL ≥ I(X; UL ); (19b) i=1 (15a) E1 : x ∈ Tn (X), (xn , unL (iL )) ∈ / Tn (X, UL ), for all iL = 1, . . . , 2RL ; El : (xn , unL−l+2 (iL−l+2 ), . . . , unL (iL )) ∈ Tn (X, UL−l+2 , . . . , UL ), (xn , unL−l+1 (iL−l+1 ), . . . , unL (iL )) ∈ / Tn (X, UL−l+1 , . . . , UL ), for all iL−l+1 = 1, . . . , 2RL−l+1 −RL−l+2 ; (19a) (18a) (18b) ≤ ··· ≤ similarly,
7cs.IT
ON MAXIMAL GREEN SEQUENCES FOR TYPE A QUIVERS arXiv:1403.6149v3 [math.CO] 18 May 2016 ALEXANDER GARVER AND GREGG MUSIKER Abstract. Given a framed quiver, i.e. one with a frozen vertex associated to each mutable vertex, there is a concept of green mutation, as introduced by Keller. Maximal sequences of such mutations, known as maximal green sequences, are important in representation theory and physics as they have numerous applications, including the computations of spectrums of BPS states, Donaldson-Thomas invariants, tilting of hearts in derived categories, and quantum dilogarithm identities. In this paper, we study such sequences and construct a maximal green sequence for every quiver mutation-equivalent to an orientation of a type A Dynkin diagram. Contents 1. Introduction 2. Preliminaries and Notation 3. Direct Sums of Quivers 4. Quivers Arising from Triangulated Surfaces 5. Signed Irreducible Type A Quivers 6. Associated Mutation Sequences 6.1. Definition of Associated Mutation Sequences 7. Proof of Theorem 6.5 8. Additional Questions and Remarks 8.1. Maximal Green Sequences for Quivers Arising from Surface Triangulations 8.2. Trees of Cycles 8.3. Enumeration of Maximal Green Sequences 8.4. Further Study of Maximal Green Sequences References 1 3 4 9 11 14 14 19 28 28 33 33 34 34 1. Introduction A very important problem in cluster algebra theory, with connections to polyhedral combinatorics and the enumeration of BPS states in string theory, is to determine when a given quiver has a maximal green sequence. In particular, it is open to decide which quivers arising from triangulations of surfaces admit a maximal green sequence, although progress for surfaces has been made in [17], [7], [8] and in the physics literature in [1]. In [1], they give heuristics for exhibiting maximal green sequences for quivers arising from triangulations of surfaces with boundary and present examples of this for spheres with at least 4 punctures and tori with at least 2 punctures. They write down a particular triangulation of such a surface and show that the quiver defined by this triangulation has a maximal green sequence. In [7, 8], this same approach is used on surfaces of any genus with at least 2 punctures. In [17], it is shown that there do not exist maximal green sequences for a quiver arising from any triangulation of a closed once-punctured genus g surface. It is still unknown the exact set of surfaces with the property that each of its triangulations defines a quiver admitting a maximal green sequence. Outside the class of quivers defined by triangulated surfaces there has also been progress in proving that certain quivers do not have maximal green sequences. In [5], it is shown that if a quiver has non-degenerate Jacobi-infinite potential, then the quiver has no maximal green sequences. This is used in [5] to show that a certain McKay quiver has no maximal green sequences, and in [22] it is shown that the X7 quiver has no maximal green sequences. Other work [18] illustrates that it is possible to have two mutation-infinite quivers that are mutation equivalent to one another where only one of the two admits a maximal green sequence. Even for cases where the existence of maximal green sequences is known (e.g. for quivers of type A), the problem of exhibiting, classifying or counting maximal green sequences has been challenging and serves as our motivation. By a quiver of type A, we mean any quiver that is mutation-equivalent to an orientation of a type 1 A Dynkin diagram. In the case where Q is acyclic, one can find a maximal green sequence whose length is the number of vertices of Q, by mutating at sources and iterating until all vertices have been mutated exactly once. In general, maximal green sequences must have length at least the number of vertices of Q. However, even for the smallest non-acyclic quiver, i.e. the oriented 3-cycle (of type A3 ), a shortest maximal green sequence is of length 4. (While we were in the process of revising this paper, it was shown in [9] that the shortest possible length of a maximal green sequence for a quiver Q of type An is n ` t where t “ #t3-cycles of Qu. See Remark 6.7 and Sections 8.1 and 8.3 for more details.) With a goal of gaining a better understanding of such sequences, in this paper we explicitly construct a maximal green sequence for every quiver of type A. As any triangulation of the disk with n ` 3 marked points on the boundary defines a quiver of type An , our construction shows that the disk belongs to the set of surfaces each of whose triangulations define a quiver admitting a maximal green sequence. We remark that the latter result has also been proved in [9] by constructing maximal green sequences of type An quivers of shortest possible length. Additionally, the maximal green sequences constructed in [9] are almost never the same as the maximal green sequences constructed in this paper. In Section 2, we begin with background on quivers and their mutations. This section includes the definition of maximal green sequences, which is our principal object of study in this paper. Section 3 describes how to decompose quivers into direct sums of strongly connected components, which we call irreducible quivers. We remark that this definition of direct sum of quivers, which is based on a quiver gluing rule from [1], coincides with the definition of a triangular extension of quivers appearing in [2]. Using this notion of direct sums in Theorem 3.12, we show that for certain direct sums of quivers, to construct a maximal green sequence, it suffices to construct a maximal green sequence for each of their irreducible components. We refer to the class of such quivers for which Theorem 3.12 holds as t-colored direct sums of quivers (see Definition 3.1). In Section 4, we show that almost all quivers arising from triangulated surfaces (with 1 connected component) which are a direct sum of at least 2 irreducible components are in fact a t-colored directed sum. For type A quivers, irreducible quivers have an especially nice form as trees of 3-cycles, as described by Corollary 5.2. This allows us to restrict our attention to signed irreducible quivers of type A, which are defined in and studied in Section 5. We then construct a special mutation sequence for every signed irreducible quiver of type A in Section 6, which we call an associated mutation sequence. This brings us to the main theorem of the paper, Theorem 6.5, which states that this associated mutation sequence is a maximal green sequence. Section 6 also highlights how the results of Section 3 can be combined with Theorem 6.5 to get maximal green sequences for any quiver of type A (see Corollary 6.8). The proof of Theorem 6.5 is somewhat involved. The proof of Theorem 6.5 essentially follows from two important lemmas (see Lemma 7.2 and Lemma 7.3). Our proof begins by attaching frozen vertices to a signed p (see Section 2 for more details). We then apply the irreducible type A quiver Q to get a framed quiver Q associated mutation sequence µ alluded to above, which is constructed in Section 6, but decompose it into certain subsequences as µ “ µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 and apply each mutation subsequence µk one after the other. In Lemma 7.2 we explicitly describe, for the resulting intermediate quivers, the full subquiver that will be affected by the p affected by µ as Rk . next iteration of mutations µk . We will refer to this full subquiver of µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq k Lemma 7.3 then explicitly describes how each of these full subquivers, Rk , is affected by the mutation sequence µk . Together these lemmas lead us to conclude that the associated mutation sequence µ “ µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 is a maximal green sequence. p is isomorphic (as a directed Furthermore, these two lemmas imply that the final quiver µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq q the co-framed quiver where the directions of arrows between vertices of Q and frozen vertices have all graph) to Q, been reversed. In particular, such an isomorphism is known as a frozen isomorphism since it permutes the vertices of Q while leaving the frozen vertices fixed. We refer to this permutation, of vertices of Q, as the permutation induced by a maximal green sequence (we refer the reader to Section 2 for precise definitions of these notions). One of the benefits of proving Theorem 6.5 using the two lemmas mentioned in the previous paragraph is that we exactly describe the permutation that is induced by an associated mutation sequence of a signed irreducible quiver of type A. (See the last paragraph in Section 2 and Definition 7.1.) This is a result that may be of independent interest. Finally, Section 8 ends with further remarks and ideas for future directions, including extensions to quivers arising from triangulations of surfaces other than the disk with marked points on the boundary. Acknowledgements. The authors would like to thank T. Brüstle, M. Del Zotto, B. Keller, S. Ladkani, R. Patrias, V. Reiner, and H. Thomas for useful discussions. We also thank the referees for their careful reading 2 ; ;2 pQ, F q = # 2c ;3 1 µ 2 ÞÝÑ 4 1 {{ // ;3 = pµ2 Q, F q 4 Figure 1. An example of quiver mutation. and numerous suggestions. The authors were supported by NSF Grants DMS-1067183, DMS-1148634, and DMS1362980. 2. Preliminaries and Notation The reader may find excellent surveys on the theory of cluster algebras and maximal green sequences in [5, 14]. For our purposes, we recall a few of the relevant definitions. A quiver Q is a directed graph without loops or 2-cycles. In other words, Q is a 4-tuple ppQq0 , pQq1 , s, tq, where pQq0 “ rM s :“ t1, 2, . . . , M u is a set of vertices, pQq1 is a set of arrows, and two functions s, t : pQq1 Ñ pQq0 α are defined so that for every α P pQq1 , we have spαq Ý Ñ tpαq. An ice quiver is a pair pQ, F q with Q a quiver and F Ă pQq0 frozen vertices with the additional restriction that any i, j P F have no arrows of Q connecting them. We refer to the elements of pQq0 zF as mutable vertices. By convention, we assume pQq0 zF “ rN s and F “ rN ` 1, M s :“ tN ` 1, N ` 2, . . . , M u. Any quiver Q can be regarded as an ice quiver by setting Q “ pQ, Hq. The mutation of an ice quiver pQ, F q at a mutable vertex k, denoted µk , produces a new ice quiver pµk Q, F q by the three step process: (1) For every 2-path i Ñ k Ñ j in Q, adjoin a new arrow i Ñ j. (2) Reverse the direction of all arrows incident to k in Q. (3) Delete any 2-cycles created during the first two steps. We show an example of mutation in Figure 1 depicting the mutable (resp. frozen) vertices in black (resp. blue). Since we will focus on quiver mutation in this paper, it will be useful to define a notation for arrows obtained α by reversing their direction. Given α P pQq1 where spαq Ñ tpαq, formally define αop to be the arrow where spαop q “ tpαq and tpαop q “ spαq. With this notation, step (2) in the definition of mutation can be rephrased as: if α P pQq1 and spαq “ k or tpαq “ k, replace α with αop . The information of an ice quiver can be equivalently described by its (skew-symmetric) exchange matrix. α Given pQ, F q, we define B “ BpQ,F q “ pbij q P ZN ˆM :“ tN ˆ M integer matricesu by bij :“ #tpi Ñ jq P α pQq1 u ´ #tpj Ñ iq P pQq1 u. Furthermore, ice quiver mutation can equivalently be defined as matrix mutation of the corresponding exchange matrix. Given an exchange matrix B P ZN ˆM , the mutation of B at k P rN s, also denoted µk , produces a new exchange matrix µk pBq “ pb1ij q with entries " ´bij : if i “ k or j “ k b1ij :“ bij ` sgnpbik qrbik bkj s` : otherwise where rxs` “ maxpx, 0q. For example, the mutation of the ice quiver above (here M “ 4 and N “ 3) translates into the following matrix mutation. Note that mutation of matrices (or of ice quivers) is an involution (i.e. pµk ˝ µk qpBq “ B). fi » fi » 0 ´2 2 0 0 0 2 0 µ2 0 fl ÞÝÑ – 2 0 ´1 0 fl “ Bpµ2 Q,F q . BpQ,F q “ – ´2 0 1 0 ´1 0 ´1 ´2 1 0 ´1 In this paper, we focus on successively applying mutations to a fixed ice quiver. As such, if pQ, F q is a given ice quiver we define an admissible sequence of pQ, F q, denoted i “ pi1 , . . . , id q, to be a sequence of mutable vertices of pQ, F q such that ij ‰ ij`1 for all j P rd ´ 1s. An admissible sequence i “ pi1 , . . . , id q also gives rise to a mutation sequence, which we define to be an expression µ “ µid ˝ ¨ ¨ ¨ ˝ µi1 with ij ‰ ij`1 for all j P rd ´ 1s that maps an ice quiver pQ, F q to a mutation-equivalent one1. Let Mut(pQ, F q) denote the collection of ice quivers obtainable from pQ, F q by a mutation sequence of finite length where the length of a mutation sequence is defined to be d, the number of vertices appearing in the associated admissible sequence i “ pi1 , . . . , id q. Given 1In the sequel, we will identify an admissible sequence with the mutation sequence it defines. 3 p we define the support of ν, denoted supppνq, to be the set of mutable a mutation sequence ν of Q P MutpQq vertices of Q appearing in the admissible sequence which gives rise to ν. Given a quiver Q, we focus on successively mutating the framed quiver of Q, which we now define. Following references such as [5, Section 2.3], given a quiver Q, we define its framed (resp. coframed) quiver to be the ice p (resp. Q) q where pQq p 0 p“ pQq q 0 q :“ pQq0 \ rN ` 1, 2N s, F “ rN ` 1, 2N s, and pQq p 1 :“ pQq1 \ ti Ñ N ` i : quiver Q q p by Q. In the sequel, i P rN su (resp. pQq1 :“ pQq1 \ tN ` i Ñ i : i P rN su). We will denote elements of Mut(Q) p as i1 . Thus F “ rN s1 where S 1 :“ tx1 : x P Su for any we will often write frozen vertices N ` i of Q P Mut(Q) p up to frozen isomorphism (i.e. an isomorphism S Ă pQq0 . In this paper, we consider ice quivers Q P MutpQq of quivers that fixes frozen vertices). Such an isomorphism is equivalent to a simultaneous permutation of the rows and of the first N columns of the exchange matrix BQ . p is said to be green (resp. red) if all arrows of Q connecting A mutable vertex i of an ice quiver Q P MutpQq 1 p are green and all an element of rN s and i point away from (resp. towards) i. Note that all mutable vertices of Q q vertices of Q are red. By the Sign-Coherence of c- and g-vectors for cluster algebras [10, Theorem 1.7], it follows p each mutable vertex of Q is either red or green. that given any Q P MutpQq p Define tQpkqu0ďkďd to be the sequence of ice quivers Let µ “ µid ˝ ¨ ¨ ¨ ˝ µi1 be a mutation sequence of Q. p and Qpjq :“ pµi ˝ ¨ ¨ ¨ ˝ µi qpQq. p (In particular, throughout this paper, we apply any sequence where Qp0q :“ Q j 1 of mutations in order from right-to-left.) A green sequence of Q is an admissible sequence i “ pi1 , i2 , . . . id q of p such that ij is a green vertex of Qpj ´ 1q for each 1 ď j ď d. The admissible sequence i is a maximal green Q sequence of Q if it is a green sequence of Q such that in the final quiver Qpdq, the vertices 1, 2, . . . , N are all red2. In other words, Qpdq contains no green vertices. Following [5], we let greenpQq denote the set of maximal green sequences of Q3. Proposition 2.10 of [5] shows that given any maximal green sequence µ of Q, one has a frozen isomorphism q Such an isomorphism amounts to a permutation of the mutable vertices of Q, q (i.e. Qpdq “ Qσ | for some Qpdq – Q. | permutation σ P SN where Qσ is defined by the exchange matrix Bσ “ BQq σ that has entries pBσqi,j “Bi¨σ,j¨σ ). We call this the permutation induced by µ. Note that we can regard σ as an element S2N where i ¨ σ “ i for any i P rN ` 1, 2N s. 3. Direct Sums of Quivers In this section, we define a direct sum of quivers based on notation appearing in [1, Section 4.2]. We also show that, under certain restrictions, if a quiver Q can be written as a direct sum of quivers where each summand has a maximal green sequence, then the maximal green sequences of the summands can be concatenated in some way to give a maximal green sequence for Q. Throughout this section, we let pQ1 , F1 q and pQ2 , F2 q be finite ice quivers with N1 and N2 vertices, respectively. Furthermore, we assume pQ1 q0 zF1 “ rN1 s and pQ2 q0 zF2 “ rN1 `1, N1 `N2 s. Definition 3.1. Let pa1 , . . . , ak q denote a k-tuple of elements from pQ1 q0 zF1 and pb1 , . . . , bk q a k-tuple of elements from pQ2 q0 zF2 . (By convention, we assume that the k-tuple pa1 , . . . , ak q is ordered so that ai ď aj if i ă j unless stated otherwise.) Additionally, let pR1 , F1 q P MutppQ1 , F1 qq and pR2 , F2 q P MutppQ2 , F2 qq. We define the direct pb ,...,b q sum of pR1 , F1 q and pR2 , F2 q, denoted pR1 , F1 q ‘pa11 ,...,akk q pR2 , F2 q, to be the ice quiver with vertices ´ ¯ pb ,...,b q pR1 , F1 q ‘pa11 ,...,akk q pR2 , F2 q :“ pR1 q0 \ pR2 q0 “ pQ1 q0 \ pQ2 q0 “ rN1 ` N2 s \ F1 \ F2 0 and arrows ´ ¯ ! ) α pb ,...,b q pR1 , F1 q ‘pa11 ,...,akk q pR2 , F2 q :“ pR1 , F1 q1 \ pR2 , F2 q1 \ ai Ñi bi : i P rks . 1 Observe that we have the identification of ice quivers { pb ,...,b q x1 ‘pb1 ,...,bk q Q x2 , Q1 ‘pa11 ,...,akk q Q2 – Q pa1 ,...,ak q where the total number of vertices M “ 2pN1 ` N2 q in both cases. 2Note that since we identify an admissible sequence with the mutation sequence defined by it, we have that maximal green sequences are identified with maximal green mutation sequences, as they are referred to in [19]. 3By identifying maximal green sequences with maximal green mutation sequences, we abuse notation and write an element of greenpQq either as an admissible sequence i “ pi1 , . . . , id q or as its corresponding mutation sequence µ “ µid ˝ ¨ ¨ ¨ ˝ µi1 . 4 25g 76 G1 7g  2W 4  /* 8 3 29w O  ' 10 ,  11 w Figure 2. The quiver Q used in Example 3.5. pb ,...,b q We say that pR1 , F1 q ‘pa11 ,...,akk q pR2 , F2 q is a t-colored direct sum if t “ #tdistinct elements of ta1 . . . , ak uu and there does not exist i and j such that α #tai Ñ bj u ě 2. Remark 3.2. Our definition of the direct sum of two quivers coincides with the definition of a triangular extension of two quivers introduced by C. Amiot in [2], except that we consider quivers as opposed to quivers with potential. We thank S. Ladkani for bringing this to our attention. He uses this terminology to study the representation theory of a related class of quivers with potential, called class P by M. Kontsevich and Y. Soibelman [16, Section 8.4]. Remark 3.3. The direct sum of two ice quivers is a non-associative operation as is shown in Example 3.5. Definition 3.4. We say that a quiver Q is irreducible if pb ,...,b q Q “ Q1 ‘pa11 ,...,akk q Q2 for some k-tuple pa1 . . . , ak q on pQ1 q0 and some k-tuple pb1 , . . . , bk q on pQ2 q0 implies that Q1 or Q2 is the empty quiver. Note that we define irreducibility only for quivers rather than for ice quivers because we later only study reducibility when F “ H. Example 3.5. Let Q denote the quiver shown in Figure 2. Define Q1 to be the full subquiver of Q on the vertices 1, . . . , 4, Q2 to be the full subquiver of Q on the vertices 6, . . . , 11, and Q3 to be the full subquiver of Q on the vertex 5. Note that Q1 , Q2 , and Q3 are each irreducible. Then p5,8,11,8,9,11q Q “ Q1 ‘p1,1,1,3,4,4q Q23 p5q where Q23 “ Q2 ‘p6q Q3 so Q is a 3-colored direct sum. On the other hand, we could write p5,5q Q “ Q12 ‘p1,6q Q3 p8,11,8,9,11q Q2 so Q is a 2-colored direct sum. Additionally, note that ¯ ´ ¯ ´ p5,8,11,8,9,11q p5q p5,8,11,8,9,11q p5,8,11,8,9,11q p5q Q1 ‘p1,1,1,3,4,4q Q23 “ Q1 ‘p1,1,1,3,4,4q Q2 ‘p6q Q3 ‰ Q1 ‘p1,1,1,3,4,4q Q2 ‘p6q Q3 where Q12 “ Q1 ‘p1,1,3,4,4q p5,8,11,8,9,11q where the last equality does not hold because Q1 ‘p1,1,1,3,4,4q Q2 is not defined as 5 is not a vertex of Q2 . This shows that the direct sum of two quivers, in the sense of this paper, is not associative. Our next goal is to prove that Q has a maximal green sequence if Q is a t-colored direct sum and each of its summands has a maximal green sequence (see Proposition 3.12). Before proving this, we introduce a standard form of t-colored direct sums of ice quivers with which we will work: p1q (1) pR, F q “ p1q ptq ptq x1 ‘pb1 ,...,br1 ,...,b1 ,...,brt q Q2 Q pa1 ,...,a1 ,...,at ,...,at q 5 p1q p1q ptq ptq x2 q, a1 , . . . , at P pQ1 q0 zrN1 s1 , b , . . . , br1 , . . . , b , . . . , brt P pQ2 q0 zrN2 s1 , and µ is a fixed where Q2 P MutpQ 1 1 mutation sequence µid ˝ ¨ ¨ ¨ ˝ µi1 where supppµq Ă pQ1 q0 . We consider the sequence of mutated quivers pRpkq , F q, for each k P r0, ds, where Rpkq :“ µik ˝ ¨ ¨ ¨ ˝ µi1 R. By convention, k “ 0 implies that the empty mutation sequence has been applied to pR, F q so Rp0q “ R. For every p 1 q and the following set of arrows k P r0, ds, we define Q1 pkq :“ pµik ˝ ¨ ¨ ¨ ˝ µi1 qpQ " * spαq or tpαq P pQ1 pkqq0 zrN1 s1 and the other end of pkq Apkq :“ α P pR , F q1 : . p1q p1q ptq ptq α is in ta11 , . . . , a1t u Y tb1 , . . . , br1 , . . . , b1 , . . . , brt u Observe that the sets Apkq only contain arrows in the partially mutated quivers which have exactly one of their two ends incident to a vertex in pQ1 q0 . The next lemma illustrates how the set of arrows Apk ´ 1q transforms into the set Apkq. α α α Lemma 3.6. If pi Ñ jq P Apkq, but α, αop R Apk ´ 1q, then there is a 2-path i Ñ1 ik Ñ2 j in pRpk´1q , F q and exactly one of the arrows α1 , α2 P pRpk´1q , F q1 belongs to Apk ´ 1q. α Proof. By the definition of quiver mutation, the arrow pi Ñ jq P Apkq Ă pRpkq , F q1 “ pµik Rpk´1q , F q1 was originally in Apk ´ 1q, was the reversal of an arrow originally in Apk ´ 1q, or resulted from a 2-path. By hypothesis, we must be in the last case. By the definition of Apkq, either the source or target of α is in α α pQ1 pkqq0 zrN11 s but not both. Hence the 2-path i Ñ1 ik Ñ2 j must contain one arrow from pQ1 pkqq0 zrN11 s to itself and one arrow in Apk ´ 1q.  In the context of this lemma, we refer to this unique arrow in Apk ´ 1q as α. We use Lemma 3.6 to define a coloring function to stratify the set of arrows Apkq. This will allow us to keep track of their orientations as will be needed to prove a crucial lemma (see Lemma 3.10). Definition 3.7. Let pR, F q be a t-colored direct sum with a direct sum decomposition of the form shown in (1) and let µ be a mutation sequence where supppµq Ă pQ1 q0 . Define a coloring function by f 0 : Ap0q ÝÑ α Ý Þ Ñ ta1 , . . . , at u spαq. We say that α P Ap0q has color f 0 pαq in pR, F q. Now, inductively we define a coloring function on each ice quiver pRpkq , F q where k P r0, ds. Define f k : Apkq Ñ ta1 , . . . , at u by $ & f k´1 pαq : if α, αop R Apk ´ 1q k f k´1 pαop q : if α R Apk ´ 1q, αop P Apk ´ 1q, f pαq “ % f k´1 pαq : if α P Apk ´ 1q. We say that α P Apkq has color f k pαq in pRpkq , F q. Example 3.8. Using the notation from Example 3.5 and writing ´ ¯ p“Q p 1 ‘p5,8,11,8,9,11q Q p 2 ‘p5q Q p3 , Q p1,1,1,3,4,4q p6q p1q p1q p1q p2q p3q p3q we have a1 “ 1 and b1 “ 5, b2 “ 8, b3 “ 11, a2 “ 3 and b1 “ 8, and a3 “ 4 and b1 “ 9, b2 “ 11. In p and µ3 Q. p The label written on an arrow α of Q p or µ3 Q p indicates its color with respect to Figure 3, we show Q Q1 . Our next result shows how the coloring functions tf k u0ďkďd defined by an ice quiver pR, F q of the form in (1) and a mutation sequence µ “ µid ˝ ¨ ¨ ¨ ˝ µi1 partition the arrows connecting a mutable vertex x P pQ1 q0 and a pjq vertex in tbi : i P rrj su \ ta1j u. Lemma 3.9. Let pR, F q be a t-colored direct sum with a direct sum decomposition of the form shown in (1) and let µ be a mutation sequence where supppµq Ă pQ1 q0 . For any k P r0, ds, we have that the coloring function f k is defined on each α P Apkq. Proof. We proceed by induction on k. If k “ 0, no mutations have been applied so the desired result holds. Suppose the result holds for pRpk´1q , F q and we will show that the result also holds for pRpkq , F q. We can write pjq pRpkq , F q “ pµy Rpk´1q , F q for some y P pQ1 q0 . Let α P Apkq such that spαq “ x P pQ1 q0 and tpαq “ z P tbi : i P 1 rrj su \ taj u or vice-versa. There are three cases to consider: 6 / 51 45d 3O 1 1 11 o F1 1 3 21 o  2X  /+ 8 3 3 1 4 o 1 4 4 / 71 7d 1 p = Q  19z O 4 $ * 1 3F z / 111 / 51 11 45d / 61 :6 F1X 1 3 2 o 1 3  o F3 2X  ++ 8 3 1 4 / 71 7d 1 41 o / 101 10 1 3 p = µ3 Q / 81 / 91 4 11 o / 61 :6  4 19z O 4 / 91 $ 4 * 11 / 81 z 10 / 101 / 111 p and µ3 Q p with the coloring functions f 1 and f 2 , respectively. Figure 3. The quivers Q aq x “ y, bq x is connected to y and there is a 2-path x Ñ y Ñ z or x Ð y Ð z in pRpk´1q , F q, cq x does not satisfy aq or bq. In Case a), we have that all arrows α P Apk ´ 1q connecting x and z are replaced by αop P Apkq. By the definition of the coloring functions, these reversed arrows obtain color f k pαq “ f k´1 pαop q. In Case b), it follows by Lemma 3.6 that an arrow α P Apkq resulting from mutation of the middle of a 2-path has a well-defined color given by f k´1 pαq. Further, mutation at y would reverse both arrows of such a 2-path hence vertex y is in the middle of a 2-path in Apkq if and only if it is in the middle of a 2-path in Apk ´ 1q. Finally, in Case c), the mutation at y does not affect the arrows α connecting x and z and therefore the colors of such an arrow is inherited from its color as an arrow in Apk ´ 1q. Note that an arrow between x and y would connect vertices of pQ1 q0 and thus has no color.  For the proofs in the remainder of this section, we denote the exchange matrix of pRpkq , F q, as BpRpkq ,F q “ α α pbk px, yqqxPrN1 `N2 s,yPr2pN1 `N2 qs . Here bk px, yq :“ #tpx Ñ yq P pRpkq , F q1 u ´ #tpy Ñ xq P pRpkq , F q1 u. (This pjq differs from the notation of Section 2 to differentiate it from our notation for the set of vertices tbi Furthermore, we refine this enumeration according to color using the following terminology. α α : i P rrj su.) bk px, y, `q :“ #tpx Ñ yq P pRpkq , F q1 : α has color `u ´ #tpy Ñ xq P pRpkq , F q1 : α has color `u. We proceed with the following two technical lemmas. 7 Lemma 3.10. Let pR, F q be a t-colored direct sum with a direct sum decomposition of the form shown in (1) and let µ be a mutation sequence of pR, F q where supppµq Ă pQ1 q0 . For any k P r0, ds, ` P rts, and x P pQ1 q0 , all of the arrows of Apkq with color a` and incident to vertex x either all point towards vertex x or all point away from vertex x. Moreover they do so with the same multiplicity. pjq Proof. We need to show that for any x P pQ1 q0 , k P r0, ds, j P rts, and ` P ta1 , . . . , at u we have that bk px, bi , `q “ bk px, a1j , `q for all i P rrj s. We proceed by induction on k. If k “ 0, no mutations have been applied so the desired results holds. Suppose the result holds for pRpk´1q , F q and we will show that the result also holds for pRpkq , F q. pjq We can write pRpkq , F q “ pµy Rpk´1q , F q for some y P pQ1 q0 . Let x P pQ1 q0 and z P tbi : i P rrj su \ ta1j u be given. There are three cases to consider: aq x “ y, bq x is connected to y and sgnpbk´1 px, yqq “ sgnpbk´1 py, zqq ‰ 0, cq x does not satisfy aq or bq. ř ř By Lemma 3.9, we know that bk px, zq “ `Ptai :iPrtsu bk px, z, `q and bk´1 py, zq “ `Ptai :iPrtsu bk´1 py, z, `q. Thus, from the definition of µy and the proof of Lemma 3.9, we have that $ : Case aq & ´bk´1 px, z, `q k bk´1 px, yqbk´1 py, z, `q ` bk´1 px, z, `q : Case bq b px, z, `q “ % k´1 b px, z, `q : Case cq. pjq By induction, each expression on the right hand side of the equality is independent of the choice of z P tbi : pjq i P rrj su \ ta1j u. Thus bk px, z, `q is independent of of the choice of z P tbi : i P rrj su \ ta1j u.  Lemma 3.11. Let pR, F q be a t-colored direct sum with a direct sum decomposition of the form shown in (1), let µ be a mutation sequence of pR, F q where supppµq Ă pQ1 q0 , and let k P r0, ds. In any pRpkq , F q, the arrows incident to the frozen vertex a1i (for all i P rts) have color ai . Proof. Let a1i P ta11 , . . . , a1t u be given. We proceed by induction on k. If k “ 0, no mutations have been applied so the desired result holds. Suppose the result holds pRpk´1q , F q and we will show that the result holds for pRpkq , F q. We can write pRpkq , F q “ pµy Rpk´1q , F q for some y P pQ1 q0 . As y ‰ a1i , there are only two cases to consider: bq a1i is connected to y and there is a 2-path a1i Ñ y Ñ z or a1i Ð y Ð z in pRpk´1q , F q, cq a1i does not satisfy bq. First, in Case b), if there is a 2-path a1i Ñ y Ñ z in pRpk´1q , F q (resp. a1i Ð y Ð z in pRpk´1q , F q), then by induction the arrow pa1i Ñ yq P pRpk´1q , F q1 (resp. pa1i Ð yq P pRpk´1q , F q1 ) has color ai . Thus if there is a 2-path a1i Ñ y Ñ z in pRpk´1q , F q (resp. a1i Ð y Ð z in pRpk´1q , F q), then there is an arrow a1i Ñ z P pRpkq , F q1 (resp. a1i Ð z P pRpkq , F q1 ) of color ai . In Case c), the mutation at y does not affect the arrows α connecting a1i and any vertex z P pRpkq , F q0 . Therefore the color of such an arrow is inherited from its color as an arrow in Apk ´ 1q. By induction, such arrows have color ai .  p is a t-colored direct sum each of whose We now arrive at the main result of this section. It shows that if Q summands has a maximal green sequence, then one can build a maximal green sequence for Q using the maximal green sequences for each of its summands. p1q pb ptq ,...,bp1q ,...,b ,...,bptq rt q 1 1 Theorem 3.12. Let Q “ Q1 ‘pa11 ,...,a1 r,...,a t ,...,at q and µ2 P green pQ2 q, then µ2 ˝ µ1 P green pQq . Q2 be a t-colored direct sum of quivers. If µ1 P green pQ1 q Proof of Theorem 3.12. Let σi denote the permutation of the vertices of Qi induced by µi . Observe that under the identification in Definition 3.1, we let p1q ptq p1q ptq p “ Q x1 ‘pb1 ,...,br1 ,...,b1 ,...,brt q Q x2 . Q pa1 ,...,a1 ,...,at ,...,at q p1q p1q ptq ptq x1 ‘pb1 ,...,br1 ,...,b1 ,...,brt q Q x2 is a t-colored direct sum of the form shown in (1). We also have that Q pa1 ,...,a1 ,...,at ,...,at q p is a s-colored direct sum (for some s). Let µ “ µi ˝ ¨ ¨ ¨ ˝ µi . Since µ P greenpQ1 q, We first show that µ1 Q 1 d 1 1 1 x ~ we have that µ Q1 “ Q1 σ1 and so for each frozen vertex a with j P rts, we obtain that xj :“ aj ¨ σ1 P pQ1 q0 j 1 α p that is connected to a1 by an arrow. Furthemore, pxj Ð a1 q P pµ Qq p 1 is the is the unique mutable vertex of Q j j 1 p connecting these two vertices. unique arrow of µ Q 1 8 ř ~ By Lemma 3.9, for any a1j we have that bd pxj , a1j q “ `Ptai : iPrtsu bd pxj , a1j , `q. Since Q 1 σ1 has no 2-cycles, d 1 d sgnpb pxj , aj , `qq ď 0 for any ` P tai : i P rtsu. By Lemma 3.11, αj has color aj so b pxj , a1j q “ bd pxj , a1j , aj q. By Lemma 3.10, given any xj :“ aj ¨ σ1 P pQ1 q0 we have that bd pxj , zq “ bd pxj , z, aj q “ ´1 for any z P pjq 1 ,...,x1 ,...,xt ,...,xt q ~ p“Q x2 ‘pxp1q tbi : i P rrj su \ ta1j u. Thus we have that µ1 Q ptq Q1 σ1 is a s-colored direct sum where p1q ptq pb1 ,...,br1 ,...,b1 ,...,brt q p1q p1q ptq ptq tb1 , . . . , br1 , . . . , b1 , . . . , brt u is a multiset on pQ2 q0 zF2 (with s distinct elements) and tx1 , . . . , x1 , . . . , xt , . . . , xt u pjq is a multiset on pQ1 q0 zF1 . Note that in this s-colored direct sum, the bi ’s are not necessarily given in increasing order. p is a t-colored direct sum. Since µ Q p is a s-colored direct sum and µ “ Next, we show that µ2 pµ1 pQqq 1 2 p µjd1 ˝ ¨ ¨ ¨ ˝ µj1 is a mutation sequence with supppµ2 q Ă pQ2 q0 , one defines coloring functions tg k u0ďkďd1 on µ1 Q with respect to Q2 in the sense of Definition 3.7. Now an analogous argument to that of the previous two paragraphs shows that p1q ptq p1q ptq py1 ,...,yr ,...,y1 ,...,yrt q 1 ~ p “Q ~ Q µ2 pµ1 pQqq 2 σ2 1 σ1 ‘px1 ,...,x1 ,...,xt ,...,xt q piq piq where yj :“ bj ¨ σ2 with i P rts, j P rri s. One now observes that p1q p1q ptq ptq py1 ,...,yr ,...,y1 ,...,yrt q 1 ~ q p “Q ~ Q pµ2 ˝ µ1 qpQq 2 σ2 – Q 1 σ1 ‘px1 ,...,x1 ,...,xt ,...,xt q p are red. and thus all mutable vertices of pµ2 ˝ µ1 qpQq p along µ ˝ µ takes place at a green vertex. Thus Finally, since µi P greenpQi q for i “ 1, 2, each mutation of Q 2 1  µ2 ˝ µ1 P greenpQq. Remark 3.13. We believe that Theorem 3.12 holds for any quiver that can be realized as the direct sum of two non-empty quivers, but we do not have a proof. 4. Quivers Arising from Triangulated Surfaces In this section, we show that Theorem 3.12 can be applied to quivers that arise from triangulated surfaces. Our main result of this section is that quivers Q arising from triangulated surfaces can be realized as t-colored direct sums (see Corollary 4.5). Before presenting this result and its proof, we recall for the reader how a triangulated surface defines a quiver. For more details on this construction, we refer the reader to [11]. Let S denote an oriented Riemann surface that may or may not have a boundary and let M Ă S be a finite subset of S where we require that for each component B of BS we have B X M ‰ H. We call the elements of M marked points, we call the elements of MzpM X BSq punctures, and we call the pair pS, Mq a marked surface. We require that pS, Mq is not one of the following degenerate marked surfaces: a sphere with one, two, or three punctures; a disc with one, two, or three marked points on the boundary; or a punctured disc with one marked point on the boundary. Given a marked surface pS, Mq, we consider curves on S up to isotopy. We define an arc on S to be a simple curve γ in S whose endpoints are marked points and which is not isotopic to a boundary component of S. We say two arcs γ1 and γ2 on S are compatible if they are isotopic relative to their endpoints to curves that are nonintersecting except possibly at their endpoints. A triangulation of S is defined to be a maximal collection of pairwise compatible arcs, denoted T. Each triangulation T of S defines a quiver QT by associating vertices to arcs and arrows based on oriented adjacencies (see Figure 4). 1 2 3 3[ ù 1  // 2 Figure 4. The quiver QT defined by a triangulation T. 9 One can also move between different triangulations of a given marked surface pS, Mq. Define the flip of an arc γ P T to be the unique arc γ 1 ‰ γ that produces a triangulation of pS, Mq given by T1 “ pTztγuq \ tγ 1 u (see Figure 5). If pS, Mq is a marked surface where M contains punctures, there will be triangulations of S that contain self-folded triangles (the region of S bounded by γ3 and γ4 in Figure 6 is an example of a self-folded triangle). We refer to the arc γ3 (resp. γ4 ) shown in the triangulation in Figure 6 as a loop (a radius). As the flip of a radius of a self-folded triangle is not defined, Fomin, Shapiro, and Thurston introduced tagged arcs, a generalization of arcs, in order to develop such a notion. γ γ0 ÐÑ Figure 5. A flip connecting two triangulations of an annulus. γ1 γ2 γ1 ι γ3 γ4 γ2 ι(γ3 ) γ4 Figure 6. The map identifying a triangulation of a punctured disk as a tagged triangulation of a punctured disk. We will not review the details of tagged arcs in this paper, but we remark that any triangulation can be regarded as a tagged triangulation of pS, Mq (i.e. a maximal collection of pairwise compatible tagged arcs). In Figure 6, we show how one regards a triangulation of pS, Mq as a tagged triangulation of pS, Mq. We also note that any tagged triangulation T of pS, Mq gives rise to a quiver QT (see Example 8.1 for a quiver defined by a tagged triangulation or see [11] for more examples and details). We now review the notion of blocks, which was introduced in [11] and used to classify quivers defined by a triangulation of some surface. Definition 4.1. [11, Def. 13.1] A block is a directed graph isomorphic to one of the graphs shown in Figure 7. Depending on which graph it is, we call it a block of type I, II, III, IV, or V. The vertices marked by unfilled circles in Figure 7 are called outlets. A directed graph Γ is called block-decomposable if it can be obtained from a collection of disjoint blocks by the following procedure. Take a partial matching of the combined set of outlets; matching an outlet to itself or to another outlet from the same block is not allowed. Identify (or glue) the vertices within each pair of the matching. We require that the resulting graph Γ1 be connected. If Γ1 contains a pair of edges connecting the same pair of vertices but going in opposite directions, then remove each such a pair of edges. The result is a block-decomposable graph Γ. As quivers are examples of directed graphs, one can ask if there is a description of the class of blockdecomposable quivers. The following theorem answers this question completely. Theorem 4.2. [11, Thm. 13.3] Block-decomposable quivers are exactly those quivers defined by a triangulation of some surface. 10 I II IIIa IIIb IV V Figure 7. The Fomin-Shapiro-Thurston blocks. Remark 4.3. Let QT be a quiver defined by a triangulated surface with no frozen vertices. In other words, we are assuming that every v P pQT q0 is a mutable vertex. Then α #tα P pQT q1 : x ÝÑ y for some y P pQT q0 u ď α #tα P pQT q1 : y ÝÑ x for some y P pQT q0 u ď 2 2. We now consider the quivers that are defined by triangulations, but are not irreducible. We show that any such quiver is a t-colored direct sum. The following lemma is a crucial step in showing that a quiver defined by a triangulation that is not irreducible will not have a double arrow connecting two summands of Q. Lemma 4.4. Assume that Q is defined by a triangulated surface (with 1 connected component) and that α1 / a / b is a proper subquiver of Q. Then there exists a path of length 2 from b to a. α2 Proof. Since Q is defined by a triangulated surface, there exists a block decomposition tRj ujPrms of Q by Theorem 4.2. By definition of the blocks, α1 and α2 come from distinct blocks. Without loss of generality, α1 is an arrow of R1 and α2 is an arrow of R2 . Furthermore, in Ri with i “ 1, 2 we must have that spαi q and tpαi q are outlets. Thus Ri with i “ 1, 2 is of type I, II, or IV, but by assumption R1 and R2 are not both of type I. When we glue the R1 to R2 to using the identifications associated with Q, a case by case analysis shows that there exists a path of length 2 from b to a. Furthermore, the vertices corresponding to a and b are no longer outlets. Thus attaching the remaining Rj ’s will not delete any arrows from this path.  Corollary 4.5. Let Q be a quiver defined by a triangulated surface (with 1 connected component) that is not α1 / irreducible. If Q ‰ a / b , then Q is a t-colored direct sum for some t P N. α2 Proof. Since we are assuming that Q is not irreducible, there exists subquivers Q1 and Q2 of Q such that we can pb ,...,b q write Q as the direct sum Q “ Q1 ‘pa11 ,...,akk q Q2 where ta1 , . . . , ak u is a multiset on pQ1 q0 and tb1 , . . . , bk u is a α multiset on pQ2 q0 . Let ai P ta1 , . . . , ak u and bj P tb1 , . . . , bk u be given. We claim that #tα P pQq1 : ai ÝÑ bj u ď 1. α1 / Suppose this were not the case, then Q would have a proper subquiver of the form ai / bj . By α2 Lemma 4.4, there must be a path of length 2 from bj to ai . This contradicts the fact that all arrows between ta1 , . . . , ak u and tb1 , . . . , bk u point towards the latter. Hence, Q is not only a direct sum but is a t-colored direct sum.  5. Signed Irreducible Type A Quivers In this section, we focus our attention on type An quivers, which are defined to be quivers R P Mutp1 Ð 2 Ð ¨ ¨ ¨ Ð nq where n ě 1 is a positive integer. We begin by classifying irreducible type An quivers. After that, we explain how almost any irreducible type An quiver carries the structure of a binary tree of 3-cycles. In section 6, we will show how regarding irreducible type An quivers as trees of 3-cycles allows us to construct maximal green sequences for such quivers. Our first step in classifying irreducible type An quivers is to present the following theorem of Buan and Vatne, which classifies quivers in Mutp1 Ð 2 Ð ¨ ¨ ¨ Ð nq where n ě 1 is a positive integer. We will say that a quiver is of type A if it is of type An for some positive integer n ě 1. Lemma 5.1. [6, Prop. 2.4] A quiver Q is of type A if and only if Q satisfies the following: i) all non-trivial cycles in the underlying graph of Q are of length 3 and are oriented in Q, ii) any vertex has at most four neighbors, 11 iii) if a vertex has four neighbors, then two of its adjacent arrows belong to one 3-cycle, and the other two belong to another 3-cycle, iv) if a vertex has exactly three neighbors, then two of its adjacent arrows belong to one 3-cycle, and the third arrow does not belong to any 3-cycle. Corollary 5.2. Besides the quiver of type A1 , the irreducible quivers of type A are exactly those quivers Q obtained by gluing together a finite number of Type II blocks tSα uαPrns in such a way that the cycles in the underlying graph of Q are in bijection with the elements of tSα uαPrns . Additionally, each Sα shares a vertex with at most three other Sβ ’s. (We say that Sα is connected to Sβ in such a situation.) Proof. Assume that Q is a quiver obtained by gluing together a finite number of Type II blocks tSα uαPrns in such a way that the cycles in the underlying graph of Q are in bijection with the elements of tSα uαPrns . Then Q satisfies i) in Lemma 5.1. By the rules for gluing blocks together, each vertex i P pQq0 has either two or four neighbors so ii) and iv) in Lemma 5.1 hold. It also follows from the gluing rules that if i has four neighbors, then two of its adjacent arrows belong to one 3-cycle and the other two belong to another 3-cycle so iii) in Lemma 5.1 holds. Additionally, since each arrow of Q is contained in an oriented 3-cycle, there is no way to partition the vertices into two components so that the arrows connecting them coherently point from one to the other. Thus the quiver Q is irreducible. Conversely, let Q be an irreducible type A quiver that is not the quiver of type A1 . We first show that any α arrow of Q belongs to a (necessarily) oriented 3-cycle of Q. Suppose pi ÝÑ jq P pQq1 does not belong to an pjq oriented 3-cycle of Q. Then there exist nonempty full subquivers Q1 and Q2 of Q such that Q “ Q1 ‘piq Q2 . (By property i), there cannot be an (undirected) cycle of length larger than 3.) This contradicts the fact that Q is irreducible. Not only is it true that every arrow of Q belongs to an oriented 3-cycle of Q, property i) also ensures that Q is obtained by identifying certain vertices of Type II blocks in a finite set of Type II blocks tSα uαPrns . Furthermore, property ii) in Lemma 5.1 implies these identifications are such that all vertices have two or four neighbors. By properties i) and iii), these identifications do not create any new cycles in the underlying graph of Q. Thus Q is obtained by gluing together a finite number of Type II blocks tSα uαPrns in such a way that the cycles in the underlying graph of Q are in bijection with the elements of tSα uαPrns .  Definition 5.3. Let Q be an irreducible type A quiver with at least one 3-cycle. Define a leaf 3-cycle Sα in Q to be a 3-cycle in Q that is connected to at most one other 3-cycle in Q. We define a root 3-cycle to be a chosen leaf 3-cycle. Lemma 5.4. Suppose Q is an irreducible type A quiver with at least one 3-cycle. Then Q has a leaf 3-cycle. Proof. If Q has exactly one 3-cycle R, then Q “ R is a leaf 3-cycle. If Q is obtained from the Type II blocks tSi uiPrns , consider the block Si1 . If Si1 is connected to only one other 3-cycle, then Si1 is a leaf 3-cycle. If Si1 is connected to more than one 3-cycle, let Si2 denote one of the 3-cycles to which Si1 is connected. If Si2 is only connected to Si1 , then Si2 is a leaf 3-cycle. Otherwise, there exists a 3-cycle Si3 ‰ Si1 connected to Si2 . By Lemma 5.1 there are no non-trivial cycles in the underlying graph of Q besides those determined by the blocks tSi uiPrns so this process will end. Thus Q has a leaf 3-cycle.  Consider a pair, pQ, Sq where Q is an irreducible type A quiver Q with at least one 3-cycle, and S denotes a root 3-cycle in Q. We now define a labeling of the arrows of Q, an ordering of the 3-cycles, and a sign function on the set of 3-cycles of Q. Adding this additional data to pQ, Sq yields a binary tree structure on the set of 3-cycles tSα uαPrns . We begin by letting S1 :“ S denote the chosen root 3-cycle, S2 denote the unique 3-cycle connected to S1 , and z1 denote the vertex shared by S1 and S2 . (In the event that Q is a single 3-cycle, we choose z1 to be a vertex of S1 arbitrarily.) Next, we let α1 , β1 and γ1 denote the three arrows of S1 in cyclic order such that spγ1 q “ z1 “ tpβ1 q, spβ1 q “ tpα1 q, and spα1 q “ tpγ1 q. We next label the arrows of S2 such that spα2 q “ z1 “ tpγ2 q, tpα2 q “ spβ2 q, and tpβ2 q “ spγ2 q. See Figure 8 for examples of this labeling. For i ě 2, we order the remaining 3-cycles by a depth-first ordering where we (1) inductively define Si`1 to be the 3-cycle attached to the vertex tpαi q, (2) define αi`1 such that spαi`1 q “ tpαi q and then βi`1 , γi`1 follow αi`1 in cyclic order, (3) if no 3-cycle is attached to tpαi q, define Si`1 to be the 3-cycle attached to tpβi q and spαi`1 q “ tpβi q instead, and finally (4) minimally backtrack and continue the depth-first ordering until all arrows and 3-cycles have been labeled. 12 β3 | < y2 “ x3 yO1 β1 x1 | z1 b S2 “ γ1 yO1 ¨ x2 γ2 < y2 β1 z3 γ3 x1 or α2 " S1 α1 α2 " S1 α1 " S3 α3 ¨¨ x2 γ1 | z1 b S2 “ yO3 β2 γ2  z2 “ b x3 γ3 β2 α3  z2  y3 < z3 S3 β3 ¨¨ ¨ Figure 8. Labeling arrows of an irreducible quiver of type A. Given a 3-cycle Si in the block decomposition of Q, define xi :“ spαi q, yi :“ spβi q, and zi :“ spγi q. The vertex z1 of S1 was already defined in the previous paragraph and that definition of z1 clearly agrees with this one. We say that a 3-cycle Si is positive (resp. negative) if spαi q “ tpαj q (resp. spαi q “ tpβj q) for some j ă i. We define sgnpSi q :“ ` (resp. ´) if Si is positive (resp. negative). By convention, we set sgnpS1 q “ `. We define Ti :“ pSi , sgnpSi qq to be a 3-cycle in the block decomposition of Q and its sign. We will refer to Ti where i P rns as a signed 3-cycle of Q. For graphical convenience, we will consistently draw 3-cycles as shown in Figure 9 with the convention that sgnpSi q “ ` (resp. ´) in the former figure (resp. latter figure). We refer to the data Q :“ pQ, S, tTi uiPrns q as a signed irreducible type A quiver. αi > yi βi Ti γi xi o Ti γi zi / yi αi xi ` zi ~ βi Figure 9. A positive (resp. negative) 3-cycle is shown on the left (resp. right). Remark 5.5. If Q is an irreducible type A quiver with more than one 3-cycle, then the choice of a root 3-cycle completely determines the sign of each 3-cycle of Q. Thus Q “ pQ, S, tTi uiPrns q depends only on pQ, Sq and thus it makes sense to refer to the signed irreducible type A quiver defined by pQ, Sq. The next lemma follows immediately from Corollary 5.2 and from our definition of the sign of a 3-cycle Si in Q. Lemma 5.6. If Q is an irreducible type A quiver with at least one 3-cycle, S is a root 3-cycle of Q and Q “ pQ, S, tTi uiPrns q is a signed irreducible type A quiver defined by pQ, Sq, then Q is equivalent to a labeled binary tree with vertex set tSi uiPrns where Si is connected to Sj by an edge if and only if Si is connected to Sj (i.e. Si and Sj share a vertex). Furthermore, a 3-cycle Sj P tSi uiPrns has a right child (resp. left child) if and only if Sj shares the vertex yj (resp. zj ) with another 3-cycle, . For the remainder of this section, we assume that Q is a given irreducible type A quiver and S a root 3-cycle of Q. We also assume Q is a signed irreducible type A defined by the data pQ, Sq. For convenience, we will abuse notation and refer to the vertices, arrows, 3-cycles, etc. of Q with the understanding that we are referring p the framed quiver of to the vertices, arrows, 3-cycles, etc. of Q, respectively. Since we will often work with Q, p Q, it will also be useful to define Q to be framed quiver of Q with the additional data of S, the root 3-cycle of Q, and the data of a sign associated with each 3-cycle of Q. Now for convenience, we will abuse notation and p with the understanding that we refer to the mutable vertices, frozen vertices, arrows, and 3-cycles of Q p respectively. We will refer to Q p are referring to the mutable vertices, frozen vertices, arrows, and 3-cycles of Q, 13 p to be as a signed irreducible type A framed quiver. Additionally, we define a full subquiver R of Q or Q p a full subquiver of Q or Q, respectively, with the property that the sign of any 3-cycle C of R is the same as the p sign of C when regarded as a 3-cycle of Q or Q. Example 5.7. In Figure 10, we show an example of a signed irreducible type A23 quiver, which we denote by Q. The positive 3-cycles of Q are T1 , T3 , T4 , T5 , T7 . For clarity, we have labeled the arrows of Q in Figure 10, but we will often suppress these labels in later examples. We also note that many of the vertices, e.g. z1 , y2 , y3 , z3 could also be labeled as x2 , x3 , x4 , x11 , respectively, but we suppress the vertex labels xi (which are shorthand for spαi q) except for x1 . α5 α4 α1 x1 o ? y1 T1 γ1 β1  α3 / y2 o α2 z1 _ T2 γ2 z2  β2 o ? y3 T3 γ3 ? y4 ? y5 o T4 γ4 T5 γ5 β4  β5  α7 z5 _ T6 γ6 z4 / y6 o α6 z6  ? y7 T7 γ7 z3 _ γ11 α11 T11  z11  z7 _ / y8 α8 T8 γ8 β6 z8 _ β3  β7  β8α γ9 / y11 / y9 9 T9β z9 _ 9  γ10 β11 α10 T10  z10 / y10 β10 Figure 10. A signed irreducible type A23 quiver. p We label the mutable vertices of Q p according to It will be helpful to define an ordering on the vertices of Q. the linear order 1 “ spα1 q ă tpα1 q ă tpβ1 q ă tpα2 q ă tpβ2 q ă ... ă tpαn q ă tpβn q “ N p according to the linear order and the frozen vertices of Q N ` 1 “ spα1 q1 ă tpα1 q1 ă tpβ1 q1 ă tpα2 q1 ă tpβ2 q1 p We call this the standard ordering of the vertices of Q. ă ... ă tpαn q1 ă tpβn q1 “ 2N. p denote the signed irreducible type A23 framed quiver shown in Figure 11. We have labeled Example 5.8. Let Q p the vertices of Q in Figure 11 according to the standard ordering. Note that we have suppressed the arrow labels in Figure 11. 6. Associated Mutation Sequences Throughout this section we work with a given signed irreducible type A quiver Q with respect to a fixed root 3-cycle S. Based on the data defining the signed irreducible type A quiver Q, we construct a mutation sequence of Q that we will call the associated mutation sequence of Q. After that we state our main theorem which says that the associated mutation sequence of Q is a maximal green sequence (see Theorem 6.5). We then apply our main theorem to construct a maximal green sequence for any type A quiver Q (see Corollary 6.8). 6.1. Definition of Associated Mutation Sequences. Before defining the associated mutation sequence of Q, we need to develop some terminology. Definition 6.1. Let Tk be a signed 3-cycle of Q. Define the sequence of vertices pxp0, kq, xp1, kq, . . . , xpd, kqq of Q by " zk : if j “ 0, xpj, kq :“ tpγmj q : γmj is the unique arrow of Q satisfying spγmj q “ xpj ´ 1, kq. Note that such a sequence is necessarily finite, and we choose d to be maximal, or equivalently so that sgnpSmd q “ `. When k is clear from context, we abbreviate xps, kq as xpsq. It follows from the definition of xpjq that xpjq “ xmj for any j P rds, and that xpdq “ x1 or ymd ´1 . However, xp0q can be expressed as xs for some s P rns only if degpxp0qq “ degpzk q “ 4. See Figure 12. Note that if sgnpSk q “ `, then this sequence of vertices is simply pxp0q, xp1qq. 14 10O 1 2O 1 1O 1 ?2 1o T1 8O 1 ? 10 11O 1 o ?8 T5   6O 1 3O 1 4O 1 o ?6 3_ /4o T3 T2 5  14O 1  T4  9 7_ T11  71 23  51  11 _ T6 / 91 13 / 22  131 12O 1 ? 14 15O 1 / 12 o T7  15 _  16O 1 / 16 T8 17 _  18O 1  171  221 / 18 T9 19 _  191  231  20O 1 / 20 T10 21   211 Figure 11. The framed quiver of a signed irreducible type A23 quiver with vertices labeled using the standard ordering. = xpdq o ymd Tmd γmd " xpd ´ 1q d Tmd´1 / ym d´1 “trpyk q γmd´1 { xpd ´ 2q .. . xp1q b γm1 Tk “Tm1 / yk ~ xp0q Figure 12. The sequence pxp0q, xp1q, . . . , xpdqq defined by Tk where sgnpSk q “ ´. The transport of yk is also illustrated for quivers where there is no sequence of the form in (2) of Definition 6.2. Definition 6.2. For any vertex v of Q which can be expressed as v “ yk , i.e. as a point of some signed 3-cycle Tk of Q, we define the transport of yk by the following procedure. We will denote the image of the transport as trpvq. Consider the full subquiver of Q on the vertices of the signed 3-cycles T1 ,T2 ,. . . ,Tk , which we denote by Qk . Inside this subquiver, iq move from yk along βk to tpβk q, iiq move from tpβk q along the sequence of arrows γm1 , γm2 , . . . , γmd of maximal length to tpγmd q where the integers tmi uiPrds are those defined by the signed 3-cycle Tk (see Definition 6.1), iiiq if possible, move from tpγmd q to trpyk q :“ tpβks q along the sequence of arrows of the form shown in (2) each of which belongs to a signed 3-cycle Ti for some i ă k, under the assumption that the subsequences 15 αk1 xpdq o yk1 ? βk1  αk2 / yk2 xpd ´ 1q _ Tmd´1 γmd´1  βk2 xpd ´ 2q Tmd “Tk1 γmd .. . αk``1 xpiq _ γmi αk` Tmi “Tk` / xk``1 o yk``1 ? Tk``1 βk``1  xk``2 _  xpi ´ 1q αk``2 Tk``2  xk``3 .. / yk``2 βk``2 .. . xp1q _  xp0q xk s βk _ αks / yks Tks zks  βks “ γm1 Tk “Tm1 / yk . trpyk q Figure 13. The sequence of arrows one follows to compute the transport of yk . Note that in this case, the sequence A1 is non-empty. A1 and A2 are of maximal length, and A2 must be nonempty. If no such sequence exists of this form, we instead define trpyk q :“ tpγmd q. (2) αk1 , βk1 , αk2 , βk2 , . . . , αk`´1 , βk`´1 , αk` , αk``1 , βk``1 , αk``2 , βk``2 , . . . , αks , βks A1 A2 See Figures 12, 13, and 14. We now use the above notation to define the associated mutation sequence of Q. Definition 6.3. Let Q “ pQ, S, tTi uiPrns q be a signed irreducible type A quiver. Define µ0 :“ µx1 . For each k P rns we define a sequence of mutations, denoted µk , as follows. Note that when we write H below we mean the empty mutation sequence. We define µk :“ µA ˝ µB ˝ µC ˝ µD where µA , µB , µC , and µD are mutation sequences defined in the following way µD µC µB µA :“ µyk :“ µ "xpd´1q ˝ ¨ ¨ ¨ ˝ µxp1q ˝ µxp0q µtrpxpdqq : if xpdq ‰ x1 :“ H : if xpdq “ x1 :“ µtrpyk q . Note that xpdq “ x1 or ymd ´1 so the transport trpxpdqq in µB is well-defined. Now define the associated mutation sequence of Q to be µ :“ µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 . We will denote the associated mutation sequence of Q by µ or by µQ if it is not clear from context which signed irreducible type A quiver defines µ. At times it will be useful to write µk “ µApkq ˝ µBpkq ˝ µCpkq ˝ µDpkq . 16 αk1 xpdq o = γmd βk2 ! Tk2 xk 2 o Tmd “Tk1 yk2 ! xpd ´ 1q _ γmd´1 xk3 Tmd´1 αk3 a / yk3 Tk3 / ymd´1 xk4 βk3 }  xpd ´ 2q .. . .. . xks xp1q _ Tk “Tm1  xp0q γm1 αks a / yks Tks / yk zks βks } “ = αk2 βk trpyk q Figure 14. The sequence of arrows one follows to compute the transport of yk . Note that in this case, the sequence A1 is empty. G2 1o T1 10 G  G6 3W T2 5  /4o T3  7W T4 9W /8o  T7  15W T5  11W  17W / 12  13 / 14 T8 T6 / 16 T9  19 o 22 G o 20 G / 18 o 24 G T10 T11  21W T12  25W  23 T15 T13  27W / 30 / 26 T14 / 28  29  31 Figure 15. The signed irreducible type A31 quiver described in Example 6.4. Example 6.4. Let Q denote the signed irreducible type A31 quiver appearing in Figure 15. In the table in Figure 16, we describe µi for each 0 ď i ď 15. Thus, the associated mutation sequence defined by Q is µ15 ˝ µ14 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 . We now arrive at the main result of this paper. Theorem 6.5. If Q “ pQ, S, tTi uiPrns q is a signed irreducible type A quiver with associated mutation sequence µ, then we have µ P green pQq. We present the proof Theorem 6.5 in the next section, as the argument requires some additional tools. 17 i 0 1 2 3 4 5 6 7 µi µ1 µ1 ˝ µ3 ˝ µ2 µ1 ˝ µ3 ˝ µ5 ˝ µ4 µ4 ˝ µ1 ˝ µ7 ˝ µ6 µ4 ˝ µ1 ˝ µ7 ˝ µ9 ˝ µ8 µ8 ˝ µ4 ˝ µ11 ˝ µ10 µ8 ˝ µ4 ˝ µ11 ˝ µ13 ˝ µ12 µ13 ˝ µ1 ˝ µ7 ˝ µ9 ˝ µ15 ˝ µ14 i 8 9 10 11 12 13 14 15 µi µ13 ˝ µ1 ˝ µ7 ˝ µ9 ˝ µ15 ˝ µ17 ˝ µ16 µ13 ˝ µ1 ˝ µ7 ˝ µ9 ˝ µ15 ˝ µ17 ˝ µ19 ˝ µ18 µ18 ˝ µ13 ˝ µ21 ˝ µ20 µ20 ˝ µ18 ˝ µ23 ˝ µ22 µ22 ˝ µ20 ˝ µ25 ˝ µ24 µ22 ˝ µ20 ˝ µ25 ˝ µ27 ˝ µ26 µ22 ˝ µ20 ˝ µ25 ˝ µ27 ˝ µ29 ˝ µ28 µ23 ˝ µ13 ˝ µ21 ˝ µ31 ˝ µ30 Figure 16. The associated mutation of the signed irreducible type A31 quiver in Figure 15. Remark 6.6. For a given irreducible type A quiver with at least one 3-cycle, the length of µ can vary depending on the choice of leaf 3-cycle. Let Q denote the irreducible type A7 quiver shown in Figure 17. By choosing the 3-cycle 1,2,3 (resp. 5,6,7) to be the root 3-cycle, one obtains the signed irreducible type A quiver Q1 (resp. Q2 ) shown in Figure 18. Then the associated mutations of Q1 and Q2 are µQ1 Q2 µ “ µ1 ˝ µ3 ˝ µ5 ˝ µ7 ˝ µ6 ˝ µ1 ˝ µ3 ˝ µ5 ˝ µ4 ˝ µ1 ˝ µ3 ˝ µ2 ˝ µ1 “ µ3 ˝ µ6 ˝ µ2 ˝ µ1 ˝ µ6 ˝ µ5 ˝ µ4 ˝ µ3 ˝ µ6 ˝ µ5 ˝ µ7 ˝ µ6 . Furthermore, the maximal green sequence produced by Theorem 6.5, i.e. the associated mutation sequence of a each signed irreducible type A quiver associated to Q, is not necessarily a minimal length maximal green sequence. For example, it is easy to check that ν “ µ3 ˝ µ1 ˝ µ4 ˝ µ3 ˝ µ7 ˝ µ6 ˝ µ2 ˝ µ5 ˝ µ1 ˝ µ4 ˝ µ7 is a maximal green sequence of Q, which is of length less than that of µQ1 or µQ2 . Remark 6.7. While we were revising this paper, Cormier, Dillery, Resh, Serhiyenko, and Whelan [9] found a construction of minimal length maximal green sequences for type A quivers. Therein, they construct a maximal green sequence for any irreducible type A quiver Q with at least one 3-cycle by mutating first at all leaf 3-cycles of Q, then mutating at the 3-cycles connected to the leaf 3-cycles of Q, continuing this process, and then mutating a subsequence of the vertices in reverse. This contrasts with the maximal green sequences we construct in this paper, which involve some extraneous steps but whose process can be defined locally and inductively, akin to writing down the reduced word for a permutation using bubble sort. ?2 Q = 1o  ?4 3o ?6   5o 7. Figure 17. ?2 Q1 “ 1o  ?7 3_  /4 5_ 7  6o /6  ?1 5_ 4  /3o  2 “ Q2 Figure 18. The two signed irreducible type A quivers that can be obtained from Q. We conclude this section by using Theorem 6.5 to show that any type A quiver has at least one maximal green sequence. Corollary 6.8. Let Q P Mutp1 Ñ 2 Ñ ¨ ¨ ¨ Ñ nq. Then Q has a maximal green sequence. 18 Proof. By Corollary 4.5, Q can be expressed as a direct sum of irreducible type A quivers tQ1 , Q2 , . . . , Qk u. In other words, pb ,b ,...,b pbp1,jq ,bp2,jq ,...,bpd q p2,1q pd1 ,1q Q “ Q1 ‘pap1,1q Q12 where Q1j “ Qj ‘pap1,jq ,ap2,jq ,...,apdj p1,1q ,ap2,1q ,...,apd ,1q q ,jq q j ,jq 1 q Q1j`1 for 2 ď j ď k ´ 1, and Q1k “ Qk . If Qi is of type A1 and ai denotes the unique vertex of Qi , then µpiq :“ µai is a maximal green sequence of Qi . If Qi is not of type A1 , then we form a signed irreducible type A quiver, Qpiq , associated to Qi by picking a leaf 3-cycle. Now by Theorem 6.5, the associated mutation sequence of Qpiq , denoted µpiq , is a maximal green sequence of Qi . By applying Proposition 3.12 iteratively, we obtain µ “ µpkq ˝ ¨ ¨ ¨ ˝ µp2q ˝ µp1q is a maximal green p sequence of Q.  7. Proof of Theorem 6.5 In this section, we work with a fixed signed irreducible type A quiver Q “ pQ, S, tTi uiPrns q with N vertices. We write µ “ µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 for the associated mutation sequence of Q. Definition 7.1. For each µi appearing in µ we define a permutation τi P SpQq0 – SN where SpQq0 denotes the symmetric group on the vertices of Q. In the special case where i “ 0, we define τ0 to be the identity permutation. Then for i P rns where µi “ µid ˝ ¨ ¨ ¨ ˝ µi1 we define τi :“ pi2 , . . . , id q in cycle notation (i.e. ij ¨ τi “ ij`1 for j P rd ´ 1s and id ¨ τi “ i2 ). Note that i1 “ yi . We also define σi :“ τi ¨ ¨ ¨ τ1 τ0 “ τi ¨ ¨ ¨ τ1 where the last equality holds since τ0 is the identity permutation. We say that σn is the associated permutation corresponding to Q. Theorem 6.5 will imply that the associated permutation σn is exactly the permutation induced by µ (see the last paragraph of Section 2). Let Tk and Tt where k ď t be signed 3-cycles of Q. Let Qk,t denote the full subquiver of Q on the vertices of T1 , . . . , Tk and the vertices of Tm1 , . . . , Tmd where the integers m1 , . . . , md P rns are those defined by Tt as in Definition 6.1. For example, Qk,k is the full subquiver of Q on the vertices of the signed 3-cycles T1 , . . . , Tk . By convention, we also define Q0,0 to be the full subquiver of Q consisting of only the vertex x1 . Now define tr|k,t to be the restriction of the transport to Qk,t . p of the Lemma 7.2. For each k P rns there is an ice quiver Rk that is a full subquiver of µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq form shown in Figure 19 (resp. Figure 20) where the vertices zk “ xp0q, xp1q, . . . , xpd ´ 1q, trpxpdqq, and trpyk q (resp. zk “ xp0q, xp1q, . . . , xpd ´ 1q, and trpyk q) are those appearing in the mutation sequence µApkq ˝ µBpkq ˝ µCpkq and the integers m1 , m2 , . . . , md are those defined by Tk in Definition 6.1. Recall that we only mutate at trpxpdqq if xpdq ‰ x1 . Furthermore, the ice quiver Rk has the following properties: ‚ Rk includes every frozen vertex that is connected to a mutable vertex appearing in Figure 19 (resp. 1 p where x r k q :“ r Figure 20) by at least one arrow in µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq rp1q :“ zm , trpxpdqq :“ x1m2 , trpy d ´1 4 5 1 1 1 1 r k q :“ xm and x rpsq :“ xm rpsq :“ xm xm and x for s P r2, d ´ 1s (resp. trpy for s P r1, d ´ 1s), 1 1 d´s`2 d´s`1 1 1 ‚ vertices ym , ym , zm , and zm appear in Rk if and only if degpyk q “ 4 in Q, 1 1 ‚ vertices y` , y` , z` , and z` appear in Rk if and only if degpzk q “ 4 in Q, ‚ vertices yt and yt1 appear in Rk if and only if there exists a signed 3-cycle Tt in Q with k ă t such that p the vertex xt has been mutated exactly once6, and tr|k,t pyt q “ zk and such that in µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq 1 1 Ą Ą ‚ in Figure 19 (resp. Figure 20) C1,k :“ xm ´1 ¨ σ ´1 , C , Cs,k :“ ym ¨ σ ´1 , and C 1,k :“ x s,k :“ y d k´1 md ´1 j k´1 mj ´1 1 Ą for s P r2, ds and j “ d ´ s ` 2 (resp. Cs,k :“ ymj ¨ σk´1 and C s,k :“ ymj for s P r1, d ´ 1s and j “ d ´ s ` 2). z ~ Additionally, for each k P rns we have µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQ k,k q “ Qk,k ¨ σk . We will prove Lemma 7.2 in the case where the vertex trpxpdqq appears in the mutation sequence µk (i.e. when xpdq ‰ x1 ). Under this assumption, the following lemma will allow us to prove Lemma 7.2 inductively. The proof of Lemma 7.2 when trpxpdqq does not appear in µk is very similar so we omit it. 4If d “ 1, then trpxpdqq r “ x1m1 “ xk . 5If d “ 1, then trpxpdqq r “ x1m1 “ xk . Furthermore, d “ 1, in this case, if and only if k “ 1. 6Note that this can only happen if there exists j ă k such that z “ x and xpd, kq “ y as in Definition 6.1. t j j 19 z`1 O yt1 O Ą C 1,k Ą C 2,k Ą C s,k Ą C d,k zG ` yG t  C1,k G  C2,k G  Cs,k G  Cd,k E R k “ y` o  y`1  zk o  xp1q o O  zk1  rp1q x  xp2q o O  xp3q ¨ ¨ ¨ xpsq o O O # ' x rp2q ) x rp3q *  xps ` 1q ¨ ¨ ¨ trpxpdqq o O O x rpsq + x rps ` 1q r trpxpdqq 1 ym O yG m  trpyk q o O yk o  zm , r trpyk q  yk1  1 zm Figure 19. The local configuration around yk and zk just before µk is applied. R k “ y` o  y`1 z`1 O yt1 O Ą C 1,k Ą C 2,k Ą C s,k CČ d´1,k zG ` yG t  C1,k G  C2,k G  Cs,k G  Cd´1,k E  zk o  xp1q o O  zk1  rp1q x  xp2q o O  xp3q ¨ ¨ ¨ xpsq o O O # ' x rp2q ) x rp3q x rpsq * 1 ym O yG m  xps ` 1q ¨ ¨ ¨ xpd ´ 1q o O O  trpyk q o O yk o  zm + , r trpyk q  yk1  1 zm x rps ` 1q x rpd ´ 1q Figure 20. The local configuration in the special case when xpdq “ x1 since trpx1 q is not defined. Lemma 7.3. Let k P rns be given and let Rk be the ice quiver described in Lemma 7.2. (See Figure 19.) Then 1 1 , y` , y`1 , z` , z`1 , yt , and yt1 appear , zm , zm ‚ µk pRk q has the form shown in Figure 22 (here, the vertices ym , ym in µk pRk q if and only if they appear in Rk ), p ‚ µ pRk q is a full subquiver of µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq, k k 1 0 ‚ as one mutates Rk along µk , one does so only at green vertices, ‚ µk pRk q includes every frozen vertex that is connected to a mutable vertex appearing in Figure 22 by at p least one arrow in µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq, k 1 0 p on the vertices pQq p 0 zpRk q0 is unchanged by the mutation ‚ the full subquiver of µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq sequence µk . ‚ the vertices z` and zm (rather than zk ) are the only mutable vertices in µk pRk q that are incident to multiple frozen vertices. p restricted to the green mutable vertices Additionally, for each k P rns, the full subquiver of µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq k 1 0 p restricted to those outside of pRk q0 , as well as the incident frozen vertices, equals the original framed quiver Q vertices. Proof of Theorem 6.5. By the third assertion in Lemma 7.3, the associated mutation sequence µ “ µn ˝ ¨ ¨ ¨ µ1 ˝ µ0 of Q is a green mutation sequence of Q. By Lemma 7.2, p “ µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQ pn,n q “ Q qn,n ¨ σn “ Q q ¨ σn µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq n 1 0 20 z`1 O yt1 O : yt : Ą C 2,k Ą C s,k Ą C d,k  C1,k  C2,k  Cs,k  8 Cd,k  xp1q o Z  µk pRk q “ z` o Ą C 1,k zkZ o : : ¨¨¨  xp2q Z ¨¨¨  xpsq Z xps ´ 1q o Z 1 ym O y` d  trpxpdqq \ e xpd ´ 1q o \ ym  / yk O 5 zm { 1 trpyk q  y`1 s # zk1 r ' rp1q x ) x rp2q * x rp3q x rpsq + , x rps ` 1q r trpxpdqq , r trpyk q yk1   1 zm Figure 21. The quiver µk pRk q before rearrangement. µk pRk q “ z` o  z`1 yt1 O Ą C 1,k Ą C s,k Ą C d,k yk1 a 1 1 zm ym O O yG t  C1,k G  Cs,k E  Cd,k C  yE k o ym zG m  xp1, kq ¨ ¨ ¨ xps ´ 1, kq o O O  zkO o  x rp1, kq # x rp2, kq ( * x rps, kq  xps, kq ¨ ¨ ¨ xpd ´ 1, kq o O O  trpxpd, kqq o O + r x rps ` 1, kq trpxpd ´ 1, kqq , r trpyk q  trpyk q o O , z1 k  y`  y`1 Figure 22. The quiver µk pRk q rearranged to look more like Rk`1 . p is red. Thus µ “ µ ˝ ¨ ¨ ¨ µ ˝ µ P greenpQq. and so every mutable vertex of µn ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq n 1 0  Remark 7.4. It follows from Lemma 5.1 that as one mutates Rk along µk “ µir ˝ ¨ ¨ ¨ ˝ µi1 , we have that ij in µij´1 ˝ ¨ ¨ ¨ ˝ µi1 pRk q is incident to at most four other mutable vertices. Proof of Lemma 7.3. The first assertion follows inductively by mutating the vertices of Rk in the specified order µk “ µtrpyk q ˝ µtrpxpdqq ˝ µxpd´1q ˝ µxpd´2q ˝ ¨ ¨ ¨ µxp1q ˝ µxp0q ˝ µyk , reading right-to-left. In particular, as this mutation sequence is applied to Rk , Remark 7.4 shows that the mutable vertices incident to y` are located further and further to the right in Figure 19 until we see that they are trpyk q and zm at the end of the sequence. In fact, we observe after mutating Rk at yk that zk is the unique green vertex of Rk (with the exception of the vertices y` , z` , yt , ym and zm , if they appear in Rk ). As we continue to mutate µyk pRk q along the remaining mutations in µk , the unique green vertex is xpsq for some s P r0, d ´ 1s or as trpxpdqq or trpyk q (as before, with the exception of the vertices y` , z` , yt , ym and zm ). Iteratively mutating at this unique green vertex exactly corresponds to performing the mutation sequence µApkq ˝ µBpkq ˝ µCpkq on µDpkq pRk q. p follows since the vertices of Q at The second assertion, µ pRk q is a full subquiver of µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq, k k 1 0 which one mutates when applying µk are all vertices of Rk . One can see that the third assertion follows from the above observation that a unique vertex becomes green as we iteratively mutate. The fourth assertion holds for µk pRk q since it holds for Rk . The fifth assertion follows since the vertices in the support of µk are all disconnected p 0 zpRk q0 . Further, the sixth assertion is demonstrated inductively as ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQqq from the vertices in pµ k´1 1 0 21 z21 O zG 2 R “ y2 o  y21  z1 o xO 1 o  z11  x11 y1  y11 p Figure 23. The subquiver R “ R1 of µ0 pQq. we mutate xpsq for s P r0, d ´ 1s. Lastly, by restricting to the green mutable vertices outside of pRk q0 and the incident frozen vertices, it is clear that the mutation sequence µk leaves this full subquiver unaffected.  p has the full subquiver R Proof of Lemma 7.2. We prove the lemma by induction. For k “ 1, observe that µ0 pQq shown in Figure 23 where we assume that n ą 1. We show that R has all of the properties that R1 must satisfy. 1 Note that trpy1 q “ x1 and for k “ 1 one has that xp1q “ xm1 “ x1 . Since degpy1 q “ 2, no vertices ym , ym , zm , and 1 p no arrows between vertices zm appear in R, as desired. Since only vertex x1 has been mutated to obtain µ0 pQq, of a signed 3-cycle Tt with 1 ă t and vertices of signed 3-cycle Ti with i ď 1 have been created. Furthermore, there is no signed 3-cycle Tt of Q with 1 ă t where tr|1,t pyt q “ z1 . Note that in this degenerate case, trpy1 q “ xp1q Ą r 1 q “ x11 . Thus the quiver R satisfies all of the properties and so no Ci,1 ’s or C rp1q “ trpy i,1 ’s appear in R1 , and x 1 z that R1 must satisfy. Further, in this special case Q 0,0 contains only the vertex x1 and x1 and σ0 is the identity y } permutation. Thus µ0 Q 0,0 indeed equals Q0,0 ¨ σ0 . p has a full subquiver Rk with the properties in the ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq Now assume that k ą 1 and that µ k´1 1 0 p has the desired full subquiver Rk`1 , we consider four statement of the lemma. To show that µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq cases: i) degpyk q “ 2 and degpzk q “ 4, ii) degpyk q “ 4 and degpzk q “ 2, iii) degpyk q “ 4 and degpzk q “ 4, and iv) degpyk q “ 2 and degpzk q “ 2. 1 Suppose that we are in Case i). By the properties of the ice quiver Rk , this means that vertices ym , ym , zm , 1 and zm do not appear in Rk . This also implies that ` “ k ` 1. Now Lemma 7.3 implies that µk pRk q has the form shown in Figure 24 where the vertices yt and yt1 appear µk pRk q if and only if they appear in Rk . Note that the quiver in Figure 24 is the same as the quiver in Figure 22 with the notation updated accordingly. In pk`1q pk`1q pk`1q particular, the integers m1 , m2 , . . . , md`1 P rns and the vertices xp1, k ` 1q, . . . , xpd ` 1, k ` 1q P pQq0 are those defined by Tk`1 following Definition 6.1. Since the signed 3-cycles Tk and Tk`1 share the vertex zk (i.e. zk “ xk`1 ), we have that (3) pk`1q m1 pk`1q “ k ` 1, m2 pk`1q “ m1 , . . . , mj pk`1q “ mj´1 , . . . , md`1 “ md and xp1, k ` 1q “ zk , xp2, k ` 1q “ xp1q, . . . , xps, k ` 1q “ xps ´ 1q, . . . , xpd ` 1, k ` 1q “ xpdq. This implies that trpxpd ` 1, k ` 1qq “ trpxpd, kqq and trpyk`1 q “ trpyk q. Now we also obtain that 1 1 rp1, k ` 1q “ zm x “ zm “x rp1, kq and x rps, k ` 1q “ x1mpk`1q pk`1q d ´1 ´1 d`1 d`1´s`2 “ x1mpk`1q “ x1mj´1 “ x rps, kq j for s P r2, ds where j “ pd ` 1q ´ s ` 2 and that r r k q and trpy r k`1 q “ x1 pk`1q “ x1k`1 “ zk1 trpxpd ` 1, k ` 1qq “ x1mpk`1q “ x1m1 “ trpy m 2 1 22 yt1 O CČ 1,k`1 CČ s,k`1 1 Č CČ d,k`1 Cd`1,k`1 “ yk C yt  C1,k`1 C  Cs,k`1 B   Cd,k`1 Cd`1,k`1 “ @ yk @ zk`1 o xp1, k ` 1q o O ¨¨¨ ¨¨¨    xp2, k ` 1q xps, k ` 1q o xps ` 1, k ` 1q xpd, k ` 1q o trpxpd ` 1, k ` 1qq o O O O O O  1 zk`1  x rp1, k ` 1q & ) x rp2, k ` 1q x rps, k ` 1q  + x rps ` 1, kq , x rpd, k ` 1q , r trpxpd ` 1, k ` 1qq  trpyk`1 q o yk`1 O - r trpyk`1 q  1 yk`1 Figure 24. The quiver µk pRk q obtained by mutating Rk in Case i). where the last equality follows from the fact that Tk and Tk`1 share the vertex zk . Thus we have labeled the vertices of µk pRk q accordingly in Figure 24. Furthermore, that the signed 3-cycles Tk and Tk`1 share the vertex zk implies that zk`1 “ tr|k`1,t pyt q if and only if zk “ tr|k,t pyt q. Next, observe that for any s P rds we have Cs,k ¨ τk´1 “ Cs,k since we do not mutate Cs,k when applying µk . Additionally xmpk`1q ´1 “ xmd ´1 and ympk`1q “ ymj (for j “ pd ` 1q ´ s ` 2 where s P r2, ds) follows d`1 j`1 from (3). Comparing with the fifth bullet point of Lemma 7.2, we obtain Cs,k “ Cs,k ¨ τk´1 “ Cs,k`1 and Ą Ą ´1 Č C s,k “ Cs,k ¨ τk “ Cs,k`1 for any s P rds. Č “ y 1 . Note that yk ¨ σ ´1 “ yk since yk has not been mutated in Now let Cd`1,k`1 “ yk and Cd`1,k`1 k k´1 p Furthermore, yk ¨ σ ´1 τ ´1 “ yk ¨ τ ´1 “ yk by the definition of τk so Cd`1,k`1 “ yk ¨ σ ´1 , as µk´1 ˝ ¨ ¨ ¨ ˝ µ0 pQq. k´1 k k k desired. p on the vertices of µ pRk q, We now construct an ice quiver R that is the full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq k 1 1 1 as well as the vertices xr , yr , zr and corresponding frozen vertices xr , yr , zr of any signed 3-cycles Tr of Q where k ă r and zk`1 or yk`1 is a vertex if Tr . Comparing this construction of R to the quiver Rk`1 appearing in Figure 19, we verify that R indeed equals Rk`1 and satisfies the five properties listed as bullet points in Lemma 7.2. Next, suppose that we are in Case ii). In this situation, we have that m “ k ` 1 and the vertices y` , y`1 , z` , and z`1 do not belong to Rk . Now Lemma 7.3 implies that µk pRk q has the form shown in Figure 25. We let Tp (resp. Tq ) be the signed 3-cycle not equal to Tk`1 that contains zk`1 (resp. yk`1 ), if they exist. Define R to be p on the vertices the ice quiver that is a full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq 1 1 yk`1 , yk`1 , zk`1 , zk`1 , trpyk q, zk1 , yk , yk1 , trpxpdqq, x1k , yp , yp1 , zp , zp1 , yq , yq1 , zq , zq1 where we include yp and yp1 (resp. zp , zp1 , yq , yq1 , zq , and zq1 ) in R if and only if yp and yp1 (resp. zq , zq1 , yq , yq1 , zq , and zq1 ) appear in µk pRk q, i.e. depending on if degpyk`1 q “ 4 and if degpzk`1 q “ 4. See Figure 26. Just as above, we claim that the ice quiver R equals Rk`1 and satifies the five bullet points in the statement p that includes every frozen vertex of Lemma 7.2. It is easy to see that R is a full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq p In that is connected to a mutable vertex appearing in Figure 26 by at least one arrow in µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq. k 1 0 particular, µk pRk q has this property and no vertices of Tp or Tq and neither yk`1 nor zk`1 have been mutated in p Furthermore, defining mpk`1q P rns, xp0, k ` 1q, and xp1, k ` 1q P pQq p 0 just as we did in Case µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq. 1 pk`1q i), following Definition 6.1, and using the fact that sgnpTk`1 q “ `, we have m1 and xp1, k ` 1q “ xk`1 . Hence we obtain that 1 trpxp1, k ` 1qq “ trpxk`1 q “ trpyk q and zm “ zk1 , pk`1q ´1 1 as desired. Additionally, the fact that sgnpTk`1 q “ ` also implies that trpyk`1 q “ xk`1 “ yk and x1mpk`1q “ x1k “ yk1 , 1 23 “ k ` 1, xp0, k ` 1q “ zk`1 , µk pRk q “ 1 yk`1 O Ą C 1,k Ą C s,k Ą C d,k yk1  C1,k G  Cs,k E  Cd,k C  yE k o yk`1  xp1, kq ¨ ¨ ¨ xps ´ 1, kq o O O zkO o rp1, kq x x rp2, kq x rps, kq  xps, kq ¨ ¨ ¨ xpd ´ 1, kq o O O x rps ` 1, kq r trpxpd, kqq ^  trpxpd, kqq o O  trpyk q O r kq trpy zk1 1 zk`1 O / zk`1  Figure 25. The quiver obtained by mutating Rk in Case ii). zp1 O  C1,k`1 “ xk ¨ σk´1 ? zp G R “ yp o  yp1 yq1 O 1 CČ 1,k`1 “ xk  zk`1 o  1 zk`1 trpxp1, k ` 1qq o O  yq G  trpyk`1 q o O ( zk1 yk1 yk`1 o  zq  1 yk`1  zq1 Figure 26. The quiver R “ Rk`1 that we obtain in Case ii). as desired. These calculations are reflected in the quiver R shown in Figure 26, thus verifying the first three bullet points of Lemma 7.2. Furthermore, since degpzk q “ 2, there is no signed 3-cycle Tt with k ` 1 ă t such that tr|k`1,t pyt q “ zk`1 in p vertex xt has been mutated exactly once. The fourth bullet point follows. Now observe that µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq r k q “ x1m “ x1k . Since we have applied a maximal green sequence to Qk and since trpxpd, kqq is only connected trpy 1 to the frozen vertex x1k , Proposition 2.10 of [5] implies that trpxpd, kqq “ xk ¨ σk´1 . We thus have the fifth bullet point. Case iii) is similar to Case ii), but with some key differences. In this situation, we again have that m “ k ` 1 but this time both y` and z` are relevant. Now Lemma 7.3 implies that µk pRk q has the form shown in Figure 27. We let Tp (resp. Tq ) be the signed 3-cycles incident to zk`1 (resp. yk`1 ) if they exist. Define R to be the ice p on the vertices quiver that is a full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq 1 1 yk`1 , yk`1 , zk`1 , zk`1 , trpyk q, zk1 , yk , yk1 , trpxpdqq, x1k , y` , y`1 , yp , yp1 , zp , zp1 , yq , yq1 , zq , zq1 where we include yp and yp1 (resp. zp , zp1 , yq , yq1 , zq , and zq1 ) in R if and only if yp and yp1 (resp. zq , zq1 , yq , yq1 , zq , and zq1 ) appear in µk pRk q, i.e. depending on if degpyk`1 q “ 4 and if degpzk`1 q “ 4. See Figure 28. We claim that the ice quiver R has the properties in the statement of Lemma 7.2. It is easy to see that R p That R includes every frozen vertex that is connected to a mutable is a full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq. p follows from the fact that µ pRk q vertex appearing in Figure 28 by at least one arrow in µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq k has this property and from the fact that no vertices of Tp or Tq and neither yk`1 nor zk`1 have been mutated in 24 p Now observe that trpy r k q “ x1m “ x1k . As in Case ii), Proposition 2.10 of [5] implies that µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq. 1 ´1 trpxpd, kqq “ xk ¨ σk . pk`1q Let m1 P rns be the integer from the definition of µk`1 , and let xp0, k ` 1q, xp1, k ` 1q P pQq0 be the vertices from the definition of µk`1 . As in Case ii), we are using the fact that sgnpTk`1 q “ `. Now notice that pk`1q m1 pk`1q “ md “ k ` 1, xp0, k ` 1q “ zk`1 , and xp1, k ` 1q “ xk`1 . We now obtain that trpxpd, k ` 1qq “ trpxk`1 q “ trpyk q, as desired. The fact that sgnpTk`1 q “ ` implies that trpyk`1 q “ xk`1 “ yk . Since degpzk`1 q “ 4, the vertices y` and y`1 both appear in R. Now it is clear that degpzk`1 q “ 4 if and only if tr|k`1,` py` q “ zk`1 and the signed 3-cycle T` has the property that vertex x` has been mutated exactly once in p Hence we see that the vertex y` is positioned in R exactly where yt is positioned in Rk`1 , µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq. see Figure 19. These calculations are reflected in the quiver R shown in Figure 28, and we see that this quiver has the properties that the desired quiver Rk`1 should have. The proof of the five bullet points of Lemma 7.2 in Case iii) concludes in the same way as the proof for Case ii). In addition, we illustrate how in Case iii), for each c P rns satisfying k ă c ď ` there is an ice quiver Rc,` that p Furthermore, we show that is isomorphic to R` and that appears as a full subquiver of µc´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq. R`,` “ R` . This analysis will be used in the argument for Case iv), which is given below. As we are in Case iii), we know that both vertices yk and zk are of degree 4 and the signed 3-cycles Tk , Tk`1 , and T` appear in a full subquiver of Q of the form shown in Figure 29 or 30. It follows that y` and z` , which p will not be mutated until after applying the mutation sequences are incident to zk in µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq, µk , µk`1 , . . . , µr where k ď r ă ` (see Figure 31). To be precise, the quiver in Figure 31 is a full subquiver of p which we define as follows. Letting k ă r ă ` be the integer such that zr “ trpy` q and ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq, µ k´1 1 0 e such that xpe, rq “ xk`1 “ yk , this full subquiver includes the vertices of Rk´1 as well as the mutable vertices of the signed 3-cycles Tmprq “ Tk`1 , Tmprq , . . . , Tmprq , Tmprq “ Tr , as in Definition 6.1, and their corresponding e e´1 2 1 frozen vertices. We now mutate the quiver shown in Figure 31 along µk . By Lemma 7.3, this does not affect the full subquiver p on the vertices pQq p 0 zpRk q0 . Thus we conclude that µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq p has the quiver of µ ˝ ¨ ¨ ¨ ˝ µ ˝ µ pQq k´1 1 0 k 1 0 ´1 shown in Figure 32 as a full subquiver. We observe that the permutation σk´1 has the vertices yk and zk as fixed points. However, τk´1 maps zk ÞÑ trpyk q and fixes yk . These equalities are illustrated in Figure 32. Next, we relabel the vertices of the quiver in Figure 32 to obtain the quiver shown in Figure 33. In particular, since sgnpT` q “ ´ with x` “ zk , note that zk “ xp1, `q, xps, kq “ xps ` 1, `q, and trpyk q “ tr|k,` py` q. Define p on the red vertices appearing in Figure 33, the neighbors Rk`1,` to be the full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq of y` and z` , as well as the frozen vertices to which these all are connected. One observes that Rk`1,` and R` are isomorphic as ice quivers. Furthermore, we will see that Rk`1,` has the same vertices as R` with the exceptions of yk and tr|k,` py` q. p on the set of vertices For k ă c ď `, we define Rc,` analogously as the full subquiver of µc´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq ´1 ´1 ´1 pRk`1,` q0 ¨ τk`1 τk`2 ¨ ¨ ¨ τc´1 . With this definition, we observe that Rc`1,` is identical to Rc,` except possibly at two vertices. In particular, for k ă c ď `, if Tc does not appear in Figure 29 (resp. Figure 30), then the mutation sequence µc does not involve any vertices that appear in Rc,` . Consequently, after mutation by µc , we obtain Rc`1,` “ Rc,` prq On the other hand, when Tc , for k ă c ď `, i.e. c “ ms for some s, does appear in Figure 29 (resp. Figure ´1 30), then the mutation sequence µc , as indicated by bold arrows in Figures 33 and 34, involves vertices yk ¨ σc´1 ´1 ´1 ´1 and zk ¨ σc´1 . In this case, Rc`1,` – Rc,` with the relabeling yk ¨ σc´1 ÞÑ yk ¨ σc´1 and zk ¨ σc´1 ÞÑ zk ¨ σc´1 since each ´1 application of µc permutes these two vertices by τc . This isomorphism of full subquivers follows from Lemma 7.3. prq prq prq We obtain the identity zk ¨ σc´1 “ tr|mprq ,` py` q for ms ď c ă ms´1 when s P r2, es or r “ m1 ď c ă ` s when s “ 1, which is implicit in Figure 34, by Lemma 7.5. We leave this argument until after completing the ´1 proof of Lemma 7.2 (see below). We also observe, by the specialization c “ ` ´ 1, that yk ¨ σ`´1 “ Cd`1,` and 25 yt1 O Ą C 1,k Ą C s,k Ą C d,k yk1 a 1 1 zm ym O O yG t  C1,k G  Cs,k E  Cd,k C  yE k o ym zG m  zkO o µk pRk q “ z` o  z`1  rp1, kq x  xp1, kq ¨ ¨ ¨ xps ´ 1, kq o O O # x rp2, kq (  xps, kq ¨ ¨ ¨ xpd ´ 1, kq o O O  trpxpd, kqq o O + , r trpyk q * x rps, kq x rps ` 1, kq r trpxpd, kqq  trpyk q o O , z1 k  y`  y`1 Figure 27. The quiver obtained by mutating Rk in Case iii). R “ yp o  yp1 zp1 O y`1 O zp G ? y`  zk`1 o  1 zk`1 yq1 O 1 CČ 1,k`1 “ xk  C1,k`1 “ xk ¨ σk´1 ?  trpxp1, k ` 1qq o O # yq G  trpyk`1 q o O ) zk1 yk1 yk`1 o  zq  1 yk`1  zq1 Figure 28. The quiver R “ Rk`1 that we obtain in Case iii). ´1 zk ¨ σ`´1 “ trpy` q. Consequently, we eventually arrive at the configuration in Figure 35 with configurations of the form as in Figure 34 as intermediate steps. In summary, we conclude that R`,` “ R` as desired. Next, suppose we are in Case iv). Since degpzk q “ 2, this case is similar to Case i). However, here we have 1 1 , zm , nor zm . degpyk q “ 2 as well, and so the quiver µk pRk q looks like Figure 22, but without y` , y`1 , z` , z`1 , ym , ym 1 The green vertex yt and yt may or may not appear in the quiver µk pRk q. In the latter case, k “ n and we have p In the former case, we see that t “ k ` 1, and Tt can be realized as applied the entire mutation sequence µ to Q. a signed 3-cycle T` appearing in one of Figures 29 or 30. Now by the argument at the end of Case iii), Rt,t “ Rt is indeed a full subquiver of Figure 35 with the desired properties. The five bullet points of Lemma 7.2 follow immediately. z Lastly, for all four cases, we wish to describe the quiver obtained by µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQ k,k q. To this end, we z z z decompose the vertices of Qk,k into two sets: (1) pQk,k q0 zpRk q0 and (2) pRk q0 X pQk,k q0 . By induction, we have { q “ Qk´1,k´1 ­ ¨ σk´1 µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQk´1,k´1 z { and we observe that ´ pQk,k q0 zpRk q0 Ă¯ pQk´1,k´1 q0 . The fifth bullet point of Lemma 7.3 implies that the quiver 7 z is unchanged by the mutation sequence µ , and the permutation τk fixes µ ˝¨¨¨˝µ ˝µ Q k,k | { k´1 1 0 pQk,k q0 zpRk q0 k 7We define Q ~ z ~ z (resp. Q ) to be the ice quiver that is a full subquiver of Q k,k |pQ k,k |pQ k,k (resp. Qk,k ) on the { { k,k q0 zpRk q0 k,k q0 zpRk q0 z vertices of pQ k,k q0 zpRk q0 . 26 z all vertices in pQ k,k q0 zpRk q0 . It follows that ´ ¯ ´ ¯ z ~ µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 Q “ Q | ¨ σk . k,k |pQ k,k { { pQk,k q0 zpRk q0 k,k q0 zpRk q0 z Additionally, the first bullet point of Lemma 7.3 indicates how the vertices of the second set, i.e. pRk q0 X pQ k,k q0 , are affected by µk . Comparing Figures 19 and 21, we see that the vertices of Rk have been permuted cyclically exactly as described by τk . We conclude that z ~ ~ µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQ k,k q “ Qk,k ¨ τk σk´1 “ Qk,k ¨ σk which completes the proof of Lemma 7.2. αmd`1 ymd`1 ?  βmd`1  Tmd`1 xpd ` 1, `qγmo xpd, `q _ d`1 αmd Tmd / yk2  βmd xpd ´ 1, `q γmd .. . αk`1 xp2, `q _ / yk o αk Tk  xp1, `q _ γk z` Tk`1 / y` T` γ` yk`1 ?  βk`1  zk`1 _ α prq m e´1 T prq m e´1 / ymprq e´1  β prq m xpe ´ 2, rq e´1 β` .. . xp1, rq _ / yr αr Tr βr “  xp0, rq trpy` q Figure 29. A full subquiver of Q showing one possible configuration of the signed 3-cycles Tk , Tk`1 , and T` , as described in the proof of Lemma 7.2 at the end of Case iii). Lemma 7.5. Using the notation from the proof of Lemma 7.2, for any s P r2, es and any c P rns satisfying prq prq ms ď c ă ms´1 , one has zk ¨ σc´1 “ tr|mprq ,` py` q (see Figure 34). Additionally, for any c P rns satisfying s prq r “ m1 ď c ă ` we have zk ¨ σc´1 “ trpy` q. Proof. For c “ k ` 1, we have ´1 zk ¨ σk`1 “ “ “ “ “ “ ´1 zk ¨ σk´1 τk`1 ´1 trpyk q ¨ τk`1 ´1 trpxp1, k ` 1qq ¨ τk`1 xp0, k ` 1q zk tr|k`1,` py` q, (see Figure 32) (using that sgnpTk`1 q “ `) (by the definition of τk`1 ) (by Definition 6.1) (by Definition 6.2) prq as desired. Now suppose that zk ¨ σc´1 “ tr|mprq ,` py` q where s P res and ms s prq prq satisfying ms´1 ď c ă ms´2 we have 27 prq ď c ă ms´1 . Then for c P rns yk`1 = αk`1 αk xp2, `q o βk`1 ! zk`1 a Tk`1 o = yk ! xp1, `q _ Tk γk z` T prq m e´1 / ymprq e´1 prq m e´1 } βmprq e´1 / y` xpe ´ 2, rq T` γ` α  .. β` . xp1, rq a / yr αr Tr βr “ } xp0, rq trpy` q Figure 30. A full subquiver of Q showing the other possible configuration of the signed 3-cycles Tk , Tk`1 , and T` , as described in the proof of Lemma 7.2 at the end of Case iii). zk ¨ σc´1 “ “ “ “ zk ¨ σ ´1prq τ ´1prq ¨ ¨ ¨ τc´1 ms´1 ´1 ms´1 tr|mprq ,` py` q ¨ τ ´1prq ¨ ¨ ¨ τc´1 s ms´1 prq xp1, ms´1 q ¨ τ ´1prq τ ´1prq ¨ ¨ ¨ τc´1 ms´1 ms´1 `1 prq xp0, ms´1 q ¨ τ ´1prq ¨ ¨ ¨ τc´1 m `1 (by induction) prq (note that xp1, ms´1 q “ xps ´ 1, rq) prq (note that xp0, ms´1 q “ xps ´ 2, rq) s´1 “ tr|mprq ,` py` q ¨ τ ´1prq ms´1 `1 s´1 ¨ ¨ ¨ τc´1 prq (note that xp0, ms´1 q “ tr|mprq ,` py` q) s´1 “ tr|mprq ,` py` q, s´1 as desired. We remark that the last equality in the previous computation follows from observing that tr|mprq ,` py` q s´1 is not mutated in any of the mutation sequences µmprq s´1 `1 tations τ ´1prq ms´1 `1 , . . . , µc , and thus it is unaffected by any of the permu- , . . . , τc´1 . By induction, this completes the proof.  8. Additional Questions and Remarks In this section, we give an example to show how our results provide explicit maximal green sequences for quivers that are not of type A. We also discuss ideas we have for further research. 8.1. Maximal Green Sequences for Quivers Arising from Surface Triangulations. The following example shows how our formulas for maximal green sequences for type A quivers can be used to give explicit formulas for maximal green sequences for quivers arising from other types of triangulated surfaces. Example 8.1. Consider the marked surface pS, Mq with the triangulation given as T shown in Figure 36 on the left. The surface S is a once-punctured pair of pants with triangulation T “ T1 \ T2 \ tη, , ζu where α1 , α2 , α3 P T1 and β1 , β2 , β3 , ν P T2 . We assume that the boundary arcs bi with i P r5s contain no marked points except for those shown in Figure 36. The other boundary arcs may contain any number of marked points. As in Section 4, let QT be the quiver determined by T and let vδ P pQq0 denote the vertex corresponding to arc δ P T. We can think of the marked surface pS1 , M1 q determined by c1 , β1 , b1 , c2 , β2 , b2 , β3 , b3 as an m1 -gon where m1 “ #M1 and we can think of T1 as a triangulation of S1 . Similarly, we can think of the marked surface pS2 , M2 q determined by α1 , c3 , η, b5 , c6 , α3 , c5 , b2 , α2 , c4 , b1 as an m2 -gon where m2 “ #M2 and we can think of 28 1 o yk`1 yk1 o yk o yk`1 D 1 zk`1 O Tk`1  zk`1 ] Ą C d,k prq m e´1  xpe ´ 2, rq 5 trpyk q f  Cd,k j / ymprq e´1 T Ą C 1,k  r kq trpy U . xp1, rq Z r trpxpd, kqq Y e´1 / xpe ´ 2, rq1 .. trpxpd, kqq j .. . xp2, kq k 4 1 / ym prq / yr Tr  xp1, rq1  xp0, rq / y1 r / xp0, rq1 rp2, kq x _ C1,k j xp1, kq o [ yt1 o zk1 O x rp1, kq f y`1 O + zk Z yt o / y` T` z`1 o z`  p on the vertices and frozen vertices shown here. Figure 31. The full subquiver of µk´1 ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq 1 yk`1 O 1 zk`1 O yk`1 zk`1 = c prq m e´1 yk1 r  } yk “ yk ¨ σk´1 j Ą C 1,k  {  y` xpe ´ 2, rq trpyk q “ zk ¨ σk´1 o 5 f trpxpd, kqq j .. . 4 xp1, kq k / ymprq e´1 T  zk1 U y`1 r kq trpy Y e´1 / xpe ´ 2, rq1 ..  1 / ym prq . xp1, rq Z  xp1, rq1 Tr  xp0, rq / yr / y1 r / xp0, rq1 rp2, kq x _ C1,k j zk _ o yt1 o x rp1, kq f + z` yt o / z1 ` p on the vertices and frozen vertices shown here. Figure 32. The full subquiver of µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq 29 1 yk`1 O 1 zk`1 O yk`1 zk`1 = c prq m e´1 yk1 r {  y` xpe ´ 2, rq tr|k,` py` q “ zk ¨ σk´1 o 5 g  } yk “ yk ¨ σk´1 j Ą C 1,k  / ymprq e´1 T  trpxpd ` 1, `qq j .. r . trpxpd ` 1, `qq Y xp2, `q k 4 y`1 e´1 / xpe ´ 2, rq1 ..  zk1 T 1 / ym prq . xp1, rq Z  xp1, rq1 Tr  xp0, rq / yr / y1 r / xp0, rq1 rp2, `q x _ C1,k j xp1, `q o _ yt1 o x rp1, `q f + z` yt o / z1 ` Figure 33. The quiver that appears in Figure 32 with its vertex labels updated so that the part of Rk`1,` that appears here looks like the corresponding part of the quiver R` . T2 as a triangulation of S2 . Thus the quiver QTi , determined by Ti , is a type A quiver for i “ 1, 2. Furthermore, we have ,v pv ,v q pv q QT “ QT1 ‘pvβα1 ,vβα2 ,vβα3 q QT2 ‘pvην q R 1 2 3 where : vζ R = vη $ v . By Corollary 6.8, QT1 and QT2 each have a maximal green sequence µQTi for i “ 1, 2. Since R is acyclic, we p where each mutation occurs at a source (for instance, put can define µR to be any mutation sequence of R R R µ “ µv ˝ µvζ ˝ µvη ). Then µ is clearly a maximal green sequence of R. Now Theorem 3.12 implies that µR ˝ µQT2 ˝ µQT1 is a maximal green sequence of QT . Suppose that T1 and T2 are given by the triangulations shown in Figure 36 on the right. Then we have that QT1 and QT2 are the quivers shown in Figure 37 where we think of the irreducible parts of QT1 and QT2 as p1q p2q signed irreducible type A quivers with respect to the root 3-cycles S1 and S1 , respectively. In this situation, QT1 and QT2 have the maximal green sequences µQT1 “ µw1 ˝ µw2 ˝ µvα1 ˝ µp1q ˝ µp1q ˝ µp1q ˝ µp1q 3 2 1 0 µQT2 “ µw4 ˝ µw3 ˝ µp2q ˝ µp2q ˝ µp2q ˝ µp2q ˝ µp2q ˝ µp2q 5 4 3 2 1 0 30 1 yk`1 yk1  yk ¨ σc´1 o _ Ą C d,k ,  Cd,k _ , ^  ´1 4 yk`1 ¨ σc tr|mprq ,` py` q s`1 X[ trpxpd ` 1, `qq ` ! s ¨ σc´1 o zk`1 ¨ σc´1 / ymprq e´1 [ y`1 O xps ` 1, rq ¨ σc´1 O [ zk1 e O  C1,k ] prq me´1 xp1, `q S g / ymprq ¨ σc´1 o 1 xpe ´ 2, rq  xps ´ 2, rq .. 1 / ym prq s´1 . xp1, rq Z  xps ´ 1, rq1 / z1 ` z` prq ms s´1  xps, rq1 yt h / y1 s / ymprq xps ´ 1, rq s´1 [ Tmprq s prq ms`1 ymprq { xps ` 1, rq1 x rp1, `q [ y1 s`1 { xps, rq ¨ σc´1 o O xpd ` 1, `q g .. x rpd ` 1, `q . Q ) r xp2, `q trpxpd ` 1, `qq g J rp2, `q x T yt1 o y1  xpe ´ 2, rq ¨ σc´1 O .. . y` c Ą C 1,k 1 zk`1 O Tr   xps ´ 2, rq1  xp1, rq1 xp0, rq / yr  yr1  xp0, rq1 p where mprq ď c ă mprq Figure 34. The effect of applying µc ˝ ¨ ¨ ¨ ˝ µk`1 to µk ˝ ¨ ¨ ¨ ˝ µ1 ˝ µ0 pQq s . s`1 prq If c “ ms ´ 1, the mutation sequence µmprq is indicated by the bold arrows. Note that, as in s the statement of Lemma 7.5, we have that tr|mprq ,` py` q “ zk ¨ σc´1 . s`1 respectively where µp2q 0 “ µxp2q µp1q 0 “ µxp1q µp2q 1 “ µxp2q ˝ µzp2q ˝ µyp2q µp1q 1 “ µxp1q ˝ µzp1q ˝ µyp1q µp2q 2 “ µxp2q ˝ µzp2q ˝ µzp2q ˝ µyp2q µp1q 2 “ µxp1q ˝ µzp1q ˝ µzp1q ˝ µyp1q µp2q 3 “ µyp2q ˝ µxp2q ˝ µzp2q ˝ µyp2q µp1q 3 “ µyp1q ˝ µxp1q ˝ µzp1q ˝ µyp1q µp2q 4 “ µyp2q ˝ µyp2q ˝ µzp2q ˝ µyp2q µp2q 5 “ µzp2q ˝ µxp2q ˝ µzp2q ˝ µzp2q ˝ µyp2q . 1 1 1 2 1 1 1 1 2 3 2 3 1 1 1 2 3 4 1 1 1 2 1 1 2 3 4 3 2 3 4 5 5 and µR ˝ µQT2 ˝ µQT1 is a maximal green sequence of QT . In general, if we have a quiver QT that can be realized as a direct sum of type A quivers and acyclic quivers, we can write an explicit formula for a maximal green sequence of QT . 31 1 yk`1 CČ d`1,` 4  ´1 1 zk`1 yk`1 ¨ σ`´1  Cd`1,` m \ Ą Cd,` O Cd,` _ + ,   ´1 zk`1 ¨ σ`´1 [ y` trpy` q j c zk1 Q trpxpd ` 1, `qq j Ą C 1,`  C1,` ] xpd ` 1, `q i .. x rpd ` 1, `q . U ) o x rp2, `q xp2, `q Y xp1, `q o T yt1 o rp1, `q x ´1 o / ymprq ¨ σ`´1 e´1 y1 prq me´1  ´1 o  xpe ´ 2, rq ¨ σ`´1 xpe ´ 2, rq1 y`1 .. . r trpxpd ` 1, `qq M ´1 / yr ¨ σ ´1 xp1, rq ¨ σ`´1 O ] O `´1  ´1 xp1, rq1xp0, rq ¨ σ`´1 yr1 O f xp0, rq1 *z yt o / z1 ` ` p where Cd`1,` “ yk ¨σ ´1 Figure 35. The effect of applying µ`´1 ˝¨ ¨ ¨˝µk`1 to µk ˝¨ ¨ ¨˝µ1 ˝µ0 pQq `´1 1 Č and Cd`1,` “ y , as desired. The mutation sequence µ is indicated by the bold arrows. k ` c3 α1 β1 b1 c4 c2  T1 c1 α2 β2 T2 η ζ b4 ν b2 b5 c5 α3 β3 b3 c6 Figure 36. Problem 8.2. Find explicit formulas for maximal green sequences for quivers arising from triangulations of surfaces. Using Corollary 4.5, we can reduce Problem 8.2 to the problem of finding explicit formulas for maximal green sequences of irreducible quivers that arise from a triangulated surface. In [1], the authors sketch an argument showing the existence of maximal green sequences for quivers arising from triangulated surfaces. However, we 32 ? QT1 = p1q x1 o p1q y1 p1q T1 ?  p1q z1 _ p1q T3 / y p1q o 2 p1q T2 p1q y3  / w1 o p1q z3 w2 o vα1  p1q z2 p2q y4 ? ? QT2 = p2q x1 o p2q y1 p2q T1 ?  p2q z1 _ p2q / y p2q o 2 T2  p2q y3 p2q T3 / w3 p2q z2  p2q T4 o p2q z4  p2q z3 _ / y p2q 5 p2q T5 p2q z5  / w4 Figure 37. would like to prove the existence of maximal green sequences by giving explicit formulas for maximal green sequences of such quivers. Some progress has already been made in answering Problem 8.2. In [17], Ladkani shows that quivers arising from triangulations of once-punctured closed surfaces of genus g ě 1 have no maximal green sequences. In [7, 8], explicit formulas for maximal green sequences are given for specific triangulations of closed genus g ě 1 surfaces. In [9], a formula is given for the minimal length maximal green sequences of quivers defined by polygon triangulations. It would be interesting to understand, in general, what are the possible lengths that can be achieved by maximal green sequences of a given quiver. 8.2. Trees of Cycles. Our study of signed irreducible type A quivers was made possible by the fact that such quivers are equivalent to labeled binary trees of 3-cycles (see Lemma 5.6). It is therefore reasonable to ask if one can find explicit formulas for maximal green sequences of quivers that are trees of cycles where each cycle has length at least k ě 3. In our construction, we define a total ordering and a sign function on the set of 3-cycles of an irreducible type A quiver (with at least one 3-cycle), and this data was important in discovering and describing the associated mutation sequence. One could use a similar technique to construct an analogue of the associated mutation sequence for quivers that are trees of oriented cycles. Problem 8.3. Find a construction of maximal green sequences for quivers that are trees of oriented cycles. 8.3. Enumeration of Maximal Green Sequences. In the process of revising this paper, the problems posed in this section have been solved. For posterity, we keep this section as it appeared in the original arXiv version. A solution to Problem 8.4 appears in [12]. A solution to Problem 8.5 appears in [9]. For a given signed irreducible type A quiver Q with root 3-cycle T and with at least two 3-cycles our construction produces a maximal green sequence µ “ µpT q of Q for each leaf 3-cycle in Q. It would be interesting to see how many maximal green sequences of Q can be obtained from the maximal green sequences µ as the choice of the root 3-cycle T varies. Problem 8.4. Determine what maximal green sequences of Q can be obtained via commutation relations and Pentagon Identity relations applied to the maximal green sequences in tµpT q : T is a leaf 3-cycleu. Additionally, in [5] there are several tables giving the number of maximal green sequences of certain small rank quivers by length. These computations may be useful for making progress on the problem of enumerating maximal green sequences of quivers. As discussed in Remark 6.6, the associated mutation sequences constructed here are not necessarily the shortest possible maximal green sequences. This motivates the following problem. Problem 8.5. Provide a construction of the maximal green sequences of minimal length, possibly by showing how to apply Pentagon Identity relations to the associated mutation sequences. 33 8.4. Further Study of Maximal Green Sequences. Note that maximal green sequences of a quiver Q can be thought of as maximal chains (from the unique source to the unique sink) in the oriented exchange graph [5, Section 2]. In the case that Q is of type A, the exchange graph is an orientation of the 1-skeleton of the associahedron. The oriented exchange graph is especially nice in the case when Q is a Dynkin quiver (i.e. an acyclic orientation of a Dynkin diagram of type A, D, or E). For example, it is the Hasse graph of the Tamari lattice in the case Q is linear and equioriented and it is the Hasse graph of a Cambrian lattice (in the sense of Reading [20]) as is noted in [15, Section 3]. In particular, this means that we consider the finite Coxeter group G whose Dynkin Diagram is the unoriented version of Q and a choice of Coxeter element c compatible with the orientation of Q and then maximal green sequences are in bijection with maximal chains in the Cambrian lattice, a quotient of the weak Bruhat order on G. Note, that this bijection is studied further in [19] where each c-sortable word is shown to correspond to a green sequence. To indicate the difficulty of describing the set of maximal green sequences once we consider quivers with cycles, we focus on the A3 case here. In the case where Q is a 3-cycle (with 1 Ñ 2, 2 Ñ 3, 3 Ñ 1), there is not a corresponding Cambrian congruence that one can apply to the weak Bruhat order on the symmetric group G “ S4 to obtain the desired Hasse diagram. In particular, the corresponding Cambrian lattice is constructed from the geometry of the affine Ã2 root system instead of from a finite Coxeter group. Intersecting this coarsening of the Coxeter Lattice with the Tits Cone yields 11 regions rather than the 14 we obtain in the acyclic case [21]. Nonetheless, we can still compute maximal green sequences in this case, and see that they are indeed the set of oriented paths through a certain orientation of the 1-skeleton of the associahedron. There are six possible maximal green sequences of length 4: µ1 ˝ µ3 ˝ µ2 ˝ µ1 , µ2 ˝ µ1 ˝ µ3 ˝ µ2 , µ3 ˝ µ2 ˝ µ1 ˝ µ3 , µ3 ˝ µ1 ˝ µ2 ˝ µ1 , µ1 ˝ µ2 ˝ µ3 ˝ µ2 , and µ3 ˝ µ2 ˝ µ1 ˝ µ3 . We can find three more maximal green sequences of length 5: µ2 ˝ µ3 ˝ µ2 ˝ µ1 ˝ µ2 , µ3 ˝ µ1 ˝ µ3 ˝ µ2 ˝ µ3 , and µ1 ˝ µ2 ˝ µ1 ˝ µ3 ˝ µ1 . As in Figure 22 of [5], there are no other maximal green sequences of this quiver. To obtain these sequences of length 5, we select any of the first three maximal green sequences of length 4. We then apply the relation µi`1 ˝ µi „ µi`1 ˝ µi ˝ µi`1 (where the arithmetic is carried out mod 3) and apply the vertex permutation pi, i ` 1q to the vertices at which one mutates later in the sequence. In an attempt to understand this example in terms of the Coxeter group of type A3 , i.e. S4 , we consider the presentation described in [4] for quivers with cycles. In this case, if we let s1 “ p14q, s2 “ p24q, s3 “ p34q, we obtain S4 “ xs1 , s2 , s3 : s21 “ s22 “ s23 “ ps1 s2 q3 “ ps2 s3 q3 “ ps3 s1 q3 “ ps1 s2 s3 s2 q2 “ 1y. Unlike the acyclic A3 case where the permutation in S4 corresponding to the longest word, i.e. 4321, is the only element of S4 whose length as a reduced expression, e.g. s1 s2 s3 s1 s2 s3 , is of length 6, in the Barot-Marsh presentation, the permutations 4321, 3412, 2143, 1342, and 1432 all have reduced expressions of maximal length, namely 4. Further, if we visualize the order complex of S4 under this presentation, we obtain a torus (see Example 3.1 of [3]) rather than a simply-connected surface like the acyclic case and there are no permutations with reduced expression of length 5, hence reduced expressions in this presentation cannot correspond to maximal green sequences. We thank Vic Reiner for bringing his paper with Eric Babson to our attention. Hence, understanding the full collection of maximal green sequences for other quivers with cycles, even those of type A, appears to require more than an understanding of the associated Coxeter groups. Since our original preprint, in recent work [12] (resp. [13]) of the first author and Thomas McConville, an analgoue of the weak order on Sn , known as the lattice of biclosed subcatgories (resp. biclosed sets of segments) is constructed. In [12] and [13], it is shown that the oriented exchange graph of quivers of type A can be obtained as a lattice quotient of these. This lattice congruence generalizes the Cambrian congruence in type A. Additionally, the results in [12] and [13] do require techniques from representation theory of finite dimensional algebras, which further suggests that understanding the full collection of maximal green sequences for quivers with cycles may require more than elementary techniques. References [1] M. Alim, S. Cecotti, C. Córdova, S. Espahbodi, A. Rastogi, and C. Vafa. BPS quivers and spectra of complete N “ 2 quantum field theories. Communications in Mathematical Physics, 323(3):1185–1227, 2013. [2] C. Amiot. Cluster categories for algebras of global dimension 2 and quivers with potential. In Annales de linstitut Fourier, volume 59, pages 2525–2590. Association des Annales de linstitut Fourier, 2009. [3] E. Babson and V. Reiner. Coxeter-like complexes. Discrete Mathematics & Theoretical Computer Science, 6(2):223–252, 2004. [4] M. Barot and R. Marsh. Reflection group presentations arising from cluster algebras. Transactions of the American Mathematical Society, 367(3):1945–1967, 2015. 34 [5] T. Brüstle, G. Dupont, and M. Pérotin. On maximal green sequences. International Mathematics Research Notices, 2014(16):4547–4586, 2014. [6] A. B. Buan and D. F. Vatne. Derived equivalence classification for cluster-tilted algebras of type An . J. Algebra, 319(7):2723–2738, 2008. [7] E. Bucher. Maximal green sequences for cluster algebras associated to the n-torus. arXiv preprint arXiv:1412.3713, 2014. [8] E. Bucher and M. R. Mills. Maximal green sequences for cluster algebras associated to the orientable surfaces of genus n with arbitrary punctures. arXiv preprint arXiv:1503.06207, 2015. [9] E. Cormier, P. Dillery, J. Resh, K. Serhiyenko, and J. Whelan. Minimal length maximal green sequences and triangulations of polygons. arXiv preprint arXiv:1508.02954, 2015. [10] H. Derksen, J. Weyman, and A. Zelevinsky. Quivers with potentials and their representations II: applications to cluster algebras. J. Amer. Math. Soc., 23(3):749–790, 2010. [11] S. Fomin, M. Shapiro, and D. Thurston. Cluster algebras and triangulated surfaces. part I: Cluster complexes. Acta Mathematica, 201(1):83–146, 2008. [12] A. Garver and T. McConville. Lattice properties of oriented exchange graphs and torsion classes. arXiv preprint arXiv:1507.04268, 2015. [13] A. Garver and T. McConville. Oriented flip graphs and noncrossing tree partitions. arXiv preprint arXiv:1604.06009, 2016. [14] B. Keller. On cluster theory and quantum dilogarithm identities. In Representations of Algebras and Related Topics, Editors A. Skowronski and K. Yamagata, EMS Series of Congress Reports, European Mathematical Society, pages 85–11, 2011. [15] B. Keller. Quiver mutation and combinatorial DT-invariants. FPSAC 2013 Abstract, 2013. [16] M. Kontsevich and Y. Soibelman. Motivic donaldson-thomas invariants and cluster transformation. arXiv preprint arXiv:0811.2435, 2008. [17] S. Ladkani. On cluster algebras from once punctured closed surfaces. arXiv preprint arXiv:1310.4454, 2013. [18] G. Muller. The existence of a maximal green sequence is not invariant under quiver mutation. arXiv preprint arXiv:1503.04675, 2015. [19] Y. Qiu. C-sortable words as green mutation sequences. Proceedings of the London Mathematical Society, 111(5):1052–1070, 2015. [20] N. Reading. Cambrian lattices. Advances in Mathematics, 2(205):313–353, 2006. [21] N. Reading and Speyer D. personal communication. [22] A. I. Seven. Maximal green sequences of exceptional finite mutation type quivers. Symmetry, Integrability and Geometry. Methods and Applications, 10, 2014. 35
0math.AC
Detecting the Moment of Completion: Temporal Models for Localising Action Completion Farnoosh Heidarivincheh, Majid Mirmehdi, and Dima Damen arXiv:1710.02310v1 [cs.CV] 6 Oct 2017 Computer Science Department, University of Bristol, Bristol, BS8 1UB, UK [email protected] Abstract. Action completion detection is the problem of modelling the action’s progression towards localising the moment of completion - when the action’s goal is confidently considered achieved. In this work, we assess the ability of two temporal models, namely Hidden Markov Models (HMM) and Long-Short Term Memory (LSTM), to localise completion for six object interactions: switch, plug, open, pull, pick and drink. We use a supervised approach, where annotations of pre-completion and post-completion frames are available per action, and fine-tuned CNN features are used to train temporal models. Tested on the Action-Completion-2016 dataset from [1], we detect completion within 10 frames of annotations for ∼75% of completed action sequences using both temporal models. Results show that fine-tuned CNN features outperform hand-crafted features for localisation, and that observing incomplete instances is necessary when incomplete sequences are also present in the test set. Keywords: action completion, action recognition/detection, Convolutional Neural Network, Long-Short Term Memory, Hidden Markov Model 1 Introduction An action is defined, based on the Oxford dictionary, as the fact or process of doing something, typically to achieve an aim. Previous works on action recognition from visual data have overlooked assessing whether the action’s aim has actually been achieved, rather than merely attempted. Similarly, action localisation approaches detect the start and the end of an action’s attempt, without assessing whether the aim has been successfully achieved. The notion of assessing completion was introduced in [1] where the performance of a variety of hand-crafted RGB-D features to distinguish between complete and incomplete sequences was reported, using a binary classifier which was learnt per action. However, the approach in [1] considered the sequence as a whole and classified it as either complete or incomplete. In this work, we closely examine the progression of the action and attempt to locate the moment in time when the action can indeed be considered completed. Temporal localisation of the moment of completion is a step towards an online approach that can detect completion once the action’s goal has been achieved. Completion could prompt reminders or guidance for the next action. For example, when preparing a food recipe, the user could be notified to wash the vegetables once these have been picked up. Thus, we define the problem of ‘detecting the moment of completion’ as detecting the frame that separates pre-completion from post-completion per sequence, when present. Note that the ‘moment of completion’ is different from the typical ‘start’/‘end’ frames in action localisation. The former focuses on the action’s goal, while the latter focuses on the start and conclusion of any motion of relevance to the action. Consider the action ‘drink’; the action is completed when the subject consumes some of the beverage from a cup or glass. 1 Fig. 1. Complete and incomplete sequences for action switch are performed similarly up to the completion moment, after which an observer would confidently confirm completion. In this example, completion occurs as soon as the light is off. The pre- and post-completion frames are shown in orange and purple bordering, respectively. Traditionally, localisation approaches locate the first movement of the hand as it lifts the cup up to the mouth, all the way to putting the cup down. Even if drinking does not actually take place, the start and end of the hand motion is localised. In contrast, the moment of completion is as soon as the subject actually drinks the beverage. The moment of completion cannot be localised when the action’s goal has not been completed. In detecting the moment of completion, we take a supervised approach, where we observe complete and incomplete sequences for the same action. Up to the moment of completion, both complete and incomplete sequences would be similar, and an observer cannot confidently say if the action is going to be completed. The sequences differ after the completion takes place. Fig. 1 illustrates this notion using two sequences of action switch from the dataset in [1]. In this example, our approach detects the moment the light is observed to be switched off, as the moment of completion - whereas in [1] the aim was to label the entire sequence as complete/incomplete. Completing an action makes changes in the scene which can be considered as visual cues for detecting completion. We propose an approach for completion detection in which these learnt signatures are trained using Convolutional Neural Network (CNN) features along with a temporal model to encode the action’s evolution, similar to [2,3,4]. This approach is particularly useful for action/activity detection tasks, where the classification per frame depends not only on the observations of the current frame but also on the information passed from previous frames. Hidden Markov Models (HMMs) and Long-Short Temporal Memory models (LSTMs) are two temporal models, suitable for dealing with sequential input data and capable of handling frame by frame analysis of an action sequence. In this work, we compare HMM and LSTM for completion detection on six action classes. The remainder of this paper is organised as follows: related work in Sec. 2, the proposed method and features used in Sec. 3, results in Sec. 4 and conclusion and future work in Sec. 5. 2 2 Related Work We now present a brief review of related works in action recognition/detection and discuss which methods could be applied for completion detection. Remarkable results for action recognition/detection have been achieved through extracting robust features, encoding them, then feeding them into classification methods [5]. For example, [6,7,8,9,10,11,12,13] extract space-time features from interest points or dense trajectories, encode them using BoWs or FVs, and then use SVM to recognise the actions. Such approaches do not model the temporal dynamics of actions explicitly, thus cannot provide per-frame detection. Recently, CNN features of spatial and temporal information have been used for action recognition/detection using dual streams [14,15] or 3D convolutions [16,17]. A seminal work of Wang et al. [13] encodes the transformations an action introduces to the scene from precondition into effect. Although their approach is similar to ours, focussing on the changes that actions make into the scene, they perform action recognition without an explicit temporal encoding, which makes the approach unsuitable for frame level analysis or detecting the moment of completion. Many recent works on action recognition/detection, such as [2,3,4,18,19], take advantage of CNN models to extract features from their last fully-connected layers in order to have a good representation of spatial information per frame. Then, they also train a temporal model on top of the extracted features to encode the dynamics of the action. This approach suits our completion detection task in two ways. First, extracting features from the CNN helps to encode the appearance changes in the scene. Second, it uses a temporal model and can provide per-frame decisions, while considering the context. Two temporal models widely applied for action recognition/detection are HMMs and LSTMs. HMM and its variants have been widely used in action recognition/detection to model temporal dynamics of actions [20,21,22,23,24,25]. For this purpose, an HMM model is usually trained per desired class. Then, the likelihood of a test sequence to belong to each model is evaluated and classification is performed by specifying the model which produces the maximum likelihood for the sequence. To detect completion, we similarly learn a single supervised HMM model per action, with two hidden states pre-completion/post-completion, then use the Viterbi algorithm to find the most likely label sequence. LSTM, as another temporal model designed to deal with sequential information, is able to capture long-term dependencies in the input data, using the memory inside each cell. In many recent works, LSTMs have achieved promising results for the task of action recognition/detection, such as [26,18,27,28,2,3]. The closest work to ours, [1], extracts skeletal features from depth data which are temporally encoded by Fourier temporal pyramid for recognising sequence-level completion. As they use a sequence-level representation, the method is not suitable for per-frame decisions. In this work, we go beyond sequence-level completion to, (i) achieve frame-level detection of the moment of completion, (ii) show fine-tuned appearance features outperform pretrained and previously used skeletal features for completion detection, (iii) report results on six actions from the previously introduced action completion dataset [1], and (iv) compare per-action HMM and LSTM temporal models. Using fine-tuned appearance features, we detect the moment of completion for six different actions - within 10 frames - for 75.1% and 74.6% of the sequences by HMM and LSTM models, respectively. 3 Proposed Method for Detecting Completion To present our proposal for detecting action completion, we first consider the underlying assumptions of the model, and then discuss how we use per-frame features and train two temporal models, HMMs and LSTMs. We make three reasonable assumptions, namely; 3 Fig. 2. Overall scheme of the proposed method for completion detection (of action plug):: CNN features are extracted per frame and fed into the temporal model (LSTM or HMM). The outputs pre and post represent pre- and post-completion labels, respectively. Fig. 3. An HMM model for completion detection encodes that the model starts at pre- state, and cannot transiting back to pre- state once at post- state. – Temporally Segmented Sequences: We assume sequences include a single instance of the action that has not been completed at the beginning of the sequence, and the action is not repeated within the sequence. Accordingly, we only need to detect a single moment of completion per sequence, if at all. The sequences do not include cases where the subject undertakes steps to undo the completion, e.g. a person places the cup down after picking it up. – Momentary Completion: we assume completion could be detected using a single frame in the sequence. This is typically the first frame where a human observer would be sufficiently confident that the goal has been achieved. All frames prior to the completion localisation are pre-completion and all frames from the completion moment onwards indicate post-completion. For an incomplete sequence, all the frames would be labelled as pre-completion. – Uniform Prior for Completion: in a Bayesian setting one might wish to consider the prior probability of an action being completed. Consider that the prior probability for a person to forget to switch off the light in their home is 0.01. A method that thus assumes completion for every sequence will have a high accuracy but is nevertheless not 4 suitable for completion detection. Thus, we assume a uniform prior (i.e. 50-50 chance) for an action to be completed. Fig. 2 illustrates the overall scheme of the proposed method, which relies on per-frame features, optimised to classify pre-completion and post-completion frames. We test handcrafted, pre-trained and fine-tuned CNN features for per-frame representations. For handcrafted features, we evaluate the best skeletal feature from [1], namely Joint-Velocities (JV), as well as the best raw-depth feature, namely Local Occupancy Patterns (LOP) [29]. We also test hand-crafted RGB features, namely Histogram of Oriented Gradients (HOG). For CNN features, we use the “very deep VGG-16-layer” model [30] trained on UCF101 action dataset [14], as pre-trained features. We also fine-tune these models per action for two classes: pre-completion and post-completion, using leave-one-subject-out. Features are then extracted from the fc7 layer for both the pre-trained and fine-tuned CNNs. Completion detection is then trained as a temporal model and evaluated using two temporal approaches: HMM: A supervised HMM model with two hidden states is trained per action. Fig. 3 illustrates this model. The parameters of this HMM, i.e. initial and transition probabilities, in addition to covariance matrices and mean vectors of two multivariate Gaussians (for the two states of pre- and post-completion) are computed from the training data. Note that, due to the assumptions made for completion detection, in this supervised HMM model, the initial probabilities for pre- and post- completion states are learned from training data to be 1 and 0, respectively. Also, the probability of transitioning from post-completion state to pre-completion state is learned to be 0, as the sequence remains in post-completion state once it transitions to it. LSTM: The LSTM model is also trained per action. For this purpose, the frames’ CNN features, along with the frames’ labels (pre- or post-completion), are fed into an LSTM network. The LSTM is optimised using Stochastic Gradient Descent with back-propagation. Also, the labels per frame are predicted using a softmax layer on top of the LSTM hidden layer. The details of the LSTM architecture are presented in Sec 4. In presenting results, we also evaluate the need for training using incomplete sequences per action. For these results, we only train on labeled complete sequences. This aims to assess when completion detection requires, or benefits from, observing incompletion. 4 Experimental Results Dataset and Completion Annotation: We use the RGBD-AC dataset from [1], which contains both complete and incomplete sequences for the same action. It contains 414 complete and incomplete sequences of six actions: switch, plug, open, pull, pick and drink. However, the annotations provided by the dataset are sequence-level annotations. Thus, we re-annotate each sequence in the dataset for the moment of completion. An annotation corresponding to the completion moment is assigned to every complete sequence by one human observer. Implementation Details: As noted earlier, we use a pre-trained spatial stream CNN from [14] which uses the VGG-16 architecture [30], fine-tuned on UCF101 action dataset [31]. We perform Leave-One-Person-Out cross validation on the 8 subjects in the dataset. For finetuning, 15 epochs are performed, and the learning rate is started at 10−3 , divided by 10 at epochs 3 and 5, and fixed thereafter. All the other hyper-parameters are set similar to [15]. The 4096-dimension f c7 features are extracted per frame. We test the full dimension as well as applying dimensionality reduction via PCA, as this proves essential for training the HMM. Without applying PCA, the HMM remains in the pre5 switch plug open pull pick drink Total precision recall F1 -score precision recall F1 -score precision recall F1 -score precision recall F1 -score precision recall F1 -score precision recall F1 -score JV 78.0 86.0 81.8 43.0 76.4 55.0 56.9 85.1 68.2 57.6 69.6 63.0 62.9 82.3 71.3 66.2 94.9 78.0 LOP 99.0 36.8 53.7 23.8 56.3 33.4 NA 0 NA 77.8 11.5 20.0 93.7 65.7 77.3 96.1 43.4 59.8 HOG PT-CNN FT-CNN 99.8 99.7 99.8 95.1 100 100 97.4 99.9 99.9 100 82.4 99.5 9.3 21.0 94.5 17.1 33.4 97.0 NA 80.9 99.9 0 9.2 36.2 NA 16.6 53.2 100 100 99.9 44.1 14.5 94.6 61.2 25.3 97.2 100 83.1 88.7 3.8 56.3 97.4 7.3 67.1 92.9 95.6 68.2 84.7 13.7 32.4 90.8 24.0 43.9 87.6 precision 61.5 63.2 recall 85.1 36.1 F1 -score 71.4 46.0 99.1 30.2 46.3 84.3 39.8 54.1 92.4 89.0 90.6 Table 1. Comparing features for completion detection using PCA-HMM. completion state and never goes to post-completion. We keep the number of components that encapsulates at least 90% of the variance. LSTM however, does not require dimensionality reduction, and indeed we see a slight drop in performance when PCA is applied. Hence, for all results reported below, we use PCA-HMM or LSTM for the temporal models. The LSTM model has one hidden layer with 128 units. After a random initialisation, 25 epochs are performed for training. The learning rate is 10−3 for the first epoch and is fixed at 10−4 for the next epochs. For each test sequence, the output of HMM’s Viterbi algorithm and LSTM are validated against ground truth labels. Evaluation Metrics: Due to the imbalance in the number of pre- and post-completion labels, we present precision and recall results, where the post-completion is considered as the positive class. For comparison, F1 -score percentage is also reported. While precision, recall and F1 -score are suitable for comparing per-frame decisions, we wish to evaluate the accuracy with which the moment of completion is detected. Thus, we introduce a cumulative metric for evaluating completion detection that captures the difference between the labelled and estimated moment of completion, N  1 X (pseq − gseq ) ≤ i C(i) = N seq=1 (1) where gseq and pseq correspond to the first post-completion label in ground truth and predicted labels, respectively, i is the shift between the predicted and true completion frames, [.] is a boolean function, and N is the number of sequences. We do not use the absolute difference in frames, so that for complete sequences, we can capture whether detection takes 6 place prematurely, or is overdue per action. When completion is not detected, pseq = ∞. Also, for incomplete sequences gseq = 0. We report these results as a cumulative graph of i vs C(i), for complete and incomplete sequences of each action, independently. The optimal plot for complete sequences is one that shows a step function from 0 to 1 when i = 0. The optimal graph for incomplete sequences would thus be a flat line at 0. Feature evaluation: We compare fine-tuned CNN features (FT-CNN) features to the other hand-crafted and pre-trained features using PCA-HMM in Table 1. As can be seen, FT-CNN has the highest F1 -score in total which shows its ability to represent the subtle changes in the scene observed after completion. Temporal Model evaluation: The results of comparing PCA-HMM with LSTM per action (using CNN features), are summarised in Table 2 and shown in Fig. 4. Also, the combined results for all six actions in the dataset are shown in Fig. 5. The figure shows that while LSTM detects completion more frequently - in fact completion is detected for 96.7% of the complete sequences using LSTM, compared to 88.5% using PCA-HMM, LSTM is more likely to detect completion in incomplete sequences as well. The slightly delayed detection by PCA-HMM could be because of its low transition probability (less than 1%) to go from pre- to post-completion state. Also, it should be noted that, since LSTM does not learn any definite constraint on its transitions, it can transit back from post-completion to precompletion, while PCA-HMM is forced to remain in post-completion. The results also show that action switch is the nearest to the ground truth for both temporal models, which is due to the obvious change it introduces to the scene. In contrast, action open has the worst performance, probably due to the subtle change it introduces to the environment. switch plug open pull pick drink total LSTM PCA+HMM precision 100 99.8 recall 99.7 100 F1 -score 99.9 99.9 precision 92.2 99.5 recall 96.0 94.5 F1 -score 94.0 97.0 precision 84.8 99.9 recall 69.1 36.2 F1 -score 76.2 53.2 precision 96.0 99.9 recall 96.5 94.6 F1 -score 96.2 97.2 precision 75.6 88.7 recall 96.1 97.4 F1 -score 84.7 92.9 precision 82.1 84.7 recall 91.9 90.8 F1 -score 86.7 87.6 precision recall F1 -score 87.7 92.7 90.1 92.4 89.0 90.6 Table 2. Comparing LSTM and PCA-HMM using FT-CNN features. 7 plug switch 1 Ground truth PCA+HMM LSTM 0.8 open pick pull drink 1 1 1 1 1 0.8 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0 -150 -100 -50 0 50 100 0 -150 -100 -50 0 50 100 0 -150 -100 -50 0 50 100 0 -150 -100 -50 0 50 100 0.2 0 -150 -100 -50 0 50 100 0 -150 1 1 1 1 1 1 0.8 0.8 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0 0 0 100 200 300 0 0 100 200 300 0 0 100 200 300 100 200 300 -50 0 50 100 0.2 0 0 -100 0 0 100 200 300 0 100 200 300 Fig. 4. LSTM vs PCA-HMM for complete (top) and incomplete (bottom) sequences. 1 0.8 1 Ground truth PCA+HMM LSTM 0.8 0.6 0.6 0.4 0.4 0.2 0.2 0 -150 0 -100 -50 0 50 100 0 100 200 300 Fig. 5. Results for complete (left) and incomplete (right) sequences across the six actions The need for observing incomplete sequences: In theory, completion detection could use any dataset (which only contains complete sequences), as both pre- and post-completion labels are present in complete sequences. In this experiment, we train PCA-HMM on only complete sequences, but test on both complete and incomplete sequences. The results are shown in Fig 6. As seen, while performance is slightly improved for detecting completion in complete sequences, particularly for actions open and pull, the performance on incomplete sequences clearly deteriorates. The method tends to label completion when the action is not completed, (especially for actions switch and drink ). This shows that training only on complete sequences may cause the CNN learn incorrect features for completion detection and supports the need for learning from both complete and incomplete sequences. In Fig. 7, we present some qualitative success and failure results for detecting completion. 5 Conclusion and Future Work This paper presents action completion detection as the task of localising the moment in time when a human observer believes an action’s goal has been achieved, for example an object has been picked up, or the light has been switched off. The approach goes beyond sequence-level recognition of completion towards frame level fine-grained perception of completion. We proposed a supervised approach for detecting completion per action. Fine-tuned CNN features were extracted per-frame and used to train temporal models. Two widely used 8 plug switch Ground truth Train on whole dataset Train on only complete 1 0.8 open pick pull drink 1 1 1 1 1 0.8 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0 -150 -100 -50 0 50 100 0 -150 -100 -50 0 50 100 0 -150 -100 -50 0 50 100 0 -150 -100 -50 0 50 100 0.2 0 -150 -100 -50 0 50 100 0 -150 1 1 1 1 1 1 0.8 0.8 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 0.2 0 0 100 200 300 0 0 0 100 200 300 0 0 100 200 300 100 200 300 -50 0 50 100 0.2 0 0 -100 0 0 100 200 300 0 100 200 300 Fig. 6. The PCA-HMM model is trained only on complete sequences, then tested on complete (top) and incomplete (bottom) sequences. temporal models, HMM and LSTM, were applied and their results were validated against the ground truth pre- and post-completion labels. We showed that, for detecting completion, fine-tuned CNN features outperform pre-trained and hand-crafted features, as they capture the subtle changes in the scene when the action is completed. We also introduced a metric for completion detection to assess when completion is prematurely detected or when the decision is overdue. We showed that both temporal models (LSTM and PCA-HMM) can detect completion within 10 frames in ∼75% of complete sequences. However, we found that PCA-HMM outperforms LSTM on incomplete sequences. We aim to pursue two directions for future work. First, we aim to search for novel temporal models that particularly aim at completion detection, and can work in untrimmed videos. Second, we aim to test the method on other datasets including a variety of actions for a wider understanding of action completion detection. References 1. Heidarivincheh, F., Mirmehdi, M., Damen, D.: Beyond action recognition: Action completion in rgb-d data. In: British Machine Vision Conference (BMVC). (2016) 2. Ma, S., Sigal, L., Sclaroff, S.: Learning activity progression in lstms for activity detection and early detection. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2016) 3. Yeung, S., Russakovsky, O., Jin, N., Andriluka, M., Mori, G., Li, F.F.: Every moment counts: Dense detailed labeling of actions in complex videos. arXiv preprint arXiv:1507.05738 (2015) 4. Lei, J., Li, G., Zhang, J., Guo, Q., Tu, D.: Continuous action segmentation and recognition using hybrid convolutional neural network-hidden markov model model. IET Computer Vision (2016) 5. Kang, S.M., Wildes, R.P.: Review of action recognition and detection methods. arXiv preprint arXiv:1610.06906 (2016) 6. Zhang, H., Zhou, W., Reardon, C., Parker, L.E.: Simplex-based 3d spatio-temporal feature description for action recognition. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2014) 7. Laptev, I., Marszalek, M., Schmid, C., Rozenfeld, B.: Learning realistic human actions from movies. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2008) 8. Niebles, J.C., Wang, H., Fei-Fei, L.: Unsupervised learning of human action categories using spatial-temporal words. International Journal of Computer Vision (2008) 9. Gilbert, A., Illingworth, J., Bowden, R.: Scale invariant action recognition using compound features mined from dense spatio-temporal corners. In: European Conference on Computer Vision (ECCV). (2008) 9 (a) (b) (c) (d) Fig. 7. sample sequences of success and failure for completion detection for both PCA-HMM and LSTM: (a) PCA-HMM has an early detection by 1 frame, (b) LSTM has a late detection by 1 frame, (c) PCA-HMM is delayed by 7 frames (6 frames omitted for space), while LSTM is delayed by 1 frame, (d) both PCA-HMM and LSTM fail to detect completion. 10. Matikainen, P.K., Hebert, M., Sukthankar, R.: Trajectons: Action recognition through the motion analysis of tracked features. In: ICCV Workshop on Video-Oriented Object and Event Classification. (2009) 11. Wang, H., Kläser, A., Schmid, C., Liu, C.L.: Dense trajectories and motion boundary descriptors for action recognition. International Journal of Computer Vision (2013) 12. Wang, H., Schmid, C.: Action Recognition with Improved Trajectories. In: IEEE International Conference on Computer Vision (ICCV). (2013) 13. Wang, X., Farhadi, A., Gupta, A.: Actions ˜ transformations. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2016) 14. Simonyan, K., Zisserman, A.: Two-stream convolutional networks for action recognition in videos. In: Advances in Neural Information Processing Systems (NIPS). (2014) 15. Feichtenhofer, C., Pinz, A., Zisserman, A.: Convolutional two-stream network fusion for video action recognition. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2016) 16. Ji, S., Xu, W., Yang, M., Yu, K.: 3d convolutional neural networks for human action recognition. IEEE Transaction on Pattern Analysis and Machine Intelligence (2013) 17. Tran, D., Bourdev, L., Fergus, R., Torresani, L., Paluri, M.: Learning spatiotemporal features with 3d convolutional networks. In: IEEE International Conference on Computer Vision 10 (ICCV). (2015) 18. Donahue, J., Hendricks, L.A., Guadarrama, S., Rohrbach, M., Venugopalan, S., Saenko, K., Darrell, T.: Long-term recurrent convolutional networks for visual recognition and description. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2015) 19. Yue-Hei Ng, J., Hausknecht, M., Vijayanarasimhan, S., Vinyals, O., Monga, R., Toderici, G.: Beyond short snippets: Deep networks for video classification. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2015) 20. Brand, M., Oliver, N., Pentland, A.: Coupled hidden markov models for complex action recognition. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (1997) 21. Oliver, N.M., Rosario, B., Pentland, A.P.: A bayesian computer vision system for modeling human interactions. IEEE Transaction on Pattern Analysis and Machine Intelligence (2000) 22. Ramanan, D., Forsyth, D.A.: Automatic annotation of everyday movements. In: International Conference on Neural Information Processing Systems (NIPS). (2003) 23. Weinland, D., Boyer, E., Ronfard, R.: Action recognition from arbitrary views using 3d exemplars. In: IEEE International Conference on Computer Vision (ICCV). (2007) 24. Yu, E., Aggarwal, J.K.: Human action recognition with extremities as semantic posture representation. In: IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). (2009) 25. Kellokumpu, V., Zhao, G., Pietikäinen, M.: Recognition of human actions using texture descriptors. Machine Vision and Applications (2011) 26. Baccouche, M., Mamalet, F., Wolf, C., Garcia, C., Baskurt, A.: Action classification in soccer videos with long short-term memory recurrent neural networks. In: International Conference on Artificial Neural Networks. (2010) 27. Grushin, A., Monner, D., Reggia, J.A., Mishra, A.: Robust human action recognition via long short-term memory. In: International Joint Conference on Neural Networks (IJCNN). (2013) 28. Veeriah, V., Zhuang, N., Qi, G.J.: Differential recurrent neural networks for action recognition. In: IEEE International Conference on Computer Vision (ICCV). (2015) 29. Wang, J., Liu, Z., Wu, Y., Yuan, J.: Mining actionlet ensemble for action recognition with depth cameras. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (2012) 30. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. CoRR (2014) 31. Soomro, K., Zamir, A.R., Shah, M.: A dataset of 101 human actions classes from videos in the wild. CoRR (2012) 11
1cs.CV
A Decoding Approach to Reed–Solomon Codes from Their Definition Maria Bras-Amorós∗ arXiv:1706.03504v1 [cs.IT] 12 Jun 2017 March 7, 2018 Abstract Because of their importance in applications and their quite simple definition, Reed–Solomon codes can be explained in any introductory course on coding theory. However, decoding algorithms for Reed– Solomon codes are far from being simple and it is difficult to fit them in introductory courses for undergraduates. We introduce a new decoding approach, in a self-contained presentation, which we think may be appropriate for introducing error correction of Reed–Solomon codes to nonexperts. In particular, we interpret Reed–Solomon codes by means of the degree of the interpolation polynomial of the code words and from this derive a decoding algorithm. Compared to the classical algorithms, our algorithm appears to arise more naturally from definitions and to be easier to understand. It is related to the Peterson– Gorenstein–Zierler algorithm (see [10] and [20]). 1 Introduction. Error control codes are used to detect and correct errors that may occur in data transmission or storage through eventually defective channels or storage devices that can distort the sent or stored information. For example, the atmosphere introduces errors in the transmission of images from the Meteosat satellite to Earth, different interferences in communications by mobile phone may cause transmission errors, or reading devices need correcting algorithms for handling CDs, DVDs, or USB memories. Error control codes are also used in distributed data storage in the cloud to recover lost or damaged chunks of information. In the words of Elwyn R. Berlekamp, one of the fathers of coding theory, Communication links transmit information from here to there. Computer memories transmit information from now to then. In either case, noise causes the received data to differ slightly from the original data. As Shannon [24] showed in 1948, the noise need not cause any degradation in reliability. The noise does impose some limiting capacity on the throughput rate, although that limit is typically well above the throughput rate at which real systems operate. Error-correcting codes enable a system to achieve a high degree of reliability despite the presence of noise [2]. The modus operandi of those codes is to send along with the original information a small amount of redundancy, so that from all the received information one can deduce what is actually transmitted. The simplest example is adding for every transmitted bit (a 0 or a 1) two identical copies. If the original bit or one of its copies is received with an error, we can still correct it from the other two, which we expect to coincide. Note that by adding redundancy, on one side we improve the quality of the received information. But, on the other side, we augment the transmission cost. In the example of repeating bits, the transmission cost is multiplied by three. Coding theory aims at designing and implementing codes with good correcting capacity, while maintaining a low transmission cost, as well as designing detection and correction algorithms that allow the receiver to recover the original information. ∗ M. Bras-Amorós is with Universitat Rovira i Virgili, Tarragona, Catalonia (e-mail: [email protected]) 1 Berlekamp’s reference [2] gives a detailed historical review (up to 1980) of coding theory since Shannon’s cornerstone contribution [24]. At that time, the so-called Reed–Solomon codes [21] and the most relevant algorithms for decoding Reed–Solomon codes had already appeared. They are the most universal error control codes and are currently being used directly or indirectly in most transmission devices and storage systems. Reed–Solomon codes admit different definitions as will be explained in this article, and they are all based in polynomials of bounded degrees over a finite field. One way to explain how they work is as follows. Fix a finite field of cardinality q. From the data one wants to transmit (say k elements of Fq ), one interpolates a polynomial of degree less than k that takes these values when evaluated at k given nonzero elements of the finite field. Then one adds to the original k information values the redundancy which consists of the evaluation of the polynomial at the remaining q − 1 − k nonzero values of the finite field. Basic polynomial theory shows how any small part of the whole (q − 1)-length of the received information can be restored from the rest. Because of their importance in applications and their quite simple definition, Reed–Solomon codes can be explained in any introductory course. However, decoding algorithms for Reed–Solomon codes are far from being so simple and it is difficult to explain them in introductory courses for undergraduates. This is why we introduce our new decoding approach, in a self-contained presentation, which we think may be appropriate to introduce error correction of Reed–Solomon codes to nonexperts. Although a direct implementation of the algorithm presented in this article may not be as efficient as the most efficient known algorithms, we think that it is performable by any undergraduate student using basic software tools. However, we do not rule out the possibility that technical improvements to the algorithm may make it much more efficient, especially if one can deemphasize matrices in favor of polynomials. The most celebrated algorithms for decoding Reed–Solomon codes have been the Peterson–Gorenstein– Zierler algorithm [20, 10] for its simplicity, and the algorithms designed to solve Berlekamp’s key equation [1]. The two primary decoding algorithms that solve Berlekamp’s key equation are the Berlekamp-Massey algorithm [15] and the Sugiyama et al. adaptation of the Euclidean algorithm [26]. The alternative so-called Welch–Berlekamp equations are solved in the Welch–Berlekamp algorithm [27]. Bit-serialized multiplication and bit-serial encoders are more efficient for hardware implementation of shift registers [3]. This is used in the algorithm in [4]. The Welch–Berlekamp equations were also solved by Chambers’ algorithm [7] and by Fedorenko’s algorithm [9]. Another general perspective is that of decoding pairs [18, 19]. Guruswami and Sudan presented their breakout algorithm [25, 11] decoding beyond half the minimum distance by means of list decoding. All these algorithms and their relationships are analyzed in several papers such as [8, 12, 16, 6, 17]. In Section 3 we revisit the definition of Reed–Solomon codes, giving four different, but equivalent, versions. Reinterpreting a definition related to the degree of the interpolation polynomial, we derive a decoding algorithm. The key result for the new formulation is Theorem 20 in Section 4. Now, for correcting a received word, its interpolation polynomial is split into two parts, one with low order terms (lower than the code dimension) and the other one with the remaining terms. The latter part is fixed while the first part is modified in order to maximize the number of nonzero roots. This gives the code word at minimum distance from the received word. Our decoding algorithm is related to the Peterson–Gorenstein–Zierler algorithm. We compare both algorithms in Sections 6 and 7 and see how our algorithm is well suited for the optimistic view of best case decoding [4]. This is the case when error correction codes of high correction capability are used, but with a low expectation of errors. 2 Some background on coding theory. Let us start with some background definitions and results on coding theory. Standard references are [14, 22, 13, 5, 23]. 2 The alphabet Fq . The symbols that contain the information that needs to be sent as well as the symbols corresponding to the transformed and transmitted data are the elements of a finite field, which is often called the transmission alphabet. One can consider the case in which Fq is a prime field, that is, q is a prime number and Fq can be identified by the set {0, 1, . . . , q − 1}, equipped with the usual addition and product modulo q. There will always exist an element α in Fq such that all the powers of α with exponent smaller than q − 1 are different. Then, Fq = {0, 1, α, α2 , . . . , αq−2 }. In this case, α is called a primitive element. Example 1. Consider F7 . It is the set {0, 1, 2, 3, 4, 5, 6} equipped with the addition and multiplication operations, always modulo 7. For instance, in F7 , 4 + 5 = 2, 1 − 2 = 6, 3 · 5 = 5. It is easy to verify that α = 5 is a primitive element of F7 . Linear codes. A linear code C of length n over a finite field Fq is a vector subspace of Fnq . Its vectors are called code words. The dimension k of the code is the dimension of the subspace. In particular, the number of code words of C is q k . Generator matrices. We say that a matrix G of k rows and n columns is a generator matrix of C if its rows are a set of vectors generating the code. The generator matrix is not unique, for example we can permute the rows. To encode a word of k symbols of Fq , we multiply it by the generator matrix. Example 2. The following matrix is the generator matrix of a code C of length 6 and dimension 2 over F7 .   1 1 1 1 1 1 Gex = . 1 5 4 6 2 3 To encode the information 110256 we split it into blocks of k  1 1 Gex = 2 6 5  0 2 Gex = 2 3 1  5 6 Gex = 4 0 1 The encoded information will then be 265034231546401632. = 2 symbols and multiply each block by Gex .  0 3 4 ,  5 4 6 ,  6 3 2 . Dual code and parity-check matrices. Consider the scalar product of two vectors (u0 , u1 , . . . , un−1 ) and (v0 , v1 , . . . , vn−1 ) of Fnq , defined as u0 v0 + u1 v1 + · · · + un−1 vn−1 ∈ Fq . The dual code of C is C ⊥ = {v ∈ Fnq : v · c = 0 for all c ∈ C}. It is a linear code with the same length as C and dimension n − k. We can define it from a system of linear equations with coefficient matrix G. A matrix H generating C ⊥ is called a parity-check-matrix of C. Equivalently, a parity-check matrix of C is a matrix such that the code C can be redefined as C = {c ∈ Fnq : c · h = 0 for every row h of H}. Example 3. The following matrix is a parity-check matrix of the code C of Example 2.   1 5 4 6 2 3  1 4 2 1 4 2   Hex =   1 6 1 6 1 6  1 2 4 1 2 4 Hamming distance, correction capability, and Singleton bound. The Hamming distance between two words of the same length is the number of positions in which their symbols differ. The purpose of decoding algorithms is, given an input vector u of the same length as the code, output a code word c ∈ C minimizing the Hamming distance between u and c. The weight of a word is the number of nonzero symbols or, equivalently, its Hamming distance from the zero vector. The minimum distance d of a linear code 3 C can be equivalently defined as (i) the minimum Hamming distance between two words of C; (ii) the minimum weight of nonzero words of C; (iii) the minimum number of linearly dependent columns of H. The minimum distance of a code is an important parameter quantifying the error correction capability of the code. Indeed, if at most ⌊ d−1 2 ⌋ errors are added to a code word c ∈ C, corrupting it into a word u, then c is the unique code word of C at Hamming distance at most ⌊ d−1 2 ⌋ from u, and in this sense we say that d−1 ⌊ 2 ⌋ errors can be corrected. The Singleton bound states that for a linear code of length n and minimum distance d, the dimension k satisfies k ≤ n − d + 1. The codes attaining this bound are called maximum distance separable codes (MDS). Example 4. The Hamming distance between the code words 265034 and 231546 of the code C in Example 2 is 5. The Hamming distance between the code word 111111 corresponding to the first row of Gex and 265034 is 6. Notice that the elements of the first row of the generator matrix of C are all equal while the elements of the second row are all different. Any code word of C will be a multiple of the second row plus a multiple of the first row. The components of any multiple of the second row, except for the zero vector, will all be different by field properties. Similarly, if we add to a vector whose components are all different a constant vector, then the components of the vector so obtained will also all be different by field properties. So, for any vector in C, either it is constant or all its components are different. This makes the Hamming distance between any two words in C either equal to 6 or to 6 − 1 = 5. Consequently, the minimum distance of C is 5. Vandermonde matrices. Although Vandermonde matrices can be defined over any field, for our purposes we concentrate on finite fields. Given α1 , α2 , . . . , αn ∈ Fq , the Vandermonde matrix of α1 , . . . , αn of order r is defined as   1 1 ... 1  α1 α2 . . . αn    2  α21 α2 . . . α2n  Vr (α1 , α2 , . . . , αn ) =  .  .. ..  .. ..  . . .  . αr−1 1 αr−1 2 . . . αr−1 n Q It can be proved that the determinant of Vn (α1 , α2 , . . . , αn ) satisfies |V (α1 , α2 , . . . , αn )| = 1≤i<j≤n (αj −αi ). Consequently, Vn (α1 , α2 , . . . , αn ) has an inverse matrix if and only if αi 6= αj for all 1 ≤ i < j ≤ n. 3 Four definitions of Reed–Solomon codes. Let us introduce Reed–Solomon codes from four different, but complementary, points of view. 3.1 Reed–Solomon codes from generator matrices. Let Fq be the field with q elements (q a prime power) and let α be a primitive element of Fq . Then Fq = {0, 1, α, α2 , . . . , αq−2 }. Let n = q − 1. Definition 5. The Reed–Solomon code over Fq and of dimension k, RSq,α (k), is the linear code of Fnq with generator matrix   1 1 1 ... 1  1  α α2 ... αn−1   2 4 2(n−1)  1  α α ... α G= .  ..  .. .. . .. ..  .  . . . k−1 (k−1)2 (k−1)(n−1) 1 α α ... α Example 6. Consider the finite field F7 . As noted above, the element 5 ∈ F7 is primitive. Indeed, 50 = 1, 51 = 5, 52 = 4, 53 = 6, 54 = 2, 55 = 3 and 56 is again 1. The code RS7,5 (2) is exactly the code C of Example 2. 4 3.2 Reed–Solomon codes from parity-check matrices. Consider the matrix    H =  1 1 .. . α α2 .. . α2 α4 .. . 1 αn−k α(n−k)2 ... ... .. . αn−1 α2(n−1) .. . . . . α(n−k)(n−1)    .  (1) It is a matrix of maximum rank (namely n − k) because of the Vandermonde structure. Furthermore, the product of matrix G and the transpose of matrix H is the zero matrix. Indeed, P the product of the ith row n (i−1)(r−1) j(r−1) of matrix G (1 ≤ i ≤ k) times the jth row of matrix H (1 ≤ j ≤ n − k) is α = r=1 α Pn (i+j−1)(r−1) i+j−1 α . Now, because of the limits of i and j, we have that i + j − 1 < q − 1 and so α = 6 1. r=1 i+j−1 n Finally, the sum equals (ααi+j−1)−1−1 = 0. This enables us to give the following equivalent definition. Definition 7. The Reed–Solomon code over Fq and of dimension k, RSq,α (k), is the linear code of Fnq with parity-check matrix equal to H. Example 8. One can check that matrix Hex in Example 3 is of the form of the matrix H in (1). Lemma 9 uses Definition 7 to deduce that Reed–Solomon codes attain the Singleton bound, and so they are maximum distance separable (MDS) codes. Lemma 9. The minimum distance of RSq,α (k) is exactly n − k + 1. Hence, it is an MDS code. Proof. The submatrix given by any subset of n − k columns (with column indices 0 ≤ j1 , . . . , jn−k ≤ n − 1) has determinant αj1 α2j1 α3j1 .. . αj2 α2j2 α3j2 .. . α(n−k)j1 α(n−k)j2 ... ... ... .. . αjn−k α2jn−k α3jn−k .. . = αj1 . . . αjn−k · Vn (αj1 , . . . , αjn−k ) , . . . α(n−k)jn−k which is not zero. So, any set of n − k columns of the parity-check matrix are independent, and so the minimum distance must be at least n − k + 1. By the Singleton bound the minimum distance must be exactly equal to n − k + 1. Example 10. The minimum distance of RS7,5 (2) is 5 as justified in Example 4. This equals n−k+1 = 6−2+1. 3.3 Reed–Solomon codes and interpolation polynomials. Consider the set Fq [x]<k of all polynomials with coefficients in Fq and of degree strictly less than k. A general element a ∈ Fq [x]<k is of the form a = a0 +a1 x+· · ·+ak−1 xk−1 with ai ∈ Fq . Observe that evaluating a at αi−1 gives a(αi−1 ) = a0 + a1 αi−1 + · · ·+ ak−1 α(i−1)(k−1) , which is exactly the result of the product of the vector (a0 , . . . , ak−1 ) by the ith column of matrix G. So, the product of the vector (a0 , . . . , ak−1 ) by matrix G is exactly the vector (a(1), a(α), a(α2 ), . . . , a(αn−1 )). Definition 11. The Reed–Solomon code over Fq and of dimension k, RSq,α (k), is the set {(a(1), a(α), a(α2 ), . . . , a(αn−1 )) : a ∈ Fq [x]<k }. Example 12. The three code words computed in Example 2, which are 265034, 231546, and 401632 are, respectively, the evaluation of the polynomials x + 1, 2x, and 6x + 5 at 50 , 51 , 52 , 53 , 54 , 55 . The degree of the three polynomials is less than 2 which is the dimension of the code. 5 Now, for each vector u = (u0 , . . . , un−1 ) in Fnq , there exists a unique polynomial fu of degree at most Pn−1 n − 1 such that fu (αi ) = ui for all i in {0, . . . , n − 1}. It can be computed using the formula fu = i=0 ui fi , Qn−1 x−αj where fi is the interpolation polynomial of the ith standard basis vector, that is, fi = j=0 αi −αj . The j6=i uniqueness of fu is a consequence of the fact that if fu = a0 + a1 x + · · · + an−1 xn−1 , then the coefficients a0 , . . . , an−1 are a solution of the linear system of equations   1 1 1 1 ... 1      1  α α2 α3 ... α(n−1) u0 a0    1     α2 α4 α6 ... α2(n−1)     a1   u 1  3 6 9 3(n−1) =  1 .     . . α α α ... α    ..   ..   .  . . . . .. .. .. .. ..  ..  . un−1 an−1 1 αn−1 α2(n−1) α3(n−1) . . . α(n−1)(n−1) The matrix of this system is a square Vandermonde matrix which is known to be invertible. So, any u in Fnq is of the form (f (1), f (α), f (α2 ), . . . , f (αn−1 )) for some unique f ∈ Fq [x] of degree less than n. Example 13. In F7 , taking α = 5 as primitive element, we have f0 f1 f2 f3 f4 f5 = = = = = = 6x5 + 6x4 + 6x3 + 6x2 + 6x + 6, 2x5 + 3x4 + x3 + 5x2 + 4x + 6, 3x5 + 5x4 + 6x3 + 3x2 + 5x + 6, x5 + 6x4 + x3 + 6x2 + x + 6, 5x5 + 3x4 + 6x3 + 5x2 + 3x + 6, 4x5 + 5x4 + x3 + 3x2 + 2x + 6. Then, for a general vector u ∈ F67 , the coefficients of fu (in increasing order) can be computed as the product of u by the matrix   6 6 6 6 6 6  6 4 5 1 3 2     6 5 3 6 5 3     6 1 6 1 6 1 .    6 3 5 6 3 5  6 2 3 1 5 4 For instance, the coefficients of the polynomial interpolating u = (4, 2, 1, 6, 3, 2) are (3, 0, 3, 2, 6, 4), and the coefficients of the polynomial interpolating w = (0, 2, 5, 6, 0, 6) are (2, 2, 2, 2, 6, 0). Code word checking. From Definition 11, a vector u = (u0 , . . . , un−1 ) in Fnq is a code word if and only if its interpolation polynomial fu satisfies deg(fu ) < k. Example 14. The words 265034, 231546, and 401632 are code words of RS7,5 (2) because, as seen in Example 12, their interpolation polynomials are, respectively, x + 1, 2x, and 6x + 5, whose degrees are less than k = 2. The words 421632 and 025606 are not code words of RS7,5 (2) because, as seen in Example 13, their interpolation polynomials are, respectively, 6x5 + 6x3 + 5x2 + 2x and 6x4 + 2x3 + 2x2 + 2x + 2, whose degrees are larger than k = 2. 3.4 Reed–Solomon codes and polynomial evaluation. Consider now the set Fq [x]<n of all polynomials with coefficients in Fq and degree strictly less than n. A general element u ∈ Fq [x]<n is of the form u = u0 + u1 x + · · · + un−1 xn−1 with ui ∈ Fq . Observe that evaluating u at αi gives u(αi ) = u0 + u1 αi + · · · + un−1 αi(n−1) , which, if i ≤ n − k, is exactly the result of the product of the ith row of matrix H and vector (u0 , . . . , un−1 )T . The value u(αi ), if i ≤ n − k, is called the 6 ith syndrome of u with respect to C. Now, the product of matrix H and vector (u0 , . . . , un−1 )T is exactly the vector (u(α), u(α2 ), . . . , u(αn−k )), which is called the syndrome vector of u with respect to C. On the other hand, by definition of parity-check matrix, (u0 , . . . , un−1 ) is a code word if and only if the product of matrix H and (u0 , . . . , un−1 )T is zero. Definition 15. The Reed–Solomon code over Fq and of dimension k, RSq,α (k), is the set of vectors u = (u0 , . . . , un−1 ) in Fnq such that the polynomial u0 + u1 x + · · · + un−1 xn−1 vanishes at αj for all j with 1 ≤ j ≤ n − k. Code word checking. Now, given a vector u = (u0 , . . . , un−1 ) in Fnq , u is a code word if and only if u(αi ) = 0 for all i with 1 ≤ i ≤ n − k. Example 16. Suppose we want to check whether the word 342650 belongs to RS7,5 (2). We consider the polynomial u(x) = 3 + 4x + 2x2 + 6x3 + 5x4 and evaluate it at 5, 52 , 53 and 54 . We obtain u(51 ) = u(5) u(52 ) = u(4) u(53 ) = u(6) u(54 ) = u(2) = 3+6+1+1+3 = 3+2+4+6+6 = 3+3+2+1+5 = 3+1+1+6+3 = 0, = 0, = 0, = 0. Since u(5) = u(52 ) = u(53 ) = u(54 ) = 0, the word 342650 belongs to RS7,5 (2). 3.5 Connection of the coefficients of an interpolation polynomial and its evaluation at all points. Next we will see that the coefficients of an interpolation polynomial over a finite field are intimately related to the values obtained when evaluating the polynomial at all the nonzero elements of the finite field. Lemma 17. Suppose that α is a primitive element of a finite field of q elements and let n = q − 1. The polynomials Qn−1 j i n−1 + α2i xn−2 + α3i xn−3 + · · · + α(n−1)i x + αni ). fi = j=0 αx−α i −αj satisfy fi = −(α x j6=i Proof. Suppose β ∈ Fq \{0}. From the equality (x−β)(xn−1 +βxn−2 +β 2 xn−3 +· · ·+β n−2 x+β n−1 ) = xn −1, n −1 . This, together with the fact xn − 1 = it follows that xn−1 + βxn−2 + β 2 xn−3 + · · · + β n−2 x + β n−1 = xx−β Q n−1 + βxn−2 + β 2 xn−3 + · · · + β n−2 x + β n−1 vanishes at all the elements of γ∈Fq \{0} (x − γ), implies that x Fq \ {0} except at β, where it evaluates to β n−1 + ββ n−2 + β 2 β n−3 + · · · + β n−2 β + β n−1 = nβ n−1 = −1 β . n−1 n−2 2 n−3 n−2 n−1 Hence, −β(x + βx +β x +···+β x+β ) vanishes at all the elements of Fq \ {0} except at β, where it evaluates to 1. Finally, −β(xn−1 + βxn−2 + β 2 xn−3 + · · · + β n−2 x + β n−1 ) = −(βxn−1 + β 2 xn−2 + β 3 xn−3 + β 4 xn−4 + · · · + β (n−1) x + β n ). If we take β = αi then fi and the expression have degree q − 2 and take the same values at q − 1 points, hence are equal. The main result relating the last two definitions of Reed–Solomon codes is the following lemma. Lemma 18. The inverse of the map Fn (v0 , . . . , vn−1 ) → Fn 0 7→ (v(α ), v(α), v(α2 ), . . . , v(αn−1 )) is (−u(αn ), −u(αn−1 ), −u(αn−2 ), . . . , −u(α)) →7 (u0 , . . . , un−1 ), where v(β) is the evaluation of v0 +v1 x+· · ·+vn−1 xn−1 at β and u(β) is the evaluation of u0 +u1 x+· · ·+un−1 xn−1 at β. 7 Proof. The inverse map is giving the coefficients of the interpolation polynomial fu . By Lemma 17 we have Pn−1 that fu = i=0 ui fi , where fi = −(αi xn−1 + α2i xn−2 + α3i xn−3 + · · · + α(n−1)i x + αni ). Now,   −1    −α  fu = xn−1 u0 u1 · · · un−1   ..   . + xn−2 u0 u1 · · · un−1 −αn−1  −1 2  −α   ..  . −α2(n−1) + ··· + x + u0 u0 · · · un−1 u1 u1 · · · un−1 So, fu = −u(α)xn−1 − u(α2 )xn−2 − · · · − u(αn ) = Pn−1 i=0           −1 −αn−1 .. . −α(n−1)(n−1)  −1  −αn  . ..  . −αn(n−1)           (−u(αn−i ))xi . Example 19. Consider the word (u0 , u1 , u2 , u3 , u4 , u5 ) = (5, 4, 0, 1, 2, 0) and the related polynomial u = 5 + 4x + x3 + 2x4 . Its evaluation at the powers of 5 is u(51 ) = u(5) u(52 ) = u(4) u(53 ) = u(6) u(54 ) = u(2) u(55 ) = u(3) u(56 ) = u(1) =5+6+6+4 =5+2+1+1 =5+3+6+2 =5+1+1+4 =5+5+6+1 =5+4+1+2 = 0, = 2, = 2, = 4, = 3, = 5. What Lemma 18 says is that the polynomial v(x) = −5 − 3x − 4x2 − 2x3 − 2x4 = 2 + 4x + 3x2 + 5x3 + 5x4 satisfies that u = (v(1), v(5), v(52 ), v(53 ), v(54 ), v(55 )). Indeed, v(50 ) = v(1) v(51 ) = v(5) v(52 ) = v(4) v(53 ) = v(6) v(54 ) = v(2) v(55 ) = v(3) =2+4+3+5+5 =2+6+5+2+3 =2+2+6+5+6 =2+3+3+2+5 =2+1+5+5+3 =2+5+6+2+6 = 5, = 4, = 0, = 1, = 2, = 0, and it follows that (v(1), v(5), v(52 ), v(53 ), v(54 ), v(55 )) = (5, 4, 0, 1, 2, 0) = (u0 , u1 , u2 , u3 , u4 , u5 ). 4 New decoding approach. We approach decoding from the point of view of Definition 11. However, we use Definition 15 for the proofs. 8 Let Fq [x]<d be the set of polynomials with coefficients in Fq and degree strictly less than d, and let ′ Fq [x]<d ≥d′ be the set of polynomials with coefficients in Fq and with only terms of degrees at least d and at most d − 1. Suppose we receive u ∈ Fnq . Let fu be the interpolation polynomial of u. Decoding u is the same as finding c ∈ RSq,α (k) such that u and c are at minimum Hamming distance. Since words c ∈ RSq,α (k) are the evaluation of polynomials of degrees smaller than k at the nonzero elements of Fq , decoding u is equivalent to finding gc ∈ Fq [x]<k such that fu − gc has maximum number of nonzero roots. In fact, gc is then the interpolation polynomial of c. The monomials of fu can be split into those that have degree less than k and those having degree at least <k k. Let hu , gu be the unique polynomials with hu ∈ Fq [x]<n such that fu = hu + gu . Once fu ≥k , gu ∈ Fq [x] <k is fixed, and so is hu , consider, from all the polynomials in Fq [x] , a polynomial ghu that maximizes the number of nonzero roots of hu + ghu . That is, the number of nonzero roots of hu + ghu is larger than or equal to the number of nonzero roots of hu + g ′ for any g ′ ∈ Fq [x]<k . Then, g c = g u − g hu . (2) Notice that if e is the minimum weight word such that u − e ∈ RSq,α (k), then e = u − c and its interpolation polynomial is fe = fu − gc = hu + ghu . Consider the set Λ = {λ ∈ Fq [x] such that λ(hu + g) vanishes at all Fq \ {0}, for some g ∈ Fq [x]<k }. Q Because of the fact that xn − 1 = γ∈Fq \{0} (x − γ), an equivalent definition is Λ = {λ ∈ Fq [x] such that (xn − 1) divides λ(hu + g) for some g ∈ Fq [x]<k }. Notice that Λ is not empty because xn − 1 belongs to Λ. Theorem 20. Let λu be a monic polynomial with minimum degree among the polynomials in Λ. For a polynomial g ∈ Fq [x]<k , if (xn − 1) divides λu (hu + g), then the number of nonzero roots of hu + g is greater than or equal to the number of nonzero roots of hu + g ′ for any g ′ ∈ Fq [x]<k . Proof. For a fixed g ∈ Fq [x]<k , the set of polynomials Λg = {λ ∈ Fq [x] such that (xn − 1) divides λ(hu + g)} is, since xn − 1 = Q γ∈Fq \{0} (x − γ), the set of polynomials that are multiples of Y (x − γ). (3) γ∈Fq \{0} (hu +g)(γ)6=0 The monic polynomial with minimum degree among Λg is then the polynomial (3) itself. Now, Λ = ∪g∈Fq [x]<k Λg . So a monic polynomial with minimum degree among Λ must be one of the polynomials as in (3) for some g ∈ Fq [x]<k . The minimality of the degree of λu implies the maximality of the number of nonzero roots of hu + g, where g is such that λu ∈ Λg . Let λu be as in Theorem 20 and suppose µ ∈ Fq [x] is such that λu (hu + g) = µ(xn − 1) for some g ∈ Fq [x]<k . Suppose that deg(λu ) = t and deg(hu ) = du . In particular, t ≤ n and du ≤ n − 1. Now, deg(µ) = t + du − n. Let the coefficients of λu (hu + g) be ξ0 , . . . , ξdu +t . If hu = adu xdu + adu −1 xdu −1 + · · · + ak xk and λu = t x + lt−1 xt−1 + · · · + l1 x + l0 , then, letting aj = 0 for all j > du and ξj = 0 for all j > du + t, we have for all i ≥ 0, ξk+t+i = ak+t+i l0 + ak+t+i−1 l1 + · · · + ak+i+1 lt−1 + ak+i , 9 which, by Lemma 18, is equivalent to ξk+t+i = −u(αn−k−t−i )l0 − u(αn−k−t−i+1 )l1 − · · · − u(αn−k−i ). (4) Since deg(µ) = t + du − n < n, the coefficients of λu (hu + g) = µ(xn − 1) = µxn − µ satisfy ξi = −ξn , ξ1 = −ξn+1 , . . . , ξt+du −n = −ξt+du and ξt+du −n+1 = ξt+du −n+2 = · · · = ξn−1 = 0. Lemma 21. Let λu be as in Theorem 20. The nonleading coefficients of λu give a solution to the linear system      u(α) u(α2 ) ... u(αt ) l0 −u(αt+1 ) t+2   u(α2 )    u(α3 ) . . . u(αt+1 )     l1   −u(α )  =     . .. .. . . . . .. .. ..    ..    . . lt−1 u(αn−k−t ) u(αn−k−t+1 ) . . . u(αn−k−1 ) −u(αn−k ) (5) Proof. The lemma is a consequence of equation (4) and the fact that ξk+t , . . . , ξn−1 = 0, since k + t ≥ du + t − n + 1. Lemma 22. Let t be the weight of a minimum weight vector e ∈ Fnq such that u − e ∈ RSq,α (k) and consider the linear system      u(α2 ) u(α3 ) .. . u(α) u(α2 ) .. . ′ ... ... .. . ′ u(αt ) ′ u(αt +1 ) .. . ′ u(αn−k−t ) u(αn−k−t +1 ) . . . u(αn−k−1 ) ′ 1. If t ≤ n−k 2 and t = t, then the linear square system  u(α) u(α2 ) 2  u(α ) u(α3 )   .. ..  . . u(αt )       l0 l1 .. . lt′ −1      =   ′ −u(αt +1 ) ′ −u(αt +2 ) .. . −u(αn−k )   .  system has a unique solution, which can be found as a solution to the ... ... .. . u(αt ) u(αt+1 ) .. . u(αt+1 ) . . . u(α2t−1 )      l0 l1 .. . lt−1       =   −u(αt+1 ) −u(αt+2 ) .. . −u(α2t ) 2. If t ≤ n−k 2 and t′ = t, then the unique solution to the previous system satisfies l0 6= 0. 3. If t ≤ n−k 2 and t′ < t, then the system has no solution. Proof.     .  1. The existence of a solution is a consequence of Lemma 21. For the uniqueness, we will see that the square submatrix   u(α) u(α2 ) . . . u(αt )  u(α2 ) u(α3 ) . . . u(αt+1 )      .. .. .. ..   . . . . t t+1 2t−1 u(α ) u(α ) . . . u(α ) has nonzero determinant. As a consequence of Definition 15 of RSq,α (k) and the fact that 2t−1 ≤ n−k,     u(α) . . . u(αt ) e(α) . . . e(αt )    ..  .. .. .. .. ..  = . . . . . . . u(αt ) . . . u(α2t−1 ) e(αt ) 10 . . . e(α2t−1 ) Suppose that the nonzero positions of e are i1 , . . . , it , with 0 ≤ i1 < i2 < · · · < it ≤ n − 1. Then it is easy to check that, letting   1 ... ... 1  αi1  ... αit αi2   2it 2i2  α2i1  . . . α α W = ,   .. .. . . . .   . . . . α(t−1)i1 α(t−1)i2 . . . α(t−1)it we have    t   ... e(α )    .. .. =W . .   e(αt ) . . . e(α2t−1 ) e(α) .. . αi1 ei1 0 0 .. . αi2 ei2 .. . 0 ... ... 0 .. .. . . .. . 0 0 αit eit which clearly has nonzero determinant because W is a Vandermonde matrix.    T W ,   2. Suppose that      u(α2 ) u(α3 ) .. . u(α) u(α2 ) .. . u(αt ) u(αt ) u(αt+1 ) .. . ... ... .. . u(αt+1 ) . . . u(α2t−1 )       0 l1 .. . lt−1      =   −u(αt+1 ) −u(αt+2 ) .. . −u(α2t )    .  Then, rearranging the columns, and considering Definition 15 of RSq,α (k) together with the fact that 2t ≤ n − k, we obtain      0 l1 e(α2 ) . . . e(αt ) e(αt+1 )  e(α3 ) . . . e(αt+1 ) e(αt+2 )   ..   0   .     (6)  =  . ,   .. .. . . . .   lt−1   ..   . . . . 0 1 e(αt+1 ) . . . e(α2t−1 ) e(α2t ) but      e(α2 ) e(α3 ) .. . e(αt+1 ) . . . e(αt+1 ) . . . e(αt+2 ) .. .. . . . . . e(α2t )   2i1 α ei1    .. =W .  0  ... 0  T .. .. W , . . 2it . . . α eit which, again, has nonzero determinant. This contradicts (6). 3. Suppose t′ < t and t − t′ = δ. If  u(α) 2  u(α )   ..  . ... ... .. . ′ u(αt ) ′ u(αt +1 ) .. . ′ u(αn−k−t ) . . . u(αn−k−1 ) then, supressing the first δ rows we obtain  u(αδ+1 ) u(αδ+2 )  u(αδ+2 ) u(αδ+3 )   .. ..  . .      γ1 γ2 .. . γt′      =    ′ . . . u(αδ+t ) γ1 δ+t′ +1   γ . . . u(α ) 2   .. .. ..  . . . n−k−t′ n−k−t′ +1 n−k−1 γt′ u(α ) u(α ) . . . u(α ) 11   ′ −u(αt +1 ) ′ −u(αt +2 ) .. . −u(αn−k )      =      ,  −u(αt+1 ) −u(αt+2 ) .. . −u(αn−k )      and adding δ columns at the beginning,        0 .    ′  ..   u(αδ+t ) −u(αt+1 )   ′  0   u(αδ+t +1 )    −u(αt+2 )      γ  . .. ..  1=    .  γ2  .   n−k n−k−1 −u(α ) u(α )  ..   .  γt′ . . . u(αδ+1 ) . . . . . . u(αδ+2 ) . . . .. .. .. . . . ′ u(αn−k−t ) . . . u(αn−k−t ) . . . u(α) u(α2 ) .. . This contradicts the two previous points. We obtain the following decoding algorithm for a RSq,α (k) code, where n = q − 1. Input: u ∈ Fnq . 1. Let t be the minimum integer such that  u(α) . . . u(αt )  u(α2 ) . . . u(αt+1 )  rank  .. .. ..  . . .  . . . u(αt+1 )   . . . u(αt+2 )     .  = rank  .. ..    . . n−k−t n−k n−k−t n−k−1 u(α ) . . . u(α ) u(α ) . . . u(α )   u(α) u(α2 ) .. . (7) For t = 0, the first matrix is the null matrix. In this case we consider rank() = 0. 2. Solve the linear system  u(α)  u(α2 )   ..  . u(αt ) u(α2 ) u(α3 ) .. . ... ... .. . u(αt ) u(αt+1 ) .. . u(αt+1 ) . . . u(α2t−1 )      l0 l1 .. . lt−1       =   −u(αt+1 ) −u(αt+2 ) .. . −u(α2t )      for l0 . . . , lt−1 and denote by λu the polynomial xt + lt−1 xt−1 + · · · + l1 x + l0 . 3. Obtain as in Lemma 18 the interpolation polynomial fu of u, and let du be its degree. 4. Let ζ0 , . . . , ζdu +t be the coefficients of λu fu ; that is, λu fu = ζ0 + ζ1 x + · · · + ζdu +t xdu +t . Let gc = fu − (xn −1)(ζn +ζn+1 x+···+ζdu +t xdu +t−n ) . λu 5. Output: (gc (1), gc (α), gc (α2 ), . . . , gc (αn−1 )). Theorem 23. Suppose we received u ∈ Fnq . Let t be the weight of a minimum weight vector e ∈ Fnq such that u − e ∈ RSq,α (k). If t ≤ n−k 2 , then the previous algorithm outputs u − e. Proof. By Lemma 22, step 1 gives the actual number of errors t. By Lemma 22 again, the system in step 2 has a unique solution and, by Lemma 21, the polyomial one obtains is exactly the polynomial λu in Theorem 20. After step 3 we get the interpolation polynomial fu . Let hu , gu be the unique polynomials with <k hu ∈ Fq [x]<n such that fu = hu + gu . By Theorem 20, xn − 1 divides λu (hu + ghu ) for some ≥k , gu ∈ Fq [x] ghu maximizing the number of nonzero roots of hu + Fq [x]<k . In particular, there exists µ such that (xn − 1)µ = λu (hu + ghu ) 12 (8) and µ must have degree less than n. Hence, the degrees of the monomials in xn µ and those in −µ do not n+k overlap. On the other hand, the monomials of λu ghu have degree less than t + k ≤ n−k 2 + k = 2 ≤ n. So, n the monomials in x µ of degrees at least n coincide with the monomials in λu hu of degrees at least n. That is, xn µ = ζn xn + ζn+1 xn+1 + · · · + ζdu +t xdu +t , and we deduce that µ = ζn + ζn+1 x + · · · + ζdu +t xdu +t−n . (xn −1)(ζ +ζ x+···+ζ xdu +t−n ) n n+1 du +t Now, from (8), we deduce that ghu = − hu . Now, as explained in equation λu (2), the polynomial gc interpolating the code word c ∈ RSq,α (k) at minimum distance of u is gc = gu − (xn −1)(ζ +ζ x+···+ζ xdu +t−n ) n n+1 du +t g hu = f u − λu c ∈ RSq,α (k) at minimum distance of u. . From here it follows that the output is, indeed, the code word Remark. Steps 3 and 4 of the algorithm can be replaced by the equivalent steps in the Peterson–Gorenstein– Zierler algorithm, that is, we can find the error positions by means of the roots of λu and then obtain the error values by means of the linear system      i1 u(α) ei1 αi2 . . . αit α  α2i1 α2i2 . . . α2it   ei2   u(α2 )       .  .. .. ..   ..  =  .. ..       . . . . . . t tit ti2 ti1 u(α ) eit ... α α α Example 24. Consider the same code as in Example 2, that is, the code C = RS7,5 (2). Suppose that after transmission of three code words we receive u = 421632, v = 342650, w = 025606. Denote by the same symbol u the vector 421632 and the polynomial 4 + 2x + x2 + 6x3 + 3x4 + 2x5 . The syndromes of u are   4        2  1 5 4 6 2 3 3 u(a)    u(a2 )   1 4 2 1 4 2   1   1          u(a3 )  =  1 6 1 6 1 6   6  =  5  .    3  1 2 4 1 2 4 4 u(a4 ) 2     3  1   Since the syndromes are nonzero we deduce that there is at least one error. We have rank   6= rank   5 , 4     3 3 1 but rank  1  = rank  1 5 . So t = 1 and there is only one error. We solve the system 3l0 = −1, 5 5 4 whose solution is l0 = 2. We deduce that the error locator polynomial is λ = x + 2. We compute fu as in Example 13, obtaining fu = 4x5 + 6x4 + 2x3 + 3x2 + 3. Now, since fu · λ = 4x6 + 6x2 + 3x + 6, we deduce that ζn + · · · + ζdu +t xdu +t−n = 4 and gc = 6x + 5, so that the corrected word is (401632). We could also have found the single root of λ, which is 5 = 51 , and then deduce that there is an error at the second position (first position, if we start counting by 0). Then, to find the error value we could have solved the system 51 e1 = u(a) = 3, whose solution is e1 = 2. The corrected word is then u − (020000) = (421632) − (020000) = (401632). Denote by the same symbol v the vector 342650 and the polynomial 3 + 4x + 2x2 + 6x3 + 5x4 . The syndromes of v are   3        4  1 5 4 6 2 3 0 v(a)    v(a2 )   1 4 2 1 4 2   2   0          v(a3 )  =  1 6 1 6 1 6   6  =  0  .    5  1 2 4 1 2 4 0 v(a4 ) 0 13 Since the syndromes are all zero we deduce that there is no error. Denote by the same symbol w the vector 025606 and the polynomial 2x+5x2 +6x3 +6x5 . The syndromes of w are   0        2  1 5 4 6 2 3 w(a) 0    w(a2 )   1 4 2 1 4 2   5   1          w(a3 )  =  1 6 1 6 1 6   6  =  5  .    0  1 2 4 1 2 4 w(a4 ) 5 6     0  1   Since the syndromes are nonzero we deduce that there is at least one error. We have rank   6= rank   5 , 5         0 0 1 0 1 0 1 5 rank  1  6= rank  1 5 , while rank = rank = 2. So, t = 2. We solve the 1 5 1 5 5 5 5 5 system        0 1 l0 −5 2 = = , 1 5 −5 2 l1 whose solution is l0 = 6, l1 = 2. We deduce that the error locator polynomial is λ = x2 + 2x+ 6. We compute fw as in Example 13, obtaining fw = 6x4 + 2x3 + 2x2 + 2x + 2. Now, since fw · λ = 6x6 + 4x3 + 4x2 + 2x + 5, we deduce that ζn + · · · + ζdu +t xdu +t−n = 6 and gc = 4x + 3, so that the corrected word is (025641). We could also have found the roots of λ, which are 2 = 54 and 3 = 55 and then deduce that the error positions are the fifth and sixth positions (fourth and fifth positions, if we start counting by 0). Then, to find the error value we could have solved the system          4  w(a) 0 2 3 e4 5 55 e4 = = = , w(a2 ) e5 1 4 2 e5 52 54 whose solution is e4 = 3, e5 = 5. The corrected word is then w − (000035) = (025606)− (000035) = (025641). 5 A glimpse of the Peterson–Gorenstein–Zierler algorithm. Peterson [20] and Gorenstein and Zierler [10] proposed a decoding algorithm which is very similar to the one we just presented. It is based on the following lemma. For all h with t ≤ h ≤ n−k 2 , define   u(α) u(α2 ) ... u(αh )  u(α2 ) u(α3 ) . . . u(αh+1 )    Ah =  . .. .. .. ..   . . . . u(αh ) u(αh+1 ) . . . u(α2h−1 ) Lemma 25. If t < h ≤ n−k 2 , then det(Ah ) = 0, while det(At ) 6= 0. That is, the number of errors (if it is at most n−k ) is the maximum integer h ≤ n−k 2 2 such that det(Ah ) 6= 0. Proof. Since 2h − 1 ≤ n − k,    Ah =   e(α) e(α2 ) .. . e(αh ) e(α2 ) e(α3 ) .. . ... ... .. . e(αh ) e(αh+1 ) .. . e(αh+1 ) . . . e(α2h−1 ) 14    .  As before, let us denote the error positions as i1 , . . . , it and let M = {m1 , ..., mh } ⊆ {0, ..., n − 1} be any subset containing all the error positions. Let D be the diagonal matrix D = diag(em1 , . . . , emh ). Clearly, |D| 6= 0 if h = t and |D| = 0 if h > t. Let  1 m1  α  2m 1  W = α  ..  . α(h−1)m1 1 αm2 α2m2 .. .  1 ... ... ... .. . αmh α2mh .. .    .   . . . α(h−1)mh α(h−1)m2 Since W is a Vandermonde matrix and the indices in M are all different, |W | 6= 0. We have    m  e(α) . . . e(αh ) 0 α 1 e m1 . . .     T .. .. .. .. .. ..  =W W . . . . . . . mh h 2h−1 0 . . . α e mh e(α ) . . . e(α ) Now it is straightforward to check that this product of matrices has zero determinant if and only if M contains no error positions, that is, if es = 0 for some s ∈ M . The Peterson–Gorenstein–Zierler algorithm is as follows. Input: u ∈ Fnq . 1. Let t be the maximum integer smaller than or equal to u(α2 ) u(α3 ) .. . u(α) u(α2 ) .. . ... ... .. . n−k 2 such that u(αh ) u(αh+1 ) .. . 6= 0. u(αh ) u(αh+1 ) . . . u(α2h−1 ) 2. Solve the linear system  u(α)  u(α2 )   ..  . u(αt ) u(α2 ) u(α3 ) .. . ... ... .. . u(αt ) u(αt+1 ) .. . u(αt+1 ) . . . u(α2t−1 )      l0 l1 .. . lt−1       =   −u(αt+1 ) −u(αt+2 ) .. . −u(α2t ) for l0 , . . . , lt−1 and denote by λu the polynomial xt + lt−1 xt−1 + · · · + l1 x + l0 . 3. Find the error positions by means of the roots of λu . 4. Find the error values by means of the linear system   i1 αi2 . . . αit α  α2i1 α2i2 . . . α2it      .. .. ..   ..  . . . .  tit ti2 ti1 ... α α α 5. Output: c = u − e. 15 ei1 ei2 .. . eit       =   u(α) u(α2 ) .. . u(αt )    .       6 Comparison of our algorithm with the Peterson–Gorenstein–Zierler algorithm. The main differences between our proposed algorithm and the Peterson–Gorenstein–Zierler algorithm are • Computation of the number of errors (step 1 in both algorithms); • Computation of the error values (steps 3–4 in both algorithms). Error location (step 2) is done exactly in the same way. As for the computation of the error values, step 4 in our algorithm needs two polynomial multiplications and one division (all of them of order t + n), while steps 3 and 4 in the Peterson–Gornestein–Zierler algorithm involve two linear square systems of t equations. This already makes our algorithm simpler than the Peterson–Gorenstein–Zierler algorithm. But the main difference is in the computation of the number of errors. In the Peterson–Gorenstein– n−k Zierler algorithm we start computing the determinant of a (large) n−k 2 × 2 matrix and continue computing determinants of decreasing order, while in our algorithm we start computing the rank of a (small) 2 × (n − k − 1) matrix and continue computing ranks of (h + 1) × (n − k − h) matrices with an increasing value of h. In the Peterson–Gorenstein–Zierler algorithm, the smaller the number of errors, the more determinant computations will be needed. In our algorithm, the smaller the number of errors, the fewer rank computations will be needed. Furthermore, in the Peterson–Gorenstein–Zierler algorithm we start with the most complex determinants and then they get simpler, while in our algorithm we start with the simpler rank computations and, as the number of errors increases we get more complex rank computations. 7 The optimistic view of best case decoding. There are many scenarios where a high reliability is required but errors rarely occur. In this case, error correcting codes with a high error correction capability are required although the expected number of errors is low. In terms of error correction, the decoding approach that takes this perspective into consideration is called best case decoding. See [4] for a deep analysis. In Berlekamp’s clarifying words, . . . a best case decoder is philosophically analogous to a small child who continually asks, “Are we almost there now?” This question may occur at many places in a long decoding program. But, in a high-reliability application, the odds are quite favorable that any time the question is asked, the answer is likely to be “YES”. Our algorithm is very well suited for best case decoding because, in contrast to the Peterson–Gorenstein– Zierler algorithm, it is fast when the number of errors is small and it is only a bit slower when the number of errors approaches the correction capability. Acknowledgments. The author would like to thank the anonymous referees for deeply reading the manuscript and for making very useful comments. She would specially like to thank the editor Susan Jane Colley for her careful reading. References [1] E. R. Berlekamp, Algebraic Coding Theory. McGraw-Hill Book Co., New York, 1968. [2] , The technology of error-correcting codes, Proceedings of the IEEE 68 (1980) 564–593. 16 [3] , Bit-serial Reed-Solomon encoders, IEEE Trans. Information Theory IT 28 (1982) 869–874. [4] , Bounded distance+1 soft-decision reed-solomon decoding, IEEE Trans. Information Theory IT 42 (1996) 704–720. [5] J. Bierbrauer, Introduction to Coding Theory. Chapman & Hall/CRC, Boca Raton, FL, 2005. [6] M. Bossert, S. Bezzateev, A unified view on known algebraic decoding algorithms and new decoding concepts, IEEE Trans. Inform. Theory 59 (2013) 7320–7336. [7] W. G. Chambers, Solution of Welch-Berlekamp key equation by Euclidean algorithm, Electronics Letters 29 (1993). [8] J.-L. Dornstetter, On the equivalence between Berlekamp’s and Euclid’s algorithms, IEEE Trans. Inform. Theory 33 (1987) 428–431. [9] S. V. Fedorenko, A simple algorithm for decoding Reed-Solomon codes and its relation to the WelchBerlekamp algorithm, IEEE Trans. Inform. Theory 51 (2005) 1196–1198. [10] D. Gorenstein, N. Zierler, A class of error-correcting codes in pm symbols, J. Soc. Indust. Appl. Math. 9 (1961) 207–214. [11] V. Guruswami, M. Sudan, Improved decoding of Reed-Solomon and algebraic-geometry codes, IEEE Trans. Inform. Theory 45 (1999) 1757–1767. [12] A. E. Heydtmann, J. M. Jensen, On the equivalence of the Berlekamp-Massey and the Euclidean algorithms for decoding, IEEE Trans. Inform. Theory 46 (2000) 2614–2624. [13] J. Justesen, T. Høholdt, A Course in Error-Correcting Codes. EMS Textbooks in Mathematics, European Mathematical Society (EMS), Zürich, 2004. [14] F. J. MacWilliams, N. J. A. Sloane, The Theory of Error-Correcting Codes.. North-Holland Publishing Co., Amsterdam-New York-Oxford, 1977, North-Holland Mathematical Library, Vol. 16. [15] J. L. Massey, Shift-register synthesis and BCH decoding, IEEE Trans. Information Theory IT-15 (1969) 122–127. [16] T. D. Mateer, On the equivalence of the Berlekamp–Massey and the Euclidean algorithms for algebraic decoding, in Information Theory (CWIT), 2011 12th Canadian Workshop on, 2011, 139–142. [17] , Simple algorithms for decoding systematic Reed–Solomon codes, Des. Codes Cryptogr. 69 (2013) 107–121. [18] R. Pellikaan, On decoding by error location and dependent sets of error positions, Discrete Math. 106/107 (1992) 369–381, A collection of contributions in honour of Jack van Lint. [19] , On the existence of error-correcting pairs, J. Statist. Plann. Inference 51 (1996) 229–242, Shanghai Conference Issue on Designs, Codes, and Finite Geometries, Part 1 (Shanghai, 1993). [20] W. W. Peterson, Encoding and error-correction procedures for the Bose-Chaudhuri codes., IRE Transactions on Information Theory IT-6 (1960) 459–470. [21] I. S. Reed, G. Solomon, Polynomial codes over certain finite fields, J. Soc. Indust. Appl. Math. 8 (1960) 300–304. [22] S. Roman, Introduction to Coding and Information Theory. Undergraduate Texts in Mathematics, SpringerVerlag, New York, 1997. [23] R. M. Roth, Introduction to Coding Theory. Cambridge University Press, New York, 2006. 17 [24] C. E. Shannon, A mathematical theory of communication, Bell System Tech. J. 27 (1948) 379–423, 623– 656. [25] M. Sudan, Decoding of Reed Solomon codes beyond the error-correction bound, J. Complexity 13 (1997) 180–193. [26] Y. Sugiyama, M. Kasahara, S. Hirasawa, T. Namekawa, A method for solving key equation for decoding Goppa codes, Information and Control 27 (1975) 87–99. [27] L. R. Welch, E. R. Berlekamp, Error correction for algebraic block codes, US Patent 4633470 (1986). 18
7cs.IT
Fault Detection in IEEE 14-Bus Power System with DG Penetration Using Wavelet Transform 1 1 2 Dept. of Electrical and Electronics Engineering, IIIT, Bhubaneswar, India Dept. of Electrical Engineering, SOA University, Bhubaneswar, India 3 3 4 Prakash K. Ray, 2B. K. Panigrahi, 2P. K. Rout Asit Mohanty, 4Harishchandra Dubey Dept. of Electrical Engineering, CET, Bhubaneswar, India Dept. of ECE, The University of Texas at Dallas, USA ABSTRACT: Wavelet transform is proposed in this paper for detection of islanding and fault disturbances distributed generation (DG) based power system. An IEEE 14-bus system with DG penetration is considered for the detection of disturbances under different operating conditions. The power system is a hybrid combination of photovoltaic, and wind energy system connected to different buses with different level of penetration. The voltage signal is retrieved at the point of common coupling (PCC) and processed through wavelet transform to detect the disturbances. Further, energy and standard deviation (STD) as performance indices are evaluated and compared with a suitable threshold in order to analyze a disturbance condition. Again, a comparative analysis between the existing and proposed detection is studied to prove the better performance of wavelet transform. 1 INTRODUCTION Distributed generations (DGs) being regarded as small-scale power resources, which are basically installed near to the loads or can be connected to grid if required. These sources are gaining a great popularity now-a-days because of deregulation and restructuring of the modern power system (Onara et al. 2008, Kim et al. 2008). Of course, the penetration levels of these DGs vary depending upon the location and availability of natural resources. But, with the increase in penetration level, some issues like islanding and fault disturbances become more vital and complex to detect because of uncertain characteristics of renewable resources like solar and wind energy. Islanding is a phenomenon usually occurring when the utility grid is being isolated from the DG because of some abnormal conditions, but during the same condition the DG continues to feed power to loads connected. Similarly fault may occur at any bus or near any bus of the system because of symmetrical and unsymmetrical faults like L-G, LL, L-L-G, L-L-L, L-L-L-G etc. So once occur, they have to be detected as quickly as possible and corrective measures are to be taken to protect the loads as well as the power system (Ray et al. 2010, Fernandez et al. 2002). In the literature, many methods were suggested in order to detect the disturbances (Yadav et al. 2014, Jang et al. 2004). The design and influence of multiple staged inverters in detecting the islanding events are presented in ( Yadav et al. 2014). The effect of interfacing control and non-detection zones for islanding detection is discussed in (Zeineldin et al. 2006). Voltage unbalance (VU) and total harmonic distortion (THD) are also taken as indices to detect islanding (Jang et al. 2004). But, if the threshold is not selected properly, the detection becomes difficult sometimes under some operating conditions. Artificial intelligence techniques like artificial neural network (ANN), fuzzy, adaptive neuro-fuzzy inference system (ANFIS), and support vector machines (SVM) are being used by the researchers for detection and classification of fault disturbances. In this context, different signal processing techniques are being implemented out of them wavelet transform (WT) is an efficient tool for detection based on time-frequency localization (Dubey et al. 2011, Cheng et al. 2008). WT is very versatile in identifying disturbance features which can easily detect any irregularities in the signal. Comparative detection ability between the existing methods like Fourier Transform (FT), Short time Fourier Transform (STFT) and wavelet transform is carried out with the help of performance indices; standard deviation and energy to prove the better performance of the proposed transform. The work is described section wise as follows; modeling of the This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by the authors or by the respective copyright holders. The original citation of this paper is:Prakash K. Ray, B. K. Panigrahi, P. K. Rout, Asit Mohanty, Harishchandra Dubey, "Fault Detection in IEEE 14-Bus Power System with DG Penetration Using Wavelet Transform", In the Proceedings of First International Conference on Advancement of Computer Communication & Electrical Technology, Oct. 2016, Murshidabad, India. DOI: 10.13140/RG.2.2.32899.09763 IEEE 14-bus system is described in Section 2, WT as signal processing based detection tool is presented in Section 3. Then, the MATLAB based simulation results with descriptions are given in Section 4. Finally, concluding remarks are presented in Section 5. 2 IEEE 14-BUS POWER SYSTEM The penetration level of different renewable power is increasing with time, thereby; the hybrid power system becomes more complex. Hence, the design, operation and control of power system are becoming more challenging. Suitable methods are to be adopted to identify the normal as well as abnormal operating conditions. While operating in grid-connected mode, the grid may be disconnected due to some abnormal conditions leading to islanding condition where the DG still continues to supply power the local loads. Similarly, there may arise fault disturbances due some type of faulty conditions between the phases and ground. Pmech   3 Awind C wind ( ,  )Vwind 2 (1) where is the mechanical power output from the wind in watts; ρ is the air density (kg/m3); is the power coefficient; is the tip-speed ratio ( / ), (m/s) is blade tip speed, and (m/s) is wind speed; is the area covered by rotor of wind turbine (m2); and β is the pitch angle (in degrees). The tip-speed ratio  is given as Rr  vwind (2) Where is the electrical speed (elec. rad/s). The doubly-fed induction generator (DFIG) model used as a part of the WECS (Tapia et al. 2003, Ray et al. 2010). 2.2 Photovoltaic (PV) The solar PV module is formed by combination of cells represented as basic P-N junction diode. The PV cells convert the input solar radiation into electricity. PV cells are connected in a series and parallel combination to vary the output power ratings. The output voltage V and the load current I of PV system are expressed by: V  IRs   I  I L  I 0 exp( )  1    (3) Where is the PV current in amps; is the saturation current; is the series resistance in ohms and is the thermal constant (Onara et al. 2008). 3 ISLANDING DETECTION METHODS Figure 1. IEEE 14-bus power system with interconnection of DGs. Fig. 1 shows the IEEE 14-bus power system with interconnection of DGs to some of its distribution buses. This model is developed in MATLAB/Simulink. 2.1 Wind energy conversion system (WECS) Wind turbines are a non-linear, dynamic system that converts the wind kinetic energy into mechanical energy which is then processed to produce electrical energy by using wind generators. The characteristics of wind turbines are highly uncertain, non-linear and complex to design and study. Different models of wind turbines are proposed with many degrees of freedom (DOFs) to ensure the energy conversion. The mechanical power output from wind turbine in terms of wind speed is expressed as (Ackermann 2005). 3.1 Wavelet transform (WT) as detection method Wavelet is a tool which is applied to decompose a signal/function into different components and associate a frequency band to each of them. WT also changes the scales and frequencies of the analyzed signal and components. WT does not require a fixed basis function as in case of Fourier transform (FT), rather, different set of possible basis functions can be formulated to improve the performance. In the present study, the voltage signals of the system is extracted and processed by Haar mother wavelet to decompose and detect the disturbances (Fernandez et al. 2002, Yadav et al. 2014). Of course, the voltage is filtered out by a series of low and high pass filters to obtain approximation (A) and detail (D) coefficients. The decomposition in of and detailed components are A1 (n)   H (k  2n) C0 (k ) ; D1 (n)   G(k  2n) C0 (k ) (4) k k where, ( ) is low-pass and ( ) is the high-pass components of filter. For every decomposition scale, approximate and detail coefficients ( ( )& ( )) is determined for time-frequency analysis of the signal, ( ). 3.2 STD and Energy as performance indices the coefficients of Haar wavelet transform is shown in Figure 2. Of course, here it is observed that the signal is represented for 1000 sec, where as the approximate and detail coefficients are represented in 500 sec, because the 1000 sec window is divided equally. Therefore, the islanding event which starts at around 610 secs. is reflected to be detected by the coefficients at about half of 305 secs. Magnitude approximation expressed as: Based on Parseval’s theorem, it is known that energy of a signal ( ) becomes same both in time as well as frequency domains and is given as T 2  V (t ) dt  K  V  n 2 (5) n 0 0 where T and K are time period and signal length, respectively, and [ ] is FT of the signal. Then, energy can be calculated by WT (Ackermann et al. 2005) Esignal   2 y (t ) dt  2   c (k )     d j (k ) -500 0 200 400 600 800 1000 0 -1000 0 -10 500 0 0 Time (sec) 500 Time (sec) Figure 2. Islanding detection at bus-14 using wavelet transform. 2 (6) The standard deviation and energy is calculated from the detail component (d1) of the voltage signal. k  0 Approx. coef. for haar Detail coef. for haar 1000 10 Magnitude Esignal 1  T 500 j  jo k  4 SIMULATED RESULTS This section presents the simulation and analysis of the system and techniques for islanding and fault disturbance detection in power system using wavelet transform under different operating conditions. The study is being implemented in an IEEE 14-bus power system with DG penetration like wind and solar photovoltaic energy system. The models of the above power system are simulated in MATLAB/SIMULINK environment The parameters of various components used for simulation are given in the reference (Zeineldin et al. 2006, Jang et al. 2004, Dubey at al. 2011, Cheng et al. 2008). 4.1 Islanding detection The islanding detection study using wavelet transform is presented in the 14-bus hybrid power system under different operating conditions. The voltage signal is captured from the bus-14 to which the solar DG1 (DGS1) system is connected along with the loads. The voltage signal is then being processed by wavelet transform to detect the islanding disturbance and the simulated results of 4.2 Fault disturbance detection This sub-section presents the study of detection of fault disturbances. Similar to the previous section, the voltage signal at bus-13, where the wind turbine is connected, is being measured and taken offline for processing. This signal is collected at the bus when there is an AG fault in the line connected between bus-13 and bus-14. Of course, both the voltages at the buses are affected. But, the voltage signal at bus-13 is taken into account for study in order to know the effect of fault as well as wind turbine on the voltage. The voltage signal with its detection results by detail and approximate coefficient of Haar wavelet is presented in Figure 3. As seen from the figure that the fault occurs at about 60 secs. in the signal and the corresponding detection in the detail and approximate coefficients of Haar wavelet are reflected in figure. It is observed from the detail coefficient that the instant fault occurrence is clearly detected with an sudden increase and oscillation of magnitude and when the fault is cleared, the voltage and its coefficients become normal. Similarly, the detection results for a AB fault in the connected line near bus-11 is shown in Figure 4. The voltage signal represents the variation which is also being detected by the wavelet coefficients. As soon as the fault is cleared, the signal as well as the coefficient comes to the normal operating conditions. Magnitude Magnitude (c) Comparison with different transforms 2 0 Technique -2 0 200 400 600 800 1000 Approx. coef. for haar Detail coef. for haar 2 0.2 0 0 -2 -0.2 0 500 0 500 Time (sec) Time (sec) Magnitude Magnitude Figure 3. AG fault detection at bus-13 using wavelet transform. 2 0 -2 0 200 400 Approx. coef. for haar 2 600 1000 Detail coef. for haar 0.1 0 -2 800 0 -0.1 0 500 Time (sec) Time (sec) Figure 4. AB fault detection at bus-11 using wavelet transform. 0 500 4.3 Energy and STD based detection of Islanding and Fault disturbances Table 1. STD and energy for islanding faults (a) Haar wavelet transform Scenario Bus-11 (AG) Bus-12 (BG) Bus-13 (CG) Bus-11 (AB) Bus-12 (BC) Bus-13 (CA) Fault disturbance STD Energy Islanding STD Bus-11 (AG) Bus-12 (BG) Bus-13 (CG) Bus-11 (AB) Bus-12 (BC) Bus-13 (CA) Energy 0.967 1.034 1.495 1.567 1.675 1.716 Islanding STD 1.120 1.673 1.784 1.649 1.801 2.014 Energy 1.894 2.171 2.742 2.698 2.822 2.963 The detection of islanding as well as fault disturbances based on the value of performance indices (PIs) like standard deviation (STD) and energy, are presented in this sub-section. The indices are evaluated from the output coefficients of wavelet. These values are then compared with the selected threshold values to know whether they come greater/lower. In case the index is higher than the threshold, islanding is identified, otherwise, if less, fault disturbance is detected. The computed energy and STD values are presented in Table 1. But, the challenge is there in selection of proper threshold value, which may be complex depending upon the type of network configuration as well as operating conditions. After finding the different values of PIs, as shown in Table, all the values are being compared with the threshold to identify the type of disturbance. A comparison between the different transforms is presented in (c) which suggest the increase in PI values in case of WTs, thereby increasing detection accuracy. Energy 1.39×10 0.6676 1.49×10 1.4657 5 CONCLUSIONS 2.44×10-11 0.8462 1.69×10-9 2.3645 -5 2.74×10 1.5670 -4 2.68×10 4.6767 1.39×10-5 1.6874 2.20×10-3 5.6786 1.39×10-5 0.9761 1.67×10-5 4.4656 2.30×10-5 1.5731 2.33×10-4 4.6763 A study on detection of islanding as well as the fault disturbances in an IEEE 14-bus hybrid power system, in presence of DGs, is presented under different operating conditions. The disturbances are detected using Haar and dB4 wavelet transforms. Case studies are shown for identifying islanding and fault disturbances under various operating scenarios. Further, quantitative analysis using PIs in terms of STD and energy were also presented for disturbance detections. Both qualitative and quantitative analysis shows the effectiveness and accuracy of the proposed transform in detecting the islanding and faults. -5 -5 (b) Daubechies4 (dB4) wavelet-transform Scenario FT STFT WT_dB1 WT_Haar WT_Coif WT_Demey Fault STD 0.453 0.634 0.842 0.793 0.830 0.772 Fault disturbance STD Energy 0.48×10 -5 1.83×10 -11 Islanding STD Energy -5 1.1935 0.0892 -4 2.37×10 2.3843 0.2460 2.03×10-5 3.0110 -5 0.3834 -5 2.35×10 3.3921 1.28×10-5 0.2781 3.39×10-5 2.9380 2.06×10-5 0.4830 2.29×10-4 3.3921 2.39×10-5 1.23×10 0.0671 3.13×10 REFERENCES Onara, O. C., M. Uzunoglua & M. S. Alam (2008). Modeling, control and simulation of an autonomous wind turbine/photovoltaic/fuel cell/ultra-capacitor hybrid power system. J. Power Sources. 185 (2), 1273-1283. Kim, Seul-Ki, Jeon Jin-Hong, Cho Chang-Hee, Jong-Bo Ahn, & Kwon Sae-Hyuk (2008). Dynamic Modeling and Control of a GridConnected Hybrid Generation System With Versatile Power Transfer. IEEE Trans. on Ind. Electr. 55 (4), 1677-1688. Ray, P. K., H. C. Dubey, S. R. Mohanty, Nand Kishor & K. Ganesh (2010). Power quality disturbance detection in grid-connected wind energy system using wavelet and S-transform. IEEE International Conference on Power, Control and Embedded Systems (ICPCES), November 29-Dec. 1, 1 – 4. Fernandez ALO & NKI Ghonaim (2002). A novel approach using a FIRANN for fault detection and direction estimation for high voltage transmission lines. IEEE Trans Power Deliv. 17, 894–901. Yadav A & A. Swetapadma (2014). Improved first zone reach setting of artificial neural networkbased directional relay for protection of double circuit transmission lines. IET Gen Transm Distrib 8(3), 373–88. Zeineldin H. H, Ehab F. El-Saadany & MMA. Salama (2006). Impact of DG interface control on islanding detection and non-detection zones. IEEE Trans Power Delivery 21(3), 1515–1523. Jang S & K. Kim (2004). An islanding detection method for distributed generation algorithm using voltage unbalance and total harmonic distortion of current. IEEE Trans Power Delivery 19(2), 745–752. Dubey H. C., S. R. Mohanty, Nand Kishor & P. K. Ray (2011). Fault Detection in a Series Compensated Transmission Line using Discrete Wavelet Transform and Independent Component Analysis: a Comparative Study. 5th International Power Engineering and Optimization Conference (PEOCO), Shah Alam, Selangor, Malaysia. Cheng-Tao Hsieh, Jeu-Min Lin & Shyh-Jier Huang (2008). Enhancement of islanding-detection of distributed generation systems via wavelet transform-based approaches. J. Electr. Power and Energy Syst., 30, 575–580. Ackermann T. (2005) Wind power in power systems Chichester, Wiley. Tapia, A., G. Tapia, J. X. Ostolaza & J. R. Saenz ( 2003). Modeling control of a wind turbine driven doubly fed induction generator. IEEE Trans. Energy Convers. 18 (2), 194–204. Ray P. K., S. R. Mohanty & Nand Kishor (2010). Coherency determination in grid-connected distributed generation based hybrid system under islanding scenarios. IEEE International Conference on Power and Energy (PECON), Kuala Lumpur, Malaysia, Nov 29-Dec. 1, 10, 85 – 88.
3cs.SY
Deciding How to Decide: Dynamic Routing in Artificial Neural Networks Mason McGill 1 Pietro Perona 1 arXiv:1703.06217v2 [stat.ML] 12 Sep 2017 Abstract We propose and systematically evaluate three strategies for training dynamically-routed artificial neural networks: graphs of learned transformations through which different input signals may take different paths. Though some approaches have advantages over others, the resulting networks are often qualitatively similar. We find that, in dynamically-routed networks trained to classify images, layers and branches become specialized to process distinct categories of images. Additionally, given a fixed computational budget, dynamically-routed networks tend to perform better than comparable staticallyrouted networks. Milner, 1992), and faces and other behaviorally-relevant stimuli ellicit responses in anatomically distinct, specialized regions (Moeller et al., 2008; Kornblith et al., 2013). However, state-of-the-art artificial neural networks (ANNs) for visual inference are routed statically (Simonyan & Zisserman, 2014; He et al., 2016; Dosovitskiy et al., 2015; Newell et al., 2016); every input triggers an identical sequence of operations. Clearly Sticks (Classify) Clearly Insects (Classify) Ambiguous (Inspect Further) 1. Introduction Some decisions are easier to make than others—for example, large, unoccluded objects are easier to recognize. Additionally, different difficult decisions may require different expertise—an avid birder may know very little about identifying cars. We hypothesize that complex decision-making tasks like visual classification can be meaningfully divided into specialized subtasks, and that a system designed to perform a complex task should first attempt to identify the subtask being presented to it, then use that information to select the most suitable algorithm for its solution. This approach—dynamically routing signals through an inference system, based on their content—has already been incorporated into machine vision pipelines via methods such as boosting (Viola et al., 2005), coarse-to-fine cascades (Zhou et al., 2013), and random decision forests (Ho, 1995). Dynamic routing is also performed in the primate visual system: spatial information is processed somewhat separately from object identity information (Goodale & 1 California Institute of Technology, Pasadena, California, USA. Correspondence to: Mason McGill <[email protected]>. Proceedings of the 34 th International Conference on Machine Learning, Sydney, Australia, PMLR 70, 2017. Copyright 2017 by the author(s). Figure 1. Motivation for dynamic routing. For a given data representation, some regions of the input space may be classified confidently, while other regions may be ambiguous. With this in mind, we propose a mechanism for introducing cascaded evaluation to arbitrary feedforward ANNs, focusing on the task of object recognition as a proof of concept. Instead of classifying images only at the final layer, every layer in the network may attempt to classify images in lowambiguity regions of its input space, passing ambiguous images forward to subsequent layers for further consideration (see Fig. 1 for an illustration). We propose three approaches to training these networks, test them on small image datasets synthesized from MNIST (LeCun et al., 1998) and CIFAR-10 (Krizhevsky & Hinton, 2009), and quantify the accuracy/efficiency trade-off that occurs when the network parameters are tuned to yield more aggressive early classification policies. Additionally, we propose and evaluate methods for appropriating regularization and optimization techniques developed for statically-routed networks. 2. Related Work Since the late 1980s, researchers have combined artificial neural networks with decision trees in various Deciding How to Decide: Dynamic Routing in Artificial Neural Networks ways (Utgoff, 1989) (Sirat & Nadal, 1990). More recently, Kontschieder et al. (2015) performed joint optimization of ANN and decision tree parameters, and Bulo & Kontschieder (2014) used randomized multi-layer networks to compute decision tree split functions. dj = 0 To our knowledge, the family of inference systems we discuss was first described by Denoyer & Gallinari (2014). Additionally, Bengio et al. (2015) explored dynamically skipping layers in neural networks, and Ioannou et al. (2016) explored dynamic routing in networks with equallength paths. Some recently-developed visual detection systems perform cascaded evaluation of convolutional neural network layers (Li et al., 2015; Cai et al., 2015; Girshick, 2015; Ren et al., 2015); though highly specialized for the task of visual detection, these modifications can radically improve efficiency. Source While these approaches lend evidence that dynamic routing can be effective, they either ignore the cost of computation, or do not represent it explicitly, and instead use opaque heuristics to trade accuracy for efficiency. We build on this foundation by deriving training procedures from arbitrary application-provided costs of error and computation, comparing one actor-style and two critic-style strategies, and considering regularization and optimization in the context of dynamically-routed networks. 3. Setup In a statically-routed, feedforward artificial neural network, every layer transforms a single input feature vector into a single output feature vector. The output feature vector is then used as the input to the following layer (which we’ll refer to as the current layer’s sink), if it exists, or as the ouptut of the network as a whole, if it does not. We consider networks in which layers may have more than one sink. In such a network, for every n-way junction j a signal reaches, the network must make a decision, dj ∈ {0..n}, such that the signal will propagate through the ith sink if and only if dj = i (this is illustrated in Fig. 2). We compute dj as the argmax of the score vector sj , a learned function of the last feature vector computed before reaching j. We’ll refer to this rule for generating d from s as the inference routing policy. 3.1. Multipath Architectures for Convolutional Networks Convolutional network layers compute collections of local descriptions of the input signal. It is unreasonable to expect that this kind of feature vector can explicitly encode the global information relevant to deciding how to route the entire signal (e.g., in the case of object recognition, whether the image was taken indoors, whether the image contains dj = 1 Sink 0 Sink 1 Sink 0 Source Sink 1 Figure 2. A 2-way junction, j. dj is an integer function of the source features. When dj = 0, the signal is propagated through the top sink, and the bottom sink is inactive. When dj = 1, the signal is propagated through the bottom sink, and the top sink is inactive. an animal, or the prevalence of occlusion in the scene). To address this, instead of computing a 2-dimensional array of local features at each layer, we compute a pyramid of features (resembling the pyramids described by Ke et al. (2016)), with local descriptors at the bottom and global descriptors at the top. At every junction j, the score vector sj is computed by a small routing network operating on the last-computed global descriptor. Our multipath architecture is illustrated in Fig. 3. 3.2. Balancing Accuracy and Efficiency For a given input, network ν, and set of routing decisions d, we define the cost of performing inference: cinf (ν, d) = cerr (ν, d) + ccpt (ν, d), (1) where cerr (ν, d) is the cost of the inference errors made by the network, and ccpt (ν, d) is the cost of computation. In our experiments, unless stated otherwise, cerr is the crossentropy loss and ccpt (ν, d) = kcpt nops (ν, d), (2) where nops (ν, d) is the number of multiply-accumulate operations performed and kcpt is a scalar hyperparameter. This definition assumes a time- or energy-constrained system—every operation consumes roughly the same amount of time and energy, so every operation is equally expensive. ccpt may be defined differently under other constraints (e.g. memory bandwidth). 4. Training We propose three approaches to training dynamicallyrouted networks, along with complementary approaches to regularization and optimization, and a method for adapting to changes in the cost of computation. Deciding How to Decide: Dynamic Routing in Artificial Neural Networks “H ” se or Routing Subnetworks 4×4 8×8 Convolution, Batch Normalization, Rectification 16×16 Linear Transformation, Batch Normalization, Rectification Linear Transformation, Softmax Linear Transformation, Argmax “Stop” Signal 32×32 “Go” Signal 16 chan. 16 chan. 32 chan. 32 chan. 64 chan. 64 chan. 128 chan. 128 chan. Figure 3. Our multiscale convolutional architecture. Once a column is evaluated, the network decides whether to classify the image or evaluate subsequent columns. Deeper columns operate at coarser scales, but compute higher-dimensional representations at each location. All convolutions use 3×3 kernels, downsampling is achieved via 2×2 max pooling, and all routing layers have 16 channels. 4.1. Training Strategy I: Actor Learning Since d is discrete, cinf (ν, d) cannot be minimized via gradient-based methods. However, if d is replaced by a ˆ during training, we can engistochastic approximation, d, ˆ to be nonzero. We can then neer the gradient of E[cinf (ν, d)] learn the routing parameters and classification parameters simultaneously by minimizing the loss where J is the set of junctions encountered when making ˆ and cure is the utility regression erthe routing decisions d, ror cost, defined: cjure = kure ksj − uj k2 , (6) uij = −cinf (νji , d), (7) where ˆ Lac = E[cinf (ν, d)]. (3) In our experiments, the training routing policy samples dˆ such that Pr(dˆj = i) = softmax(sj /τ )i , (4) where τ is the network “temperature”: a scalar hyperparameter that decays over the course of training, converging the training routing policy towards the inference routing policy. 4.2. Training Strategy II: Pragmatic Critic Learning Alternatively, we can attempt to learn to predict the expected utility of making every routing decision. In this case, we minimize the loss  ˆ + Lcr = E cinf (ν, d) kure is a scalar hyperparameter, and νji is the subnetwork consisting of the ith child of νj , and all of its descendants. Since we want to learn the policy indirectly (via cost prediction), dˆ is treated as constant with respect to optimization. 4.3. Training Strategy III: Optimistic Critic Learning To improve the stability of the loss and potentially accelerate training, we can adjust the routing utility function u such that, for every junction j, uj is independent of the routing parameters downstream of j. Instead of predicting the cost of making routing decisions given the current downstream routing policy, we can predict the cost of making routing decisions given the optimal downstream routing policy. In this optimistic variant of the critic method,  X j∈J cjure  , (5) uij = −mind0 (cinf (νji , d0 )). (8) Deciding How to Decide: Dynamic Routing in Artificial Neural Networks 4.4. Regularization Many regularization techniques involve adding a modelcomplexity term, cmod , to the loss function to influence learning, effectively imposing soft constraints upon the network parameters (Hoerl & Kennard, 1970; Rudin et al., 1992; Tibshirani, 1996). However, if such a term affects layers in a way that is independent of the amount of signal routed through them, it will either underconstrain frequently-used layers or overconstrain infrequently-used layers. To support both frequently- and infrequently-used layers, we regularize subnetworks as they are activated by ˆ instead of regularizing the entire network directly. d, ˆ With this policy, at every training quent layers based on d. interation, mini-batch stochastic gradient descent shifts the parameters associated with layer ` by a vector δ`∗ , defined: δ`∗ = −λ cmod = E kL2 # X w2 , (9) w∈W g`i , (11) i where λ is the global learning rate and g`i is the gradient of the loss with respect to the parameters in `, for training example i, under d∗` . Analogously, the scaled parameter adjustment under dˆ can be written δ` = −α` λ For example, to apply L2 regularization to critic networks, we define cmod : " X X pi` g`i , (12) i where pi` is the probability with which dˆ routes example i through `. We want to select α` such that where W is the set of weights associated with the layers ˆ and kL2 is a scalar hyperparameter. activated by d, For actor networks, we apply an extra term to control the magnitude of s, and therefore the extent to which the net explores subpotimal paths: Var(δ` ) = Var(δ`∗ ). (13) Substituting the definitions of δ` and δ`∗ , !  cmod = E kL2 Var α`  X w∈W w2 + kdec X j∈J ksj k2  , (10) where kdec is a scalar hyperparameter indicating the relative cost of decisiveness. cmod is added to the loss function in all of our experiments. Within cmod , unless stated otherwise, dˆ is treated as constant with respect to optimization. 4.5. Adjusting Learning Rates to Compensate for Throughput Variations Both training techniques attempt to minimize the expected cost of performing inference with the network, over the training routing policy. With this setup, if we use a constant learning rate for every layer in the network, then layers through which the policy routes examples more frequently will receive larger parameter updates, since they contribute more to the expected cost. To allow every layer to learn as quickly as possible, we scale the learning rate of each layer ` dynamically, by a factor α` , such that the elementwise variance of the loss gradient with respect to `’s parameters is independent of the amount of probability density routed through it. To derive α` , we consider an alternative routing policy, d∗` , that routes all signals though `, then routes through subse- X pi` g`i ! = Var i X g`i . (14) i Since every g`i is sampled independently, we can rewrite this equation: nex v` α`2 kp` k2 = nex v` , (15) where nex is the number of training examples in the minibatch and v` is the elementwise variance of g`i , for any i (since every example is sampled via the same mechanism). We can now show that α` = kp` k−1 . (16) So, for every layer `, we can scale the learning rate by kp` k−1 , and the variance of the weight updates will be similar thoughout the network. We use this technique, unless otherwise specified, in all of our experiments. 4.6. Responding to Changes in the Cost of Computation We may want a single network to perform well in situations with various degrees of computational resource scarcity (e.g. computation may be more expensive when a device battery is low). To make the network’s routing behavior responsive to a dynamic ccpt , we can concatenate ccpt ’s known Deciding How to Decide: Dynamic Routing in Artificial Neural Networks parameters—in our case, {kcpt }—to the input of every routing subnetwork, to allow them to modulate the routing policy. To match the scale of the image features and facilitate optimization, we express kcpt in units of cost per tenmillion operations. 4.7. Hyperparameters In all of our experiments, we use a mini-batch size, nex , of 128, and run 80,000 training iterations. We perform stochastic gradient descent with initial learning rate 0.1/nex and momentum 0.9. The learning rate decays continuously with a half-life of 10,000 iterations. networks to classify images from a small-image dataset synthesized from MNIST (LeCun et al., 1998) and CIFAR10 (Krizhevsky & Hinton, 2009) (see Fig. 4). Our dataset includes the classes “0”, “1”, “2”, “3”, and “4” from MNIST and “airplane”, “automobile”, “deer”, “horse”, and “frog” from CIFAR-10 (see Fig. 4). The images from MNIST are resized to match the scale of images from CIFAR-10 (32×32), via linear interpolation, and are colormodulated to make them more difficult to trivially distinguish from CIFAR-10 images (MNIST is a grayscale dataset). The weights of the final layers of routing networks are zero-initialized, and we initialize all other weights using the Xavier initialization method (Glorot & Bengio, 2010). All biases are zero-initialized. We perform batch normalization (Ioffe & Szegedy, 2015) before every rectification operation, with an  of 1×10−6 , and an exponential moving average decay constant of 0.9. τ is initialized to 1.0 for actor networks and 0.1 for critic networks, and decays with a half-life of 10,000 iterations. kdec = 0.01, kure = 0.001, and kL2 = 1 × 10−4 . We selected these values (for τ , kdec , kure , and kL2 ) by exploring the hyperparameter space logarithmically, by powers of 10, training and evaluating on the hybrid MNIST/CIFAR-10 dataset (described in section 5.1). At a coarse level, these values are locally optimal—multiplying or dividing any of them by 10 will not improve performance. 4.8. Data Augmentation We augment our data using an approach that is popular for use with CIFAR-10 (Lin et al., 2013) (Srivastava et al., 2015) (Clevert et al., 2015). We augment each image by applying vertical and horizontal shifts sampled uniformly from the range [-4px,4px], and, if the image is from CIFAR-10, flipping it horizontally with probability 0.5. We fill blank pixels introduced by shifts with the mean color of the image (after gamma-decoding). 5. Experiments We compare approaches to dynamic routing by training 153 networks to classify small images, varying the policy-learning strategy, regularization strategy, optimization strategy, architecture, cost of computation, and details of the task. The results of these experiments are reported in Fig. 5–10. Our code is available on GitHub. 5.1. Comparing Policy-Learning Strategies To compare routing strategies in the context of a simple dataset with a high degree of difficulty variation, we train Figure 4. Sample images from the hybrid MNIST/CIFAR-10 dataset. We recolor images from MNIST via the following procedure: we select two random colors at least 0.3 units away from each other in RGB space; we then map black pixels to the first color, map white pixels to the second color, and linearly interpolate in between. For a given computational budget, dynamically-routed networks achieve higher accuracy rates than architecturematched statically-routed baselines (networks composed of the first n columns of the architecture illustrated in Fig. 3, for n ∈ {1..8}). Additionally, dynamically-routed networks tend to avoid routing data along deep paths at the beginning of training (see Fig. 8). This is possibly because the error surfaces of deeper networks are more complicated, or because deeper paths are less stable—changing the parameters in any component layer to better classify images routed along other, overlapping paths may decrease performance. Whatever the mechanism, this tendency to initially find simpler solutions seems to prevent some of the overfitting that occurs with 7- and 8-layer statically-routed networks. Deciding How to Decide: Dynamic Routing in Artificial Neural Networks 0.06 0.06 Error Rate 0.04 0.02 0.04 0.06 0.04 0.02 0.02 0 1×107 2×107 0 1×107 2×107 0 1×107 2×107 1×107 0 2×107 0 1×107 2×107 Mean Op Count Statically-Routed Nets Pragmatic Critic Nets Optimistic Critic Nets Pragmatic Critic Nets, no TALR Pragmatic Critic Nets, Classification Error Actor Nets Actor Nets, no TALR Actor Nets, kdec = 0 Actor Net, Branching Actor Net, Dynamic kcpt Actor Nets, Regularized Policy Cost of Computation Figure 5. Hybrid dataset performance. Every point along the “statically-routed nets” curve corresponds to a network composed of the first n columns of the architecture illustrated in Fig. 3, for 1 ≤ n ≤ 8. The points along the “actor net, dynamic kcpt ” curve correspond to a single network evaluated with various values of kcpt , as described in section 4.6. The points along all other curves correspond to distinct networks, trained with different values of kcpt . kcpt ∈ {0, 1 × 10−9 , 2 × 10−9 , 4 × 10−9 , ... 6.4 × 10−8 }. Layer Index Correct Labels Incorrect Labels Layer Index 0 1 2 3 4 Airplane Automobile Deer Frog Horse Figure 6. Dataflow through actor networks trained to classify images from the hybrid MNIST/CIFAR-10 dataset. Every row is a node-link diagram corresponding to a network, trained with a different kcpt . Each circle indicates, by area, the fraction of examples that are classified at the corresponding layer. The circles are colored to indicate the accuracy of each layer (left) and the kinds of images classified at each layer (right). Deciding How to Decide: Dynamic Routing in Artificial Neural Networks Compared to other dynamically-routed networks, optimistic critic networks perform poorly, possibly because optimal routers are a poor approximation for our small, lowcapacity router networks. Actor networks perform better than critic networks, possibly because critic networks are forced to learn a potentially-intractable auxilliary task (i.e. it’s easier to decide who to call to fix your printer than it is to predict exactly how quickly and effectively everyone you know would fix it). Actor networks also consistently achieve higher peak accuracy rates than comparable statically-routed networks, across experiments. the cross-entropy error in the cure term with the classification error. Although these networks do not perform as well as the original pragmatic critic networks, they still outperform comparable statically-routed networks. 5.2. Comparing Regularization Strategies Based on our experiments with the hybrid dataset, regularˆ as described in section 4.4, discourages networks izing d, from routing data along deep paths, reducing peak accuracy. Additionally, some mechanism for encouraging exploration (in our case, a nonzero kdec ) appears to be necessary to train effective actor networks. 5.3. Comparing Optimization Strategies Throughput-adjusting the learning rates (TALR), as described in section 4.5, improves the hybrid dataset performance of both actor and critic networks in computationalresource-abundant, high-accuracy contexts. 0 1 2 3 4 Airplane Automobile Deer Frog Horse 5.4. Comparing Architectures Dataflow Figure 7. Dataflow through a branching actor network trained to classify images in the hybrid dataset, illustrated as in Fig. 6. kcpt = 1×10−9 kcpt = 0 kcpt = 2×10−9 kcpt = 4×10−9 1.0 80k Epoch Index 0.8 0.6 40k 0.4 For a given computational budget, architectures with both 2- and 3-way junctions have a higher capacity than subtrees with only 2-way junctions. On the hybrid dataset, under tight computational constraints, we find that trees with higher degrees of branching achieve higher accuracy rates. Unconstrained, however, they are prone to overfitting. In dynamically-routed networks, early classification layers tend to have high accuracy rates, pushing difficult decisions downstream. Even without energy contraints, terminal layers specialize in detecting instances of certain classes of images. These classes are usually related (they either all come from MNIST or all come from CIFAR-10.) In networks with both 2- and 3-way junctions, branches specialize to an even greater extent. (See Fig. 6 and 7.) 0.2 0.0 4 8 4 8 4 8 4 8 Layer Index Figure 8. Dataflow over the course of training. The heatmaps illustrate the fraction of validation images classified at every terminal node in the bottom four networks in Fig. 6, over the course of training. Although actor networks may be more performant, critic networks are more flexible. Since critic networks don’t reˆ to be a differentiable function of d, ˆ they quire E[cinf (ν, d)] ˆ saving memory, and they can be trained by sampling d, support a wider selection of training routing policies (e.g. -greedy) and cinf definitions. In addition to training the standard critic networks, we train networks using a variant of the pragmatic critic training policy, in which we replace 5.5. Comparing Specialized and Adaptive Networks We train a single actor network to classify images from the hybrid datset under various levels of computational constraints, using the approach described in section 4.6, sampling kcpt randomly from the set mentioned in Fig. 5 for each training example. This network performs comparably to a collection of 8 actor nets trained with various static values of kcpt , over a significant, central region of the accuracy/efficiency curve, with an 8-fold reduction in memory consumption and training time. 5.6. Exploring the Effects of the Decision Difficulty Distribution To probe the effect of the inference task’s difficulty distribution on the performance of dynamically-routed net- Deciding How to Decide: Dynamic Routing in Artificial Neural Networks works, we train networks to classify images from CIFAR10, adjusting the classification task to vary the frequency of difficult decisions (see Fig. 9). We call these variants CIFAR-2—labelling images as “horse” or “other”— and CIFAR-5—labelling images as “cat”, “dog”, “deer”, “horse”, or “other”. In this experiment, we compare actor networks (the best-performing networks from the first set of experiments) to architecture-matched statically-routed networks. Error Rate 0.3 CIFAR-10: Statically-Routed Nets CIFAR-10: Actor Nets CIFAR-5: Statically-Routed Nets CIFAR-5: Actor Nets CIFAR-2: Statically-Routed Nets CIFAR-2: Actor Nets 0.2 0.1 1×107 2×107 Mean Op Count Figure 9. Performance effects of the task difficulty distribution, as described in section 5.6. The “statically-routed nets” and “actor nets” curves are drawn analogously to their counterparts in Fig. 5. Error Rate 16 ≤ nchan ≤ 128 0.25 0.20 0.20 0.15 0.15 32 ≤ nchan ≤ 256 0 2×107 Statically-Routed Nets Actor Nets 48 ≤ nchan ≤ 384 0.15 0.10 0.10 0 8×107 0 To test whether dynamic routing is advantageous in highercapacity settings, we train actor networks and architecturematched statically-routed networks to classify images from CIFAR-10, varying the width of the networks (see Fig. 10). Increasing the model capacity either increases or does not affect the relative advantage of dynamically-routed networks, suggesting that our approach is applicable to more complicated tasks. 6. Discussion Our experiments suggest that dynamically-routed networks trained under mild computational constraints can operate 2–3 times more efficiently than comparable staticallyrouted networks, without sacrificing performance. Additionally, despite their higher capacity, dynamically-routed networks may be less prone to overfitting. When designing a multipath architecture, we suggest supporting early decision-making wherever possible, since cheap, simple routing networks seem to work well. In convolutional architectures, pyramidal layers appear to be reasonable sites for branching. 0.0 0 5.7. Exploring the Effects of Model Capacity 1.8×108 Mean Op Count The actor strategy described in section 4.1 is generally an effective way to learn a routing policy. However, the pragmatic critic strategy described in section 4.2 may be better suited for very large networks (trained via decision sampling to conserve memory) or networks designed for applications with nonsmooth cost-of-inference functions—e.g. one in which kcpt has units errors/operation. Adjusting learning rates to compensate for throughput variations, as described in section 4.5, may improve the performance of deep networks. If the cost of computation is dynamic, a single network, trained with the procedure described in section 5.5, may still be sufficient. Figure 10. Performance effects of model capacity, training and testing on CIFAR-10. (Left) Networks with (subsets of) the architecture illustrated in Fig. 3. (Center) Networks otherwise identical to those presented in the left panel, with the number of output channels of every convolutional layer multiplied by 2, and kcpt divided by 4. (Right) Networks otherwise identical to those presented in the left panel, with the number of output channels of every convolutional layer multiplied by 3, and kcpt divided by 9. While we test our approach on tasks with some degree of difficulty variation, it is possible that dynamic routing is even more advantageous when performing more complex tasks. For example, video annotation may require specialized modules to recognize locations, objects, faces, human actions, and other scene components or attributes, but having every module constantly operating may be extremely inefficient. A dynamic routing policy could fuse these modules, allowing them to share common components, and activate specialized components as necessary. We find that dynamic routing is more beneficial when the task involves many low-difficulty decisions, allowing the network to route more data along shorter paths. While dynamic routing offers only a slight advantage on CIFAR-10, dynamically-routed networks achieve a higher peak accuracy rate on CIFAR-2 than statically-routed networks, at a third of the computational cost. Another interesting topic for future research is growing and shrinking dynamically-routed networks during training. With such a network, it is not necessary to specify an architecture. The network will instead take shape over the course of training, as computational contraints, memory contraints, and the data dictate. Deciding How to Decide: Dynamic Routing in Artificial Neural Networks Acknowledgements This work was funded by a generous grant from Google Inc. We would also like to thank Krzysztof Chalupka, Cristina Segalin, and Oisin Mac Aodha for their thoughtful comments. References Ho, Tin Kam. Random decision forests. In Document Analysis and Recognition, 1995., Proceedings of the Third International Conference on, volume 1, pp. 278–282. IEEE, 1995. Hoerl, Arthur E and Kennard, Robert W. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55–67, 1970. Bengio, Emmanuel, Bacon, Pierre-Luc, Pineau, Joelle, and Precup, Doina. Conditional computation in neural networks for faster models. arXiv preprint arXiv:1511.06297, 2015. Ioannou, Yani, Robertson, Duncan, Zikic, Darko, Kontschieder, Peter, Shotton, Jamie, Brown, Matthew, and Criminisi, Antonio. Decision forests, convolutional networks and the models in-between. arXiv preprint arXiv:1603.01250, 2016. Bulo, Samuel and Kontschieder, Peter. Neural decision forests for semantic image labelling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 81–88, 2014. Ioffe, Sergey and Szegedy, Christian. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. Cai, Zhaowei, Saberian, Mohammad, and Vasconcelos, Nuno. Learning complexity-aware cascades for deep pedestrian detection. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3361– 3369, 2015. Clevert, Djork-Arné, Unterthiner, Thomas, and Hochreiter, Sepp. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015. Denoyer, Ludovic and Gallinari, Patrick. Deep sequential neural network. arXiv preprint arXiv:1410.0510, 2014. Dosovitskiy, Alexey, Fischer, Philipp, Ilg, Eddy, Hausser, Philip, Hazirbas, Caner, Golkov, Vladimir, van der Smagt, Patrick, Cremers, Daniel, and Brox, Thomas. Flownet: Learning optical flow with convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2758–2766, 2015. Girshick, Ross. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1440– 1448, 2015. Ke, Tsung-Wei, Maire, Michael, and Yu, Stella X. Neural multigrid. arXiv preprint arXiv:1611.07661, 2016. Kontschieder, Peter, Fiterau, Madalina, Criminisi, Antonio, and Rota Bulo, Samuel. Deep neural decision forests. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1467–1475, 2015. Kornblith, Simon, Cheng, Xueqi, Ohayon, Shay, and Tsao, Doris Y. A network for scene processing in the macaque temporal lobe. Neuron, 79(4):766–781, 2013. Krizhevsky, Alex and Hinton, Geoffrey. Learning multiple layers of features from tiny images. 2009. LeCun, Yann, Cortes, Corinna, and Burges, Christopher JC. The mnist database of handwritten digits, 1998. Li, Haoxiang, Lin, Zhe, Shen, Xiaohui, Brandt, Jonathan, and Hua, Gang. A convolutional neural network cascade for face detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5325–5334, 2015. Lin, Min, Chen, Qiang, and Yan, Shuicheng. Network in network. arXiv preprint arXiv:1312.4400, 2013. Glorot, Xavier and Bengio, Yoshua. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pp. 249–256, 2010. Moeller, Sebastian, Freiwald, Winrich A, and Tsao, Doris Y. Patches with links: a unified system for processing faces in the macaque temporal lobe. Science, 320(5881):1355–1359, 2008. Goodale, Melvyn A and Milner, A David. Separate visual pathways for perception and action. Trends in neurosciences, 15(1):20–25, 1992. Newell, Alejandro, Yang, Kaiyu, and Deng, Jia. Stacked hourglass networks for human pose estimation. In European Conference on Computer Vision, pp. 483–499. Springer, 2016. He, Kaiming, Zhang, Xiangyu, Ren, Shaoqing, and Sun, Jian. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016. Ren, Shaoqing, He, Kaiming, Girshick, Ross, and Sun, Jian. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in Neural Information Processing Systems, pp. 91–99, 2015. Deciding How to Decide: Dynamic Routing in Artificial Neural Networks Rudin, Leonid I, Osher, Stanley, and Fatemi, Emad. Nonlinear total variation based noise removal algorithms. Physica D: Nonlinear Phenomena, 60(1-4):259–268, 1992. Simonyan, Karen and Zisserman, Andrew. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. Sirat, JA and Nadal, JP. Neural trees: a new tool for classification. Network: Computation in Neural Systems, 1 (4):423–438, 1990. Srivastava, Rupesh K, Greff, Klaus, and Schmidhuber, Jürgen. Training very deep networks. In Advances in neural information processing systems, pp. 2377–2385, 2015. Tibshirani, Robert. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pp. 267–288, 1996. Utgoff, Paul E. Perceptron trees: A case study in hybrid concept representations. Connection Science, 1(4):377– 391, 1989. Viola, Paul, Jones, Michael J, and Snow, Daniel. Detecting pedestrians using patterns of motion and appearance. International Journal of Computer Vision, 63(2):153–161, 2005. Zhou, Erjin, Fan, Haoqiang, Cao, Zhimin, Jiang, Yuning, and Yin, Qi. Extensive facial landmark localization with coarse-to-fine convolutional network cascade. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pp. 386–391, 2013.
9cs.NE
arXiv:1310.0584v1 [math.AC] 2 Oct 2013 UPPER BOUND OF MULTIPLICITY OF F-RATIONAL RINGS AND F-PURE RINGS CRAIG HUNEKE AND KEI-ICHI WATANABE Abstract. This paper answers in the affirmative a question raised by Karl Schwede concerning an upper bound on the multiplicity of F-pure rings. 1. Introduction In the problem session of the workshop at AIM, August 2011, titled “Relating Test Ideals and Multiplier Ideals”, Karl Schwede, inspired by the work of Stefan Helmke [He], posed the following question. Let (R, m) be a Noetherian local ring of characteristic p > 0 of dimension d and embedding dimension v. Assume that R is F-pure. Then does the multiplicity e(R) of R always satisfy   v ? e(R) ≤ d We will prove this inequality is true, and follows from a Briançon-Skoda type theorem. Our results can be used to give an alternate proof of one of the main results of [ST], bounding the number of F-pure centers in an F-pure F-finite local ring, which was one of the reasons for asking the motivating question. See Remark 3.4. 2. Preliminaries Let (R, m) be either a Noetherian local ring or R = ⊕n≥0 Rn be a graded ring finitely generated over a field R0 = k. We always assume that either R contains a field of characteristic p > 0 or R is essentially of finite type over a field of characteristic 0. We always assume that our ring R is reduced. Definition 2.1. We denote by R◦ the set of elements of R that are not contained in any minimal prime ideal. The tight closure I ∗ of I is defined to be the ideal of R consisting of all elements x ∈ R for which there exists c ∈ R◦ such that cxq ∈ I [q] for all large q = pe . 2010 Mathematics Subject Classification. Primary: 13H15, Secondary: 13C99, 14B05. The first author is partially supported by NSF grant 1259142. The second author is partially supported by Grant-in-Aid for Scientific Research 20540050 and Individual Research Expense of College of Humanity and Sciences, Nihon University. We thank AIM for the opportunity to work together. 1 2 CRAIG HUNEKE AND KEI-ICHI WATANABE Definition 2.2. We say that a local ring (R, m) is F-rational if it is a homomorphic image of a Cohen-Macaulay ring and for every parameter ideal J of R we have J ∗ = J. It is known that F-rational rings are normal and Cohen-Macaulay. Definition 2.3. Assume that R contains a field of characteristic p > 0 and q = pe be a power of p. (1) For a power q = pe and ideal I in R, we denote by I [q] , the ideal generated by {aq | a ∈ I}. (2) We write R1/q then we say that R is F-pure if for every R module M, the natural map M = M ⊗R R → M ⊗R R1/p , sending x ∈ M to x⊗1 is injective. (3) Let I be an ideal of R and x ∈ R. If R is F-pure and if xq ∈ I [q] , then x ∈ I. This follows from (2) if we put M = R/I. 3. The main results The following theorem is our main result in this article. Theorem 3.1. Let (R, m) be a Noetherian local ring with dim R = d and embedding dimension v. Then,   v−1 (1) If R is a rational singularity or F-rational, then e(R) ≤ . d−1   v (2) If R is F-pure, then e(R) ≤ . d This theorem easily follows from the following theorem. We recall that a reduction J of an ideal I is an ideal J ⊂ I such that for large n, I n = JI n−1 . A minimal reduction is a reduction minimal with respect to inclusion. A fundamental fact is that in a Noetherian local ring of dimension d having infinite residue class field, minimal reductions are always generated by at most d elements. See [HS, Section 8.3]. Theorem 3.2. Let (R, m) be a Noetherian local ring with dim R = d and let J ⊂ m be a minimal reduction of m. (1) If R is a rational singularity or F-rational, then md ⊂ J. (2) If R is F-pure, then md+1 ⊂ J. Proof. The statement (1) is well known and follows from Briançon-Skoda type theorem (cf. [HH], [LT]). For the statement (2) we will prove the following statement. Assume R is F-pure and I is an ideal generated by r elements, which contains a nonzerodivisor, then I r+1 ⊂ I. This is sufficient to prove 3.2 since md+1 ⊂ md+1 = J d+1 . Now, take x ∈ I r+1 . Then we can take c ∈ R◦ such that for sufficiently large N, cxN ∈ I (r+1)N . Then cxN ∈ c(I (r+1)N : c). The latter is contained in cR ∩ I (r+1)N and by the Artin-Rees Lemma, there exists k such that cR ∩ I (r+1)N ⊂ cI (r+1)N −k UPPER BOUND OF MULTIPLICITY OF F-RATIONAL RINGS AND F-PURE RINGS 3 for sufficiently large N. Now, we have shown that cxN ∈ cI (r+1)N −k . Note that I rq ⊂ I [q] . Taking sufficiently large N = q = pe and noting that c is a non zero divisor, we get xq ∈ I [q] . Since R is F-pure, we get x ∈ I. This was proved in [Hu], Proposition 4.9 when R is Cohen-Macaulay.  It is easy to prove 3.1 using 3.2. Proof of 3.2 =⇒ 3.1. We have the following inequality and the equality holds if and only if R is Cohen-Macauly (cf. [BH], Corollary 4.7,11). (3.1.1) e(R) ≤ lR (R/J) So, it suffices to show that lR (R/J) is bounded by the right-hand side of the inequalities in 3.1. Now, let x1 , . . . , xd , y1 , . . . , yv−d be minimal generators of m with J = (x1 , . . . , xd ). Then R/J is generated by the monomials of y1 , . . . , yv−d of degree ≤ d − 1 (resp. degree ≤ d) in case (1) (resp. case (2)) by 3.2. It is easy to see that the number    of y1 , . . . , yv−d of degree ≤ d − 1 (resp. degree ≤ d) is  of monomials v−1 v (resp. ).  d−1 d Remark 3.3. Assume we have equality in 3.1 (1) or (2). Then R is Cohen-Macaulay since we must have equality in (3.1.1), too. Moreover, since the associated graded ring of R has the same embedding dimension and multiplicity with R, grm (R) is also Cohen-Macaulay in this case. Remark 3.4. Another class of singularities which would be natural to consider are F-injective (respectively, Du Bois) singularities. So, it is natural to ask if 3.2 is true if we assume R is F-injective or a Du Bois singularity. We do not know the answer. Also, we point out that our 3.2 (2) gives another proof of one of the main theorems of [ST] concerning the number of F-pure centers. Actually, in Theorem 5.10 of [ST], if Qi (1 ≤ i ≤ N) are prime ideals of dimension d of R such that every R/Qi is F-pure, then certainly the number N is bounded by the multiplicity of R/[∩N i=1 Qi ] and the latter is F-pure. Thus we can apply our 3.2(2). We thank the anonymous referee for suggesting these points. 4. Actual Upper Bound The upper bound in 3.1 (2) is taken by the following example. Example 4.1. Let ∆ be a simplicial complex on the vertex set {1, 2, . . . , v}, whose maximal faces are all possible d − Then the Stanley-Reisner ring R = 1 simplices.  v k[∆] has dimension d and e(R) = . Note that Stanley-Reisner rings are always d F-pure. 4 CRAIG HUNEKE AND KEI-ICHI WATANABE Remark 4.2. (1) Are there other examples where we have equality in 3.1 (2) if v ≥ d + 2 ? It is shown in [GW] that in the case of d = 1, this is the only example if we assume (R, m) is complete local ring with algebraically closed residue field. (2) It is natural to ask if there are examples where we have equality in 3.1 (1) if v ≥ d + 2 and d ≥ 3. If d = 2, we have always e(R) = v − 1 (cf. [Li]). See remark (4) below. (3) It is not difficult to see that the examples which attain the maximal value in   v−1 Theorem 3.1 (1) must be generated by elements of degree d, and have d defining ideal with a linear resolution. In fact,let R be  a rational singularity or v−1 , where the dimension of F-rational having maximal multiplicity e(R) = d−1 R is d and v is the embedding dimension. Let A be a general Artinian reduction of R, that is to say, A is R modulo a general linear system of parameters (we assume infinite field here). Then as the proof of the main theorem shows, A ∼ = d k[x1 , ..., xc ]/(x1 , ..., xc ) , where c = v − d is the embedding codimension of R. It is well-known that (x1 , ..., xc )d has a linear resolution. Since R must be CohenMacaulay, its defining ideal will also have a linear resolution. Observe that the a-invariant of R must then be −1, since the dimension of R is d, and the socle degrees of the Artinian reduction A are all d − 1. The converse will often be true; if S is a polynomial ring, and R′ a graded Frational quotient ring (or rational singularity) whose defining ideal J has a linear resolution, then provided the common degree of the generators of J, say d, is at most the dimension of R′ , then one should be able to cut R′ down by general linear forms (at least over an algebraically closed field) to a ring R such that the dimension of R is exactly d and R is F-rational or has rational singularities on the punctured spectrum (see, for example, [SZ]). But then it is enough to check that the a-invariant is negative to prove R is F-rational [Wa, F]. This follows from the fact R has a linear resolution over the polynomial ring obtained from S by cutting with the same general linear forms.   The a-invariant of R will be −1. The multiplicity of R will be exactly v−1 , where v is the embedding dimension of R. d−1 (4) To see an explicit example as in (3), with even an isolated singularity, consider the ideal of maximal minors of a generic r by s matrix X over an algebraically closed field of characteristic 0. Assume that 2r ≤ s + 3. Let S be the ambient polynomial ring, and let R′ = S/I, where I is generated by the maximal minors of the generic matrix X. The singular locus of R′ is defined by the image of the r − 1 size minors of X, which has height in R′ exactly (r − (r − 1) + 1)(s − (r − 1) + 1) − (s − r + 1) = 2(s −r + 2) −(s −r + 1) = s −r + 3. Since r ≤ s −r + 3 by assumption, we can reduce R′ modulo rs − s + 2r − 1 general linear forms to reach an r-dimensional ring R with an isolated singularity (see [F2, Satz 5.2]), defined by the maximal minors of an r UPPER BOUND OF MULTIPLICITY OF F-RATIONAL RINGS AND F-PURE RINGS 5 by s matrix Y of linear forms such that the r by r minors have generic height. The a-invariant of R is −1, so by the results of [F]   and [Wa], R has a rational singularity. v−1 The multiplicity of R is exactly , where v is the embedding dimension d−1 and d is the dimension of R. It seems likely that the following question will have a positive answer: Question 4.3. Assume that (R, m) is a rational singularity or F-rational with dimension d and embedding dimension v with maximal possible multiplicity (as in Theorem 3.1). Then is the associated graded ring grm (R) Cohen-Macaulay having a defining ideal with linear resolution? 5. Case of Gorenstein Rings If R is Gorenstein, the upper bound is largely reduced by the duality. We prove: Theorem 5.1. Let (R, m) be a Gorenstein Noetherian local ring with dim R = d and embedding dimension v. (1) If singularity orF-rational with dim R = 2r + 1, then e(R) ≤  R is a rational   v−r−1 v−r−2 + . r r−1 (2) IfR is a rational  singularity or F-rational with dim R = 2r, then e(R) ≤ v−r−1 2 r − 1.   v−r−1 (3) If R is F-pure with dim R = 2r + 1, then e(R) ≤ 2 . r     v−r v−r−1 (4) If R is F-pure with dim R = 2r, then e(R) ≤ + . r r−1 Proof. We will prove the first statement. All the others follow in exactly the same manner. We may assume that the residue field is infinite. Let J be a minimal reduction of the maximal ideal of R, and let B = R/J, an Artinian Gorenstein ring. By Theorem 3.2, we know that md ⊂ J, so that if n denotes the maximal ideal of B, n2r+1 = 0. We estimate the length of the B (which is the multiplicity of R). First, observe that since B is Gorenstein, l(B/nt ) is the same as the length of the Matlis dual module, Hom(B/nt , B), which is equal to the length of (0 : nt ). Therefore, e(R) = l(B) = l(nr ) + l(B/nr ) ≤ l((0 : nr+1 )) + l(B/nr ) = l(B/nr+1 ) + l(B/nr ), where the inequality follows because nr ⊂ (0 : nr+1 ). Now B has embedding dimension v − (2r + 1). As before, B a homomorphic image of a polynomial ring in v − (2r + 1) variables. As above, the length of a polynomial  ring in this  many v−r−1 variables modulo the (r + 1)st power of its maximal ideal is , while r   v−r−2 modulo the rth power is , giving the statement of part (1).  r−1 6 CRAIG HUNEKE AND KEI-ICHI WATANABE Remark 5.2. Again, the upper bound in (3), (4) is taken by the Stanley-Reisner ring of “Cyclic Polytopes” (cf. [St]). Question 5.3. As was the case in the last section, it is reasonable to ask the following: suppose that (R, m) is Gorenstein with rational singularity (or F-rational) having the maximal possible multiplicity given the dimension and embedding dimension. Then is grm (R) Gorenstein with ”symmetric linear” resolution (i.e., pure resolution with degree sequence (n, n + 1, . . . , n + s, 2n + s)? Acknowledgment. We are grateful to Naoki Terai for suggesting cyclic polytopes as examples. We also thank Karl Schwede and Wenliang Zhang for valuable communications. We also thank AIM for hosting the workshop where this question was first discussed, and the main result was proved. References [BH] [F] [F2] [GW] [He] [HH] [Hu] [HS] [Li] [LT] [ST] [SZ] [St] [Wa] W. Bruns and J. Herzog, Cohen-Macauly rings, Cambridge University Press, 1997 (revised edition). H. Flenner, Divisorenklassengruppen quasihomogener Singularitäten, J. Reine Angew. Math. 328 (1981), 128???-160. H. Flenner, Die Sätze von Bertini für lokale Ringe, Math. Ann. 229 , (1977), 97–111. S. Goto, K. Watanabe, The Structure of One-Dimensional F-pure Rings, J. of Algebra, 47 (1977). S. Helmke, On Fujita’s Conjecture, Duke Math. 88 (1997), 201–216. M. Hochster and C. Huneke, Tight closure, invariant theory and the Briançon-Skoda theorem, J. Amer. Math. Soc. 3 (1990), 31–116. C. Huneke, Hilbert function and symbolic powers, Michigan Math. J. 34 (1987), 293–318. C. Huneke and I. Swanson, Integral closure of ideals, rings, and modules, London Math. Soc. Lecture Notes 336 (2006), Cambridge University Press, Cambridge, UK. J. Lipman, Rational singularities with applications to algebraic surfaces and unique factorization, Inst. Hautes Études Sci. Publ. Math. 36 (1969), 195–279. J. Lipman and B. Teissier, Pseudo-rational local rings and a theorem of Briançon-Skoda about integral closures of ideals, Michigan Math. J. 28 (1981), 97-116. K. Schwede and K. Tucker, On the number of compatibly Frobenius split subvarieties, prime F-ideals, and log canonical centers, Ann. Inst. Fourier (Grenoble) 60 (2010), 1515– 1531. K. Schwede and W. Zhang, Bertini theorems for F-singularities, preprint arXiv:1112.2161 R. Stanley, The Upper Bound Conjecture and Cohen-Macaulay Rings, Stud. Appl. Math. 54 (1975), 135-142. K. Watanabe, Rational singularities with k*-action. Commutative algebra (Trento, 1981), 339–351, Lecture Notes in Pure and Appl. Math., 84, Dekker, New York, (1983). Department of Mathematics, University of Virginia, Charlottesville, VA 22904 USA E-mail address: [email protected] Department of Mathematics, College of Humanities and Sciences, Nihon University, Setagaya-ku, Tokyo 156–0045, Japan E-mail address: [email protected]
0math.AC
On Stochastic Comparisons of Order Statistics from arXiv:1607.06564v1 [math.ST] 22 Jul 2016 Heterogeneous Exponential Samples Yaming Yu Department of Statistics University of California Irvine, CA 92697, USA [email protected] Abstract We show that the kth order statistic from a heterogeneous sample of n ≥ k exponential random variables is larger than that from a homogeneous exponential sample in the sense of star ordering, as conjectured by Xu and Balakrishnan (2012). As a consequence, we establish hazard rate ordering for order statistics between heterogeneous and homogeneous exponential samples, resolving an open problem of Pǎltǎnea (2008). Extensions to general spacings are also presented. Keywords: convolution; dispersive ordering; exponential distribution; majorization; stochastic order. 1 Introduction and main results There exists a large literature on stochastic comparisons between order statistics arising from possibly heterogeneous populations, see Balakrishnan and Zhao (2013) for a review. In reliability theory, order statistics play a prominent role as the lifetime of a k-out-of-n system can be represented by the n − k + 1th order statistic of the n component lifetimes. Because of the complexity of the distribution of order statistics arising from heterogeneous populations, stochastic comparisons with those from a homogeneous population are helpful, and can provide bounds on tail probabilities and hazard rates. Of particular interest is the following result of Bon and Pǎltǎnea (2006). Let X1 , . . . , Xn be independent exponential random variables with 1 rates λ1 , . . . , λn respectively. Let Y1 , . . . , Yn be another set of independent exponential random variables with a common rate γ. Then the kth order statistic of the heterogeneous sample is larger than that of the homogeneous sample in the usual stochastic order, that is, Yk:n ≤st Xk:n , if and only if γ≥ !1/k  −1 n sk (λ1 , . . . , λn ) , k (1) where sk denotes the kth elementary symmetric function. For the sample maximum, Khaledi and Kochar (2000) showed that (1) with k = n implies that Xn:n is larger than Yn:n according to both the hazard rate order and the dispersive order. In the context of failsafe systems, Pǎltǎnea (2008) showed that (1) with k = 2 is equivalent to Y2:n ≤hr X2:n . In the k = 2 case, Zhao et al. (2009) obtained related results for the likelihood ratio ordering. In this paper we aim to extend such results to general k. Specifically, we have Theorem 1. For each 1 ≤ k ≤ n, (1) is equivalent to Yk:n ≤hr Xk:n , and also equivalent to Yk:n ≤disp Xk:n . The statement concerning ≤hr in Theorem 1 confirms a conjecture of Pǎltǎnea (2008). Theorem 1 is established by considering the star order between Xk:n and Yk:n. For random variables X and Y supported on (0, ∞) with distribution functions F and G respectively, we say X is smaller than Y in the star order, denoted by X ≤∗ Y (or F ≤∗ G), if G−1 F (x)/x is increasing in x > 0, where G−1 denotes the right continuous inverse of G. Equivalently, X ≤∗ Y if and only if, for each c > 0, F (cx) crosses G(x) at most once, and from below, as x increases on (0, ∞). For definitions and properties of various stochastic orders including ≤∗ , see Shaked and Shanthikumar (2007). Kochar and Xu (2009) showed Yn:n ≤∗ Xn:n , a key result that allowed Xu and Balakrishnan (2012) to obtain stochastic comparison results for the ranges of heterogeneous exponential samples; see Genest et al. (2009) for related work. Our Theorem 2 confirms the conjecture of Xu and Balakrishnan (2012) (see also Balakrishnan and Zhao (2013), Open Problem 5). A special case of our Theorem 2 was obtained by Kochar and Xu (2011) for multiple-outlier models. Theorem 2. For each 1 ≤ k ≤ n, we have Yk:n ≤∗ Xk:n . The star ordering is a strong variability ordering. It implies the Lorenz ordering ≤L , which in turn implies the ordering of the coefficients of variation. Our Theorem 2 is a strengthening of the main result of Da et al. (2014) who showed Yk:n ≤L Xk:n . 2 Theorems 1 and 2 can be extended from order statistics to general spacings. Corollary 1. For 1 ≤ m < k ≤ n we have Yk:n − Ym:n ≤∗ Xk:n − Xm:n . Proposition 1. For 1 ≤ m < k ≤ n we have Yk:n − Ym:n ≤order Xk:n − Xm:n if and only if   m Y λrj n − m k−m X [r] (2) γ ≥ sk−m (λ) Pj−1 k−m Λ − i=1 λri r j=1 where r = (r1 , . . . , rm ), the outer sum is over all permutations of {1, . . . , n} using m at a time, P [r] λ = (λ1 , . . . , λn ), Λ = ni=1 λi , sk−m (λ) = sk−m (λ\{λr1 , . . . , λrm }), and ≤order is any of ≤st , ≤hr or ≤disp . In the special case of m = 1 and k = n, which corresponds to comparing the sample ranges, the condition (2) reduces to γ≥  Qn i=1 λi Λ/n 1/(n−1) , and we recover Theorem 4.1 of Xu and Balakrishnan (2012). In the case of ordinary spacings, that is, k = m + 1, Proposition 1 can also be derived using the log-concavity arguments of Yu (2009). As noted by Pǎltǎnea (2011), however, it is difficult to implement such an argument in general. In Section 2 we prove Theorem 2, from which Theorem 1, Corollary 1 and Proposition 1 are deduced. We refer to Pǎltǎnea (2008) for numerical illustrations and Da et al. (2014) for potential applications of these results. It would be interesting to see if results similar to Theorem 1 and Proposition 1 can be obtained for the likelihood ratio order, for which Theorem 2, based on the star order, is not helpful. 2 Derivation of main results We need the following closure property of the star order with respect to mixtures. Lemma 1 (Lemma 3.1 of Xu and Balakrishnan (2012)). Let F be a distribution function with density f supported on (0, ∞) such that f (ex ) is log concave in x ∈ R. Let G1 , . . . , Gn be distribution functions with densities g1 , . . . , gn supported on (0, ∞) such that F ≤∗ Gi for each P P i = 1, . . . , n. Then F ≤∗ ni=1 pi Gi for pi > 0 such that ni=1 pi = 1. 3 We also need the following representation of order statistics from heterogeneous exponential samples. Lemma 2 (Pǎltǎnea (2011), Theorem 4.1). Let S = {X1 , . . . , Xn } be a set of n > 1 independent exponential random variables with rates λ1 , . . . , λn respectively. Denote S [i] = S\{Xi } and let [i] [i] Xj:(n−1) be the jth order statistic from S [i] with distribution function Fj:(n−1) for j ≤ n − 1. Then for k ≤ n − 1 the (k + 1)th order statistic X(k+1):n from S is the sum of two independent P random variables: X1:n , which has an exponential distribution with rate Λ = nj=1 λj , and a P [i] mixture of order statistics with distribution function Λ−1 ni=1 λi Fk:(n−1) . Finally, we need some stochastic comparison results concerning convolutions of gamma vari- ables. For independent random variables Z1 , . . . , Zn ∼ gamma(α) let Fθ denote the distribution P function of the weighted sum ni=1 θi Zi where θ = (θ1 , . . . , θn ) is a vector of positive weights. We use ≺w to denote weak sub-majorization (Marshall et al. (2009)). The following Lemma is a consequence of Theorem 1 of Yu (2011). Lemma 3. For α > 0, if log η ≺w log θ then Fη ≤st Fθ . Lemma 4 asserts a unique crossing between the distribution functions of two weighted sums of iid gamma variables when the weights form a special configuration. Lemma 4 is an important step in Yu’s (2016) investigation of the unique crossing conjecture of Diaconis and Perlman (1990); it is also a key tool in deriving our main results (we only need the α = 1 case). Lemma 4 (Theorem 1 of Yu (2016)). Suppose α ≥ 1. Suppose 0 < θ1 ≤ · · · ≤ θn and η1 ≤ · · · ≤ ηn and (a) there exists 2 ≤ k ≤ n such that θi < ηi for i < k and θi > ηi for i ≥ k; Q Q (b) ni=1 ηi > ni=1 θi . Then there exists x0 ∈ (0, ∞) such that Fη (x) < Fθ (x) for x ∈ (0, x0 ) and the inequality is reversed for x > x0 . Proof of Theorem 2. Let us use induction. The k = 1 case is trivial. Suppose the claim holds for a certain k ≥ 1 and all n ≥ k. We shall prove that it holds for k + 1 and all n ≥ k + 1. Assume (τ ) λi , i = 1, . . . , n, are not all equal, and let Fk:n denote the distribution function of the kth order statistic from a sample of n iid exponential variables with rate τ . In the notation of Lemma 2, [i] (τ ) the induction hypothesis yields Fk:(n−1) ≤∗ Fk:(n−1) for τ > 0, n ≥ k + 1, and i = 1, . . . , n. As (τ ) noted by Xu and Balakrishnan (2012), Fk:(n−1) has a density f such that f (ex ) is log-concave. 4 By Lemma 1, we have (τ ) Fk:(n−1) ≤∗ n X λi i=1 Λ [i] Fk:(n−1) . (3) As noted by Da et al. (2014), when x ↓ 0 we have [i] Fk:(n−1) (x) = [i] sk (λ)xk k + o(x ), (τ ) Fk:(n−1) =   n−1 k k τ x + o(xk ), k [i] where λ = (λ1 , . . . , λn ) and sk (λ) = sk (λ\{λi }). Thus, if  1/k n equivalently τ ≥ τ ∗ with τ ∗ = (nsk+1 (λ)/Λ/ k+1 ) , then (τ ) Fk:(n−1) ≤st n X λi i=1 Λ n−1 k k τ ≥ [i] i=1 λi sk (λ)/Λ, Pn [i] Fk:(n−1) . Analogous considerations as x → ∞ (Pǎltǎnea, 2011) reveal that if τ ≤ τ∗ ≡ or (4) Pn−k i=1 λ(i) /(n − k), where λ(1) , . . . , λ(n) are λ arranged in increasing order, then (4) holds with the direction of ≤st reversed. For τ ∈ (τ∗ , τ ∗ ), star ordering implies that there exists x0 > 0 such that (τ ) Fk:(n−1) (x) ≤ n X λi i=1 Λ [i] Fk:(n−1) (x), x ∈ (0, x0 ), (5) and the inequality is reversed if x ∈ (x0 , ∞). One can show strict inequality, that is, the crossing point is unique. Indeed, if there exists another x̃ ∈ (0, x0 ), for example, such that equality holds in (5) at x = x̃, then a slight increase in τ would produce at least two crossings, near x0 and x̃, respectively (equality cannot hold for all x ∈ [x̃, x0 ] unless the two distributions are identical, because these distribution functions can be written as linear combinations of exponential functions and are therefore analytic). In view of Lemma 2, we can convolve both sides of (3) with an exponential with rate Λ and (τ ) obtain that expo(Λ) ∗ Fk:(n−1) crosses F(k+1):n (the distribution function of X(k+1):n ) exactly once, and from below, for τ ∈ (τ∗ , τ ∗ ). That there is at most one crossing follows from variation diminishing properties of TP2 kernels (Karlin 1968). Upon close inspection there is exactly one crossing at a unique point. In particular, because Λ > (n − k)τ > (n − k)τ∗ , convolving with P (τ ) [i] expo(Λ) cannot reverse the sign of Fk:(n−1) (x) − Λ−1 ni=1 λi Fk:(n−1) (x) as x → ∞. We then recognize the crossing point, denoted by x∗ , as a decreasing, continuous function of τ , because (τ ) Fk:(n−1) stochastically decreases in τ . Furthermore, the above analysis at the end points τ∗ and τ ∗ shows that x∗ (τ ) ↑ ∞ as τ ↓ τ∗ and x∗ (τ ) ↓ 0 as τ ↑ τ ∗ . 5 The distribution of Y(k+1):n is the convolution (γ) F(k+1):n = expo(nγ) ∗ expo((n − 1)γ) ∗ · · · ∗ expo((n − k)γ). (γ) Suppose F(k+1):n crosses F(k+1):n at some x∗ > 0. Then we can choose τ ∈ (τ∗ , τ ∗ ) such that (τ ) x∗ (τ ) = x∗ , that is, expo(Λ) ∗ Fk:(n−1) crosses F(k+1):n at exactly x∗ , from below. If γ ≥ Λ/n then Maclaurin’s inequality yields γ ≥ τ ∗ > τ , which implies that (τ ) (γ) F(k+1):n ≤st expo(Λ) ∗ Fk:(n−1) , (6) contradicting the existence of x∗ . If γ ≤ τ then the inequality (6) is reversed, and there is again Q Q no crossing. Thus we must have γ ∈ (τ, Λ/n). If ki=0 ((n − i)γ) ≥ Λ ki=1 ((n − i)τ ) then one can show (the log applies element-wise) − log(nγ, (n − 1)γ, . . . , (n − k)γ) ≺w − log(Λ, (n − 1)τ, . . . , (n − k)τ ), which again implies (6) by Lemma 3. For the remaining case, (γ) Qk i=0 ((n−i)γ) the conditions of Lemma 4 are satisfied. It follows that F(k+1):n crosses <Λ Qk i=1 ((n−i)τ ), (τ ) expo(Λ)∗Fk:(n−1) exactly (γ) once, from below, at the same point x∗ . We deduce that F(k+1):n crosses F(k+1):n exactly once, from below, at x∗ . Since γ > 0 is arbitrary, we have Y(k+1):n ≤∗ X(k+1):n . Proof of Theorem 1. Theorem 1 can be deduced from Theorem 2 as discussed by Xu and Balakrishnan (2012). Specifically, given Yk:n ≤∗ Xk:n , we have the equivalence Yk:n ≤st Xk:n ⇐⇒ Yk:n ≤disp Xk:n . Since Yk:n has increasing failure rate, dispersive ordering implies hazard rate ordering. Proof of Corollary 1. Extending Lemma 2 we can write the distribution function of Xk:n − Xm:n as m XY r j=1 Λ− λr j Pj−1 i=1 [r] λr i F(k−m):(n−m) , (7) [r] where the notation is the same as in the statement of Proposition 1, and F(k−m):(n−m) denotes the distribution function of the (k − m)th order statistics of {X1 , . . . , Xn }\{Xr1 , . . . , Xrm }. The (γ) distribution of Yk:n − Ym:n is simply F(k−m):(n−m) . The claim therefore follows from Theorem 2 and Lemma 1. 6 Proof of Proposition 1. Given the star ordering, we can establish the characterization for ≤st by examining the distribution function (7) near x = 0 (we did this for m = 1 in the proof of Theorem 2). Characterizations for ≤hr and ≤disp follow as in the proof of Theorem 1. References [1] N. Balakrishnan, P. Zhao, Ordering properties of order statistics from heterogeneous populations: A review with an emphasis on some recent developments, Probability in the Engineering and Informational Sciences 27 (2013) 403–443. [2] J.-L. Bon, E. Pǎltǎnea, Comparison of order statistics in a random sequence to the same statistics with iid variables. ESAIM: Probab. and Statist. 10 (2006) 1–10. [3] G. Da, M. Xu, N. Balakrishnan, On the Lorenz ordering of order statistics from exponential populations and some applications, Journal of Multivariate Analysis 127 (2014) 88–97. [4] P. Diaconis, M. D. Perlman, Bounds for tail probabilities of weighted sums of independent gamma random variables, IMS Lecture Notes–Monograph Series 16 (1990) 147–166. [5] C. Genest, S.C. Kochar, M. Xu, On the range of heterogeneous samples, Journal of Multivariate Analysis 100 (2009) 1587–1592. [6] S. Karlin, Total Positivity. Stanford: Stanford Univ. Press (1968). [7] B.-E. Khaledi, S. Kochar, Some new results on stochastic comparisons on parallel systems. J. Appl. Probab. 37 (2000) 1123–1128. [8] S.C. Kochar, M. Xu, Comparisons of parallel systems according to the convex transform order, Journal of Applied Probability 46 (2009) 342–352. [9] S.C. Kochar, M. Xu, On the skewness of order statistics in the multiple-outlier models, Journal of Applied Probability 48 (2011) 271–284. [10] Marshall, A.W., Olkin, I. and Arnold, B., Inequalities: Theory of Majorization and Its Applications, 2nd Ed. (2009) Springer, New York. 7 [11] E. Pǎltǎnea, On the comparison in hazard rate ordering of fail-safe systems, Journal of Statistical Planning and Inference 138 (2008) 1993–1997. [12] E. Pǎltǎnea, Bounds for mixtures of order statistics from exponentials and applications, Journal of Multivariate Analysis 102 (2011) 896–907. [13] M. Shaked, J. G. Shanthikumar, Stochastic orders. Springer, New York (2007). [14] M. Xu, N. Balakrishnan, On the sample ranges from heterogeneous exponential variables, Journal of Multivariate Analysis 109 (2012) 1–9. [15] Y. Yu, Stochastic ordering of exponential family distributions and their mixtures, J. Appl. Probab. 46 (2009) 244–254. [16] Y. Yu, Some stochastic inequalities for weighted sums, Bernoulli 17 (2011) 1044–1053. [17] Y. Yu, On the unique crossing conjecture of Diaconis and Perlman on convolutions of gamma random variables, Preprint (2016) arXiv:1607.02689 [18] P. Zhao, X. Li, N. Balakrishnan, Likelihood ratio order of the second order statistic from independent heterogeneous exponential random variables, J Multivar Anal 100 (2009) 952– 962. 8
10math.ST
SBML FOR OPTIMIZING DECISION SUPPORT'S TOOLS Dalila Hamami1 and Baghdad Atmani2 Computer science laboratory of Oran (LIO) 1 Department of Computer Science, Mostaganem University, Algeria [email protected] 2 Oran university, Algeria [email protected] ABSTRACT Many theoretical works and tools on epidemiological field reflect the emphasis on decision-making tools by both public health and the scientific community, which continues to increase. Indeed, in the epidemiological field, modeling tools are proving a very important way in helping to make decision. However, the variety, the large volume of data and the nature of epidemics lead us to seek solutions to alleviate the heavy burden imposed on both experts and developers. In this paper, we present a new approach: the passage of an epidemic model realized in Bio-PEPA to a narrative language using the basics of SBML language. Our goal is to allow on one hand, epidemiologists to verify and validate the model, and the other hand, developers to optimize the model in order to achieve a better model of decision making. We also present some preliminary results and some suggestions to improve the simulated model. KEYWORDS Epidemiology, simulation, modelling, Bio-PEPA, narrative language, SBML. 1. INTRODUCTION In recent years, biotechnology improved the knowledge of epidemiological pathogens, and developed effective ways to fight against these epidemics. Currently, several outbreaks are in vogue, and developing factors helped build huge data banks [1]. Therefore, the amounts of raw data are too large to be analyzed manually by both experts and computer scientists who need to understand the epidemiological domain. Due to the variety of biological data and the nature of epidemics [2],the adopted methods was insufficient and therefore inefficient, so a new approach is used: the development of an interface between expert and computer scientist who is no longer required to start from the "whole" to achieve the "perfect" model. This interface converts the model created by the developer, to understandable language by the expert, so that he can check the validity of the model by: settings, rules, constraints, etc, and finally allow the developer to review and optimize the model, so that, any implementation of prevention and control are carried out for appropriate treatment. The rest of the paper is organized as follows. Section 2 presents a brief review of epidemiological modeling and why do we need to translate the simulated model to the narrative languages?. A description of our model in SBML (Bio-PEPA), and how to perform its translation into narrative language, in Section 3. Section 4 describes the details of information on testing and evaluation. Section 5 summarizes the work done and also some suggestions to improve the model. 2. FROM NARRATIVE LANGUAGE TO A MODEL Develop and use a good epidemiological model, remains to this day a very attractive idea, and to achieve it many researchers are struggling between having to choose the best tools and methods or to conduct a thorough training in the field in question and often they find themselves stagger between them. However, others, give little importance to neither one nor the other, rather they prefer to save their energy and adopt a technique completely original that is to transform the context expressed by an expert directly in a simulated model, as it was presented by Georgoulas and Guerriero in 2012 [3], for translating the narrative language in a "BioPEPA" formel model. In 2007 and 2009, Guerriero et all [4, 5] studied the translation of narrative language in a "model Beta-binders" and " a bio-inspired process calculus", the authors have assumed that it would be better to simplify the communication between experts and developers by providing a simple interface that would allow both the expert to insert their information and the developer to manipulate only the code without worrying too much about understanding everything. This approach has been baptized the passage from narrative language to a model. Although this work is regarded as a large opening in the field of modeling, however, the question arises, what happens to existing models?. The following work, were largely inspired from Guerriero's work [5], where we suggest to do the reverse of him, kept the existing model and improve it, which means, translating the BioPEPA model to a narrative language. 3. FROM MODEL TO A NARRATIVE LANGUAGE In order to respond to the issues raised in the previous section and based on the principle defined above, we propose an approach whose aim is to preserve existing models and also to optimize it by allowing an incremental model implementation. An extensive literature search, which focused on methods of modeling with both, analytical and decision support tools, as well as the translation of the model in other specific formats, for approaching the narrative language, we were able to highlight Bio-PEPA [2, 6], which is formal language based on the process algebras recommended for biochemical systems and which was perfectly suited to epidemiological field. Beyond this definition, Bio-PEPA is equipped with an extension that allows translating any model in Bio-PEPA in XML format better known as SBML (Systems Biology Markup Language). 3.1. Bio-PEPA (Biological Performance Evaluation of Process Algebras) Bio-PEPA is a tool, method and language based on process algebra. These are described by mathematical formalisms used in the analysis of concurrent systems [2, 7, 8], which consist of a set of processes running in parallel, can be independent or share common tasks. As it was defined in [6], the Bio-PEPA language is 7-tuple (V, N, K, FR, Comp, P, Event) Where: • V is a set of locations, • N is a set of auxiliary information, • K is a set of parameters, • E is a set of functional rates • Comp is the set of species • P is the component model. • Event is the set of events. 3.1.1. Characteristics of Bio-PEPA The main features which are provided in Bio-PEPA are: • provides a formal abstraction of biochemical systems and further epidemiological systems. • Allows expressing any kind of interaction law expressed using functional rates. • Allows expressing the evolution of species and their interaction. • Defined syntax and structural semantics based on a formal representation. • Provides the ability to perform different types of analysis from the model (continuous time Markov chain, the stochastic simulation algorithms, differential equations). 3.1.2. Bio-PEPA Syntax As defined by [9, 6], Bio-PEPA syntax is described by: S:= (α,k) op S:=S ; S:=S+S; S:=C where op = ↓‫ ⊙׀ ↑׀⊕׀⊖׀‬And S::= S S ‫ ׀‬S(x) Where, S: describe the species (different types of individuals); P: the model describing the system and interaction between species. The term (α, k) op S, express that the action α is described by k rate and performed by the species S, “op” define the role of S. Op={ ↓: reactant, ↑: product, ⊕ : activator, ⊖ : inhibitor, ⊙ : generic modifier}. 3.2. Systems Biology Markup Language (SBML) SBML (The Systems Biology Markup Language) is a markup language based on XML (the eXtensible Markup Language). In essence, an XML document is divided into hierarchically structured elements from a root element. Syntactically, the elements of an XML document are marked in the document itself by opening and closing pairs of tags, each element consists of a name that specifies its type, attributes, and content (elements or text). SBML is a set of constructions’ elements specific to the systems biology, defined in an XML schema. It has been adapted to the epidemiological models. The SBML language is divided into hierarchically structured elements which are a syntax tree of language as an XML schema. As it was defined in section 3.1, an epidemiological model is defined in Bio-PEPA by a set of compartments, species and reactions described by rates and parameters. SBML do the same by using tags and attributes [10, 14]. Figure 1 shows the general organization of SBML's TAG which are described in the following [11]: Figure 1. General organization of SBML language.  Model : An SBML model definition consists of lists of SBML components located inside the tags : <model id="My_Model" > ….</model>.  listOfFunctionDefinitions: The mathematical functions that can be used in the other part of the model are defined in this section.  listOfUnitDefinitions : these units are used to explicitly specify: constants, initial conditions, the symbols in the formulas and the results of formulas.  listOfCompartments : Is an enclosed space in which the species (species) are located.  listOfSpecies : To specify the different entities in the model regardless of their nature, where one type of species "listOfSpeciesTypes" can be specified.  listOfReactions : Any process whereby the transfer of a species from one compartment to another. We specify that Representation and semantics of mathematical expressions are defined in the SBML using MathML. 3.3. Relation of Bio-PEPA to SBML T The principal notions which rely Bio-PEPA to SBML are summarized in table 1, (this table was directly extracted from [2]). Table 1: Summary of mapping from SBML to Bio-PEPA (taken from [2]) SBML Element Corresponding Bio-PEPA component List of Compartments Bio-PEPA compartments List of Species Species definitions (Name, initial concentration and compartment). Step size and level default to 1. Also used in species sequential component definitions. List of Parameters Bio-PEPA parameter list. Local parameters renamed to include re- action name. List of Reactions Species component definitions and model component definition. Kinetic-Laws Bio-PEPA Functional rates 4. IMPLEMENTATION For implementing our approach, we resumed work that we had already started in [6] which was to reproduce the spread and vaccination protocol of chickenpox in Bio-PEPA, as shown in Figure 2. Figure 2. Model structure (taken from [12]). The overall scheme of our approach is defined by three main steps: • Formulation of the epidemic model in Bio-PEPA: definition of species and reactions. • Exporting SBML file. • Representation in narrative language: analysis of SBML file, displaying a detailed report, validation by the expert. 4.1. Description of model structure Our approach, as it was structured, allows us to share our work in two main stages, the first is to develop a model with Bio-PEPA (Formulation from epidemic model in Bio-PEPA), a work that has already been done [6] and demonstrated the importance of using such a tool. The second part (Exporting SBML file from Bio-PEPA, Representation of SBML text in narrative language) is developing a module that would translate the Bio-PEPA code in a language understood by the expert, who may easily check whether the contents of the model is adequate to the example and thus validate it. 4.1.1. Chickenpox model in Bio-PEPA To better understand the modeling process, we have taken and explained in this section the most important part of the code Bio-PEPA model of chickenpox [12]. (For clarity of the document, we have listed a few parts of model). 1. Location: To explain the seven age groups of the model, we have represented it as compartments. location Age1 in world : size = sizeAge, type = compartment; ……… location Age7 in world : size = sizeAge, type = compartment; 2. Fonctionnel rate: Describes the interaction law between compartments. Exposition =  . S . I; describes the contact between susceptible (S) and infected (I) with  rate. ……. LostVaccin = W . VP; defines the rate of immune lost (W) of those protected by vaccination (VP). 3. The species : are the system entities expressed by operations describing their evolution. S = [(Exposition,1)↓ S + (Vaccination_1,1) ↓ S + (Vaccination_2,1)↓S; explains what happens if executes Exposition function, Vaccination_1 or Vaccination_2. Some lines of Bio-PEPA code are shown in Figure 3. We could note that even if the BioPEPA language is simple and easy for developer, however, remains an ambiguous part face which is set epidemiologist who cannot verify the validity of information represented by the developer, as the epidemiologist cannot understand the Bio-PEPA code. We can extract from this figure, two important points, firstly the representation of chickenpox model in Bio-PEPA (right of the figure), and another hand the results of a simulation graph summarizing the status of various species (left of the figure). Figure 3. Global view of Bio-PEPA model. 4.1.2. Exporting SBML file from Bio-PEPA Bio-PEPA provides the ability to export the model as an SBML file. As shown in Figure 4: The resulting text describes all the tags and attributes as they were presented in Section 3.2, corresponding to our model of chickenpox. It should be remembered that to study an epidemic, we must take into consideration: the environment "space", time, and various other functions. SBML can express perfectly each section describing the elements defined in Bio-PEPA. 4.1.3. The Chickenpox model in narrative language To work with SBML, we need to perform a literature research, about tools analyzing and interpreting this type of descriptor, the latter revealed the JDOM [13] tool. The main features of DOM are:  The DOM model (unlike on this point to another famous API: SAX) is a specification that has its origins in the w3C consortium.  The DOM model is not only a multi-platform specification, but also multilanguages: as Java, JavaScript, etc.  DOM presents documents as a hierarchy of objects, from which, more specialized interfaces are themselves implemented: Document, Element, Attribute, Text, etc. With this model, we can treat all DOM components either by their generic type, “Node”, or by their specific type “element, attribute”, many methods of navigation allow navigation in the tree without having to worry about the specific type of component Treated. <?xml version="1.0" encoding="UTF-8"?> <sbml version="3" level="2" xmlns="http://www.sbml.org/sbml/level2/version3"> <model id= "vaccination_biopepa"> <listOfCompartmentTypes> <compartmentType id="Compartment"/> <compartmentTypeid="Membrane"/> </listOfCompartmentTypes> <listOfCompartments> <compartmentid="Age7" outside="world" size="100000.0" compartmentType="Compartment"/> …….. <compartment id="Age5" outside="world" size="100000.0" compartmentType="Compartment"/> </listOfCompartments> <listOfSpecies> <species id="Exp_Age1" hasOnlySubstanceUnits="true" substanceUnits="item" compartment="Age1" name="Exp"/> …… <species id="VS_Age7" hasOnlySubstanceUnits="true" substanceUnits="item" compartment="Age7" name="VS"/> </listOfSpecies> <listOfParameters> <parameter id="landa1" value="0.17241"/> Figure 4. Chickenpox model in SBML. …….. <parameter id="W" value="0.021"/> </listOfParameters> ……. Figure 5. (a) From SBML code to narrative language. Figure 5 (b) From SBML code to narrative language. Figures 5 (a, b) shows the interface of our application based on JDOM model and thus gathering the steps defined above. White space viewed in the figure corresponds to the loading of SBML file, when the black area corresponds to the translation and analysis of SBML in narrative language understandable by the expert, the expert in this way has no difficulty in verifying the validity of the model. The user-friendly interface allows him to navigate the various components of the model (species, function of interaction, locations ... etc.) To validate our application, we made a change in the initial code (Bio-PEPA) where we intentionally caused an error in our model, the generation of the latter, as shown clearly in Figure 6 that the expert could detect the species and reactions which are missing, and therefore it can easily report them to us. (The red frame line specifies the error caused by the number of species missed). Figure 6. Detection error after translatation the model into narrative language. 5. CONCLUSIONS Modeling and simulation are very useful to understand and predict the dynamics of various biological phenomena. The Bio-PEPA approach seems to be an interesting and powerful approach to address such problems. Through its various features it allows an easy development of the computer model and a transparent way for biologists between the real system and the built which helps a faithful representation of the phenomenon studied. Nevertheless, in case of occurrence of a new event, which has been badly treated by the developer and therefore omitted, correction model is considered a tedious task for both. This is the reason for which, we have introduced a new module (interface), where the expert can easily detect this omission and thus back to the developer, who may discern error and quickly position it, on the Bio-PEPA model. As perspective to strengthen this work, why not attached it to the one that was mentioned in Section 2, and thus drift toward a cyclical pattern, which would not require even the presence of developer, however, after reflection, what will become the expert, front of its multitude of information? After a brief literature review the idea of integrating it with the world of data mining would be a much better idea to fruition. REFERENCES [1] Mansoul, A., & Atmani, B. (2009). Fouille de données biologiques : vers une représentation booléenne des règles d’association, In Proceedings of CIIA. [2] Ciocchetta, F., & Ellavarason, K. (2008). An Automatic Mapping from the Systems Biology Markup Language to the Bio-PEPA Process Algebra. [3] Georgoulas, A., & Guerriero, M. L. (2012). A software interface between the Narrative Language and Bio-PEPA, 1–9. [4] Guerriero, M. L., A. Dudka, N. Underhill-Day, J. K. Heath and C. Priami (2009), Narrative-based computational modelling of the Gp130/JAK/STAT signalling pathway, BMC Systems Biology 3, p. 40. [5] Guerriero, M. L., J. K. Heath and C. Priami, (2007), An Automated Translation from a Narrative Language for Biological Modelling into Process Algebra, in: Proceedings of Computational Methods in Systems Biology (CMSB’07), LNCS 4695, pp. 136–151. [6] Hamami.D, Atmani.B. (2012). Modeling the effect of vaccination on varicella using Bio-PEPA. Proceeding Iasted , 783-077, doi:978-0-88986-926-4 [7] Milner.R. (1999). Communicating and Mobile Systems: the π-calculus. Cambridge University Press. [8] Baeten J.C.M.(2005). A Brief History of Process Algebras. Theoretical Computer Science, Volume 335, Issue 2-3, Pages 131-146. [9] Ciocchetta, F. and M. Guerriero (2009), Modelling Biological Compartments in Bio-PEPA, ENTCS 227, pp. 77–95. [10] Hucka.M, Finney.A, S. Hoops, S. Keating and N. L. Novere (2007). Systems Biology Markup Language (SBML) Level 2: Structures and Facilities for Model Definitions. Systems Biology Markup Language, Release 2. [11] Beurton-aimar.M (2007). Langage de modélisation des réseaux biochimiques, 1–16, ECRINBiologie syst, Chap. 07, Page 7·. [12] Bonmarin.I, Santa-Olalla.P, Lévy-Bruhl.D(2008), « Modélisation de l’impact de la vaccination sur l’épidémiologie de la varicelle et du zona », Revue d’Epidémiologie et de Santé Publique 56 323– 331. [13] Hunter, J. (2002). JDOM Makes XML Easy.Sun’s 2002 Worlwide Java Developer Conference. [14] Hucka.M, Finney.A, Bornstein.B.J, Keating.S.M, B.E. Shapiro, J. Matthews, B.L. Kovitz, M.J. Schilstra, A. Funahashi, J.C. Doyle and H. Kitano. Evolving a Lingua Franca and Associated Software Infrastructure for Computational Systems Biology (2004): The Systems Biology Markup Language (SBML) Project, Systems Biology, Volume 1, Pages 41-53.
5cs.CE
ON THE STABILITY OF NETWORK INDICES DEFINED BY MEANS OF MATRIX FUNCTIONS∗ arXiv:1709.05132v1 [math.NA] 15 Sep 2017 STEFANO POZZA† AND FRANCESCO TUDISCO‡ Abstract. Identifying important components in a network is one of the major goals of network analysis. Popular and effective measures of importance of a node or a set of nodes are defined in terms of suitable entries of functions of matrices f (A). These kinds of measures are particularly relevant as they are able to capture the global structure of connections involving a node. However, computing the entries of f (A) requires a significant computational effort. In this work we address the problem of estimating the changes in the entries of f (A) with respect to changes in the edge structure. Intuition e is not significantly distorted, relevant suggests that, if the topology of connections in the new graph G e We propose several bounds giving mathematical components in G maintain their leading role in G. reasoning to such intuition and showing, in particular, that the magnitude of the variation of the entry f (A)k` decays exponentially with the shortest-path distance in G that separates either k or ` from the set of nodes touched by the edges that are perturbed. Moreover, we propose a simple method that exploits the computation of f (A) to simultaneously compute the all-pairs shortest-path distances of G, with essentially no additional cost. As the nodes whose edge connection tends to change more often or tends to be more often affected by noise have marginal role in the graph and are distant from the most central nodes, the proposed bounds are particularly relevant. Key words. Centrality indices, stability, decay bounds, geodesic distance, Faber polynomials. AMS subject classifications. primary: 65F60, 05C50; secondary: 15B48, 15A16; 1. Introduction. Networks and datasets of large dimension arise naturally in a number of diversified applications, ranging from biology and chemistry to computer science, physics and engineering, [10, 1, 27, 37, 15, 40, 13] e.g. Being able to recognize important components within a vast amount of data is one of the main goals of the analysis of networks. As a network can be uniquely identified with an adjacency matrix, many efficient mathematical and numerical strategies for revealing relevant components employ tools from numerical linear algebra and matrix analysis. Important examples include locations of clusters of data points [17, 36, 39, 29], detection of communities [20, 21, 38] and ranking of nodes and edges [18, 7, 32]. To address the latter range of problems, a popular approach is to employ the concepts known as centrality and communicability of the nodes of a network. These two attributes describe a certain measure of importance of nodes and edges in a network. Many commonly used and successful models for communicability and centrality measures are based on matrix eigenvectors. These models quantify the importance of a node in terms of the importances of its neighbors, thus relying on the local behavior around the node. In this work we focus on another common class of models for centrality and communicability measures based, instead, on matrix functions [23, 11]. This latter class of models is particularly informative and effective as, unlike the eigenvector-based models previously mentioned, the use of matrix functions allows to capture the global structure of connections involving a node. However the matrix function approach requires a significantly larger computational cost. This is particularly prohibitive for example when the network changes and the important † Department of Numerical Mathematics, Faculty of Mathematics and Physics, Charles University in Prague ([email protected]). ‡ Department of Mathematics and Statistics, University of Strathclyde, UK ([email protected]). ∗ The work of S.P. has been partially supported by INdAM GNCS. The work of F.T. has been partially supported by the MSCA grant MAGNET 1 components have to be updated or when the network structure is affected by noise and the importance of the components can be biased. In principle each change in the network requires a complete re-computation of the matrix function to obtain the updated measure. However, in many applications one needs to know only “who are” the first few most important nodes in the graph and how stable they are with respect to edge perturbations. Moreover, the nodes whose edge connection tends to change more often or is more likely to be affected by noise are those having a marginal role in the graph [32]. Intuition suggests that, if the topology of connections in the new “perturbed” e is not significantly distorted, relevant components in the original graph G graph G e In this paper we provide mathematical support for maintain their leading role in G. this intuition by analyzing the stability of network measures based on matrix functions with respect to edge changes. By exploiting the theory of Faber polynomials and the recent literature on functions of banded matrices [44, 42, 9, 8, 6], we propose a number of bounds showing that the magnitude of the variation of the centrality of node k or the communicability between nodes k and ` decays exponentially with the distance in the graph that separates either k or ` from the set of nodes touched by the edges that are perturbed. This implies, for example, that if changes in the edge structure occur in a relatively small and peripheral network area – in the sense that the perturbed edges involve only nodes being far from the most relevant ones – then the set of leading components remains unchanged. We organize the discussion as follows: The next section reviews some central concepts and properties we shall use alongside the present work, in particular the notions of f -centrality and f -communicability. Section 3 is devoted to give details about our motivating ideas. Then, in Section 4, we review the relevant theory about Faber polynomials. In Section 5 we state and prove our main results where we provide a number of bounds on the absolute variation of the centrality and the communicability measures of nodes k and ` based on the matrix function f (A) when some edges are modified in G. The bounds are given in terms of the distances in G that separate k and ` from the set of perturbed edges and for two important network matrices: the adjacency matrix and the normalized (random walk) adjacency matrix. We give particular attention to the case of the exponential and the resolvent function, as they often arise in the related literature on complex networks. We also provide a simple algorithm that exploits the computation of the entries of f (A) to simultaneously address the all-pairs shortest-path distances of the graph, at essentially no additional cost. Finally, in Section 6, we provide several numerical experiments where the behavior of the proposed computational strategy as well as the one of the proposed bounds is tested on some example networks, both synthetically generated and borrowed from real-world applications. 2. Network properties and matrix functions. One of the major goals of data analysis is to identify important components in a network G = (V, E) by exploiting the topological structure of connections between nodes. In order to address this matter from the mathematical point of view one needs a quantitative definition of the importance of a node k or a pair of nodes (k, `), thus leading to concepts such as the nodes centrality and the nodes communicability. Despite these quantities have a long history, dating back to the early 1950s, recent years have seen the introduction of many new centrality scores based on the entries of certain function of matrices [7, 18, 19, 26]. The idea behind such metrics is to measure the relevance of a component by quantifying the number of subgraphs of G that involve a certain node or 2 group of nodes. In order to better perceive these concepts, we first introduce some preliminary graph notation. Let G = (V, E, ω) be a (weighted) graph where V = {1, . . . , N } is the finite set of nodes, E ⊆ V × V the set of edges and ω : E → R+ a positive weight function. Given two nodes k, ` ∈ V , an ordered sequence of edges W = W(k, `) = {e1 , . . . , er } ⊆ E is a walk in G from k to `, if k is the starting point of e1 , ` is the endpoint of er and, for any i = 1, . . . , r − 1, the endpoint of ei is the starting point of ei+1 . The length of a walk is the number of edges forming the sequence (repetitions are allowed) and is denoted by |W|. The length of the shortest walk from k to ` is called the (geodesic or shortest-path) distance in G from k to ` and is denoted hereafter by dG (k, `). If there is no walk in G connecting the pair (k, `), we set dG (k, `) = +∞. The diameter of G is the longest shortest-path distance between any two nodes. A graph is said to be strongly connected if dG (k, `) is a finite number, for any two possibly coinciding nodes k and `. Note that, in a strongly connected undirected graph without self-loops, dG (k, k) = 2 for any k ∈ V . Given a set S ⊆ V and a node k∈ / S, we let dG (k, S) = min dG (k, s) s∈S and dG (S, k) = min dG (s, k) . s∈S The weight of a walk W is defined by ω(W) = Y ω(e) . e∈W This quantity has ×N A = (aij ) ∈ RN + ( ω(e) aij = 0 a natural matrix representation. Consider the adjacency matrix of G = (V, E, ω), defined by if i, j are starting and ending points of e ∈ E, respectively . otherwise Thus, for any walk W = W(k, `), there exists a sequence of nodes u1 , . . . , un , such that (2.1) ω(W) = aku1 au1 u2 · · · aun−1 un aun ` . The preceding formula shows that the powers of the adjacency matrix A can be used to count the “weighted number” of walks of different lengths in G. More precisely, if n is a positive integer and Ωn (k, `) = {W(k, `) : |W(k, `)| = n} is the set of walks from k to ` of length exactly n, then one can easily observe that (An )k` = P W∈Ωn (k,`) ω(W). It is worth noting that, regardless of the edge weight function ω : E → R+ , such characterization of the entries of An implies that (2.2) (An )k` = 0, for every n < dG (k, `) . This property will be one of the key tools of our forthcoming analysis. A matrix function can be defined in a number of different but equivalent ways (see [28] e.g.). Here we adopt the power series representation as it has a direct interpretation in terms of network properties: Given a matrix A and a function f : C → CP being analytic on a regionPΩ ⊆ C containing the spectrum of A, we let f (A) = n≥0 θn An , where f (z) = n≥0 θn z n is the power series representation of f in Ω. Given a function f , the importance of a node in a network can be quantified 3 in terms of certain entries of the matrix f (A). This idea was firstly introduced by Estrada and Rodriguez-Vasquez in [19], for the particular choice f (z) = exp(z), and then developed and extended in many subsequent works, see f.i. [7, 2, 18] and the references therein. We thus adopt the following definition: ×N Definition 2.1. Let A ∈ RN be the adjacency matrix of a graph G = + (V, E, ω). Let f : C → C be analytic on a set Ω containing the spectrum of A and P such that, for z ∈ Ω, f (z) = n≥0 θn z n with θn > 0. The f -centrality of the node k ∈ V is the quantity f (A)kk . The f -communicability from node k to node ` is the quantity f (A)k` . The centrality of a node is a measure of its importance as a P component in the graph. Using (2.1) one easily realizes that the quantity f (A)kk = n≥0 θn (An )kk is a weighted sum of the weights of all the possible closed walks from k to itself, the weights being given by the positive coefficients θn . If f (A)kk is large, then many closed walks consistently weighted pass by the node k ∈ V , and thus k can be recognized as an important component in G. The communicability of a pair of nodes is a measure of the robustness of communication between the pair. Arguing as before, we can infer that, if f (A)k` is large, then many walks with a consistent weight start in k and end up in `. Thus the connection between these two nodes is likely to be not affected by unpredicted breakdowns in the edge structure of the network, that is any message sent from k toward ` is very likely to reach its destination. As mentioned before, typical choices of the function f in the context of networks analysis are the exponential and the resolvent functions [19, 18], respectively given by choosing θn = 1/n! or θn = αn , where 0 < α < ρ(A) and ρ(A) is the spectral radius of A. Namely, (2.3) exp(A) = X 1 An , n! rα (A) = X αn An = (I − αA)−1 . n≥0 n≥0 3. Motivations. This work is concerned with the problem of estimating the changes in the entries of f (A) with respect to “small” changes in the entries of A. However, for our purposes, the concept of being small is not related with the norm nor the spectrum of the perturbation, whereas we assume that a small number of entries are modified in A via a sparse matrix δA. This form of perturbation has the following network interpretation: if A is a square nonnegative matrix of order N and G = (V, E, ω) is the graph associated with A, then adding the sparse noise δA ∈ RN ×N to A is equivalent to adding, removing or modifying the weight of the edges in a set e = (V, E, e ω δE ⊆ V × V , with |δE|  |E|. We obtain in this way a new graph G e ), e e e where E = E ∪ δE and ω e : E → R+ coincides with ω on E \ δE. Although the norm of δA can be arbitrarily large, intuition suggests that, if the topology of connections e is not significantly distorted, relevant components in G maintain in the new graph G e Providing mathematical evidences in support of this intuition their leading role in G. is one of the main objectives of the present work, where we show that the magnitude of the variation of the entry f (A)k` decays exponentially with the distance in G that separates either k or ` from the set of nodes touched by the new edges δE. This is of particular interest when addressing measures of f -centrality or f communicability for large networks. To fix ideas, let us focus on the centrality case and consider the example case where the network represents a data set where interactions evolve in time. Let A be the adjacency matrix of the current graph G and 4 e = A + δA be the adjacency of the graph G e in the next time stamp. Computing A the diagonal entries of f (A) is a costly operation and, in principle, knowing the ime requires computing the entries of f (A) e almost from scratch. portance of nodes in G On the other hand, very often one needs to know only “who are” the first few most important nodes in the graph, whereas the nodes whose edge connection tends to change more often are those having a marginal role in the graph [32], and typically we expect that the distance in G from important nodes and nodes having a marginal role is large. To gain further intuition, in what follows we briefly consider an example model where an edge exists from node i to node j with a probability being exponentially dependent on the difference between the importances of i and j. This is a form of “logistic preferential attachment” model, where edge distribution follows an exponential rather than a more common power law. The reasons for this choice are purely expository, as the logistic function simplifies the computations we discuss below. Let c : V → [0, 1] be a centrality function measuring the importances of nodes. Assume that an edge from i to j exists with probability P(i → j) = sα (cj − ci ), where sα (x) = 1 . 1 + e−α x The parameter 0 < α ≤ 1 can be used to vary the slope of the sigmoid function sα and thus to tune the growth rate of sα towards 1 or 0, as x increases or decreases respectively. This model is assuming that nodes highly ranked are very unlikely pointing to nodes with low rank, whereas the reverse implication is very likely to occur. This kind of phenomenon is relatively common in real-world networks [3] and it is at the basis of several ranking models [32]. Given a set of nodes S ⊆ V let cS = maxi∈S ci be the centrality of the most influential node in S. By noting that for x, y ∈ R it holds sα (x)sα (y) ≤ sα (x + y), the probability πn (i, S) that there exists in G a walk of length n from i to the set S, can be bounded by   N − |S| πn (i, S) ≤ sα (cS − ci ) n  a! where ab = (a−b)!b! is the binomial coefficient. We can thus bound the probability that a node i is at least n steps far from the set S as follows:   n    n Y N − |S| P(dG (i, S) > n) = 1 − πk (i, S) ≥ 1 − sα (cS − ci ) . n k=1 e is a clique δE = S ×S. Suppose for simplicity that the set of perturbed edges in G If the size of S is small enough and ci  cS , that is the node i is significantly more relevant than the nodes in S, then the above derivation shows that the probability that i is n steps far from S is large. We shall show in the forthcoming Section 5 e k` | decays exponentially with dG . Thus, that the absolute variation |f (A)k` − f (A) as claimed, in a model with such a preferential attachment edge distribution, it is expected that changes in the topology of edges involving low relevant nodes do not affect the ranking of the leading components. 4. Faber polynomials. In this section we review the definition of Faber polynomials and several of their fundamental properties. Faber polynomials extend the 5 theory of power series to sets different from the disk, and, inspired by the analysis made in [42], will be used in the next section for our main results. Let Ω be a continuum with connected complement, and let us consider the relative conformal map φ satisfying the following conditions φ(∞) = ∞, lim z→∞ φ(z) = d > 0. z Hence, φ can be expressed by a Laurent expansion φ(z) = dz + a0 + Furthermore, for every n > 0 we have (n) n (n) (n) (φ(z)) = dn z n + an−1 z n−1 + · · · + a0 + a1 z + a2 z2 + .... (n) a a−1 + ... . + −2 z z2 The Faber polynomial for the domain Ω is defined by (see, e.g., [44]) (n) (n) Φn (z) = dz n + an−1 z n−1 + · · · + a0 , for n ≥ 0. If f is analytic on Ω then it can be expanded in a series of Faber polynomials over Ω, namely Theorem 4.1 ([44]). Let f be analytic on Ω. Let φ be the conformal map of Ω, ψ be its inverse and Φj be the j-th Faber polynomial associated with φ. Then (4.1) f (z) = ∞ X fj Φj (z), for z ∈ Ω; j=0 with the coefficients fj being defined by fj = 1 2πi Z D f (ψ(z)) dz , z j+1 where D is the boundary of a neighborhood of the unit disc such that f in Ω can be represented in terms of its Cauchy integral on ψ(D). It immediately follows from the above theorem that, if the spectrum of A is contained in Ω and f is a function analytic in Ω, then the matrix function f (A) can be expanded as follows (see, e.g., [44, p. 272]) (4.2) f (A) = ∞ X fj Φj (A). j=0 The field of values or numerical range of a matrix A ∈ CN ×N is a convex and compact subset of C defined by F(A) = {x∗ Ax : x ∈ CN , kxk2 = 1} . The following theorem, proved by Beckermann in [4, Theorem 1], will be particularly useful in the following section. Theorem 4.2. Let A be a square matrix and let Ω a convex set containing F(A). Then for every n ≥ 1 it holds kΦn (A)k ≤ 2 , being Φn the n-th Faber polynomial for the domain Ω, as previously defined. 6 5. Main results. Consider a function f : C → C and let k, ` be two nodes in V . Assume that the adjacency matrix A of G = (V, E, ω) is modified into the matrix e = A + δA with associated graph G. e As we discussed above, we are interested in A e with respect to a-priori estimations of the absolute variation of the entries of f (A) those of f (A). To this end, in the following Sections 5.1 and 5.2, we develop a number of explicit bounds of the form  (5.1) e k` | ≤ β(δ) |f (A)k` − f (A) 1 ρ(δ) δ , where δ is a quantity measuring the distance in G from k and ` and the set of modified e β(δ) → β > 0 for δ → +∞, and ρ(δ) depends on the function f and the edges in G, e field of values of A and A. It is worthwhile pointing out that the bounds we propose depend on the distances e is required. This is between nodes in G, whereas no knowledge on the topology of G particularly important as it allows us to formulate a simple algorithm that exploits the computations needed for computing the f -centrality or f -communities scores to simultaneously compute (or approximate) the distances between node pairs in G and thus, for each node k or pair of nodes k and `, identifying via (5.1) the subareas of G whose change in the edge topology do not affect (or affect in minor part) the score f (A)k` . 5.1. Upper bounds on network indices’ stability. In order to derive our bounds for the stability of f (A)k` we employ the theory of Faber polynomials briefly discussed in Section 4. On top of being of self interest, the following lemmas are crucial to address our main Theorem 5.3. N ×N be its adjacency maLemma 5.1. Let G = (V, E, ω) be a graph and A ∈ R+ e with adjacency matrix A, e obtained by adding, erasing, or trix. Consider the graph G, modifying the weights of the edges contained in δE ⊂ V × V . If S = {s|(s, t) ∈ δE} and T = {t|(s, t) ∈ δE} are respectively the sets of sources and tips of δE, then e k` = (pn (A))k` , (pn (A)) for every polynomial pn of degree n ≤ dG (k, S) + dG (T, `). en )k` = (An )k` concluding then by linProof. We prove it for the monomials (A n earity. Since (A )k` is the weighted number of walks from k to ` of length n, en )k` = (An )k` whenever G and G e have the same walks of length n from k to (A e must contain at least an edge from `. Furthermore, a modified walk from k to ` in G S to T . We conclude noticing that any walk from k to ` passing through S and T has length greater or equal to dG (k, S) + dG (T, `) + 1. Lemma 5.2. Consider the assumptions of Lemma 5.1. Moreover, let Ω be a cone and with connected complement. If f is vex continuum containing F(A) and F( PA) ∞ an analytic function on Ω and f (z) = j=0 fj Φj (z) is its Faber expansion (4.1) for the domain Ω, then ∞   X e f (A) − f (A) ≤4 |fj |, k` where δ = dG (k, S) + dG (T, `). 7 j=δ+1 Proof. Since the coefficients fj depend only on the set Ω and the function f they e Therefore, (4.2) gives are the same for both the expansions (4.2) of f (A) and f (A). ∞ X e = f (A) − f (A) e fj (Φj (A) − Φj (A)). j=0 By Lemma (5.1) we get   e Φj (A) − Φj (A) =0 for every j ≤ δ. k` Thus   e f (A) − f (A) ∞ X = k`   e fj Φj (A) − Φj (A) . k` j=δ+1 Since Ω is convex Theorem 4.2 concludes the proof. The previous theorem allows for the claimed exponential decay bound on the e absolute variation of the entries of f (A) and f (A). e and let Theorem 5.3. Let Ω be a convex continuum containing F(A) and F(A) f be analytic in Ω. Given a τ > 1 let D = Dτ = {z : |z| = τ } and ψ be as in the assumptions of Theorem 4.1. Then  e f (A) − f (A) 2 τ ≤ µτ (f ) πτ −1  k`  δ+2 1 , τ with δ = dG (k, S) + dG (T, `) and Z |f (ψ(z))| dz . µτ (f ) = Dτ  Proof. By Lemma 5.2 we get e f (A) − f (A)  ≤4 k` ∞ X |fj |. The Faber coef- j=δ+1 ficients fj are given by fj = Thus |fj | ≤ 1 2πτ j+1 µτ (f ),  1 2πi Z Dτ f (ψ(z)) dz. z j+1 and  e f (A) − f (A) k` ∞  j+1 2 X 1 π τ j=δ+1  δ+2 X ∞  j 2 1 1 = µτ (f ) π τ τ j=0  δ+2 2 τ 1 = µτ (f ) πτ −1 τ ≤ µτ (f ) concluding the proof. The theorem above shows that if k is distant from S, or T is distant from `, then e k` is close to f (A)k` . Moreover, the difference between the two values decreases f (A) 8 exponentially in δ = dG (k, S) + dG (T, `). As a limit case, if the considered graph is not connected and there is no walk either from k to m or from n to `, then δ = +∞ e k` = f (A)k` . and we deduce f (A) In order to obtain a sharp bound in Theorem 5.3 we need to choose τ appropriately. This choice clearly depends on the trade-off between µτ (f ), that is the possibly “large size” of f on the given region, and the exponential decay of (1/τ )δ+2 . Hence, Theorem 5.3 produces a family of bounds depending on the considered problem. As we discussed in Section 2, the exponential and the resolvent functions (2.3) play a central role for f -centrality and f -communicability problems in the complex networks literature [19, 18, 7]. For this reason in what follows we focus on these two special functions and derive more precise bounds when f (x) is either exp(x) or rα (x). We will use the symbol <(z) to denote the real part of the complex number z. e S and T be as in Lemma 5.1, Ω be a set containing Corollary 5.4. Let A, A, e and δ = dG (k, S) + dG (T, `). F(A) and F(A), If the boundary of Ω is a horizontal ellipse with semi-axes a ≥ b > 0 and center c, and δ > b − 1 then  δ+1   a + b eq(δ+1) 4e<(c) p(δ + 1) e , exp(A) − exp(A) ≤ p(δ + 1) − (a + b)/(δ + 1) δ + 1 p(δ + 1) k` p a2 −b2 , p(δ) = 1 + 1 + (a2 − b2 )/δ 2 . with q(δ) = 1 + δ2 +δ√ δ 2 +a2 −b2 If Ω is a disk of radius a and center c, and δ > a − 1 then  δ+1   ae <(c) (δ + 1) e exp(A) − exp(A) ≤ 4e . δ+1−a δ+1 k` If Ω is a real subinterval [c − a, c + a] (with a > 0), then for every δ > 0 4ec p(δ + 1) ≤ p(δ + 1) − a/(δ + 1) k` p 2 a with q(δ) = 1 + δ2 +δ√ , p(δ) = 1 + 1 + (a/δ)2 . δ 2 +a2   e exp(A) − exp(A)  a eq(δ+1) δ + 1 p(δ + 1) δ+1 , Notice that for δ big enough p(δ) ≈ 2 and q(δ) ≈ 1. Proof. We begin with the case of Ω with boundary an horizontal ellipse. A conformal map for Ω is p w − c − (w − c)2 − ρ2 , (5.2) φ(w) = ρR and its inverse is ρ ψ(z) = 2 (5.3) with ρ = that √   1 Rz + + c, Rz a2 − b2 and R = (a + b)/ρ; see, e.g., [44, chapter II, Example 3]. Notice ρ max |eψ(z) | = max e<(ψ(z)) = e 2 (Rτ + Rτ )+<(c) . |z|=τ 1 |z|=τ Hence, since µτ (exp) ≤ τ max|z|=τ |eψ(z) |, by Theorem 5.3 we get  δ+1   ρ 1 τ 1 e exp(A) − exp(A) ≤4 e<(c) e 2 (Rτ + Rτ ) . τ −1 τ k` 9 ρ The optimal value of τ > 1 which minimizes e 2 (Rτ + Rτ ) τ= δ+1+ 1  1 δ+1 τ is p (δ + 1)2 + ρ2 . ρR Moreover the condition τ > 1 is satisfied if and only if δ + 1 > noticing that   ρ 1 Rτ + = (δ + 1)q(δ + 1), 2 Rτ ρ 2 R− 1 R  = b. Finally, the proof is completed for the ellipse case. The case in which Ω is a disk is easily obtained setting b = a, while the case Ω = [c − a, c + a] can be proved considering an ellipse of center c, major axis a minor axis any b > 0, and then letting b → 0 in the bound for the ellipse case. Similarly, we can derive a bound for the resolvent rα (A) = (I − αA)−1 . In this case, the function rα (z) is not analytic in the whole complex plane. This property has crucial effects in the approximation, as the subsequent corollary shows. e S and T be as in Lemma 5.1, Ω be a set symmetric Corollary 5.5. Let A, A, e δ = dG (k, S) + dG (T, `), with respect to the real axis and containing F(A) and F(A), −1 and rα (x) be defined as in (2.3) with α > 0 such that α ∈ / Ω. If the boundary of Ω is a horizontal ellipse with semi-axes a ≥ b > 0 and center c, then for 0 < ε < |α−1 − c| − a and δ > 0  e rα (A) − rα (A)  ≤ k` 4 1− a+b (|α−1 −c|−ε)pε 1 ε  a+b 1 |α−1 − c| − ε pε δ+1 , p where pε = 1 + 1 − (a2 − b2 )/(|α−1 − c| − ε)2 . If Ω is a disk of radius a and center c, then for 0 < ε < |α−1 − c| − a and δ > 0   e rα (A) − rα (A) ≤ k` 4 1− a (|α−1 −c|−ε) 1 ε  a −1 |α − c| − ε δ+1 . If Ω is a real subinterval [c − a, c + a] (with a > 0), then for 0 < ε < |α−1 − c| − a and δ > 0  e rα (A) − rα (A) where pε = 1 + p  k` ≤ 4 1− a (|α−1 −c|−ε)pε 1 ε  a 1 |α−1 − c| − ε pε δ+1 , 1 − (a/(|α−1 − c| − ε))2 . Notice that since incidence matrices are real their field of values are symmetric with respect to the real axis, hence the assumption on Ω is natural. We also remark that pε ≈ 2 when δ is large. Proof. Here we prove the case of Ω with ellipse shape since the other two cases can then be derived as done in the proof of Corollary 5.4. Let φ as in (5.2) and ψ as in (5.3). Since the function (1 − αz)−1 is not analytic −1 in α in order to fulfill the assumptions of Theorem 5.3 we assume |ψ(z)| < α−1 for every |z| = τ , with τ > 1. 10  1 Notice that ρ2 Rτ + Rτ is the major semi-axis of the ellipse Γτ = {ψ(z) : |z| = τ }. Since the center of the ellipse is on the real axis, for ε > 0 small enough we get   ρ 1 −1 −1 = |α − c| − ε = min ψ(z) − α Rτε + , 2 Rτε |z|=τε for some τε > 1. Hence by Theorem 5.3 we get  e rα (A) − rα (A)  ≤4 k` τ 1 τ −1ε  1 τε δ+1 , Noticing that τε = |α−1 − c| − ε + p (|α−1 − c| − ε)2 − ρ2 , ρR we derive the bound. Finally, the condition τ > 1 is satisfied if and only if ε < |α−1 − c| − a. 5.2. Normalized adjacency matrices: Random walks on G. In many cases the adjacency matrix of a graph G = (V, E, ω) is “normalized” into a transition matrix, so to model a random walk process on the edges. Transition matrices (or random walks matrices) arise in many network applications, including centrality, quasi-randomnes and clustering problems (e.g. [12, 14, 43, 46]). Assume for simplicity that the graph G is unweighted, loop-free and with no dangling nodes. That is, if A is the adjacency matrix of G, then aij ∈ {0, 1}, aii = 0 ∀i, j and, for each i, there exists at least one j such that aij = 1. A popular transition matrix Aout on G describes the stationary random walk on the graph where a walker standing on a vertex i chooses to walk along one of the outgoing edges of node i, with no preference among such edges. The entries of Aout are the probabilities of going −1 from node i to node j in one step, which are then given by (Aout )ij = (Dout A)ij , out out out where A is the adjacency matrix of G, Dout = diag(d1 , . . . , dn ) and di is the number of outgoing edges from node i. Note that when the graph is not oriented the adjacency matrix A is symmetric, however the transition matrix is not. This is one of the reasons why a symmetrized version of Aout is typically preferred in this 1/2 −1/2 −1/2 −1/2 case. Such matrix, defined by A = Dout Aout Dout = Dout ADout , is also known as normalized adjacency matrix of G. In this section we discuss how the bounds of Section 5.1 transfer to Aout and A. For the sake of simplicity, let us first address the undirected case. For a set of nodes S ⊆ V let ∂S = {i ∈ V \ S : dG (S, i) = 1} denote the neighborhood of S. Let A and Ae be the normalized adjacency matrices of G and e respectively. Unlike the conventional adjacency matrix, the set of entries that are G, effected by the changes in E are not only related to δE, but to a larger set. Precisely, if the edges in δE connects the nodes within S ⊂ V , then changes in A occur on the entries corresponding to the nodes in S̄ = S ∪ ∂S. Given k ∈ / S, we have (5.4) dG (k, S) = dG (k, S̄) + 1. Therefore, an easy consequence of Lemma 5.1 applied to S̄ implies that Theorem 5.3 e k` | when δ is replaced by dG (k, S) + dG (S, `) − 2. However a holds for |f (A)k` − f (A) more careful analysis of the structure reveals that the following lemma holds: ×N Lemma 5.6. Let G = (V, E, w) be an undirected graph and A ∈ RN be its + e normalized adjacency matrix. Consider the graph G, obtained by adding or erasing 11 the edges between the nodes in a subset S and let Ae be the corresponding normalized adjacency matrix. Then, for any k, ` ∈ / S we have e k` = (pn (A))k` , (pn (A)) for every polynomial pn of degree n ≤ dG (k, S) + dG (S, `) − 1. e contains a modified edge only if it passes through Proof. A walk from k to ` in G at least one modified edge in S or through at least one re-weighted edge connecting S and ∂S. Therefore, any modified walk must go from k to ∂S, then from ∂S to S, then from S to ∂S, and finally from ∂S to `. Therefore, due to the identity (5.4), the length of any modified walk must be equal or longer than dG (k, S̄) + dG (S̄, `) + 2 = dG (k, S) + dG (S, `). The proof thus follows as the one of Lemma 5.1. Hence, following the same arguments as the one in Section 5, we can extend to A the bounds of Theorem 5.3, Corollary 5.4 and Corollary 5.5 by replacing δ with δ − 1. Let us now consider the case of a directed network and let us thus transfer Lemma 5.1 to the transition matrix Aout . Arguing as above we obtain N ×N be the its Lemma 5.7. Let G = (V, E, w) be a directed graph and Aout ∈ R+ e transition matrix. Consider the graph G, obtained by adding or erasing the edges in δE ⊂ V × V , and let Aeout be the corresponding transition matrix. If S = {s|(s, t) ∈ δE} and T = {t|(s, t) ∈ δE} are respectively the sets of sources and tips of δE, then (pn (Aeout ))k` = (pn (Aout ))k` , for every polynomial pn of degree n ≤ dG (k, S) + min{dG (T, `), dG (S, `) − 1}. Proof. Consider ∂out S = {i ∈ V \ S : dG (S, i) = 1}, the out neighborhood of S. e contains a modified edge only if it passes through at least A walk from k to ` in G one modified edge in S or through at least one re-weighted edge connecting S and ∂out S. Therefore, any modified walk must go from k to S, then it may go from S to T through a modified edge, or it can go to any node in ∂out S. In the first case, the length from k to ` of the walk must be greater or equal than dG (k, S) + dG (T, `) + 1. In the second case, the length of the walk must be greater or equal than dG (k, S) + dG (S, `). The proof thus follows as the one of Lemma 5.1. Hence, we can extend to Aout the bounds of Theorem 5.3, Corollary 5.4 and Corollary 5.5 by replacing δ with min{δ, dG (k, S) + dG (S, `) − 1}. 5.3. On the field of values of adjacency matrices. Two quantities play a key role in the computation of the bounds we proposed: the shortest-path distances e Next subsection between pairs of nodes and the shape of the field of values of A and A. deals with the former whereas we devote the present subsection to the latter. Let A be a N × N real matrix with nonnegative entries. The numerical radius of A is the quantity ν(A) = max{|w| : w ∈ F(A)} , 12 whereas, the Hermitian part of A is the Hermitian matrix defined by HA = (A+A∗ )/2. As for the spectrum of A, a Perron-Frobenius theory for the field of values F(A) has been developed in relatively recent years (see e.g. [35, 34]). We recall henceforth two results which are useful for our scopes: 1. When A ≥ 0, the numerical radius ν(A) is the maximal element of F(A), attained by the maximal eigenvector of HA . Precisely, for A ≥ 0, we have (5.5) ν(A) = ρ(HA ) . 2. The shape of the field of values F(A) for nonnegative matrices can be characterized in terms of the index of imprimitivity of A, defined as the number of eigenvalues of A having maximal modulus. In fact, if A ≥ 0 is irreducible, then the maximal elements of F(A) are of the form ν(A) exp(2iπp/k), p = 1, 2, . . . , k − 1 being k the index of imprimitivity of A. N ×N Point 1 shows that, for nonnegative matrices A ∈ R+ , it is always possible to e compute a set Ω containing the field of values of A or of A, by letting Ω = {ζ ∈ C : e respectively. Moreover, point 2 above shows that |ζ| ≤ ν} where ν is ν(A) or ν(A), if the imprimitivity index of A is large, then the ball {ζ ∈ C : |ζ| ≤ ν(A)} is a tight approximation of the field of values F(A). The normalized adjacency matrix A has the desirable property of being diagonally e = 1. For general similar to a stochastic matrix. This implies that ν(A) = ν(A) nonnegative matrices, instead, the field of values can be large. However, due to (5.5), e can be well approximated by standard eigenvalues the numerical radii ν(A) and ν(A) techniques such as the power method or the Lanczos process. The computational cost of this operation is much smaller than the effort required to compute the entries of e Moreover, if δA is sparse enough, we expect ν(A) the matrix functions f (A) or f (A). e and ν(A) to be close. This claim is also supported by the following Theorem 5.8, where the case of a single-entry perturbation is discussed. e = A + 1m 1Tn . Then Theorem 5.8. Let A ≥ 0 and let A e e − ν(A) > 0. 1. 0 ≤ ν(A) − ν(A) ≤ 1/2 and, if HAe is irreducible, then ν(A) 2. Assume HA irreducible. For any nonnegative function f : C → R+ , such that f (ν(A)) 6= 0 we have p   e − ν(A) ≤ f (A)mm f (A)nn + O 1 0 < ν(A) f (ν(A)) 4 e ≥ A ≥ 0, then H e ≥ HA ≥ 0 and, by the Perron-Frobenius theorem Proof. As A A e ≥ ν(A). As, by assumption, A e 6= A, then H e 6= HA and point 1 above, we have ν(A) A and, again, the Perron-Frobenius theorem applied to HA and HAe ensures the strict inequality if HAe is irreducible. Observe that H1m 1Tn (1m +1n ) = (1m +1n )/2, implying that ρ(H1m 1Tn ) = kH1m 1Tn k2 = 1/2. By the Bauer-Fike theorem (see [25] f.i.) applied to HAe = HA + H1m 1Tn we get e ≤ kA − Ak e 2 = kH1 1T k2 = 1/2 |ν(A) − ν(A)| m n completing the proof of the fist statement. To address the second statement note that, as HA is irreducible, ν(A) = ρ(HA ) is a simple eigenvalue and the corresponding 13 eigenvector x with x∗ x = 1 is entry-wise positive. Thus we can use a standard eigenvalue perturbation argument (see e.g. [47]) to get (5.6) e − ν(A) = (x∗ H1 1T x)kH1 1T k2 + O(kH1 1T k22 ) = xm xn + O(1/4) ν(A) m n m n m n Let y2 , . . . , yn be the orthonormal eigenvectors of HA corresponding to the eigenvalues λ2 , . . . , λn , with λj 6= ν(A). Then, for any 1 ≤ i ≤ n, we have f (A)ii = f (ν(A))x2i + X f (λj )(yj )2i ≥ f (ν(A))x2i . j>1 p As a consequence xi ≤ f (A)ii /f (ν(A)) and, together with (5.6), we conclude. 5.4. Computing node distances by Krylov methods. The bounds proposed so far rely on the geodesic distances between pair of nodes in the graph. Computing such distances is a classical problem in graph theory and several efficient and parallelizable algorithms are available [45]. In this section, however, we propose a simple numerical strategy that exploits the computation of f (A)k` , to simultaneously approximate the distances dG (m, `) and dG (k, m) for any node m, at essentially no attentional cost. As we will discuss in what follows, the procedure is well suited for undirected graphs and allows to compute small distances exactly, whereas provides a lower bound when dG (m, `) (resp. dG (k, m)) is too large. Computing the f -communicability or f -centrality of a network can be a computationally expensive task, especially for large graphs. An established and efficient strategy to address this quantities exploits the fact that f (A)k` can be written as the quadratic form 1Tk f (A)1` and thus employs Lanczos-type algorithms [30, 31] both for symmetric ([24, 5]) and non-symmetric matrices ([22, 41]). The non-Hermitian Lanczos algorithm produces two basis {v0 , . . . , vn−1 } and {w0 , . . . , wn−1 } for the Krylov subspaces Kn (A, v0 ) and Kn (AT , w0 ), respectively. If no breakdowns arise, the j-th vectors vj and wj are obtained at the j-th step of the algorithm. Moreover, they are biorthogonal (wj∗ vj = 1) and such that vj = pj (A)v0 and wj = pj (AT )w0 , with pj a polynomial of degree exactly j. We remark that the Hermitian Lanczos algorithm can be used when A is symmetric and v0 = w0 . For symmetric matrices and the case v0 6= w0 , a similar strategy can be employed (see [24, Ch. 7] for details). In the following we treat only the non-Hermitian Lanczos algorithm. Everything can be easily transferred to the Hermitian case by letting wj = vj . In order to approximate f (A)k` the method requires to set v0 = 1` and w0 = 1k . We then get the following result: Theorem 5.9. Let {v0 , . . . , vn−1 } and {w0 , . . . , wn−1 } be the basis of Kn (A, 1` ) and Kn (AT , 1k ) obtained by the non-Hermitian Lanczos algorithm. Then for every m = 1, . . . , N the distance dG (m, `) (resp. dG (k, m)) is equal to the first index j for which the m-th element of vj (resp. wj ) is nonzero. Proof. We prove the result for dG (m, `). The proof can be easily transfered to dG (k, m). As we already discussed, (Aj )m` is the overall weight of the walks of length j from m to `. Therefore, if dG (m, `) < j, then (pj (A))m,` = 0. Moreover, since pj has degree exactly j, if dG (m, `) = j then (pj (A))m,` = α(Aj )m,` 6= 0 for some α 6= 0, concluding the proof. 14 Hence, we can modify the non-Hermitian Lanczos algorithms to compute the distance vectors     dG (1, `) dG (k, 1) ← →     .. .. d` =  dk =  . , . . dG (N, `) dG (k, N ) The idea is to add the following pseudo-code to the Lanczos algorithm (we assume to stop it at the (n − 1)-th iteration). First, initialize the variables is_zero_k, is_zero_l, d_k and d_l as follows for i=1,...,N is_zero_k(i) is_zero_l(i) d_k(i) = n d_l(i) = n end = = % % TRUE TRUE vector of the distances from k vector of the distances to l and then modify the method by adding the procedure below, to derive the distances from the nonzero pattern of vj and wj , at each step of the scheme for j=1,...,n-1 % Iteration of Lanczos algorithm compute vector v_j and w_j for m=1,...,N if v_j(m) > 0 && is_zero_k(m) d_k(m) = j is_zero_k(m) = FALSE end if w_j(m) > 0 && is_zero_L(m) d_l(m) = j is_zero_l(m) = FALSE end end proceed with the rest of the algorithm end Notice that if n is smaller or equal than the diameter of the graph, there can be null elements in vj for j = 0, . . . , n−1. Nevertheless, for all these elements, n is a lower bound for the distance, which can then be used to approximate δ in Theorem 5.3. On the other hand, let us remark that many real-world networks have a small diameter, thus we expect the proposed technique to be able to actually compute the desired distances in typical applications. Also note that by using this strategy, computing the diagonal of f (A) allows to simultaneously address the all-pair shortest-path distances of the graph. This is particularly effective when dealing with undirected graphs. In that case, in fact, the entries f (A)kk can be computed with the Hermitian Lanczos method which further ensures no breakdowns. Table 1 in the next section shows how this strategy behaves on four sample undirected networks, where the diagonal of the exponential function is approximated by the Hermitian Lanczos method and the number of maximal iterations varies. 15 6. Numerical examples. In this section we illustrate the behavior of the proposed bounds on some example networks. The first explanatory example graph we consider is represented in Figure 1. The considered graph G is made by two simple cycles (closed undirected paths) with 111 → nodes each, and by one directed edge e from node 111 to node 112. Fig. 1. Example: two cycles connected by a directed bridge (n, m) in which we add the edge in the opposite direction (m, n). → Since there are no closed walks passing through e , all the nodes in G have the same f -centrality. The graph is then perturbed by the insertion of one single new ← directed edge e from node 112 to node 111. This new edge “closes the two-directional bridge” between the two circles, resulting into a perturbation of the f -centrality scores e kk | (left of the nodes. In Figure 2 we plot in red crosses the values | exp(A)kk − exp(A) e plot) and those of |rα (A)kk − rα (A)kk | with α = 3 (right plot), for k = 1, . . . , 222. With blue circles, instead, we represent the bound in Corollaries 5.4 (left plot) and 5.5 (right plot) for every admissible k. As we can see the behavior of the decays of the differences is well approximated by the bounds. Moreover, we observe that the exponential decay for the exponential centrality variation as well the linear decay of the resolvent one are captured by the bound. 10 0 10 0 10 -10 10 -10 10 -20 10 -20 0 50 100 150 0 200 50 100 150 200 e kk | (red crosses) when adding the edge ← Fig. 2. In the ordinate: |f (A)kk − f (A) e in the graph of Figure 1 and the bounds (blue circles) of Corollaries 5.4 and 5.5. In the abscissa: k, the nodes of the graph. From left to right: variation of exponential centrality f (x) = exp(x); variation of resolvent centrality f (x) = r3 (x). In the following we present four examples of real-world undirected networks whose diameter is proportional to the logarithm of the number of nodes. Our analysis is meant to show the correlation between the variation of the network centralities and the variation of the distances in G with respect to the set of perturbed edges. For 16 this reason, normalized adjacency matrices A are considered below, so to guarantee the field of values of both the original and the perturbed matrices to be constrained within the unit segment [−1, 1]. The considered network data are borrowed from [16, 33] and are briefly described below: Gnutella A snapshots of the Gnutella peer-to-peer file sharing network in August, 8, 2002. Nodes represent hosts in the Gnutella network topology and edges represent connections between the Gnutella hosts. Number of nodes: 6300, Number of edges: 41297, Diameter: 10; Facebook This dataset consists of anonymous “friends circles” from Facebook. Facebook data was collected from survey participants. Number of nodes: 4038, Number of edges: 176167, Diameter: 10; GRCQ General Relativity and Quantum Cosmology (GR-QC) collaboration network. Data are collected from the e-print arXiv and covers scientific collaborations between authors papers submitted to GR-QC category. The data covers papers in the period from January 1993 to April 2003. Number of nodes: 5242, Number of Edges: 14496, Diameter: 17; Erdös Erdös collaboration network. Number of nodes: 472, Number of edges: 2628, Diameter: 11. For each network we compute (approximate) the exponential centrality index exp(A)kk , k = 1, . . . , n, by running n iterations of the Lanczos algorithm. By using the method presented in Subsection 5.4, for every ` we can compute dn (k, `): an approximation of dG (k, `). If dG (k, `) ≤ n, then dn (k, `) = dG (k, `). Otherwise, if d(k, `) > n then dn (k, `) = n ≤ dG (k, `). We compared the proposed methods with dM (k, `): the distance between k and ` computed by the Matlab function distances. Note that, dM (k, k) = 0 for every node k, whereas dn (k, k) is either n or the minimal length of a closed walk passing through k. Moreover, when k and ` are disconnected, dn (k, `) = n for every n, while distances correctly sets to ∞ the distance between disconnected nodes. In order to evaluate the proposed method, we consider the quantity %n (G) = #{(k, `)| dn (k, `) 6= dM (k, `), k 6= `, dG (k, `) < ∞} , #{(k, `)| k 6= `, dG (k, `) < ∞} which depends on the number of pairs (k, `) for which dn (k, `) 6= dM (k, `) (excluding the disconnected and the coincident nodes). Table 1 presents %n (G) for some values of n and for the networks listed above. The table clearly shows that for a small number of Lanczos iterations we are able to determine most of the distances. Moreover, when n is greater or equal to the diameter of the network we always have dn (k, `) = dM (k, `), for every k 6= ` and dG (k, `) < ∞. Now, for each network, we select the 10 nodes having smallest centrality exp(A)kk and we perturb the edge topology of the graph by adding all the missing edges among those nodes (obtaining a clique connecting all the “less important” nodes). The plots of Figure 3 represent the actual variation of network exp-centrality e kk | (red crosses) and the bound in Corollary 5.4 (blue circle). values | exp(A)kk −exp(A) Let us point out that in the plots shown, we are relabeling the nodes according with the distance from (and to) the set S of modified nodes: the larger is the node index k the farther k is from S. The results show that the proposed bounds, although not tight, well approximate the actual behavior of the variation of f (A)kk . This allows to predict the nodes whose centrality index remains effectively unchanged under perturbations 17 n 7 9 11 13 15 17 Erdös 1.7188e − 02 5.4461e − 04 0 0 0 0 Facebook 1.6729e − 02 7.2177e − 04 0 0 0 0 GRQC 2.5187e − 01 3.0759e − 02 2.3687e − 03 1.0956e − 04 5.4373e − 06 0 Gnutella 5.1500e − 04 5.1438e − 08 0 0 0 0 Table 1 Values of %n (G) for n = 7, 9, 11, 13, 15, 17 and for the networks: Erdös, Facebook, GRQC, and Gnutella. of the original graph topology. For example, the exp-centrality of all the nodes from 3000 onwards in GRQC is guaranteed to be unchanged up to 10 digits of precision. 10 0 10 0 10 -20 100 200 300 Facebook Erdös 10 -10 10 -10 10 -20 400 1000 2000 3000 4000 10 0 10 0 Gnutella GRQC 10 -10 10 -10 10 -20 10 -20 1000 2000 3000 4000 1000 5000 2000 3000 4000 5000 6000 e kk | when k ranges from 1 to N . The perturbed Fig. 3. Absolute variation | exp(A)kk − exp(A) edges are δE = S × S, where S is the set of 10 nodes with least exp-centrality. Nodes in the plot are ordered so that the larger is k the farther it is from S. Red crosses show the actual difference whereas the blue circles show the bound of Corollary 5.4. 7. Conclusion. Centrality and communicability indices based on function of matrices are among the most effective measures of the importance of nodes and of the robustness of edges in a network. These quantities are defined as the entries f (A)k` where f (A) is a suitable function of a matrix A describing the structure of the network G. In this work we address the somewhat natural problem of understanding the stability of such indices with respect to perturbations in the edge topology of the graph. Our analysis reveals that the absolute variation of f (A)k` decays exponentially with respect to the distance in G that separates k and ` from the set of nodes touched by the perturbed edges. The knowledge of this behavior can be of help in e = A + δA, the entries of several practical applications. In fact, if A is modified into A e f (A) should in principle be re-computed from scratch. However, we propose a simple numerical strategy that allows to compute the distances between nodes in G simul18 taneously with the computation of the entries of f (A), with essentially no additional cost. In particular, computing the diagonal of f (A) for undirected networks (the network f -centrality scores) allows to compute the all-pairs shortest-path distances in the graph. Thus, using the proposed bounds, we are able to predict the magnitude of variation in the f -centralities of G when changes occur in a localized set of edges or, viceversa, for each node k we can locate a set of nodes whose change in the edge topology affects the score f (A)kk by a small order of magnitude. Examples of application include the case where the edge topology is evolving in time and changes in G happen more frequently in network subareas being peripheral with respect to the subset of nodes one is actually interested in, or where the information on the edge structure of peripheral nodes is not fully reliable or, equivalently, is likely to be affected by noise. Finally, the results proposed are numerically tested on some example networks borrowed from real-world applications. Our experiments show that the proposed bounds well resemble the actual behavior of the variation of f (A)k` although being some orders of magnitude larger. A clear margin for improvements and further work is thus left open to determine a better constant c > 2 to be added in the exponent δ + c of Theorem 5.3. REFERENCES [1] U. Alon, An introduction to systems biology: design principles of biological circuits, CRC press, 2006. [2] M. Aprahamian, D. J. Higham, and N. J. Higham, Matching exponential-based and resolventbased centrality measures, Journal of Complex Networks, (2015), p. cnv016. [3] A.-L. Barabási and R. Albert, Emergence of scaling in random networks, Science, 286 (1999), pp. 509–512. [4] B. Beckermann, Image numérique, GMRES et polynômes de Faber, C. R. Math. Acad. Sci. Paris, 340 (2005), pp. 855–860. [5] M. Benzi and P. Boito, Quadrature rule-based bounds for functions of adjacency matrices, Linear Algebra and its Applications, 433 (2010), pp. 637–652. , Decay properties for functions of matrices over C ∗ -algebras, Linear Algebra Appl., 456 [6] (2014), pp. 174–198. [7] M. Benzi, E. Estrada, and C. Klymko, Ranking hubs and authorities using matrix functions, Linear Algebra and its Applications, 438 (2013), pp. 2447–2474. [8] M. Benzi and N. Razouk, Decay bounds and O(n) algorithms for approximating functions of sparse matrices, Electron. Trans. Numer. Anal., 28 (2007), pp. 16–39. [9] M. Benzi and V. Simoncini, Decay Bounds for Functions of Hermitian Matrices with Banded or Kronecker Structure, SIAM J. Matrix Anal. Appl., 36 (2015), pp. 1263–1282. [10] S. Boccaletti, V. Latora, Y. Moreno, M. Chavez, and D.-U. Hwang, Complex networks: Structure and dynamics, Physics reports, 424 (2006), pp. 175–308. [11] P. Bonacich, Power and centrality: A family of measures, American journal of sociology, 92 (1987), pp. 1170–1182. [12] U. Brandes and T. Erlebach, eds., Network analysis: methodological foundations, vol. 3418, Springer Science & Business Media, 2005. [13] S. Brin and L. Page, The anatomy of a large-scale hypertextual web search engine, Computer networks and ISDN systems, 30 (1998), pp. 107–117. [14] F. Chung and R. Graham, Quasi-random graphs with given degree sequences, Random Structures & Algorithms, 32 (2008), pp. 1–19. [15] J. J. Crofts and D. J. Higham, A weighted communicability measure applied to complex brain networks, Journal of the Royal Society Interface, (2009), pp. rsif–2008. [16] T. Davis and Y. Hu, University of Florida sparse matrix collection , ACM Transactions on Mathematical Software, 38 (2011), pp. 1–25. [17] E. Estrada and M. Benzi, Core–satellite graphs: Clustering, assortativity and spectral properties, Linear Algebra and its Applications, 517 (2017), pp. 30–52. [18] E. Estrada and D. J. Higham, Network properties revealed through matrix functions, SIAM review, 52 (2010), pp. 696–714. 19 [19] E. Estrada and J. A. Rodriguez-Velazquez, Subgraph centrality in complex networks, Physical Review E, 71 (2005), p. 056103. [20] D. Fasino and F. Tudisco, An algebraic analysis of the graph modularity, SIAM Journal on Matrix Analysis and Applications, 35 (2014), pp. 997–1018. [21] , Generalized modularity matrices, Linear Algebra and its Applications, 502 (2016), pp. 327–345. [22] C. Fenu, D. Martin, L. Reichel, and G. Rodriguez, Block Gauss and Anti-Gauss Quadrature with Application to Networks, SIAM Journal on Matrix Analysis and Applications, 34 (2013), pp. 1655–1684. [23] L. C. Freeman, Centrality in social networks conceptual clarification, Social networks, 1 (1978), pp. 215–239. [24] G. H. Golub and G. Meurant, Matrices, Moments and Quadrature with Applications, Princeton Series in Applied Mathematics, Princeton University Press, 2009. [25] G. H. Golub and C. F. Van Loan, Matrix computations, vol. 3, JHU Press, 2012. [26] P. Grindrod and D. J. Higham, A dynamical systems view of network centrality, Proc. Royal Society A, 470 (2014), p. 20130835. [27] P. Grindrod and M. Kibble, Review of uses of network and graph theory concepts within proteomics, Expert review of proteomics, 1 (2004), pp. 229–238. [28] N. J. Higham, Functions of matrices: theory and computation, SIAM, 2008. [29] K. Kloster, Graph diffusions and matrix functions: Fast algorithms and localization results, PhD thesis, Purdue University, 2016. [30] C. Lanczos, An iterative method for the solution of the eigenvalue problem of linear differential and integral operators, J. Res. Natl. Bur. Stand., 45 (1950), pp. 255–282. [31] C. Lanczos, Solution of systems of linear equations by minimized iterations, J. Res. Natl. Bur. Stand., 49 (1952), pp. 33–53. [32] A. N. Langville and C. D. Meyer, Who’s# 1?: the science of rating and ranking, Princeton University Press, 2012. [33] J. Leskovec and A. Krevl, SNAP Datasets: Stanford Large Network Dataset Collection. http://snap.stanford.edu/data, June 2014. [34] C.-K. Li, B.-S. Tam, and P. Wu, The numerical range of a nonnegative matrix, Linear algebra and its applications, 350 (2002), pp. 1–23. [35] J. Maroulas, P. Psarrakos, and M. Tsatsomeros, Perron–Frobenius type results on the numerical range, Linear algebra and its applications, 348 (2002), pp. 49–62. [36] P. Mercado, F. Tudisco, and M. Hein, Clustering Signed Networks with the Geometric Mean of Laplacians, in Advances in Neural Information Processing Systems, 2016, pp. 4421–4429. [37] J. L. Morrison, R. Breitling, D. J. Higham, and D. R. Gilbert, A lock-and-key model for protein–protein interactions, Bioinformatics, 22 (2006), pp. 2012–2019. [38] M. E. J. Newman, Finding community structure in networks using the eigenvectors of matrices, Physical review E, 74 (2006), p. 036104. [39] A. Y. Ng, M. I. Jordan, and Y. Weiss, On spectral clustering: Analysis and an algorithm, in Advances in Neural Information Processing Systems (NIPS), vol. 14, 2001, pp. 849–856. [40] J.-P. Onnela, J. Saramäki, J. Hyvönen, G. Szabó, D. Lazer, K. Kaski, J. Kertész, and A.-L. Barabási, Structure and tie strengths in mobile communication networks, Proceedings of the National Academy of Sciences (PNAS), 104 (2007), pp. 7332–7336. [41] S. Pozza, M. Pranic, and Z. Strakoš, Lanczos algorithm and the complex Gauss quadrature. 2017. [42] S. Pozza and V. Simoncini, Decay bounds for non-Hermitian matrix functions, submitted, arXiv:1605.01595v3 [math.NA], (2016). [43] K. Rohe, S. Chatterjee, and B. Yu, Spectral clustering and the high-dimensional stochastic blockmodel, The Annals of Statistics, (2011), pp. 1878–1915. [44] P. K. Suetin, Series of Faber polynomials, Gordon and Breach Science Publishers, 1998. [45] H. C. Thomas, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to algorithms, vol. 6, MIT press Cambridge, 2001. [46] U. Von Luxburg, A tutorial on spectral clustering, Statistics and computing, 17 (2007), pp. 395–416. [47] J. Wilkinson, The algebraic eigenvalue problem, vol. 87, Clarendon Press Oxford, 1965. 20
7cs.IT
Systematic Derivation of Behaviour Characterisations in Evolutionary Robotics Jorge Gomes1,2 and Pedro Mariano2 and Anders Lyhne Christensen1,3 1 Instituto de Telecomunicações, Lisbon, Portugal LabMAg – Faculdade de Ciências da Universidade de Lisboa, Portugal 3 Instituto Universitário de Lisboa (ISCTE-IUL), Lisbon, Portugal [email protected], [email protected], [email protected] 2 arXiv:1407.0577v1 [cs.NE] 2 Jul 2014 Abstract Evolutionary techniques driven by behavioural diversity, such as novelty search, have shown significant potential in evolutionary robotics. These techniques rely on priorly specified behaviour characterisations to estimate the similarity between individuals. Characterisations are typically defined in an ad hoc manner based on the experimenter’s intuition and knowledge about the task. Alternatively, generic characterisations based on the sensor-effector values of the agents are used. In this paper, we propose a novel approach that allows for systematic derivation of behaviour characterisations for evolutionary robotics, based on a formal description of the agents and their environment. Systematically derived behaviour characterisations (SDBCs) go beyond generic characterisations in that they can contain task-specific features related to the internal state of the agents, environmental features, and relations between them. We evaluate SDBCs with novelty search in three simulated collective robotics tasks. Our results show that SDBCs yield a performance comparable to the task-specific characterisations, in terms of both solution quality and behaviour space exploration. Introduction Evolutionary robotics (ER) is focused on the application of evolutionary algorithms to the synthesis of robot controllers, and sometimes robot morphologies (Nolfi and Floreano, 2000). In ER, the evolutionary process is typically driven towards solutions for a task according to a manually crafted fitness function (Nelson et al., 2009). Evolutionary algorithms driven by a fitness function are, however, vulnerable to deception and convergence to local optima (Whitley, 1991). Common approaches to overcome these issues are based on diversity preservation. Traditionally, diversity is preserved at the genomic level (Goldberg and Richardson, 1987). However, in ER it has been observed that many different genotypes can represent similar behaviours, and that small changes in the genotype can lead to substantial changes in behaviour (Mouret and Doncieux, 2012). Therefore, recent works have proposed the use of behaviour similarity measures (BSM) in the evolutionary process to promote an effective diversity in the population. A number of different strategies using BSM have been proposed. The most popular approach, novelty search, di- rectly rewards individuals that display novel behaviours (as measured by the BSM), instead of using a fitness function (Lehman and Stanley, 2011; Mouret and Doncieux, 2012). BSM have also been used to speciate the population according to the behaviour of the individuals (Trujillo et al., 2011; Moriguchi and Honiden, 2010). Ollion and Doncieux (2011) defined a measure for the degree of behaviour space exploration, based on BSM, and used the measure to predict the relative performance of different evolutionary setups. Devising effective behaviour measures is not straightforward (Savage, 2004), since the measure must be able to capture the details of the behaviour that are relevant in the given task, while at the same time should contain no or as few irrelevant behaviour features as possible. Behaviour measures are typically defined by the experimenter based on task-specific knowledge (for examples, see Mouret and Doncieux, 2012; Lehman and Stanley, 2011; Mouret and Doncieux, 2009; Gomes et al., 2013). Relying on the experimenter’s intuition about the task may, however, introduce biases in the evolutionary process. These biases can compromise the evolutionary search, as the experimenter might not know beforehand what type of behavioural traits should be explored in order to solve the task. Several researchers have proposed the use of generic BSM (Doncieux and Mouret, 2010; Gomez, 2009; Gomes and Christensen, 2013) for ER. Generic measures do not rely on the specific details of a task, and can be used throughout the domain. Their use is, however, associated with two key issues: (i) generic measures are only weakly related with the specific task, which can create an unnecessarily large behaviour space (Cuccu and Gomez, 2011), and (ii) they are mostly unintelligible, undermining analysis and comprehension of the behaviour space exploration. We propose a new class of behaviour measures, systematically derived behaviour characterisations (SDBCs), that combine the advantages of task-specific and generic measures. The proposed measures are directly derived from a formal description of the task state. This way, we reduce the dependency on the experimenter’s knowledge about the task while, at the same time, obtain characterisations that are directly related to the task. In this paper, we apply SDBCs to robotics tasks, but the approach could potentially be generalised to other types of agent-based systems, as the formal task description resembles the SMART agent framework (d’Inverno et al., 2004). We augment our method with the inclusion of a weighting scheme for behaviour features, based on the estimated relevance of the features. The proposed measures are evaluated with novelty search in three simulated collective robotics tasks: resource sharing, gate escape, and predators-prey pursuit. We compare the proposed measures with behaviour characterisations defined based on task-specific knowledge. Related Work Task-specific distance measures Most previous works on behavioural diversity rely on behaviour characterisations designed specifically for the given task. These characterisations are composed of behavioural traits that the experimenter considers relevant for describing agent behaviour in the context of the given task. The behavioural distance then corresponds to the Euclidean distance between the characterisation vectors. Table 1 lists several examples of characterisations that have been used in previous ER studies. Analysing these characterisations, the following commonalities can be identified: • There is a strong focus on the spatial relationships between entities in the task environment (1, 2, 5, 6, 8, 9). • Characterisations often comprise only a small number of different behavioural traits (1, 3–5, 7–9). • Many characterisations focus on the final state of the environment (1, 3–5, 7–9), values averaged over an entire trial (7–9), or a single quantity sampled over time (2, 6). Generic distance measures Gomez (2009) proposed the use of generic measures for assessing behaviour similarity. In the proposed approach, action records for the agents are compared, using either the Hamming distance, relative entropy, or normalised compression distance (NCD). Doncieux and Mouret (2010) extended generic measures to evolutionary robotics, proposing the following BSMs: Hamming distance: Distance between the sequence of all the binary sensor and effector values of the agent sampled through time. DFT: A discrete Fourier transform is applied to the sensoreffector sequence, and the first coefficients are used to compute the distances between individuals. State count: Each possible sensor-effector state corresponds to one entry in a vector. Each entry contains the number of times the corresponding state was visited. Gomes and Christensen (2013) extended the Hamming distance and state count measures, making them applicable to multiagent systems and non-binary sensors and effectors. Common to all generic measures is that they rely exclusively on the sensor-effector states of the agents. While this design makes the measures generic and widely applicable, as any robotics experiment involves robots with sensors and effectors, it also represents their main weakness. Since there is no direct relationship between a given task and the generic behaviour characterisation, the behaviour space is typically very large, which can compromise the performance of diversity-based techniques (Cuccu and Gomez, 2011; Mouret, 2011). Additionally, the characterisations are mostly unintelligible, since they are not intrinsically related to observable characteristics of the agent’s behaviour. Mouret and Doncieux (2012) compared task-specific and generic characterisations in a comprehensive empirical study with a number of single-robot tasks. Doncieux and Mouret (2013) showed how different similarity measures (generic or task-specific) can be combined, by either switching between them throughout evolution or by calculating the behaviour distance based on all similarity measures. Novelty search To evaluate the proposed SDBCs, we use novelty search to evolve controllers for three distinct multirobot tasks. In novelty search (Lehman and Stanley, 2011), individuals are scored according to a novelty metric, instead of how well they perform a given task. The novelty metric quantifies how different an individual is from other, previously evaluated individuals with respect to behaviour. The metric relies on the mean behaviour distance (as given by the BSM) of that individual to the k nearest neighbours. Potential neighbours include the other individuals of the current population and a sample of individuals from previous generations stored in an archive. Candidates from sparse regions of the behaviour space therefore tend to receive higher novelty scores, generating a constant evolutionary pressure towards behavioural innovation. As novelty search is guided by behavioural innovation alone, its performance can be greatly affected by the size and shape of the behaviour space. In particular, behaviour spaces that are vast or contain dimensions not related with the task can cause novelty search to perform poorly (Cuccu and Gomez, 2011; Mouret, 2011; Gomes et al., 2012). To address this issue, we augment novelty search and include a fitness objective, as suggested in (Mouret, 2011; Mouret and Doncieux, 2012). Systematically Derived Behaviour Characterisations – SDBC In the analysis of the task-specific behaviour characterisations used in previous works, it can be observed that the characterisations are generally composed of relatively simple behavioural features (see Table 1). Based on these regularities, we formalise a workflow for the definition of behaviour characterisations. We show how such workflow can Table 1: Behaviour characterisations used in previous works in evolutionary robotics. The right-most column lists the lengths Sheet1 to the simulation length. of the characterisation vectors, with S denoting that the length is proportional Study (Lehman and Stanley, 2011a; Mouret and Doncieux, 2012; Mouret, 2011) (Lehman and Stanley, 2011a) (Trujillo et al., 2011) (Lehman and Stanley, 2011b) Task Characterisation Maze navigation Biped locomotion Homing navigation Virtual creature evolution Sequential light seeking (Mouret and Doncieux, 2012) Ball collecting robot Aggregation (Gomes et al., 2013) Recharging station sharing Predators vs prey pursuit (Gomes et al., 2014) Keepaway soccer Length 1. Final location of the robot 2 2. Robot trajectory S 3. Height, mass, number of joints 4. Whether each of the seven light switches was activated 5. Final position of the balls 6. Sampled mean distance to the centre of mass (and/or number of clusters) 7. Number of survivors, mean energy, (mean speed, mean distance to station) 8. Capture state, time to capture, final distance to prey, mean dispersion 9. Number and mean length of passes, game length, mean dispersion 3 7 8 S / 2S 2/4 4 4 Task state formalism For each simulation step Formal task state (1) Feature extraction Behaviour features samples (2) Sample aggregation Raw characterisation (3) Standardised characterisation (6) Standardisation coefficients (4) Weighted characterisation (7) Feature weights (5) Figure 1: Workflow of the SDBC approach for obtaining the behaviour characterisation of each individual. The steps below the dashed line are performed after the entire population is evaluated. See the text for details. be used to systematically derive behaviour characterisations with minimal dependence on the experimenter’s understanding of the task. The proposed workflow is summarised in Figure 1. The interface between the specific task and the derivation of the behaviour characterisations is accomplished through a formal description of the current state of the task (1) that should be specified by the experimenter. At each simulation step, a set of behaviour features is extracted from the formal task state (2). After the simulation has ended, the behaviour feature samples are combined to assemble a fixed-length raw characterisation vector (3). Based on all the raw characterisation vectors obtained in the current population, a set of standardisation coefficients is calculated (4), and optionally, a set of feature weights (5). The raw characterisations are then transformed with the standardisation coefficients (6) and feature weights (7). The behaviour distance between individuals is then given by the Euclidean distance between the respective transformed characterisation vectors. Below, we present the task description formalism and details on each step in the workflow. The task state formalism separates the specific task details from the method used to devise behaviour characterisations, thus reducing the dependence on the experimenter. The proposed formalism makes no distinction between agents and environmental features, both are treated equally as entities of the task. Each entity e ∈ Eκ is associated with a κ-tuple of state attributes (ϑ), and a tuple x with the constant properties of the entity. The tuple ϑ is composed of the properties of the entity that can change during task execution. To encompass multiagent tasks, we introduce the concept of entity group. An entity group g ∈ G can be formed by an arbitrary number of entities that share the same type and number (κ) of attributes. The cardinality (η) of a group can change during the task, and a single agent can constitute a group. The experimenter should provide the minimum (ηmin ) and maximum (ηmax ) size of each group. A task state is composed of (i) a list of entity groups, and (ii) a distance function fD . The function fD should measure or estimate the physical distance between any two entities. A task state T is thus defined by: T = hg1 , · · · , gN , fD i , gi ∈ G G = {he1 , · · · , eη i | ei ∈ Eκ ∧ η ∈ [ηmin , ηmax ]} Eκ = {hϑ, xi | ϑ ∈ Rκ } (1) fD : Eκ × Eκ0 → R Extraction of behaviour features At each time step, we automatically extract a set of behaviour features from the formal task state. These features correspond to a high-level description of the agents’ behaviour and environment’s state. They measure spatial relations between agents of the same entity group and between different groups, and the mean state of each group. Previous work (Gomes et al., 2013) has shown that averaging behaviour features over a group’s agents can lead to effective and scalable characterisations for multiagent systems. We defined the following behaviour features: • Size of each entity group, relative to the respective limits: Sg = |g| − ηming , g ∈ G ∧ ηmaxg > ηming ηmaxg − ηming • For each entity group, mean state of the entities: * + X ϑe [1] X ϑe [κ] ϑg = ,g ∈ G ,··· , |g| |g| e∈g e∈g (2) (3) • For each entity group, mean distance of each entity to the other entities of the same group (a measure of dispersion): Dg = X X ei ∈g ej ∈g,j6=i fD (ei , ej ) , g ∈ G ∧ |g| > 1 (4) (|g| − 1)2 • Mean pairwise distance between each two entity groups: R = hd(g1 , g2 ), · · · , d(g1 , gN ), · · · , d(gN −1 , gN )i X X fD (ei , ej ) (5) d(ga , gb ) = , a 6= b |g ||g | a b e ∈g e ∈g i a j b Aggregation of feature samples After a simulation has ended, the samples obtained for each behaviour feature at each time step are aggregated to assemble a fixed-length characterisation vector. Inspired by the task-specific characterisations used in previous work (see Table 1), a concatenation of the mean and final values of each behaviour feature is performed. The duration of the simulation is additionally included as a feature in the characterisation. Feature standardisation The behaviour characterisations can be composed of features that have different nature and thus have very distinct ranges. To overcome this disparity, the characterisations of the current population are standardised with the same set of coefficients at every generation. If a novelty archive exists, it also needs to be updated with those coefficients. Each behaviour feature k of a vector b is standardised according to: b0k = (bk − µk )/σk , (6) where µk and σk are respectively the mean and standard deviation of feature k. Feature weighting Previous work has shown that behaviour features weakly related with the task might be harmful (Gomes et al., 2013). We therefore propose and evaluate a method for weighting the behaviour features according to their estimated relevance to the task. Relevance is estimated based on mutual information feature selection (MIFS) (Battiti, 1994) — a machine learning feature selection algorithm. Mutual information is a quantitative measurement of how much one random variable tells us about another random variable. In the proposed approach, the relevance of each behaviour feature is estimated according to the mutual information between the feature values and the fitness scores of the individuals. Since the fitness score typically reflects the degree of fulfilment of a given task, this measure estimates the relevance of each behaviour feature with respect to the solution of the task. Each behaviour feature is assigned a weight equal to the mutual information estimate plus a minimum weight δ. Therefore, the higher the mutual information, the higher the impact of that behaviour feature in the distance measure. The added minimum feature weight guarantees that none of the behaviour features is completely ignored. Each feature k of a characterisation b is weighted according to: b0k = bk · [δ + I(F ; k)] , (7) where I(F ; k) is an estimate of the mutual information between the fitness scores (F ) and the behaviour feature k, and δ is the minimum feature weight. We set δ = 0.25 in all experiments, which is relatively small when compared to the typical mutual information scores of the more relevant features. Values of 0, 0.1 and 0.5 were also tested, but they yielded no improvements. Behaviour feature weights have to be periodically updated throughout evolution. For scalability purposes, we only use the current population to calculate the weights. The computational complexity associated with weights calculation could be further reduced by performing updates less frequently, every n generations, for instance. Experimental Setup We use three different tasks to evaluate the general applicability of our approach. The performance of SDBCs is compared with task-specific characterisations and fitness-based evolution. For the resource sharing task and predator-prey pursuit, we use task-specific characterisations that have been fine-tuned in previous works. In all tasks, the robots are homogeneous, i.e., the same neural network is copied to each robot of the group for evaluation. Each controller is evaluated in 10 simulations with randomised initial conditions. Gate escape task In this task, a group of robots must escape through a narrow gate that closes shortly after the first robot has passed. To solve the task successfully, the robots must first find the gate, and then wait for each other before starting to pass through the gate. The task is detailed in Figure 2 (top-left) and Table 2. The fitness function Fg is given by: Fg = g + t/τ , 1+N (8) where g is the number of robots that escaped through the gate, t is the simulation length, τ is the maximum simulation length, and N is the total number of robots. The taskspecific behaviour characterisation is a vector of length four comprising the following behavioural features (normalised to [0,1]): (i) number of escaped robots; (ii) time when the gate opened; (iii) mean distance to the gate; and (iv) mean dispersion of the robots. The task state Tg is composed of three entity groups: (i) the group of the robots that have still not passed through the gate; (ii) the gate; and (iii) the walls. Each robot has five attributes: its x and y position, turning speed, linear speed, and whether it is currently passing through the gate or not. The gate has one state variable, denoting whether it is closing or not. The surrounding walls are stateless. Robot sensor Gate sensor Wall sensor Gate Resource sharing Robot sensor Charging station Robot Robot 200cm Predator-prey pursuit 150cm Predators Resource sharing task In the resource sharing task (Gomes et al., 2013; Gomes and Christensen, 2013), a group of robots must coordinate in order to allow each member periodical access to a single battery charging station. The energy consumption varies with the motor speed, and the charging station can only hold one robot at a time. The task is detailed in Figure 2 (top-right) and Table 2. The fitness function Fs is given by: Fs = Gate escape s + e/emax , 1+N (9) where s is the number of surviving robots, e is the mean energy of the robots throughout the simulation, and N is the number of robots. The task-specific characterisation was proposed in (Gomes et al., 2013): a vector of length four, composed of: (i) the number of surviving robots; (ii) the mean energy of the robots; (iii) the mean movement speed; and (iv) the mean distance of the robots to the charging station. Each of these elements is normalised to [0, 1]. The task state Ts is composed by two entity groups: (i) the group of alive robots; and (ii) the charging station. Each robot has six attributes: its x and y position, turning speed, linear speed, current energy level, and whether it is currently charging. The charging station has a single state variable indicating whether it is currently charging a robot or not. Predator-prey pursuit In the predator-prey task, three predators have the objective of capturing a single prey, i.e., one predator should physically touch the prey. The predators can sense one another. The simulation ends if the prey escapes the chase zone. Only the predators’ controller is evolved, and the behaviour of the prey is preprogrammed: the prey moves away from nearby predators at full speed, and stops moving when it does not sense any predators. The task is detailed in Figure 2 (bottom) and Table 2. The fitness function Fp is given by: ( 2 − t/τ if prey captured Fp = , (10) max(di − df , 0)/size otherwise where t is the simulation length, τ is the maximum length, di is the mean initial distance from the predators to the prey, df Prey starting area Prey 100cm Prey vision Chase zone Figure 2: Initial simulation conditions. In the predators-prey task, the predator’s initial position is fixed. In the other two tasks, the robots are placed randomly in the environment. Table 2: Parameters of the tasks and the evolutionary Sheet1 setup. Gate escape task Gate location sensor 50 cm Wall detection sensors 4 x 5 cm Robot detection sensors 4 x 25 cm Nearby robot counter 25 cm Robot's max. speed 5 cm/s Gate close time 15 s Max. simulation length 200 s Predator-prey pursuit Prey location sensors ∞ Predator location sensors ∞ Predators' max. speed 5 cm/s Prey's escape distance 5 cm Prey's escape speed 7.5 cm/s Max. simulation length 60 s Resource sharing task Robot detection sensors 4 x 25 cm Station location sensor ∞ Charging sensor Energy level sensor Robot's max. speed 5 cm/s Maximum energy 500 u Energy consumption [5,10] u Station recharging rate 100 u/s Max. simulation length 100 s Genetic algorithm Crossover Gene mutation rate Tournament size Population size none 5% 5 200 Novelty search Novelty nearest k Add archive probability Maximum archive size 15 3% 1000 is the mean final distance, and size is the arena’s diagonal. The task-specific characterisation (Gomes et al., 2014) is a vector of length four, with all elements normalised to [0,1]: (i) whether the prey was captured or not; (ii) the simulation length; (iii) the mean final distance of the predators to the prey; and (iv) the mean distance of the predators to their centre of mass (dispersion) throughout the simulation. The task state Tp is composed of three entity groups: (i) the group of the predators; (ii) the prey; and (iii) the chase zone boundaries. Both the predators and the prey have the same attributes: x and y location, turning speed, and linear speed. The environment is stateless. Gate escape task Evolutionary setup 0.7 0.7 0.6 Fitness We used a canonical generic algorithm, where the neural network weights are directly encoded in the chromosomes. The parameters of the genetic algorithm and novelty search are listed in Table 2. All evolutionary treatments use the same parameters. The individuals are scored with a multiobjectivisation of novelty and fitness scores: at each generation, the individuals are sorted according to their Pareto front and crowding distance (Deb et al., 2002), considering the fitness and novelty objectives. 0.6 0.5 0.5 0.4 0.4 0.3 0 100 200 300 Generation 400 Fit 500 NSTS ● ● Relevance of behaviour features Following Equations 2–5, and the task descriptions presented in the Experimental Setup, a total of 10 behaviour features were extracted for the gate-escape task, 10 features for the resource sharing task, and 13 features for the predator-prey pursuit. After the feature sample aggregation process, this resulted in behaviour characterisations of lengths 21, 21, and 27, respectively. Since feature extraction is systematic, it is important to determine if the behaviour features can adequately characterise the behaviour of the individuals in the context of the given task. Table 3 lists the mutual information scores of the NS- SD ● 0.75 Fitness 0.6 ● 0.50 0.4 0.25 0.2 ● 0 200 400 Generation Fit 600 NST S NSS D+ NS- SD Predator-prey pursuit 1.6 1.0 ● 1.2 Fitness We compare fitness-driven evolution (Fit) to novelty search with the three behaviour characterisation approaches: taskspecific characterisations (NS-TS), SDBC with feature weighting (NS-SD+), and SDBC without weighting (NSSD). Figure 3 shows the highest fitness scores achieved with each approach, in each of the three tasks. The distribution of the highest fitness scores achieved by Fit displays a high variance, since all tasks have some degree of deception and Fit often converges to local optima. NS is unaffected by deception, and all variants achieve significantly higher fitness scores than Fit (Mann-Whitney U test, p-value < 0.05). The scores achieved by NS-TS are on average superior to NS-SD+ in the gate escape (p-value = 0.013) and resource sharing tasks (p-value = 0.025). The difference is, however, relatively small, and visual inspection of the solutions revealed no clear difference between the best controllers evolved by NS-TS and NS-SD+. Across the three tasks, the use of feature weighting never harms the performance of SDBCs, and NS-SD+ is on average superior to NS-SD. Significant differences between NSSD and NS-SD+ are, however, only present in the resource sharing task (p-value < 0.01). What makes NS-SD+ superior in this particular task is not evident, and additional experiments are needed to clarify the potential advantage provided by the weighting scheme. In the following sections, we analyse the weighting scheme and what impact it has on behaviour exploration. D+ Resource sharing task Results and Analysis Quality of the solutions NSS ● 0.8 0.5 0 200 400 Generation Fit NS-TS Fit 600 NS-SD+ NSTS NSS D+ NS- SD NS-SD Figure 3: Left: highest fitness scores found at each generation, averaged over 20 evolutionary runs for each method and task. Right: boxplots of the highest fitness scores found in each evolutionary run. The whiskers are the extreme values within 1.5 IQR and the dots are outliers. most relevant features for each task. It can be observed that some of the behaviour features match the features defined in the task-specific characterisations (highlighted in the table with a tick). The remaining features correspond to behavioural traits that are intuitively related with the fulfilment of the task. The relevance of each feature is also consistent across the multiple evolutionary runs, as indicated by the relatively small standard deviations of the means. Our results suggest that the mutual information between feature values and fitness scores is a good indicator of the relative relevance of each behaviour feature to task fulfilment. Furthermore, the analysis shows that the systematically derived characterisations include highly relevant behaviour features for the given tasks. This explains why the performance of novelty search with systematically derived Fit NS-TS NS-SD NS-SD+ Table 3: Mutual information (MI) between behaviour features and fitness scores, averaged over each evolutionary run (Mean MI). The standard deviation is shown in the SD MI column. Only the features with highest MI scores are shown. (F) marks features measured at the final state, while (M) marks features averaged over simulation time. The rightmost column indicates if a similar feature is present in the corresponding task-specific characterisation. Mean MI Feature SD MI In TS char. Gate escape task Gate is closing (F) Agent group size (F) Simulation length Agent group size (M) Gate is closing (M) Agent is passing gate (M) 2.37 1.85 1.46 1.43 1.39 0.81 0.05 0.03 0.04 0.03 0.04 0.04 X X Resource sharing task Agent energy level (M) Agent group size (F) Agent energy level (F) Simulation length Station is occupied (M) Agent is charging (M) 1.58 1.56 1.12 0.96 0.84 0.81 0.14 0.17 0.09 0.06 0.08 0.07 X X 0.05 0.01 0.08 0.03 0.02 X Figure 4: Average behaviour space exploration in the resource sharing task. The bigger the circles, the higher the exploration in that specific behaviour region. The behaviour region associated with the highest fitness scores is highlighted with a semicircle (bottom-middle). Predator-prey prey pursuit Predators-prey distance (F) Predators-prey distance (M) Predators dispersion (F) Prey speed (F) Prey-bounds distance (F) 1.47 0.98 0.66 0.57 0.48 X characterisations is very similar to novelty search with characterisations specifically designed for each task. Behaviour space exploration We analysed the exploration of the behaviour space to determine the underlying differences between the novelty search variants. The behaviour space was built with the SDBC features. We used a Kohonen map to reduce the dimensionality of the space for visualisation purposes. The resulting plots for the resource sharing task can be seen in Figure 4. The results for the other two tasks are similar. Fitness-based evolution typically explores only a narrow region of the behaviour space, which translates to premature convergence and in turn leads to an inferior performance. All novelty search variants explore the behaviour space more uniformly. The behaviour exploration in NS-SD+ follows a pattern similar to NS-TS, but with a slightly inferior focus on the high-fitness behaviour region (highlighted in the maps). Regarding the influence of the weighting scheme, it is clear that NS-SD+ spends more effort in the high-fitness region, when compared to NS-SD. The behaviour exploration of NS-SD is the most uniform since there are no bias towards specific behaviour dimensions. The absence of bias causes NS-SD to explore a behaviour region to which none of the other methods devoted significant effort (top-left corner in the maps). These results suggest that although there was no significant difference between NS-SD+ and NS-SD in terms of solutions’ quality (see Figure 3), the weighting scheme can actually focus behaviour exploration in the most relevant regions. Conclusion We proposed an approach for systematically deriving behaviour characterisations (SDBCs) for evolutionary robotics. The proposed approach relies on a formal description of the task state. Behaviour features are systematically extracted based on the state of the agents, their environment, and the spatial relationships between the physical entities of the task. We also proposed a feature weighting scheme that estimates the relevance of the extracted features, based on the mutual information between feature values and fitness scores. We demonstrated the proposed approaches with novelty search, using three different simulated collective robotics tasks. Our results showed that SDBCs are on par with taskspecific characterisations, with the advantage of relying less on the experimenter’s task-specific knowledge. The quality of the evolved solutions is similar, and the behaviour space exploration with task-specific characterisations was similar to SDBCs with the weighting scheme. Analysing the most relevant behaviour features present in SDBCs, we could observe that they either match features of the task-specific characterisation or correspond to behavioural traits that are highly related to solving the task. While the calculated relevance scores are in accordance with our understanding of the tasks, using these scores to weight the characterisations did not translate in a significant advantage in terms of the fitness scores achieved. Our results did, however, show that feature weighting helps focus the exploration on more relevant behaviour regions and more effort is spent in regions associated with high fitness scores. In light of our results, we consider that the proposed systematic approach represents a promising way of defining behaviour characterisations. SDBCs reduce the dependency on the experimenter’s intuition about the task, thus introducing fewer biases in behaviour exploration. Nevertheless, the systematically derived characterisations contain behaviour features that are highly related to the specific task, and can accurately capture the behaviour of the individuals. The approach is flexible and extensible, and can potentially accommodate the specific details of many tasks, possibly even outside the domain of embodied agents. Possible extensions of the proposed approach include: (i) extraction of additional features from the task state, e.g., by measuring inter-group relations between attributes of the same type; (ii) improved strategies for combining the behaviour feature samples obtained during task execution, e.g., through function approximation or time discretisation; and (iii) more elaborate weighting schemes, that could for example eliminate redundancy between behaviour features. Acknowledgements This research is supported by Fundação para a Ciência e Tecnologia (FCT) grants PEst-OE/EEI/LA0008/2013, PEst-OE/EEI/UI0434/2014, SFRH/BD/89095/2012 and EXPL/EEI-AUT/0329/2013. References Battiti, R. (1994). Using mutual information for selecting features in supervised neural net learning. Transactions on Neural Networks, 5(4):537–550. Cuccu, G. and Gomez, F. (2011). When novelty is not enough. In Applications of Evolutionary Computation, pages 234–243. Springer. Deb, K., Pratap, A., Agarwal, S., and Meyarivan, T. (2002). A fast and elitist multiobjective genetic algorithm: Nsga-ii. Transactions on Evolutionary Computation, 6(2):182–197. d’Inverno, M., Luck, M., and Luck, M. M. (2004). Understanding agent systems. Springer. Goldberg, D. E. and Richardson, J. (1987). Genetic algorithms with sharing for multimodal function optimization. In Conference on Genetic Algorithms, pages 41–49. Lawrence Erlbaum. Gomes, J. and Christensen, A. L. (2013). Generic behaviour similarity measures for evolutionary swarm robotics. In Genetic and Evolutionary Computation Conference, pages 199–206. ACM Press. Gomes, J., Mariano, P., and Christensen, A. L. (2014). Avoiding convergence in cooperative coevolution with novelty search. In International Conference on Autonomous Agents and Multi-agent Systems, pages 1149–1156. IFAAMAS. Gomes, J., Urbano, P., and Christensen, A. (2012). Progressive minimal criteria novelty search. In Ibero-American Conference on Artificial Intelligence, pages 281–290. Springer. Gomes, J., Urbano, P., and Christensen, A. L. (2013). Evolution of swarm robotics systems with novelty search. Swarm Intelligence, pages 115–144. Gomez, F. J. (2009). Sustaining diversity using behavioral information distance. In Genetic and Evolutionary Computation Conference, pages 113–120. ACM Press. Lehman, J. and Stanley, K. O. (2011). Abandoning objectives: Evolution through the search for novelty alone. Evolutionary Computation, 19(2):189–223. Moriguchi, H. and Honiden, S. (2010). Sustaining behavioral diversity in neat. In Genetic and Evolutionary Computation Conference, pages 611–618. ACM Press. Mouret, J.-B. (2011). Novelty-based multiobjectivization. In New Horizons in Evolutionary Robotics, pages 139–154. Springer. Mouret, J.-B. and Doncieux, S. (2009). Overcoming the bootstrap problem in evolutionary robotics using behavioral diversity. In Congress on Evolutionary Computation, pages 1161–1168. IEEE Press. Mouret, J.-B. and Doncieux, S. (2012). Encouraging behavioral diversity in evolutionary robotics: an empirical study. Evolutionary Computation, 20(1):91–133. Nelson, A. L., Barlow, G. J., and Doitsidis, L. (2009). Fitness functions in evolutionary robotics: A survey and analysis. Robotics and Autonomous Systems, 57(4):345–370. Nolfi, S. and Floreano, D. (2000). Evolutionary Robotics: The Biology, Intelligence, and Technology. MIT Press. Ollion, C. and Doncieux, S. (2011). Why and how to measure exploration in behavioral space. In Genetic and Evolutionary Computation Conference, pages 267–274. ACM Press. Savage, T. (2004). Measurement and the explanation of adaptive and novel behaviors in real and artificial creatures. Cognitive Systems Research, 5(1):3–39. Doncieux, S. and Mouret, J.-B. (2010). Behavioral diversity measures for evolutionary robotics. In Congress on Evolutionary Computation, pages 1–8. IEEE Press. Trujillo, L., Olague, G., Lutton, E., De Vega, F. F., Dozal, L., and Clemente, E. (2011). Speciation in behavioral space for evolutionary robotics. Journal of Intelligent & Robotic Systems, 64(3-4):323–351. Doncieux, S. and Mouret, J.-B. (2013). Behavioral diversity with multiple behavioral distances. In Congress on Evolutionary Computation, pages 1427–1434. IEEE Press. Whitley, L. D. (1991). Fundamental principles of deception in genetic search. In Foundations of Genetic Algorithms, pages 221–241. Morgan Kaufmann.
9cs.NE
arXiv:1604.06777v1 [cs.CE] 24 Mar 2016 Global sensitivity analysis with 2D hydraulic codes: application on uncertainties related to high resolution topographic data M. Abily∗, O. Delestre†, P. Gourbesville‡, N. Bertrand§, C.-M. Duluc¶ and Y. Richetk March 24, 2018 Abstract Technologies such as aerial photogrammetry allow production of 3D topographic data including complex environments such as urban areas. Therefore, it is possible to create High Resolution (HR) Digital Elevation Models (DEM) incorporating thin above ground elements influencing overland flow paths. Even though this category of big data has a high level of accuracy, there are still errors in measurements and hypothesis under DEM elaboration. Moreover, operators look for optimizing spatial discretization resolution in order to improve flood models computation time. Errors in measurement, errors in DEM generation, and operator choices for inclusion of this data within 2D hydraulic model, might influence results of flood models simulations. These errors and hypothesis may influence significantly flood modelling results variability. The purpose of this study is to investigate uncertainties related to (i) the own error of high resolution topographic data, and (ii) the modeller choices when including topographic data in hydraulic codes. The aim is to perform a Global Sensitivity Analysis (GSA) which goes through a MonteCarlo uncertainty propagation, to quantify impact of uncertainties, followed by a Sobol’ indices computation, to rank influence of identified parameters on result variability. A process using a coupling of an environment for parametric computation (Prométhée) and a code relying on 2D shallow water equations (FullSWOF 2D) has been developed (P-FS tool). The study has been performed over the lower part of the Var river valley using the estimated hydrograph of 1994 flood event. HR topographic data has been made available for the study area, which is 17.5 km2 , by Nice municipality. Three uncertain parameters were studied: the measurement error (var. E), the level of details of above-ground element representation in DEM (buildings, sidewalks, etc.) (var. S), and the spatial discretization resolution (grid cell size for regular mesh) (var. R). Parameter var. E follows a probability density function, whereas parameters var. S and var. R. are discrete operator choices. Combining these parameters, a database of 2, 000 simulations has been produced using P-FS tool implemented on a high performance computing structure. In our study case, the output of interest is the maximal ∗ Polytech’Nice Sophia & URE Innovative-CiTy, University of Nice Sophia Antipolis, France, e-mail : [email protected] † Lab. J.A. Dieudonné & EPU Nice Sophia, University of Nice, France, e-mail : [email protected] ‡ Polytech’Nice Sophia & URE Innovative-CiTy, University of Nice Sophia Antipolis, France § Institut de Radioprotection et de Sûreté Nucléaire (IRSN), PRP-DGE, SCAN, BEHRIG, France, e-mail : [email protected] ¶ Institut de Radioprotection et de Sûreté Nucléaire (IRSN), PRP-DGE, SCAN, BEHRIG k Institut de Radioprotection et de Sûreté Nucléaire (IRSN), PSN-EXP, SNC, France 1 water surface reached during simulations. A stochastic sampling on the produced result database has allowed to perform a Monte-Carlo approach. Sensitivity index have been produced at given points of interest, enhancing the relative weight of each uncertain parameter on variability of calculated overland flow. Perspectives for Sobol index maps production are put to the light. Keywords Global sensitivity analysis; photogrammetry; 2D numerical modelling; urban flooding; Sobol index. 1 Introduction To understand or predict surface flow properties during an extreme food event, models based on 2D Shallow Water Equations (SWEs) using high resolution description of the environment are commonly used in practical engineering applications. In that case, the main role of hydraulic models is to finely describe overland flow maximal water depth reached at some specific points or area of interest. In complex urban environment, above ground surface features have a major influence on overland flow path, their implementations (buildings, walls, sidewalks) in hydraulic model are therefore required as shown in [Abily et al., 2013a; Abily et al., 2013b]. The representation of details surface features within models can be achieved through the use of High Resolution Digital Elevation Models (HR DEMs). Geomatics community intensively uses urban reconstruction relying on airborne topographic data gathering technologies such as imagery and Light Detection and Ranging (LiDAR) scans to produce HR DEM [Musialski et al., 2013]. These technologies allow producing DEM with a high accuracy level [Lafarge et al., 2010; Lafarge and Mallet, 2011; Mastin et al., 2009]. Moreover, modern technologies, such as Unmanned Aerial Vehicle (UVA) use, make high resolution LiDAR or imagery born data easily affordable in terms of time and financial investments [Remondino et al., 2011; Nex and Remondino, 2013]. Consequently, hydraulic numerical modelling community increasingly uses HR DEM information from airborne technologies to model urban flood [Tsubaki and Fujita, 2010]. Among HR topographic data, photogrammetry technology allows the production of 3D classified topographic data [Andres, 2012]. This type of data is useful for surface hydraulic modelling community as it provides classified information on complex environments. It gives the possibility to select useful information for a DEM creation specifically adapted for flood modelling purposes [Abily et al., 2013b]. Even though HR classified data have high horizontal and vertical accuracy levels (in a range of few centimeters), this data set is assorted of errors and uncertainties. Moreover, in order to optimize models creation and numerical computation, hydraulic modellers make choices regarding procedure for this type of dataset use. These sources of uncertainties might produce variability in hydraulic flood models outputs. Addressing models output variability related to model input parameters uncertainty is an active topic which is one of the main concern for practitioners and decision makers involved in assessment and development of flood mitigation strategies [ASN, 2013]. To tackle a part of the uncertainty in modelling approaches, practitioners are developing methods which enable to understand and reduce results variability related to input parameters uncertainty such as Global Sensitivity Analysis (GSA) [Herman et al., 2013; Iooss, 2011]. A GSA aims to quantify the output uncertainty in the input factors, given by their uncertainty range and distribution [Nguyen et al., 2015]. To do so, the deterministic code (2D hydraulic code in our case) is considered as a black box model as described in [Iooss, 2011]: f : Rp → R X 7→ Y = f (X) 2 (1) where f is the model function, X = (X1 ; ...; Xp ) are p independent input random variables with known distribution and Y is the output random variable. The principle of GSA method relies on estimation of inputs variables variance contribution to output variance. An unique functional analysis of variance (ANOVA) decomposition of any integral function into a sum of elementary functions allows to define the sensitivity indices as explained in [Iooss, 2011]. Sobol’s indices are defined as follow: Si = V ar [E(Y |Xi )] /V ar(Y ). (2) First-order Sobol index indicates the contribution to the output variance of the main effect of each input parameters. The production of Sobol index spatial distribution map is promising. Moreover, such maps have been done in other application fields such as hydrology, hydrogeology and flood risk cost estimation [Saint-Geours, 2012]. GSA process most generally goes through uncertain parameters definition, uncertainty propagation and results variability study. Such type of approach has been applied at an operational level in 1D hydraulic modelling studies by public institutions and consulting companies [Nguyen et al., 2015]. For 2D free surface modelling, GSA approach is still at an exploratory level. Indeed, GSA requires application of a specific protocol and development of adapted tools. Moreover, it requires important computational resources. The purpose of this study is to investigate on uncertainties related to HR topographic data use for hydraulic modelling. Two categories of uncertain parameters are considered in our approach: the first category is inherent to HR topographic data internal errors (measurement errors) and the second category is related to operator choices for this type of data inclusion in 2D hydraulic codes. This paper presents the results of an applied GSA approach performed over a 2D flood river event modelling case. The aim of our study is to rank the impact of uncertainties related to HR topographic use. To achieve this aim, a protocol and a tool for GSA application to 2D hydraulic codes have been developed. Input parameters considered as introducing uncertainty are chosen and a probability distribution is attributed to each uncertain input parameters. A Monte-Carlo uncertainty propagation is then carried out, uncertainties are quantified and the influence of selected input parameters are ranked by the computation of the Sobol indices. Section 2 introduces the data and methodology used and followed. Then, section 3 presents the first results, main outcomes and perspectives. 2 2.1 Material and methods Flood event scenario The 5th of November 1994, an intense rainfall event occurred in the Var catchment (France), leading to serious flooding in the low Var river valley [Lavabre et al., 1996]. For our study, hydraulic conditions of this historical event were used as a framework for a test scenario. The study area has been restricted to the last five kilometers of the low Var valley. Since 1994, the urban area has changed a lot, as levees, dikes and urban structures have been intensively constructed and it has to be reminded that the objective here was not to reproduce the flood event itself. For the GSA approach, the hydraulic parameters of the model are set identically for the simulations (as described below), only the input DEM changes from one simulation to another following the strategy defined in next section. The 2D hydraulic code is FullSWOF 2D [Delestre et al., 2014a; Delestre et al., 2014b]. FullSWOF 2D relies on 2D SWEs and uses a finite volume approach over a regular Cartesian grid. An estimated hydrograph of the 5th of November 1994 flood event as described in 3 [Guinot and Gourbesville, 2003] is used as the upstream boundary condition of the low Var river valley. To shorten the simulation length, we chose to run a constant 1, 500 m3 .s−1 discharge for 3 hours, to reach a steady state with a water level in the riverbed just half a meter below the elevation of the flood plain. The reached steady state is used as an initial condition (or hot start) for the other simulations. For the GSA simulations the unit hydrograph is then run until the estimated peak discharge (3, 700 m3 .s−1 ) and decreases until a significant diminution of the overland flow water depth is observed. The Manning’s friction coefficient n is spatially uniform on overland flow areas with a standard value of 0.015 which corresponds to a concrete surfacing. No energy loss properties have been included in the 2D hydraulic model to represent the bridges, piers or weirs. Downstream boundary condition is an open sea level with a Neumann boundary condition. For our application, the 3D classified data of the low Var river valley is used to generate specific DEM adapted to surface hydraulic modelling. 2.2 Photo-interpreted high resolution topographic data of the low Var valley Aerial Photogrammetry technology allows to measure 3D coordinates of a surface and its features using 2D pictures taken from different positions. The overlapping between pictures allows calculating, through an aerotriangulation calculation step, 3D properties of space and features based on stereoscopy principle [Egels and Kasser, 2004; Lu and Weng, 2007]. Photointerpretation allows creation of vectorial information based on photogrammetric dataset. The 3D classification of features based on photo-interpretation allows getting 3D high resolution topographic data over a territory offering large and adaptable perspectives for its exploitation for different purposes [Andres, 2012]. A photo-interpreted dataset is composed of classes of points, polylines and polygons digitalized based on photogrammetric data. Important aspects in the photo-interpretation process are classes’ definition, dataset quality and techniques used for photo-interpretation. Both will impact the design of the output classified dataset [Lu and Weng, 2007]. A HR photogrammetric 3D classified data gathering campaign has been held in 2010 − 2011 covering 400 km2 of Nice municipality [Andres, 2012]. Aerial pictures have a pixel resolution of 0.1 m at the ground level. Features have been photo-interpreted by human operators under vectorial form in 50 different classes. These classes of elements include large above ground features such as building, roads, bridges, sidewalks, etc.. Thin above ground features (like concrete walls, road-gutters, stairs, etc.) are included in classes. An important number of georeferencing markers were used (about 200). Globally, over the whole spatial extent of the data gathering campaign, mean accuracy of the classified data is 0.3 m and 0.25 m respectively in horizontal and vertical dimension. For the low Var river valley area, a low flight elevation combined with a high level of overlapping among aerial pictures (80%), have conducted to a higher level of accuracy. In the low Var river valley sector, classified data mean horizontal and vertical mean accuracy is 0.2 m. This mean error value encompasses errors, due to material accuracy limits, to bias and to nuggets, which occurs within the photogrammetric data. For this data set, errors in photo-interpretation are estimated to represent 5% of the total number of elements. This percentage of accuracy represents errors in photo-interpretation, which results from feature misinterpretation, addition or omission. To control and ensure both, average level of accuracy and level of errors in photo-interpretation, the municipality has carried out a terrestrial control of data accuracy over 10% of the domain covered by the photogrammetric campaign. 4 2.3 Global Sensitivity Analysis A GSA method quantifies the influence of uncertain input variables on the variability in numeric models outputs. To implement a GSA approach, it is necessary (i) to identify inputs and assess their probability distribution, (ii) to propagate uncertainty within the model (e.g. using a Monte Carlo approach) and (iii) to rank the effects of input variability on the output variability through functional variance decomposition method such as calculation of Sobol indices (eq. 1). 2.3.1 Uncertain input parameters To encompass uncertainty related to measurement error in HR topographic dataset, Var. E is considered. Two other uncertain parameters are also considered as modeller choices: the level of details of above-ground elements included in DEM (Var. S), and the spatial discretization resolution (Var R). Parameters Var. S, E and R are independent parameters considered as described below. Var. E: measurement errors of HR topographic dataset – In each cell of the DEM having the finest resolution (1 m), this parameter introduces a random error. For our study, only the altimetry errors are taken into account as the planimetric dimension of the error is assumed to be relatively less significant for hydraulic study purpose compared to altimetry error. This altimetry measurement error follows a Gaussian probability density function N (0; 0.2), where the standard deviation is equal to the mean global error value (0.2 m). This error introduction is spatially homogeneous. This approach is a first approximation: mean error could be spatialized in different sub-areas having physical properties, which would impact spatial patterns of error value. Moreover, errors in photo-interpretation (classification) are not considered in our study. One hundred grids of random errors are generated and named E1 to E100. Var. S: modeller choices for DEM creation – This parameter represents modeller choices for DEM creation, taking advantage of selection possibilities offered by above described classified topographic data. Four discrete schemes are considered: (i) S1, is the DTM of the study case, (ii) S2, the elevation information of buildings added to S1, (iii) S3 the elevation information of walls added to S2, and (iv) S4, elevation information of concrete features in streets added to S3. Var. S parameter is included in the SA as a categorical ordinal parameter. These discrete modeller choices are considered as having the same probability. Four DEMs are generated at resolution 1 m, S1 to S4. Var. R: modeller choices for mesh spatial resolution – When included in 2D models, HR DEM information is spatially and temporally discretized. FullSWOF is based on structured mesh, therefore the DEM grid can be directly included as a computational grid without effort for mesh creation. Nevertheless, for practical application, optimization of computational time/accuracy ratio often goes through a mesh degradation process when a HR DEM is used. Var. R represents modeller choices, when decreasing regular mesh resolution. Var. R parameter takes 5 discrete values : 1, 2, 3, 4 or 5 m. 2.3.2 Applied protocol for uncertainty propagation To create the HR DEMs, the following approach has been carried out. A HR DTM using multiple ground level information sources (points, polygons and polylines) is created and provided at a 0.5 m resolution by The GIS Department of Nice Côte d’Azur Metropolis (DIGNCA). The HR DEM resolution is degraded to 1 m resolution. At this resolution the number of mesh cells is above 17.8 million. Then, a selection procedure among classified data is performed. This selection is achieved by considering concrete elements which can 5 influence overland flow drainage path only. It includes dikes, buildings, walls and ”concrete” above ground elements (such as sidewalks, road gutters, roundabout, doors steps, etc.). 12 classes are selected among the 50 classes of the 3D photo-interpreted dataset. During this step, polylines giving information on elevated roads and bridges, which might block overland flow paths, are removed. The remaining total number of polylines is 52, 600. Selected above-ground features are aggregated in 3 groups of features (buildings, walls and concrete street features). Extruding elevation information of selected polylines groups on the DTM (S1), four 1 m resolution DEMs, S1 to S4, are produced. The previously described method has allowed inclusion of thin elements impacting flow behavior of infra-metric dimension, oversized to metric size, in the 1 m resolution regular mesh. Then, 100 grids of var. E are produced and added to var. S1, S2, S3 and S4 at resolution 1 m. These 400 DEMs are used to create 2, 000 DEMs with a resolution from 1 to 5 m. DEMs are named SmRnEx, with the parameters m between [1; 4], n between [1; 5] and x between [1; 100]. These DEMs are used in the coupled parametric environment (Prométhée) – 2D hydraulic code (FullSWOF 2D) through parameterization of the input file, and integrated in whole GSA as summed up in Figure 1. Prométhée-FullSWOF (P-FS) is presented in more detail in next section 2.3.3 Operational tool and setup developed for uncertainty analysis and Sobol index mapping To apply a GSA with 2D Hydraulic models, a coupling between Prométhée a code allowing a parametric environment of other codes, has been performed with FullSWOF 2D, a two-dimensional SWE based hydraulic code. The coupling procedure has taken advantage of previous coupling experience of Prométhée with 1D SWE based hydraulic code [Nguyen et al., 2015]. The coupled code Prométhée-FullSWOF (P-FS) has been performed on a HPC computation structure. The aim was to use tool for a proof of concept of protocol application requiring extensive computational resources. FullSWOF 2D – FullSWOF 2D (Full Shallow Water equation for Overland Flow in 2 dimensions) is a code developed as a free software based on 2D SWE [Delestre et al., 2014a]. In FullSWOF 2D, the 2D SWE are solved thanks to a well-balanced finite volume scheme based on the hydrostatic reconstruction. The finite volume scheme, which is suited for a system of conservation low, is applied on a structured spatial discretization, using regular Cartesian mesh. For the temporal discretization, a variable time step is used based on the CFL criterion. The hydrostatic reconstruction (which is a well-balanced numerical strategy) allows to ensure that the numerical treatment of the system preserves water depth positivity and does not create numerical oscillation in case of a steady states, where pressures in the flux are balanced with the source term here (topography). Different solvers can be used HLL, Rusanov, Kinetic, VFROE combined with first order or second order (MUSCL or ENO) reconstruction. FullSWOF 2D is an object oriented software developed in C++. Two parallel versions of the code have been developed allowing to run calculations under HPC structures [Cordier, S. et al., 2013]. Prométhée-FullSWOF – Prométhée software is coupled with FullSWOF 2D. Prométhée is an environment for parametric computation, allowing to carry out uncertainties propagation study, when coupled to a code. This software is an open source environment developed by IRSN (http://promethee.irsn.org/doku.php). The main interest of Prométhée is the fact that it allows the parameterization of any numerical code. Also, it is optimized for intensive computing resources use. Moreover, statistical post-treatment can be performed using Prométhée as it integrates R statistical computing environment [Ihaka, 1998]. The coupled code Prométhée/FullSWOF (P-FS) is used to automatically launch parameterized 6 computation through R interface under Linux OS. A graphic user interface is available under Windows OS, but in case of large number of simulation launching, the use of this OS has shown limitations as described in [Nguyen et al., 2015]. A maximum of 30 calculations can be run simultaneously, with the use of 30 daemons. Figure 1: Implemented GSA approach. Once simulations were completed with P-FS, GSA analysis has been carried out. First, the convergence of the results, in other word it has been checked that the number of simulations is large enough to generate a representative sample of the uncertainties associated to the studied source. Then uncertainties analysis was conducted, followed by the calculation of Sobol indices. The selected output of interest is the overland flow water surface elevation (hmax + z). 3 3.1 Results and discussion Operational achievement of the approach A performed version of P-FS couple allows to run simulations with selected set of input parameters (Var. E, S and R). The coupled tool is operational on the Mésocentre HPC computation center and P-FS would be transposable over any common high performance computation cluster, requiring only slight changes in the coupling part of the codes. Through the use of R commands, it is possible to launch several calculations. Using Daemons, up to 30 simulations can be launched at a time. The calculations running time of our simulation is significant. Indeed, this computation time is highly dependent of mesh resolution as the dx 7 will directly impact the CFL dependent dt. Over a 12 cores node of the Mésocentre HPC, the computation time is 2, 6, 12, 24, 80 hours respectively for 5, 4, 3, 2, 1 m resolution grids. Using about 400, 000 CPU hours, it has been possible to run 1, 500 simulations. Out of these 1, 500 simulations, few runs (about 30) have shown numerical errors leading to computational crash. These simulations have been removed from our set of simulations used to carry out the GSA. This will be clarified in future work, but errors are possibly due to numerical instabilities generated by important topographic gradient change at the boundary condition. This first data set of output allows us to carry out a first UA and GSA. The remaining 500 simulations are mainly for R1 and R2 resolutions, which are the most resource-demanding simulations, and will be run in a close future using more than one HPC node per each run to decrease running time. Figure 2: Illustration of hmax value for two given simulations where Var. S changes. The variable of interest is the maximal water surface elevation (hmax + z) reached during a given simulation at different locations, with hmax the maximal water depth reached at the point of interest and z the DEM surface elevation at this point. The figure 2 illustrates the difference of hmax + z obtained between two simulations when Var. S varies. At different points of interest (see next section) difference in hmax + z value can be significant. The analyses carried out over 40 points of interests, highlight the influence of the selected variables. For example, for a given scenario when only Var. E varies, an up to 0.5 m difference in hmax + z can be observed. Between all the 1, 500 scenarios a maximal difference of 1.26 m in hmax + z estimation at one of the point of interest is observed. 3.2 Local results for a point of interest In the first place, a local analysis of the influence of topographic parameters has been achieved; 40 points of interest have been selected and used for the analyses. 8 The convergence for Var. E has been analyzed for the different points. As illustrated by figure 3(a), it appears that the distribution and the standard deviations of hmax + z, become stable with a sample size (N ) of Var. E is around 40 to 50. This gives qualitatively a first idea of what should be the minimum size of sample N of Var. E to allow performing reliable statistical analysis with an acceptable level of convergence. To strengthen these findings, tests of convergence have been performed observing the evolution of mean hmax +z value and the 95% confidence interval (CI) when N size increases. Figure 3(b) shows this result for a given point of interest. The analysis shows the sample size is above 30, the mean and the CI become stable. It has to be noticed that similar results are obtained with the other selected points of interest, 30 to 40 realizations are sufficient to generate a representative sample of the uncertainties associated to the Var. E. Figure 3: (a): Illustration of hmax + z distribution and (b) convergence of mean and CI with fixed Var. S and Var. R when increasing sample of size of Var. E. When looking at the output variable of interest hmax + z, it is relevant to check its distribution behavior for a fixed value of one of the two discrete input parameters (Var. R or Var. S). This has been done with a subset of sample N Var. E equal to 50 for each discrete value of non fixed variables Var. R and Var. S (figure 4). This approach helps to make a qualitative description of the output distribution behavior relatively to the non fixed parameters. This test has been carried out for 40 different points of interest. Figure 4 illustrates the main observations which can be effectuated using different distribution plots for fixed Var. R or for fixed value of Var. S. Results show that for a given value of Var. R, Var. E impact over variability of hmax + z is relatively less significant than the impact of Var. S (discrete choices). It has also been observed that increasing the level of geometric details included in DEM (Var. S) will not involve linear variations in hmax + z values. Indeed, detailed above ground feature implementation lead to more local effects in terms of overland flow path modification and consequently, highly impact local hmax + z values. When focusing on hmax + z distribution for varying discrete mesh resolution (Var. R) for a given fixed Var. S value (figure 4), it is observed that, comparatively to effect of Var. E in output distribution, the influence generated by Var. R on hmax + z values is negligible. This finding does not consider the finest Var. R (1 m) as less than 50 realizations of Var. E were available so far with these resolutions. The final step of the GSA approach calculates the Sobol indices (Figure 5). As mentioned 9 Figure 4: Output (hmax + z) distribution plots at two points of interest with one fixed value (either Var. S or Var. R). previously Var. R1 has not been considered for the calculation. The parameter which influences the most hmax + z is Var. S. Concerning the Sobol indices, it has to be mentioned that the sum of Sobol indices should be one, in our case the sum is smaller than one. Similar results have been highlighted by [Iooss, 2011]. This finding is due to the parameters cross variation. Moreover the inclusion of results at the highest resolution (1 m) might increase the cross variation effects. These promising results for analysis are already useful and further analysis to observe cross variation effects as well as spatial variation of Sobol index are in progress. So far it can be observed that 32 of the 40 points of interest have Var. S with the highest Sobol index and 8 points have Var. R with the highest Sobol index. These two parameters are modeller choices. In the 32 cases where Var. S has the highest Sobol Index, 50% of the points have Var. R in the second rank and 50% Var. E. 3.3 Perspectives and analyze for further work One of the main advantages of two-dimensional hydraulic models is their spatial distribution over the area modeled. Therefore, uncertainties related to topography variability can be spatially represented for the Var river valley. Sobol index maps are presented in figure 6 over a sub-area. In a near future and integrate cross variation effect. Nevertheless, as it has been mentioned, our representation of Var. E, using a spatially uniform distribution function of average measurement error is a first simple approximation. Indeed, the average error is a spatially varying function of physical properties (slope notably). Assigning differents spatially varying parameters of Var. E distribution function would be a more sophisticated approach. Moreover, errors in photo-interpretation, which will spatially impact Var. S, deserve to be investigated as well. 10 Figure 5: First-order Sobol indices for two selected points. 4 Conclusions In this study, a GSA is performed based on Sobol sensitivity analysis to quantify the uncertainties related to high resolution topography data inclusion in two-dimensional hydraulic model. Input parameters considered in the study encompass both measurement errors, and modeller choices for high resolution topographic data used in models. The applied GSA method relies (i) on the use of a specific tool coupling a parametric environment with a 2D hydraulic modelling tool Prométhée-FullSWOF 2D, and (ii) on the use of high performance computation resources. The implemented approach is able to highlight the uncertainties generated by topography parameters and operator choices when including high resolution data in hydraulic models. 1, 500 simulations have been effectuated at this stage of the study. Convergence of the approach is checked and output distribution analyzed for qualitative apprehension of input parameters local effects on maximal computed overland flow (hmax + z). The major source of uncertainty related to water elevation hmax + z is the modeller choice Var. S which is the choice of operator regarding above ground features included in DEM used for hydraulic simulation. Errors related to measurement Var. E significantly impact variability of hmax +z model outputs but in a relatively smaller extent. Regarding Var. R, further investigations will be undertaken when more realizations will be available. Overall, these results confirm the relative importance of the uncertainty in topography input data. The main limits of the approach are concerning the way Var. E and Var. S are integrated in the analysis. Future work will be focused on the design of Sobol map index over the whole flood extent. 11 Figure 6: Sobol index maps over 150 m long per 200 m large part of the domain. 12 Acknowledgments Photogrammetric and photo-interpreted dataset used for this study have been kindly provided by Nice Côte d’Azur Metropolis for research purpose. Technical expertise on DIGNCA dataset has been provided by G. Tacet and F. Largeron. This work was granted access to the HPC resources of Aix-Marseille Université financed by the project Equip@Meso (ANR-10EQPX-29-01) of the program ”Investissements d’Avenir” supervised by the Agence Nationale pour la Recherche. Technical support for codes adaptation on high performance computation centers has been provided by T. Nguyen, J. Brou, F. Lebas., H. Coullon and P. Navarro. References [Abily et al., 2013a] Abily, M., Duluc, C. M., Faes, J. B., and Gourbesville, P. (2013a). Performance assessment of modelling tools for high resolution runoff simulation over an industrial site. Journal of Hydroinformatics, 15(4):1296–1311. [Abily et al., 2013b] Abily, M., Gourbesville, Andres, L., and Duluc, C.-M. (2013b). Photogrammetric and LiDAR data for high resolution runoff modeling over industrial and urban sites. In Zhaoyin, W., Lee, J. H.-w., Jizhang, G., and Shuyou, C., editors, Proceedings of the 35th IAHR World Congress, September 8-13, 2013, Chengdu, China. Tsinghua University Press, Beijing. [Andres, 2012] Andres, L. (2012). L’apport de la donnée topographique pour la modélisation 3d fine et classifiée d’un territoire. Revue XYZ, 133 - 4e trimestre:24–30. [ASN, 2013] ASN (2013). Protection of Basic Nuclear Installations Against External Flooding - guide no.13 - version of 08/01/2013. Technical report, Autorité de Sûreté Nucléaire. [Cordier, S. et al., 2013] Cordier, S., Coullon, H., Delestre, O., Laguerre, C., Le, M. H., Pierre, D., and Sadaka, G. (2013). FullSWOF Paral: Comparison of two parallelization strategies (MPI and SkelGIS) on a software designed for hydrology applications. ESAIM: Proc., 43:59–79. [Delestre et al., 2014a] Delestre, O., Cordier, S., Darboux, F., Du, M., James, F., Laguerre, C., Lucas, C., and Planchon, O. (2014a). FullSWOF: A software for overland flow simulation. In Gourbesville, P., Cunge, J., and Caignaert, G., editors, Advances in Hydroinformatics, Springer Hydrogeology, pages 221–231. Springer Singapore. [Delestre et al., 2014b] Delestre, O., Darboux, F., James, F., Lucas, C., Laguerre, C., and Cordier, S. (2014b). FullSWOF: A free software package for the simulation of shallow water flows. Research report, MAPMO, université d’Orléans ; Institut National de la Recherche Agronomique. 38 pages. [Egels and Kasser, 2004] Egels, Y. and Kasser, M. (2004). Digital Photogrammetry. Taylor & Francis. [Guinot and Gourbesville, 2003] Guinot, V. and Gourbesville, P. (2003). Calibration of physically based models: back to basics? Journal of Hydroinformatics, 5(4):233–244. [Herman et al., 2013] Herman, J., Kollat, J., Reed, P., and Wagener, T. (2013). Technical note: Method of Morris effective reduces the computational demands of global sensitivity analysis for distributed watershed models. Hydrology and Earth System Sciences, 17:2893– 2903. 13 [Ihaka, 1998] Ihaka, R. (1998). R: Past and future history. A Draft of a Paper for Interface ’98. [Iooss, 2011] Iooss, B. (2011). Revue sur l’analyse de sensibilité globale de modèles numériques. Journal de la Société Française de Statistique, 152(1):1–23. [Lafarge et al., 2010] Lafarge, F., Descombes, X., Zerubia, J., and Pierrot-Deseilligny, M. (2010). Structural approach for building reconstruction from a single DSM. Trans. on Pattern Analysis and Machine Intelligence, IEEE, 32(1):135–147. [Lafarge and Mallet, 2011] Lafarge, F. and Mallet, C. (2011). Building large urban environments from unstructured point data. In Computer Vision (ICCV), 2011 IEEE International Conference, volume 0, pages 1068–1075, Los Alamitos, CA, USA. IEEE Computer Society. [Lavabre et al., 1996] Lavabre, J., Mériaux, P., Nicoletis, E., and Cardelli, B. (1996). La crue catastrophique du Var du 5 novembre 1994/ Catastrophic Var river flood of 5 november 1994. In Convegno internazionale la prevenzione delle catastrofi idrogeologichi il contributo della ricerca scientifica, Alba, ITA, 5-7 nivembre 1996. 5 pages. [Lu and Weng, 2007] Lu, D. and Weng, Q. (2007). A survey of image classification methods and techniques for improving classification performance. International Journal of Remote Sensing, 28(5):823–870. [Mastin et al., 2009] Mastin, A., Kepner, J., and Fisher, J. I. (2009). Automatic Registration of LIDAR and Optical Images of Urban Scenes. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 2639–2646. [Musialski et al., 2013] Musialski, P., Wonka, P., Aliaga, D. G., Wimmer, M., van Gool, L., and Purgathofer, W. (2013). A survey of urban reconstruction. Computer Graphics Forum, 32(6):146–177. [Nex and Remondino, 2013] Nex, F. and Remondino, F. (2013). UAV for 3D mapping applications: a review. Applied Geomatics, pages 1–15. [Nguyen et al., 2015] Nguyen, T.-m., Richet, Y., Balayn, P., and Bardet, L. (2015). Propagation des incertitudes dans les modèles hydrauliques 1D. La Houille Blanche, 5:55–62. [Remondino et al., 2011] Remondino, F., Barazzetti, L., Nex, F., Scaioni, M., and Sarazzi, D. (2011). UAV photogrammetry for mapping and 3D modeling – Current status and future perspectives. In Archives of Photogrammetry, Remote Sensing and Spatial Information Sciences, volume 38(1/C22). ISPRS Conference UAV-g, Zurich, Switzerland. [Saint-Geours, 2012] Saint-Geours, N. (2012). Analyse de sensibilité de modèles spatialisés - Application à l’analyse coût-bénéfice de projets de prévention des inondations. Thèse, Université Montpellier II - Sciences et Techniques du Languedoc. [Tsubaki and Fujita, 2010] Tsubaki, R. and Fujita, I. (2010). Unstructured grid generation using LiDAR data for urban flood inundation modelling. Hydrological Processes, 24:1404– 1420. 14
5cs.CE
The Dynamic Geometry of Interaction Machine: A Call-by-need Graph Rewriter Koko Muroya and Dan Ghica University of Birmingham, UK arXiv:1703.10027v1 [cs.PL] 29 Mar 2017 Abstract Girard’s Geometry of Interaction (GoI), a semantics designed for linear logic proofs, has been also successfully applied to programming language semantics. One way is to use abstract machines that pass a token on a fixed graph along a path indicated by the GoI. These token-passing abstract machines are space efficient, because they handle duplicated computation by repeating the same moves of a token on the fixed graph. Although they can be adapted to obtain sound models with regard to the equational theories of various evaluation strategies for the lambda calculus, it can be at the expense of significant time costs. In this paper we show a token-passing abstract machine that can implement evaluation strategies for the lambda calculus, with certified time efficiency. Our abstract machine, called the Dynamic GoI Machine (DGoIM), rewrites the graph to avoid replicating computation, using the token to find the redexes. The flexibility of interleaving token transitions and graph rewriting allows the DGoIM to balance the trade-off of space and time costs. This paper shows that the DGoIM can implement call-by-need evaluation for the lambda calculus by using a strategy of interleaving token passing with as much graph rewriting as possible. Our quantitative analysis confirms that the DGoIM with this strategy of interleaving the two kinds of possible operations on graphs can be classified as “efficient” following Accattoli’s taxonomy of abstract machines. 1 1.1 Introduction Token-passing Abstract Machines for λ-calculus Girard’s Geometry of Interaction (GoI) [16] is a semantic framework for linear logic proofs [15]. One way of applying it to programming language semantics is via “token-passing” abstract machines. A term in the λcalculus is evaluated by representing it as a graph, then passing a token along a path indicated by the GoI. Token-passing GoI decomposes higher-order computation into local token actions, or low-level interactions of simple components. It can give strikingly innovative implementation techniques for functional programs, such as Mackie’s Geometry of Implementation compiler [20], Ghica’s Geometry of Synthesis (GoS) high-level synthesis tool [12], and Schöpp’s resource-aware program transformation to a low-level language [25]. The interactionbased approach is also convenient for the complexity analysis of programs, e.g. Dal Lago and Schöpp’s IntML type system of logarithmic-space evaluation [7], and Dal Lago et al.’s linear dependent type system of polynomialtime evaluation [5, 6]. Fixed-space execution is essential for GoS, since in the case of digital circuits the memory footprint of the program must be known at compile-time, and fixed. Using a restricted version of the call-by-name language Idealised Algol [13] not only the graph, but also the token itself can be given a fixed size. Surprisingly, this technique also allows the compilation of recursive programs [14]. The GoS compiler shows both the usefulness of the GoI as a guideline for unconventional compilation and the natural affinity between its space-efficient abstract machine and call-by-name evaluation. The practical considerations match the prior theoretical understanding of this connection [9]. In contrast, re-evaluating a term by repeating its token actions poses a challenge for call-by-value evaluation (e.g. [11, 24, 18, 3]) because duplicated computation must not lead to repeated evaluation. Moreover, in callby-value repeating token actions raises the additional technical challenge of avoiding repeating any associated computational effects (e.g. [23, 22, 4]). A partial solution to this conundrum is to focus on the soundness of the equational theory, while deliberately ignoring the time costs [22]. However, Fernández and Mackie suggest that in a call-by-value scenario, the time efficiency of a token-passing abstract machine could also be improved, by allowing a token to jump along a path, even though a time cost analysis is not given [11]. For us, solving the the problem of creating a GoI-style abstract machine which computes efficiently with evaluation strategies other than call-by-name is a first step in a longer-range research programme. The compilation techniques derived from the GoI can be extremely useful in the case of unconventional computational platforms. 1 But if GoI-style techniques are to be used in a practical setting they need to extend beyond call-by-name, not just correctly but also efficiently. 1.2 Interleaving Token Passing with Graph Rewriting A token jumping, rather than following a path, can be seen as a simple form of short-circuiting that path, which is a simple form of graph-rewriting. This idea first occurs in Mackie’s work as a compiler optimisation technique [20] and is analysed in more depth theoretically by Danos and Regnier in the so-called Interaction Abstract Machine [9]. More general graph-rewriting-based semantics have been used in a system called virtual reduction [8], where rewriting occurs along paths indicated by GoI, but without any token-actions. The most operational presentation of the combination of token-passing and jumping was given by Fernández and Mackie [11]. The interleaving of token actions and rewriting is also found in Sinot’s interaction nets [26, 27]. We can reasonably think of the DGoIM as their abstract-machine realisation. We build on these prior insights by adding more general, yet still efficient, graph-rewriting facilities to the setting of a GoI token-passing abstract machine. We call an abstract machine that interleaves token passing with graph rewriting the Dynamic GoI Machine (DGoIM), and we define it as a state transition system with transitions for token passing as well as transitions for graph rewriting. What connects these two kinds of transitions is the token trajectory through the graph, its path. By examining it, the DGoIM can detect redexes and trigger rewriting actions. Through graph rewriting, the DGoIM reduces sub-graphs visited by the token, avoiding repeated token actions and improving time efficiency. On the other hand, graph rewriting can expand a graph by e.g. copying sub-graphs, so space costs can grow. To control this trade-off of space and time cost, the DGoIM has the flexibility of interleaving token passing with graph rewriting. Once the DGoIM detects that it has traversed a redex, it may rewrite it, but it may also just propagate the token without rewriting the redex. As a first step in our exploration of the flexibility of this machine, we consider the two extremal cases of interleaving. The first extremal case is “passes-only,” in which the DGoIM never triggers graph rewriting, yielding an ordinary token-passing abstract machine. As a typical example, the λ-term (λx.t) u is evaluated like this: 1. A token enters the graph on the left at the bottom open edge. 2. A token visits and goes through the left sub-graph λx.t. λx.t u 3. Whenever a token detects an occurrence of the variable x in t, it traverses the right sub-graph u, then returns carrying the resulting value. 4. A token finally exits the graph at the bottom open edge. Step 3 is repeated whenever term u needs to be re-evaluated. This strategy of interleaving corresponds to call-by-name reduction. The other extreme is “rewrites-first,” in which the DGoIM interleaves token passing with as much, and as early, graph rewriting as possible, guided by the token. This corresponds to both call-by-value and call-by-need reductions, the difference between the two being the trajectory of the token. In the case of call-by-value, the token will enter the graph from the bottom, traverse the left-hand-side sub-graph, which happens to be already a value, then visit sub-graph u even before x is used in a call. While traversing u, it will cause rewrites such that when the token exits, it leaves behind the graph of a machine corresponding to a value v such that u reduces to v. The difference with call-by-need is that the token will visit u only when x is encountered in λx.t. In both cases, if repeated evaluation is required then the sub-graph corresponding now to v is copied, so that one copy can be further rewritten, if needed, while the original is kept for later reference. 1.3 Contributions This work presents a DGoIM model for call-by-need, which can be seen as a case study of the flexibility achieved through controlled interleaving of rewriting and token-passing. This is achieved through a rewriting strategy which turns out to be as natural as the passes-only strategy is for implementing call-by-name. The DGoIM avoids re-evaluation of a sub-term by rewriting any sub-graph visited by a token so that the updated sub-graph represents the evaluation result, but, unlike call-by-value, it starts by evaluating the sub-graph corresponding to the function λx.t first. We chose call-by-need mainly because of the technical challenges it poses. Adapting the technique to call-by-value is a straightforward exercise, and we discuss other alternative in the Conclusion. We analyse the time cost of the DGoIM with the rewrites-first interleaving, using Accattoli et al.’s general methodology for quantitative analysis [2, 1]. Their method cannot be used “off the shelf,” because the DGoIM does not satisfy one of the assumptions used in [1, Sec. 3]. Our machine uses a more refined transition system, 2 in which several steps correspond to a single one in loc. cit.. We overcome this technical difficulty by building a weak simulation of Danvy and Zerny’s storeless abstract machine [10] to which the recipe does apply. The result of the quantitative analysis confirms that the DGoIM with the rewrites-first interleaving can be classified as “efficient,” following Accattoli’s taxonomy of abstract machines introduced in [1]. As we intend to use the DGoIM as a starting point for semantics-directed compilation, this result is an important confirmation that no hidden inefficiencies lurk within the fabric of the rather complex machinery of the DGoIM. 2 The Dynamic GoI Machine 2.1 Well-boxed Graphs The graphs used to construct the DGoIM are essentially MELL proof structures [15] of the multiplicative and exponential fragment of linear logic. They are directed, and built over the fixed set of nodes called “generators” shown in Fig. 1. H | | Ax Cut ` ! ? D ? Cn ! | Figure 1: Generators of Graphs Figure 2: !-box H A Cn -node is annotated by a natural number n that indicates its in-degree, i.e. the number of incoming edges. It generalises a contraction node, whose in-degree is 2, and a weakening node, whose in-degree is 0, of MELL proof structures. In Fig. 1, a bunch of n edges is depicted by a single arrow with a strike-out. Graphs must satisfy the well-formedness condition below. Note that, unlike the usual approach [15], we need not assign MELL formulas to edges, nor require a graph to be a valid proof net. Definition 2.1 (well-boxed). A directed graph G built over the generators in Fig. 1 is well-boxed if: • it has no incoming edges • each !-node v in G comes with a sub-graph H of G and an arbitrary number of ?-nodes ~u such that: – the sub-graph H (called “!-box”) is well-boxed inductively and has at least one outgoing edges – the !-node v (called “principal door of H”) is the target of one outgoing edge of H – the ?-nodes ~u (called “auxiliary doors of H”) are the targets of all the other outgoing edges of H • each ?-node is an auxiliary door of exactly one !-box • any two distinct !-boxes with distinct principal doors are either disjoint or nested Note that a !-box might have no auxiliary doors. We use a dashed box to indicate a !-box together with its principal door and its auxiliary doors, as in Fig. 2. The auxiliary doors are depicted by a single ?-node with a thick frame and with single incoming and outgoing arrows with strike-outs. Directions of edges are omitted in the rest of the paper, if not ambiguous, to reduce visual clutter. 2.2 Pass Transitions and Rewrite Transitions The DGoIM is formalised as a labelled transition system with two kinds of transitions, namely pass transitions 99K and rewrite transitions . Labels of transitions are b, s, o that stand for “beta,” “substitution,” and “overheads” respectively. Let L be a fixed countable (infinite) set of names. The state of the transition system s = (G, p, h, m) consists of the following elements: • a named well-boxed graph G = (G, ℓG ), that is a well-boxed graph G with a naming lG that assigns a unique name α ∈ L to each node of G • a pair p = (e, d) called position, of an edge e of G and a direction d ∈ {↑, ↓} • a history stack h defined by the grammar h ::=  | Axα : h | Cutα : h | ⊗α : h | `α : h | !α : h | Dα : h | Cnα : h, where α ∈ L and n is some positive natural number. • a multiplicative stack m defined by the BNF grammar m ::=  | l : m | r : m. 3 We refer to a node by its name, i.e. we say “a node α” instead of “a node whose name is α.” A pass transition (G, p, h, m) 99Ko (G, p′ , h′ , m′ ) changes a position using a multiplicative stack, pushes to a history stack, and keeps a named graph unchanged. All pass transitions have the label o. Fig. 3 shows pass transitions graphically, omitting irrelevant parts of graphs. A position p = (e, d) is represented by a bullet • (called “token”) on the edge e together with the direction d. Recall that an edge with a strike-out represents a bunch of edges. The transition in the last line of Fig. 3 (where we assume n > 0) moves a token from one of the incoming edges of a Cn -node to the outgoing edge of the node. Node names α ∈ L are indicated wherever needed. (h, m) Ax α ↑ (h, m) ↓ $α (h, l : m) ↑ $α (h, m) ↓ ! α (h, m) (Axα : h, m) 99Ko Ax α ↓ ($α : h, l : m) 99Ko ↓ $α ($α : h, m) 99Ko ↑ $α (!α : h, m) 99Ko ↓ ! (h, m) ↓ Cut α (h, m) $α ↓ (h, r : m) $α ↑ (h, m) ↓ α Dα (Cutα : h, m) 99Ko Cut α ↑ ($α : h, r : m) 99Ko $α ↓ ($α : h, m) 99Ko $α ↑ (Dα : h, m) 99Ko ↓ Dα (Cnα : h, m) | | ↓ Cn α 99Ko Cn α ↓ Figure 3: Pass Transitions ($ ∈ {⊗, `}, n > 0) A rewrite transition (G, (e, d), h, m) x (G′ , (e′ , d), h′ , m) consumes some elements of a history stack, rewrites a sub-graph of a named graph, and updates a position (or, more precisely, its edge). The label x of a rewrite transition x is either b, s or o. Fig. 4 shows rewrite transition in the same manner as Fig. 3. Multiplicative stacks are not present in the figure since they are irrelevant. The ♯-node represents some arbitrary node (incoming edges omitted). We can see that no rewrite transition breaks the well-boxed-ness of a graph. The rewrite transitions (1),(2),(3), and (4) are exactly taken from MELL cut elimination [15]. The rewrite transition (5) is a variant of (1). It acts on a connected pair of a Cut-node and an Ax-node that arises as a result of the transition (6) or (7) but cannot be rewritten by the transition (1). These transitions (6) and (7) are inspired by the MELL cut elimination process for (binary) contraction nodes; note that we assume n > 0 in Fig. 4. The rewrite transition (6) in Fig. 4 deserves further explanation. The sub-graph H ≈ is a copy of the !-box H where all the names are replaced with fresh ones. The thick Cg+f −1 -node and Cg+2f −1 -node represent families m {Cg(j)+f −1 (j) }m ǫ = ǫ0 , . . . , ǫl and j=0 , {Cg(j)+2f −1 (j) }j=0 , of C-nodes respectively. They are connected to ?-nodes ~ µ ~ = µ0 , . . . , µl in such a way that: • the natural numbers l, m satisfy l ≥ m, and come with a surjection f : {0, . . . , l} ։ {0, . . . , m} and a function g : {0, . . . , m} → N to the set N of natural numbers • each ?-node ǫi and each ?-node µi are both connected to the C-node φf (i) • each C-node φj has g(j) incoming edges whose source is none of the ?-nodes ~ǫ, ~µ. Some rewrite transitions introduce new nodes to a graph. We require that the uniqueness of names throughout a whole graph is not violated by these transitions. Under this requirement, the introduced names ν, ~µ and the renaming H ≈ in Fig. 4 can be arbitrary. Definition 2.2. We call a state ((G, ℓG ), p, h, m) rooted at e0 for an open (outgoing) edge e0 of G, if there exists a finite sequence ((G, ℓG ), (e0 , ↑), , ) 99K∗ ((G, ℓG ), p, h, m) of pass transitions such that the position p appears only last in the sequence. 4 Cutα : Axβ : h ↑ Cut α Ax β h o !α : Cutβ : Axγ : h (1) ↑ !α : h ↑ ! Ax γ α o ↑ ! Cut β `α : Cutβ : ⊗γ : h ↑ ↑ γ Cut β b !α : Cutβ : Cn+1 : ♯δ : h γ !ν : Cutη : ♯δ : h (2) Cut ν ν H | H≈ ↑ ?µ ! ~ | `α Cut β Cutβ : h (5) α Cutβ : h | ↑ b Cut β (3) ? ~ǫ ! Cn+1 γ α s ? ~ǫ ! ~ φ Cutβ : h | | Cg+2f −1 | | H ↑ | δ o ! α Dγ Cut β | ?~ H ↑ (4) Cut β !α : Cutβ : C1γ : ♯δ : h α C1 γ Cut β s Cn γ Cut β α ~ φ H ↑ ?~ | | δ ♯δ ! (6) !α : Cutβ : ♯δ : h | | H ↑ ?~ ♯δ | | !α : Cutβ : Dγ : h Cut η | Cg+f −1 Cut ν ♯δ Cut β | γ | ↑ `α Cut β H ↑ | `α : Cutβ : ⊗γ : h δ ♯δ ! (7) α Cut β Figure 4: Rewrite Transitions (n > 0) Lem. 2.3(1) below implies that, the DGoIM can determine whether a rewrite transition is possible at a rooted state by only examining a history stack. The rooted property is preserved by transitions. Lemma 2.3 (rooted states). Let ((G, ℓG ), (e, d), h, m) be a rooted state at e0 with a (finite) sequence ((G, ℓG ), (e0 , ↑), , ) 99K∗ ((G, ℓG ), (e, d), h, m). 1. History stack represents an (undirected and possibly cyclic) path of the graph G connecting edges e0 and e. 2. If a transition ((G, ℓG ), (e, d), h, m) (99K ∪ ) ((G′ , ℓG′ ), p′ , h′ , m′ ) is possible, the open edges of G′ are bijective to those of G, and the state ((G′ , ℓG′ ), p′ , h′ , m′ ) is rooted at the open edge corresponding to e0 . Proof. (Sketch.) The proof of the first part is by induction on the length of the sequence of move transitions. For the second part, rewrite transitions modify open edges of a graph in a bijective way. The edge that a state is rooted at can be modified only by the rewrite transitions (1) and (5) involving Ax-nodes. 2.3 Cost Analysis of the DGoIM The time cost of updating stacks is constant, as each transition changes only a fixed number of top elements of stacks. Updating a position is local and needs constant time, as it does not require searching beyond the next edge in the graph from the current edge. We can conclude all pass transitions take constant time. We estimate the time cost of rewrite transitions by counting updated nodes. The rewrite transitions (1)–(3) involve a fixed number of nodes, and the transition (7) eliminates one C1 -node. Only the transitions (4) and (6) have non-constant time cost. The number of doors deleted in the transition (4) can be arbitrary, and so is the number of nodes introduced in the transition (6). Pass transitions and rewrite transitions are separately deterministic (up to the choice of new names). However, both a pass transition and a rewrite transition are possible at some states. We here opt for the following “rewrites-first” way to interleave pass transitions with as much rewrite transitions as possible: ( s x s′ (if x possible) ′ def. s _x s ⇐⇒ ′ s 99Kx s (if only 99K [x possible). The DGoIM with this strategy yields a deterministic labelled transition system _ up to the choice of new names in rewrite transitions. We denote it by DGoIM_ , making the strategy explicit. Note that there can be other strategies of interleaving although we do not explore them here. Before we conclude, several considerations about space cost analysis. Space costs are generally bound by time costs, so from our analysis there is an implicit guarantees that space usage will not explode. But if a more refined space cost analysis is desired, the following might prove to be useful. 5 Terms Values Evaluation contexts Substitution contexts t ::= x | λx.t | t t | t[x ← t] v ::= λx.t E ::= h·i | E t | E[x ← t] | Ehxi[x ← E] A ::= h·i | A[x ← t] Pure terms Pure values t ::= x | λx.t | t t v ::= λx.t (t u, E)term →o (t, Ehh·i ui)term (8) (x, E1 hE2 [x ← t]i)term →o (t, E1 hE2 hxi[x ← h·i]i)term (v, E)term →o (v, E)ctxt (9) (10) (λx.t, EhA ui)ctxt →b (t, EhAhh·i[x ← u]ii)term (v, E1 hE2 hxi[x ← A]i)ctxt →s (v ≈ , E1 hAhE2 [x ← v]ii)ctxt (if x ∈ FV∅ (E2 )) (11) (12) (v, E1 hE2 hxi[x ← A]i)ctxt →s (v, E1 hAhE2 ii)ctxt (if x ∈ / FV∅ (E2 )) (13) Figure 5: Call-by-need Storeless Abstract Machine (SAM) The space required in implementing a named well-boxed graph is bounded by the number of its nodes. The number of edges is linear in the number of nodes, because each generator has a fixed out-degree and every edge of a well-boxed graph has its source. Additionally a !-box can be represented by associating its auxiliary doors to its principal door. This adds connections between doors to a graph that are as many as ?-nodes. It enables the DGoIM to identify nodes of a !-box by following edges from its principal and auxiliary doors. Nodes in a !-box that are not connected to doors can be ignored, since these nodes are never visited by a token (i.e. pointed by a position) as long as the DGoIM acts on rooted states. Only the rewrite transition (6) can increase the number of nodes of a graph by copying a !-box with its doors. Rewrite transitions can copy !-boxes and eliminate the !-box structure, but they never create new !-boxes or change existing ones. This means that, in a sequence of transitions that starts with a graph G, any !-boxes copied by the rewrite transition (6) are sub-graphs of the graph G. Therefore the number of nodes of a graph increases linearly in the number of transitions. Elements of history stacks and multiplicative stacks, as well as a position, are essentially pointers to nodes. Because each pass/rewrite transition adds at most one element to each stack, the lengths of stacks also grow linearly in the number of transitions. 3 3.1 Weak Simulation of the Call-by-Need SAM Storeless Abstract Machine (SAM) We show the DGoIM_ implements call-by-need evaluation by building a weak simulation of the call-by-need Storeless Abstract Machine (SAM) defined in Fig. 5. It simplifies Danvy and Zerny’s storeless machine [10, Fig. 8] and accommodates a partial mechanism of garbage collection (namely, transition (13)). We will return to a discussion of garbage collection at the end of this section. The SAM is a labelled transition system between configurations (t, E). They are classified into two groups, namely term configurations and context configurations, that are indicated by annotations term, ctxt respectively. Pure terms (resp. pure values) are terms (resp. values) that contain no explicit substitutions t[x ← u]; we sometimes omit the word “pure” and the overline in denotation as long as that raises no confusion. Each evaluation context E contains exactly one open hole h·i, and replacing it with a term t (or an evaluation context E ′ ) yields a term Ehti (or an evaluation context EhE ′ i) called plugging. In particular an evaluation context E ′ hxi[x ← E] replaces the open hole of E ′ with x and keeps the open hole of E. Labels of transitions are the same as those used for the DGoIM (i.e. b, s and o). The transition (11), with the label b, corresponds to the β-reduction where evaluation and substitution of function arguments are delayed. Substitution happens in the transitions (12) and (13), with the label s, that replaces exactly one occurrence of a variable. The other transitions with the label o, namely (t, E) →o (t′ , E ′ ), search a redex by rearranging a configuration. The two pluggings Ehti and E ′ ht′ i indeed yield exactly the same term. We characterise “free” variables using multisets of variables. Multisets make explicit how many times a variable is duplicated in a term (or an evaluation context). This information of duplication is later used in translating terms to graphs. Notation (multiset). A multiset x := [x, . . . , x] consists of a finite number of x. The multiplicity of x in a multiset M is denoted by M (x). We write x ∈k M if M (x) = k, x ∈ M if M (x) > 0 and x ∈ / M if M (x) = 0. A multiset M comes with its support set supp(M ). For two multisets M and M ′ , their sum and difference are 6 denoted by M + M ′ and M − M ′ respectively. Removing all x from a multiset M yields the multiset M \x, e.g. [x, x, y]\x = [y]. Each term t and each evaluation context E are respectively assigned multisets of variables FV(t), FVM (E), with M a multiset of variables. The multisets FV are defined inductively as follows. FV(x) := [x], FV(λx.t) := FV(t)\x, FV(t u) := FV(t) + FV(u), FV(t[x ← u]) := (FV(t)\x) + FV(u). FVM (h·i) := M, FVM (E t) := FVM (E) + FV(t), FVM (E[x ← t]) := (FVM (E))\x + FV(t), FVM (E ′ hxi[x ← E]) := (FV[x] (E ′ ))\x + FVM (E). The following equations can be proved by a straightforward induction on E. Lemma 3.1 (decomposition). FV(Ehti) = FVFV(t) (E) FVM (EhE ′ i) = FVFVM (E ′ ) (E) A variable x is bound in a term t if it appears in the form of λx.u or u[x → u′ ]. A variable x is captured in an evaluation context E if it appears in the form of E ′ [x ← t] (but not in the form of E ′ hxi[x ← E ′′ ]). The transitions (12) and (13) depend on whether or not the bound variable x appears in the evaluation context E2 . If the variable x appears, the value v is kept for later use and its copy v ≈ is substituted for x. If not, the value v itself is substituted for x. The SAM does not assume the α-equivalence, but explicitly deals with it in copying a value. The copy v ≈ in has all its bound variables replaced by distinct fresh variables (i.e. distinct variables that do not appear in a whole configuration). This implies that the SAM is deterministic up to the choice of new variables introduced in copying. A term t is closed if FV(t) = ∅; and is well-named if each variable gets bound at most once in t, and each bound variable x in t satisfies x ∈ / FV(t). An initial configuration is a term configuration (t0 , h·i)term where t0 is closed and well-named. A finite sequence of transitions from an initial configuration is called an execution. A reachable configuration (t, E), that is a configuration coming with an execution from some initial configuration to itself, satisfies the following invariant properties. Lemma 3.2 (reachable configurations). Let (t, E) be a reachable configuration from an initial configuration (t0 , h·i)term . The term t is a sub-term of the initial term t0 up to α-equivalence, and the plugging Ehti is closed and well-named. Proof. (Sketch.) The proof is by induction on the length of the execution (t0 , h·i)term →∗ (t, E). Not only the term t but also the term u′ in any sub-term t′ u′ or t′ [x ← u′ ] of the plugging Ehti is a sub-term of the initial term t0 . The transition (12) renames a value in the way that preserves closedness and the well-named-ness of pluggings. In the transition (13) where an explicit substitution for a bound variable x is eliminated, the induction hypothesis ensures that the variable x does not occur in the plugging E1 hAhE2 hviii. We now conclude with a brief consideration on garbage collection. Transition (13) eliminates an explicit substitution and therefore implements a partial mechanism of garbage collection. The mechanism is partial because only an explicit substitution that is looked up in an execution can be eliminated, as illustrated below. The explicit substitution [x ← λz .z] is eliminated in the first example, but not in the second example because the bound variable x does not occur. ((λx.x) (λz .z), h·i)term →∗ (λz .z, h·i)ctxt ((λx.λy.y) (λz .z), h·i)term →∗ (λy.y, h·i[x ← λz .z])ctxt We incorporate this partial garbage collection to make clear the behaviour of the DGoIM_ , in particular the use of the rewrite transitions (6) and (7). 7 x† := x Ax | t† x Ck FV(t)\x x (if x ∈k FV(t)) | (λx.t)† := ? ! | FV(t)\x t† † (t u) := FV(u) | | FV(t) u† Ax D Cut u† | (if x ∈k FV(t)) | (t[x ← u])† := t† x C FV(t)\x x k | Cut FV(u) Figure 6: Inductive Translation (·)† of Terms to Well-boxed Graphs x† := t† x Ax † (t u) := FV(u) | FV(t) | t† x Ck FV(t)\x x u† Ax D Cut | | (λx.t)† := | (if x ∈k FV(t)) | (t[x ← u])† := ! u† | ? | FV(t)\x t† x C FV(t)\x x k (if x ∈k FV(t)) Cut FV(u) Figure 7: Inductive Translation (·)†M of Evaluation Contexts to Graphs 3.2 Translation and Weak Simulation A weak simulation is built on top of translations of terms and evaluation contexts. The translations (·)† are inductively defined in Fig. 6 and Fig. 7. What underlies them is the so-called “call-by-value” translation of intuitionistic logic to linear logic. This translates all and only values to !-boxes that can be copied by rewrite transitions. t† of a term t is a well-boxed graph, where some edges are annotated with variables The translation | FV(t) to help understanding. We continue representing a bunch of edges by a single edge and a strike-out, with M | annotations denoted by a multiset, and a bunch of nodes by a single thick node. The translation † EM | FVM (E) of an evaluation context E, given a multiset M of variables, is not a well-boxed graph because it has incoming edges. Lem. 3.3 is analogous to Lem. 3.1; their proof is by straightforward induction on E. Lemma 3.3 (decomposition). † t FV(t) | FVFV(t) (E) | † (Ehti) = † EFV(t) (E ′ )†M FVM (E) † EFV ′ M (E ) FVFVM (E ′ ) (E) | (EhE ′ i)†M = | M | 8 The translations (·)† are lifted to a binary relation between reachable configurations of the SAM and rooted states of the DGoIM_ . | Definition 3.4 (binary relation ). A reachable configuration c and a state ((G, ℓG ), p, h, m) satisfies c  ((G, ℓG ), p, h, m) if and only if:  †  t    FV(t) ↑ (if c = (t, E)term )   †  EFV(t)       v⋄ • (G, p) = v⋄  †  FV(v) ↑  (if v = FV(v)   ? ! ? !   FV(v)  FV(v)   †  EFV(v)   and c = (v, E)ctxt ) | | | | • ℓG is an arbitrary naming • ((G, ℓG ), p, h, m) is rooted at the unique open edge of G. Note that the graph G in the above definition has exactly one open edge, because it is equal to the translation Ehti† (Lem. 3.3) and the plugging Ehti is closed (Lem. 3.2). The binary relation  gives a weak simulation, as stated below. It is weak in Milner’s sense [21], where transitions with the label o are regarded as internal. We can conclude from Thm. 3.5 below that the DGoIM_ soundly implements the call-by-need evaluation. Theorem 3.5 (weak simulation). Let a configuration c and a state s satisfy c  s. 1. If a transition c →b c′ of the SAM is possible, there exists a sequence s _2o _b _o s′ such that c′  s′ . 2. If a transition c →s c′ of the SAM is possible, there exists a sequence s _s _o s′ such that c′  s′ . ′ 3. If a transition c →o c′ of the SAM is possible, there exists a sequence s _N o s such that 0 < N ≤ 4 and ′ ′ c s. 4. No transition _ is possible at the state s′ if c′ = (v, A)ctxt . Proof. We start with two basic observations. First, only a pass transition is possible at a state s that satisfies (t, E)term  s, and second, no transition is possible at a state s that satisfies (v, A)ctxt  s. Fig. 8 shows how the DGoIM_ simulates each transition of the SAM. Stacks, annotations of edges, and some annotations of C-nodes are omitted. The equations in Fig. 8 apply the decomposition properties in Lem. 3.3 as well as the other decomposition properties in the following Lem. 3.6. In the application, we exploit the closedness and well-named-ness of reachable configurations (in the sense of Lem. 3.2). Lemma 3.6 (decomposition). Let M0 , M be multisets of variables. M A‡M FVM (A) | 1. The translation A†M of a substitution context A has a unique decomposition . | † 2. If no variables in M0 are captured in an evaluation context E, the translation EM is equal to the graph 0 +M | M † EM | M0 . | FVM (E) † 3. If each variable in M0 is captured in an evaluation context E exactly once, the translation EM has 0 +M | †† EM | M0 M1 CM0 +M1 . The multiset M1 satisfies supp(M1 ) ⊆ supp(M0 ), | | supp(M0 ) Cut | FVM0 +M (E) | a unique decomposition M and the thick CM0 +M1 -node represents a family {CM0 (x)+M1 (x) }x∈supp(M0 ) of C-nodes. 9 v⋄ Ax ? (E2 )†∅ ! ? | | Ax (E2 )†∅ (E2 )†∅ v⋄ | | | | (v⋄ )≈ ↑ ? ! t† | | | | | Cut C | 99K3o | C | (E2 )†∅ t† ↑ (E2 )†∅ Cut v⋄ | | | C | ? 99Ko ! | EhAi†† ↑ | | ! ? Cut v⋄ Cut ! | | ↑ Ck | E1† v⋄ ? o | | s E1† | | (E2 )†∅ Cut Ax ↑ | | C E1† Ax ↑ ! Cut A‡ E1† →o (10) ? EhAi†† Cut == Ck+1 == | Cut ! | ? v⋄ | | Ck+1 ↑ | | == | t† C →o (9) | | E1† Ax E† ↑ (E2 )†[x] Cut E1† D A‡ Ck+1 | Cut Cut E† Ax == A† Ck+1 Ax ↑ | ↑ 99K4 o D Cut u† | t† Ax | | →o (8) u† ! | | | →s (12) t† ↑ | | (E2 )†∅ v⋄ Ax ↑ † EFV(v) (v⋄ )≈ ↑ ? ! † EFV(v) | t† Ax == EhAi† u† | | | | D A‡ Ax (E2 )†∅ | E1† Cut E1† A† v⋄ v⋄ | | o A‡ | | Figure 8: Illustration of Simulation (k > 0) 10 == ! (E2 )†∅ A‡ | | E1† ! | | (E2 )†∅ ? | ? s ↑ | ↑ | E† E1† | Cut A‡ C1 == | E† ↑ Cut == A† C1 u† | A‡ | o | | b ↑ Cut ? | C | o 99Ko C (E2 )†∅ ! | →s (13) | t† u† | t† ? | E† v⋄ Ax ↑ ↑ | Cut E† v⋄ Ax D | Cut ! | u† | A† ? Cut | ? | nnn Ck ` ↑ ! | | ` ↑ ! v⋄ | | C (E2 )†∅ == | | C ? →b (11) t† ! | | M0 M (E2 )†M0 +M t† x FVM0 +M (E2 )\x xCk Cut | | | † EM = 0 +M (E1 )† | | | M2 M (E2 )†M2 +M t† x x Ck x Cut | | M1 | | (by 2.) | = (E1 )† | | M (E2 )†† M x Ck C x Cut | | | | | = (E1 M1 | | | M2 t† | | x Cut (I.H.) )†† | | | C | | Cut † Figure 9: Decomposing EM 0 +M Proof. The proofs for 1. and 2. are by straightforward inductions on A and E respectively. The proof for 3. is by induction on the dimension of M0 , i.e. the size of the support set supp(M0 ). The base case where M0 = ∅ is obvious. In the inductive case, let x satisfy x ∈ M0 . Since x is captured exactly once in E by assumption, the evaluation context E can be decomposed as E = E1 hE2 [x ← t]i such that x is not captured in E1 or E2 . The evaluation context E2 satisfies x ∈k FVM0 +M (E2 ) for some positive multiplicity k. Moreover the multiset M0 can be decomposed as M0 = M1 + x + M2 such that all the variables in M1 (resp. M2 ) are only captured † †† in E1 (resp. E2 ). The translation EM can be decomposed as in Fig. 9. Finally, we let EM consist of 0 +M † †† (E2 )†† , t , (E ) . 1 M 4 Time Cost Analysis of Rewrites-First Interleaving 4.1 Recipe for Time Cost Analysis Our time cost analysis of the DGoIM_ follows Accattoli’s recipe, described in [2, 1], of analysing complexity of abstract machines. This section recalls the recipe and explains how it applies to the DGoIM_ . The time cost analysis focuses on how efficiently an abstract machine implements an evaluation strategy. In other words, we are not interested in minimising the number of β-reduction steps simulated by an abstract machine. Our interest is in making the number of transitions of an abstract machine “reasonable,” compared to the number of necessary β-reduction steps determined by a given evaluation strategy. Accattoli’s recipe assumes that an abstract machine has three groups of transitions: 1) “β-transitions” that correspond to β-reduction in which substitution is delayed, 2) transitions perform substitution, and 3) other “overhead” transitions. We incorporate this classification using the labels b, s, o of transitions. Another assumption of the recipe is that, each step of β-reduction is simulated by a single transition of an abstract machine, and so is substitution of each occurrence of a variable. This is satisfied by many known abstract machines including the SAM, however not by the DGoIM_ . The DGoIM_ has “finer” transitions and can take several transitions to simulate a single step of reduction (hence a single transition of the SAM, as we can observe in Thm. 3.5). In spite of this mismatch we can still follow the recipe, thanks to the weak simulation . It discloses what transitions of the DGoIM exactly correspond to β-reduction and substitution, and gives a concrete number of overhead transitions that the DGoIM_ needs to simulate β-reduction and substitution. The recipe for the time cost analysis is: 1. Examine the number of transitions, by means of the size of input and the number of β-transitions. 11 2. Estimate time cost of single transitions. 3. Derive a bound of the overall execution time cost. 4. Classify an abstract machine according to its execution time cost. The last step is accompanied by the following taxonomy of abstract machines introduced in [1]. Definition 4.1 (classes of abstract machines [1, Def. 7.1]). 1. An abstract machine is efficient if its execution time cost is linear in both the input size and the number of β-transitions. 2. An abstract machine is reasonable if its execution time cost is polynomial in the input size and the number of β-transitions. 3. An abstract machine is unreasonable if it is not reasonable. The input size in our case is given by the size |t| of a term t, inductively defined by: |x| := 1 |λx.t| := |t| + 1 |t u| := |t| + |u| + 1 |t[x ← u]| := |t| + |u| + 1. Given a sequence r of transitions (of either the SAM or the DGoIM_ ), we denote the number of transitions with a label x in r by |r|x . Since we use the fixed set {b, s, o} of labels, the length |r| of the sequence r is equal to the sum |r|b + |r|s + |r|o . 4.2 Number of Transitions We first estimate the number of transitions of the SAM, and then derive estimation for the DGoIM_ . Lemma 4.2 (quantitative bounds for SAM). Each execution e from an initial configuration (t0 , E)term , comes with the following inequalities: |e|s ≤ |e|b |e|o ≤ |t0 | · (5 · |e|b + 2) + (3 · |e|b + 1). Proof. The proof is analogous to the discussion in [2, Sec. 11]. Let |e|(8) , |e|(9) and |e|(10) be the numbers of transitions (8), (9) and (10) in e, respectively. The number |e|o is equal to the sum of these three numbers. The transition (11) introduces one explicit substitution, and the other transitions never increase the number of explicit substitution. In particular the transition (12) copies a pure value, that means no explicit substitutions are copied. Therefore we can bound the number of transitions that concern explicit substitutions, and obtain |e|(9) ≤ |e|b and |e|s ≤ |e|b . Each occurrence of the transition (10) in an execution is either the last transition of the execution or followed by the transitions (11), (12) and (13). This yields the inequality |e|(10) ≤ |e|b + |e|s + 1 and hence |e|(10) ≤ 2 · |e|b + 1. The transition (8) reduces the size of a pure term that is the first component of a configuration. The pure term is always a sub-term of the initial term t0 (Lem. 3.2). This means each maximal subsequence of an execution that solely consists of the transition (8) has at most the length |t0 |. Such a maximal subsequence either occurs at the end of an execution or is followed by transitions other than the transition (8). Therefore the number of these maximal sub-sequences is no more than |e|b + |e|s + |e|(9) + |e|(10) + 1 that can be bounded by 5 · |e|b + 2. A bound of the number |e|(8) can be given by multiplying these two bounds, namely we obtain |e|(8) ≤ |t0 | · (5 · |e|b + 2). Combining these bounds for the SAM with the weak simulation , we can estimate the number of transitions of the DGoIM_ as below. Proposition 4.3 (quantitative bounds for DGoIM_ ). Let r : s0 _∗ s be a sequence of transitions of the DGoIM_ . If there exists an execution (t0 , h·i)term →∗ (t, E) of the SAM such that s0  (t0 , h·i)term and s  (t, E), the sequence r comes with the following inequalities: |r|s ≤ |r|b |r|o ≤ 4 · |t0 | · (5 · |r|b + 2) + (16 · |r|b + 4). Proof. This is a direct consequence of Lem. 4.2 and Thm. 3.5. 12 4.3 Execution Time Cost We already discussed time cost of single transitions of the DGoIM in Sec. 2.3. It is worth noting that the discussion in Sec. 2.3 is independent of any particular choice of a rewriting and token-passing interleaving strategy. Thm. 4.4 below gives a bound of execution time cost of the DGoIM_ . We can conclude that, according to Accattoli’s taxonomy (see Def. 4.1), the DGoIM_ is “efficient” as an abstract machine for the call-by-need evaluation. Theorem 4.4 (time cost). Let C, D be fixed natural numbers, and r : s0 _∗ s be a sequence of transitions of the DGoIM_ . If there exists an execution (t0 , h·i)term →∗ (t, E) of the SAM such that s0  (t0 , h·i)term and s  (t, E), the total time cost T (r) of the sequence r satisfies: T (r) = O((|t0 | + C) · (|r|b + D)). Proof. We estimated in Sec. 2.3 that time cost of single transitions, except for the rewrite transitions (4) and (6), is constant. Time cost of these rewrite transitions (4) and (6) depends on the number of doors and/or nodes of a !-box. Since the sequence r of transitions simulates an execution of the SAM, every !-box concerned in r arises as the translation of a value v. By definition of the translation (·)† (Fig. 6), the graph v † is a !-box, with as many auxiliary doors as occurrences of free variables in v. The number of auxiliary doors is no more than the number of nodes in the !-box, due to the well-boxed-ness condition, that is linear in the size |v| of the value. Moreover the value v appears as the first component of a context configuration, and therefore it is a sub-term of the initial term t0 (Lem. 3.2). As a result, time cost of each occurrence of the rewrite transitions (4) and (6) in the sequence r is linear in the size t0 . The bound of the total time cost T (r) of the sequence r is given by combining these estimations for single transitions with the results of Prop. 4.3. Corollary 4.5. The DGoIM_ is an efficient abstract machine, in the sense of Def. 4.1. 5 Conclusions We introduced the DGoIM, which can interleave token passing with graph rewriting informed by the trajectory of the token. We focused on the rewrites-first interleaving and proved that it enables the DGoIM to implement the call-by-need evaluation strategy. The quantitative analysis of time cost certified that the DGoIM_ gives an “efficient” implementation in the sense of Accattoli’s classification. The proof of Thm. 4.4 pointed out that eliminating and copying !-boxes are two main sources of time cost. Our results are built on top of a weak simulation of the SAM, that relates several transitions of the DGoIM to each computational task such as β-reduction and substitution. The main feature of the DGoIM is the flexible combination of interaction and rewriting. We here briefly discuss how the flexibility can enable the DGoIM to implement evaluation strategies other than the call-by-need. As mentioned in Sec. 1.2, the passes-only interleaving yields an ordinary token-passing abstract machine that is known to implement the call-by-name evaluation. Because no rewrites are triggered, as oppose to the rewrites-first interleaving, a token not only can pass a principal door but also can go inside a !-box and pass an auxiliary door. These behaviours are in fact not possible with the DGoIM presented in this paper; the transitions and data carried by a token are tailored to the rewrites-first interleaving. To recover an ordinary token-passing machine, we therefore need to add pass transitions that involve auxiliary doors and data structures (so-called “exponential signatures”) that deal with !-boxes, for example. The only difference between the call-by-need and the call-by-value evaluations lies in when function arguments are evaluated. In the DGoIM, this corresponds to changing a trajectory of a token so that it visits function arguments immediately after it detects function application. Therefore, to implement the call-by-value evaluation, the DGoIM can still use the rewrites-first interleaving, but it should use a modified set of pass transitions. Further refinements, not only of the evaluation strategies but also of the graph representation could yield even more efficient implementation, such as full lazy evaluation, as hinted in [26]. Our final remarks concern programming features that have been modelled using token-passing abstract machines. Ground-type constants are handled by attaching memories to either nodes of a graph or a token, in e.g. [20, 18, 3] — this can be seen as a simple form of graph rewriting. Algebraic effects are also accommodated using memories attached to nodes of a graph in token machines [18], but their treatment would be much simplified in the DGoIM as effects are evaluated out of the term via rewriting. Acknowledgements. We are grateful to Ugo Dal Lago and anonymous reviewers for encouraging and insightful comments on earlier versions of this work. 13 References [1] Beniamino Accattoli. The complexity of abstract machines. In WPTE 2016, volume 235 of EPTCS, pages 1–15, 2017. [2] Beniamino Accattoli, Pablo Barenbaum, and Damiano Mazza. Distilling abstract machines. In ICFP 2014, pages 363–376. ACM, 2014. [3] Ugo Dal Lago, Claudia Faggian, Benoı̂t Valiron, and Akira Yoshimizu. Parallelism and synchronization in an infinitary context. In LICS 2015, pages 559–572. IEEE, 2015. [4] Ugo Dal Lago, Claudia Faggian, Benoı̂t Valiron, and Akira Yoshimizu. The Geometry of Parallelism: classical, probabilistic, and quantum effects. In POPL 2017, pages 833–845. ACM, 2017. [5] Ugo Dal Lago and Marco Gaboardi. Linear dependent types and relative completeness. In LICS 2011, pages 133–142. IEEE Computer Society, 2011. [6] Ugo Dal Lago and Barbara Petit. Linear dependent types in a call-by-value scenario. In PPDP 2012, pages 115–126. ACM, 2012. [7] Ugo Dal Lago and Ulrich Schöpp. Computation by interaction for space-bounded functional programming. Inf. Comput., 248:150–194, 2016. [8] Vincent Danos and Laurent Regnier. Local and asynchronous beta-reduction (an analysis of Girard’s execution formula). In LICS 1993, pages 296–306. IEEE Computer Society, 1993. [9] Vincent Danos and Laurent Regnier. Reversible, irreversible and optimal lambda-machines. Elect. Notes in Theor. Comp. Sci., 3:40–60, 1996. [10] Olivier Danvy and Ian Zerny. A synthetic operational account of call-by-need evaluation. In PPDP 2013, pages 97–108. ACM, 2013. [11] Maribel Fernández and Ian Mackie. Call-by-value lambda-graph rewriting without rewriting. In ICGT 2002, volume 2505 of LNCS, pages 75–89. Springer, 2002. [12] Dan R. Ghica. Geometry of Synthesis: a structured approach to VLSI design. In POPL 2007, pages 363–375. ACM, 2007. [13] Dan R. Ghica and Alex Smith. Geometry of Synthesis III: resource management through type inference. In POPL 2011, pages 345–356. ACM, 2011. [14] Dan R. Ghica, Alex Smith, and Satnam Singh. Geometry of Synthesis IV: compiling affine recursion into static hardware. In ICFP, pages 221–233, 2011. [15] Jean-Yves Girard. Linear logic. Theor. Comp. Sci., 50:1–102, 1987. [16] Jean-Yves Girard. Geometry of Interaction I: interpretation of system F. In Logic Colloquium 1988, volume 127 of Studies in Logic & Found. Math., pages 221–260. Elsevier, 1989. [17] Georges Gonthier, Martı́n Abadi, and Jean-Jacques Lévy. The geometry of optimal lambda reduction. In POPL 1992, pages 15–26. ACM, 1992. [18] Naohiko Hoshino, Koko Muroya, and Ichiro Hasuo. Memoryful Geometry of Interaction: from coalgebraic components to algebraic effects. In CSL-LICS 2014, pages 52:1–52:10. ACM, 2014. [19] John Lamping. An algorithm for optimal lambda calculus reduction. In POPL 1990, pages 16–30. ACM Press, 1990. [20] Ian Mackie. The Geometry of Interaction machine. In POPL 1995, pages 198–208. ACM, 1995. [21] Robin Milner. Communication and concurrency. PHI Series in Computer Science. Prentice Hall, 1989. [22] Koko Muroya, Naohiko Hoshino, and Ichiro Hasuo. Memoryful Geometry of Interaction II: recursion and adequacy. In POPL 2016, pages 748–760. ACM, 2016. [23] Ulrich Schöpp. Computation-by-interaction with effects. In APLAS 2011, volume 7078 of Lect. Notes Comp. Sci., pages 305–321. Springer, 2011. 14 [24] Ulrich Schöpp. Call-by-value in a basic logic for interaction. In APLAS 2014, volume 8858 of Lect. Notes Comp. Sci., pages 428–448. Springer, 2014. [25] Ulrich Schöpp. Organising low-level programs using higher types. In PPDP 2014, pages 199–210. ACM, 2014. [26] François-Régis Sinot. Call-by-name and call-by-value as token-passing interaction nets. In TLCA 2005, volume 3461 of Lect. Notes Comp. Sci., pages 386–400. Springer, 2005. [27] François-Régis Sinot. Call-by-need in token-passing nets. Math. Struct. in Comp. Sci., 16(4):639–666, 2006. 15
6cs.PL
Progressive Bit-Flipping Decoding of Polar Codes Over Layered Critical Sets Zhaoyang Zhang1,2† , Kangjian Qin1,2 , Liang Zhang1,2, Huazi Zhang3, Guo Tai Chen4 1 College of Information Science and Electronic Engineering, Zhejiang University, Hangzhou, China Zhejiang Provincial Key Laboratory of Info. Proc., Commun. & Netw. (IPCAN), Hangzhou, China 3 Huawei Technologies Co., Ltd., Hangzhou, China 4 School of Electrical and Information Engineering, Fuqing Branch of Fujian Normal University, Fuzhou, China E-mail: {ning ming† , north}@zju.edu.cn, [email protected], [email protected], [email protected] arXiv:1712.03332v1 [cs.IT] 9 Dec 2017 2 Abstract—In successive cancellation (SC) polar decoding, an incorrect estimate of any prior unfrozen bit may bring about severe error propagation in the following decoding, thus it is desirable to find out and correct an error as early as possible. In this paper, we first construct a critical set S of unfrozen bits, which with high probability (typically > 99%) includes the bit where the first error happens. Then we develop a progressive multi-level bit-flipping decoding algorithm to correct multiple errors over the multiple-layer critical sets each of which is constructed using the remaining undecoded subtree associated with the previous layer. The level in fact indicates the number of independent errors that could be corrected. We show that as the level increases, the block error rate (BLER) performance of the proposed progressive bit flipping decoder competes with the corresponding cyclic redundancy check (CRC) aided successive cancellation list (CA-SCL) decoder, e.g., a level 4 progressive bitflipping decoder is comparable to the CA-SCL decoder with a list size of L = 32. Furthermore, the average complexity of the proposed algorithm is much lower than that of a SCL decoder (and is similar to that of SC decoding) at medium to high signal to noise ratio (SNR). I. INTRODUCTION Polar codes, as the first provable capacity-achieving codes for any symmetric binary-input discrete memoryless channel (B-DMC) with efficient successive cancellation (SC) decoding [1], have been recently adopted as the channel coding scheme for control information in the 5G enhanced Mobile BroadBand (eMBB) scenario [2]. Different from data packets, the blocklength for control messages is typically short or moderate due to coding granularity. However, the performance of such finite block-length polar codes is still far from satisfactory. To improve the performance of polar codes in finite blocklength case, Tal and Vardy presented a successive cancellation list (SCL) decoder in [3], which helps polar codes successfully compete with low-density parity-check (LDPC) codes. Subsequently, adaptive SCL decoding and cyclic redundancy check (CRC) aided SCL (CA-SCL) decoding were proposed in [4], [5]. Moreover, the performance of SCL decoding was theoretically analyzed in [6]. Although SCL decoder significantly improves the block error rate (BLER) of finite blocklength polar codes, it suffers from large storage overhead and high computational complexity, both of which grow linearly with the list size. To address this issue, the authors in [7] put forward a SC flip decoder trying to correct the first erroneous estimate of an unfrozen bit, and indicated that the decoding performance could be dramatically improved if the first incorrect hard decision was flipped. This decoder was further modified in [8] to recover two incorrect hard decisions, which induced significant gains in terms of decoding performance and competed with the CA-SCL decoder with list size L = 4. Furthermore, [8] defined a new metric to determine the flipping positions, which yielded reduced complexity compared to the log likelihood ratio (LLR) metric exploited in [7]. Nonetheless, by using such metric, the search scope for the first erroneous hard decision is still the entire unfrozen set. In this paper, by investigating the distribution of the first erroneous hard decision in SC decoding, we find it possible to narrow down the search scope to an unfrozen bit subset S, which is much smaller than the unfrozen set. For ease of exposition, the subset S is referred to as critical set through the rest of this paper. It can be proven that if SC decoding fails, the first incorrect hard decision is almost surely included this critical set. As such, the decoder only needs to consider S for the flipping position, thus further reducing the computational complexity. In addition, since there might exist several other errors besides the first erroneous hard decision, it is desirable to flip multiple incorrect bits rather than only the first one. For this purpose, we propose to iteratively modify the critical set S and correct the errors progressively, aiming to achieve superior decoding performance. Numerical results show that, the proposed progressive decoder can compete with the CASCL decoder in terms of BLER performance, e.g., a level 4 progressive bit-flipping decoder is comparable to the CASCL decoder with a list size of L = 32, while having an average decoding complexity similar to that of the standard SC decoding at medium to high SNR. To summarize, our main contributions are as follows: • The critical set, which with high probability includes the first incorrect hard decision, is proposed. Because of the smaller search scope, the computational complexity is reduced significantly. • A progressive multi-level bit-flipping decoding algorithm based on iteratively modified critical set is proposed. It has the ability to correct multiple errors and achieve a BLER performance much better than the conventional SC decoding and comparable to the CA-SCL decoding. The rest of this paper is organized as below. In Section II, a short background on polar codes is presented and our analytical framework is briefly described. Section III provides some important results about the critical set. Section IV shows the proposed progressive algorithm that correct multiple errors. Simulation results are provided in Section V and Section VI concludes this paper. II. P RELIMINARIES A. Polar codes We use aN 1 to denote a vector (a1 , a2 , ..., aN ). For  polar codes with block-length N = 2n and kernel G2 = 11 01 , we denote uN 1 as the information sequence, and a polar codeword ⊗n N N cN 1 is obtained by c1 = u1 BN G2 , where ‘⊗’ denotes the Kronecker product while BN is a permutation matrix. A coding rate R = K/N means that a set A ⊂ {1, 2, ..., N } of cardinality K is selected as the information set (see [1]), and thus uN 1 consists of K unfrozen bits and N − K frozen bits (all frozen bits are assumed to be zero if not speci(i) fied). The split channel is defined as WN (y1N , ui−1 1 |ui ) = P 1 N N uN ∈X N −i 2N −1 WN (y1 |u1 ), and the Bhattacharyya pai+1 (i) Z(WN ) is computed to select the K most reliable rameter split channels to transmit unfrozen bits. Interested readers are referred to [1] for more details. we have C[1] = 1 and C[2] = 0. Next, invoking the expressions (A[1], A[2]) = (B[1], C[1]) × G2 and (A[3], A[4]) = (B[2], C[2]) × G2 , the polar codeword is obtained as c41 = (A[1], A[2], A[3], A[4]) = (1, 1, 0, 0). One can also check that c41 can be obtained by c41 = (D[1], E[1], F [1], G[1])×B4G⊗2 2 . As for SC decoding, it starts from the root node A, which possesses the LLRs received from the underlying channel, and uses [1, Eq. 75] and [1, Eq. 76] to calculate LLRs recursively. In the meantime, polarization can also be interpreted based on this tree. One can check that node A has four independent copies of the underlying channel W , while node B has two (1) independent copies of the synthetic channel W2 and node (2) C has two independent copies of the synthetic channel W2 . Finally, a leaf node has a unique copy of the split channel, (2) e.g., node E has W4 . We refer the reader to [9] for more details. It is worth noting that this framework can be extended to polar codes with arbitrary block-length. III. T HE CRITICAL A. SC decoding from a subblock-by-subblock perspective Let us focus on a more complicated example as shown in Fig. 2, where N = 24 and K = 9 (the information set may not be reasonable). B. Analytical framework A The framework in [9] is adopted for the ensuing analysis. To facilitate understanding, let us consider a toy example of polar codes with block-length N = 22 and information sequence u41 = (u1 , u2 , u3 , u4 ). u3 and u4 are chosen as the unfrozen bits, thus inducing a coding rate R = 2/4. D E F A A A B SET C B G D E F C B G D C E F G Fig. 1. Full binary tree for N = 22 . To proceed, a full binary tree with N = 22 leaf nodes is constructed in Fig. 1 (left). The leaf nodes {D, E, F, G} correspond to the information bits {u1 , u2 , u3 , u4 }, respectively. Since u3 and u4 are unfrozen bits, nodes F and G are denoted by black circles for the sake of clarity, see Fig. 1 (middle) for illustration. Furthermore, for each non-leaf node in the tree, if its two descendants are of the same color, then it is marked with that color as well. Otherwise, it is indicated by a gray circle. This process starts from the bottom non-leaf nodes until the root node is reached, as shown in Fig. 1 (right). To implement polar encoding, a constituent code is assigned to each node in Fig. 1 (right). Suppose that u41 = (0, 0, 1, 0), i.e., D[1] = 0, E[1] = 0, F [1] = 1, G[1] = 0, where D[i] denotes the i-th component at node D. On this basis, the constituent code at node B is obtained by (B[1], B[2]) = (D[1], E[1]) × G2 , which gives B[1] = B[2] = 0. Similarly, C B D Fig. 2. Full binary tree for N = 24 . In our framework, SC decoding is not viewed as a bitby-bit process, but from a subblock-by-subblock perspective. Once the full binary tree corresponding to the current specific polar code is constructed, the entire polar code is divided into multiple sub-polar codes (also called subblocks), which all have coding rate R = 1. In Fig. 2, there exist four such subblocks, which are denoted by the corresponding root nodes A, B, C and D, respectively (they are also polar codes but with shorter block-length). The subblock consists of only unfrozen bits, e.g, node A has unfrozen bits u16 13 . In particular, node D has an unfrozen bit u6 , and it can be viewed as a special subblock which has itself as both the codeword (root node) and information sequence (leaf node). Now, consider a general subblock A (A denotes its root M node) which has M = 2m unfrozen bits. We use uM 1 and c1 to denote its information sequence and codeword, respectively. Then the following proposition is derived, which sheds light on our main results. Proposition 1: For a binary erasure channel (BEC), the entire subblock is correctly decoded if and only if u1 is correctly decoded. Proof: The proof is straightforward. Recall that uM 1 = M −1 c1 (BM G⊗m , and one can check that we always have 2 ) u1 = c1 ⊕ c2 ⊕ · · · ⊕ cM . If u1 is correctly decoded, then − Pu1 = i=1 M−2i − p) < X 2i 2i CM ǫ , i=1 which completes the proof. Remarks: The difference Ps bler − Pu1 represents the probability that two or more errors occur. As ǫ → 0, this value approaches 0. This implies that if WM is reliable enough, Pu1 is quite close to the error probability of the entire subblock. B. Constructing the critical set Capitalizing on the results above, there is a high probability that the first incorrectly estimated unfrozen bit happens to be the first unfrozen bit within the subblock. Inspired by this, we provide a method to construct a set S that almost surely includes the first incorrect hard decision in SC decoding. The corresponding algorithm is summarized as Algorithm 1. Algorithm 1: A method to construct the critical set S Step 1 Establish the full binary tree corresponding to the current polar codes; Step 2 Divide the polar codes into multiple subblocks with coding rate R = 1 and put the first unfrozen bit of each subblock into set S. Taking Fig. 2 for instance, we have S = {u6 , u7 , u11 , u13 }. Note that the number of elements in set S is exactly the same as that of subblocks, which is rather small compared with the information set A of cardinality K. Furthermore, S is uniquely determined once the construction of polar codes is completed. Due to the all-zero codeword, the probabilitypthat u1 is incorrectly estimated is calculated as Pu1 = Q( µu1 /2), where R +∞ t2 Q(x) = √12π x e− 2 dt. Similarly, the error probability of p m the entire subblock is Ps bler = 1 − (1 − Q( µ/2))2 . 0    0    í í  (UURU3UREDELOLW\ bler M/2 2i 2i CM p (1 í  3 í  VBEOHU  í  3 í  VBEOHU 3 3 X  X  í   í  0HDQ    0      0HDQ     0    í  (UURU3UREDELOLW\ Ps X To validate the above method, we first focus on the evaluation of the difference Ps bler − Pu1 . To the best of our knowledge, the exact values of Ps bler and Pu1 are rather difficult to compute. Thereby, we exploit the Gaussian approximation method to provide some insightful results. Gaussian approximation was introduced in [10] and adopted for the analysis of polar codes in [11]. In the following analysis, we restrict our attention to binary phase shift keying (BPSK) modulation, i.e., for a given AWGN channel, the received symbol is expressed as yi = xi + ni , where xi = 1 − 2ci , and ni represents a Gaussian random variable with mean zero and variance σ 2 . Without loss of generality, we assume that the allzero codeword is transmitted. In this sense, one can check that i =1) the received LLR can be written as L(yi ) = log WW(y(yi i|x|xi =−1) = 2yi σ2 , which can be viewed as a Gaussian random variable with mean σ22 and variance σ42 . By rewriting formulae [1, Eq.75] and [1, Eq.76] in an LLR form, one can find that the operations involved in SC decoding are exactly the same as those in belief propagation decoding. Thus, as suggested in [10], by assuming that the symmetry condition is always satisfied, all the LLRs involved in SC decoding can be viewed as Gaussian random variables with the form N (µ, 2µ). We only need to calculate the mean µ. For a given subblock A, suppose that the LLR corresponding to the synthetic channel WM satisfies N (µ, 2µ). Then the (1) LLR corresponding to the split channel WM takes a mean m  2 ), where φ(x) is defined as µu1 = φ−1 (1 − 1 − φ(µ) Z  ∞ (u−x)2 u 1 − √1 tanh · e− 4x du, x > 0, 2 φ(x) = 4πx −∞  1, x = 0. (UURU3UREDELOLW\ M/2 C. Validation of set S under Gaussian approximation (UURU3UREDELOLW\ it means that there must be no erasure symbols involved in ⊗m −1 M M cM . On the other hand, if 1 , and thus u1 = c1 (BM G2 ) the entire subblock is correctly decoded, i.e., every ci takes a value either 0 or 1, it is obvious that u1 can be correctly estimated as well. Now, we extend the above arguments to other channels. According to our framework, node A has M = 2m independent copies of some synthetic channel, which is denoted by WM , and we further denote the split channel experienced (i) by ui (within this subblock) as WM . Provided that all the prior subblocks are correct, we assume the error probabilities (i) of WM and WM are p and Pui , respectively. Under this condition, we obtain the following proposition. Proposition 2: Denote the error probability of the entire subblock as Ps bler . Then, for p < ǫ, we have Ps bler − Pu1 < PM/2 2i 2i i=1 CM ǫ . Proof: According to the number of errors occurred in 1 p(1 − the codeword, Ps bler can be computed as Ps bler = CM 2 2 M M p)M−1 +CM p (1−p)M−2 +· · ·+CM p . Although this is not BEC, however, no frozen bits are involved, and thus no parity check needs to be satisfied. Then, the estimate of u1 , denoted as û1 , can still be computed by û1 = ĉ1 ⊕ ĉ2 ⊕ · · · ⊕ ĉM , where ĉi denotes the hard decision. Thus, u1 is incorrectly decoded if and only if the number of errors in cM 1 is odd, 1 3 3 p(1 − p)M−1 + CM p (1 − p)M−3 + which gives Pu1 = CM M−1 M−1 · · · + CM p (1 − p). As such, it is obtained that í  3VBEOHU í  í  í  3VBEOHU 3X í  3X    í  0HDQ Fig. 3. Ps bler      0HDQ vs. Pu1 under Gaussian approximation. The numerical comparison between Ps bler and Pu1 using Gaussian approximation is depicted in Fig. 3. It can be observed that for large length M and small µ, there still exists some obvious difference between Ps bler and Pu1 . This is practical because, firstly, small µ means that the synthetic channel WM is not quite reliable, and thus it is more likely to introduce more than one error; secondly, large M increases the probability to include two or P more errors as well. Thus, M/2 2i 2i M−2i the difference Ps bler − Pu1 = i=1 CM p (1 − p) becomes noticeable. However, we conjecture that for any given underlying channel W to implement polarization, a subblock A with large M in general has a large µ as well. For larger (1) M , the split channel WM is further degraded compared with (1) the synthetic channel WM . As WM is selected to transmit an unfrozen bit, thus WM should be sufficiently reliable as well, since otherwise u1 will turn into a frozen bit. It can be seen in Fig. 3 that if µ is large enough, the difference between Ps bler and Pu1 can usually be neglected. simulation times T = 106 1.5 2 2.5 296391 73789 10888 296573 73810 10888 99.94 99.97 100 112 117 124 X 3 1007 1007 100 129 CORRECTING MULTIPLE ERRORS In this section, invoking the derived critical set, the bitflipping methodology is adopted to correct the first erroneous unfrozen bit. Furthermore, by iteratively modifying the critical set, a progressive multi-level bit-flipping decoding algorithm, which can correct multiple errors in SC decoding, is proposed. A. Progressive bit-flipping decoding Now suppose that ûi is the first incorrect hard decision and is flipped to 1− ûi based on the bit-flipping method. Under this condition, all the elements in ui1 can be viewed as frozen bits. (i+1) The reason is that, for the split channel WN (y1N , ui1 |ui+1 ), the estimate of ui+1 is determined once the sequence ûi1 is provided. And therefore, whether some uj with 1 ≤ j ≤ i is a frozen bit or unfrozen bit no longer makes any difference. X )OLSVWELW OHYHO X X ( X X X )OLS ELW OHYHO To further evaluate the Algorithm 1, we focus on the probability that the first incorrect hard decision falls into set S through Monte Carlo simulations, which is shown in Table I. The “Included in set S” denotes the number that the first incorrectly estimated unfrozen bit falls into the critical set S, and “Incorrect blocks” denotes the total number of blocks that are not correctly recovered, while “Accuracy” simply computes their ratio. It can be observed that the probability that the first error is included in the critical set S approaches 100%, even for low signal to noise ratios (SNRs). Furthermore, the performance of Algorithm 1 improves as SNR increases, which is consistent with our prior analysis. IV. P ROGRESSIVELY 6& OHYHO QG TABLE I EVALUATION OF ALGORITHM 1 N = 1024, K = 512, Eb /N0 (dB) 1 Included in set S 675840 Incorrect blocks 677211 Accuracy (%) 99.80 Size of set S 110 By considering {u1 , · · · , ui } as frozen bits, a new full binary tree similar to Fig. 2 can be established immediately. However, at this time, all nodes corresponding to ui1 are white nodes, while the colors of the following nodes corresponding to uN i+1 still depend on whether it is a frozen bit or unfrozen bit. Based on this new tree, we can construct a modified critical set S ′ using Algorithm 1. This modified critical set implies that if errors occur in estimating uN i+1 under SC decoding, the first incorrect hard decision should be almost surely included in such a set. By adopting the bit-flipping operation as done for ui , this error is promised to be corrected, thus further improving the performance. Note that, including ui , the above scheme has corrected two errors during SC decoding. X X ) )OLSUGELW OHYHO Fig. 4. Implementation of progressive bit-flipping decoding for Fig. 2. Interestingly, this scheme can be extended to correct more errors based on a tree structure. Taking the polar code in Fig. 2 for example, the tree structure based implementation of progressive bit-flipping decoding is depicted in Fig. 4, where each node denotes an estimate of uN 1 as a candidate sequence and the edge indicates the unfrozen bit that is flipped. The tree is built via the following steps: first, conventional SC decoding is employed to obtain the root node at level 0, which denotes the candidate sequence ûN 1 without flipping any bits; next, the critical set S1 = {u6 , u7 , u11 , u13 } is constructed to obtain nodes at level 1, i.e., every unfrozen bit in S1 corresponds to an edge extended from the root node; then, for each node at level 1, e.g., node E, it constructs a modified critical set S ′ = {u14 , u15 } by building a full binary tree similar to Fig. 2, with the leaf nodes corresponding to u13 1 being white and those corresponding to u16 14 being black, thus inducing the edges and nodes at level 2. Intuitively, repeating the steps above gives rise to the following levels of the tree. On the basis of such tree structure, the bit-flipping decoding scheme is implemented in a level-order traversal, starting from the root node. In particular, for each node, the entire edges that start from the root node constitute the unfrozen bits that should be flipped. For instance, the node F in Fig. 4 means that: SC decoding is first implemented to compute û13 1 , but û13 is flipped; then SC decoding is continued to compute û15 14 , but û15 is flipped as well; finally SC decoding is implemented to compute û16 and thus a candidate sequence û16 1 is obtained at this node. The “level” in fact indicates the number of unfrozen bits that are flipped, and specifically level 0 denotes the conventional SC decoding without flipping any unfrozen B. Pruning technique To further reduce the search complexity, the current node should not generate any child node if it contains some incorrectly flipped unfrozen bits. According to Gaussian approximation, if all the prior flipped unfrozen bits are correct, the LLRs at uN i should not be too small compared with their mean values. Based on this observation, we can assign a threshold ωl to the l-th level in the tree √ structure, and design a metric µi − γleft σi , where σi = 2µi and γleft is an optimized value derived through numerical simulations. By counting the B. Pruning techniquebits in uN as N , while the number of number of unfrozen 1 i To further search unfrozen bitsreduce whosethe LLRs fail complexity, in achievingtheµicurrent − γleft σnode i as should not that generate any child node if it to contains some set incorN2 (note unfrozen bits belonging the critical are rectly flipped to Gaussian approxiexcluded whenunfrozen countingbits. N1 According and N2 ), we define ENoChild as N2 the prior flipped unfrozen bits are correct, the mation, if all the event >= ω , if E is true, then the estimate l NoChild N1 should not be tootosmall compared LLRs at ûi−1 sequence is supposed contain at leastwith one their error,mean thus 1 values. Based on this observation, we can assign a the branches extended from the current node can bethreshold pruned. to the -th in node the tree structure, and design a metric Otherwise, thelevel current is allowed to generate child nodes. , where and is an optimized left left If the current node is determined to generate its child nodes, value derived through counting the then the unfrozen bitsnumerical which aresimulations. likely to beBycorrect should number of unfrozen bits in as , while the number of not be selected as child nodes. Recall that under Gaussian i−1 i−1 unfrozen bits whose LLRs fail in achieving as left approximation, given that û1 = u1 , if LLR(ui ) is larger that value, unfrozen belonging critical On set this are than(note its mean thenbits ui is supposedtoto the be correct. √ as excluded when counting and ), we define NoChild basis, we design a threshold µi + γright σi , where σi = 2µi , ifWe NoChild true, then estimate the and event γright is a constant. define isENotSelect (ui ) the as the event sequence is supposed to contain at least one error, L(ui ) > µi + γright σi , if event ENotSelect (ui ) is true, then uthus i is the extended from node. the current node can be pruned. not branches selected to be the child Otherwise, the current node is multi-level allowed to generate child nodes. The proposed progressive bit-flipping decoding If the current node is determined to generate its child nodes, algorithm using the above pruning rules is summarized as then the unfrozen bitsSlwhich arethe likely to be correctbits should Algorithm 2, where denotes set of unfrozen that not be selected as child nodes. Recall that under Gaussian should be flipped at level l. , if is larger approximation, given that V. S IMULATION RESULTS than its mean value, then is supposed to be correct. On this In this section,a threshold the BLER performance and the compubasis, we design right , where tational complexity of the proposed progressive and is a constant. We define asbit-flipping the event right NotSelect algorithm Specifically, we focus on transmis> 𝜇 are investigated. , if event is true, then is right NotSelect sions with BPSK modulation over AWGN channel (details not selected to be the child node. have given in Section III-C). Polar codes are constructed Thebeen proposed progressive multi-level bit-flipping decoding with parameters N = 1024pruning and K rules = 512 using Gaussian algorithm using the above is summarized as approximation as in [11] and then concatenated with 24Algorithm 2, where denotes the set of unfrozen bitsa that CRC with generator polynomial g(D) = D24 + D23 + D6 + should be flipped at level 5 D + D + 1 (see [12]). In this regard, the coding rate for Algorithm bit-flipping decoding polar codes is2:RProgressive = 1/2 while the effective information rate is K−24 . received vector R Input: = N the , unfrozen set In Fig. 5,recovered we compare the BLER performance of Algorithm Output: sequence 2 with level SC = {1, 2} and CA-SCL decoder with list size L = {2, 4}. InCRC(ˆ particular, ) = the pruning do rules introduced in Section IV-B are not+used 1 here, i.e., each node at level = {1, 2} always chooses to generate child nodes. toWe also use the geniegenerate criticalitssets at level form aided select SC decoder (alsoin called Oracle-Assisted a an increasing order of SC Decoder), as in [7], [8],Bit-Flipping to predict the theoretical optimal performance, ,𝑢 which serve as lower bounds on the BLER results for practical CRC(ˆ ) = do SC flip decoders. “Genie-aided SC Decoder k” means that it if false then NoChild 10 11 12 13 construct of current node if NotSelect ) = true then remove from generate child nodes using else Algorithm 2: Progressive bit-flipping decoding Input: the received vector y1N , unfrozen set A Output: recovered sequence ûN 1 N N 1 û1 ← SC(y1 , A), l ← 0 //initialization N 2 while CRC(û1 ) = failure do 3 l ←l+1 4 generate critical sets at level l to form Sl i )| 5 select some ui ∈ Sl in an increasing order of |L(u µi N 6 ûN 1 ← Bit-Flipping(y1 , A, ui ) N 7 while CRC(û1 ) = failure do 8 if ENoChild = false then 9 construct S of current node 10 if EV. (ui ) = trueRESULTS then NotSelect S IMULATION 11 remove ui from S In this section, the BLER performance and the computation12 child progressive nodes usingbit-flipping S al complexity of generate the proposed algoelse are investigated. Specifically, we focus on transmissions if every ui over ∈ Sl has beenchannel flipped then BPSK modulation AWGN (details have 15 go toIII-C). step 3Polar codes are constructed with been given in Section 16 parameters else = 1024 and = 512 using Gaussian approxi17 stepconcatenated 5 mation as in [11] go andtothen with a 24 23 +1 generator polynomial ) = 24 N this regard, the coding rate for polar codes is (see [12]). In 18 return û1 24 = 1 while the effective information rate is 13 rithm 14 with 1 .        %ORFNHUURUUDWH bits. Therefore, the progressive bit-flipping decoding can be viewed as a tree search process.     6&'HFRGHU &5&DLGHG6&/LVW /  *HQLHDLGHG6&'HFRGHU $OJRULWKPOHYHO &5&DLGHG6&/LVW /  *HQLHDLGHG6&'HFRGHU $OJRULWKPOHYHO            ( E 1 G% Fig.5.5. BLER performance of Algorithm 2 with level = 1 and level = 2 2. In Fig. 5, we compare the BLER performance of Algorithm 2can with level correct theand CA-SCL decoder list size always first k incorrect hardwith decisions met by . In particular, the pruning rules introduced Section SC decoder, but no more errors can be corrected. Asinshown in IV-B arethe notBLER used here, i.e., eachof node at level 2 with level always Fig. 5, performance Algorithm =1 chooses to generate its child nodes.with We list alsosize useLthe outperforms the CA-SCL decoder = genie2, but aided SC decoder (also called Oracle-Assisted SC Decoder), with only 50% computational complexity at medium to high as in [7], [8],(see to Fig. predict the theoretical SNR region 7), and as the level optimal increasesperformance, to levle= 2, which serve as lower bounds on the BLER results forLpractical Algorithm 2 outperforms the CA-SCL decoder with = 4, but SC decoders. “Genie-aidedcomplexity SC Decoderat medium ” meanstothat it withflip only 25% computational high can always correct the first incorrect hard decisions met by SNR region. Furthermore, Algorithm 2 can achieve almost SC but no moreaserrors can be corrected. As shown in the decoder, same performance the Genie-aided SC decoder if they Fig. 5, the BLER performance of Algorithm 2 with level hard =1 are designed to correct the same number of incorrect outperforms decisions in the SCCA-SCL decoding.decoder with a list size of = 2, but 50% computational at mediumoftoAlgohigh In Fig. 6, we compare thecomplexity BLER performance SNR region (see Fig. 7), and as the level increases to levle= 2 rithm 2 with level = 4 and CA-SCL decoder with list size Algorithm 2 outperforms the CA-SCL decoder with = 4, but L = {16, 32}. The detailed pruning rules and corresponding computational complexity high parameters25% are listed in Table II, where theat∅medium notationtomeans SNR region. Furthermore, Algorithm 2 can achieve almost the same performance as the Genie-aided SC decoder if they are designed to correct the same number of incorrect hard decisions in SC decoding. In Fig. 6, we compare the BLER performance of Algorithm 2 with level = 4 and CA-SCL decoder with list size     %ORFN(UURU5DWH estimate for most cases, and the search stops at an early time. Note that, in low SNR regime, the complexity of the proposed algorithm grows rapidly since more paths need to be searched when error becomes more random, while we also note that in practical system, the low SNR region is not a region of interest because the decoding procedure is usually not activated at a low SNR region due to the high BLER. &$6&/ /  &$6&/ /  $OJRULWKPOHYHO      VI.          ( E 1 G% Fig. 6. BLER performance of Algorithm 2 with level = 4 vs. CA-SCL decoder with L = 16 and L = 32. that the corresponding pruning rule introduced in Section IVB is not used. For instance, ω0 is ∅ for all SNRs, which implies that for each node (in fact only one) at level 0, it always chooses to generate its child nodes. We observe that for higher decoding level, such as level = 4, the proposed bit-flipping decoder can achieve superior BLER performance, which competes with the CA-SCL decoder with a list size L = 32 and outperforms CA-SCL decoder with L = 16. Moreover, the computational complexity is dramatically reduced and even degrades to that of SC decoding at medium to high SNR region (see Fig. 7). TABLE II T HE PARAMETERS USED IN A LGORITHM 2 WITH LEVEL = 4 Eb /N0 (dB) (γleft , γright ) ω0 , ω1 , ω4 ω2 ω3 N = 1024, K = 512 1.5 1.75 2 (3.6, 2) (3.6, 2) (3.6, 2) ∅ ∅ ∅ 0.5 0.5 0.5 0.25 0.25 0.25 2.25 (4, 3) ∅ 0.6 0.3 2.5 (6, 5) ∅ 0.6 0.3  &$6&/ /  &$6&/ /  &$6&/ /  &$6&/ /  $OJRULWKPOHYHO  $OJRULWKPOHYHO  $OJRULWKPOHYHO  6&'HFRGHU  $YHUDJH1RUPDOL]HG&RPSOH[LW\ A critical set S which with high probability includes the first incorrect hard decision in SC decoding is proposed. By iteratively modifying the critical set, multi-layer critical sets are established. On this basis, a progressive multi-level bitflipping decoder which can correct multiple errors in SC decoding is proposed. We show that as the level increases, the BLER performance of the proposed progressive bit-flipping decoder competes with the corresponding CA-SCL decoder. Furthermore, the average complexity of the proposed algorithm is much lower than that of a SCL decoder (and is similar to that of SC decoding) at medium to high SNR. ACKNOWLEDGEMENT This work was supported in part by National Hi-Tech R&D Program of China (No. 2014AA01A702), National Natural Science Foundation of China (No. 61371094, No. 61401391), National Key Basic Research Program of China (No. 2012CB316104), Zhejiang Provincial Natural Science Foundation (No. LR12F01002), the open project of Zhejiang Provincial Key Laboratory of Information Proc., Commun. & Netw., China, HIRP Flagship Projects from Huawei Technologies Co., Ltd (YB2013120029 and YB2015040053), Natural Science Foundation of Fujian Province (No. 2017J01106), and Key Project of Natural Science Fund for Young Scholars in Universities and Colleges of Fujian Province (No. JZ160489). R EFERENCES                 CONCLUSION    ( E 1 G% Fig. 7. Average complexity of Algorithm 2 normalized by the complexity of standard SC decoding The average computational complexity of Algorithm 2 is investigated in Fig. 7. It can be seen that the average complexity decreases rapidly as SNR increases. The reason is that as the underlying channel turns to be more reliable, it is sufficient to flip only one or two unfrozen bits to obtain the correct [1] E. Arıkan, “Channel polarization: A method for constructing capacityachieving codes for symmetric binary-input memoryless channels,” IEEE Trans. Inf. Theory, vol. 55, no. 7, pp. 3051-3073, Jul. 2009. [2] Chairmans notes, 3GPP TSG RAN WG1 #87, 2016. [3] I. Tal and A. Vardy, “List decoding of polar codes,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), pp. 1-5, Aug. 2011. [4] B. Li, H. Shen, and D. Tse, “An adaptive successive cancellation list decoder for polar codes with cyclic redundancy check,” IEEE Commun. Lett., vol. 16, no. 12, pp. 2044-2047, Dec. 2012. [5] K. Chen, K. Niu, and J. R. Lin, “Improved successive cancellation decoding of polar codes,” IEEE Trans. Commun., vol. 61, no. 8, pp. 3100-3107, Aug. 2013. [6] M. Mondelli, S. H. Hassani and R. Urbanke, “Scaling exponent of list decoders with applications to polar codes,” IEEE Trans. Inf. Theory, vol. 61, no. 9, pp. 4838-4851, Sep. 2015. [7] O. Afisiadis, A. Balatsoukas-Stimming, and A. Burg, “A low-complexity improved successive cancellation decoder for polar codes,” in Proc. 48th Asilomar Conf. Signals, Systems and Computers, pp. 2116-2120, Nov. 2014. [8] L. Chandesris, V. Savin, and D. Declercq, “An Improved SCFlip Decoder for Polar Codes,” in Proc. Global Commun. Conf. (GLOBECOM), pp. 1-6, Dec. 2016. [9] A. Alamdar-Yazdi and F. R. Kschischang, “A simplified successivecancellation decoder for polar codes,” IEEE Commun. Lett., vol. 15, no. 12, pp. 1378-1380, Dec. 2011. [10] S.-Y. Chung, T. J. Richardson, and R. Urbanke, “Analysis of sumproduct decoding of low-density parity-check codes using a Gaussian approximation,” IEEE Trans. Inf. Theory, vol. 47, no. 2, pp. 657-670, Feb. 2001. [11] P. Trifonov, “Efficient design and decoding of polar codes,” IEEE Trans. Commun., vol. 60, no. 11, pp. 3221-3227, Nov. 2012. [12] J. G. Proakis, Digital Communications. McGraw Hill, 1995.
7cs.IT
arXiv:1603.02063v2 [cs.DS] 30 Mar 2016 Aggregated 2D Range Queries on Clustered Points✩ Nieves R. Brisaboaa , Guillermo De Bernardob , Roberto Konowc , Gonzalo Navarroc , Diego Seco d a University of A Coruña, Campus de Elviña, A Coruña, Spain b Enxenio S.L., Baños de Arteixo, A Coruña, Spain c DCC, University of Chile, Beauchef 851, Santiago, Chile d University of Concepción, Edmundo Larenas 219, Concepción, Chile Abstract Efficient processing of aggregated range queries on two-dimensional grids is a common requirement in information retrieval and data mining systems, for example in Geographic Information Systems and OLAP cubes. We introduce a technique to represent grids supporting aggregated range queries that requires little space when the data points in the grid are clustered, which is common in practice. We show how this general technique can be used to support two important types of aggregated queries, which are ranked range queries and counting range queries. Our experimental evaluation shows that this technique can speed up aggregated queries up to more than an order of magnitude, with a small space overhead. Keywords: Compact Data Structures, Grids, Query Processing, Aggregated queries, Clustered Points ✩ Funded in part by European Union’s Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No 690941, by Millennium Nucleus Information and Coordination in Networks ICM/FIC P10-024F (Chile), by MINECO (PGE and FEDER) Projects TIN2013-46238-C4-3-R and TIN2013-46801-C4-3-R (Spain), and also by Xunta de Galicia (GRC2013/053) (Spain). A preliminary partial version of this article appeared in Proc. SPIRE 2014, pp. 215–226. ✩✩ This is an Author’s Original Manuscript of an article whose final and definitive form, the Version of Record, has been published in Information Systems [copyright Elsevier], available online at: http://dx.doi.org/10.1016/j.is.2016.03.004. Corresponding author: [email protected]. Tel.: +56 41 2204692; fax: +56 41 2221770 Preprint submitted to Information Systems April 1, 2016 1. Introduction Many problems in different domains can be interpreted geometrically by modeling data records as multidimensional points and transforming queries about the original records into queries on the point sets [1, Chapter 5]. In 2D, for example, orthogonal range queries on a grid can be used to solve queries of the form “report all employees born between y0 and y1 who earn between s1 and s2 dollars”, which are very common in databases. In the same way, other aggregated range queries (e.g., top-k, counting, quantile, majority, etc.) have proved to be useful for data analysis in various domains, such as Geographic Information Systems (GIS), OLAP databases, Information Retrieval, and Data Mining, among others [2]. In GIS, aggregated range queries can facilitate decision making [3] by counting, for example, the number of locations within a specific area for which the values of pollution are above a threshold. Similarly, top-k range queries on an OLAP database1 of sales can be used to find the sellers with most sales in a time slice. In this example, the two dimensions of the grid are seller ids (arranged hierarchically in order to allow queries for sellers, stores, areas, etc.) and time (in periods of hours, days, weeks, etc.), and the weights associated to the data points are the amount of sales made by a seller during a time slice. Thus, the query asks for the k heaviest points in some range Q = [i1 , i2 ] × [t1 , t2 ] of the grid. The approach of modeling problems using a geometric formulation is wellknown. There are many classical representations that support the queries required by the model and solve them efficiently. Range trees [4] and kd-trees [5] are two paradigmatic examples. Some of these classical data structures are even optimal both in query time and space. However, such classical representations usually do not take advantage of the distribution of the data in order to reduce the space requirements. When dealing with massive data, which is the case of some of the aforementioned data mining applications, the use of space-efficient data structures can make the difference between maintaining the data in main memory or having to resort to (orders of magnitude slower) external memory. In this work we consider the case where we have clustered points in a 2D grid, which is a common scenario in domains such as Geographic Information Systems, Web graphs, social networks, etc. There are some well-known prin1 The support of more than two dimensions is essential in OLAP databases. We discuss the extension to multi-dimensional structures in the conclusions. 2 ciples that hold in most scenarios of that kind. Two examples are Tobler’s first law of geography [6], which states that near things are more related than distant things, and the locality of reference for time-dependent data. This is also the case in Web graphs [7], where clusters appear when the Web pages are sorted by URL. We take advantage of these clusters in order to reduce the space of the data structures for aggregated 2D range queries. The K 2 -tree [8] (a space-efficient version of the classical Quadtree) is a good data structure to solve range queries on clustered points and it has been extensively evaluated in different domains [9, 10, 11]. We introduce a general technique to extend this data structure in order to support aggregated range queries. We then illustrate its potential by instantiating the technique in two emblematic cases: range counting and ranked (MAX/MIN) queries within a 2D range. The paper is organized as follows. First, we introduce basic concepts and related work in Sections 2 and 3, respectively. In Section 4 we describe the general technique to extend the K 2 -tree to solve different aggregated range queries on grids. Two paradigmatic examples of such queries are described in Section 5 (ranked range queries) and Section 6 (range counting queries). Section 7 presents an exhaustive empirical evaluation of the proposed solutions. Finally, Section 8 concludes and sketches some interesting lines of future work. 2. Basic Concepts 2.1. Aggregated queries on clustered points We consider two dimensional grids with n columns and m rows, where each cell aij can either be empty or contain a weight in the range [0, d − 1] (see Fig. 1). For some problems, we will omit the weights and just consider the non-empty cells, which can be represented as a binary matrix (Fig. 2) in which each cell contains a 1 (if there is a weighted point in the original matrix) or a 0 (in other case). Let t be the number of 1s in the binary matrix (i.e., the number of weighted points). If we can partition the t points into c clusters, not necessarily disjoint and c << t, we will say that the points are clustered. This definition is used by Gagie et al. [12] to show that in such case a Quadtree P needs only O(c log u + i ti log li ) bits, where u = max(n, m), and ti and li are the number of points and the diameter of cluster i, respectively. 3 Figure 1: Weighted ma- Figure 2: Binary ma- Figure 3: Range query. trix. trix. A range query Q = [x1 , x2 ] × [y1 , y2] defines a rectangle with all the columns in the range [x1 , x2 ] and the rows in [y1 , y2 ] (see Fig. 3). An aggregated range query defines, in addition to the range, an aggregate function that must be applied to the data points in the query range. Examples of aggregated queries are COUN T (Q), which counts the number of data points in the query range, MAX /MIN (Q), which computes the maximum (alt. minimum) value in the query range, and its generalization top-k, which retrieves the k lightest (alt. heaviest) points in the query range. These top-k queries are also referred to in the literature as ranked range queries. For the range query q in Fig. 3 the result of COUN T (q) is 6, MAX (q) returns 7, MIN (q) returns 1, and the top-3 heaviest elements are 7, 4, and 3. There are other interesting data-analysis queries on two-dimensional grids. For example, QUAN T ILE(Q, a) returns the a-th smallest value in Q, and MAJ ORIT Y(Q, α) retrieves those values in Q that appear with relative frequency larger than α. These and other queries have been studied by Navarro et al. [13], who introduce space-efficient data structures with good time performance. We restrict ourselves to an emblematic subset of these queries, and propose data structures that are even more space-efficient when the points in the set are clustered. 2.2. Rank and select on bitmaps Two basic primitives used by most space-efficient data structures are rank and select on bitmaps. Let B[1, n] be a sequence of bits, or a bitmap. We define operation rankb (B, i) as the number of occurrences of b ∈ {0, 1} in B[1, i], and selectb (B, j) as the position in B of the j-th occurrence of b. B can be represented using n + o(n) bits [14, 15], so that both operations are solved in constant time. These operations have proved very efficient in 4 practice [16]. In addition, when the bitmaps are compressible, it is possible to reduce the space and still support these operations in constant time [17]. 2.3. Wavelet tree and discrete grids An elegant generalization of rank and select queries to an arbitrary alphabet Σ of size σ is provided by the wavelet tree [18]. Given a sequence S over the alphabet Σ, the wavelet tree supports rank, select and access in O(log σ) time with n log σ +o(n log σ) bits. The wavelet tree is a complete binary tree, in which each node represents a range R ⊆ [1, σ] of the alphabet Σ, its left child represents a subset Rℓ ⊂ R and the right child the subset Rr = R \ Rℓ . Every node representing subset R is associated with a subsequence S ′ of the input sequence S composed of the elements whose values are in R. The node only stores a bitmap of length |S ′ | such that a 0 bit at position i means that S ′ [i] belongs to Rℓ , and a 1 bit means that it belongs to Rr . The three basic operations require to traverse the tree from the root to a leaf (for rank and access) or from a leaf to the root (for select) via rank and select operations on the bitmaps stored at the nodes of the wavelet tree (those bitmaps are then represented with the techniques cited above). The wavelet tree can also be used to represent grids [19, 20]. An n × m grid with n points, exactly one per column (i.e., x values are unique), can be represented using a wavelet tree. In this case, this is a perfect balanced binary tree of height ⌈log m⌉ where each node corresponds to a contiguous range of values y ∈ [1, m] and represents the points falling in that y-range, sorted by increasing x-coordinate. The root represents [1, m] and the two children of each node split its y-range by half. The leaves represent a single y-coordinate. Each internal node stores a bitmap, which tells whether each point corresponds to its left or right child. Using rank and select queries on the bitmaps, the wavelet tree uses n log m + o(n log m) bits, and can count the number of points in a range in O(log m) time, because the query is decomposed into bitmap ranges on at most 2 nodes per wavelet tree level (see Section 3). Any point can be tracked up (to find its x-coordinate) or down (to find its y-coordinate) in O(log m) time as well. When the grids may contain more than one point per column, an additional bitmap B is used to map from the original domain to a new domain that has one point per column. This bitmap stores, for each column, a bit 1 followed by as many zeros as the number of points in such column. Then, a range of columns [cs , ce ] in the original domain can be mapped to a new range [select1 (B, cs ) − cs + 1, select1 (B, ce + 1) − ce − 1]. If the grid is very 5 Figure 4: On the left, the conceptual K 2 -tree for the binary matrix in Fig. 2 (highlighted edges are traversed when computing the range query in Fig. 3). On the right, the two bitmaps that are actually used to store the tree. sparse and/or the distribution of the data points is very skewed, this bitmap can be compressed with RRR [17] or the sd-bitvector [21]. 2.4. K 2 -trees The K 2 -tree [8] is a data structure designed to compactly represent sparse binary matrices (which can also be regarded as point grids). The K 2 -tree subdivides the matrix into K 2 submatrices of equal size. In this regard, when K = 2, the K 2 -tree performs the same space partitioning of the traditional Quadtree. The submatrices are considered left-to-right and top-to-bottom (i.e., in Morton order), and each is represented with a bit, set to 1 if the submatrix contains at least one non-zero cell. Each node whose bit is 1 is recursively decomposed, subdividing its submatrix into K 2 children, and so on. The subdivision ends when a fully-zero submatrix is found or when we reach the individual cells. A K 2 -tree for the running example is shown in Fig. 4. The K 2 -tree is stored in two bitmaps: T stores the bits of all the levels except the last one, in a level-order traversal, and L stores the bits of the last level (corresponding to individual cells). Given a node whose bit is at position p in T , its children nodes are located after position rank1 (T, p) · K 2 . This property enables K 2 -tree traversals using just T and L. 2 The worst-case space, if t points are in an n×n matrix, is K 2 t logK 2 nt (1+ 2 o(1)) bits. This can be reduced to t log nt (1 + o(1)) if the bitmaps are compressed. This is similar to the space achieved by a wavelet tree, but in practice K 2 -trees use much less space when the points are clustered. Gagie et al. [12] P show that this quadtree-like partitioning results in O(c log n+ i ti log li ) bits, when the t points can be partitioned into c clusters with ti , . . . , tc points and diameters l1 , . . . , lc . Therefore, the K 2 -tree is competitive in domains where 6 ALGORITHM 1: Range(n, x1 , x2 , y1 , y2 , dp , dq , p) lists all non-empty cells in [x1 , x2 ] × [y1 , y2 ] with a k2 -tree if p ≥ |T | then /* leaf */ if L[p − |T |] = 1 then output (dp , dq ) else/* internal node */ if p = −1 or T [p] = 1 then y ← rank1 (T, p) · k2 for i ← ⌊x1 /(n/k)⌋ . . . ⌊x2 /(n/k)⌋ do if i ← ⌊x1 /(n/k)⌋ then x′1 ← x1 mod (n/k) else x′1 ← 0 if i ← ⌊x2 /(n/k)⌋ then x′2 ← x2 mod (n/k) else x′2 ← (n/k) − 1 for j ← ⌊y1 /(n/k)⌋ . . . ⌊y2 /(n/k)⌋ do if j = ⌊y1 /(n/k)⌋ then y1′ ← y1 mod (n/k) else y1′ ← 0 if j = ⌊y2 /(n/k)⌋ then y2′ ← y2 mod (n/k) else y2′ ← (n/k) − 1 Range(n/k, x′1 , x′2 , y1′ , y2′ , dp + (n/k) · i, dq + (n/k) · j, y + k · i + j) end end end end such clusters arise, for example in Web graphs or social networks. Among other types of queries (such as direct/reverse neighbors, check edge, etc.), the K 2 -tree can answer range queries with multi-branch top-down traversal of the tree, following only the branches that overlap the query range. This is illustrated in Algorithm 1 (adapted from [8, Alg. 1]), which solves the query Q = [x1 , x2 ] × [y1 , y2 ] by invoking Range(n, x1 , x2 , y1 , y2 , 0, 0, −1). To show an example, in Fig. 4 the edges traversed in the computation of the range query in Fig. 3 are highlighted. As mentioned above, this traversal is computed via rank queries on T . While this algorithm has no good worst-case time guarantees, in practice times are competitive. 2.5. Treaps, priority search trees and ranked range queries A treap [22] is a binary search tree whose n nodes have two attributes: key and priority. The treap maintains the binary search tree invariants for the keys and the heap invariants for the priorities, that is, the key of a node is larger than those in its left subtree and smaller than those in its right subtree, whereas its priority is not smaller than those in its subtree. The treap does not guarantee logarithmic height, except on expectation if priorities are independent of keys [23]. A treap can also be regarded as the Cartesian tree [24] 7 of the sequence of priorities once the values are sorted by keys. The succinct representations of the Cartesian tree topology [25] are called range maximum query (RMQ) data structures, use just 2n + o(n) bits, and are sufficient to find the maximum in any range of the sequence. By also storing the priority data, they can answer top-k queries in O(k log k) or O(k log log n) time. The treap can also be used to compress the representation of keys and priorities [26]. Similar data structures for two or more dimensions are convenient only for dense grids (full of points) [27]. The priority search tree [28] is somewhat similar, but it is balanced. In this case, a node is not the one with highest priority in its subtree, but the highest-priority element is stored in addition to the element at the node, and removed from the subtree. Priority search trees can be used to solve 3-sided range queries on t-point grids, returning k points in time O(k + log t). This has been used to add rank query capabilities to several index data structures such as suffix trees and range trees [29]. 3. Related Work Navarro et al. [13] introduce compact data structures for various queries on two-dimensional weighted points, including range top-k queries and range counting queries. Their solutions are based on wavelet trees. For range top-k queries, the bitmap of each node of the wavelet tree is enhanced as follows: Let x1 , . . . , xr be the points represented at a node, and w(x) be the weight of point x. Then, a RMQ data structure built on w(x1 ), . . . , w(xr ) is stored together with the bitmap. Such a structure uses 2r + o(r) bits and finds the maximum weight in any range [w(xi ), . . . , w(xj )] in constant time [25] and without accessing the weights themselves. Therefore, the total space becomes 3n log m + o(n log m) bits. To solve top-k queries on a grid range Q = [x1 , x2 ] × [y1 , y2], we first traverse the wavelet tree to identify the O(log m) bitmap intervals where the points in Q lie. The heaviest point in Q in each bitmap interval is obtained with an RMQ, but we need to obtain the actual priorities in order to find the heaviest among the O(log m) candidates. The priorities are stored sorted by x- or y-coordinate, so we obtain each one in O(log m) time by tracking the point with maximum weight in each interval. Thus a top-1 query is solved in O(log2 m) time. For a top-k query, we must maintain a priority queue of the candidate intervals and, each time the next heaviest element is found, we remove it from its interval and reinsert in the queue the two resulting 8 subintervals. The total query time is O((k + log m) log(km)). It is possible to reduce the time to O((k + log m) logǫ m) time and O( 1ǫ n log m) bits, for any constant ǫ > 0 [30], but the space usage is much higher, even if linear. Wavelet trees can also compute range counting queries in O(log m) time with n log m + o(n log m) bits. The algorithm to solve range counting queries on a grid range Q = [x1 , x2 ] × [y1 , y2 ] also starts by traversing the wavelet tree to identify the O(log m) bitmap intervals where the points in Q lie, but then it just adds up all the bitmap interval lengths. A better result, using multi-ary wavelet trees, was introduced by Bose et al. [31]. They match the optimal O(log n/ log log n) time using just n log n + o(n log n) bits on an n × n grid. Barbay et al. [32] extended the results to n × m grids. This query time is optimal within space O(n polylog(n)) [33]. 4. Augmenting the K 2 -tree In this section we describe a general technique that can be used to solve aggregated range queries on clustered points. We then present two applications of this technique to answer two paradigmatic examples, ranked range queries and range counting queries. These examples illustrate how to adjust and tune the general technique for particular operations. Let M[n × n] be a matrix in which cells can be empty or contain a weight in the range [0, d − 1] and let BM[n × n] be a binary matrix in which each cell contains a zero or a one. Matrix BM represents the topology of M, that is, BM[i][j] = 1 iff M[i][j] is not empty. We store separately the topology of the matrix and the weights associated with the non-empty cells. For the topology, we use a K 2 -tree representation of BM (recall Section 2.4), which will take advantage of clustering. A level-wise traversal of the K 2 -tree can be used to map each node to a position in an array of aggregated values, which stores a summary of the weights in the submatrix of the node. Thus the position where the aggregated value of a node is stored is easily computed from the node position in T . The specific value of this summary depends on the operation. For example, for ranked range queries (Section 5) the summary represents the maximum weight in the corresponding submatrix, whereas for counting queries (Section 6), it represents the number of non-empty cells in the submatrix. However, a common property is that the value associated with a node aggregates information about its K 2 children. Therefore, we use a sort of differential encoding [34] to encode the values of each node with respect to 9 the value of its parent. In other words, the information of a node (such as its summary and number of children) is used to represent the information of its children in a more compact way. In order to access the original (noncompressed) information of a node we need to first access its parent (i.e., the operations in this technique are restricted to root-to-leaf traversals). To summarize, we use a K 2 -tree to represent the topology of the data and augment each node of such a tree with additional values that represent the aggregated information related with the operation to be supported. These aggregated values are differentially encoded with respect to information of the parent node in order to store them in reduced space. In the following sections we show how both the K 2 -tree and the differentially encoded values can be tuned to efficiently solve two types of queries. Finally, note that we present our results for matrices of size n × n. This does not lose generality, as we can extend a matrix M ′ [n × m] with zeros to complete a square matrix M[n × n] (w.l.o.g. we assume m ≤ n). As the topology of the matrix is represented with a K 2 -tree, this does not cause a significant overhead because the K 2 -tree is efficient to handle large areas of zeros. Actually, we round n up to the next power of K [8]. 5. Answering Ranked (Max/Min) Range Queries We present a first application of the general technique described in the previous section, to solve ranked range queries. We present the case of MAX queries, but the results are analogous for MIN queries. We name this datastructure K 2 -treap, as it conceptually combines a K 2 -tree with a treap data structure. Consider a matrix M[n×n] where each cell can either be empty or contain a weight in the range [0, d−1]. We consider a quadtree-like recursive partition of M into K 2 submatrices, the same performed in the K 2 -tree with binary matrices. We build a conceptual K 2 -ary tree similar to the K 2 -tree, as follows: the root of the tree will store the coordinates of the cell with the maximum weight of the matrix, and the corresponding weight. Then the cell just added to the tree is marked as empty, deleting it from the matrix. If many cells share the maximum weight, we pick any of them. Then, the matrix is conceptually decomposed into K 2 equal-sized submatrices, and we add K 2 children nodes to the root of the tree, each representing one of the submatrices. We repeat the assignment process recursively for each child, assigning to each of them the coordinates and value of the heaviest cell in 10 Figure 5: Example of a K 2 -treap construction for the matrix in Fig. 1. At the top, Mi represents the state of the matrix at level i of the decomposition. On the bottom, the conceptual K 2 -treap. the corresponding submatrix and removing the chosen point. The procedure continues recursively on each branch until we reach the cells of the matrix, or we find a completely empty submatrix (either because the submatrix was initially empty or because we emptied it by successively extracting heaviest points). Fig. 5 shows an example of K 2 -treap construction, for K = 2. On the top of the image we show the state of the matrix at each level of the decomposition. M0 represents the original matrix, where the maximum value is highlighted. The coordinates and value of this cell are stored in the root of the tree. In the next level of the decomposition (matrix M1) we find the maximum values in each quadrant (notice that the cell assigned to the root has already been removed from the matrix) and assign them to the children of the root node. The process continues recursively, subdividing each matrix into K 2 submatrices. The cells chosen as local maxima are highlighted in the matrices corresponding to each level, except in the last level where all the cells are local maxima. Empty submatrices are marked in the tree with the symbol “-”. 11 Figure 6: Storage of the conceptual tree in our data structures. On the top, the differentially encoded conceptual K 2 -treap. On the bottom left, the conceptual K 2 -tree that stores the topology of the matrix, and its bitmap implementation T . On the bottom right, the local maximum values. 5.1. Local maximum coordinates The data structure is represented in three parts: The coordinates of the local maxima, the weights of the local maxima, and the tree topology. The conceptual K 2 -treap is traversed level-wise, reading the sequence of cell coordinates from left to right in each level. The sequence of coordinates at each level ℓ is stored in a different sequence coord[ℓ]. The coordinates at each level ℓ of the tree are transformed into an offset in the corresponding submatrix, representing each ci as ci mod (n/K ℓ ) using ⌈log(n) − ℓ log K⌉ bits. For example, in Fig. 6 (top) the coordinates of node N1 have been transformed from the global value (4, 4) to a local offset (0, 0). In the bottom of Fig. 6 we highlight the coordinates of nodes N0, N1 and N2 in the corresponding coord arrays. In the last level all nodes represent single cells, so there is no coord array in this level. With this representation, the worstPlog (t) 2 case space for storing t points is ℓ=0K2 2K 2ℓ log Knℓ = t log nt (1+O(1/K 2 )), that is, the same as if we stored the points using the K 2 -tree. 5.2. Local maximum values The maximum value in each node is encoded differentially with respect to the maximum of its parent node [34]. The result of the differential encoding 12 is a new sequence of non-negative values, smaller than the original. Now the K 2 -treap is traversed level-wise and the complete sequence of values is stored in a single sequence named values. To exploit the small values while allowing efficient direct access to the array, we represent values with Direct Access Codes (DACs) [35]. Following the example in Fig. 6, the value of node N1 has been transformed from 7 to 8 − 7 = 1. The bottom of the figure depicts the complete sequence values. We also store a small array first[0, logK 2 n] that stores the offset in values where each level starts. 5.3. Tree structure We separate the structure of the tree from the values stored in the nodes. The tree structure of the K 2 -treap is stored in a K 2 -tree. Fig. 6 shows the K 2 -tree representation of the example tree, where only cells with value are labeled with a 1. We will consider a K 2 -tree stored in a single bitmap T with rank support, that contains the sequence of bits from all the levels of the tree. Our representation differs from a classic K 2 -tree (which uses two bitmaps T and L and only adds rank support to T ) because we will need to perform rank operations also in the last level of the tree. The other difference is that points stored separately are removed from the grid. Thus, we save the K 2 -tree space needed to store those removed points. Our analysis above shows that, in a worst-case scenario, the saved and the extra space cancel out each other, thus storing those explicit coordinates is free in the worst case. 5.4. Query processing 5.4.1. Basic navigation To access a cell C = (x, y) in the K 2 -treap we start accessing the K 2 -tree root. The coordinates and weight of the element stored at the root node are (x0 , y0 ) = coord[0][0] and w0 = values[0]. If (x0 , y0) = C, we return w0 immediately. Otherwise, we find the quadrant where the cell would be located and navigate to that node in the K 2 -tree. Let p be the position of the node in T . If T [p] = 0 we know that the complete submatrix is empty and return immediately. Otherwise, we need to find the coordinates and weight of the new node. Since only nodes set to 1 in T have coordinates and weights, we compute r = rank1 (T, p). The value of the current node will be at values[r], and its coordinates at coord[ℓ][r −first[ℓ]], where ℓ is the current level. We rebuild the absolute value and coordinates, w1 as w0 − values[r] and (x1 , y1) by adding the current submatrix offset to coord[ℓ][r − first[ℓ]]. If (x1 , y1) = C we return w1 , otherwise we find again the appropriate quadrant 13 in the current submatrix where C would be located, and so on. The formula to find the children is identical to that of the K 2 -tree. The process is repeated recursively until we find a 0 bit in the target submatrix, we find a 1 in the last level of the K 2 -tree, or we find the coordinates of the cell in an explicit point. 5.4.2. Top-k queries The process to answer top-k queries starts at the root of the tree. Given a range Q = [x1 , x2 ] × [y1 , y2 ], the process initializes an empty max-priority queue and inserts the root of the K 2 -tree. The priority queue stores, in general, K 2 -tree nodes sorted by their associated maximum weight (for the root node, this is w0 ). Now, we iteratively extract the first element from the priority queue (the first time this is the root). If the coordinates of its maximum element fall inside Q, we output it as the next answer. In either case, we insert all the children of the extracted node whose submatrix intersects with Q, and iterate. The process finishes when k results have been found or when the priority queue becomes empty (in which case there are less than k elements in Q). 5.4.3. Other supported queries The K 2 -treap can also answer basic range queries (i.e., report all the points that fall in Q). This is similar to the procedure on a K 2 -tree, where the submatrices that intersect Q are explored in a depth-first manner. The only difference is that we must also check whether the explicit points associated to the nodes fall within Q, and in that case report those as well. Finally, we can also answer interval queries, which ask for all the points in Q whose weight is in a range [w1 , w2 ]. To do this, we traverse the tree as in a top-k range query, but we only output weights whose value is in [w1 , w2 ]. Moreover, we discard submatrices whose maximum weight is below w2 . 6. Answering Range Counting Queries Consider a binary matrix BM[n × n] where each cell can either be empty or contain data2 . In this case, a K 2 -tree can be used to represent BM 2 It is easy to allow having more than one point per cell, by using the aggregated sums described in Section 6.1.2. 14 Figure 7: Storage of the conceptual tree in our data structures. On the top, the conceptual K 2 -treap for the binary matrix in Fig. 2. On the bottom left, the conceptual K 2 -tree that stores the topology of the matrix. On the bottom right, the bitmap that implements the k 2 -tree, T , and the sequence of differentially encoded counting values, counts. succinctly while supporting range queries, as explained in Section 2.4. Obviously, the algorithm presented for range reporting can be optimized to count the number of elements in a range, instead of reporting such elements. In this section, we show how to augment the K 2 -tree with additional data to further optimize those range counting queries. In Section 7 we show that this adds a small overhead in space, while drastically reducing the running time of those queries. 6.1. Augmenting the K 2 -tree The augmented data structure stores additional information to speed up range counting queries. In Fig. 7 we show a conceptual K 2 -tree in which each node has been annotated with the number of elements in its corresponding submatrix. Note that this is the same example of Fig. 5, considering as non-empty cells those with weight larger than 0. This conceptual tree is traversed level-wise, reading the sequence of counts from left to right at each level. All these counts are stored in a sequence counts using a variant of the differential encoding technique presented in Section 4. Let v be a node of the K 2 -tree, children(v) the number of children 15 of v, and count(v) the number of elements in the submatrix represented by count(v) v. Then, count(v ′ ) = children(v) represents the expected number of elements in the submatrix associated with each child v ′ of v, assuming a uniform distribution. Thus, the count of each node v ′ is stored as the difference of the actual count and its expected value. In the running example, the root has three children and there are 22 elements in the matrix. Each of the corresponding submatrices is expected to contain ⌊22/3⌋ = 7 elements whereas they actually contain 10, 7 and 5 elements, respectively. Hence, the differential encoding stores 10 − 7 = 3, 7 − 7 = 0, and 5 − 7 = −2. The result of this differential encoding is a new sequence of values smaller than the original, but which may contain negative values. In order to map this sequence, in a unique and reversible way, to a sequence of non-negative values we use the folklore overlap and interleave scheme, which maps a negative number −i to the ith -odd number (2i − 1) and a positive number j to the j th even number (2j). Finally, to exploit the small values while allowing efficient direct access to the sequence, we represent counts with DACs [35]. As counts corresponds with a level-wise traversal of the K 2 -tree, it is not necessary to store this additional information for all the levels of the tree. In this way, we provide a parametrized implementation that sets the space overhead by defining the number of levels for which counting information is stored. This provides a space-time trade-off we later study experimentally. 6.1.1. Range counting queries The base of the range counting algorithm is the range reporting algorithm of the K 2 -tree, Algorithm 1. We modify this divide-and-conquer algorithm in order to navigate both the K 2 -tree and counts at the same time. Given a query range Q = [x1 , x2 ] × [y1 , y2 ], we start accessing the K 2 -tree root, and set c0 = counts[0] and result = 0. Then, the algorithm explores all the children of the root that intersect Q and decodes the counting value of the node from the counts sequence and the absolute counting value of the root. The process continues recursively for each children until it finds a completely empty submatrix, in which case we do not increment result, or a matrix completely contained inside Q, in which case we increment result with the counting value of such matrix. To clarify the procedure, let us introduce some notation and basic functions. We name the nodes with the position of their first bit in the bitmap T that represents the K 2 -tree. Then, v = 0 is the root, v = K 2 is its first non-empty child, and so on. Recall that rank1 (T, v) · K 2 gives the position 16 in T where the children of v start and each of them is represented with K 2 bits. We can obtain the number of children of v as NumChildren(v) = rank1 (T, v + K 2 ) − rank1 (T, v − 1). Non-empty nodes store their differential encoding in counts in level order, so we must be able to compute the level order of a node in constant time. Node v stores K 2 bits that indicate which children of v are non-empty. If the ith bit is set to 1, then the level order of that child node is rank1 (T, v + i), with i ∈ [0, K 2 − 1]. Given a node v with absolute counting value cv and NumChildren(v) cv children, each child v ′ is expected to contain count(v ′) = N umChildren(v) el′ ements. Let p be the level order number of child v . Then, the absolute counting value of v ′ can be computed as cv′ = counts[p] + count(v ′ ). Note that counts is stored using DACs, which support direct access. We use the computed value cv′ to recursively visit the children of v ′ . Let us consider a query example q = [0, 1] × [0, 2]. We start at the root with c0 = 22 and result = 0. The root has three children, but only the first one, stored at position 4 in T , intersects q. Each child is expected to represent ⌊22/3⌋ = 7 elements, so we set c4 = counts[rank1 (T, 0 + 0)] + 7 = 3 + 7 = 10. Similarly, we recurse on the first and third child of this node. On the first branch of the recursion, we process node 16 and set c16 = counts[rank1 (T, 4+ 0)] + ⌊10/4⌋ = counts[4] + 2 = 2. As the submatrix corresponding with this node is contained in q, we add 2 to the result and stop the recursion on this branch. On the other child, we have to recurse until the leaves in order to sum the other element to the result, and obtain the final count of 3. 6.1.2. Other supported queries This data structure obviously supports all the queries that can be implemented on a K 2 -tree, such as range reporting or emptiness queries. More interesting is that it can also support other types of queries with minor modifications. A natural generalization of range counting queries are aggregated sum queries. In this case, we consider a matrix M[n × n] where each cell can either be empty or contain a weight in the range [0, d − 1]. We perform the same data partitioning on the conceptual binary matrix that represents the non-empty cells. In other words, we use a K 2 -tree to represent the topology of the matrix. Then, instead of augmenting the nodes with the count of the non-empty cells in the corresponding submatrix, we store the sum of the weights contained in such submatrix. The same differential encoding used for range counting can be used to store these sums. In this case, however, the space-efficiency achieved by the data structure depends not only on the 17 clustering of the data, but also on the distribution of the weights. The encoding achieves its best performance when the sums of the weights of all the children of a node are similar. 7. Experiments and Results In this section we empirically evaluate the two types of queries studied in previous sections. As the datasets and evaluated solutions for both scenarios are quite different, we devote one subsection to each type of query: we first present the experiment setup (baselines and datasets), then an evaluation in terms of space usage, and finally a running time comparison. All the data structures were implemented by ourselves and the source code is available at http://lbd.udc.es/research/aggregatedRQ. We ran all our experiments on a dedicated server with 4 Intel(R) Xeon(R) E5520 CPU cores at 2.27GHz 8MB cache and 72GB of RAM memory. The machine runs Ubuntu GNU/Linux version 9.10 with kernel 2.6.31-19-server (64 bits) and gcc 4.4.1. All the data structures were implemented in C/C++ and compiled with full optimizations. All bitmaps that are employed use a bitmap representation that supports rank and select using 5% of extra space. The wavelet tree employed to implement the solution of Navarro et al. [13] is a pointerless version obtained from LIBCDS (http://www.github.com/fclaude/libcds). This wavelet tree is augmented with an RMQ data structure at each level, which requires 2.37n bits and solves range maximum queries in constant time. 7.1. Ranked range queries 7.1.1. Experiment setup We use several synthetic datasets, as well as some real datasets where top-k queries are of interest. Our synthetic datasets are square matrices where only some of the cells have a value set. We build different matrices varying the following parameters: the size s × s of the matrix (s = 1024, 2048, 4096, 8192), the number of different weights d in the matrix (16, 128, 1024) and the percentage p of cells that have a point (10, 30, 50, 70, 100%). The distribution of the weights in all the datasets is uniform, and the spatial distribution of the cells with points is random. For example, the synthetic dataset with (s = 2048, d = 128, p = 30) has size 2048 × 2048, 30% of its cells have a value and their values follow a uniform distribution in [0, 127]. 18 Table 1: Description of the real datasets used, and space (in bits per cell) required to represent them with the compared data structures. Dataset SalesDay SalesHour #Sellers Time instants Number of K 2 -treap mk2tree wtrmq (rows) (columns) diff. values (bits/cell) (bits/cell) (bits/cell) 1314 471 297 2.48 3.75 9.08 1314 6028 158 1.06 0.99 3.90 We also test our representation using real datasets. We extracted two different views from a real OLAP database (https://www.fupbi.com 3 ) storing information about sales achieved per store/seller each hour over several months: salesDay stores the number of sales per seller per day, and salesHour the number of sales per hour. Huge historical logs are accumulated over time, and are subject to data mining processing for decision making. In this case, finding the places (at various granularities) with most sales in a time period is clearly relevant. Table 1 shows a summary with basic information about the real datasets. For simplicity, in these datasets we ignore the cost of mapping between real timestamps and seller ids to rows/columns in the table, and assume that the queries are given in terms of rows and columns. We compare the space requirements of the K 2 -treap with a solution based on wavelet trees enhanced with RMQ structures [13] (wtrmq). Since our matrices can contain none or multiple values per column, we transform our datasets to store them using wavelet trees. The wavelet tree will store a grid with as many columns as values we have in our matrix, in column-major order. A bitmap is used to map the real columns with virtual ones: we append a 0 per new point and a 1 when the column changes. Hence, range queries in the wtrmq require a mapping from real columns to virtual ones (2 select1 operations per query), and the virtual column of each result must be mapped back to the actual value (a rank1 operation per result). We also compare our proposal with a representation based on constructing multiple K 2 -trees, one per different value in the dataset. In this representation (mk2tree), top-k queries are answered by querying consecutively the K 2 -tree representations for the higher values. Each K 2 -tree representation in this proposal is enhanced with multiple optimizations over the simple bitmap 3 The dataset belongs to SkillupChile R , which allow us to use it for our research. 19 approach we use, like the compression of the lower levels of the tree (see [8] for a detailed explanation of this and other enhancements of the K 2 -tree). 7.1.2. Space comparison We start by comparing the compression achieved by the representations. As shown in Table 1, the K 2 -treap overcomes the wtrmq in the real datasets considered by a factor over 3.5. Structure mk2tree is competitive with the K 2 -treap and even obtains slightly less space in the dataset salesHour, taking advantage of the relatively small number of different values in the matrix. The K 2 -treap also obtains the best space results in most of the synthetic datasets studied. Only in the datasets with very few different values (d = 16) the mk2tree uses less space than the K 2 -treap. Notice that, since the distribution of values and cells is uniform, the synthetic datasets are close to a worst-case scenario for the K 2 -treap and mk2tree. Fig. 8 provides a summary of the space results for some of the synthetic datasets used. The left plot shows the evolution of compression with the size of the matrix. The K 2 -treap is almost unaffected by the matrix size, as its space is around 2 p t log st = s2 100 log 100 bits, that is, constant per cell as s grows. On the p p log s bits, that is, its space per other hand, the wtrmq uses t log s = s2 100 cell grows logarithmically with s. Finally, the mk2tree obtains poor results in the smaller datasets but it is more competitive on larger ones (some enhancements in the K 2 -tree representations behave worse in smaller matrices). Nevertheless, notice that the improvements in the mk2tree compression stall once the matrix reaches a certain size. The right plot of Fig. 8 shows the space results when varying the number of different weights d. The K 2 -treap and the wtrmq are affected only logarithmically by d. The mk2tree, instead, is sharply affected, since it must build a different K 2 -tree for each different value: if d is very small the mk2tree representation obtains the best space results also in the synthetic datasets, but for large d its compression degrades significantly. As the percentage of cells set p increases, the compression in terms of bits/cell (i.e., total bits divided by s2 ) will be worse. However, if we measure the compression in bits/point (i.e., total bits divided by t), then the space of the wtrmq is independent of p (log s bits), whereas the K 2 -treap and mk2tree use less space as p increases (log 100 ). That is, the space usage of the wtrmq p increases linearly with p, while that of the K 2 -treap and mk2tree increases sublinearly. Over all the synthetic datasets, the K 2 -treap uses from 1.3 to 13 bits/cell, the mk2tree from 1.2 to 19, and the wtrmq from 4 to 50 bits/cell. 20 Space usage varying s 10 k2treap (d=128,p=10) k2treap (d=1024,p=10) mk2tree (d=128,p=10) mk2tree (d=1024,p=10) wtrmq (d=128,p=10) wtrmq (d=1024,p=10) 6 k2treap (s=1024,p=10) k2treap (s=2048,p=10) mk2tree (s=1024,p=10) mk2tree (s=2048,p=10) wtrmq (s=1024,p=10) wtrmq (s=2048,p=10) 8 Space (bits/cell) 8 Space (bits/cell) Space usage varying d 10 4 2 6 4 2 0 0 1024 2048 4096 Size of the matrix (s) 8192 16 128 Number of different values (d) 1024 Figure 8: Evolution of the space usage with s and d in the synthetic datasets, in bits/cell (in the right plot, the two lines for the K 2 -treap coincide). 7.1.3. Query processing In this section we analyze the efficiency of top-k queries, comparing our structure with the mk2tree and the wtrmq. For each dataset, we build multiple sets of top-k queries for different values of k and different spatial ranges (we ensure that the spatial ranges contain at least k points). All query sets are generated for fixed k and w (side of the spatial window). Each query set contains 1,000 queries where the spatial window is placed at a random position within the matrix. Fig. 9 shows the time required to perform top-k queries in some of our synthetic datasets, for different values of k and w. The K 2 -treap obtains better query times than the wtrmq in all the queries, and both evolve similarly with the size of the query window. On the other hand, the mk2tree representation obtains poor results when the spatial window is small or large, but it is competitive with the K 2 -treap for medium-sized ranges. This is due to the procedure to query the multiple K 2 -tree representations: for small windows, we may need to query many K 2 -trees until we find k results; for very large windows, the K 2 -treap starts returning results in the upper levels of the conceptual tree, while the mk2tree approach must reach the leaves; for some intermediate values of the spatial window, the K 2 -treap still needs to perform several steps to start returning results, and the mk2tree representation may find the required results in a single K 2 -tree. Notice that the K 2 -treap is more efficient when no range limitations are given (that is, when w = s), since it can return after exactly K iterations. Fig. 9 only shows the 21 Query time (microsecs/query) s=4096, d=128, p=100 s=4096, d=1024, p=100 k2treap (k=10) k2treap (k=1000) mk2trees (k=10) mk2trees (k=1000) wt-rmq (k=10) wt-rmq (k=1000) 50000 10000 1000 100 10 4 10 50 100 500 Spatial window size 4096 4 10 50 100 500 Spatial window size 4096 Figure 9: Times (in microseconds per query) of top-k queries in synthetic datasets for k = 10 and k = 100 and range sizes varying from 4 to 4,096. The number of different weights d in the matrix is 128 on the left graph and 1,024 on the right graph, while s and p remain fixed. We omit the lines connecting the points for wtrmq variants, as they produce several crosses that hamper legibility. results for two of the datasets, but similar results were obtained in all the synthetic datasets studied. Next we query our real datasets. We start with the same w × w queries as before, which filter a range of rows (sellers) and columns (days/hours). Fig. 10 shows the results of these range queries. As we can see, the K 2 -treap outperforms both the mk2tree and wtrmq in all cases. As in the synthetic spaces, the mk2tree obtains poor query times for small ranges but it is better in larger ranges. We also run two more specific sets of queries that may be of interest in many datasets, as they restrict only the range of sellers or the time periods, that is, only one of the dimensions of the matrix. Row-oriented queries ask for a single row (or a small range of rows) but do not restrict the columns, and column-oriented ask for single columns. We build sets of 10,000 top-k queries for random rows/columns with different values of k. Fig. 11 (left) shows that in column-oriented queries the wtrmq is faster than the K 2 -treap for small values of k, but our structure is still faster as k grows. The reason for this difference is that in “square” range queries, the K 2 -treap only visits a small set of submatrices that overlap the region; in row-oriented or columnoriented queries, the K 2 -treap is forced to check many submatrices to find only a few results. The mk2tree suffers from the same problem, being unable to efficiently filter the matrix, and obtains the worst query times in all cases. 22 Query time (microsecs/query) dataset salesDay dataset salesHour k2treap (k=1) k2treap (k=5) k2treap (k=50) mk2tree (k=1) mk2tree (k=5) mk2tree (k=50) wtrmq (k=1) wtrmq (k=5) wtrmq (k=50) 100 10 1 4 10 50 Spatial window size 100 4 10 50 Spatial window size 100 Figure 10: Query times (in microseconds per query) of top-k queries in the real datasets SalesDay (left) and salesHour (right) for k = 1, k = 5 and k = 50, and range sizes varying from 4 to 100. In row-oriented queries (Fig. 11, right) the wtrmq is even more competitive, obtaining the best results in many queries. The reason for the differences with column-oriented queries in the wtrmq is the mapping between real and virtual columns: column ranges are expanded to much longer intervals in the wavelet tree, while row ranges are left unchanged. Notice anyway that our structure is still competitive unless k is very small. Row-oriented queries Query times (microseconds/query) Query times (microseconds/query) Column-oriented queries k2treap - salesDay k2treap - salesHour mk2tree - salesDay mk2tree - salesHour wtrmq - salesDay wtrmq - salesHour 1000 100 10 1 5 10 k 50 100 k2treap - salesDay k2treap - salesHour mk2tree - salesDay mk2tree - salesHour wtrmq - salesDay wtrmq - salesHour 10000 1000 100 1 5 10 k 50 100 Figure 11: Query times (in microseconds per query) of column-oriented (left) and row-oriented (right) top-k queries on the real datasets for k varying from 1 to 100. 23 7.2. Range counting queries 7.2.1. Experiment setup In this evaluation, we use grid datasets coming from three different real domains: Geographic Information Systems (GIS), Social Networks (SN) and Web Graphs (WEB). For GIS data we use the Geonames dataset4 , which contains the geographic coordinates (latitude and longitude) of more than 6 million populated places, and converted it into three grids with different resolutions: Geo-sparse, Geo-med, and Geo-dense. The higher the resolution, the sparser the matrix. These datasets allow for evaluating the influence of data sparsity in the different proposals. For SN we use three social networks (dblp-2011, enwiki-2013 and ljournal-2008) obtained from the Laboratory for Web Algorithmics5 [7, 36]. Finally, in the WEB domain we consider the grid associated with the adjacency matrix of three Web graphs (indochina-2004, uk-2002 and uk-2007-5) obtained from the same Web site. The clustering in these datasets is very dissimilar. In general, GIS datasets do not present many clusters, whereas data points in the WEB datasets are highly clustered. SN represents an intermediate collection in terms of clustering. In this experiment, we compare our proposal to speed up range counting queries on a K 2 -tree, named rck2tree, with the original K 2 -tree. Recall from Section 6 that we augment the K 2 -tree with additional data in order to speed up this type of queries. Thus, in this evaluation we show the space-time tradeoff offered by the rck2tree structure, which is parametrized by the number of levels of the original K 2 -tree augmented with counting information. As a baseline from the succinct data structures area, we include a representation of grids based on wavelet trees, named wtgrid in the following discussion. This representation was described in Section 2.3 and an algorithm to support range counting was sketched in Section 3. As explained in Section 2.3, this representation requires a bitmap to map from a general grid to a grid with one point per column. In our experiments we store this bitmap with either plain bitmaps, RRR or sd-arrays, whichever requires less space. As for the wavelet tree itself, we use a balanced tree with just one pointer per level and the bitmaps of each level are compressed with RRR. In other words, we use a configuration of this representation that aims to reduce the space. Note, however, that we use the implementation available in Libcds [16], which 4 5 http://www.geonames.org http://law.di.unimi.it 24 Table 2: Description of the real datasets used, and space (in bits per point) required to represent them with the compared data structures. Dataset Type Geo-dense Geo-med Geo-sparse dblp-2011 enwiki-2013 ljournal-2008 indochina-2004 uk-2002 uk-2007-5 GIS GIS GIS SN SN SN WEB WEB WEB Grid (u) Points (n) 524,288 6,049,875 4,194,304 6,080,640 67,108,864 6,081,520 986,324 6,707,236 4,206,785 101,355,853 5,363,260 79,023,142 7,414,866 194,109,311 18,520,486 298,113,762 105,896,555 3,738,733,648 wtgrid K 2 -tree rck2tree4 rck2tree8 rck2tree16 (bits/point) (bits/point) (bits/point) (bits/point) (bits/point) 17.736 14.084 14.085 14.356 18.138 26.588 26.545 26.564 29.276 36.875 44.019 41.619 41.997 48.802 56.979 19.797 9.839 9.844 10.935 13.124 19.031 14.664 14.673 16.016 19.818 20.126 13.658 13.673 15.011 18.076 14.747 1.725 1.729 1.770 2.13 16.447 2.779 2.797 2.888 3.451 16.005 1.483 1.488 1.547 1.919 uses O(alphabet size) counters to speed up queries. As we will show in the experiments, this data structure, even with the compression of the bitmaps that represent the nodes of the wavelet tree, does not take full advantage of the existence of clusters in the data points. Table 2 shows the main characteristics of the datasets used: name of the dataset, size of the grid (u)6 , number of points it contains (n) and the space achieved by the baseline wtgrid, by the original K 2 -tree and by different configurations of our rck2tree proposal. Unlike the previous scenario, the space is measured in bits per point because these matrices are very sparse, which results in very low values of bits per cell. 7.2.2. Space comparison As expected, the representation based on wavelet trees, wtgrid, is not competitive in terms of space, especially when the points in the grid are clustered. Even though the nodes of the wavelet tree are compressed with RRR, this representation is not able to capture the regularities induced by the clusters. In the WEB domain, where the points are very clustered, the wtgrid representation requires up to 10 times the space of the K 2 -tree. Therefore, the latter allows for the processing in main memory of much larger datasets. In domains where the data points are not that clustered, space-savings are still significant but not as outstanding as in the previous case. Second, we analyze the space overhead incurred by the rck2tree in comparison with the original K 2 -tree. As mentioned above, this overhead de6 Note that, unlike the grids used in the previous scenario, these are square grids, and thus u represents both the number of rows and columns. 25 3.5 16 3 Space (bits/point) Space (bits/point) 50 rck2tree 8 rck2tree4 rck2tree 2 K -tree 40 30 20 10 16 rck2tree 8 rck2tree4 rck2tree 2 K -tree 2.5 2 1.5 1 0.5 0 GEO_dense GEO_med Dataset 0 indochina-2004 GEO_sparse uk-2002 Dataset uk-2007-5 Figure 12: Space overhead (in bits per point) in the real datasets GIS (left) and WEB (right). Each bar, from bottom to top, represents the K 2 -tree and the additional space used by the rck2tree with 4, 8, and 16 levels, respectively. The additional space required by rck2tree4 is almost negligible. pends on the number of levels of the K 2 -tree that are augmented with additional range counting information. In these experiments, we show the results of three configurations in which 4, 8 and 16 levels were augmented, respectively. As Table 2 shows, the space overhead is almost negligible for the rck2tree4 and it ranges from 25% to 40% for rck2tree16 . In the next section we will show the influence of this extra space in the performance of the data structure to solve range counting queries. It is interesting to notice that the space overhead is lower in the domains where the K 2 -performs best. The K 2 -tree performs better in sparse domains where data points are clustered [8], for example, in the Web graph. In the largest WEB dataset, uk-2007-5, the K 2 -tree requires about 1.5 bits per point, and we can augment the whole tree with range counting information using less than 0.5 extra bits per point (this is an overhead of less than 30%). Sparse and clustered matrices result in less values being stored in the augmented data structure (as in the original K 2 -tree, we do not need to store information for submatrices full of zeros). In Fig. 12 we show the space overhead in two of our dataset collections, GIS and WEB. Note also that, unlike the K 2 -tree, the space overhead does not increase drastically in sparse non-clustered datasets (e.g., Geo-sparse). This is because isolated points waste K 2 bits per level in the original K 2 -tree, and this is much more than the overhead incurred by the range counting fields, 26 where they use approximately two bits per level. The reason is that these fields represent the difference between the expected number of elements in the submatrix, 1, and the actual number, which is also 1.7 . For example, in Geo-sparse the K 2 -tree uses more than 40 bits per point, which is much more than the (roughly) 2 bits per point in the sparse and clustered WEB datasets. However, the space overhead of the rck2tree16 (with respect to the K 2 -tree) is about 40% in Geo-sparse and 30% in uk-2007-5 (i.e., a difference of 10 percentage points). In the configurations that store range counting values only for some levels of the K 2 -tree, the difference is even smaller. This is expected because there are fewer isolated points in the higher levels. 7.2.3. Query processing In this section we analyze the efficiency of range counting queries, comparing our augmented K 2 -tree with the original data structure and with the wtgrid. For each dataset, we build multiple sets of queries with different query selectivities (i.e., size of spatial ranges). All the query sets were generated for fixed query selectivity. A query selectivity of X% means that each query in the set covers X% of the cells in the dataset. Each query set contains 1,000 queries where the spatial window is placed at a random position in the matrix. As in the space comparison, we show the results of three different configurations of our augmented data structure, in which 4, 8, and 16 levels are augmented with range counting data. Fig. 13 shows the time required to perform range counting queries in some of our real datasets, for different values of query selectivity. For each domain (GIS, SN and WEB), we only show the results of the two most different datasets, as the others do not alter our conclusions. Our augmented data structure consistently outperforms the original K 2 tree for all domains and query selectivities. The only exception is the rck2tree4 in the two SN datasets and Geo-dense for very selective queries (i.e., with the smallest areas). The influence of the query selectivity in the results is evident. The larger the query, the higher the impact of the additional range counting data in the performance of the data structure. Larger queries are expected to stop the recursion of the range counting algorithm in higher levels of the K 2 -tree because those queries are more likely to contain the whole 7 Recall that these data are represented using DACs, which require at least two bits. 27 dataset Geo-dense 10000 dataset Geo-sparse 1e+06 2 Query time (microseconds/query) Query time (microseconds/query) 100000 K -tree 4 rck2tree8 rck2tree16 rck2tree wtgrid 1000 100 10 1 100000 10000 2 K -tree 4 rck2tree8 rck2tree16 rck2tree wtgrid 1000 100 10 1 0.001% 0.01% 0.1% Query selectivity 1% 0.001% 0.01% 0.1% Query selectivity dataset dblp-2011 10000 dataset ljournal-2008 1e+06 2 Query time (microseconds/query) Query time (microseconds/query) 100000 K -tree4 rck2tree8 rck2tree 16 rck2tree wtgrid 1000 100 10 1 100000 10000 2 K -tree4 rck2tree8 rck2tree 16 rck2tree wtgrid 1000 100 10 1 0.001% 0.01% 0.1% Query selectivity 1% 0.001% 0.01% 0.1% Query selectivity dataset indochina-2004 10000 1% dataset uk-2007-5 1e+07 2 Query time (microseconds/query) Query time (microseconds/query) 1e+06 100000 1% K -tree4 rck2tree8 rck2tree16 rck2tree wtgrid 1000 100 10 1 1e+06 100000 2 K -tree4 rck2tree8 rck2tree16 rck2tree wtgrid 10000 1000 100 10 1 0.001% 0.01% 0.1% Query selectivity 1% 0.001% 0.01% 0.1% Query selectivity 1% Figure 13: Query times (in microseconds per query) of range counting queries in two examples of each type of real dataset: GIS (top), SN (middle) and WEB (bottom) for range queries sizes varying from 0.001% to 1%. 28 area covered by nodes of the K 2 -tree. Recall that a node of the K 2 -tree at level i represents u2 /(K 2 )i cells. In our experiments we use a configuration of the K 2 -tree in which the first six levels use a value of K1 = 4 (thus partitioning the space into K12 = 16 regions) and the remaining levels use a value of K2 = 2. Therefore, for the rck2tree4 to improve the performance of the range counting queries, those queries must contain at least u2 /(42 )4 = u2 /216 cells. In the rck2tree8 and rck2tree16 , which contain range counting data for more levels of the K 2 -tree, this value is much lower, and thus the recursion can be stopped early even for small queries. For larger queries, the performance improvement reaches several orders of magnitude in some datasets (note the logarithmic scale). In most datasets, the performance of rck2tree8 and rck2tree16 is very similar, therefore the former is preferable as it requires less extra space. Hence, in general, we can recommend the use of the rck2tree8 configuration to speed up range counting queries. If the queries are not very selective, and there are memory constraints, the rck2tree4 can be an alternative as it requires almost the same space of the original K 2 -tree. The wtgrid is consistently not only faster than the data structures based on the K 2 -tree, but also less sensitive to the size of the query. However, as we showed above, it also requires significantly more space. To reinforce these conclusions, Fig. 14 shows the space-time trade-offs of the different configurations. We selected two representative datasets that were not used in the previous experiment, enwiki-2013 (SN) and uk-2002 (WEB), and two query selectivities for each of them, 0.001% and 0.1%. Each point in the lines named rck2tree represents a different configuration with 4, 8, and 16 levels augmented with range counting information, respectively from left to right. These graphs show that the rck2tree8 configuration offers the most interesting trade-off, as it requires just a bit more space than the original K 2 -tree and it speeds up range counting queries significantly. This effect is more evident for larger queries, but even for very selective queries the improvement is significant. The wtgrid competes in a completely different area of the trade-off, being the fastest data structure, but also the one that requires the most space. 8. Conclusions We have introduced a technique to solve aggregated 2D range queries on grids, which requires little space when the data points in the grid are 29 dataset enwiki-2013 dataset uk-2002 100000 2 Query time (microseconds/query) Query time (microseconds/query) 100000 K -tree (0.001%) 2 K -tree (0.1%) rck2tree (0.001%) rck2tree (0.1%) wtgrid (0.001%) wtgrid (0.1%) 10000 1000 100 10 1 2 K -tree (0.001%) 2 K -tree (0.1%) rck2tree (0.001%) rck2tree (0.1%) wtgrid (0.001%) wtgrid (0.1%) 10000 1000 100 10 1 14 15 16 17 18 Space (bits/point) 19 20 2 4 6 8 10 12 Space (bits/point) 14 16 18 Figure 14: Space-time trade-offs offered by the compared range counting variants on examples of SN (left) and WEB (right) datasets. clustered. We use a K 2 -tree to represent the topology of the data (i.e., the positions of the data points) and augment each node of the tree with additional aggregated information that depends on the operation to be supported. The aggregated information in each node is differentially encoded with respect to its parent in order to reduce the space overhead. To illustrate the applicability of this technique, we adapted it to support two important types of aggregated range queries: ranked and counting range queries. In the case of ranked queries, we named the resulting data structure K 2 treap. This data structure performs top-k range queries up to 10 times faster than current state-of-the-art solutions and requires as little as 30% of their space, both in synthetic and real OLAP datasets. This holds even on uniform distributions, which is the worst scenario for K 2 -treaps. For range counting queries, our experimental evaluation shows that with a small space overhead (below 30%) on top of the K 2 -tree, our data structure answers queries several orders of magnitude faster than the original K 2 -tree, especially when the query ranges are large. These results are consistent in the different databases tested, which included domains with different levels of clustering in the data points. For example, in Web graphs the data points are very clustered, which is not the case in GIS applications. The comparison with a wavelet tree-based solution shows that, although the wavelet tree is faster, our proposal requires less space (up to 10 times less when the points are clustered). Thus, we provide a new alternative in the space-time trade-off which allows for the processing of much larger datasets. 30 Although we have presented the two types of queries separately, this does not mean that an independent data structure would be required for each type of aggregated query. The topology of the data can be represented by a unique K 2 -tree and each type of aggregated query just adds additional aggregated and differentially encoded information. However, some specific optimizations on the K 2 -tree, such as the one presented for ranked range queries, may not be possible for all types of queries. The technique can be generalized to represent grids in higher dimensions, which is essential in some domains such as OLAP databases [37], by replacing our underlying K 2 -tree with its generalization to d dimensions, the K d -tree [38] (not to be confused with kd-trees [5]). The algorithms stay identical, but an empirical evaluation is left for future work. In the worst d case, a grid of t points on [n]d will require O(t log nt ) bits, which is of the same order of the data, and much less space would be used on clustered data. Instead, an extension of the wavelet tree will require O(n logd n) bits, which quickly becomes impractical. Indeed, any structure able to report the points in a range in polylogarithmic time requires Ω(n(log n/ log log n)d−1 ) words of space [39], and with polylogarithmic space one needs time at least Ω(log n(log n/ log log n)⌊d/2⌋−2 ) [40]. As with top-k queries one can report all the points in a range, there is no hope to obtain good worst-case time and space bounds in high dimensions, and thus heuristics like K d -treaps are the only practical approaches (kd-trees do offer linear space, but their time guarantee is rather loose, O(n1−1/d ) for n points on [n]d ). References [1] M. d. Berg, O. Cheong, M. v. Kreveld, M. Overmars, Computational Geometry: Algorithms and Applications, 3rd Edition, Springer-Verlag, 2008. [2] G. Navarro, Y. Nekrich, L. Russo, Space-efficient data-analysis queries on grids, Theoretical Computer Science 482 (2013) 60–72. [3] J. H. Harvey J. Miller, Geographic Data Mining and Knowledge Discovery, Chapman & Hall/CRC Data Mining and Knowledge Discovery Series, 2009. [4] J. L. Bentley, Decomposable searching problems, Information Processing Letters 8 (5) (1979) 244–251. 31 [5] J. L. Bentley, Multidimensional binary search trees used for associative searching, Communications of the ACM 18 (9) (1975) 509–517. [6] W. Tobler, A computer movie simulating urban growth in the detroit region, Economic Geography 46 (2) (1970) 234–240. [7] P. Boldi, S. Vigna, The WebGraph framework I: Compression techniques, in: Proc. of the Thirteenth International World Wide Web Conference (WWW 2004), ACM Press, Manhattan, USA, 2004, pp. 595–601. [8] N. Brisaboa, S. Ladra, G. Navarro, Compact representation of web graphs with extended functionality, Information Systems 39 (1) (2014) 152–174. [9] S. Álvarez-Garcı́a, N. R. Brisaboa, J. D. Fernández, M. A. Martı́nezPrieto, G. Navarro, Compressed vertical partitioning for efficient RDF management, Knowledge and Informations Systems 44 (2) (2015) 439– 474. [10] G. de Bernardo, S. Alvarez-Garcı́a, N. Brisaboa, G. Navarro, O. Pedreira, Compact querieable representations of raster data, in: Proc. 20th International Symposium on String Processing and Information Retrieval (SPIRE), LNCS 8214, 2013, pp. 96–108. [11] D. Caro, M. A. Rodrı́guez, N. R. Brisaboa, Data structures for temporal graphs based on compact sequence representations, Information Systems 51 (2015) 1–26. [12] T. Gagie, J. González-Nova, S. Ladra, G. Navarro, D. Seco, Faster compressed quadtrees, in: Proc. 25th Data Compression Conference (DCC), 2015, pp. 93–102. [13] G. Navarro, Y. Nekrich, L. Russo, Space-efficient data-analysis queries on grids, Theoretical Computer Science 482 (2013) 60–72. [14] G. Jacobson, Space-efficient static trees and graphs, in: Proc. SFCS, 1989, pp. 549–554. [15] D. Clark, Compact pat trees, Ph.D. thesis, University of Waterloo (1996). 32 [16] F. Claude, G. Navarro, Practical rank/select queries over arbitrary sequences, in: Proc. 15th SPIRE, 2008. [17] R. Raman, V. Raman, S. Rao, Succinct indexable dictionaries with applications to encoding k-ary trees and multisets, in: Proc. SODA, 2002, pp. 233–242. [18] R. Grossi, A. Gupta, J. Vitter, High-order entropy-compressed text indexes, in: Proc. 14th SODA, 2003, pp. 841–850. [19] B. Chazelle, A functional approach to data structures and its use in multidimensional searching, SIAM Journal on Computing 17 (3) (1988) 427–462. [20] V. Mäkinen, G. Navarro, Position-restricted substring searching, in: Proc. 7th LATIN, 2006, pp. 703–714. [21] D. Okanohara, K. Sadakane, Practical entropy-compressed rank/select dictionary, in: Proc. 9th Workshop on Algorithm Engineering and Experiments, ALENEX, 2007. [22] R. Seidel, C. Aragon, Randomized search trees, Algorithmica 16 (4/5) (1996) 464–497. [23] C. Martı́nez, S. Roura, Randomized binary search trees, J. ACM 45 (2) (1997) 288–323. [24] J. Vuillemin, A unifying look at data structures, Communications of the ACM 23 (4) (1980) 229–239. [25] J. Fischer, V. Heun, Space-efficient preprocessing schemes for range minimum queries on static arrays, SIAM J. Comp. 40 (2) (2011) 465–492. [26] R. Konow, G. Navarro, C. Clarke, A. López-Ortı́z, Faster and smaller inverted indices with treaps, in: Proc. 36th SIGIR, 2013, pp. 193–202. [27] M. Golin, J. Iacono, D. Krizanc, R. Raman, S. S. Rao, Encoding 2D range maximum queries, in: Proc. 22nd ISAAC, 2011, pp. 180–189. [28] E. M. McCreight, Priority search trees, SIAM J. Comp. 14 (2) (1985) 257–276. 33 [29] I. Bialynicka-Birula, R. Grossi, Rank-sensitive data structures., in: SPIRE, 2005, pp. 79–90. [30] G. Navarro, Y. Nekrich, Top-k document retrieval in optimal time and linear space, in: Proc. 23rd SODA, 2012, pp. 1066–1078. [31] P. Bose, M. He, A. Maheshwari, P. Morin, Succinct orthogonal range search structures on a grid with applications to text indexing, in: Proc. of the 11th International Symposium on Algorithms and Data Structures, WADS, 2009, pp. 98–109. [32] J. Barbay, F. Claude, G. Navarro, Compact binary relation representations with rich functionality, Information and Computation 232 (2013) 19–37. [33] M. Patrascu, Lower bounds for 2-dimensional range counting, in: Proc. of the 39th Annual ACM Symposium on Theory of Computing, 2007, pp. 40–46. [34] F. Claude, P. K. Nicholson, D. Seco, On the compression of search trees, Information Processing & Management 50 (2) (2014) 272–283. [35] N. Brisaboa, S. Ladra, G. Navarro, DACs: Bringing direct access to variable-length codes, Information Processing & Management 49 (1) (2013) 392–404. [36] P. Boldi, M. Rosa, M. Santini, S. Vigna, Layered label propagation: A multiresolution coordinate-free ordering for compressing social networks, in: Proceedings of the 20th international conference on World Wide Web, ACM Press, 2011. [37] S. Sarawagi, Indexing OLAP data, IEEE Data Eng. Bull. 20 (1) (1997) 36–43. [38] G. de Bernardo, S. Álvarez-Garcı́a, N. R. Brisaboa, G. Navarro, O. Pedreira, Compact querieable representations of raster data, in: Proc. 20th SPIRE, 2013, pp. 96–108. [39] B. Chazelle, Lower bounds for orthogonal range searching I: The reporting case, J. ACM 37 (2) (1990) 200–212. 34 [40] P. Afshani, L. Arge, K. G. Larsen, Higher-dimensional orthogonal range reporting and rectangle stabbing in the pointer machine model, in: Proc. SCG, 2012, pp. 323–332. 35
8cs.DS
arXiv:1604.07813v2 [math.AC] 3 May 2016 FINITELY GENERATED MODULES OVER QUASI-EUCLIDEAN RINGS LUC GUYOT Abstract. Let R be a unital commutative ring and let M be an R-module that is generated by k elements but not less. Let En (R) be the subgroup of GLn (R) generated by the elementary matrices. In this paper we study the action of En (R) by matrix multiplication on the set Umn (M ) of unimodular rows of M of length n ≥ k. Assuming R is moreover Noetherian and quasiEuclidean, e.g., R is a direct sum of finitely many Euclidean rings, we show that this action is transitive if n > k. We also prove that Umk (M )/Ek (R) is equipotent with the unit group of R/a1 where a1 is the first invariant factor of M . These results encompass the well-known classification of Nielsen non-equivalent generating tuples in finitely generated Abelian groups. 1. Introduction In this paper rings are supposed unital and commutative. The unit group of a ring R is denoted by R× . Let M be a finitely generated R-module. We denote by rkR (M) the minimal number of generators of M. For n ≥ rkR (M), we denote by Umn (M) the set of unimodular rows of M of length n, i.e, the set of elements in M n whose components generate M. We consider the action of GLn (R) on Umn (M) by matrix right-multiplication. Let En (R) be the subgroup of GLn (R) generated by the elementary matrices, i.e., the matrices which differ from the identity by a single off-diagonal element. Two unimodular rows m, m′ ∈ Umn (M) are said to be En (R)-equivalent if there exists E ∈ En (R) such that m′ = mE. Our chief concern is the description of the orbit set Umn (M)/En (R) when R enjoys a cancellation property shared by Euclidean rings, namely: for every n ≥ 2 and every r = (r1 , . . . , rn ) ∈ Rn , Date: May 5, 2016. 2000 Mathematics Subject Classification. Primary 13F39, Secondary 20K21, 20E05. Key words and phrases. quasi-Euclidean ring; elementary divisor ring; finitely generated module; finitely generated Abelian group; elementary rank; Nielsen equivalence. The author thanks the Mathematics Institute of Göettingen and the Max Planck Institute for Mathematics in Bonn for the excellent conditions provided for his stay at these institutions, during which the paper was written. 1 2 LUC GUYOT there exist E ∈ En (R) and d ∈ R such that (1) (d, 0, . . . , 0) = rE. Rings with the above property are known as quasi-Euclidean rings in the sense of O’Meara and Cooke [O’M65, Coo76] (see [AJLL14, Theorem 11] for equivalence of definitions). A Noetherian quasi-Euclidean ring R is therefore a principal ideal ring (PIR), i.e., a ring whose ideals are principal. It is moreover an elementary divisor ring (see definition below) so that every finitely generated R-module admits an invariant factor decomposition, that is a decomposition of the form (2) R/a1 × R/a2 × · · · × R/ak with R 6= a1 ⊃ a2 ⊃ · · · ⊃ ak where k is necessarily equal to rkR (M). If R is both Noetherian and quasiEuclidean, properties (1) and (2) make the study of the action of En (R) on Umn (R) particularly amenable. Indeed, this assumption implies that En (R) acts transitively on Umn (M) for every n > rkR (M) and enables us to exhibit a complete invariant of En (R)-equivalence when n = rkR (M). These two claims are corollaries of Theorem A below. Theorem A. Let R be a Noetherian quasi-Euclidean ring and let M be a finitely generated R-module. Let R/a1 × · · · × R/ak be the invariant factor decomposition of M. Then every row in Umn (M) with n ≥ k is En (R)-equivalent to a row of the form (δe1 , e2 , . . . , ek , 0, . . . , 0) with δ ∈ (R/a1 )× and where ei ∈ M is defined by (ei )i = 1 ∈ R/ai and (ei )j = 0 for j 6= i. If n > k, then δ can be replaced by the identity. Corollary B. Let M be as in Theorem A. The action of En (R) on Umn (M) by matrix multiplication is transitive for every n > rkR (M). Corollary C. Let R be a Noetherian quasi-Euclidean ring. Let b1 , . . . , bk be proper ideals of R and set b = b1 + · · · + bk . Denote by M the R-module R/b1 × · · · × R/bk and for m = (mi ) ∈ M k denote by det(m) the determinant of the matrix whose coefficients are the images in R/b of the (mi )j ’s via the natural maps R/bj ։ R/b. Then m, m′ ∈ Umk (M) are Ek (R)-equivalent if and only if det(m) = det(m′ ). Suppose k = rkR (M). Then the ideal b of Corollary C coincides with the first invariant factor a1 of M (cf. proof). Putting Theorem A and Corollary C together, we see that m ∈ Umk (M) is Ek (R)-equivalent to (det(m)e1 , e2 , . . . , ek ) where (ei ) is as in Theorem A and det as in Corollary C. Therefore the map g 7→ det(g) induces a bijection from Umk (M)/Ek (R) onto (R/a1 )× . The latter bijection endows Umk (M)/Ek (R) with an Abelian group structure. The subject whether Umk (R)/Ek (R) has a group structure for R a commutative ring FINITELY GENERATED MODULES OVER QUASI-EUCLIDEAN RINGS 3 of finite Krull dimension is well studied [VS76, vdK83, vdK89, Rao98, Fas11] but we don’t know of any similar results for modules. By analogy with [MR87, Definition 11.3.9], we can define the elementary rank of a finitely generated R-module M, for any associative ring R with identity, as the least integer e such that the action of En (R) on Umn (M) is transitive for all n > e. This rank is not less than rkR (M) − 1 and not greater than rkR (M) − 1 + sr(M), where sr(M) is the stable rank of M, a natural generalization of the Bass stable rank of rings to modules [MR87, Definition 6.7.2]. We showed in our situation that the elementary rank is rkR (M) − 1 if R/a1 has 2 elements and coincides with rkR (M) otherwise. Specifying the above results to R = Z yields the characterization of Nielsen equivalent generating tuples in finitely generated Abelian groups. This characterization was obtained in part by several authors [NN51, LM93, DG99] and reaches its complete form in [Oan11]. In order to present it, we introduce the following definitions. Given a finitely generated group G, denote by rk(G) the minimal number of generators of G. For n ≥ rk(G), let Vn (G) be the set of generating n-vectors of G, i.e., the set of elements in Gn whose components generate G. Two generating n-vectors are said to be Nielsen equivalent if they can be related by a finite sequence of transformations of Gn taken in the set {Lij , Ii ; 1 ≤ i 6= j ≤ n} where Lij and Ii replace the component gi of g = (g1 , . . . , gn ) ∈ Gn by gj gi and gi−1 respectively and leave the other components unchanged. Corollary D. Let G be a finitely generated Abelian group whose invariant factor decomposition is Zd1 × · · · × Zdk with 1 6= d1 | d2 | · · · | dk , di ≥ 0 and where Zdi stands for Z/di Z (in particular Z0 = Z). Then every generating n-vector g with n ≥ k is Nielsen equivalent to (δe1 , e2 , . . . , ek , 0, . . . , 0) for some δ ∈ (Zd1 )× and where ei ∈ G is defined by (ei )i = 1 ∈ Zdi and (ei )j = 0 for j 6= i. • If n > k, then δ above can be replaced by the identity. • If n = k then δ must be ± det(g) with det defined as in Corollary C. In particular G has only one Nielsen equivalence class of generating n-vectors for n > k while it has max(ϕ(d1 )/2, 1) Nielsen equivalence classes of generating k-vectors where ϕ denotes the Euler totient function extended by ϕ(0) = 0. Our results allow further applications to the study of Nielsen equivalence in split extensions of Abelian groups by cyclic or free Abelian groups. Consider for instance an infinite cyclic group C and denote by Z[C] its integral group ring. Let R be a quasi-Euclidean quotient of Z[C], e.g., R = Zn [C] for n a square-free integer, and let M be a finitely generated R-module. Then the image of C in 4 LUC GUYOT R is a subgroup of R× so that C acts naturally on M by automorphisms. Let G = M ⋊ C be the corresponding semi-direct product. Let T be the subgroup of R× generated by the images of −1 and C, set Λ = R/a1 where a1 is the first invariant factor of M, and let TΛ be the image of T in Λ× . Our results allow us to show that the set of Nielsen equivalence classes of generating k-tuples of G is equipotent with Λ× /TΛ for k = rk(G) [Guy16b]. (See also [Guy16a, Corollary 4.ii] for an application of Corollary B). We introduce now definitions and preliminary results that will be used by the proofs of our statements in Section 2. A ring R is said to be an elementary divisor ring if every matrix A over R admits a diagonal reduction, i.e., if we can find invertible matrices P, Q and elements d1 , . . . , dn ∈ R such that P AQ = diag(d1 , . . . , dn ) and d1 | d2 | · · · | dn . Principal ideal domains (PID) are elementary divisor rings [DF04, Theorem 4]. This classical result extends effortlessly to PIRs thanks to a theorem of Hungerford. Indeed, the class of elementary divisor rings is stable under taking quotients and direct sums. As a PIR is a direct sum of rings, each of which is the homomorphic image of a PID [Hun68, Theorem 1], our claim follows. A Noetherian elementary divisor ring has moreover a unique invariant factor decomposition [Kap49, Theorems 9.1 and 9.3], thus we showed Lemma 1. Let R be a PIR. Then the following hold: (i) R is an elementary divisor ring. (ii) Every finitely generated R-module M has a unique invariant factor decomposition, i.e., a decomposition of the form R/a1 × R/a2 × · · · × R/an with R 6= a1 ⊃ a2 ⊃ · · · ⊃ an where the factors ai are uniquely determined by the latter condition. For such decomposition, n is the minimal number of generators of M, that is n = rkR (M). The following result of Whitehead [Wei13, Example I.1.11] will come in handy in the proof of Theorem A. Let R be a unital commutative ring. For u ∈ R× , we denote by Di (u) ∈ GLn (R) the diagonal matrix which coincides with the identity except possibly for its (i, i)-entry, which is set to u. Let Dn (R× ) be the subgroup of GLn (R) generated by the matrices Di (u). Whitehead’s lemma implies that a matrix D ∈ Dn (R× ) lies in SLn (R) if and only if it lies in En (R). Corollary C elaborates on Theorem A by showing that the unit δ of the theorem identifies with a natural invariant of En (R)-equivalence, namely the determinant in the largest quotient of M that is a free module. This invariant extends Diaconis-Graham’s invariant defined for finitely generated Abelian groups [DG99]. It can be defined for any commutative unital ring R and any finitely generated R-module M. Consider a generating set m = (m1 , . . . , mn ) of M with minimal cardinality. We say that r ∈ R is involved in a relation of FINITELY GENERATED MODULES OVER QUASI-EUCLIDEAN RINGS 5 P M with respect to m if there is (ri ) ∈ Rn such that ri mi = 0 and r = ri for some i. Denote by r(M) the set of elements of R which are involved in a relation of M with respect to m. Clearly, r(M) is an ideal of R and it is easily checked that r(M) is independent of m. Let m = π(m) be the image of m by the natural map π : M ։ M/r(M)M and let e be the canonical basis of (R/r(M))n . Then the map m 7→ e induces an isomorphism ϕm from M/r(M)M onto (R/r(M))n . For m′ ∈ Umn (M), we define detm (m′ ) as the determinant of ϕm ◦ π(m′ ) with respect to e. Let ϕ + ϕm ◦ ϕ−1 m′ . Because the ′ identity detm = det(ϕ) detm holds, we have shown the following Lemma 2. Let n = rkR (M) and let m, m′ ∈ Umn (M). There exists u ∈ (R/r(M))× such that detm = u detm′ . It is straightforward to check that detm is an invariant of En (R)-equivalence, i.e., detm (m′ E) = detm (m′ ) for every E ∈ En (R). If r(M) = R, then detm is trivial and hence useless. This doesn’t happen when R is an elementary divisor ring, for r(M) is then the first invariant factor a1 of M. The identity elements of each factor ring in a decomposition M ≃ R/a1 × · · · × R/an where n = rkR (M) form a unimodular row of M. We refer to this unimodular row as the unimodular row naturally associated to the given decomposition. Acknowledgements. The author is grateful to Pierre de la Harpe, Tatiana Smirnova-Nagnibeda and Laurent Bartholdi for their encouragements and useful comments made on preliminary versions of this paper. He is also thankful to Wolfgang Pitsch and Daniel Oancea for their early corrections and helpful suggestions. 2. Proofs Proof of Theorem A. The case k = 1 follows straighforwardly from (1). We assume now that k ≥ 2 and reverse the order of the sequence (ai ) for notational convenience, supposing that aj ⊂ aj+1 for every j. Let m = (mi ) ∈ Umn (M) with n ≥ k. We set mij + (mi )j for every 1 ≤ i ≤ n, 1 ≤ j ≤ k and identify m with the matrix (mij ). Applying (1) to every row mi + (mij )i≤j≤k we obtain a matrix E ∈ En (R) such that m′ = mE is a lower-triangular matrix (m′ij ) with m′11 = 1. We claim that m′jj is a unit of R/aj for every 2 ≤ j ≤ k. To see this, we consider the image ρl of (m′ij )1≤i, j≤l via the natural map induced by the projection R/al−1 ։ R/al for every 2 ≤ l ≤ k. Since the rows of ρl generate (R/al )l , the matrix ρl is invertible [Mat89, Theorem 2.4]. Therefore det(ρl ) ∈ (R/al )× and subsequently m′ll ∈ (R/al )× . As a result we readily find E ′ ∈ En (R) such that m′′ + m′ E ′ = diag(1, m′′2 , . . . , m′′k ) with m′′j + m′jj for 2 ≤ j ≤ k. If k = 2, we are done. Otherwise we consider the matrices 6 LUC GUYOT Ej + Dj (1/m′′j )Dk (m′′j ) for 2 ≤ j ≤ k − 1. Since Ej ∈ Ek (R/aj ) for every j by Whitehead’s lemma, each matrix Ej has a lift in Ek (R) and the product of these lifts is a matrix E ′′ ∈ En (R) satisfying m′′ E ′′ = diag(1, . . . , 1, m′′′ k ) with × ′′′ m′′′ ∈ (R/a ) . If n > k, we can store 1 − m in the (k, k + 1)-entry of m′′ , k k k then turn m′′′ k into 1 and eventually cancel the (k, k + 1)-entry with obvious elementary column transformations.  Proof of Corollary C. Since det is invariant under elementary row transformations, the ’only if’ part is established. To prove the converse, it suffices to show that there is u ∈ (R/b)× such that for every m ∈ M k , det(m) = uδ(m) where δ = δ(m) is the unit given by Theorem A. Let π, π ′ : M ։ (R/b)k be the R-epimorphisms naturally induced by the invariant factor decomposition and the decomposition R/b1 × · · · × R/bk respectively. Our claim certainly holds if π ′ = ϕ ◦ π for some automorphism ϕ of (R/b)k . To prove the latter fact, we first show that b is the first invariant factor in the decomposition of M if k = rkR (M) and b = R if k > rkR (M). As R is a PIR, we can write bi = bi R with bi ∈ R for every i. Let A = diag(b1 , . . . , bk ), with A square of order k. Since R is an elementary divisor ring, the matrix A admits a diagonal reduction diag(d1 , . . . , dk ). As the ideal generated by the coefficients of A is invariant under this reduction, we have b = d1 R. If d1 ∈ / R× , the ideals di R correspond to the invariant factors ai of M and hence k = rkR (M). Otherwise b = R and det vanishes on Umk (M) while rows in Umk (M) are all Ek (R)-equivalent by Theorem A. Therefore we can assume that k = rkR (M) and b = d1 R is a proper ideal of R. Considering the unimodular rows naturally associated to our two decompositions of M as a direct sum of cyclic factors, we see that the existence of ϕ is established by Lemma 2. This proves the claim and hence the result.  Proof of Corollary D. The group G is a Z-module and Umn (G) naturally identifies with Vn (G). Considering the matrix counterparts of the transformations Lij and Ii , it is easily checked that the Nielsen classes in Vn (G) concide with the orbits in Umn (G) of GLn (Z) = Dn ({±1})En (Z) where Dn ({±1}) is the group of diagonal matrices with diagonal entries in {±1}. The result is then a straightforward consequence of Theorem A and Corollary C.  References [AJLL14] Adel Alahmadi, S. K. Jain, T. Y. Lam, and A. Leroy. Euclidean pairs and quasiEuclidean rings. J. Algebra, 406:154–170, 2014. [Coo76] George E. Cooke. A weakening of the Euclidean property for integral domains and applications to algebraic number theory. I. J. Reine Angew. Math., 282:133–156, 1976. FINITELY GENERATED MODULES OVER QUASI-EUCLIDEAN RINGS 7 [DF04] David S. Dummit and Richard M. Foote. Abstract algebra. John Wiley & Sons, Inc., Hoboken, NJ, third edition, 2004. [DG99] Persi Diaconis and Ronald Graham. The graph of generating sets of an abelian group. Colloq. Math., 80(1):31–38, 1999. [Fas11] Jean Fasel. Some remarks on orbit sets of unimodular rows. Comment. Math. Helv., 86(1):13–39, 2011. [Guy16a] L. Guyot. Generators in split extensions of Abelian groups by cyclic groups. Preprint, arXiv:1604.08896 [math.GR], 2016. [Guy16b] L. Guyot. Generators of split metabelian groups. In preparation, 2016. [Hun68] Thomas W. Hungerford. On the structure of principal ideal rings. Pacific J. Math., 25:543–547, 1968. [Kap49] Irving Kaplansky. Elementary divisors and modules. Trans. Amer. Math. Soc., 66:464–491, 1949. [LM93] Martin Lustig and Yoav Moriah. Generating systems of groups and ReidemeisterWhitehead torsion. J. Algebra, 157(1):170–198, 1993. [Mat89] Hideyuki Matsumura. Commutative ring theory, volume 8 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, second edition, 1989. Translated from the Japanese by M. Reid. [MR87] J. C. McConnell and J. C. Robson. Noncommutative Noetherian rings. Pure and Applied Mathematics (New York). John Wiley & Sons, Ltd., Chichester, 1987. With the cooperation of L. W. Small, A Wiley-Interscience Publication. [NN51] Bernhard H. Neumann and Hanna Neumann. Zwei Klassen charakteristischer Untergruppen und ihre Faktorgruppen. Math. Nachr., 4:106–125, 1951. [Oan11] Daniel Oancea. A note on Nielsen equivalence in finitely generated abelian groups. Bull. Aust. Math. Soc., 84(1):127–136, 2011. [O’M65] O. T. O’Meara. On the finite generation of linear groups over Hasse domains. J. Reine Angew. Math., 217:79–108, 1965. [Rao98] Ravi A. Rao. An abelian group structure on orbits of “unimodular squares” in dimension 3. J. Algebra, 210(1):216–224, 1998. [vdK83] Wilberd van der Kallen. A group structure on certain orbit sets of unimodular rows. J. Algebra, 82(2):363–397, 1983. [vdK89] Wilberd van der Kallen. A module structure on certain orbit sets of unimodular rows. J. Pure Appl. Algebra, 57(3):281–316, 1989. [VS76] L. N. Vaseršteı̆n and A. A. Suslin. Serre’s problem on projective modules over polynomial rings, and algebraic K-theory. Izv. Akad. Nauk SSSR Ser. Mat., 40(5):993–1054, 1199, 1976. [Wei13] Charles A. Weibel. The K-book, volume 145 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, 2013. An introduction to algebraic K-theory. EPFL ENT CBS BBP/HBP. Campus Biotech. B1 Building, Chemin des mines, 9, Geneva 1202, Switzerland E-mail address: [email protected]
0math.AC
Hybrid Forecasting of Exchange Rate by Using Chaos Wavelet SVM-Markov Model and Grey Relation Degree Kim Gol a Ri Suk Yun a b b Center of Natural Sciences, University of Sciences, DPR Korea Foreign Economic General Bureau, Pyongyang, DPR Korea 5 June, 2012 Abstract This paper proposes an exchange rate forecasting method by using the grey relative combination approach of chaos wavelet SVM-Markov model. The problem of short-term forecast of exchange rate by using the comprehensive method of the phase space reconstitution and SVM method has been researched We have suggested a wavelet-SVR-Markov forecasting model to predict the finance time series and demonstrated that can more improve the forecasting performance by the rational combination of the forecast results through various combinational tests. Our test result has been showed that the two-stage combination model is more excellent than the normal combination model. Also we have comprehensively estimated the combination forecast methods according to the forecasting performance indicators. The estimated result have been shown that the combination forecast methods on the basic of the degree of grey relation and the optimal grey relation combination have fine forecast performance. Keywords: Exchange rate forecasting; Chaos ; Wavelet; SVM; Grey TOPSIS method; Combination model Introduction The time series analysis is importantly suggested on the many application including the control of physical systems, process of engineering, biochemistry, environmental economic system, company management and economy. Especially, the forecast of exchange rate acts on the macroeconomic policy, business management and individual decision-making establishment. Owing to these importances, the forecast of exchange rate became a hot spot of research for many scholars in the world. There are many methods in forecast technique of time series such as linear regression, Kalman filtering, neural network modeling, and fuzzy system method. The linear regression method is simple but its adaptation is poor. The filtering method has the adaptation but it is essentially linear technique. The neural network modeling method approximates arbitrary nonlinear function but it demands many learning data and difficult to analysis. 1 With contrast for it, fuzzy system method has the good explanatory ability but its adaptation is poor. The support vector machine(SVM) has effectively been used for machine learning. Its reason is owing to that the generalized properties of SVM are not dependent on the completely many training data but it is only dependent on the subset of training data namely the support vectors. At present time, SVM are widely used in multi-field such as handwriting recognition, three dimensions object recognition, regression analysis and so on. Recently, SVM is used as the universal tool in prediction of time series. ([1-13]) Its reason is owing to that the SVM has the considerable feature which it has the generalized performance and it don’t fall into the local minimization and it is represented with few information data. The training error has been minimized in the mostly traditional forecast technique which implemented the principle of empirical danger minimization. With contrast for it, SVM is implement ting the principle of structural danger minimization to find the upper bound and lower bound of generalized error. This is immediately the reason which SVM become to be better for the forecast performance in the generalized performance than other traditional methods. SVM have always the global optimum solution and don’t fall into the local minimization because of its learning is equivalent to solve the convex quadratic programming problem with linear constrain. Actually, its solution is only to be determined by the support vectors which are subsets of training data set. Therefore, it is easily capable of notating. The first importance step to enhance the forecast performance of SVM is the feature selection or feature extraction of time series. We have made use of the embedding dimension([40]) of chaos time series in order to characterize the input sample number needed for the machine learning of SVM. Consequently, we have researched the problem of short-term forecast of exchange rate by using the comprehensive method of the phase space reconstitution([41]) and SVM method. We have suggested a Wavelet-SVR-Markov forecasting model to predict the finance time series and demonstrated that can more improve the forecasting performance by the rational combination of the forecast result through various combinational tests. Our test result has been showed that the two-stage combination model is more excellent than the normal combination model. Also we have comprehensively estimated the combination forecast methods according to the forecasting performance indicators. The estimated result have been shown that the combination forecast methods on the basic of the degree of grey relation and the optimal grey relation combination have fine forecast performance. 1. The phase space reconstitution 1.1. The theory of phase space reconstitution of the chaos time series 2 Recently, the analysis of nonlinear system especially time series generated under the chaos background becomes to regard as important more and more for person. The chaos phenomenon which there exists widely in the natural world is a kind of irregular motion and it is one of the complicated behaviors generated by the deterministic nonlinear dynamic system. The analysis of chaos time series is an important application field. It not only can be progressed the detection and diagnosis of chaos through the determination of dynamic model for the system which are going to research but also it can be able to apply widely in the various field of the natural science and social science. It has the very important signification in theory and practice, for example, the forecasting of stock market price and price fluctuation, the forecasting of glacial epoch. Recently, according to the intensification of the research for chaos theory and applied technology constantly, the model-building and the forecasting of chaos time series becomes to a hot spot research field in the forecasting of stock and exchange rate. Until now, the persons have already suggested various forecast method of chaos series on the basic of Takens embedding theorem and the idea of phase space reconstruction. The foundation of the forecast of chaos time series is the theory of phase space reconstruction. Through the phase space reconstruction, one can find the law of evolution which is behinded in chaotic attractor. And, by entering the present data to range which can be described, one can obtain a novel method and idea to research the time series. [Definition 1] Let ( N1 , ρ1 ) and ( N 2 , ρ 2 ) are tow metric space. We assume that there exists mapping ϕ : N1 → N 2 and it holds true the following conditions: (ⅰ) ϕ is surjective mapping (ⅱ) ρ1 ( x, y ) = ρ 2 (ϕ ( x), ϕ ( y )) , ∀x, y ∈ N Then ( N1 , ρ1 ) and ( N 2 , ρ 2 ) is called an isometric isomorphism. [Definition 2] Let ( N1 , ρ1 ) and ( N 2 , ρ 2 ) are tow metric space. Let ( N 0 , ρ 0 ) is a subspace of metric space ( N 2 , ρ 2 ) . If ( N1 , ρ1 ) and ( N 0 , ρ 0 ) is called an isometric isomorphism, then it is called that metric space ( N 1 , ρ1 ) can be embedded to metric space ( N 2 , ρ 2 ) . [Takens theorem] Let M be a d dimensional manifold and ϕ : M → M be a smooth diffeomorphism mapping And let γ : M → R be a second order continuously differentiable mapping and φ (ϕ , γ ) be a mapping φ (ϕ , γ ) M → M 2 d +1 . Here φ (ϕ , γ ) = (γ ( x ), γ (ϕ ( x)), γ (ϕ 2 ( x )),⋯ , γ (ϕ 2 d ( x ))) . Then, φ (ϕ , γ ) is a embedding from M to R 2 d +1 For a time series {x1 , x 2 , ⋯ , x n −1 , xn ,⋯} , if we can suitably choice the embedding dimension m and delay time τ , then can reconstruct phase space: Y (t i ) = [ x (t i ), x (t i + τ ), x (t i + 2τ ), ⋯ , x (t i + (m − 1)τ )] ( i = 1,2, ⋯) (1) By Takens theorem, we can immediately return to the dynamic character of the attractor under the meaning of phase equivalence. The theoretical dependence of chaos forecast for finance time series is the delay embedding theorem subjected by Takens and Mance. 3 We assume that an actual data { y (k )} (k = 1,2,⋯ , N ) is output of certain state for one dimensional system. By using the delay embedding theorem, the time series { y (k )} of one dimensional dynamic system has been embedded to D E -dimensional space( the embedding delay time is τ ) that is y (k ) ⇒ y R (k ) = [ y (k ), y (k − τ ), y (k − 2τ ),⋯ , y ( k − ( D E − 1)τ )] Let “ {D E ,τ } ” be a window with which impute dimension is D E and delay time is τ . This window has made to appear all elements of D E -dimension among time series { y ( k )) at the same time. When the time series have been moved sequentially and passed this window, we can obtain D E -dimension state vector such as: Yk = [ y (k ), y (k − τ ), y ( k − 2τ ), ⋯ , y ( k − ( DE − 1)τ )]T , k = 1,2, ⋯ , N m (2) Here N m = N − ( D E − 1)τ is number of reconstructed vectors. The method which the state vectors have been obtained by such method from the time series y (k ) is called an embedding methods. The space composted from the vector Yk is called a quasi-phase space. Let N be a dimension of original phase space. If condition m ≥ 2 N + 1 holds true, then Takens theorem [2] shows that the quasi-phase space and the phase space of systemic is diffeomorphism. That is, above two spaces is the equivalent space topologically. Therefore, those have perfectly same dynamic character each other. 1.2. The determination of embedding dimension and delay time One of the crucial problems of reconstruction for phase space is to determine the delay time τ . There are many methods to choose of τ for actual problem already. The method often used is the self-correlation function method and the method of mutual amount of information. By using method of average mutual amount of information, we have determined the embedding dimension. The delay is choused as τ which average mutual information I (τ ) minimize and the embedding dimension is determined by the procedure of false nearest neighbors[41]. The procedure of average mutual information method is given as follows. When the time series { y (k )} is given, we divide the change width of { y (k )} to some subinterval (for example, subinterval of B number) We find out the probability which fall to the subinterval by number of average mutual information entering to each subinterval. For the delay sequence P ( y ( k − τ )) , same procedure is too progressed. Then, we compose the state set of B2 number by the change width of sequence { y (k )} between delay sequence P ( y ( k − τ )) and find out joint probability P ( y ( k ), y ( k − τ )) by number which y (k ) and y ( k − τ ) belong to each state set at the same time. The average mutual information I (τ ) is given by I (τ ) = ∑ P( y(k ), y(k − τ )) log 2 P ( y (k ), y (k − τ )) /( P ( y (k )) P ( y (k − τ ))) y ( k ), y ( k −τ ) The procedure of false nearest neighbors is given as follows. 4 When the time series { y (k )} is given, making increase the DE from 1 one by one, we find out the nearest neighbors of each point Yn = [ y (n), y (n − τ ),⋯ y (n − ( DE − 1)τ )] , n = 1,2, ⋯ , N − τ in the DE -dimensional space. The Euclidean metric is used in the calculation of neighbors. Then, adding component y (n − DEτ ) to DE -dimension vectors, we judge whether the nearest neighbors of DE -dimension stand also still to the false nearest neighbors in DE + 1 -dimension. When incrementing the DE , the number of the false nearest neighbors which is not done the neighbors in DE + 1 -dimension decreases as function of DE . When dropping the ratio of the false nearest neighbors to certain threshold value for instance below-1%, we choose its corresponding dimension as embedding dimension In the case of our example, delay time and embedding dimension found out from above procedure are τ =1, DE =4 respectively By this method, we have determined delay time and embedding dimension for SVR regression. 2. The smoothing of data and wavelet transformation In the chaos forecasting for finance time series, by using delay and embedding theorem, one-dimension finance time series { y (k )} is embed to D E -dimension space (embedding delay time is τ ) and by using the state vector reconstructed, the forecasting for observable quantity is progressed Actually, this problem is to approximate a mapping f satisfying as following condition; f : R DE → R y (k + 1) = f ( y R ( k )) (3) In the finance time series analyses, this is a non-well posed problem. If the following three conditions that is, existence, uniqueness, continuity holds true at the same time ,then given problem is called a well posed problem in meaning of Hadamard . If it doesn’t hold true, it is called a non-well posed problem,. The cause occurred the non-well posed problem in dynamic system composed by finance time series is due to the following facts: The first, the existence condition doesn’t satisfied because of various unknown cause The second, it is owing to the finance time series can’t hold the sufficient information which is reflecting the dynamic situation of financial market. Therefore, uniquely reconstructing the phase space for this system is impossible The third, owing to the finance time series suffers the effect of various sudden accidents and hearsay, the fluctuation of system make strongly destroy the continuity condition. Therefore, it is caused any uncertainty in the dynamic reconstruction The basic method which non-well posed problem converts to well pose problem is to give the restriction for mapping f : R D E → R by introducing various a priori knowledge. The regularization theory of Tikhonov ([8]) is an effective method to solve this problem. Now, the capacity of the financial market of some countries is comparatively small and law is incomplete, development doesn’t maturate and fluctuation is excessive. 5 Therefore, necessarily one hand the approximation requirement for mapping f : R D E → R should be extended, on the other hand the inherent features of system evolution should be stabilized by removing the effect of short-term fluctuations for the system. This and the regularization theory are consistent with prior information smoothing which often accepted for f . Therefore, by retreating from the others demand and progressing the approximation for smoothed f , we are going to attain to the goal for forecasting of finance tine series. There are three sorts of smoothing method that is, average smoothing method, exponent smoothing method, wavelet transformation smoothing method in the technical analysis of financial market The smoothing data obtained from average smoothing method have certain time delay and the smoothing data obtained from exponent smoothing method make remove time delay. These two sorts of method all are the typical smoothing method Meanwhile, smoothing method by wavelet transformation is new technique developed in the last 20 years. There is no the time delay in the reconstructed smoothing data as low-frequency spectrum by using wavelet transformation. In the traditional time series analytical technique, it has been assumed that time series all is stationary in time. But, actually time series data encountered with real world are the non stationary time series Decomposing the time series over distinctive frequency channel by step after step in the processing method of time series data by wavelet, after that the decomposed data make have strong the stationary capacity. Moreover, owing to wavelet decomposition make a smoothing action for time series data, it exhibit itself superiority in the processing for non-stationary random time series. We have used the wavelet noise elimination procedure-wden in Wavelet Toolbox of MATLAB 7.8 and applied third order coiflet- coif3 with family of functions for wavelet. By using time series obtained after which noise are removed to SVR time series model, we have progressed the forecast. Then, in the comprehensive forecasting method, we have progressed the forecast by using fuzzy Markov model and weighted Markov model for the forecast error obtained from SVR and it made compensated to the forecast result of SVR. In combinational forecast, we have used the combined weight determination method based on the least square combined weight determination method, the weight determination method by effective degree, the weight determination method by grey relation degree, the weight determination method by optimal grey relation degree. Then, we made compared for the combinational forecast result. 3. The wavelet-least square support vector machine How to obtain the algorithm which accuracy high and generalization ability strengthen is too the problem suggested very urgently. 6 In the paper [16], Support Vector Machine (SVM) is used and this is a sort of new algorithm. This method have more advantage than another methods which performance criterion choose to minimize the empirical risk and it have optimal solution in the global range at the same time because of its algorithm is convex quadratic programming. But, when data volume is large, traditional SVM algorithm demand great computational costs and there are also suggested some problems in the choice of kernel function. In relation to this, least square support vector machine (LS-SVM) is a sort development of the traditional SVM. There is that reason because of LS-SVM makes change to equality restriction for inequality restriction of SVM method and the error square and loss function make to empirical loss finally the problem make change to linear matrix problem. This method is fast in the solving velocity than the algorithm convex quadratic optimization and less computational costs is required( [13,14]). In this paper, we have applied this algorithm to construct wavelet kernel function. 3.1. LS-SVM prediction theory Essentially, the forecast belongs to the regression problem. That is, through the function estimation, the relational model between input value and out value is settled up and an ahead output value is forecasted by this model. LS-SVM algorithm is constructed as following( [2,3]). Let {( x(1), y (1)), ( x(2), y (2)),⋯, ( x( N ), y ( N ))} be an indicated training data. Here x(i) ∈ R d are input arguments and y (i) ∈ R are out arguments. y (i ) = f ( x(i )) (i = 1,2,⋯, N ) and f (x) ( x = ( x(1), x( 2), ⋯ , x( N )) ) is an unknown function to be should estimate. We make the nonlinear mapping φ : R d → H and function f (x) to be should estimate choose as following:. y = f ( x) = wT φ( x) + b (3) Here φ is called the characteristic mapping and H is called the characteristic space. w is output vector in the space H and b ∈ R is bias Then, LS-SVM method which estimates nonlinear function in the characteristic space becomes optimization problem as following. min J ( w, e) = w, b , e 1 T 1 w W+ γ 2 2 N ∑ e(i) 2 i =1 s.t. y (i ) = wT φ ( x(i )) + b + e(i ) Here e(i ) ∈ R , i = 1,2,⋯, N is variable which express the error. J ( w, e) is composed of regularization part 1 T 1 N w w and error square part γ ∑ e(i) 2 . 2 i =1 2 Here γ is positive constant. Generally, solving the extreme value problem (4) is very difficult. 7 (4) The reason is that w can be infinite-dimensional. Accordingly, we transform this problem to dual spaces and define Lagrange function such as; N L( w, b, e, α ) = J ( w, e) − ∑α [w φ ( x(i) + b + e(i) − y(i)] T (5) i i =1 Here α is Lagrange's indeterminate multiplier Then, the optimality condition is given as following: N  ∂L = → = w 0 α iφ ( x(i))   ∂w i =1  N  ∂L = 0 → α = 0 i  ∂b i =1   ∂L  ∂e(i ) = 0 → α i = γe(i )   ∂L = 0 → wT φ ( x(i ) + b + e(i ) − y (i ) = 0(i = 1,2,⋯ , N )   ∂α i ∑ ∑ (6) Eliminating e(i) and w and solving equation (6), following equation are obtained. 0  I  v   b  0 1   =   Ω + I α  Y  γ  I vT Here Y = [ y (1), y ( 2), ⋯ , y ( N )] I v = [1,1, ⋯ ,1]T , , α = [α 1 , α 2 ,⋯ , α N ] , Ω ij = φ ( x(i )) T φ ( x( j )) = K ( x(i ), x( j )), i, j = 1,2, ⋯, N . K ( x(i ), x( j )) is kernel function This is called Mercer condition. The estimating function of LS-SVM is given as following: N y (i ) = ∑α k K ( x ( k ), x (i )) + b (7) k =1 α i and b can be obtained from linear equation There are various forms for kernel function but we take often as follows form([10]) (ⅰ) polynomial kernel function; K ( x, y ) = ( xy + c) d , c is constant and d = 1, 2, ⋯ (ⅱ) RBF kernel function; K ( x, y ) = exp( − x− y 2 ) 2σ 2 (ⅲ) Sigmoid kernel function; K ( x, y ) = tanh[b( x ⋅ y ) − c] 3.2.The construction of wavelet kernel function In the papers [8,12] , the input data make decomposed by using wavelet and the new decomposed coefficients are used with the input data. Then, combination of wavelet and SVM is realized by using RBF kernel function. 8 In this paper, we consider the method composing wavelet kernel function on the basic of certain frame [Essence of kernel function]. Let F be a frame and R be a composition operator of F . And let R* be a decomposition operator of the F. If we put Q = RR* , then Q is bounded measurable frame( [11]) We assume that λ is a positive operator and G ( x, y ) is Green function of λ *λ . Then G is the kernel of Mercer and K ( x, y ) =< (λ K ( x, ⋅), λ K (⋅, y ) > (λ *λ G (⋅, y ))( x) = δ y ( x) are satisfied. In this formula δ y ( x) is estimation operator of y , K ( x, y ) is kernel function to be should estimate. Therefore, we can define kernel function such as; K (⋅, x) : x → λ G (⋅, x) Let H s be Sobolev space. We put F = { fi } ⊂ H = H s (Ω) Let G ( x, y ) ∈ H s (Ω × Ω) be Q -Green function. Making operator λ = R* , we obtain (QG (⋅, y ))( x) = δ y ( x) . According to the character of δ y ( x) , we obtain G ( x, y ) =< G (⋅, y ), δ x (⋅) > Because of G ( x, y ) =< G (⋅, y ), δ x (⋅) >=< G (⋅, y ), QG (⋅, x) >=< G (⋅, y ), RR*G (⋅, x) > =< R*G (⋅, y ), R*G (⋅, x) >l 2 holds true. Hence K =G (8) Essentially, kernel function is Green function of decomposition and is composite normal operator under the some frame. This is very similar to wavelet decomposition and composition. Therefore, again to think the solution of Green function ( kernel function ) under the wavelet frame is very easy. [Construction of kernel function by wavelet] The frame theory was proposed by Duffin etc at 1952 and it was researched based on concept of normal orthogonal basis 9 Its aim is to compose function f from inner product of f in Hilbert space with family of functions {ψ k }k∈K ([7]). We assume that family of functions {ψ k }k∈K is given in Hilbert space H . Then , if there exist 0 < A < B < ∞ for all f ∈ H such that 2 A f ≤ ∑ < f ,ψ k > ≤ B f 2 2 (9) k then family of functions {ψ k }k∈K is called frame in the space H . And A and B are called upper-limit and lower bound of frame respectively. Especially, if A = B ,then it is called strict frame and if A = B = 1 , then it is called orthogonal frame. If ψ k = 1 , then {ψ k } is normal orthogonal basis. For arbitrary f which belongs to H , we can decompose as following; f = ∑ < f ,ψ k >ψ k = ∑ < f ,ψ k >ψ k k (10) k Here ψ k is conjugate frame of ψ k . Let F = {ψ i } be frame in the square integrable function space L2 (Ω) and {λi } be increasing sequence of positive numbers. Then function K ( x, y ) can be expressed such as K ( x, y ) = ∑ λψ i i ( x )ψ i ( y ) (11) i The function defined by above formula is half positive value. [Theorem 3.1] (Mercer’s Theorem) Let function K ( x, x′) is symmetry in space L2 . Then the necessary and sufficient condition for which K ( x, x′) is inner product in the characteristic space is to satisfy as following condition; ∫∫ d R ×R K ( x, x′) f ( x) f ( x′) dxdx′ ≥ 0 d for all f which satisfies the condition f ≠ 0, ∫ f(ξ )dξ < ∞ . Rd This theorem gives soon the process to judge and to construct the kernel function. The above formula make to be used kernel function in SVM which it is to be satisfied the Mercer condition. There is another kind of case. If the parallel displacement invariant kernel function, for instance K(x, x′) = K(x − x′) satisfies the Mercer’s theorem, then it is admissible kernel function. But actually to decompose the parallel displacement invariant kernel function to two functions is very difficult. Following theorem gives the necessary and sufficient condition for which the parallel displacement invariant kernel function is kernel function in SVM. 10 [Theorem 3.2] The necessary and sufficient condition for which the parallel displacement invariant kernel function K(x, x′) = K(x − x′) is admissible support vector kernel function is to satisfy Fourier transformation of K ( x) such as condition F [ K ( w)] = (2π ) d 2 ∫e −i ( w, x ) K ( x)dx ≥ 0 Rd If theorem 3.1 and theorem 3. 2 hold true, then the kernel function of SVM can be constructed. Now, let us see the kernel function constructed by wavelet. Let ψ ( x) be a generating function of wavelet. Let a be the flexible factor and m be the parallel displacement factor in the generating function of wavelet ψ ( x) . If the wavelet frame is generated by this the generating function of wavelet, then the wavelet kernel function is constructed such as d K ( x, x ′) = ∏ Ψ[ i =1 x(i ) − mi x ′(i ) − mi′ ]Ψ[ ] ai ai′ (12) Here x, x ′ ∈ R d ; x(i), x ′(i), ai , ai′ , mi , mi′ ∈ R , ai , ai′ ≠ 0 . [Least-square wavelet Support Vector Machine (LS-WSVM)] In the above, we have made the kernel function of general SVM based on wavelet. If the wavelet kernel function is determined, then the model is soon determined. In this paper, to construct the parallel displacement invariant kernel function, we have choused x2 ). 2 By above mentioned argument, the parallel displacement invariant wavelet kernel function Mexican Hat wavelet kernel functionψ ( x) = (1 − x 2 ) exp(− composed by Mexican Hat wavelet is given such as; d K ( x, x ′) = K ( x − x ′) = ∏ i =1 x(i ) − x ′′(i ) Ψ[ ]= ai d x(i ) − x′(i ) i =1 ai2 ∏[1 − 2 ] exp[− x(i ) − x ′(i ) ai2 2 ] (13) Here x(i), x′(i), ai ∈ R , ai′ ≠ 0 , x, x ′ ∈ R d . This is a sort of admissible kernel function of SVM. Now, we assume that G = {x(i ), y (i )}iN=1 are training samples and xi ∈ R d are input vectors. Here N is the whole number of data and y (i) ∈ R is the expected value. We assume that the numbers of support vector included into the input vector is M respectively. And we denote those by SV1 , SV2 , ⋯ , SV M . Then, by means of wavelet transformation, corresponding wavelet frame Ψ (x(1)), Ψ (x(2)), ⋯, Ψ ( x( M )) satisfying Mercer condition is obtained. Therefore, we can obtain the kernel function corresponding to it given by the formula (13). Accordingly, we can obtain the LS-WSVM approximate function which appropriate to the regression problem such as 11 N y= d ∑ ∏ k =1 αk [1 − x k (i ) − x ′k (i ) 2 ] exp[− a ′k2 i =1 x k (i ) − x ′k (i ) 2a ′k2 2 ]+b (14) In this formula x k (i) is i th component in k number of training data. So, we have constructed a new regression method by using wavelet kernel function and LS-SVM That is, we have constructed the Least-square Support Vector Machine (LS-WSVM) based on wavelet. Essentially, LS-WSVM is a sort of form for LS-SVM. To choice N × d number parameters a ′k , i = 1,2, ⋯ , d ; k = 1,2, ⋯ , N is difficult because of the parameters of kernel for LS-SVM can’t be optimized. Therefore, to decrease and simplify the numbers of parameters, we put ak′ = a . Then, the numbers of parameters for the kernel function become one. The super parameter a of wavelet kernel function can be choosed by using the cross-validity method. But, in this paper we have used the genetic algorithm. The support vector machine SVM is strong nonlinear system. The less change of its intrinsic parameter exerts on the effect in the adapted performance of the system. Generally, the parameter σ of the kernel function for SVM has been established in initial moment next it keeps on constancy. But, owing to the financial market system is strange and complicate besides there is the time-varying law , clearly it don’t conform with to use the invariant kernel parameter at direct series forecast actually. Therefore, in this paper we have proposed the method adjusting the kernel function parameters of SVM automatically by using the genetic algorithm. The genetic algorithm is a kind of global optimal search algorithm simulating the process of organic evolution. Their objective functions not only don’t demand the continuity but also don’t demand the differentiability, have only to demand calculability of the problem. Besides, its exploration has been progressed in the integrated solution space from the beginning to the finishing. Therefore, the global optimal solution has been obtained easily. Suppose that the test length is T and the sample length is N . Suppose yˆ1 (i ) (i = 1,2,⋯, T ) is the predicted value for the T number of test data and y1 (i ) (i = 1, 2,⋯, T ) is the T number of actual value for the test data. And we introduce the notation ŷ1 = ( yˆ1 (1), yˆ1 (2), ⋯ , yˆ1 (T )) , y1 = ( y1 (1), y1 (2), ⋯ , y1 (T ))) T yˆ − y RMSE1 = 1 1 T ∑[ yˆ (i) − y (i)] 1 = 2 1 i =1 T 2 L Then, we define the calibration error such as; T yˆ − y RMSE1 = 1 1 T ∑[ yˆ (i) − y (i)] 1 = 2 L 1 i =1 T 12 2 Suppose that yˆ1 (i ) (i = 1,2,⋯, N ) is the predicted value for the N number of fitting data and y1 (i ) (i = 1, 2,⋯, N ) is the N number of actual value for the fitting data. And we introduce the notation ŷ 2 = ( yˆ 2 (1), yˆ 2 (2), ⋯ , yˆ 2 ( N )) , y 2 = ( y 2 (1), y 2 (2), ⋯ , y2 (T )) Then, we define the error of fitting such as; N yˆ − y 2 RMSE2 = 2 N ∑ [ yˆ (i) − y (i)] 2 = 2 2 i =1 N L2 fitness = −(η1 RMSE1 + η 2 RMSE ) With due regard to the calibration error and the error of fitting comprehensively, we have defined the fitness function such as N yˆ − y 2 RMSE2 = 2 N ∑ [ yˆ (i) − y (i)] 2 = L2 2 2 i =1 N Here η1 and η 2 denote the weight coefficients. We put η1 = 0.3 , η 2 = 0.7 . Let note that the fitness function is the inverse of the predicted error. Therefore, to maximize the fitness function corresponds to minimize the predicted error. When the genetic algorithm arrives at the stop standard, an individual with the greatest fitness degree is corresponded to optimal parameter of SVM. 4. Forecasting by fuzzy Markov-support vector regression and weight Markov We assume that X̂ t is the fitting curve which is obtained through forecasting for the financial time series Yt by using wavelet-support vector regression. In order to progress Markov prediction, it is need to make several state by dividing the relative error of given time series. In due consideration of the actual meaning of the time series, in this paper we have generated a new time series Z t = (Yt − Xˆ t ) / Yt −1 (t = 2,3, ⋯ , N ) which the fitting curve X̂ t make reference Here Yt −1 is one step of time delay value. In accordance with the distribution of the random sequence Zt , it is divided by k pieces of state and is taken its partition value. That is, e1 = [m0 , m1 ] , e2 = [m1 , m2 ] , , ⋯ , ek −1 = [mk − 2 , mk −1 ] , ek = [mk −1 , mk ] Here mi ≥ mi −1 . Then, the sequence Zt is the random sequence which E = {ei } (i = 1, 2, ⋯ , k ) become its state space. Markov process is a field of random process and its greatest character is the “un-posterior effectiveness”. That is, the “future” and the “past” of the given some random process is independent under the condition of “present”. Markov chain is the Markov process which its state and time parameter all are discrete and its mathematical notation is given as follows. 13 We assume that sequence { X (t ), t ∈ T }, T = {0,1,2, ⋯} of probability space (Ω, F , P ) was defined The state space I = {0,1,2,⋯} is called Markov chain, if it satisfied the condition such as; that is , for arbitrary positive integers l , m, k and nonnegative integer jl > ⋯ > j 2 > j1 ( m > jl ), im + k , im , i jl , ⋯ , i j 2 , i j1 P{ X (m + k ) = i m + k X ( m) = i m , X ( jl ) = im X (m) = i jl , ⋯ , X ( j 2 ) = i j 2 , X ( j1 ) = i j1} = = P{ X (m + k ) = im + k X (m) = im } (15) holds true. Here the left-hand side of expression (15) should have the meaning, that is P{ X (m) = im , X ( jl ) = im X ( m) = i jl ,⋯ , X ( j 2 ) = i j 2 , X ( j1 ) = i j1} > 0 There are many definitions for the properties and characters of Markov chain . We don’t mention for that one by one. In the practical application, we consider the homogeneous Markov chain, that is, for arbitrary k, n ∈ N + Pij (n, k ) = Pij ( k ) , i, j = 0,1,2,⋯ , (16) holds true. Here Pij (n, k ) denote the probability which n -step state equals to i and the transition probability transited to the state j by passed k -step is given by it. The transition probability transited form i to j by pass k -step is denoted by Pij (k ) . That is, pij = p{xk(0)+1 = j xk(0) = i} = nij / ni = M ij (i, j = 1, 2,3,⋯ , m; k = 1, 2,⋯ , ( N − 1) . The homogeneous Markov chain X (t ) is perfectly determined by its initial distribution {P(i ), i = 0,1,2,⋯} and its state transition probability matrix (that is, it is composed by the state transition probability Pij (i, j = 0,1,2, ⋯) ). [Testing of Markov property] We assume that ni is the number which down at state ei among the N number points of given random sequence Zt . We denote the frequency nij of transition from ei to e j for the state Z1 , Z 2 , ⋯ , Z N by passed one step. Then, we accept the statistical quantity such as; k Pij = nij ni ∑n ij , P0 j = i =1 k ∑n k , k χ 2 = 2∑∑ nij log i =1 j =1 Pij P0 j i i =1 Then, when N is comparatively large, the statistical quantity χ 2 is 14 according to χ 2 -distribution with the degree of freedom (k − 1) 2 .([3]) When giving the degree of confidence α , if χ 2 > χα2 (m − 1) 2 ,then we confirm that the random sequence Zt have Markov’s property, unless, the sequence haven’t Markov’s property. [Fuzzy Markov forecasting model] Suppose U is the numerical range which random variable of Markov chain adopt and we construct the fuzzy state set S1 , S 2 ,⋯, S l If for arbitrary u ∈ U the condition l ∑µ m= Sm (u ) = 1 is satisfied, and then µ Sm (u ) is called the member degree of the fuzzy state S M for numerical valueU . The value Zt which the fuzzy variable adopts in some time certainly didn’t revert to some state by all means, but it is split by another member degree and belongs to each fuzzy state. That is Zt is split and belongs to each fuzzy state. [Definition 4.1] Suppose µ Si ( Z t ) ⋅ µ S j ( Z t +1 ) is the fuzzy state transition coefficient from the state Si to state S j when time is turned from t into t + 1 . Then, N −1 aij = ∑ µ Si ( Z t ) ⋅ µ S j ( Z t +1 ) t =1 is called fuzzy transition frequency number from the state Si to the state S j . When the state Zt belongs to Si with degree of member µ Si ( Z t ) and belongs to S j with degree of member µ S j ( Z t ) , the transition order is only expressed by the product between degrees of member µ Si ( Z t ) ⋅ µ S j ( Z t +1 ) . Owing to the fuzzy transition probability from the state Si to the state S j is denoted by Pij = aij ∑a , ( (i, j = 1, 2, ⋯ , M ) ij j =1 , then the time series time series which we are going to establish is given such as; k Yˆt = Xˆ t + ∑ i =1 k µ Si (Z t −1 ) 1 ∑ 2 (m i −1 + mi ) Pij Yt −1 , t = 1,2,⋯ , N j =1 Here, X̂ t is the predicted value obtained by using wavelet –support vector. 15 [Forecasting model of weighted Markov chain] The autocorrelation coefficient of each order describes the correlation and its strength and weakness between the finance time series value in the every delay time, because of the finance time series is the random variable quantity depending mutually. Therefore, in forecasting of finance time series, we can consider as following method. The first, we choice the finance time series of several time stage before present time stage and can progress the forecast of finance time series of present time stage by using some method. Then, we find out the weight added sum by the strong and the weak of correlation between before each time stage and present time stage. That is, we can arrive at the forecast goal by using the information sufficiently and rationally. This is immediately the basic idea of the forecasting of weighted Markov chain. The basic method and procedure of the forecasting of weighted Markov chain is established such as: Step 1.For the financial time series, calculate the autocorrelation coefficient of each order rk , that is, n −k rk = ∑ n ( xt − x )( xt + k − x ) / t =1 ∑ (x t − x)2 (17) t =1 Here, rk denote the autocorrelation coefficient of k time stage (delay time k ) x k denotes the financial time series value of t time stage. And x denotes the average value of financial time series n denote the length of financial time series. Step 2. progress the normalization for the autocorrelation coefficient of each order. m wk = rk / ∑r (18) k k =1 These make m of Markov chain for every kind delay time (step length). Here m is the optimal order calculated by forecast demand. Step 3. Determine the grading standard of the financial time series (this is corresponded to the determination of state space for Markov chain). This is progressed based on the long and short of data sequence as well as the demand of problem. For example, we can divide grading standard by the class of il number. This is corresponded to the state space I = {i1 , i1 ,⋯il } . Step 4. On the ground of the grading standard established by procedure 3), the state of grading standard for each time stage is determined. Step 5. By progressing the statistical calculate for the results obtained by procedure 4), we can obtain transition probability for Markov chain of each other differential steps. This determines the probability law of the state transition process for the financial time series Step 6. If each financial time series before some time stage is selected as an initial state and is coupled the state transition probability matrix corresponded to it, then the state probability Pi (k ) at this time stage for the financial time series is immediately forecasted. Here, i, i ∈ I is the state and k ( k = 1,2,3, ⋯ ) is the delay time (step). 16 Step 7. Making the weight added sum for each forecast probability of same state, it become the forecast probability to be faced in this state for the financial time series, that is m Pi = ∑w P (k ) k i (19) k =1 Thus, finally i corresponded to max{Pi , i ∈ I } become immediately the forecast state of this time stage for the financial time series. After that obtained the financial time series value occurred at this time stage, it inserts in the original time series and repeat the procedure 1)-7), then the forecast value in next time stage for financial time series can be obtained. Therefore, we make the forecasting model by the fuzzy Markov-support vector regression and the weighted Markov such as; 1 Yˆt = (Yˆt (1) + Yˆt ( 2 ) ) 2 Here, Yˆt is the comprehensive forecast value and Yˆt (1) are the forecast value by the fuzzy Markov-support vector regression forecasting model and Yˆt ( 2) the forecast value by the weighted Markov forecasting model. The forecasting model obtained by above methods is called wavelet-support vector regressionMarkov (Wavelet-SVR-Markov) forecasting model. 5. The comprehensive forecasting model Practically, there are various sorts of models which can be used to forecast generally. When encounter to the problem how choice the actual forecast value from different forecast values obtained by using various types of “possible” models, the problem such that predictor use what kind of model and choose what sort of predicted value is importantly suggested. In fact, each model reflects only some aspect of the information under this circumstance. To neglect the model which can be used in some degree latently means that some wrathful information can be neglect. And if any single model is only to choose, then global character of time series evolution can’t be described perfectly. In order to avoid these problems, to making the comprehensive forecast is suitable for predictor by considering the combined forecast method. The idea of comprehensive forecast is such that the predicted values obtained from various kinds of models how make to combine with organized method by the added accuracy. If each forecast method is well combined, then not only a matter for regret such that the single individual model throw away some aspect of useful information can be avoided but also the randomness of forecast can be weakened and the accuracy can be enhanced. At the present, the idea of comprehensive forecast is widely used in various kinds of forecasts practically. If the forecast is only made by traditional single model, then there can be some shortcoming. 17 For instance, the information source can’t be extensive and there can be the sensitivity for the model setting form etc. After suggesting first the method of comprehensive forecast in paper [1], it not only receive importance from many predict experts ,but also become heat point task in the forecast field([1-11]). The comprehensive forecast is immediately the method presenting the effective forecast result by combining the individual forecast result obtained from single forecast model with the suitable weighted average form. The most key problem in the comprehensive forecast is how to find good weight coefficient and to enhance more effectively for the comprehensive forecast model. At present, the most many comprehensive forecast methods suggested in actual application and theoretical research is to calculate the weight coefficient of the comprehensive forecast methods by using a kind of absolute error make as optimal criteria. Therefore, the researches of comprehensive method don’t be completed yet and an optimal comprehensive forecast model built various kinds of combined criteria is demanded. So, to enrich the comprehensive forecast theory and methods is demanded in going one more step forward. In paper [6] an optimal comprehensive forecast model which the error sum of squares arrive at minimum under the condition of unless non-negative constraint is built and the condition has been judged which a simple average method is whether the recessive comprehensive forecast or dominant comprehensive forecast by using the property of information matrix for the comprehensive forecast absolute error. In paper [7], going one more step forward. an optimal comprehensive forecast model of the error sum of squares under the condition of non-negative constraint condition has been studied. In paper [8], a comprehensive forecast model based on the forecast effective degree has been studied and the solving method of linear programming for it’s has been given. In paper [9], the properties of the comprehensive forecast model based on the forecast effective degree have been studied. In paper [10], another one of new pathway for the comprehensive forecast method has been presented. That is, an optimal comprehensive forecast model based on dependence indicator has been presented. These models include the comprehensive forecast model maximizing grey relation degree, the comprehensive forecast model maximizing correlation coefficient, the comprehensive forecast model maximizing narrow-angle cosine etc. These methods don’t directly consider the magnitude of prediction error. Therefore, these methods have comparatively the great disparity over the traditional comprehensive forecast model But, in paper [9] it has been explained that the comprehensive forecast method based on the correlation in only a standpoint of an actual proof analysis can be obtained a good comprehensive forecast effect relatively. In this paper, the effectiveness of the comprehensive forecast method based on the grey relation degree upon comparison with the comprehensive forecast model based on the maximization for grey relation degree suggested in paper [10] has been explanted mainly. 18 [Dominant forms of the typical comprehensive forecast] By considering the principle of comprehensive forecast, there are three kind of mutual another comprehensive forecast method that is, arithmetic average combination method, geometric mean combination method and harmonic average combination method. Those combination formulas are given such as respectively yˆ (t ) = k1 yˆ1 (t ) + k 2 yˆ 2 (t ) , (t = 1,2, ⋯ , N ) yˆ (t ) = yˆ1k1 (t ) + yˆ1k2 (t ) , (t = 1,2, ⋯ , N ) yˆ (t ) = 1 , (t = 1,2, ⋯, N ) k1 / yˆ1 (t ) + k 2 / yˆ 2 (t ) Here N is total number of forecast data which we are going to obtain yˆ1 (t ) , yˆ 2 (t ) are the predicted values by using the model 1 and model 2 respectively. k1 , k 2 are the weight coefficients of two forecast models respectively. The most important problem in the comprehensive forecast is to find the weight coefficients k1 , k 2 by how method. The most common used method in the comprehensive forecast is the arithmetic average combination forecast form, that is, m yˆ (t ) = ∑ k yˆ (t ) , i i (t = 1,2, ⋯ , N ) i =1 Here yˆ i (t ) (i = 1,2,⋯, m) is the predicted value by the forecast method of i th model and m is number of forecast model. k i is the weight coefficient of i th model. [Some weight determination methods of comprehensive forecast model] In the determination methods of combinatorial weight for the traditional comprehensive forecast model there are the determination methods of combinatorial weight based on averaging, the determination methods of combinatorial weight based on standard deviation, and based on deviation coefficient etc. Concretely, those methods are given such as; (ⅰ) The determination methods of combinatorial weight based on averaging. In this method, the weight w j is taken such as; wj = 1 m ( j = 1,2,⋯ , m) (20) Owing to take the average in this method, all models entering in main combination have been dealt with uniformity and equality This method has been often used when the predictor don’t select a key which some model have an advantage than another model in the models taking part in the comprehensive forecast. (ⅱ) The determination methods of combinatorial weight based on standard deviation In this method, the weight w j is taken such as; wj = S −Sj S ⋅ 1 m −1 m , S = ∑ S j ( j = 1,2,⋯, m) j =1 19 (21) Here S j is the standard deviation of j ’th model. If this model has been used, then the model which have minimum standard deviation should been taken the greatest weight in the comprehensive forecast model. (ⅲ) The determination methods of combinatorial weight based on deviation coefficient. We assume that there are n numbers forecast points. Let ŷ ij be the predicted value in the point i(i = 1,2, ⋯, n) by model j ( j = 1,2,⋯, m) and y i be the average of m numbers of predicted value in the point i . Then, the weight w j is taken such as ; d −dj wj = d ⋅ 1 ( j = 1,2,⋯ , m) m −1 (22) Here d j is deviation coefficient and d is sum of d j defined as below dj = 1 n m n ∑ ( yˆ i j − y i )2 ( j = 1,2,⋯ , m) , d = ∑d j . j =1 j =1 Now, let us consider the determination methods of combinatorial weight based on least square method, the determination methods of combinatorial weight based on effective degree, the determination methods of combinatorial weight based on grey relation degree, the determination methods of combinatorial weight based on optimal grey relation degree, the determination methods of combinatorial weight based on the theory of rough set etc. These methods have been made attention recently. 5.1.The determination methods of combinatorial weight based on least square method Let y = { y (1), y ( 2), ⋯, y ( N )} be original data series and yˆ j (t ) ( j =1,2,⋯,m) be predicted value of the j ’th method in t time, let w j ( j =1,2,⋯,m) be its weights. Here suppose w j satisfies as following condition; m ∑w j = 1 , w j ≥ 0 ( j =1,2,⋯,m) (23) j =1 Now, we construct the comprehensive forecast model such as; m yˆ (t ) = ∑ w yˆ j (24)) j (t ) j =1 In order to determine the weight w j , the optimization criterion has been choused with the error square sum, that is 20 N min J = ∑[yˆ (t ) − y( y)] (25) t =1 Then, the comprehensive forecast model become above optimization problem. Now, we denote the error such as; ε jt = yˆ j (t ) − y j (t ) , ( j = 1,2, ⋯ , m; t = 1,2, ⋯ , N ) (26) The error square sum is given by N h jt = ∑ε 2 jt ( j = 1,2,⋯ , m) , (27) t =1 Now, let us ε it and ε jt are the prediction errors of i ’th method and j ’th method respectively Then, ε it and ε jt is mutually independent respectively Therefore, we have; n hij = ∑ ε it ⋅ε jt ≈ 0 , (i, j = 1,2,⋯, m) (28) t =1 Then, we introduce the notation such as H = diag[hij ] , W = [ w1 , w2 , ⋯, wm ]T , E = [1,1, ⋯ ,1]T (29) From above expression, the matrix form the comprehensive forecast optimization model has been obtained such as; min J = W T HW (30)  E TW = 1 s.t.  W ≥ 0 Let us accept Lagrange multiplier λ and construct Lagrange function such as L = W T HW + λ (E TW − 1) (31) According to Kuhn-Tucker condition, we have  ∂L  ∂W T = 2 HW + λE = 0   ∂L = E T W − 1 = 0  ∂λ (32) Solving these equations, we obtain 1 wj = h jj m 1 i =1 ii ∑h , λ=− 2 m 1 i =1 ii ∑h 5.2. The determination methods of combinatorial weight based on the effective degree Let us introduce the conception of effective degree of the forecast technique These indicators have certain reasonableness because the forecast accuracy is reflecting the effectiveness of the forecast technique. 21 To explain a discussion briefly, let us yˆ1 (t ) and yˆ 2 (t ) (t = 1,2, ⋯ N ) are the predicted value obtained by two kind of forecast method respectively. Then, an idea of the determination methods of combinatorial weight by the effective degree has been given such as; Now, if we introduce A(t ) = 1 − y (t ) − k1 yˆ1 (t ) − k 2 yˆ 2 (t ) y (t ) − yˆ (t ) = 1− y (t ) y (t ) then A(t ) constitutes the accuracy of the comprehensive forecast Let us define the average value E and average square deviation σ of A(t ) such as respectively 1 E= N N 1 1 N σ = ( ( A(t ) − E ) 2 ) 2 N t =1 ∑ ∑ A(t ) , t =1 Then, the effective degree of the comprehensive forecast method has been defined such as S = E (1 − σ ) It show that the greater S is, the more higher the accuracy of the forecast model, the more stable and the more and more effective the model There is comparatively the complicated method which k1 and k 2 find out by optimizing of S , but there is also simple method which they find out by using physical meaning. Now, assume that A1 (t ) and A2 (t ) are the forecast accuracy series using model 1 and model 2 respectively From above expression, we can find the effective degree S1 and S 2 of model 1 and model 2 respectively Then, by standardizing the S1 and S 2 , we put kj = Sj , 2 ∑S the weight coefficient k1 and k 2 such as j = 1, 2 i i =1 5.3. The determination methods of combinatorial weight based on grey relation degree Before considering the determination methods of combinatorial weight based on grey relation degree, let us consider the concept of the degree of grey incidences In systems analysis, after the characteristic quantities which describe systems’ behaviors well have been chosen, we need to clarify all the factors that effectively affect the systems’ behaviors. [Definition 5. 1]. Assume that X i is a systems’ factor with the k’th observation value being xi (k ) ( k = 1,2, ⋯ , N ) . Then X i = ( xi (1), xi ( 2), ⋯ , xi ( N )) is called a behavioral sequence of the factor Xi [Definition 5.2]. Assume that X 0 = ( x0 (1), x0 (2),⋯ , x0 ( N )) is a sequence of data representing a system’s characteristics, and X i = ( xi (1), xi (2),⋯ , xi ( N )) (i = 1,2, ⋯, m) are sequences of relevant factors. X = { X i i = 1,2, ⋯, m} is called the set of elements of relevant factors. For a given real number γ ( x0 ( k ), xi (k )) if we introduce expression γ (X0, Xi ) = 1 n ∑ γ ( x0 (k ), xi (k )) n k =1 then it satisfies the axioms 4 for grey relation ([41]). 22 Then γ ( X 0 , X i ) is called the grey relation degree of X i with respect to X 0 , and γ ( x0 ( k ), xi (k )) the relation coefficient of X i with respect to X 0 at point k . Assume that X 0 = ( x0 (1), x0 (2),⋯ , x0 ( N )) is a sequence of data representing a system’s characteristics, and X i = ( xi (1), xi (2),⋯ , xi ( N )) (i = 1,2, ⋯, m) are sequences of relevant factors. For ρ ∈ (0,1) , define γ ( x0 ( k ), xi (k )) = min min x0 (k ) − xi (k ) + ρ max max x0 (k ) − xi ( k ) i k i k x0 (k ) − xi (k ) + ρ max max x0 (k ) − xi ( k ) i k and γ (X 0, Xi ) = 1 n n ∑ γ ( x (k ), x (k )) 0 i k =1 Then, γ ( X 0 , X i ) satisfies the four axioms for grey incidences, where ρ ∈ (0,1) is called the identification coefficient. Generally we take ρ =0.5 The grey relation degrees are numerical characteristics for the relationship of closeness between two sequences. When analyzing systems, and studying relationships between systems’ characteristic behaviors and relevant factors’ behaviors, we are mainly interested in the ordering of the degrees of incidence between the systems’ characteristic behaviors and each relevant factor’s behavioral sequence. But, the numerical magnitude of the grey relation degree is incomplete. The order of grey relation is complete ordering relation over X In the research of time series, X 0 = ( x0 (1), x0 (2),⋯ , x0 ( N )) is called a sequence of system’s characteristics and X i = ( xi (1), xi (2),⋯ , xi ( N )) (i = 1,2, ⋯, m) is called a sequences of comparison Let us consider the determination methods of combinatorial weight based on grey relation degrees We assume that an actual value of time series { y (k ) k = 1,2,⋯, N } is given. Let us there are m kind of forecast method. Let yˆ i (k ) (i = 1,2,⋯, m, k = 1,2,⋯, N ) be predicted value of the i ’th method in k time. If we put ei ( k ) = y ( k ) − yˆ i (k ) , then ei (k ) is the predicted error of k time for i ’th forecast method. Now, we put comparison sequence X i ≡ Ei = (ei (1), ei (2),⋯ , ei ( N )) and reference sequence X0 = (x0 (1), x0 (2),⋯ , x0 ( N )) = (0,0,⋯,0) and find the grey relation degree γ ( X 0 , X i ) (i = 1,2,⋯, m) . Then we obtain the vector of grey relation degree Γ = (γ ( X 0 , X 1 ), γ ( X 0 , X 2 ),⋯ , γ ( X 0 , X m )) After normalizing the vector of the grey relation degree Γ , we put it is combinatorial weight vector W = ( w1 , w2 , ⋯ , wm ) . The greater weight (i = 1,2,⋯, m) , then the effecter for forecast . 5.4. The determination methods of combinational weight based on optimal grey relation degree We assume that an actual value of time series { y (k ) k = 1,2,⋯, N } is given. We assume that there are m kind of forecast method. Let yˆ i (k ) (i = 1,2,⋯, m, k = 1,2,⋯, N ) be predicted value of the time ( j = 1,2, ⋯, m, t = 1,2,⋯, N ) . We introduce some conceptions such as ([12]); 23 j ’th forecast method in k [Definition 5. 3] We put γ0j 1 = N N ∑ min min e j (t ) + ρ max max e j (t ) 1≤ j ≤ m 1≤t ≤ N 1≤ j ≤ m 1≤t ≤ N e j (t ) + ρ max max e j (t ) t =1 1≤ j ≤ m 1≤t ≤ N Then, γ 0 j is called the grey relation degree of the predicted value sequence { yˆ j (t ) t = 1,2,⋯ , N } by j ’th forecast method between the actual value sequence { y (t ) t = 1,2, ⋯ , N } . Here ρ ∈ (0,1) is called the identification coefficient. Generally we take ρ =0.5. e j (t ) = y (t ) − yˆ j (t ) is the predicted error of k time for i ’th forecast method. Obviously, we obtain 0 ≤ γ0 j ≤1. On the ground of definition 3, the d grey relation degree the predicted value sequence by a certain kind of forecast method between the actual value sequence is equal 1 if only and if the predicted value sequence and the actual value sequence is perfectly equal. Let yˆ (t ) = w1 yˆ1 (t ) + w2 yˆ 2 (t ) + ⋯ wm yˆ m (t ) , t = 1,2,⋯ , N be the predicted value of y (t ) by the comprehensive forecast method. Here w1 , w2, ⋯, wm are the weight coefficient of m m ∑ w =1, w j ≥ 0 j kind of forecast method and ( j = 1,2,⋯ , m) j=1 From above expression, we find the inequality as; min y j (t ) ≤ yˆ (t ) ≤ max y j (t ) , t = 1,2,⋯ , N 1≤ j ≤ m 1≤ j ≤ m Let et be the predicted error of k time for i ’th kind of forecast method. Then, we obtain m e(t ) = y (t ) − yˆ (t ) = y (t ) − ∑ w yˆ j m j (t ) j =1 = ∑ w ( y(t ) − yˆ j m j (t )) j =1 = ∑ w e (t ) , t = 1,2,⋯, N j j j =1 Let γ be the grey relation degree of the comprehensive forecast method. From the definition 5.3 and above expressions, we obtain 1 γ = N N ∑ t =1 min min e j (t ) + ρ max max e j (t ) 1≤ j ≤ m 1≤t ≤ N 1≤ j ≤ m 1≤t ≤ N m ∑ w e (t ) + ρ max max e j j =1 j 1≤ j ≤ m 1≤t ≤ N jt (t ) Obviously, the grey relation degree γ is function of weight coefficient vector W = {w1 , w2 ,⋯ , wm }T for the various kinds of forecast method. Therefore, we denote γ by γ (W ) . 24 On the basic of principle of the grey relation degree, we can know that the greater the grey relation degree γ , the effecter the comprehensive forecast method. On the basic of the comprehensive forecast model of the grey relation degree, we can construct the model such as([10]); max γ (W ) = 1 N N ∑ t =1 min min e j (t ) + ρ max max e j (t ) 1≤ j ≤ m 1≤t ≤ N 1≤ j ≤ m 1≤t ≤ N m ∑ w e (t ) + ρ max max e (t ) j j j =1 1≤ j ≤ m 1≤t ≤ N j  m w j=1  s.t.  j=1  w j ≥ 0, j = 1,2, ⋯ , m ∑ By solving this optimal problem, we can determine the combinational weight. W = {w1 , w2 ,⋯ , wm }T based on the optimal grey relation degree. 5.5. The determination methods of combinational weight based on the theory of rough Set. The comprehensive forecast method by statistical rough set theory is to convert the determination problem of weight coefficient to the estimation problem of importance for attribute. In this technique, first we put on that the set constructed by each sorts of forecast method is the conditional set of decision table. Then, by using the normalization condition entropy function, we calculate importance degree of decision set (forecast index) for every kind of attribute (forecasting method). At the final stage, we determine the weight of each kind of forecasting method on the ground of the importance degree. This method can perfectly be analyzed the importance degree of each kind of forecasting method in the data analysis and can perfectly be overcame the subjectivity ([3]) in comprehensive method. [ Determination of equivalence class] Let U be a universe of discourse and C be a conditional set, D be a decision set. We denote that column is attribute and row is object (method) in two-dimension data representation system constructed as above. We can see that each attribute is corresponded to single equivalence relation and whole table define an equivalence relation of unit family. In order to convenient the classification of knowledge, we progress the specialization treatment for attribute value along some rule. U ind (C ) = {c1 , c 2 , ⋯ , c n } , U ind ( D ) = {d 1 , d 2 , ⋯ , d m } Then, the equivalence class of relation ind (C ) and relation ind (D) are called the conditional class and decision class respectively. [ Determination of weight coefficient] First, we think that the given decision making method is universal object and then distinguish the quantitative dependence degree of decision set for conditional set. Then, we eliminate a kind of forecast method in order and calculate the dependence degree at that moment 25 Lastly, we confirm the importance of knowledge for each kind of forecast method Thus, the importance of each attribute that is, weight is obtained such as procedure; Step 1. Calculate the degree of dependence H ( D C ) of knowledge R D for knowledge RC n  = H ( D C ) p(c i )H ( D c i )   i =1  n H (D c ) = − p (d i ci ) log p(d i ci ) i  j =1  ∑ ∑ Step 2. After eliminating an attribute a ∈ C in event attribute set, calculate the degree of dependence H ( D C − {a}) on that occasion by using above expression in accordance with same idea Step 3. Calculate the degree of importance σ D (a) σ D (a) = H ( D (C − {a})) − H ( D C ) Step 4. Iterating the discussion in this manner, the degree of importance for each attribute can be determined and weight coefficient of j ’th attribute can be denoted such as; µj = σ D ( j) σ D (i ) ∑ i∈c 5.6. Comprehensive forecast The determination of combination weight in comprehensive forecast by rough set theory has been progressed as following method. That is, the forecast has been progressed for n sort of verification method according to the k sort of forecast method. We put the forecast results are conditional set for each forecast method the actual data are decision-making set. Then, we divide data to five sort of class according to magnitude and decide importance weight. Let yˆ1 (t ), yˆ 2 (t ),⋯ , yˆ m (t ) be predicted values of m sort of another model in time t and µ j ( j = 1,2,⋯ , m) be the weight of j ’th model obtained by the theory of rough set. Then, the comprehensive forecast model added weight is given by m yˆ (t ) = ∑µ j =1 m j yˆ j (t ) , ∑µ j =1 j =1 6. The comparative analysis of forecasting performance [Benchmark of forecasting performance] There are many ways to evaluate the forecasting performance of directional measures to magnitude measures to distributional measures. model, ranging from In practice, the available data set is divided into two sub samples. The first sub sample of the data is used to build a model, and the second sub sample is used to evaluate the forecasting performance of the model. Let l be forecast length and y = { y (1), y (2),⋯, y (k ), ⋯, y (l )} be original sequence to be checked, ŷ = {yˆ (1), yˆ (2),⋯, yˆ (k ),⋯, yˆ (l )} be sequence obtained by forecast. And let ε = {ε (1), ε (2),⋯, ε ( N )} be error sequence. 26 Here ε = {ε (1), ε (2),⋯, ε (l )} = { y (1) − yˆ (1), y (2) − yˆ (2), ⋯ , y ( N ) − yˆ (l )} . Magnitude Measure Three statistics are commonly used to measure performance of point forecasts. Those are the mean squared error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). Mean-square error- MSE and Mean-absolute error- MAE are defined as MSE = MAE= 1 l 1 l 2 ε ( t ) = ∑ ∑ [ y (t ) − yˆ (t )]2 l t =1 l t =1 1 l 1 l ε ( i ) = ∑ ∑ y (t ) − yˆ (t ) l i =1 l i =1 Root of mean square error-RMSE and mean absolute percent error-MAPE are defined as 1 l 1 l y (t ) − yˆ (t ) [ y (t ) − yˆ (t )]2 MAPE = ∑ × 100 ∑ l t =1 y (t ) l t =1 , RMSE = Absolute relative error and mean- absolute relative error are defined as q(k ) = y (k ) ε (k ) 1 n q= , n ∑ q(k ) k =1 Average forecast accuracies is defined as Accuracy = (1 − q ) × 100% [Distributional Measure] We have used the benchmark of distributional measure such as; (ⅰ) The test of ratio of mean square deviations: C = S1 S2 Here S 12 = 1 l 1 l 2 2 is mean deviation of error [ ε ( k ) − ε ( k )] S = 2 ∑ ∑[ y(k ) − y (k )]2 is mean deviation l k =1 l k =1 of original sequence ε = 1 l 1 l ; error means, ε ( k ) y = ∑ ∑ y(k ) ; mean of original sequence l k =1 l k =1 1 n (ⅱ) Probability of small error: p = P{ ε ( k ) < 0.6745S 2 } Here P is Probability ∑ [ x (k ) − xˆ (k )] = ∑ [ xˆ (k )] n (0) (ⅲ) Theil Coefficient: u 2 (0) 2 n k (0) 2 k [Directional Measure] A directional measure considers the future direction (up or down) implied by the model. Predicting that tomorrow’s exchange rate of Euro/USD will go up or down is an example of directional forecasts that are of practical interest. We have used the benchmark of directional measure such as; 27 1 l ∑ d (i) ×100 (%) l i =1 ( y(i) − y(i − 1) )( yˆ (i ) − y(i − 1) ) ≥ 0 Directivity (Consistency) = 1, Here d (i ) =  , l - prediction length, otherwise 0, We have also used benchmark of forecasting performance (Feasibility )such as; Feasibility= fl × 100 (%), l Here f l = { i | ε (i ) ≤ 0.005, i = 1,..., l} (%) We have suggested the Wavelet-SVR-Markov model for forecast of financial time series and compared with the performance of comprehensive forecast model combined by some method of multi-variety for this model. The time series for examination of forecast performance has been chosen exchange rate data- Euro/USD (2007 /1/1~ 2011/11/15).The forecast experiment has been progressed using by MATLAB 7.8 ( 2009a ).The seven models have been used to examination of forecast performance. Those methods are given such as; The Method 1: The four dimensional vector data composed by open, highest, lowest, close exchange rate have been used to input pattern of SVR and has been forecasted the close exchange rate by Wavelet-SVR –Markov model. The Method 2: The close exchange rate have been used to input pattern of Wavelet -SVR-Markov and the results of two- SVR model corresponded to each other two parameter has been combined with average weight The Method 3: The close exchange rate has been forecasted by only Wavelet-SVR- Markov model using close exchange rate data. The Method 4: The close exchange rate has been forecasted by only SVR model using close exchange rate data. The Method 5: The close exchange rate have been used to input pattern of Wavelet-SVR-Markov and the results of two- Wavelet -SVR-Markov model corresponded to each other two parameter has been combined with the grey relation degree The Method 6: The close exchange rate have been used to input pattern of Wavelet-SVR-Markov and the results of two- Wavelet -SVR-Markov model corresponded to each other two parameter has been combined with least square method(optimal combining weight). The Method 7: The close exchange rate have been used to input pattern of Wavelet-SVR- Markov and the results of two- Wavelet -SVR-Markov model corresponded to each other two parameter has been combined with grey relation optimal combining weight. Our comprehensive forecasting scheme is given such as; 28 SVR 1 Comb 1 SVR 2 Wavelet analysis y1 ,..., y k Comb 2 y k +1 Comb Comb n SVR m Fig 1. Two-stage comprehensive forecasting model [Combining of two models] The data of day's 70 before 31 August. 2011 year is used to build model and after that exchange rate of day's 22 is forecasted by two forecast method. Then, by using that results, the combining weight has been determined on the ground of five sort of decision method of combining weight that is rough set method( RS- n ,here n is classification number), grey relation optimal combining method GRO, degree of grey coincidence method GRD, least square method LSM, efficient degree method ED. And then the data of day's 70 before 30 September. 2011 year is used to build model by using five sorts of models corresponding to these weights and after that exchange rate of day's 22 is forecasted. The forecast results are given below table. The numbers in tables are number of forecasting method and letters are name of combining forecast model. In each column of combination weights item of table 1~table 4 the combing weights corresponding to each combining methods are given. In each row of method item of table 1~table 4 the performance of results forecasted corresponding to each combining methods are given. Table 1. The forecasting Performance and combining weights--2011/9/30(sample 70, predict 22) Performance Combination weights Method accuracy feasibility consistency MAE RMSE RS-5 GRO GRD LSM ED 1 98.9598 18.1818 50 0.0142 0.0197 0.3932 0 0 0 0.4957 2 99.1413 36.3636 54.5455 0.0118 0.0148 0.6068 1 1 1 0.5043 RS-5 99.2048 31.8182 54.5455 0.0109 0.0147 GRO 99.1413 36.3636 54.5455 0.0118 0.0148 GRD 99.1413 36.3636 54.5455 0.0118 0.0148 LSM 99.1413 36.3636 54.5455 0.0118 0.0148 ED 99.2078 31.8182 54.5455 0.0108 0.0152 Table 2. The forecasting Performance and combining weights--2011/9/30(sample 70, predict 22) 29 Performance Combination weights Method accuracy 1 98.9598 feasibility consistency 18.1818 50 MAE RMSE RS-5 GRO GRD LSM ED 0.0142 0.0197 0.4233 0 0.4447 0.0227 0.4958 Table 3. The forecasting Performance and combining weights--2011/9/30(sample 70, predict 22) Performance Combination weights Method accuracy feasibility consistency MAE RMSE RS-5 GRO GRD LSM ED 1 98.9598 18.1818 50 0.0142 0.0197 0.4233 0 0.4447 0.0227 0.4958 4 99.0123 27.2727 59.0909 0.0122 0.0149 0.5767 1 0.5553 0.9773 0.5042 RS-5 99.1322 18.1818 54.5455 0.0104 0.0146 GRO 99.0124 27.2727 59.0909 0.0122 0.0149 GRD 99.1383 18.1818 54.5455 0.0104 0.0147 LSM 99.0124 27.2727 59.0909 0.0120 0.0147 Table 4. The forecasting Performance and combining weights--2011/9/30(sample 70, predict 22) Performance Combination weights Method accuracy feasibility consistency MAE 1 98.8212 13.6363 50 4 99.2763 40.9091 RS-5 99.3094 GRO RMSE RS-5 GRO GRD LSM ED 0.0161 0.0210 0.3673 0.3346 0.4793 0.2949 0.4994 63.6364 0.0099 0.0137 0.6327 0.6654 0.5207 0.7051 0.5006 40.9091 63.6364 0.0095 0.0125 99.3174 36.3637 63.6364 0.0094 0.0124 GRD 99.2823 31.8182 63.6364 0.0099 0.0130 LSM 99.3268 31.8182 68.1824 0.0092 0.0124 ED 99.2589 31.8182 63.6364 0.0102 0.0133 The couple of kernel parameter and regulation parameter in method 1, method 3, method 4 are given by [0.0064, 591.9507], [0.1245, 639.559], [0.0241, 687.4275] respectively. And method 2, method 5~ method 7 are the various combined models of method 3, method 4 [ Two stage comprehensive forecasting] In first stage, we have combined two forecast method by some combining weight decision method as above and progressed forecasting by that respectively. 30 In two stages, we have again combined the forecast results by the various combined models and progressed forecasting by that . The several of forecast test results were shown in table 5~ table 8. These methods have been obtained such as method. First of all, the results by two sort of method are combined with five sort of combinational methods And then the five sort of forecast method obtained by above method has been combined and obtained the final forecast result. Table 5. The forecasting Performance and combining weights--2011/9/30 (sample 200, predict 22, method 1,2 ) Performance Combination weights Method accuracy feasibility consistency MAE RS-5 99.3268 31.8182 RMSE GRD LSM ED RS-5 GRO 68.1824 0.0092 0.0124 0 1 0 0 0 GRD 99.3 40.9091 63.6364 0.0096 0.0126 0.1978 0.2009 0.1956 0.2025 0.2032 LSM 99.299 40.9091 63.6364 0.0096 0.0126 0.2 0.2 0.2 0.2 0.2 ED 99.299 40.9091 63.6364 0.0096 0.0126 0.2 0.2 0.2 0.2 0.2 99.3174 36.3636 63.6364 0.0094 0.0124 0.0265 0.3903 0.0216 0.2478 0.3138 GRO Table 6. The forecasting Performance and combining weights--2011/9/30 (sample 70, predict 22, method 1,4) Performance Combination weights Method accuracy feasibility consistency MAE RMSE GRD LSM ED RS-5 GRO RS-7 99.141 22.7273 45.455 0.0117 0.0158 0 0 1 0 0 GRD 99.112 31.8182 40.909 0.0121 0.0156 0.1931 0.2104 0.1915 0.1947 0.2104 LSM 99.012 27.2727 40.909 0.0135 0.0168 0.0000 0.5 0.0000 0.0000 0.5 ED 99.111 31.8182 40.909 0.0121 0.0156 0.1996 0.2006 0.1995 0.1997 0.2006 GRO 99.012 27.2727 40.909 0.0135 0.0168 0.0000 0.5 0.0000 0.0000 0.5 Table7. The forecasting Performance and combining weights--2011/9/30 (sample 70, predict 22, method 1,3) Performance Combination weights Method accuracy feasibility consistency MAE RMSE GRD LSM ED RS-5 GRO RS-8 99.1935 22.7273 63.6364 0.0110 0.0143 0 0.5 0 0 0.5 GRD 99.2487 31.8182 54.5455 0.0103 0.0144 0.1942 0.2084 0.1906 0.1954 0.2114 LSM 99.1905 22.7273 63.6364 0.0111 0.0143 0.0000 0.5284 0.0000 0.0259 0.4457 ED 99.2487 31.8182 54.5455 0.0103 0.0144 0.1997 0.2005 0.1995 0.1998 0.2005 GRO 99.1955 27.2727 63.6364 0.0110 0.0143 0.0300 0.4948 0.0287 0.0306 0.4158 31 Table8. The forecasting Performance and combining weights--2011/9/30 (sample 200, predict 22, method 1,5) Performance Combination weights Method accuracy feasibility consistency MAE RMSE GRD LSM ED RS-5 GRO RS-9 99.2703 31.8182 63.6364 0.0100 0.0131 1 0 0 0 0 GRD 99.3032 40.9091 63.6364 0.0095 0.0126 0.1978 0.2009 0.1956 0.2025 0.2032 LSM 99.3029 40.9091 63.6364 0.0095 0.0126 0.2 0.2 0.2 0.2 0.2 ED 99.3029 40.9091 63.6364 0.0095 0.0126 0.2 0.2 0.2 0.2 0.2 GRO 99.3172 36.3636 63.6364 0.0094 0.0124 0.0266 0.3903 0.0217 0.2478 0.3136 [Result analysis] First, we have compared with the results obtained by various methods for the forecast results of two SVR model correspond to each other different parameter couple. Those results are given at table 9. Here h as known from table 9, when two sort of SVR model has been combined, the method 5 that is combinational method by degree of grey coincidence is the best for all indicator of forecast performance. These facts can clearly know through the rank by GCTOPSIS (R1), PROTOPSIS (R2) and RTOPSIS (R3), respectively, and the final rank (R). Where GCTOPSIS is grey correlation TOPSIS, PROTOPSIS is projected weight grey relation TOPSIS and RTOPSIS is distance-based TOPSIS. In the forecast of 54 day, 77 day, 120 day, the comprehensive rank of the 5 method has been occupied all the first place for these ranks and the 2 method was the second place Proceeding the comprehensive estimation, we have such that result : method 5 > method 2 > method 6 > method 7 . That is, we have such that result : degree of grey coincidence method> average weight method > least square weight method > optimal grey coincidence combining weight method Let us now progress to the estimation of forecasting results by method of decision-making plan estimation for multiple attributive decision-making methods We put relative accuracy, feasibility, consistency, mean absolute error -MAE, root of mean-squared error-RMSE which take part in the forecast performance indicator are estimation indicators and the forecasting methods are the decision -making plan in decision –making method.. Then, we take subjective weights of elative accuracy, feasibility, consistency, mean absolute error, root of mean-squared error with (0.15, 0.2, 0.3, 0.2, 0.15) When comparing the results of table 4 and table 5, table 3and table 6, table 2 and table 7, we can know that secondary comprehensive result is better than first comprehensive result. Then, we have ranged the results of first comprehensive model according to the results of table 1~table 4. The ranged results are given in table 10.Here the numbers of comprehensive models are given such as: 1-RS; 2-GRO; 3-GRD; 4-LSM; 5-ED. 32 Then, we have ranged the results of secondary comprehensive model according to the results of table 5~table 8.The ranged results are given in table 11. Here the numbers of comprehensive models are given such as: 1-RS; 2-GRD; 3-LSM; 4-ED; 5-GRO.From table 10 and table 11, when have been progressed the first comprehensive model, we can know that arrangement rank is given such as; Grey relation optimal comprehensive method>Rough set method> Grey relation degree method> Least square method> Efficient degree method.When have been progressed the secondary comprehensive model, we can know that arrangement rank is given such as; Grey relation degree method> Efficient degree method> Least square method> Rough set method> Grey relation optimal comprehensive method. Combining two ranks, we obtain final range such as: Grey relation degree method> Rough set method> Grey relation optimal comprehensive method>Efficient degree method> Least square method. Table9. The forecasting Performance various models and rank --2011/9/30(sample 200, predict 22, 54,77, 98,120)-Performance Rank Method 2 5 6 7 2 5 6 7 2 5 6 7 2 5 6 7 2 5 6 7 h accuracy feasibility consistency MAE RMSE R1 R2 R3 R 99.111 99.113 99.126 99.13 99.204 99.205 99.202 99.225 99.259 99.263 99.258 99.264 99.287 99.289 99.278 99.299 99.287 99.289 99.28 99.298 31.818 27.273 36.364 22.727 33.333 35.185 31.481 31.481 35.065 35.065 33.766 32.468 34.694 34.694 34.694 33.673 32.5 32.5 31.667 31.667 59.091 54.545 59.091 54.545 66.667 66.667 64.815 59.259 67.532 68.831 66.234 63.636 65.306 66.327 65.306 65.306 64.167 65 64.167 65 0.0122 0.0122 0.0120 0.0121 0.0109 0.0109 0.0109 0.0106 0.0103 0.0102 0.0103 0.0102 0.0099 0.0099 0.0101 0.0098 0.0099 0.0099 0.0101 0.0098 0.0147 0.0147 0.0147 0.0141 0.0140 0.0140 0.0140 0.0140 0.0131 0.0131 0.0131 0.0134 0.0126 0.0126 0.0127 0.0129 0.0125 0.0125 0.0126 0.0127 2 3 1 4 2 1 3 4 2 1 3 4 2 1 3 4 2 1 4 3 2 3 1 4 2 1 3 4 2 1 3 4 2 1 3 4 2 1 4 3 3 4 1 2 3 1 4 2 2 1 3 4 2 1 4 3 3 1 4 2 2 3 1 4 2 1 3 4 2 1 3 4 2 1 3 4 2 1 4 3 22 54 77 98 120 Table 10. Table Rank Ranking method Comprehensive rank 1 2 2 1 3 3 2 4 5 4 5 3 4 1 1 5 GCTOPSIS PROTOPSIS RTOPSIS 2 3 4 1 5 2 3 3 4 1 1 2 5 4 5 4 1 3 2 2 5 GCTOPSIS PROTOPSIS RTOPSIS 3 1 4 5 2 3 2 2 5 4 4 1 5 1 5 1 3 2 3 3 4 GCTOPSIS PROTOPSIS RTOPSIS 2 5 4 1 3 4 1 1 4 2 2 1 4 3 4 3 2 3 5 5 5 GCTOPSIS PROTOPSIS RTOPSIS 1 2 4 3 5 Final rank 2 33 1 3 4 5 Table 11. Table Rank Ranking method Comprehensive rank 5 2 2 1 3 3 5 4 5 4 5 2 3 1 1 4 GCTOPSIS PROTOPSIS RTOPSIS 2 3 5 1 4 6 2 2 1 4 4 2 3 5 1 3 4 3 1 5 5 GCTOPSIS PROTOPSIS RTOPSIS 2 4 1 3 5 7 2 2 5 4 4 2 5 1 5 1 4 1 3 3 3 GCTOPSIS PROTOPSIS RTOPSIS 2 4 5 1 3 8 2 2 1 3 3 2 4 5 4 5 3 4 1 1 5 GCTOPSIS PROTOPSIS RTOPSIS 2 3 4 1 5 Final rank 2 4 3 1 5 7. Conclusion In this paper, we have suggested a Wavelet-SVR-Markov forecasting method to forecast financial time series and showed that the forecast performance can be more improved with rational combinations through various combinational experiments. Through our experiment results have been showed that two stage combinational model is finer than general combinational model. We also have estimated synthetically the combinational forecast methods according to various forecast performance indicator. Through those results have been showed that grey relation degree method and grey relation optimal comprehensive method has good forecast performance. References [1] Xing Ziu-yu, Gu-ming, Complicated financial data time series forecasting analysis based on least square support vector machine, Journal of Tsinghua University Sci & Tech, 48(7), 1147-1149, 2008 [2] L. J. Cao, Francis E. H. Tay, Support vector machine with adaptive parameters in financial time series forecasting, IEEE Transactions on Neural Networks, 14(6),1506-1518,2003 [3] L. J. Cao, Francis E. H. Tay, Financial forecasting using support vector machines, Neural Computing & Applications, [4] F. E. H. Tay and L. J. Cao, 10(2), 184 – 192, 2001 Improved financial time series forecasting by combining support vector machines with self-organizing feature map, Intelligent Data Analysis, 5, 1-16, 2002 [5] L. J. Cao and Francis E. H. Tay, Support Vector Machine With Adaptive Parameters in Financial Time Series Forecasting, IEEE Transactions on Neural Networks, 14( 6) , 1506-1518,2003, 1045-9227/03 © 2003 IEEE [6] Francis E.H. Tay, L.J. Cao, Modified support vector machines in financial time series forecasting, Neurocomputing , 48, 847–861, 2002 [7] Francis E.H. Tay , Lijuan Cao, Application of support vector machines in Financial time series forecasting, Omega 29, 309–317, 2001 [8] Liu Bin-Sheng, et al., Research on Freight Traffic Forecast Based on Wavelet and Support Vector Machine, Proceedings of the Fifth International Conference on Machine Learning and 34 Cybernetics, Dalian, 13-16 August 2006 1-4244-0060-0/06/ ©2006 IEEE, 2524-2530 [9] Fei Chen, Chongzhao Han , Time Series Forecasting Based on Wavelet KPCA and Support Vector Machine, Proceedings of the IEEE International Conference on Automation and Logistics, August 18 - 21, 2007, Jinan, China, 1-4244-1531-4/07/©. 2007 IEEE, 1487-1491 [10] Alina Lazar, Robert Zaremba, Support Vector Machines Optimization - An Income Prediction Study, Proceedings of the International Multi-Conference on Computing in the Global Information Technology (ICCGI'06) 0-7695-2629-2/06 © 2006, IEEE Computer Society [11] Kyung-Shik Shin et al, An application of support vector machines in bankruptcy prediction model , Expert Systems with Applications, 28, 127–135, 2005 [12] Kyoung-jae Kim, Financial time series forecasting using support vector machines, Neurocomputing, 55, 307 – 319, 2003 [13] Jae H. Mina, Young-Chan Leeb, Bankruptcy prediction using support vector machine with optimal choice of kernel function parameters, Expert Systems with Applications, 28,603–614, 2005 [14] Theodore B, et al, Support Vector Machin for Regression and Applications to Financial Forecasting, 0-7695-0619-4/00/©. 2000 IEEE, 348-353 [15] Guo-sheng Hu, et al, Short-term Load Forecasting Based on Fuzzy C-Mean Clustering and Weighted Support Vector Machines, Third International Conference on Natural Computation (ICNC 2007), 0-7695-2875-9/07 © 2007IEEE [16] Ping-Feng Pai, Chih-Sheng Lin, A hybrid ARIMA and support vector machines model in stock price forecasting, Omega ( The International Journal of Management Science) 33 497 – 505, 2005 [17] Shu-ping Yao, Chang-zhen Hu, Prediction of Server Load Based on Wavelet-Support Vector Regression-Moving Average, Proceedings of the Sixth International Conference on Intelligent, Systems Design and Applications (ISDA'06), 0-7695-2528-8/06 © 2006 [18] Wei Huan-ga, et al, Forecasting stock market movement direction with support vector machine, Computers & Operations Research, 3, 22513–2522, 2005 [19] Tony Van Gestel, et al, Financial Time Series Prediction Using Least Squares Support Vector Machines within the Evidence Framework, IEEE Transactions on Neural Networks, 12(4), 809-820, ,2001,1045–9227/01 © 2001 [20] Cui-fang Li, Grey Markov Model Based on Parameter Fits and its Application in Stock Price Prediction, Proceedings of the Sixth International Conference on Intelligent Systems Design and Applications (ISDA'06) 0-7695-2528-8/06 © 2006IEEE, [21] Hai-qing Yang,et.al, Non-Fixed and Asymmetrical Margin Approach to Stock Market Prediction Using Support Vector Regression, Proceedings of 9th International Conference on Neural Information Processing(ICONIP’02), 3, 1398-1402,2002 [22] Wang Yong-feng, et.al, A Gradient Method For Choosing Kernel Parameters for SVM, 35 Mathematics in Practice and Theory, 41(1), 7-13, 2011 [23] Tang Wan-mei, New forecasting model based on grey support vector machine, Journal of Systems Engineering, 21(4), 410-413.2006 [24] Dong Jing-rong, Research on Nonlinear Combining Modeling and Forecasting of Foreign Exchange Rate ,Journal of Chongqing Normal University (Natural Science Edition) , 20(3), 1-4, 2003 [25] LiHui-jun, Wu Hai-hua, Research on the Usage of Markov Process in Short-Time Forecast of Japanese Yen, Journal of Qingdao University, 18(1), 58-62, 2003 [26] Tang Wan-mei, New forecasting model based on grey support vector machine, Journal of Systems Engineering, 21(4), 410-413,2006 [27] Wang Yan-feng, Gao Feng, Stock Forecasting Based on Support Vector Machine, Computer Simulation, 23(11), 256-258, 2006 [28] Yang Su1, Shi Yao-yuan, Song Heng, Stock M arket Time Series Prediction Method Based on SVM, Science Technology and Engineering, 8(2), 381-386, 2008 [29] Yang Su1, Shi Yao-yuan, Song Heng, Stock M market Time Series Prediction Method Based on SVM and W wavelet, Science Technology and Engineering, 8(12), 1371-1374, 2008 [30] Xin Zhi-yun, Gu Ming, Complicated financial data time series forecasting analysis based on least square support vector machine, Journal 0f Tsinghua University (Sci.&Tech), 48(7), 1147-1149, 2008 [31] Zhang-Chao, A novel Algorithm of Threat Sequencing based on Grey Relation Projection Method, Fire Control and Command Control,32(5),57-60, 2007 [32] Lu Feng, Cui Xiao-hui, Multi-criteria Decising Grey Relation Projection Method and its Application, Systems Engineering-Theory and Practice, 1,103 -107, 2002 [33] Chen Hua-you et al., Properties of Combination Forecasting Model Based on Degree of Grey Incidence, Journal of Southeast University,34(1),130-134, 2004 [34] Sun Xiao-dong, Grey Correlation Based on Combinational Weigh and Its Application Industrial Engineering and Management,20(1), 62-66, 2006 [35] Mi Chuan-min, Liu Si-Feng,et al, Study on grey entropy weight clustering decision – making, Systems Engineering and Electronics, 28(12),1823-1844, 2006 [36] Liu Jie, Guo Hai-hua, Unbiased grey-Markov chains model and its Application in Stock price studies, Journal of Hubei University,27(1), 11-14, 2005 [37] Li Hui-jun, Wu Hai-hua, Research on the usage of Markov process in short- time forecast of Japanese, Journal of Qingdao University, 18(1), 58-62, 2003 [38] Xie Qing-hua,et al, The combination forecasting model of Aero-engine Maintenance Coast based on Statistic Rough Set Theory, Acta, Armamentaril, 27(5), 857-861, 2006 [39] Ren Xue-mei, et al, Power System short-tem load forecasting based on upon a combination of Markov chain and fuzzy clustering, Transactions of Beijing Institute of Technology, 24(5), 416-418, 2004 36 [40] Huang Qiao-ling, Xie wei-bo, The Prediction of short-term exchange rate based on the phase space reconstruction and Kalman, Computer Applications and Software, 25(8), 79-80, 2008 [41] Liu Si-feng, Yi Lin, Grey Information- Theory and Practical Applications, Springer-Verlag London, 508,2006 [42] Henry D. I. Abarbanel, Ulrich Parlitz, Nonlinear Analysis of Time Series Data, in Handbook of Time Series Analysis. Björn Schelter, Matthias Winterhalder, Jens Timmer, 2006, 5-15 [43] Chen Shu-yan, Wang Wei, Grey neural network forecasting for traffic flow, Journal of Southeast University, 43(4), 541-544, 2004 37
5cs.CE
arXiv:1802.06020v1 [math.AC] 16 Feb 2018 ON THE EXTREMAL BETTI NUMBERS OF BINOMIAL EDGE IDEALS OF BLOCK GRAPHS JÜRGEN HERZOG AND GIANCARLO RINALDO Abstract. We compute one of the distinguished extremal Betti number of the binomial edge ideal of a block graph, and classify all block graphs admitting precisely one extremal Betti number. Introduction Let K be a field and I a graded ideal in the polynomial ring S = K[x1 , . . . , xn ]. The most important invariants of I, which are provided by its graded finite free resolution, are the regularity and the projective dimension of I. In general these invariants are hard to compute. One strategy to bound them is to consider for some monomial order the initial ideal in< (I) of I. It is known that for the graded Betti numbers one has βi,j (I) ≤ βi,j (in< (I)). This fact implies in particular that reg(I) ≤ reg(in< (I)), and proj dim(I) ≤ proj dim(in< (I)). In general however these inequalities may be strict. On the other hand, it is known that if I is the defining binomial ideal of a toric ring, then proj dim(I) = proj dim in< (I), provided in< (I) is a squarefree monomial ideal. This is a consequence of a theorem of Sturmfels [14]. The first author of this paper conjectures that whenever the initial ideal of a graded ideal I ⊂ S is a squarefree monomial ideal, then the extremal Betti numbers of I and in< (I) coincide in their positions and values. This conjecture implies that reg(I) = reg(in< (I)) and proj dim(I) = proj dim(in< (I)) for any ideal I whose initial ideal is squarefree. An interesting class of binomial ideals having the property that all of its initial ideals are squarefree monomial ideals are the so-called binomial edge ideals, see [9], [5], [1]. Thus it is natural to test the above conjectures for binomial edge ideals. A positive answer to this conjecture was given in [7] for Cohen-Macaulay binomial edge ideals of PI graphs (proper interval graphs). In that case actually all the graded Betti numbers of the binomial edge ideal and its initial ideal coincide. It is an open question wether this happens to be true for any binomial edge ideal of a PI graph. Recently this has been confirmed to be true, if the PI graph consists of at most two cliques [2]. In general the graded Betti numbers are known only for very special classes of graphs including cycles [18]. Let JG denote the binomial edge ideal of a graph G. The first result showing that reg(JG ) = reg(in< (JG )) without computing all graded Betti numbers was obtained for PI graphs by Ene and Zarojanu [8]. Later Chaudhry, Dokuyucu and 2010 Mathematics Subject Classification. Primary 13D02, 13C13; Secondary 05E40, 05C69. Key words and phrases. Extremal Betti numbers, regularity, binomial edge ideals, block graphs. 1 Irfan [3] showed that proj dim(JG ) = proj dim(in< (JG )) for any block graph G, and reg(JG ) = reg(in< (JG )) for a special class of block graphs. Roughly speaking, block graphs are trees whose edges are replaced by cliques. The blocks of a graph are the biconnected components of the graph, which for a block graph are all cliques. In particular trees are block graphs. It is still an open problem to determine the regularity of the binomial edge ideal for block graphs (and even for trees) in terms of the combinatorics of the graph. However, strong lower and upper bounds for the regularity of edge ideals are known by Matsuda and Murai [11] and Kiani and Saeedi Madani [15]. Furthermore, Kiani and Saeedi Madani characterized all graphs are whose binomial edge ideal have regularity 2 and regularity 3, see [12] and [13]. In this note we determine the position and value of one of the distinguished extremal Betti number of the binomial edge ideal of a block graph. Let M be a finitely graded S-module. Recall that a graded Betti number βi,i+j (M) 6= 0 of M is called an extremal, if βk,k+l (M) = 0 for all pairs (k, l) 6= (i, j) with k ≥ i and l ≥ j. Let q = reg(M) and p = proj dim(M), then there exist unique numbers i and j such that βi,i+q (M) and βp,p+j (M) are extremal Betti numbers. We call them the distinguished extremal Betti numbers of M. The distinguished extremal Betti numbers are different from each other if and only if M has more than two extremal Betti numbers. In order to describe our result in detail, we introduce the following concepts. Let G be finite simple graph. Let V (G) be the vertex set and E(G) the edge set of G. The clique degree of a vertex v ∈ V (G), denoted cdeg(v), is the number of cliques to which it belongs. For a tree the clique degree of a vertex is just the ordinary degree. A vertex v ∈ V (G) is a called a free vertex, if cdeg(v) = 1 and an inner vertex if cdeg(v) > 1. Suppose v ∈ V (G) is a vertex of clique degree 2. Then G can be decomposed as a union of subgraphs G1 ∪ G2 with V (G1 ) ∩ V (G2 ) = {v} and where v is a free vertex of G1 and G2 . If this is the case, we say that G is decomposable. In Proposition 1.3 we show that if G decomposable with G = G1 ∪G2 , then the graded Poincaré series of G is just the product of the graded Poincaré series of S/JG1 and S/JG2 . This result, with a simplified proof, generalizes a theorem of the second author which he obtained in a joint paper with Rauf [17]. As a consequence one obtains that the position and value of the distinguished extremal Betti numbers of S/JG are obtained by adding the positions and multiplying the values of the corresponding distinguished extremal Betti numbers of S/JG1 and S/JG2 . The other extremal Betti numbers of S/JG are not obtained in this simple way from those of S/JG1 and S/JG2 . But the result shows that if we want to determine the distinguished extremal Betti numbers of S/JG for a graph G (which also give us the regularity and projective dimension of S/JG ), it suffices to assume that G is indecomposable. Let f (G) be the number of free vertices and i(G) the number of inner vertices of G. In Theorem 2.2 we show: let G be an indecomposable block graph with n vertices. Furthermore let < be the lexicographic order induced by x1 > x2 > . . . > xn > y1 > y2 > · · · > yn . Then βn−1,n−1+i(G)+1 (S/JG ) and βn−1,n−1+i(G)+1 (S/ in< (JG )) are extremal Betti numbers, and βn−1,n−1+i(G)+1 (S/ in< (JG )) = βn−1,n−1+i(G)+1 (S/JG ) = 2 f (G) − 1. The theorem implies that reg(JG ) ≥ i(G). It also implies that reg(JG ) = i(G) if and only if S/JG has exactly one extremal Betti number, namely the Betti number βn−1,n−1+i(G)+1 (S/JG ). In Theorem 2.4 we classify all block graphs with the property that they admit precisely one extremal Betti number, by listing the forbidden induced subgraphs (which are 4 in total), and we also give an explicit description of the block graphs with precisely one extremal Betti number. Carla Mascia informed us that Jananthan et al in an yet unpublished paper and revised version of [10] obtained a related result for trees. For indecomposable block graphs G the most challenging open problem is to obtain a combinatorial formula for the regularity of JG , or even better, a description of both distinguished extremal Betti numbers of S/JG . 1. Decomposable graphs and binomial edge ideals Let G be a graph with vertex set V (G) = [n] and edge set E(G). Throughout this paper, unless otherwise stated, we will assume that G is connected. A subset C of V (G) is called a clique of G if for all i and j belonging to C with i 6= j one has {i, j} ∈ E(G). Definition 1.1. Let G be a graph and v a vertex of G. The clique degree of v, denoted cdeg v, is the number of maximal cliques to which v belongs. A vertex v of G is called a free vertex of G, if cdeg(v) = 1, and is called an inner vertex, if cdeg(v) > 1. We denote by f (G) the number of free vertices of G and by i(G) the number of inner vertices of G. Definition 1.2. A graph G is decomposable, if there exist two subgraphs G1 and G2 of G, and a decomposition (1) G = G1 ∪ G2 with {v} = V (G1 ) ∩ V (G2 ), where v is a free vertex of G1 and G2 . If G is not decomposable, we call it indecomposable. Note that any graph has a unique decomposition (up to ordering) (2) G = G1 ∪ · · · ∪ Gr , where G1 , . . . , Gr are indecomposable subgraphs of G, and for 1 ≤ i < j ≤ r either V (Gi ) ∩ V (Gj ) = ∅ or V (Gi ) ∩ V (Gj ) = {v} and v is a free vertex of Gi and Gj . For a graded S-module M we denote by BM (s, t) = i,j βij (M)si tj the Betti polynomial of M. The following proposition generalizes a result due to Rinaldo and Rauf [17]. P Proposition 1.3. Let G be a decomposable graph, and let G = G1 ∪ G2 be a decomposition of G. Then BS/JG (s, t) = BS/JG1 (s, t)BS/JG2 (s, t). 3 Proof. We may assume that V (G) = [n] and V (G1 ) = [1, m] and V (G2 ) = [m, n] . We claim that for the lexicographic order < induced by x1 > x2 > · · · > xn > y1 > y2 > · · · > yn , we have in< (JG1 ) ⊂ K[{xi , yi}i=1,...,m−1 ][ym ] and in< (JG1 ) ⊂ K[{xi , yi }i=m+1,...,n ][xm ]. We recall the notion of admissible path, introduced in [9] in order to compute Gröbner bases of binomial edge ideals. A path π : i = i0 , i1 , . . . , ir = j in a graph G is called admissible, if (1) ik 6= iℓ for k 6= ℓ; (2) for each k = 1, . . . , r − 1 one has either ik < i or ik > j; (3) for any proper subset {j1 , . . . , js } of {i1 , . . . , ir−1 }, the sequence i, j1 , . . . , js , j is not a path. Given an admissible path π : i = i0 , i1 , . . . , ir = j from i to j with i < j we associate Q Q the monomial uπ = ( ik >j xik )( iℓ <i yiℓ ). In [9] it is shown that in< (JG ) = (xi yj uπ : π is an admissible path). The claim follows by observing that the only admissible paths passing through the vertex m are the ones inducing the set of monomials {xi ym uπ : V (π) ∈ V (G1 )} ∪ {xm yj uπ : V (π) ∈ V (G2 )}. We have the following cases to study (a) V (π) ⊂ V (G1 ) or V (π) ⊂ V (G2 ); (b) V (π) ∩ V (G1 ) 6= ∅ and V (π) ∩ V (G2 ) 6= ∅. (a) We may assume that V (π) ⊂ V (G1 ). Assume m is not an endpoint of π. Then π : i = i0 , . . . , ir = j with m = ik , 0 < k < r. Since ik−1 and ik+1 belong to the maximal clique in G1 containing m, it follows that {ik−1 , ik+1 } ∈ E(G1 ) and condition (3) is not satisfied. Therefore π : i = i0 , . . . , ir = m and xi ym uπ is the corresponding monomial. (b) In this case we observe that m is not an endpoint of the path π : i = i0 , . . . , ir = j. Since i < m < j this path is not admissible by (2). Now the claim implies that Tori (S/ in< (JG1 ), S/ in< (JG2 )) = 0 for i > 0. Therefore, we also have Tori (S/JG1 , S/JG2 ) = 0 for i > 0. This yields the desired conclusion.  The proposition implies that proj dim S/JG = proj dim S/JG1 + proj dim S/JG2 and reg S/JG = reg S/JG1 + reg S/JG2 . In fact, much more is true. Let M be a finitely graded S-module. A Betti number βi,i+j (M) 6= 0 is called an extremal Betti number of M, if βk,k+l(M) = 0 for all pairs (k, l) 6= (i, j) with k ≥ i and l ≥ j. Let q = reg(M) and p = proj dim(M), then there exist unique numbers i and j such that βi,i+q (M) and βp,p+j (M) are extremal Betti numbers. We call them the distinguished extremal Betti numbers of M. M admits only one extremal Betti number if and only the two distinguished extremal Betti numbers are equal. Corollary 1.4. With the assumptions of Proposition 1.3, let {βit ,it +jt (S/JG1 )}t=1,...,r be the set of extremal Betti numbers of S/JG1 and {βkt ,kt +lt (S/JG2 )}t=1,...,s be the set 4 of extremal Betti numbers of S/JG2 . Then {βit +kt′ ,(it +kt′ )+(jt +lt′ ) (S/JG )} t=1,...r t′ =1,...,s is a subset of the extremal Betti numbers of S/JG . For k = 1, 2, let βik ,ik +qk (Gk ) and βpk ,pk +jk (Gk ) be the distinguished extremal Betti numbers of G1 and G2 . Then βi1 +i2 ,i1 +i2 +q1 +q2 (G) and βp1 +p2 ,p1 +p2 +j1 +j2 (G) are the distinguished extremal Betti numbers of G, and βi1 +i2 ,i1 +i2 +q1 +q2 (G) = βi1 ,i1 +q1 (G1 )βi2 ,i2 +q2 (G2 ), βp1 +p2 ,p1 +p2 +j1 +j2 (G) = βp1 ,p1 +j1 (G1 )βp2 ,p2 +j2 (G2 ). 2. Extremal Betti numbers of Block graphs Let G be a graph with vertex set V (G) and edge set E(G). A vertex of a graph is called a cutpoint if the removal of the vertex increases the number of connected components. A connected subgraph of G that has no cutpoint and is maximal with respect to this property is called a block. Definition 2.1. A graph G is called a block graph, if each block of G is a clique. Observe that a block graph G is decomposable if and only if there exists v ∈ V (G) with cdeg(v) = 2. In particular, a block graph is indecomposable, if cdeg(v) 6= 2 for all v ∈ V (G). A block C of the block graph G is called a leaf of G, if there is exactly one v ∈ V (C) with cdeg(v) > 1. Theorem 2.2. Let G be an indecomposable block graph with n vertices. Furthermore let < be the lexicographic order induced by x1 > x2 > . . . > xn > y1 > y2 > · · · > yn . Then βn−1,n−1+i(G)+1 (S/JG ) and βn−1,n−1+i(G)+1 (S/ in< (JG )) are extremal Betti numbers of S/JG and S/ in< (JG ), respectively. Moreover, βn−1,n−1+i(G)+1 (S/ in< (JG )) = βn−1,n−1+i(G)+1 (S/JG ) = f (G) − 1. Proof. We prove the theorem by induction on i(G). If i(G) = 0, then G is a clique and JG is the ideal of 2-minors of the 2 × n matrix (3) x1 x2 . . . xn y1 y2 . . . yn ! The desired conclusion follows by the Eagon-Northcott resolution [6]. Let us now assume that the above equation holds for i(G) > 0. Let C1 , . . . , Ct be the blocks of G and assume that Ct is a leaf of G. Since i(G) > 0, it follows that t > 1. Let i be the vertex of Ct of cdeg(i) > 1, and let G′ be the graph which is obtained from G by replacing Ct by the clique whose vertex set is the union of the vertices of the Ci which have a non-trivial intersection with Ct . Furthermore, let G′′ be the graph which is obtained from G by removing the vertex i, and H be the graph obtained by removing the vertex i from G′ . Note that G′ and H are indecomposable block graphs for which i(G′ ) = i(H) = i(G) − 1. The following exact sequence (4) 0 −→ S/JG −→ S/JG′ ⊕ S/((xi , yi ) + JG′′ ) −→ S/((xi , yi ) + JH ) 5 from [7] is used for our induction step. By the proof of [7, Theorem 1.1] we know that proj dim S/JG = proj dim S/JG′ = n − 1, proj dim S/((xi , yi ) + JH ) = n, and proj dim S/((xi , yi )+JG′′ ) = n−q, where q+1 is the number of connected components of G′′ . Since cdeg(i) ≥ 3 it follows that q ≥ 2. Therefore, Torn−1 (S/((xi , yi) + JG′′ ), K) = 0, and hence for each j, the exact sequence (4) yields the long exact sequence (5) 0 → Tn,n+j−1(S/((xi , yi ) + JH )) → Tn−1,n−1+j (S/JG ) → Tn−1,n−1+j (S/JG′ ) → where for any finitely generated graded S-module, TSk,l (M) stands for TorSk,l (M, K). Note that ′ (6) TSn,n+j−1(S/((xi , yi) + JH )) ∼ = TSn−2,n−2+(j−1) (S ′ /JH ), where S ′ = S/(xi , yi). Our induction hypothesis implies that Tn−2,n−2+(j−1) (S ′ /JH ) = 0 for j > i(H) + 2 = i(G) + 1, and Tn−1,n−1+j (S/JG′ ) = 0 for j > i(G′ ) + 1 = i(G). Now (5) and (6) imply that Tn−1,n−1+j (S/JG ) = 0 for j > i(G) + 1, and ′ (7) TSn−2,n−2+i(H)+1 (S ′ /JH ) ∼ = TSn−1,n−1+(i(G)+1) (S/JG ). ′ S (S ′ /JH ) = f (H) − 1. Since f (G) = f (H), By induction hypothesis, βn−2,n−2+i(H)+1 (7) implies that βn−1,n−1+i(G)+1 (S/JG ) = f (G) − 1, and together with (6) it follows that βn−1,n−1+i(G)+1 (S/JG ) is an extremal Betti number. Now we prove the assertions regarding in< (JG ). If i(G) = 0, then JG is the ideal of 2-minors of the matrix (3). It is known that in< (JG ) has a 2-linear resolution. This implies that βi,j (JG ) = βi,j (in< (JG )), see []. This proves the assertions for i(G) = 0. Next assume that i(G) > 0. As noted in [3], one also has the exact sequence 0 −→ S/ in< (JG ) −→ S/ in< (JG′ ) ⊕ S/ in< ((xi , yi ) + JG′′ ) −→ S/ in< ((xi , yi ) + JH ). Since in< ((xi , yi) + JH ) = (xi , yi ) + in< (JH ) it follows that ′ (8) TSn,n+j−1(S/ in< ((xi , yi ) + JH )) ∼ = TSn−2,n−2+(j−1) (S ′ / in< (JH )). Therefore, by using the induction hypothesis, one deduces as before that ′ (9) TSn−2,n−2+i(H)+1 (S ′ / in< (JH )) ∼ = TSn−1,n−1+i(G)+1 (S/ in< (JG )). This concludes the proof.  The next corollary is an immediate consequence of Proposition 1.3 and Theorem 2.2. Corollary 2.3. Let G be a block graph for which G = G1 ∪ · · · ∪ Gs is the decomposition of G into indecomposable graphs. Then each Gi is a block graph, βn−1,n−1+i(G)+s (S/JG ) is an extremal Betti number of S/JG and βn−1,n−1+i(G)+s (S/JG ) = s Y (f (Gi ) − 1). i=1 6 In the following theorem we classify all block graphs which admit precisely one extremal Betti number. Theorem 2.4. Let G be a indecomposable block graph. Then (a) reg(S/JG ) ≥ i(G) + 1. (b) The following conditions are equivalent: (i) S/JG admits precisely one extremal Betti number. (ii) G does not contain one of the induced subgraphs T0 , T1 , T2 , T3 of Fig.1. (iii) Let P = {v ∈ V (G) : deg(v) 6= 1}. Then each cut point of G|P belongs to exactly two maximal cliques. Proof. (a) is an immediate consequence of Theorem 2.2. (b)(i) ⇒ (ii): Suppose that G contains one of the induced subgraphs T0 , T1 , T2 , T3 . We will show that reg(S/JG ) > i(G) + 1. By Corollary 2.3 this is equivalent to saying that S/JG admits at least two extremal Betti numbers. To proceed in our proof we shall need the following result [11, Corollay 2.2] of Matsuda and Murai which says that for W ⊂ V (G), one has βij (JG|W | ) ≤ βij (JG )) for all i and j. It can be checked by CoCoA that reg(S/JTj ) > i(Tj ) + 1 for each Tj . Now assume that G properly contains one of the Tj as induced subgraph. Since G is connected, there exists a clique C of G and subgraph G′ of G such that (1) G′ contains one of the Tj as induced subgraph, (2) V (G′ )∩V (C) = {v}. By using induction on the number of cliques of G, we may assume that reg(S/JG′ ) > i(G′ ) + 1. If cdeg(v) = 2, then i(G) = i(G′ )+1 and reg(S/JG ) = reg(S/JG′ )+1, by Proposition 1.3. If cdeg(v) > 2, then i(G) = i(G′ ), and by Matsuda and Murai we have reg S/JG′ ≤ reg S/JG . Thus in both case we obtain reg(S/JG ) > i(G), as desired. (ii) ⇒ (iii): Suppose condition (iii) is not satisfied. Let C1 , . . . , Cr with r ≥ 3 be maximal cliques of G|P that meet in the same cutpoint i. After a suitable relabeling of the cliques Ci we may assume that one of the following cases occurs: (α) C1 , C2 , C3 have cardinality ≥ 3; (β) C1 , C2 have cardinality ≥ 3, the others have cardinality 2; (γ) C1 has cardinality ≥ 3, the others have cardinality 2; (δ) C1 , . . . , Cr have cardinality 2. In case (α) observe that G contains C1 , C2 and C3 , too. But this contradicts the fact that G does not contain T0 as an induced subgraph. Similarly in case (β), G contains C1 , C2 . Let C3 = {i, j}. Since C3 is an edge in G|P , it cannot be a leaf of G. Therefore, since G is indecomposable, there exist at least two maximal cliques in G for which j is a cut point. It follows that T1 is an induced subgraph, a contradiction. (γ) and (δ) are discussed in a similar way. (iii) ⇒ (i): We use induction on i(G). If i(G) = 0, then G is a clique and the assertion is obvious. Now let us assume that i(G) > 0. By (a) it is sufficient to prove that reg S/JG ≤ i(G) + 1. If i(G) = 0, then G is a clique and the assertion is obvious. We choose a leaf of G. Let j be the unique cut point of this leaf, and let G′ , G′′ and H be the subgraphs of G, as defined with respect to j in the proof of Theorem 2.2. Note the G′ and H are block graphs satisfying the conditions in (iii) with i(G′ ) = i(H) = i(G) − 1. By our induction hypothesis, we have reg(S/JG′ ) = 7 T0 T1 r r ✡❏ ✡❏ ✡ ❏ ✡ ❏ r ✡ ❏r✡ r ❏r ✡❏ ✡ ❏ ❏r r ✡ r r ✡❏ ✡❏ ✡ ❏ ✡ ❏ r ✡ ❏rr✡ ❏r r r T2 r ❇ r✂ r ❇ ❇r ✂ ✂ r ❏ ❏ ❏✡ r ✡ ✡ T3 r ✂r ❇ ✂ ✂ r ❇ ❇r r r ❇ ❇ ❇r ✂ ✂ r✂ r r r r ✂ ✂ ✂r ❇ ❇ ❇r Figure 1. Induced subgraphs to avoid reg(S/JH ) = i(G). The graph G′′ has cdeg(j) many connected components with one components G0 satisfying (iii) and i(G0 ) = i(G) − 1, and with the other components being cliques, where all, but possible one of the cliques, say C0 , are isolated vertices. Applying our induction hypothesis we obtain that reg(S/JG′′ ) = i(G0 ) + reg(JC0 ) ≤ i(G) − 1 + reg(S/JC0 ) ≤ i(G), since reg(S/JC0 ) ≤ 1. Thus the exact sequence (4) yields reg S/JG ≤ max{reg S/JG′ , reg S/JG′′ , reg S/JH + 1} = i(G) + 1, as desired.  References [1] M. Badiane, I. Burke, E. Sköldberg, The universal Gröbner basis of a binomial edge ideal, Electron. J. Combin. Vol. 24, 2017, Paper #P4.11, [2] H. Baskoroputro, On the binomial edge ideal of proper interval graphs, arXiv:1611.10117. 2016. [3] F. Chaudhry, A. Dokuyucu, R. Irfan, On the binomial edge ideals of block graphs, An. Şt. Univ. Ovidius Constanta, Vol. 24, 2016, 149-158. [4] CoCoATeam, CoCoA: a system for doing Computations in Commutative Algebra, Available at http://cocoa.dima.unige.it [5] M. Crupi, G. Rinaldo, Binomial edge ideals with quadratic Gröbner basis, Vol. 18, 2011, Paper #P211, [6] J. A. Eagon, D. G. Northcott, Ideals defined by matrices and a certain complex associated with them, Proc. R. Soc. Lond. Ser. A Math. Phys. Eng. Sci. Vol. 269, 1962, pp. 188–204. [7] V. Ene, J. Herzog, T. Hibi, Cohen-Macaulay binomial edge ideals, Nagoya Math. J., Vol. 204, 2011, pp. 57–68. [8] V. Ene, A. Zarojanu. On the regularity of binomial edge ideals, Math. Nachrichten Vol. 288, 2015, pp. 19–24. [9] J. Herzog, T. Hibi, F. Hreinsdottir, T. Kahle, J. Rauh, Binomial edge ideals and conditional independence statements, Adv. in Appl. Math., Vol. 45, 2010, pp. 317–333. [10] A. V. Jayanthan, N. Narayanan, and B. V. Raghavendra Rao, Regularity of binomial edge ideals of certain block graphs arXiv:1601.01086, 2017, 1–9. [11] K. Matsuda, S. Murai, Regularity bounds for binomial edge ideals, Journal of Commutative Algebra. Vol. 5, 2013, pp. 141–149. [12] S. Saeedi Madani, D. Kiani, Binomial edge ideals of graphs, Electron. J. Combin. Vol. 19, 2012, Paper #P44. [13] S. Saeedi Madani, D. Kiani, Binomial edge ideals of regularity 3, arXiv:1706.09002, 2017, [14] B: Sturmfels, Gröbner Bases and Convex Polytopes. American Mathematical Society, Providence, RI, Vol.8, 1996. [15] D. Kiani, S. Saeedi Madani, The Castelnuovo-Mumford regularity of binomial edge ideals, Journal of Combinatorial Theory, Series A, Vol. 139, 2016, pp. 80–86. 8 [16] M. Ohtani, Graphs and ideals generated by some 2-minors, Comm. Algebra, Vol. 39, 2011, pp. 905–917. [17] A. Rauf, G. Rinaldo, Construction of Cohen-Macaulay binomial edge ideals, Comm. Algebra., Vol. 42, 2014, pp. 238–252. [18] S. Zafar, Z. Zahid, On the Betti numbers of some classes of binomial edge ideals, The Electronic Journal of Combinatorics 20(4) (2013), 1–14. Fachbereich Mathematik, Universität Duisburg-Essen, Campus Essen, 45117 Essen, Germany E-mail address: [email protected] Department of Mathematics, University of Trento, via Sommarive, 14, 38123 Povo (Trento), Italy E-mail address: [email protected] 9
0math.AC
A Decoding Algorithm for Rank Metric Codes Tovohery Hajatiana Randrianarisoa∗ arXiv:1712.07060v2 [cs.IT] 31 Jan 2018 December 20, 2017 Abstract In this work we will present algorithms for decoding rank metric codes. First we will look at a new decoding algorithm for Gabidulin codes using the property of Dickson matrices corresponding to linearized polynomials. We will be using a Berlekamp-Massey-like algorithm in the process. We will show the difference between our and existing algorithms. Apart from being a new algorithm, it is also interesting that it can be modified to get a decoding algorithm for general twisted Gabidulin codes. 1 Introduction Rank metric codes have many applications in network coding and in cryptography. So far, there are two known general constructions of rank metric codes with arbitrary parameters. The first class of rank metric codes are the Gabidulin codes [Del78, Gab85, KG05] and they were generalised to the twisted Gabidulin codes [She16, LTZ15]. Several decoding algorithms already exist for Gabidulin codes [Gab85, Loi06, RP04]. For twisted Gabidulin codes, a decoding algorithm exists but only for a particular parameters of the code [RR17]. Most of the algorithms for Gabidulin codes are using syndrome computation, extended Euclidean algorithm, Berlekamp-Massey algorithm. In this work we will use the Berlekamp-Massey algorithm for a rank metric code again, but in a different way. Namely, suppose that (c1 , · · · , cn ) + (e1 , · · · , en ) is the received vector with (e1 , · · · , en ) being the error. We first interpolate the polynomial f (x)+g(x) from the received vector, where f (x) is the message polynomial and g(x) is the polynomial corresponding to the error vector. Due to the form of f (x) (it has degree q k−1 at most), we already know some coefficients of g(x) and we will show that these coefficients are enough to recover the whole polynomial g(x). This algorithm can be further modified to be used with all cases of twisted Gabidulin codes. To do these, we will first give a description of Gabidulin codes and twisted Gabidulin codes in Section 2. Also, we will give a brief description of two decoding algorithms for Gabidulin codes. Then, in Section 3, we prove a theorem which enables us to build a new decoding algorithm. We will present the new decoding algorithm for Gabidulin codes and we will show its difference with the two algorithms we presented in Section 2. In Section 4, we will modify the algorithm to use it with twisted Gabidulin codes. Finally, we will conclude in Section 5. ∗ The author is supported by SNF grant no. 169510 1 2 Rank metric codes Definition 1. Let Fqn /Fq be a finite field extension of degree n. A linearized polynomial of q-degree k is a polynomial of the form k f (x) = f0 x + f1 xq + · · · + fk xq , where fk 6= 0 and fi ∈ Fqn for any integer i with 0 ≤ i ≤ k. The set of all these polynomials will be denoted by L[Fqn ]. If we fix an integer k, then Lk [Fqn ] denotes the set of all linearized polynomials of q-degree at most k − 1. Example 1. The trace map Fqn → Fq is the linearized polynomial Tr x = x + n−2 n−1 xq + · · · + xq + xq We know that Fqn is a vector space over Fq of dimension n. And since i xq is an Fq -automorphism of Fqn , we see that any linearized polynomial f (x) ∈ Ln [Fqn ] is an Fq -linear map Fqn → Fqn . In fact, Ln [Fqn ] is isomorphic to the set of all (n × n)-matrices over Fq . In this regard, we define the rank of a linearized polynomial to be its rank as an Fq -linear map on Fqn . Furthermore, if f (x) has q-degree k < n, then considering it as a polynomial in Fqn [x], it can have q k roots at most. Therefore as an Fq -linear map Fqn → Fqn , f (x) has a kernel of dimension of k at most. This property allows us to use these polynomials to construct rank metric codes with good property. For more on the theory of linearized polynomials, one can have a look at [LN96] Chapter 3. Definition 2. Given a finite field Fq , a rank metric code is a subset C of Matn×n (Fq ) together with the metric defined by d(c1 , c2 ) = rank(c1 − c2 ), for ci ∈ Matn×n (Fq ). We call it linear if C is a vector space over Fq of dimension k and if furthermore, d is the minimum distance between two distinct codewords of C, then we say that C is a [n × n, k, d] linear rank metric code. Remark 1. Alternative representations of a rank metric codes are given by the following: 1. The code is C ⊂ (Fqn )n , where the rank of a matrix is replaced by the maximum number of Fq -linearly independent elements in (c1 , · · · , cn ) ∈ (Fqn )n . 2. The code is C ⊂ (Ln [Fqn ]), where the rank of a matrix is replaced by the rank of the linearized polynomial c(x) as an Fq -linear map. Given a rank metric code and a minimum distance, the upper-bound on the size of the code is given by the following theorem. Theorem 1 ([Del78]). Let C be a linear code in Matn×n (Fq ), if the minimum distance of C is equal to a positive integer d, then ♯C ≤ q n(n−d+1) . Codes for which the bound is attained (i.e [n × n, n(n − d + 1), d]) are called maximum rank distance (MRD) codes. The first class of linear rank metric code is the family of Gabidulin codes [Del78, Gab85], given by, n o k−1 C = Lk [Fqn ] = a0 x + · · · + ak−1 xq , ai ∈ Fqn . 2 To prove that this is MRD, we just use the fact that the kernel has dimension k − 1 at most and then use the rank nullity theorem. This construction was generalized by Sheekey in [She16]. Namely, the Class of twisted Gabidulin codes is defined as follows: o n r k k−1 ′ Cη,r = a0 x + · · · + ak−1 xq + ηaq0 xq , ai ∈ Fqn , Qn−1 i where η ∈ Fqn with i=0 η q 6= (−1)nk and r is a non-negative integer. This is an MRD code because a codeword cannot have q k zeroes by the choice of the k the coefficients of x and xq [She16]. Remark 2. The above representations are using linearized polynomials. These are Fq -linear maps Fqn → Fqn . To get a representation of the code as a subset of (Fqn )n , we evaluate the code on a fixed basis of the extension Fqn /Fq . Using this basis, we can also get a representation in the matrix form in Matn×n (Fq ). Remark 3. The construction can be generalized by replacing the monomials i si xq by xq where (s, n) = 1. They are called generalized Gabidulin codes, see [KG05]. There are already a lot of decoding algorithms for Gabidulin codes. For twisted Gabidulin codes, there is a decoding algorithm but only for some specific parameters [RR17]. As we mentioned before, we will give another decoding algorithm for Gabidulin codes and we will show how to modify it to get a decoding algorithm for twisted general Gabidulin codes. In order to see the difference between the existing and our algorithms, we will first show a brief description of two decoding algorithms for an [n, kn, d]-Gabidulin codes 1. Compute the syndrome vector rHT , where H is a parity check matrix i of the code given by hi,j = hqj . The entries si of this vector define a linearized polynomial S(x). 2. Determine two linearized polynomials L(x) and F (x) such that F (x) = d−1 L(x) ◦ S(x) mod z q . Here, there are two methods: Use Berlekamp Massey [RP04] or use the extended Euclidean algorithm [Gab85]. 3. Find a basis {ei } of the kernel of L(x). 4. Compute the αi ’s from qj i ei αi P 5. Find a matrix Y , with αj = P i = sj . Yj,i hi . 6. Finally the error vector is eY , where the entries of e are ei . 7. output the message as r − e. 3 Decoding algorithm for Gabidulin codes Before we give our new decoding algorithm, we first give the needed tool. We know that linear maps can be decomposed as a sum of several linear maps of dimension one. And this can be shown in the setting of linearized polynomials. In the remaining part of this paper, we will use only linearized polynomials in Ln [Fqn ]. 3 Lemma 1. Any Fq -linear map Fqn → Fq can be represented by Tr (ax) for a fixed a ∈ Fqn . Proof. The set of Tr (ax) are obviously Fq -linear maps Fqn → Fq . The equality comes by looking at the dimension of the space of Fq -linear maps Fqn → Fq . Corollary 1. Let λ be an element of Fqn and let λFq be the Fq -subspace of Fqn generated by λ. Then any linear map Fqn → λFq has the form λTr (ax) for some a ∈ Fqn . The above representation in the corollary is of course not unique. As a consequence of the previous corollary, we have the following theorem. Theorem 2. Let f be a linearized polynomial of rank r, then there are two subsets of Fqn S1 = {a1 , · · · , ar } and S2 = {b1 , · · · , br } such that they are both linearly independent over Fq and that f (x) = a1 Tr (b1 x) + · · · ar Tr (br x). Proof. Since f is of rank r, then we choose {a1 , · · · , ar } to be a generator of the image of f as a linear map. By Corollary 1, each projection of f onto the subspace hai i has the form ai Tr (bi x). Thus we get the desired form of f . What remains to show is the linear independence of the bi ’s. Without loss of generality, say b1 = µ2 b2 + · · · + µr br , with µi ∈ Fq . Then f (x) = a1 ((Tr ((µ2 b2 + · · · + µr br )x))) + a2 Tr (b2 x) + · · · + ar Tr (br x) = a1 Tr (µ2 b2 x) + · · · + a1 Tr (µr br x) + a2 Tr (b2 x) + · · · + ar Tr (br x) = (a2 + a1 µ2 )Tr (b2 x) + · · · + (ar + a1 µr )Tr (br x). Thus rank of f is at most r − 1 which is a contradiction. From Theorem 2, we get the following corollary. Corollary 2. Let f (x) be a linearized polynomial of rank r over the field extension Fqn /Fq such that f (x) = f0 x + f1 xq + · · · + fn−1 xq n−1 . Then there are two subsets of Fqn S1 = {a1 , · · · , ar } and S2 = {b1 , · · · , br } such that they are both linearly independent over Fq , and for all integer i such that 0 ≤ i ≤ n − 1, r X i bqj aj . fi = j=1 n−1 Definition 3. Let f (x) = f0 x + f1 xq + · · · + fn−1 xq be a linearized polynomial. The Dickson matrix associated to f (x) is the matrix  f0 f1 .. . q fn−1 f0q .. . fn−1 q fn−2   M=   4 n−1  . . . f1q n−1  . . . f2q   ..  . .. . .  qn−1 . . . f0 Another matrix related to linearized polynomials is the Moore matrix. Definition 4. Given {a1 , · · · , ak } ai ’s is the matrix  a1  aq1   ..  . k−1 a1q ⊂ Fqn , the Moore matrix associated to the a2 aq2 .. . ... ... .. . k−1 a2q ak aqk .. . k−1 . . . akq      It is well known that the above Moore matrix is invertible if and only if the ai ’s are linearly independent over Fq . As a consequence of Corollary 2, we have the following theorem. Theorem 3. Let f (x) be a linearized polynomial of rank r over the field extension Fqn /Fq such that f (x) = f0 x + f1 xq + · · · + fn−1 xq n−1 . Let M1 , · · · , Mn be the rows of the matrix M as in Definition 3. Then we have the following property: (i) The matrix M is of rank r. (ii) Any r successive rows Mi , · · · , Mi+r are linearly independent and the other rows are linear combinations of them. (iii) All (r × r)-matrices (Mi,j )(i mod n,j with 0 ≤ li ≤ n − 1 are invertible. mod n) ; l1 ≤ i ≤ l1 + r, l2 ≤ j ≤ l2 + r Proof. From Corollary 2, one sees that M = BA, where    b1 b2 ... br a1 aq1 q q  q  b1 b2 ... br  a2 aq2   .. ..  and A =  B =  .. .. ..  ..  . . . .  . . n−1 b1q n−1 b2q . . . brq n−1 ar aqr n−1  . . . a1q n−1  . . . a2q   ..  .. . .  n−1 . . . arq Since the ai ’s are linearly independent over Fq and the same for the b′i s, we see that each r successive rows of B and any r successive columns of A constitute invertible matrices. All statements of the theorem follow from these facts. It is this theorem that is important to us. This enables us to build a new decoding algorithm. We are now ready to explain the decoding algorithm. It consists of two steps. The first part is to interpolate the received message to construct the polynomial f (x) + g(x), where f (x) is the message polynomial and g(x) is the error polynomial. Since f (x) is of degree k − 1 at most, we should know the i coefficient of xq in g(x), ∀i ≥ k. We will show that these coefficients are actually enough to recover the whole polynomial g(x) with some condition on the rank of g(x). 5 3.1 Polynomial interpolation First of all, depending on the representation of the code, we need to do some interpolation to get a linearized polynomial form. Assume that our encoding was given by Lk [Fqn ] → (Fqn )n f (x) 7→ (c1 , c2 , · · · , cn ), where {a1 , a2 , · · · , an } is a fixed basis of Fqn /Fq and ci = f (ai ). We assume that an error of e = (e1 , e2 , · · · , en ) was added to the original . Therefore (r1 , r2 , · · · , rn ) codeword and suppose that rank(e) = t < n−k+1 2 was received with ri = ci + ei . Let U be the Moore matrix  n−1  a1 aq1 . . . a1q n−1    a2 aq2 . . . a2q   U= ..  .. . .  ..  . . .  . n−1 an aqn . . . anq Then   U fn−1 + gn−1 i   r1   ..  = .   f0 + g0 .. . rn where g(x) = gi xq is the error polynomial corresponding to e i.e. g(ai ) = ei . Obviously, g(x) as an Fq -linear map has rank t < n−k+1 . 2 Thus, we may compute U−1 in advance and then compute   r1 −1  ..  U  . . P rn This gives us f0 + g0 , · · · , fn−1 + gn−1 . Since fi = 0, ∀i ≥ k, we now know the values of gk , · · · gn−1 . In the next step, we will use these coefficients to recover the other coefficients of g(x). 3.2 Polynomial reconstruction Let us have a look at the matrix M in Theorem g(x). We consider its submatrix  q qn−(k+t−1) g0 gn−1 . . . gk+t−1 ...  q qn−(k+t−1)  g1 g0 . . . gk+t ...   .. . . . .. . . . W= . . . . .  n−(k+t−1)  q q ... gt−1 gt−2 . . . gk+2t−2 gt q gt−1 n−(k+t−1) q . . . gk+2t−1 ... 3 from the error polynomial n−k n−1 gkq . . . g1q q gk+1 .. . . . . g2q .. .. . . n−k n−k q gk+t−1 n−k q gk+t n−1      .  qn−1  . . . gt  qn−1 . . . gt+1 We know that the t last rows are linearly independent and that the first row should be a linear combination of the t last rows. 6 This gives us an equation of the form  n−(k+t−1) gq  k+t−1 qn−(k+t−1) gk+t   .. (λ0 , · · · , λt )  .  n−(k+t−1)  q gk+2t−2 n−(k+t−1) q gk+2t−1 ... n−k gkq n−k q gk+1 .. .      =0  n−k  q . . . gk+t−1  qn−k . . . gk+t ... .. . (1) where we may assume that λ0 = 1. Notice that by the interpolation step, we know the coefficients gk , · · · , gn−1 . Since we suppose that t < n−k+1 , then k + 2t − 1 ≤ n − 1. Thus we know all the 2 coefficients gk , · · · , gk+2t−1 . And thus, by Theorem 3, this equation has unique solution in λ which we can compute. This can be done for example by using matrix inversion but that will take O(t3 ) operations. Similarly to the case of Reed-Solomon codes, we can do better. Namely, we have here a Toeplitz-like matrix. And this can actually be solved by using n−i a Berlekamp-Massey-like algorithm from [RP04]. To see this let ui = giq . Therefore, Equation (1) becomes   uk+t−1 . . . uk  uq . . . uqk+1   k+t   .. ..  .. . (λ0 , · · · , λt )  (2) . .   t−1 =0  q qt−1  uk+2t−2 . . . uk+t−1  t t uqk+2t−1 . . . uqk+t We want to find λ1 , · · · , λt from the sequence (uk+2t−1 , · · · , uk+t , · · · , uk ). Equation (2) is exactly the form of recurrence shown in [RP04]. In that paper, they gave an algorithm for solving Equation (2). We will give the algorithm in Algorithm 1. We set d = n − k + 1. P (i) j In this algorithm Λ(i) (x) = j λj xq and at the end of the algorithm, we will just collect the coefficient of the Λ(i) (x) to get our λi . Notice that on input we take (s0 , · · · , s2t−1 ) = (uk+2t−1 , · · · , uk ). We summarize our decoding algorithm with the following steps in Algorithm . We 2. Suppose (r1 , r2 , · · · , rn ) was received with an error of rank t < n−k+1 2 already know the matrix U−1 in advance. 3.3 Complexity and comparison with other algorithms All the three first steps of Algorithm 2 have quadratic complexity i.e they can be done in O(n2 ) operations in Fqn . The last step is a linear operation. Thus in general we have an algorithm with O(n2 ) operations in Fqn . We already saw two decoding algorithms in Section 2. As we can see, there is a difference in the first steps of these algorithms and our algorithm. Instead of using an ((n − k) × n) matrix for computing the syndromes, we use an (n × n) matrix to interpolate f + g. So in the first step, we have some extra O(nk) extra multiplications. The second steps are more or less the same as they are either Berlekamp-Massey or extended Eulidean algorithm. The last steps are where we may get the advantage as we directly use a linear recurrence to recover 7 Algorithm 1 Berlekamp-Massey 1: procedure BERLEKAMP-MASSEY(s0, · · · , s2t−1 ) 2: L←0 3: Λ(0) (x) ← x 4: B (0) (x) ← x 5: i←0 6: while i ≤ d − 2 do P (i) qj 7: ∆i ← si + L j=1 λj si−j 8: Λ(i+1) ← Λ(i) − ∆i xq ◦ B (i) (x) 9: if ∆i == 0 then 10: B (i+1) (x) ← xq ◦ B (i) (x) 11: else 12: if 2L > i then 13: B (i+1) (x) ← xq ◦ B (i) (x) 14: else (i)(x) 15: B (i+1) (x) ← ∆−1 i Λ 16: L←i+1−L 17: end if 18: end if 19: i←i+1 20: end while 21: return Λ(i) (x) 22: end procedure Algorithm 2 Decoding algorithm Input: (r1 , · · · , rn ) (1) Compute   f0 + g0 .. .       r1   fk−1 + gk−1  .  = U−1    ..    gk   rn   ..   . gn−1 (2) Use the Berlekamp-Massey-like Algorithm 1 to get the λi ’s. (3) Use the fact that the first row of the matrix W is a linear combination of the remaining rows, using the λi ’s, to recursively compute the remaining coefficients of g(x). This is just like recursively computing elements of a sequence but the difference with linear-feedback shift register is that the steps also involves raising to some power of q. (4) Output the message as (f + g)(x) − g(x). the error polynomial. For the other algorithms in Section 2, one first needs to compute the roots of some polynomials (error locator polynomial) before one 8 can reconstruct the error vectors using some relations. 4 Extension to twisted Gabidulin codes In this section, we will explain that our algorithm can also be modified to get a decoding algorithm for twisted Gabidulin codes. And in contrary to the algorithm in [RR17], we can do it for any parameters. We assume that the original message was given by f (x) = f0 x + · · · + fk−1 xq k−1 r k + ηf0q xq . After the interpolation step, we get the polynomial f (x) + g(x). In opposite to the case of Gabidulin codes, we do not know the value of gk from this. However the problem we are faced remains similar. We want to find a linear relations between the rows of  n−k n−1  q qn−(k+t−1) g0 gn−1 . . . gk+t−1 . . . gkq . . . g1q n−1   qn−(k+t−1) qn−k  g1 g0q . . . gk+t . . . gk+1 . . . g2q     ..  . .. .. .. .. .. .. W =  ...  . . . . . . .    q qn−(k+t−1) qn−k qn−1  . . . gk+t−1 . . . gt  gt−1 gt−2 . . . gk+2t−2 q qn−(k+t−1) qn−k qn−1 gt gt−1 . . . gk+2t−1 . . . gk+t . . . gt+1 r k where we know the values gk+1 , · · · , gn−1 and ηg0q − g q . We will see that we still can solve this problem. We have an equation of the form  n−(k+t) n−k  q qn−(k+t−1) gk+t gk+t−1 . . . gkq  qn−(k+t) qn−(k+t−1) qn−k   gk+t+1  gk+t . . . gk+1     .. .. .. (λ0 , · · · , λt )   = 0. . . .  n−(k+t)   q qn−(k+t−1) qn−k  gk+2t−2 . . . gk+t−1   gk+2t−1 qn−(k+t−1) qn−(k+t−1) qn−k gk+2t gk+2t−1 . . . gk+t Notice that we introduce one more columns in the equation. Again, by assumption, we have 2t < n − k + 1. Thus k + 2t ≤ n. If k + 2t < n, then a Berlekamp-Massey algorithm using the columns of the previous matrix except the last column is enough to compute the λi ’s. If k + 2t = n, then the equation becomes,  n−(k+t) n−k  q qn−(k+t−1) gk+t gk+t−1 . . . gkq  qn−(k+t) qn−(k+t−1) qn−k  gk+t+1  gk+t . . . gk+1     . . . .. .. .. (λ0 , · · · , λt )  (3)  = 0,  n−(k+t)  n−(k+t−1) n−k   q q q gk+2t−2 . . . gk+t−1 gn−1  qn−(k+t) qn−(k+t−1) qn−k g0 gn−1 . . . gk+t where two entries in terms of gk and g0 are unknown. If we use the columns of the matrix except the first and last columns, then we should have an underdetermined system of linear equations whose solution 9 space is of dimension two. We assume that two linearly independent solutions are λ and λ ′ . They can be found using the Berlekamp-Massey like algorithm λ′ for some A ∈ Fqn . again. Thus a solution of equation (3) is of the form λ + Aλ Using this with the first columnr and the last column, we get two equations. Furthermore, we also know ηg0q − gk . So in total we get a system of three equations with three unknowns,  qn−(k+t)  =0  h0 + h1 A + (h2 + h3 A)g0 qn−k (4) h + h A + (h + h A)g =0. 4 5 6 7 k   qr =0 h8 + ηg0 − gk In this system, we know all the hi and g0 , gk , A are unknown. Notice that any solution of the system of equation (4) is actually a solution of the decoding algorithm. By the unique decoding property, there can only be one solution of this system. To solve the system, we use the third equation in the two first equations and we get ( i s0 + s1 A + (s2 + s3 A)g0q = 0 (5) j s4 + s5 A + (s6 + s7 A)g0q = 0 with the si ’s known. We can further reduce this into one variable equation of the form, for some integer l, l s′ + s′5 Aq s0 + s1 A . = 4′ s2 + s3 A s6 + s′7 Aql We want to point out that this form of equation was also obtained in [RR17]. However, in our case here, we are sure that any solution would give us the closest codeword to the received message. We have now reduced the problem to solving the polynomial equation of the form l P (A) = u0 + u1 A + u2 Aq + Aq l +1 = 0. We distinguish three cases: l • If u0 = u1 u2 , then we can factor P (A) = (Aq + u1 )(A + u2 ). • If u1 = uq2 , then l l P (A) = u0 + uq2 A + u2 Aq + Aq l = u0 − uq2 u2 + (A + u2 )q l l +1 +1 • If u0 6= u1 u2 and u1 6= uq2 , then, from [Blu04], by a change of variable l y = (u2 u1 − u0 )(u1 − uq2 )−1 A − u2 , we will get a polynomial equation of the form l Q(y) = y q +1 − vy + v = 0 l with v = (u1 − uq2 )q l +1 l /(u0 − u2 u1 )q . 10 First of all, it is easy to show that if we get A from P (A), then we can use equation (5) to get g0 . And we use equation (4) to get gk . These will give us the error polynomial g(x) with the recurrence relation from equation (3). So, normally, there should be only one unique solution for A. Now the question is how do we solve the equation P (A) = 0? Any of the three cases which produce multiple solutions should be ruled out. The first case of P (A) is easy to solve. The two last cases reduce to polynomials of the form P (X) = X q l +1 + aX + b. The number of roots of such polynomials was studied in [Blu04]. Here we will give a method to find these roots. l Suppose that y2 is a root of P (X). Then set b = −y2q +1 − ay2 and choose l y1 = −a − y2q . thus b = y2 y1 . We get l 2l l l l l (xq − y1 x) ◦ (xq − y2 x) = xq − y2q xq − y1 xq + y1 y2 x 2l = xq + axq + bx. The converse is also true. So, to get the root of P (X), we just need to factor 2l the linearized polynomial xq + axq + bx. In case this polynomial admits a root x0 in Fqn then we just take y2 = x0q−1 . Otherwise, we will need to use a factorization algorithm like in [Gie98]. Once A is computed, we can compute g0 and gk . Then we continue the decoding algorithm with the same methods as with the Gabidulin codes. Remark 4. These algorithms can be easily modified to get a decoding algorithm for generalized (twisted) Gabidulin codes. Namely instead of working with the s field automorphism xq , we work with automorphisms of the form xq . 5 Conclusion In this work we have given a new decoding algorithm for Gabidulin codes. First, instead of computing syndromes, we do some polynomial interpolation. Our algorithm requires more computations in this first steps but we can compensate this in the last steps. Namely, there is no need to find roots of some “error locator polynomial”. We just need to use a recurrence relation to recover the “error polynomial” after using a Berlekamp-Massey-like algorithm. We gave a brief analysis on the complexity and a comparison of our algorithm to some existing decoding algorithms for Gabidulin codes. Furthermore, we show that our algorithm can be modified to get a general decoding algorithm for twisted Gabidulin codes. Finally, we think that it is possible to get a version of our algorithm for Reed-Solomon codes. Namely we can use an equivalent of the Dickson matrix. In the case of Reed-Solomon codes, we have a circulant matrix. And a theorem of König-Rados gives a relation between the number of non-zero roots of a polynomial and the rank of some circulant matrix, see [LN96], Chapter 6, Section 1. It is known that the most expensive steps in the decoding of Reed-Solomon codes is finding roots of the error locator polynomials. This can be avoided in our algorithm. 11 We have seen that our algorithm involves factoring linearized polynomial of degree 2. It is well known that factoring a regular polynomial of degree 2 can be done by computing the discriminant of the polynomial. The algorithm presented in [Gie98] gives a factorization for linearized polynomials of general degree, we could further simplify our algorithm if we would have a discriminant like method to factorize a degree 2 linearized polynomial. Aknowledgement I would like to thank Anna-Lena Horlemann-Trautmann and Joachim Rosenthal for their valuable comments and suggestions on this work. References [Blu04] A. W. Bluher. On xq+1 + ax + b. Finite fields and their applications, 10(3):285 – 305, 2004. [Del78] P. Delsarte. Bilinear forms over a finite field, with applications to coding theory. Journal of Combinatorial Theory, Series A, 25(3):226 – 241, 1978. [Gab85] E.M. Gabidulin. Theory of codes with maximum rank distance. Probl. Inf. Transm., 21:1–12, 1985. [Gie98] M. Giesbrecht. Factoring in skew-polynomial rings over finite fields. Journal of Symbolic Computation, 26(4):463 – 486, 1998. [KG05] A. Kshevetskiy and E. Gabidulin. The new construction of rank codes. In Proceedings. International Symposium on Information Theory, 2005. ISIT 2005., pages 2105–2108, Sept 2005. [LN96] R. Lidl and H. Niederreiter. Finite fields. 2nd ed. Cambridge: Cambridge Univ. Press, 2nd ed. edition, 1996. [Loi06] P. Loidreau. A Welch-Berlekamp like algorithm for decoding Gabidulin codes, pages 36–45. Springer Berlin Heidelberg, Berlin, Heidelberg, 2006. [LTZ15] G. Lunardon, R. Trombetti, and Y. Zhou. Gabidulin codes. ArXiv e-prints, July 2015. Generalized twisted [RP04] G. Richter and S. Plass. Error and erasure decoding of rank-codes with a modified Berlekamp-Massey algorithm. In 5th International ITG Conference on Source and Channel Coding, pages 249–256, 2004. [RR17] T. Randrianarisoa and J. Rosenthal. A decoding algorithm for twisted gabidulin codes. In 2017 IEEE International Symposium on Information Theory (ISIT), pages 2771–2774, June 2017. [She16] John Sheekey. A new family of linear maximum rank distance codes. Advances in Mathematics of Communications, 10(3):475–488, 2016. 12
7cs.IT
Reasoning about Unforeseen Possibilities During Policy Learning Craig Innesa , Alex Lascaridesa , Stefano V. Albrechta , Subramanian Ramamoorthya , Benjamin Rosmanb arXiv:1801.03331v1 [cs.AI] 10 Jan 2018 b Mobile a School of Informatics, University of Edinburgh Intelligent Autonomous Systems, CSIR, and School of Computer Science and Applied Mathematics, University of the Witwatersrand Abstract Methods for learning optimal policies in autonomous agents often assume that the way the domain is conceptualised—its possible states and actions and their causal structure— is known in advance and does not change during learning. This is an unrealistic assumption in many scenarios, because new evidence can reveal important information about what is possible, possibilities that the agent was not aware existed prior to learning. We present a model of an agent which both discovers and learns to exploit unforeseen possibilities using two sources of evidence: direct interaction with the world and communication with a domain expert. We use a combination of probabilistic and symbolic reasoning to estimate all components of the decision problem, including its set of random variables and their causal dependencies. Agent simulations show that the agent converges on optimal polices even when it starts out unaware of factors that are critical to behaving optimally. 1. Introduction Consider the following decision problem from the domain of crop farming (inspired by Kristensen and Rasmussen (2002)): Each harvest season, an agent is responsible for deciding how best to grow barley on the land it owns. At the start of the season, the agent makes some decisions about which grain variety to plant and how much fertiliser to use. Come harvest time, those initial decisions affect the yield and quality of the crops harvested. We can think of this problem as a single-stage (or “one-shot”) decision problem, in which the agent chooses one action based on a set of observations, then receives a final reward based on the outcome of its action. Suppose the agent has experience from several harvests, and believes it has a good idea of the best seeds and fertiliser to use for a given climate. One harvest, something totally unexpected happens: Despite choosing what it thought were the best grains and Email addresses: [email protected] (Craig Innes), [email protected] (Alex Lascarides), [email protected] (Stefano V. Albrecht), [email protected] (Subramanian Ramamoorthy), [email protected] (Benjamin Rosman) 1 fertiliser, many of the crops have come out deformed and of poor quality. A neighbouring farmer tells the agent the crops have been infected by a fungus that spreads in high temperatures, and that the best way to protect crops in future is to apply fungicide. The agent must now revise its model of the environment and its reward function to account for fungus (a concept it previously was not aware of), extend its available actions to include fungicide application (an action it previously did not realise existed), reason about the probabilistic dependencies these new concepts have to the ones it was already aware of, and reason about how they affect rewards. This example illustrates at least three challenges, the combination of which typically is not handled by current methods for learning optimal decision policies (we defer a detailed discussion of related work to Section 6): • In addition to starting unaware of the probabilistic dependency structure of the decision problem, the agent starts unaware of even the true hypothesis space of possible problem structures, including the sets of possible actions and environment variables, and their causal relations. • Domain exploration alone might not be enough to discover these unknown factors. For instance, it is unlikely the agent would discover the concept of fungus or the action of fungicide application by just continuing to plant crops. External expert instruction is necessary to overcome unawareness. • An expert might interject with contextually relevant advice during learning, not just at the beginning of the problem. Further, that advice may refer to concepts which are not a part of the agent’s current model of the domain. In the face of such strong unawareness, one might be tempted to side-step learning an explicit model of the problem, and instead learn optimal behaviour directly from the data. Deep reinforcement learning (e.g. Mnih et al. (2015)) has proved extremely useful for learning implicit representations of large problems, particularly in domains where the input sensory streams are complex and high-dimensional (e.g computer vision). However, in many such models, the focus of attention for abstraction and representation learning is on perceptual features rather than causal relations (see, e.g., Pearl (2017)) and other decision-centric attributes. For instance, in works such as by Chen et al. (2015), who demonstrate an end-to-end solution to the problem of autonomous driving, the decisions are not elaborated beyond “follow the lane” or “change lanes” although significant perceptual representation learning may need to happen in order to work with the predicate “lane” within the raw sensory streams. For safety critical decisions, or ones involving significant investment (e.g. driving a car, advising on a medical procedure, deciding on crops to grow for the year) it is important 1 that a system can explain the reasoning behind its decisions so the user can trust its judgement. We present a learning agent that, in a complementary approach to representation learning in batch mode from large corpora, uses evidence and a reasoning mechanism to incrementally construct an interpretable model of the decision problem, based on which optimal decision policies are computed. The main contributions of this paper are: 1 As evidenced by significant recent interest from agencies interested in the application of AI, e.g., the DARPA Explainable AI programme DARPA-BAA-16-53 (2016) 2 • An agent which, starting unaware of factors on which an optimal policy depends, learns optimal behaviour for single-stage decision problems via direct experience and advice from a domain expert. The learning uses decision networks to represent beliefs about the variables and causal structure of the decision problem, providing a compact and interpretable model. Crucially, the agent can revise all components of this model, including the set of random variables, their causal dependencies, and the domain of the reward function (Section 4). • A communication framework via which an expert can offer both solicited and unsolicited advice to the agent during learning: that is, the expert advice is offered piecemeal, in reaction to the agent’s latest attempts to solve the task, rather than all of it being conveyed prior to learning. Messages from the expert can include entirely new concepts which the agent was previously unaware of, and provide important qualitative information to complement the quantitative information conveyed by statistical correlations in the domain trials (Section 3.2). • Experiments across a suite of randomly generated decision problems, which demonstrate that our agent can learn the optimal policy from evidence, even if it were when initially unaware of variables that are critical to its success (Section 5). The kinds of applications we ultimately have in mind for this work include tasks in which there is a need for flexible and robust responses to a vast array of contingencies. In particular, we are interested in the paradigm of continual (or life-long) learning (Silver, 2011; Thrun and Pratt, 2012), wherein the agent must continually and incrementally add to its knowledge, and so revise the hypothesis space of possible states and actions within which decisions are made. In this context, there is a need for autonomous model management (Liebman et al., 2017), which calls for reasoning about what the hypothesis space is, in addition to policy learning within those hypothesis spaces. 2. The Learning Task We consider learning in single-stage decision problems. In these problems, the agent chooses an action based on a set of initial observations, then immediately receives a final reward based on the outcome of its action. Subsequent repetitions of the same decision problem have mutually independent initial observations, and the immediate reward depends only on the current action and its outcome. Solving the problem of unforeseen possibilities for single-stage scenarios is a necessary first step towards the long-term goal of extending this work to multi-stage, sequential decision problems. To learn an optimal decision policy, the agent must compute which action will maximise its expected reward, given its observations of the state in which the action is to be performed. Formally, the optimal action ~a∗ given observations ~e is the action which maximizes expected utility: X ~a∗ = arg max EU (~a|~e) = arg max P r(~s|~a, ~e)R(~s) (1) ~ a∈v(A) ~ a∈v(A) ~ s∈v(C) Here, A = {A1 , A2 , . . . , An } is the set of action variables and C = {C1 , C2 , . . . , Cm } is the set of chance variables (or state variables). An action ~a ∈ v(A) is an assignment 3 to each of the action variables in A, such that ~a = (a1 , a2 , . . . , an ) with a1 ∈ A1 , a2 ∈ A2 , etc. (We use v(Q) to denote the Cartesian product of all sets in Q.) Similarly, a state ~s ∈ C is an assignment to each chance variable in C. The reward received in state ~s is R(~s). In our task, the agent faces the extra difficulty of starting unaware of certain actions and concepts (i.e., chance variables) on which the true optimal policy depends. Consequently, it begins learning with an incomplete hypothesis space. It also has an incorrect model of the domain’s causal structure—i.e., there may be missing or incorrect dependencies. Further, the learning agent will start with an incomplete or incorrect reward function. The agent’s learning task, then, is to use evidence to converge on an optimal policy, despite beginning with an initial model defined over an incomplete set of possible states and actions and incorrect dependencies among them. Since we are interested in interpretable solutions, our approach is that the learning agent uses evidence to dynamically construct an interpretable model of the decision problem from which an optimal policy can be computed. Formally, we treat this task of learning an optimal policy as one of learning a decision network (dn). dns capture preferences with a numeric reward function and beliefs with a Bayes Net, thereby providing a compact representation of all the components in equation (1). Definition 1. Decision Network A Decision Network (dn) is a tuple hC, A, Π, θ, Ri, where C is a set of chance variables, A is a set of action variables (the agent controls their values), and R is a reward function whose domain is ΠR ⊆ C and range is R.2 hΠ, θi is a Bayes Net defined over C ∪ A. That is, Π is a directed acyclic graph (dag), defining for each C ∈ C its parents Πc ⊆ C ∪ A, such that C is conditionally independent of (C ∪ A) \ Πc given Πc . θ defines for each variable C ∈ C its conditional probability distribution θc = P r(C|Πc ). A policy for a dn is a function π from the observed portion ~e of the current state (i.e., ~e is a subvector of v(C)) to an action v(A). As is usual with dns, any variable X whose value depends on the action performed (in other words, X is a descendant of A) cannot be observed until after performing an action. More formally, C = B ∪ O, where the “before” variables B are non-descendants of A, and the “outcome” variables O are descendants of A (i.e., where Π∗ is the closure of Π, X ∈ O iff ∃A ∈ A such that A ∈ Π∗X ). So a policy π for the dn is a function from v(B 0 ) to v(A), where B 0 ⊆ B are the observable variables in B. Figure 1a shows a dn representation of the barley example from the introduction. The action variables (rectangles) are A = {Grain, Harrow, F ungicide, F ertiliser, P esticide}, the chance variables (ovals) are C = B∪O where B includes P recipitation, T emperature, Soil T ype etc. and O includes Y ield, P rotein, F ungus, and Bad P ress. The reward domain is ΠR = {Y ield, P rotein, F ungus, Bad P ress}. Our dn formulation has some similarities to influence diagrams (Howard and Matheson, 2005). In contrast to DNs, influence diagrams allow action nodes to have parents via “information arcs” from chance nodes. While this feature is useful to model multistage decision problems, we do not require it here since all action variables are assigned simultaneously. 2 Agents do not have intrinsic preferences over actions, but rather over their outcomes. 4 Our agent will incrementally learn all components of the dn, including its set of random variables, dependencies and reward function. We denote the true dn by dn+ , and the agent’s current model of the dn at time t as dnt . A similar convention is used for each component of the dn (so, for instance, At is the set of action variables the agent is aware of at time t). Thus, we compute an update function dnt = update(dnt−1 , et ), where et is the latest body of evidence and the dns dnt−1 and dnt may differ in any respect. Figure 1b gives an example of an agent’s possible starting model dn0 for the barley example. Notice that dn0 is missing factors that influence the optimal policy defined by dn+ (e.g. it is unaware of the concept of fungus). It is also missing dependencies that are a part of dn+ (e.g. it does not think the choice of grain has any influence on the amount of crops that will grow). One usually assumes that all variables in a dn are connected to the utility node because a variable that is not has no effects on optimal behaviour. So the agent knows that dn+ is so connected, but dn+ ’s set of variables, causal structure and reward function are all hidden and must be inferred from evidence. We make four main assumptions to restrict the scope of the learning task: 1. The agent can observe the values of all the variables it is aware of (so the domain of its policy function at time step t is v(Bt )). However, it cannot observe a chance variable’s values at times before it was aware of it, even after becoming aware of it— i.e. the agent cannot re-perceive past domain trials upon discovering an unforeseen factor. 2. The agent cannot perform an action it is unaware of. Formally, if X ∈ A+ but X 6∈ At , then the fully aware expert perceives the learning agent’s action as entailing X = 0 (plus other values of other variables in A+ ). This differs from the learning agent’s own perception of its action: X = 0 is not a part of the agent’s representation of what it just did because it is not aware of X! Once the agent becomes aware of X, then knowing that inadvertent actions are not possible, it can infer all its past actions entail X = 0. This contrasts with chance variables, whose values at times when the agent was unaware of them will always be hidden. Clearly, this assumption does not hold across all decision problems (e.g. an agent might inadvertently lean on a button, despite not knowing the button exists). If we wished to lift this assumption, we could simply treat action variable unawareness in the same way as we treat chance variable unawareness (as described in Section 4). 3. The set of random variables in the agent’s initial dn dn0 is incomplete rather than wrong: that is, B0 ⊆ B+ , O0 ⊆ O+ and A0 ⊆ A+ . Further, the initial domain of R is a subset of its true domain: i.e., Π0R ⊆ Π+ R . This constraint together with the dialogue strategies in Section 3.2 simplify reasoning: dn updates may add new random variables but never removes them; and may extend the domain of R but never retracts it. However, the causal structure Π and reward function R can be revised, not just refined. 4. The expert has complete knowledge of the actual decision problem dn+ but lacks complete knowledge of dnt —the learning agent’s perception of its decision problem at time t. Further, we make the expert cooperative—her advice is always sincere, competent and relevant (see Section 3.2 for details). 5 Local Concern Bad Press Fertiliser Pesticide Nitrogen Soil Type Precipitation Grain Harrow Fungicide Gross Crops Protein Fungus Temperature Insect Prevalence Infestation Weeds Yield R (a) True Decision Problem Soil Type Fertiliser Precipitation Nitrogen Gross Crops Grain Yield Protein R (b) Agent’s Initial Model Figure 1: The graphical component of the dn for the “Barley” problem. Action variables are represented by rectangles, chance variables by ovals, and the reward node by a diamond. Any competent agent attempting this learning task should obey two key principles: Consistency: At all times t, dnt should be consistent. That is, Πt should be a dag defined over the vocabulary Ct ∪At , θt should abide by the basic laws of probability, and Rt should be a well-defined function that captures an asymmetric and transitive preference relation over Ct . Satisfaction: Evidence is informative about what can happen (however rarely), not just informative about likelihood. At all times t, dnt should satisfy all the possibilities that are entailed by the observed evidence so far. Consistency is clearly desirable, because anything can be inferred from an inconsistent dn, making any action optimal. Satisfaction is not an issue in traditional approaches to learning optimal policies, because evidence never reveals a possibility that is not 6 within the hypothesis space of the learning agent’s initial dn. But in our task, without Satisfaction, the posterior dn may fail to represent an unforeseen possibility that is monotonically entailed by observed evidence. It would then fail to capture the unforeseen possibility’s effects on expected utilities and optimal policy. Our experiments in Section 5 show that when starting out unaware of factors on which optimal policies depend, a baseline agent that does not comply with Satisfaction performs worse than an agent that does. We will say dnt is valid if it complies with Consistency and Satisfaction; it is invalid otherwise. A valid dn is necessary, but not sufficient: dnt should not only be valid, but in addition its probabilistic component hΠt , θt i should reflect the relative frequencies in the domain trials. Section 4 will define a dn update procedure with all of these properties. The set of valid dns is always unbounded—it is always possible to add a random variable to a valid dn while preserving its validity. So in addition to the above two monotonic constraints on dn update, we adopt two intuitively compelling defeasible principles that make dn update tractable. Indeed, the agent needn’t enumerate all valid dns; instead, dn update uses the defeasible principles to dynamically construct a single dn from evidence: Minimality: The dn should have minimal complexity. In other words, its random variables discriminate one possible state from another, two states have distinct payoffs, and/or two factors are probabilistically dependent only when evidence justifies this. Conservativity: The agent should minimise changes to the dn’s hypothesis space when observing new evidence. Minimality is a form of Occam’s razor: make the model as simple as possible while accounting for evidence. Conservativity captures the compelling intuition that you preserve as much as possible of what you inferred from past evidence even when you have to revise the dn to restore consistency with current evidence. Minimality and Conservativity underlie existing symbolic models of commonsense reasoning (Poole, 1993; Hobbs et al., 1993; Alchourrón et al., 1985), the acquisition of causal dependencies (Bramley et al., 2015; Buntine, 1991) and preference change (Hansson, 1995; Cadilhac et al., 2015). Our final desirable feature is to support active learning: to give the agent some control over the evidence it learns from next, both from the domain trials (Section 3.1) and the dialogue content (Section 3.2). 3. Evidence We must use evidence to overcome ignorance about how to conceptualise the domain, not just ignorance about likelihoods and payoffs. We regiment this by associating each piece of evidence et with a formula δt that expresses (partial) information about the true decision problem dn+ , where δt follows monotonically from et , in the sense that it would be impossible to observe et unless δt is true of the decision problem dn+ that generated et . Thus δt is a partial description of a dn that must be satisfied by the actual (complete) decision network dn+ . 7 We illustrate this with three examples. First, given the assumptions we made about the relationship between the agent’s initial dn dn0 and dn+ (i.e., that B0 ⊆ B+ , A0 ⊆ A+ , O0 ⊆ O+ and Π0R ⊆ Π+ R ), dn0 in Figure 1b yields the partial description δ0 given in (2): {Grain, F ertiliser} ⊆ A+ ∧ {Soil T ype, P recipitation} ⊆ B+ ∧ {N itrogen, Gross Crops, Y ield, P rotein} ⊆ O+ ∧ (2) {Y ield, P rotein} ⊆ Π+ R The second example concerns domain trials: suppose the agent is in a state where it experiences the reward r and observes that the Y ield variable has value y and the P rotein variable has value p. Equation (3) must be true of dn+ , where the domain of quantification is dn+ ’s atomic states: ∃s(s → y ∧ p ∧ R+ (s) = r) (3) Thirdly, suppose the expert advises the agent to apply pesticide. Then, P esticide ∈ A+ must be true. We capture this relationship between a complete dn and formulae like (2) and (3) by defining a syntax and semantics of a language for partially describing dns (details are in the Appendix). Each model for interpreting the formulae δ in this language corresponds to a unique complete dn, and dn |= δ if and only if δ (partially) describes dn. Where δt represents the properties that a dn generating observed evidence et must have, dn+ |= δt (because dn+ generated et ), although other dns may satisfy δt too. This relationship between dn+ , et and δt enables the agent to accumulate an increasingly specific partial description of dn+ as it observes more and more evidence: where e0:t−1 is the sequence of evidence e1 , . . . , et−1 and δ0:t−1 its associated partial description of dn+ , observing the latest evidence et yields e0:t with an associated partial description δ0:t that is the conjunction of δ0:t−1 and δt . The agent will thus estimate a valid dn from evidence (as defined in Section 2) under the following conditions: 1. δ0:t captures the necessary properties of a dn that generates e0:t 2. The agent’s model obeys this partial description. That is, dnt |= δ0:t This section describes how we achieve the first condition; Section 4 defines how we achieve the second, with Section 4.2 also ensuring that the probabilistic component hΠt , θt i reflects the relative frequencies in the domain trials. 3.1. Domain Evidence: Sample 0:t Domain evidence consists of a set of domain trials. In a domain trial τi , the agent observes ~bi ∈ v(Bi ), performs an action ~ai ∈ v(Ai ), and observes its outcome ~oi ∈ v(Oi ) and reward ri . From now on, for notational convenience, we may omit the vector notation, or freely interchange vectors with conjunctions of their values. Each domain trial therefore consists of a tuple: Sample 0:t = [hbi , ai , oi , ri i : 0 < i ≤ t] 8 (4) The domain trial τi = hbi , ai , oi , ri i entails the partial description (5) of dn+ : in words, there is an atomic state s ∈ v(C+ ∪ A+ ) in dn+ that entails the observed values bi , ai and oi and which has the payoff ri . ∃s((s → (bi ∧ ai ∧ oi )) ∧ R+ (s) = ri ) (5) Formula (5) follows monotonically from τi because the agent’s perception of a domain trial is incomplete but never wrong: the agent’s random variables have observable values, and they are always a subset of those in dn+ thanks to the agent’s starting point dn0 and the dialogue strategies (see Section 3.2). Thus, even if the agent subsequently discovers a new random variable X, (5) still follows from τi , regardless of X’s value at time i (which remains hidden to the agent). But on discovering X, tuples in (4) get extended—the agent will observe X’s value in subsequent domain trials. Thus in contrast to standard domain evidence, the size of the tuples in (4) is dynamic. We discuss in Section 4 how the agent copes with these dynamics. The expert also keeps a record Sample + 0:t of the domain trials; these influence her dialogue moves (see Section 3.2). Her representation of each trial is at least as specific as the agent’s because she is aware of all the variables—so the size of the tuples in Sample + 0:t is static. Domain trials can reveal to the agent that its conceptualisation of the domain is deficient. If there are two trials in Sample 0:t with the same observed value for ΠtR (i.e., the current estimated domain of the reward function) but the rewards are different, then this entails that ΠtR is invalid. If Sample 0:t contains two domain trials with the same observed values for every chance variable Ct of which the agent is currently aware, but the rewards are different, then the vocabulary Ct is invalid. Section 4 will define how the agent detects and learns from these circumstances. The agent’s strategy for choosing an action mixes exploitation and exploration in an -greedy approach: In a proportion (1 − ) of the trials, the agent chooses what it currently thinks is an optimal action. In the remainder, the agent chooses an action at random. 3.2. Dialogue Evidence: D0:t The interaction between the agent and the expert consists of the agent asking questions that the expert then answers, and unsolicited advice from the expert. All the dialogue moves are about dn+ , and the signals are in the formal language for partially describing dns (see the Appendix), but with the addition of a sense ambiguous term, which we motivate and describe shortly. The agent’s and expert’s lexica are different, however: the agent’s vocabulary lacks the random variables in dn+ that it is currently unaware of, and so the expert’s utterances may feature neologisms. As we said earlier, we bypass learning how to ground neologisms (but see Larsson (2013); Forbes et al. (2015); Yu et al. (2016)) by assuming that once the agent has heard a neologism, it can observe its denotation in all subsequent domain trials. The sense ambiguous term is wtb : its intended denotation is what the expert observes about the state at time t before the agent acts—i.e., [[wtb ]] ∈ v(B+ ). But this denotation is hidden to the agent, whose default interpretation is [[wtb ]] projected onto Bt —i.e., it is restricted by the agent’s conceptualisation of the domain at time t. The expert uses wtb to advise the agent of a better action than the one it performed at t. We will see in Section 3.2.1 that using wtb in the expert’s signal minimises its neologisms, which 9 makes learning more tractable. But hidden messages may create misunderstandings; Section 3.2.2 describes how the agent detects and learns from them. + The agent and expert both keep a dialogue history: D0:t for the agent and D0:t for the expert. Each utterance in a dialogue history is a tuple hωi , σi , µi i, where ωi is the speaker (i.e., either the expert or the learning agent), σi the signal, and µi its (default) interpretation. Since wib may be misinterpreted, µi and µ+ i may differ and so µi is not equivalent to δi —δi is the information about dn+ that follows from the signal σi whatever the denotation of wib might be. We will specify δi for each signal σi in Section 3.2.1. 3.2.1. The expert’s dialogue strategy As noted earlier, the expert’s dialogue strategy is Cooperative: the message µ+ that she intends to convey with her signal σ is satisfied by the actual decision problem dn+ , so that dn+ |= µ+ . This makes her sincere, competent and relevant. In many realistic scenarios, this assumption may be untrue (a human teacher, for example, might occasionally make mistakes). We intend to explore relaxations of this assumption in future work. Further, the expert’s dialogue strategy limits the amount of information she is allowed to send in each signal. There are two motivations for limiting the amount of information. The first stems from the definition itself of our learning task; and the second is practical. First, recall from Section 1 that we allow the expert advice to occur piecemeal, with signals being interleaved among the learner’s domain trials. This is because a major aim of our learning task is to reflect the kind of teacher-apprentice learning seen between humans, where the teacher only occasionally interjects to say things that relate to the learner’s latest attempts to solve the task. There are many tasks where an expert may be incapable of exhaustively expressing everything they know about the problem domain, but rather can only express relevant information in reaction to specific contingencies that they experience. The second, more practical motivation is to make learning tractable. The number of possible causal structures Π is hyperexponential in the number of random variables (Buntine, 1991). Prior work utilises defeasible principles such as Conservativity (Bramley et al., 2015) and Minimality (Buntine, 1991) to make inferring Π tractable. However, if the expert’s signal σt features a set N of variables that the agent was unaware of, then the agent must add each variable in N to the causal structure Πt , and moreover by Consistency and Satisfaction, each of these must be connected to Πt ’s utility node. But Πt−1 did not feature these variables at all, and so the number of maximally conservative and minimal updates that satisfy this connectedness is hyperexponential in the size of N . Thus, an expert utterance with many neologisms undermines the efficiency and incrementality of learning. We avoid this complexity by restricting all expert signals to containing at most one neologism. Specifically, the expert must have conclusive evidence that the agent is aware of all but one of the random variables that feature in her signal σ. The expert knows the agent is aware of a variable X if: (a) X has already been mentioned in the dialogue, either by her or by the agent; or (b) X is an action variable and the agent has performed its positive value x (recall that inadvertent action is not possible): Ce Ae + = {X ∈ C+ | ∃σi ∈ D0:t : X ∈ σi } + = {X ∈ A+ | ∃σi ∈ D0:t : X ∈ σi or ∃τi ∈ Sample + 0:t : x ∈ τi } 10 (6) Here, Ce and Ae respectively are the set of chance and action variables that the expert knows the agent is aware of. The following principle, which we refer to as 1N, applies to all the expert’s signals: At Most One Neologism (1N): Each expert signal σ features at most one variable from (A+ ∪ C+ ) \ (Ae ∪ Ce ) (i.e., at most one neologism). Furthermore, if σ features such a variable X, then σ declares its type: i.e., σ includes the conjunct X ∈ B+ , X ∈ O+ or X ∈ A+ , as appropriate. The expert uses an ambiguous term wtb to comply with Cooperativity and 1N in contexts where, without wtb , she would be unable express any advice. For instance, assume that the expert’s knowledge of the agent’s “before” vocabulary is given by Be . The expert would typically be unable to express that, given bt ∈ v(B+ ), the agent should have performed an alternative action a0 to the action at that the agent actually performed—by 1N, she cannot use the vector b+ t ∈ v(B+ ) in her signal if |B+ | − |Be | > 1. + If instead she were to use the vector bet , where bet = b+ t  Be (i.e., bt projected onto Be ), then the resulting statement (7) may be false (and so violate Cooperativity), because these expected utilities marginalise over all possible values of B+ \ Be , rather than using their actual values: EU (a0 |bet ) > EU (at |bet ) (7) Alternatively, by replacing bet in the signal (7) with the ambiguous term wtb , her intended message becomes hidden but it abides by both Cooperativity and 1N. The expert’s dialogue policy is to answer all the agent’s queries as and when they arise, and to occasionally offer unsolicited advice about a better action. She does the latter when two conditions hold: (i) The agent has been behaving sufficiently poorly to justify the need for advice (ii) The current context is one where she can express a better option while abiding by Cooperativity and 1N. Condition (i) is defined via two parameters γ and β: in words, the last piece of advice was offered greater than γ time steps ago, and from then until now, the fraction of suboptimal actions taken by the agent is greater than β. This is formalised in equation (8), where t0 is the time of the last advice and a+,∗ is the optimal action given dn+ i and b+ . In the experiments in Section 5, we vary γ and β to test how changing the i expert’s penchant for offering unsolicited advice affects the learning agent’s convergence on optimal policies. Condition (ii) for giving advice is satisfied when the observed reward rt is no higher than the expected payoff from the agent’s action a+ t (equation (9)), and there is an alternative action a0 with a higher expected payoff, which can be expressed while complying with Cooperativity and 1N (equation (10)). |t − t0 | > γ ∧ +,∗ + + + 0 |{a+ i : t ≤ i ≤ t and EU (ai |bi ) < EU (ai |bi )}| >β |t − t0 | + EU (a+ t |bt ) ≥ rt + + ∃A∃a0 (a0 ∈ v(Ae ∪ {A}) ∧ EU (a0 |b+ t ) ≥ EU (at  (Ae ∪ {A})|bt )) 11 (8) (9) (10) When the context satisfies these conditions, then there are witness constants A and a0 that satisfy (10). These constants are used to articulate the advice: the expert utters (11), where at is the expression formed by projecting the vector a+ t ∈ v(A+ ) onto Ae ∪ {A}. EU (a0 |wtb ) > EU (at |wtb ) (11) In our Barley example, the message (11) might be paraphrased as: in the current circumstances, it would have been better to apply pesticide and not use fertiliser than to not apply pesticide and use fertiliser. The agent’s default interpretation of (11) is (12), where bt ∈ v(Bt ): X X P r(s|a0 , bt )R+ (s) ≥ P r(s|at , bt )R+ (s) (12) s∈Ct ×At s∈Ct ×At So hexpert, (11), (12)i is added to D0:t . While the intended message of (11) is true (because (10) is true), (12) may be false, and so no monotonic entailments about probabilities can be drawn from it. For example, in our Barley example, suppose that the agent’s current model of the domain is Figure 1b, and the agent has observed soil type n and precipitation c. Then the agent’s defeasible interpretation of the expert’s advice is that it would have been better to apply pesticide (p) and not use fertiliser (¬f ) (than to not apply pesticide and use fertiliser) in any state where n ∧ c is true (note that relative to the dn shown in Figure 1b, the expert mentioning applying pesticide leads it to discover this entirely new action): X X P r(s|p, ¬f, n, c)R+ (s) ≥ P r(s|¬p, f, n, c)R+ (s) (13) s∈Ct ×At s∈Ct ×At But this (defeasible) interpretation could be false: the expert’s (true) intended message may have been that p ∧ ¬f is better in a much more specific situation: one where not only is n ∧ c true, but also the local concern is low and the insect prevalence is high (in other words, the probabilities in (13) should have been conditioned on ¬l and i as well). However, (11) and the mutually known dialogue policy monotonically entails (14), whatever the true referent for wtb might be. ∃s((s → (a0 ∧ bt )) ∧ R+ (s) > rt ) (14) So (14) is added to δ0:t , and for dnt to be valid it must satisfy it; similarly for A ∈ A+ .3 In our example, the agent adds (15) to δ0:t : ∃s((s → (p ∧ ¬f ∧ n ∧ c)) ∧ R+ (s) > rt ) (15) Thus the expert’s unsolicited advice can result in the agent discovering an unforeseen action term A (in this case, adding pesticide) and/or prompt a revision to the reward function Rt , which in turn may reveal to the agent that its conceptualisation of the domain is deficient (just as (5) may do). 3 Our learning algorithms in Section 4 do not exploit the (defeasible) information about likelihood that is expressed in (12); that is a matter for future work. 12 domain evidence estimate Ct , At , no estimate Πt unknown effects? no estimate θt no ΠtR , Rt unforeseen rewards? misunderstanding? yes yes ask ask (17) (18) dialogue evidence yes ask (16) Figure 2: Information flow when updating a dn with the latest evidence. Diamonds are tests and rectangles are processes. 3.2.2. The agent’s dialogue strategy The agent aims to minimise the expert’s effort during the learning process, and so asks a question only when dn update fails to discriminate among a large number of dns. In this paper, we identify three such contexts (as shown in Figure 2): (i) Misunderstandings; (ii) Unforeseen Rewards; and (iii) Unknown Effects. We now describe each of these in turn. Misunderstandings. The agent checks whether the (default) interpretation of the current signal is consistent with those of prior signals; when they are inconsistent, the agent knows there has been a misunderstanding (because of Cooperativity). For instance, suppose Bt = ∅—so the agent assumes [[wib ]] = > for all i  t—and the expert advised b b ) and EU (a0 |wtb ) > EU (a|wtb ). The agent’s default interpreEU (a|wt−n ) > EU (a0 |wt−n tations of these signals fails the consistency test. Thus the agent infers that it is unaware of a B variable, but does not know its name. If the agent were to guess what variable to add, then learning would need to support retracting it on the basis of subsequent evidence, or reason about when it is identical to some subsequent factor the agent becomes aware of. This is a major potential complexity in reasoning and learning. We avoid it by defining a dialogue strategy that ensures that the agent’s vocabulary is always a subset of the true vocabulary. Here, that means the agent asks the expert for the name of a B variable. In words, question (16) expresses: what is different about the state before I acted just now and the state before I acted n time steps ago?4 ?λV (V ∈ B+ ∧ value(V, t − n) 6= value(V, t)) (16) speaking, answers to this question are partial descriptions of the domain trials Sample + 0:t as well as dn+ . The formal details of this are straightforward but tedious, so we gloss over it here. 4 Strictly 13 This signal uses a standard representation for questions (Groenendijk and Stokhof, 1982): ? is an operator that maps a function to a set of propositions (the true answers), and the function’s arguments correspond to the wh-elements of the question (which, what etc). Its semantics, given in the Appendix, follows (Asher and Lascarides, 2003): a proposition is a true answer if and only if it substitutes specific individual(s) for the λ-term(s) to create a true proposition—so “something” is not an answer but “nothing” is an answer, corresponding to the empty set. An answer can thus be non-exhaustive—it needn’t include all the referents that satisfy the body of the λ-expression. The agent’s policy for when to ask (16) guarantees that it has a true positive answer. By the 1N rule, the expert’s answer includes one variable, chosen at random if there is a choice. E.g., she answers with the signal X ∈ B+ ; so X ∈ B+ is added to δ0:t . In our barley example, the answer might be, for instance, “the temperature was high”, where the concept “temperature” is a neologism to the learning agent. The agent now knows that its default interpretations of prior signals that feature wib (i ≺ t) are incorrect—on learning X ∈ B+ , it now knows that these terms do not denote >. But the agent cannot observe the correct interpretation. Testing whether subsequent messages are consistent with prior messages would thus involve reasoning about past hidden values of X, which would be complex and fallible. For the sake of simplicity, we avoid it: if the agent discovers a new B-variable at time t, then she ceases to test whether subsequent messages µt+m are consistent with past ones µt−m0 (m, m0 ≥ 0). In effect, the agent “forgets” past signals and their (default) interpretations, but does not forget their monotonic consequences, which are retained in δ0:t . Unforeseen rewards. The current reward function’s domain, ΠtR , may be too small to be valid (see Sections 2 and 3.1). If the agent were to guess what variable to add to ΠtR , then learning would need to support retracting it on the basis of subsequent evidence—this is again a major potential complexity in reasoning and learning. Instead, when the agent infers ΠtR is too small (we define how the agent infers this in Section 4), the agent seeks monotonic evidence for fixing it by asking the expert (17): ^ ?λV (V ∈ Π+ V 6= X) R (17) t X∈ΠR For instance, in the barley domain, this question could express something like “Other than having a high yield and high protein crops, what else do I care about?” to which the answer might be “You care about bad publicity”. This is a true (non-exhaustive) answer, even though the agent (also) cares about avoiding outbreaks of fungus. Non-exhaustive answers enable the expert to answer the query while abiding by Cooperativity and the 1N rule. But they also generate a choice on which answer to give. The expert’s choice is driven by a desire to be informative: she includes in her answer + all variables in Π+ R that she knows the agent is aware of (i.e., the variables Y ∈ Ce ∩ ΠR ) + and one potential neologism (i.e., X ∈ (C+ \ Ce ) ∩ ΠR ) if it exists, with priority given to a variable whose value is different in the latest trial τt from a prior trial τt0 that had the same values as τt on all the variables mentioned in the query (17) but a different reward. If her answer includes a potential neologism, then by 1N she declares its type. For example, let Πt−1 = {O1 , O2 } and Π+ R R = {O1 , O2 , O3 , O4 , O5 }. Suppose that O3 ∈ Ce but O4 , O5 6∈ Ce . Now suppose that the latest trial τt entails o1 , ¬o2 and reward 14 of 1, but a prior trial entails o1 , ¬o2 and a reward of 0.5. Then even if O3 has different values in these trials, the agent does not infer (defeasibly) that O3 ∈ Π+ R . Rather, she asks (17): i.e., ?λV (V ∈ Π+ ∧ V = 6 O ∧ V = 6 O ). The expert’s answer includes O3 because 1 2 R O3 ∈ Ce ∩Π+ . In addition, she can mention either O or O , but not both (because of 1N). 4 5 R Suppose that τt entails o4 and a prior trial with a different reward entails o1 ∧ ¬o2 ∧ ¬o4 . + However, O5 lacks this property. Then her answer is: O3 ∈ Π+ R ∧ O4 ∈ ΠR ∧ O4 ∈ O+ . b The ambiguous term wt is not a part of the expert’s answer, and so the message is observable—indeed, it is the same as the signal. This becomes a conjunct in δ0:t , and so in our example, for dnt to be valid it must satisfy O4 ∈ ΠtR and O4 ∈ Ot (and so ΠtR ⊃ Πt−1 and if O4 truly was a neologism to the agent then Ot ⊃ Ot−1 as well). R Section 4 defines how to estimate a valid dnt from this evidence. Unknown Effects. There are contexts where the search space of possible causal structures remains very large in spite of the defeasible principles for restricting it, in which case the agent asks a question whose answer will help to restrict the search space: ?λV (X ∈ ΠV ) (18) In words, what does X affect? For instance, in the barley domain, it might express: What does the temperature affect? (to which an answer might be the risk of weeds). In Section 4 we will define precisely the contexts in which the agent asks this question, including which variable X it asks about. The expert’s answer X ∈ Π+ Y gives priority to a variable Y that she believes the agent is unaware of. This increases the chances that the agent will learn potentially valuable information about the hypothesis space. + The expert’s answer X ∈ Π+ Y has an observable interpretation; X ∈ ΠY is added to δ0:t and since dnt |= δ0:t , X ∈ ΠtY . Thus some dependencies in Πt are inferred monotonically via observable expert messages. Others are inferred defeasibly via statistical pattern recognition in the domain trials (see Section 4). 4. The Model for Learning We now define dn update in a way that meets the criteria from Section 2. We must estimate all components of the dn from the latest evidence et , in a way that satisfies the partial description δ0:t that has accumulated so far (this is required to make the dn valid). That is, one must estimate the set of random variables Ct and At , the domain ΠtR ⊆ Ct of the reward function as well as the function Rt itself, the dependencies Πt among Ct ∪ At , and the conditional probability tables (cpts) θt , given Πt . These components are estimated from the prior dn dnt−1 , the latest evidence et and the partial description δ0:t in the following order, as shown in Figure 2: 1. (a) Estimate Bt , Ot , At and ΠtR ; (b) Estimate Rt , given ΠtR ; 2. (a) Estimate Πt , given Bt ∪ Ot ∪ At and ΠtR ; (b) Estimate θt , given Πt . 15 Step 1 proceeds via constraint solving (see Section 4.1); step 2 via a combination of symbolic and statistical inference (see Section 4.2). Update proceeds in this order because the set of dependencies one must deliberate over depends on the set of random variables it is defined over, and the global constraint on dependencies—namely, that the utility node is a descendant of all nodes in the dn—must be defined in terms of the domain ΠtR of the reward function. Likewise, the set of cpts θt that one must estimate is defined by the dependency structure Πt . The search for a valid dn can prompt backtracking, however: e.g., failure to derive a valid dependency structure Πt may ultimately lead to a re-estimate of the set of random variables Bt ∪ Ot ∪ At . We now proceed to describe in detail each of these components of dn update. 4.1. Random Variables and Reward Function The first step in dn update is to identify dnt ’s random variables—that is, the sets Bt , Ot and At —and the reward function Rt . This is achieved via constraint solving, with the constraints provided by δ0:t . The number of valid vocabularies is always unbounded, because any superset of a valid vocabulary is valid. As motivated in Section 2, we make search tractable via greedy search for a minimal valid vocabulary: the agent (defeasibly) infers the vocabulary in (19a–c) (this covers all the variables the agent is aware of thanks to the dialogue strategy from Section 3.2), and also defeasibly infers the minimal domain for Rt , defined in (19d). Bt ={X : X ∈ B+ is a conjunct in δ0:t } (19a) At ={X : X ∈ A+ is a conjunct in δ0:t } (19b) Ot ={X : X ∈ O+ is a conjunct in δ0:t } (19c) ΠtR ={X : X ∈ Π+ R is a conjunct in δ0:t } (19d) The evidence described in Section 3 yields three kinds of formulae in δ0:t that (partially) describe R+ : (5), (14), and X ∈ Π+ R . The agent uses constraint solving to find, or fail to find, a reward function Rt that satisfies all conjuncts in δ0:t of the form (5) and (14), plus the constraint (20), which will ensure Rt is well-defined with respect to its (estimated) domain (19d). ∀s1 ∀s2 ((s1  ΠtR ↔ s2  ΠtR ) → Rt (s1 ) = Rt (s2 )) (20) Constraints of the form (5) and (14) are skolemized and fed into an off-the-shelf constraint solver (with R+ replaced with Rt ). The possible denotations of these skolem constants are the atomic states defined by the vocabulary (19a–c). If there is a solution, the constraint solver returns for each skolem constant a specific denotation x ∈ v(Ct ×At ). Substituting the skolem terms with their denotations projected onto ΠtR yields equalities Rt (y) = r (from (5)) and inequalities Rt (y) > r (from (14)), where y ∈ v(ΠtR ). A complete function Rt is constructed from this partial function by defaulting to indifference (recall Minimality): for any y ∈ v(ΠtR ) where there is an inequality Rt (y) > r but no equality Rt (y) = r, we set Rt (y) = r + c for some constant c (in our experiments, c = 0.1); for any y ∈ v(ΠtR ) for which there are no equalities or inequalities, we set Rt (y) = 0. 16 The constraint solver may yield no solution: i.e., there is no function Rt with the currently estimated domain (19d) satisfying all observed evidence about states and their rewards. This is the context “unforeseen rewards” described in Section 3.2 (see also Figure 2): the agent asks (17), deferring dn update until it receives the expert’s answer. The expert’s answer is guaranteed to provide a new variable to add to ΠtR . It may also be a neologism—a variable the agent was unaware of—and so after updating δ0:t with the expert’s answer, the agent backtracks to re-compute (19a–d). 4.2. Estimating hΠt , θt i Current approaches to incrementally learning Π in a graphical model of belief exploit local inference to make the task tractable. There are essentially two forms of local inference. The first is a greedy local search over a full structure: remove an edge from the current dag or add an edge that does not create a cycle, then test whether the result has a higher likelihood given the evidence (e.g., Bramley et al. (2015); Friedman and Goldszmidt (1997)). This is Conservative: Π changes only when evidence justifies it. However, adapting it to our task is problematic. Firstly, such techniques rely heavily on a decent initial dag to avoid getting stuck in a local maximum; but in our task the agent’s initial unawareness of the possibilities makes an initial decent dag highly unlikely. Secondly, removing an edge can break the global constraint on dns that all nodes connect to the utility node. We would need to add a third option of doing local search given Π: replace one edge in Π with another edge somewhere else. This additional option expands the search space considerably. We therefore adopt the alternative form of local inference: assume conditional independence among parent sets. Buntine (1991) assumes that X’s parent set is conditionally independent of Y ’s given evidence e0:t and the total temporal order  over the random variables—X  Y means that X may be a parent to Y but not vice versa. This independence assumption on its own is not sufficient for making reasoning tractable, however. If a Bayes Net has 21 variables (as the ones we experiment with in Section 5 do), then a variable may have 220 possible parent sets—a search space that is too large to be manageable. So Buntine (1991) prunes X’s possible parent sets to those that evidence so far makes reasonably likely (we will define “reasonably likely” in a precise way shortly). There are then two alternative ways of updating: • Parameter Update: Estimate the posterior probability of a parent set from its prior probability and the latest evidence under an assumption that the set of reasonable parent sets does not change. • Structural Update: Review and potentially revise which parent sets are reasonable, given a batch of evidence. (Thus, Structural Update changes the set of possible structures which are considered). We adapt Buntine’s model to our task in two ways. Firstly, Buntine’s model assumes that the total ordering on variables is known. In our task the total order is hidden, and marginalising over all possible temporal orders is not tractable—it is exponential on the size of the vocabulary. We therefore make an even stronger initial independence assumption than Buntine when deciding which parent sets are reasonable: Specifically, 17 that X’s parent set is conditionally independent of Y ’s given evidence e0:t alone. Unfortunately, this allows combinations of parent sets with non-zero probabilities to be cyclic. We therefore have an additional step where we greedily search over the space of total orderings (similar to (Friedman and Koller, 2003)), and use Integer Linear Programming (Vanderbei, 2015) at each step to find a “most likely” causal structure Πt which both obeys the currently proposed ordering and that is also a valid dn—in particular, it is a dag where the utility node is a descendant of all other nodes. Secondly, as the agent’s vocabulary of random variables expands, we need to provide new probability distributions over the larger set of possible parent sets, which in turn will get updated by subsequent evidence. We now describe each of these components of the model in turn. 4.2.1. Parameter Update Each variable V ∈ Ct is associated with a set Pv of reasonable parent sets. Each parent set Πv ∈ Pv is some combination of variables from Ct ∪ At . Parameter Update determines the posterior distribution over Pv given its prior distribution and the latest piece of evidence under the assumption that the possible values of Pv do not change. Updates from Domain Trials. Suppose that the latest evidence et is a domain trial (i.e., τt ∈ Sample 0:t ). Parameter Update uses Dirichlet distributions to support incremental learning: if τt  V = i and τt  Πv = j, then we can calculate the posterior probability of Πv in a single step using (21): (n +α −1) v=i|j P r(Πv |e0:t ) = P r(Πv |e0:t−1 ) (nv=i|j v=.|j +αv=.|j −1) (21) Here, nv=i|j is the number of trials in Sample 0:t where V = i and Πv = j, and αv=i|j is a “pseudo-count” which represents the Dirichlet parameter for V = i and Πv = j. The sum of all trials where Πv = j is given by nv=.|j . Formula (21) follows from the recursive structure of the Γ function in the Dirichlet distribution (the Appendix provides a derivation, which corrects an error in (Buntine, 1991)). Estimating θt , given Πt , likewise exploits the Dirichlet distribution (Buntine, 1991, p56): R θ P r(Sample|Π, θ)P r(θ|Π) θ Rv=i|j Eθ|Sample 0:t ,Π (θv=i|j ) = P r(Sample|Π, θ)P r(θ|Π) θ (22) nx=i|j + αv=i|j = nv=.|j + αv=.|j In words, (22) computes the conditional probability tables (cpts) directly from the counts in the trials and the appropriate Dirichlet parameters, which in turn quantify the extent to which one should trust the counts in the domain trials for estimating likelihoods—the higher the value of the αs relative to the ns, the less the counts influence the probabilities. Note that the α-parameters vary across the values of the variables and their (potential) parent sets. We motivate this shortly, when we describe how to perform dn update when a new random variable needs to be added to it. At the start of the learning process, αv=i|j = 0.5 for all V , i and j. 18 Updates from Expert Evidence. Now suppose et is an expert utterance σt , but not one that introduces a neologism (we discuss dn update over an expanded vocabulary at the end of this section). Then Parameter Update starts by using ∧-elimination on δt (i.e., the partial description of dn+ that σt entails) to infer a conjunction πt,v of all conjuncts in δ0:t of the form X ∈ Πv . Note that δt does not contain conjuncts of the form X 6∈ Πv (see Section 3.2), although it may entail such formulae (e.g., from conjuncts declaring a variable’s type). Formula (23) then computes a posterior distribution over Pv , where η is a normalising factor:  ηP r(Πv |e0:t−1 ) if Πv ` πt,v P r(Πv |e0:t ) = (23) 0 otherwise Equation (23) is Conservative—it preserves the relative likelihood of parent sets that are consistent with πt,v . It offers a way to rapidly and incrementally update the probability distribution over Pv with at least some of the information that is revealed by the latest expert evidence. Enforcing global constraints on Π. Equations (21) and (23) on their own do not comply with Satisfaction nor even with Consistency. If we naively construct the “most likely” global structure by simply picking the highest probability parent set Πv for each variable V independently, their combination might be cyclic, or violate information about parenthood entailed by δ0:t . To find a global structure which is valid as well as likely, we combine ILP techniques with a greedy local search over the space of total orderings. We first compute P r(Pv |e0:t , ) from P r(Pv |e0:t ), where  is a total temporal order over dnt ’s random variables that satisfies the partial order entailed by δ0:t . Next, we use ILP techniques to determine the most likely structure Πm  which obeys the current ordering , and is a dag with all nodes connected to the utility node. We stop searching when all valid total orders 0 formed via a local change to  yield a less likely structure m 0 m (i.e., P r(Πm 0 |e0:t ,  ) ≤ P r(Π |e0:t , )), and return Π as Πt . We now describe these steps in detail. The partial description δ0:t imposes a partial order on the random variables, thanks to the expert’s declarations of the form X ∈ ΠY (this corresponds to condition (i) in Fact 1), its entailments about each variable’s type (i.e., At , Bt or Ot ), which are in effect constraints on the relative position of variables within the dag (conditions (ii)–(iv) in Fact 1); and information about whether a variable is an immediate parent to the utility node (condition (v)): Fact 1. Total orders that satisfy δ0:t A total order  of random variables satisfies the partial order entailed by δ0:t iff it satisfies the following 5 conditions: (i) If δ0:t |= X ∈ Πy , then X  Y ; (ii) If δ0:t |= A ∈ A+ then X 6 A for any X, and A 6 Y for any Y where δ0:t |= Y ∈ Bt ; (iii) If δ0:t |= O ∈ O+ then there is a variable X where δ0:t |= X ∈ A+ and X  O; (iv) If δ0:t |= B ∈ B+ ∧ O ∈ O+ then B  O; and 19 + (v) for any X, Y , if δ0:t |= X ∈ Π+ R and δ0:t 6|= Y ∈ ΠR , then Y  X. Note that thanks to dn0 and the dialogue strategies, where Φ is B+ , O+ , A+ , Π+ R or Πy , one can test whether δ0:t |= X ∈ Φ via ∧-elimination. The agent starts by choosing (at random) a total order  that satisfies Fact 1. The agent then uses (24) to estimate the probabilities over direct parenthood relations (pa(X, Y ) means X is a parent to Y ) given the evidence and :  P Πy ∈Py :X∈Πy P r(Πy |e0:t ) if X  Y (24) P r(pa(X, Y )|e0:t , ) = 0 if Y  X Thanks to Fact 1 this makes any combination of non-zero probability parenthood relations a dag with no B-variable being a descendant to an A variable, and all A variables have no parents. But it does not guarantee that all nodes are connected to the utility node. We use an ILP step to impose this global constraint. The result is a valid structure Π (i.e., it satisfies δ0:t ) that evidence so far also deems to be likely (we give an outline proof of its validity on page 25). The ILP Step is formally defined as follows: Decision variables: Where X, Y ∈ Ct ∪ At , pa(X, Y ) is a Boolean variable with value 1 if X is a parent of Y (i.e., X ∈ Πy ), and 0 otherwise Objective Function: We want to find the most likely combination of valid parenthood relations: i.e., we want to solve (25): X max P r(pa(X, Y ))∗pa(X, Y )+(1−P r(pa(X, Y )))∗(1−pa(X, Y )) (25) X,Y ∈Ct ∪At Constraints: C1 ensures three things: (i) variables cannot have a parent which is not present in at least one of the reasonable parent sets (see (24)); (ii) parent sets obey all expert declarations of the form Z ∈ Πz0 (by equation (23)); and (iii) parents obey the currently proposed temporal ordering  (by equation (24)) thereby guaranteeing that the final graph is acyclic with no B variable being a descendant of A and all A variables are orphans. Constraints C2 and C3 ensure that the final graph satisfies the necessary global conditions for being a dn, namely that every variable is in some way connected to the utility node, and that every outcome variable has at least one action ancestor. C4 ensures that the decision variables take on binary values (0 or 1). C1 : C2 : C3 : C4 : ∀X, Y.(P r(pa(X, Y )) = 0 =⇒ pa(X, Y ) = 0) P ∀X ∈ / ΠtR .( y pa(X, Y ) ≥ 1) P ∀O ∈ O.( y∈O∪A pa(Y, O) ≥ 1) ∀X, Y.pa(X, Y ) ∈ {0, 1} Disallow impossible parents One child minimum No orphaned outcomes Binary Restriction Linear Relaxation of the ILP Step. Finding the solution to a Linear Program where all decision variables must be integers is an NP-hard problem. So we approximate the solution via Linear Relaxation: we replace C4 with (26), so that the values of decision variables can be real numbers: ∀X, Y.pa(X, Y ) ∈ [0, 1] 20 (26) We then round the resulting values to integers. This reduces the time needed to compute a solution, but one must be careful in the rounding procedure: simply rounding each pa∗ (X, Y ) to its nearest integer may create an inconsistent dn. Rounding in two phases avoids this. In the first phase, we produce a set of rounded decision variables pa0 (X, Y ) that satisfy C1 and C2:  1 if pa∗ (X, Y ) ≥ 0.5 ∨ (X ∈ / ΠtR ∧ ∀Z 6= Y.(pa∗ (X, Y ) ≥ pa∗ (X, Z))) 0 pa (X, Y ) = 0 otherwise In the second phase, we ensure that constraint C3 is also satisfied, producing the final integer values for all the variables pa(X, Y ): pa(X, Y ) = 1 iff pa0 (X, Y ) = 1 ∨ (Y ∈ O∧ ∀Z((Z 6= X ∧ Z ∈ O ∪ A) → (pa0 (Z, Y ) = 0 ∧ P r(pa(X, Y )) > P r(pa(Z, Y ))))) Because the random variable Pv does not contain all possible parent sets to V (so as to keep learning tractable), it is possible that there is in fact no solution to the ILP step for any valid temporal order . This is a context in which the agent performs a Structural Update, which in turn changes the variables that satisfy the antecedent to constraint C1. 4.2.2. Structural Update To make learning tractable, Pv includes only reasonable parent sets to V —a strict subset of those that are possible. But as evidence changes, so does what is reasonably likely. Therefore, the agent occasionally performs a Structural Update: the full batch of evidence e0:t is used to review and potentially revise the possible values of Pv and its probability distribution. Figure 3 depicts the structure of the algorithm that corresponds roughly to the nodes “estimate Πt ” and “estimate θt ” in Figure 2. In particular, it depicts the four contexts in which Structural Update is performed in our experiments in Section 5: 1. There have been 100 domain trials since last structural update 2. The agent has just discovered an unforeseen factor 3. The latest dialogue evidence σt yields a 0 probability to all parent sets in Pv via equation (23) 4. The algorithm for enforcing global constraints on Π fails to produce any valid structure The input to Structural Update consists of a (chance) variable V , the batch of evidence e0:t , the prior distribution P rt−n (Πv ) over all possible parent sets to V (where t − n is the time of the previous structural update), and the current partial description δ0:t of the dn. Its output is a (perhaps new) set of values for Pv (i.e., those parent sets to V that are currently deemed “reasonable”), the posterior probability P rt (Πv ) for each possible parent set Πv (whether it is in Pv or not) and the posterior probability distribution P rt (Pv ) (which is computed by normalising P rt (Πv ) for Πv ∈ Pv ). Informally, 21 > 100 trials? no s ye Re-compute priors yes Structural Neologism? Update no Enforce yes Parameter Global Update Constraints P r(Πv ) = 0 no success? no C ← C ∗ 0.1 ∀Πv ∈ Pv ? ye s no Return Πt Enforce yes Global Constraints Return θt (see (22)) success? Figure 3: Algorithm for Estimating hΠt , θt i. the Structural Update algorithm dynamically constructs a parent lattice Ltv , with each node corresponding to a parent set to V and arcs corresponding to the superset relation. When expanding the lattice by adding a new node, we estimate its posterior probability given the evidence e0:t . We stop expanding the lattice when all its leaves have a posterior probability that is below a certain threshold. Thus Minimality is implicit: Structural Update assumes that supersets of sufficiently improbable parent sets will not improve their probability. More formally, the root(s) of the parent lattice Ltv are the minimal valid parent sets: i.e., they contain X if δ0:t |= X ∈ Πv , and if δ0:t |= V ∈ Ot then Ltv ’s root(s) each contain at least one variable from At ∪ Ot . For each root Πv , one computes its posterior probability, given the evidence e0:t . If a node was alive in the previous Structural Update, then this posterior probability is already calculated via the sequence of Parameter Updates that were performed between the previous and current structural updates. It is therefore immediately available. If the node was marked as asleep in the previous lattice, however, then the node’s posterior probability will not have been updated with the intervening domain trials—it is computed now by performing a sequence of Parameter Updates (see 22 equation (21)). The highest of these posterior probabilities is taken to be the Best-Posterior. One then marks the nodes as alive if its posterior probability is ≥ C ∗ Best-Posterior for some constant C (in the experiments in Section 5, C = 0.001), and asleep otherwise. You then create a new node in the lattice by adding a variable to an alive leaf node. You compute its posterior probability, and if it exceeds the current Best-Posterior, then you update Best-Posterior and re-classify which nodes in the lattice are alive and which are asleep accordingly. You stop when all the leaves in the current lattice are asleep. The set Pv is defined to be all the alive parent sets in Ltv and their ancestors in Ltv .5 Having (re-)estimated Pv for each variable V , you test whether each variable X 6∈ ΠtR is in at least one reasonable parent set: if it is not then there is clearly no valid Π that one can generate from them (since X will not connect to the utility node). This test failing is the context “Unknown Effects” in the agent’s dialogue strategy, which we described in Section 3.2.2: i.e., instead of expanding the search space by reducing the asleep threshold C, the agent seeks further evidence by asking the expert (18): what is an effect of X? The evidence e0:t and partial description δ0:t get updated with the expert’s answer, and dn update begins again—backtracking to estimating the random variables via (19a–c) may be necessary because the expert’s answer may be a neologism. The experiments in Section 5 show that this querying strategy keeps a tight reign on the size of the search space, while still ensuring that many of the dependencies in Πt are inferred defeasibly from the domain trials, rather than monotonically from explicit expert declarations about parenthood. The posterior probabilities that are computed during the lattice expansion are assumed to be the posterior probabilities P rt (Πv |Ltv )—the probability that Πv is Π+ v, t t t given that Π+ ∈ L (if Π ∈ 6 L , then P r (Π |L ) = 0). The posterior probabilities v t v v v v v on every possible parent structure is then defined by (27) to (29), where P r(Ltv ) is the t probability that the true parent set Π+ v is in Lv , and p is the probability mass we wish to assign to the unexplored space: P rt (Πv ) = P rt (Ltv )P rt (Πv |Ltv ) + P rt (¬Ltv )P rt (Πv |¬Ltv )   0 if Πv ∈ Ltv t 1 P rt (Πv |¬Lv ) = if Πv 6∈ Ltv  |Ct ∪At \V | 2 − |Ltv | P rt (¬Lv ) = p P rt (Lv ) = 1 − P rt (¬Lv ) (27) (28) (29) Thus Structural Update returns for each chance variable V the values Pv , P rt (Pv ) and P rt (Πv ) for all possible parent sets Πv . But the algorithm does not require the agent 5 This contrasts with Buntine’s Structural Update, in which Pv is the alive parent sets only. We include asleep subsets of alive parent sets because our version of Parameter Update abstracts over all possible total temporal orders of the variables. To illustrate the issue, suppose that there is a very strong statistical correlation in the domain trials between X and Y —so strong that the only alive parent set for Px is {Y }, and the only alive parent set for Py is {X}. If Px = {{Y }} and Py = {{X}}, then these generate no consistent structure. But if Pv includes all subsets of alive parent sets, then we avoid this problem: ∅ will be a possible value of Px and of Py , even though Parameter Update deems ∅ to be an unlikely parent set for X and for Y . 23 to enumerate or reason about parent sets within the unexplored space. These become relevant only if in the next Structural Update, the agent expands the parent lattice to include a parent set that was absent from the prior lattice. The process for estimating Πt concludes, as always, by applying the algorithm for enforcing global constraints that we described earlier (see Figure 3). If this succeeds, it returns Πt , and from this one computes θt via (22). If not, then the agent reduces the asleep threshold (by multiplying C by 0.1) and attempts Structural Update again. 4.2.3. Initial Distribution We implicitly encode the defeasible principle of Minimality in our initial distribution over parent sets by making larger parent sets less likely than smaller ones. The agent starts with a small probability ρ that Y is a parent to X (provided this is consistent with the variables’ types as stipulated in δ0 ). The probability of a parent set Πx is then the product of each individual parent’s presence or absence:  0 if δ0 |= ¬pa(Y, X) P r0 (pa(Y, X)) ∝ (30) ρ otherwise Y Y P r(Πx ) = P r(pa(Y, X)) (1 − P r(pa(Z, X))) (31) Y ∈ΠX Z6∈ΠX For each X ∈ C0 , the agent uses (30), (31) and Structural Update to dynamically construct the set Px0 of reasonable parent sets of X and its initial probability distribution. 4.2.4. Updating with Evidence containing a Neologism Suppose the latest evidence et is an expert utterance σt that features a neologism Z. Then by (19a–c), Z is a random variable in dnt but it was not a part of dnt−1 . This means that the prior distributions over the possible parent sets no longer cover all possible parent sets! These must be updated to take account of the extra possibilities afforded by the addition of Z, and to ensure that the definitions we have given so far for calculating posterior distributions from evidence (e.g., equation (21)) remain welldefined. In addition, the agent cannot observe Z’s past values in Sample 0:t —i.e., it cannot observe nz=i|j , nor nv=i|j when Z ∈ Πv . However, we need these counts for Parameter Update (see (21)) and estimating θt (see (22)). The Dirichlet α-parameters in (21) and (22) that involve Z are also not defined. We now describe how the agent revises all these parameters, so as to ensure that (21) and (22) remain well defined and continue to support probabilistic reasoning over the newly expanded hypothesis space. We start by defining how the agent computes the probability distribution over the expanded set of possible parent sets. The agent starts this process by performing a Structural Update on the batch of evidence e0:t−1 that preceded the latest evidence et with the neologism Z. This ensures that the (small) probability mass p that is assigned to the set of “unreasonable” parent sets takes into account all evidence to date. This yields a revised (prior) probability distribution P r(Πx |e0:t−1 ) for every possible parent set Πx of X ∈ Ct that does not include the new variable Z. Equation (32) then assigns probabilities to all possible parent sets to X 6= Z, including parent sets containing Z:  if δ0:t |= ¬Πx  0 (1 − ρ)P r(Πx |e0:t−1 ) if Z 6∈ Πx P r(Πx |e0:t ) ∝ (32)  ρP r(Π0x |e0:t−1 ) if Πx = Π0x ∪ {Z} 24 This update is Conservative, because it preserves the relative likelihood among the parent sets that do not include Z—in particular, unreasonable parent sets remain unreasonable. It is also Minimal because it re-assigns only a small proportion ρ of the probability mass of a parent set that does not include Z to the parent set formed by adding Z to it—in particular, adding Z to an unreasonable parent set is unreasonable. As usual, the agent needn’t actively enumerate each possible parent set nor compute its probability; rather (32) is used to dynamically construct the lattice Ltx , from which the agent identifies the reasonable parent sets Pxt for X and Pxt ’s probability distribution, where the possibilities now include the additional variable Z. If Z is a chance variable, then equation (33) in combination with (31) defines P r(Πz |e0:t ) (if Z is an action variable, then ΠZ = ∅):  if δ0:t |= pa(Y, Z)  1 0 if δ0:t |= ¬pa(Y, Z) P r(pa(Y, Z)|e0:t ) = (33)  ρ otherwise This is Minimal because any variable being a parent to Z is assigned a low default probability ρ; so the dynamic lattice construction Ltz for identifying Pzt and its probability distribution will restrict search considerably. With Pv and its distribution for all V ∈ Ct in place, one applies the algorithm for enforcing global constraints to yield Πt . We now return to the issue of the counts nv=i|j , and the Dirichlet α-parameters. Our model avoids the computational complexity of marginalising over Z’s past values by throwing away the past domain trials Sample 0:t−1 and their counts nv=i|j , but retaining the relative likelihoods they gave rise to by packing these into updated values for the Dirichlet α-parameters, as shown in (34) (where K is a constant): Where Z ∈ dnt but Z 6∈ dnt−1 nv=i|j =  0 for all v, Πv K ∗ P rt−1 (V = i, Πv = j) αv=i|j = K ∗ 0.5 if V 6= Z and Z 6∈ Πv if V = Z or Z ∈ Πv (34) With the α-parameters and the counts nv=i|j now defined over the expanded set of atomic states, the agent can compute θt , given Πt and e0:t , using (22). Furthermore, it ensures that the equations (21) and (22) remain well-defined, should the dn get updated by subsequent observed evidence. Equation (34) makes the agent Conservative because when it observes subsequent evidence, the revised α-parameters ensure that the likelihoods inferred from the past domain trials bias the estimated likelihoods of Π and of θ that are based on that subsequent evidence (via equations (21) and (22) respectively). Indeed, the larger K is, the more Conservative you are: i.e., the more the probability distribution over dependencies and cpts before your set of random variables changed influences reasoning about dependencies and cpts after the set of random variables changes. 4.2.5. DN Update is Valid We have now defined how to use evidence to update each of the dn’s components. It meets the desiderata from Section 2. In particular: Fact 2. dn update complies with Consistency and Satisfaction: i.e., dnt is a consistent dn, and dnt |= δ0:t . 25 Outline proof. δ0:t contains three kinds of conjuncts: (i) X ∈ B+ , X ∈ A+ , X ∈ O+ , X ∈ Π+ R ; (ii) formulae of the form (5) and (14); and (iii) X ∈ Πy . Equations (19) together with the algorithm for enforcing global constraints guarantees that Πt satisfies all the conjuncts of type (i), including their consequences on each variable’s relative position in the causal structure Π+ . This is because Πt satisfies a total order  (see equation (24) and C1 in the ILP step), where by Fact 1  satisfies the partial order imposed by δ0:t —e.g., where δ0:t |= X ∈ B+ , Πtx ⊂ Bt . Rt is a consistent preference function because: (a) equation (20) makes Rt well-defined on its domain ΠtR ; and (b) since its range is R it defines an asymmetric and transitive relation. Further, since all conjuncts in δ0:t of form (ii) are constraints on R+ , it follows immediately that the constraint solver returns a reward function Rt that satisfies these. Equation (23) plus C1 in the ILP step guarantees that Πt entails conjuncts of type (iii). Furthermore, the algorithm for enforcing global constraints guarantees Πt is a dag with all nodes connected to the utility node: it is a dag because Πt satisfies a consistent total order ; and all nodes are connected to the utility node because of constraints C2 and C3 in the ILP Step. Finally, equation (22) guarantees that θt is a consistent probability distribution. Thus dnt is consistent, and dnt |= δ0:t .  5. Experiments Our experiments show that our agent can learn the optimal policy for a given task, even when initially unaware of factors that are critical to its success. Further, we show the usefulness of the defeasible principles our agent adheres to (such as Minimality and Conservativity) by comparing our agent with several variations which abandon those principles. We evaluate our agent against two different scenarios. In the first scenario, we have the agent learn in 10 randomly generated decision problems. By varying the true decision problem the agent must learn, these experiments evaluate whether the model’s ability to converge on optimal behaviour is robust to the type of domain it has to learn about. In the second scenario, we have the agent learn the hand-crafted “Barley” example from the introduction (see Figure 1). This experiment allows us to show how the model performs on a concrete example of our novel task which is explicitly designed to require the exploitation of unforeseen possibilities to be successful. Our primary metric is policy error (PE). Equation (35) defines P Et at time t as the weighted average of the expected difference in reward between the true optimal policy ∗ π+ and the agent’s perceived optimal policy πt∗ (observations b are projected onto the agent’s current conceptualisation of the domain to ensure πt∗ is defined): X   ∗ P Et = P r+ (b) EU+ (π+ (b)|b) − EU+ (πt∗ (b  Bt )|b) (35) b∈v(B+ ) We also measure the agent’s cumulative reward over the learning period: X Rt = ri (36) τi ∈Sample 0:t Additionally, we measure the runtime the agent takes to reason with the 3000 training samples. We do not measure the agent’s performance in terms of, for instance, the 26 minimum edit distance between dnt and dn+ , because the mapping from an optimal policy to its dn is one to many—for us, constructing a dn is merely the means for achieving optimal behaviour, and structural differences between dn+ and dnt may be benign in this respect. All experiments are run over 3000 training examples. However, we assume that each time the expert sends a message, the agent misses out on an opportunity to interact with the domain. This means that the more the expert intervenes, the fewer domain trials the agent gets rewards from. 5.1. Random dns: Setup In these experiments, we tested each agent variation against 10 different decision problems. Each true decision network dn+ consists of 21 Boolean variables: 7 action variables; 7 “before” variables; and 7 “outcome” variables (i.e., |A+ | = |B+ | = |O+ | = 7). This results in non-trivial decision problems with over 2 million atomic states. We generate both the structure and parameters for each dn+ randomly using an adapted version of the Bayesian network generation algorithm in (Ide et al., 2004).6 We also create a reward domain for each dn+ by choosing 5 chance variables at random, then generate a reward function which yields rewards in the range 0–50. We then assign an agent an initial conceptualisation dn0 of the decision problem; we test how unawareness affects learning by varying dn0 . To evaluate an agent’s performance in learning, we run 100 simulations, each consisting of the agent observing and learning from 3000 pieces of evidence (a mix of domain trials and expert messages). Running 100 simulations allows us to smooth over the fact that learning may be affected by the non-deterministic outcomes of the actions it performs. Our performance metrics then take the average over the 100 simulations. We evaluate and compare agents that vary along the following dimensions: Initial Awareness: We compare an agent which starts at dn0 with full knowledge of the (true) decision problem’s set of random variables against one which starts with just one action and outcome variable: Vocab Size at dn0 Min-Vocab Full-Vocab 2 21 Expert Tolerance: We vary the expert’s tolerance to the agent’s suboptimal behaviour when she deliberates over whether to offer unsolicited advice: this is achieved by varying β and γ in (8): Low-Tolerance Default-Tolerance β γ 0.001 0.9 1 50 6 Our adaptation adds additional rules to ensure the algorithm generates only valid dns. For example, the structure must conform to the rules of each variable’s type. 27 Minimality: An agent can be minimal, slightly minimal, or maximal. They vary on the following three dimensions: (i) adopting a greedy search for a minimal domain of R (see equation (19d)) vs. defining the domain of Rt to be all of Ct (i.e., the maximum possible domain, creating many more arrows in the graphical component of the dn); (ii) the prior probability ρ that is assigned to the parenthood relations (see equations (30) and (32)) can make parenthood (defeasibly) unlikely (ρ = 0.1) or equally likely as unlikely (ρ = 0.5); and (c) the asleep threshold C that prunes the search space to reasonable parent sets can result in pruning (C = 0.001) or not (C = 0). Minimal Slightly-minimal Maximal Minimal ΠtR ? ρ C yes yes no 0.1 0.5 0.5 0.001 0.001 0 Conservativity: An agent can be conservative or non-conservative. They vary on how they calculate the probability distribution over the expanded set of possible options when a new variable gets added to the dn. All agents set nv=i|j to 0 when it discovers a new variable. But the conservative and non-conservative agents vary on the how they re-set the probability distribution over dependencies and the Dirichlet α-parameters: Estimating P r(Πtv ) and P r(θt ) when adding a new variable Conservative Non-Con Use (32), (33), and (34) with K = 20 Use (30) and αn=i|j = α0 = 0.5 Domain Strategy: The agent’s domain-level strategy is to execute an optimal action vs. some other action in a ratio of (1 − ) : , and initially  = 0.3 (see Section 3.1). We vary how this strategy changes during learning as follows: (i)  does not change (Static); or (ii)  gets progressively reduced (Decay). Static Decay Initial  Decay factor (per time step) 0.3 0.3 1.0 0.999 Unless stated otherwise, the agents we evaluate are Min-Vocab, Minimal, Conservative and Static, and the expert has Default Tolerance. The baseline agent for our task adopts a standard -greedy strategy (with  set to 0.3) to learn an optimal policy from dn0 : it ignores observed evidence that makes dn0 invalid. So whatever the observed evidence, the baseline agent’s random variables C0 ∪A0 and dependencies Π0 do not change. All our other agents learn valid dns (see Fact 2). We compare the performance of the following nine agents on our task: the Baseline agent, Default (i.e., min-vocab, minimal, conservative, static, default tolerance), Low-Tolerance 28 Default Baseline Low-Tol Slightly-Min Decay Full-Vocab Non-Con Maximal P Et p-value 0.34 1.85 0.51 0.49 0.47 0.08 0.78 1.21 0.00 0.01 0.01 0.03 0.00 0.00 0.00 Default Baseline Low-Tol Slightly Min Decay Full-Vocab Non-Con Maximal P Et p-value 0.97 3.05 1.10 1.08 0.86 0.03 1.44 1.30 0.00 0.20 0.24 0.20 0.00 0.00 0.00 (b) dnworst + (a) dnbest + Table 1: Policy error (PE) for agents at t=3000. Average of 100 runs reported. (expert has low tolerance); Slightly-Min (agent is slightly minimal), Maximal (agent is maximal), Non-Con (agent is non-conservative), Decay (agent explores progressively less during learning), and Full-Vocab (the agent starts out aware of dn+ ’s vocabulary, but not its dependencies or reward function). In some of the 100 simulations, an agent that lacks the computational advantages of Minimality—a principle we argued would enhance tractability—crashes before it is observed and learned from 3000 pieces of evidence.7 In that case, the agent’s dn just before the crash occurred is used to compute the performance metric for that simulation. 5.2. Random dns: Results Across a variety of randomly generated dns, each with different dependencies, cpts, and reward domains, our agent converges to a near-optimal policy with a relatively small amount of data (3000 pieces of evidence). Tables 1 and 2 show the performance metrics for each agent in terms of final policy error (PE) and accumulated reward, respectively. Figure 4 also shows the rewards gained from the domain trials during learning (averaged across blocks of 150 domain trials and 100 simulations). We report numbers for the dn dnbest where the agent was most successful at achieving a low PE, and for dnworst where + + the agent was least successful, so as to give a measure of the lower and upper bounds of are in the Appendix.) The and dnworst the agent’s performance. (Full details on dnbest + + p-values compare each agent variation to the Default agent, and measure the probability of seeing a result of this magnitude (or greater) given the null hypothesis that the true average of both learning agents is identical. From these results we see that the Default agent significantly outperforms the Baseline agent, both in terms of final PE and total accumulated reward. Its PE is also significantly lower than the Maximal and Non-Conservative agents. We now discuss the various factors that affect learning. 7 We define a crash as an “Out of Memory” error on a Java Virtual Machine with a 4GB Memory Allocation Pool, or a simulation taking longer than its maximum allocated time of 12 hours. 29 Default Baseline Low-Tol Slightly-Min Decay Full-Vocab Non-Con Maximal Reward p-value 70043 69541 48726 62145 70940 72701 70079 36760 0.01 0.00 0.00 0.00 0.00 0.85 0.00 Default Baseline Low-Tol Slightly-Min Decay Full-Vocab Non-Con Maximal Reward p-value 79894 79211 53568 79711 81518 84342 79397 77158 0.00 0.00 0.32 0.00 0.00 0.00 0.00 (b) dnworst + (a) dnbest + Table 2: Accumulated reward for agents at t=3000. Average of 100 runs reported Initial awareness. As expected, starting with complete knowledge of the vocabulary is an advantage. Tables 1 and 2 show that the Full-Vocab agent achieves the lowest PE and highest cumulative rewards across all simulations. This is unsurprising: the agent never has to “throw away” counts from the trials, and it deliberates over all actions from the start. However, the Full-Vocab agent takes significantly longer to run than the Default agent, often anywhere from 3 to 8 times as long (see Table 3). There are two reasons for this. First, inference over a dn with more variables is usually more expensive— the Full-Vocab agent infers a 21 variable dn from the start, while the Default agent initially updates a dn with a much smaller vocabulary. Second, starting with a large initial vocabulary and a fairly weak prior makes it more difficult for Structural Update to prune the search space of parent sets. There is often an initial explosion in the number of parent sets that the Full-Vocab agent considers reasonable, because it has not yet gathered enough information from the domain trials to discriminate unreasonable parent sets from reasonable ones. In contrast, when the agent starts out aware of fewer variables, each new variable is incrementally introduced into a context where the agent has observed enough evidence to construct a more aggressive prior via equation (32). Default Baseline Low-Tol Slightly-Min Decay Full-Vocab Non-Con Time (s) p-value 3081 13 8196 12264 2923 12628 2174 0.00 0.00 0.00 0.30 0.00 0.00 Default Baseline Low-Tol Slightly-Min Decay Full-Vocab Non-Con Time (s) p-value 1266 15 2162 4979 1198 9465 1134 0.00 0.00 0.00 0.31 0.00 0.02 (b) dnworst + (a) dnbest + . Table 3: Run time in seconds for agents at t=3000. Average over 100 runs reported. (“Maximal” agent omitted, as none of the agent’s runs managed to finish) 30 Expert tolerance. In comparison to the Default expert, the Low-Tolerance expert results in a marginally worse PE, and significantly worse total accumulated reward. This is partly because each time the agent receives a message from the expert, it misses both an opportunity to receive a reward by taking an action in the domain, and also an opportunity to improve its estimate of Π and θ by observing an additional domain trial. In our experiments, the Low Tolerance expert can end up sending as many as 15 times more messages than the Default. One advantage of the Low-Tolerance expert, however, is that the agent makes early improvements to its policy. This is illustrated by Figure 5, which shows the PEs over time. Minimality. The results show that at least some level of minimality is necessary. In the vast majority of simulations (70%–100%, depending on dn+ ), the Maximal agent runs out of either time or memory, and so fails to collect rewards or improve its policy via the 3000 pieces of evidence. By comparison, the Default agent does not crash in any of the simulations. Without a mechanism to prune the set of parent sets or the domain of the reward function, the agent must consider an exponential number of options. For more than a small number of variables, this quickly becomes intractable. The differences are less dramatic for the Slightly-Minimal agent: fewer simulations crash, and those that do tend to crash come later in the simulation. However, its PE is still significantly worse than the Default agent’s PE. Excluding crashed agents from the results yields no significant difference in PE, suggesting that even with infinite time and resources, there is not necessarily any harm to adopting Minimality. The largest difference is in the run times: the Slightly Minimal Agent takes around 4 times as long to run as the Default agent. Thus, Minimality makes the problem tractable without harming performance. Conservativity. The Non-Conservative agent has a significantly worse PE than the Default agent. There appear to be two benefits to preserving information about which parent sets are unreasonable when a neologism is introduced. First, it directs the agent towards more accurate representations of the dependencies within the dn, and therefore hopefully allows it to make better decisions with equivalent samples. Second, having a more aggressive prior leads the (Conservative) Default agent to learn more vocabulary— on average 19 versus 17—as it is more likely to encounter a context where it asks the expert question (18) (“What is affected by X?”). This also explains why the NonConservative agent is marginally faster than the Default agent—it reasons with a smaller vocabulary. Domain Strategy. The Decay agent gathered a significantly larger total reward than the Default agent, without a significant difference in their PEs. In other words, gradually reducing the extent to which the agent explores the space as it gathers more evidence helps it to converge faster on a decent policy. But we haven’t demonstrated here whether the Decay agent would maintain this advantage as one increases the number of variables of dn+ : it may be a disadvantage to gradually explore less if the agent is more radically unaware at the start of the learning process than we used in our experiments here. Additionally, while it was not within the scope of these experiments to explore the space of exploration versus exploitation strategies (we arbitrarily chose an initial split of 0.7:0.3), it is possible that superior initial parameters (and decay rates) exist for learning the optimal policy. 31 25.0 24.5 Reward 24.0 23.5 23.0 Default Baseline Continuous Decay Full Vocab Non Conservative 22.5 22.0 0 500 1000 1500 2000 2500 3000 2000 2500 3000 Time Step 25 20 Reward 15 10 5 Low Tolerance Slightly Minimal Maximal 0 0 500 1000 1500 Time Step Figure 4: Rewards on dnbest + . Results averaged across 100 simulations, and blocks of 150 time steps. Note the scales in the two graphs differ, to help depict the performance of all agent types—the dips in the second figure are due to the agents crashing before t=3000. 32 3.0 Default Baseline Low Tolerance Full Vocab Non Conservative Maximal 2.5 Policy Error 2.0 1.5 1.0 0.5 0.0 0 500 1000 1500 2000 2500 3000 Time Step Figure 5: Policy error at each time step on dnbest (averaged across 100 simulations). + 5.3. Barley dn: Setup In these experiments, we test our default agent’s performance on the hand-crafted barley example (see Figure 1) and compare it against the baseline agent (which ignores evidence that makes dn0 invalid). The Barley dn is intended to reflect a somewhat realistic domain for our novel task, and has been explicitly designed so that learning the optimal policy requires knowledge of factors that the agent is initially unaware of. As in the previous experiment, we run 100 simulations over 3000 pieces of evidence then average the results. The structure of the agent’s initial decision network dn0 and the true decision network dn+ are shown in Figure 1. The cpts for each node are in the Appendix. 5.4. Barley dn: Results Figure 7 shows the policy error and average reward over 3000 pieces of evidence for the Barley dn. As expected, the baseline quickly stops improving as it reaches the bounds of what is achievable given its limited level of awareness. On the other hand, the default agent continues to improve its policy as it discovers unforeseen concepts and actions, and eventually converges upon a near-optimal policy. In addition to learning a near-optimal policy, the agent also learns a fairly accurate and efficient representation of the underlying decision network for the task. Figure 6 shows an example of the agent’s learned graph at t=3000. Notice that, in this run, the agent did not manage to discover two pieces of the true vocabulary—namely W eeds and Infestation. Both of these are outcome variables which are not in the reward domain. In future work, we aim to explore methods to allow the agent discover these variables 33 Local Concern Fertiliser Bad Press Pesticide Soil Type Precipitation Nitrogen Grain Harrow Gross Crops Protein Fungicide Fungus Insect Prevalence Temperature Infestation Weeds Yield R (a) True dn Grain Soil Type Fertiliser Precipitation Local Concern Fungicide Pesticide Nitrogen Gross Crops Fungus Bad Press Protein Harrow Temperature Insect Prevalence Yield R (b) Learned dn Figure 6: Difference in structure between the true dn and one learned by default agent at t=3000 for a (randomly chosen) simulation 34 6 14.5 5 14.0 4 13.5 Reward Policy Error Default Baseline 3 2 12.5 1 12.0 0 0 500 1000 1500 Time Step 2000 2500 3000 Default Baseline 13.0 11.5 0 500 1000 1500 Time Step 2000 2500 3000 Figure 7: Reward and policy error for agents on the Barley task which provide a more efficient factorization of the problem if discovered, but which are not necessarily vital for learning the optimal policy. Despite missing these two variables, the agent attempts to make reasonable compensations for their absence. For example, in the absence of the Infestation variable, the agent assumes that Insect-Prevalence is directly connected to Y ield. The few other incorrect edges are either due to reversals of causality (for instance, the model assumes Protein influences Nitrogen instead of vice versa) or by the model’s bias towards simplicity in the absence of sufficient domain trials (for example, Precipitation has a relatively weak influence on N itrogen compared to its many other parents, so the agent instead spuriously connects Precipitation to Local-Concern—a variable with no parents). 6. Related Work The literature on learning optimal policies includes methods for dealing with numerous types of change, such as non-stationary rewards (Besbes et al., 2014), or noise in sensing and actuation (da Silva et al., 2006). Such methods have also been applied in situations involving hidden variables (e.g., with Partially Observed Markov Decision Processes (Leonetti et al., 2011)), or in cases where the learner must reason about the underlying probabilistic structure of the problem (e.g, with Factored Markov Decision Processes (Degris et al., 2006)). However, these methods require all possible states and actions to be known in advance of learning. That is, the agent starts out with complete knowledge of C and A. In contrast, our agent learns these components from evidence. There are a few notable exceptions in the reinforcement learning (rl) literature, which attempt to relax the standard assumption that all possible states and actions are known in advance of learning. Rong (2016) defines Markov Decision Processes with Unawareness (mdpus), and also provides algorithms for learning optimal policies, even when the agent starts out unaware of actions and states that influence what is optimal. This work allows an agent to discover an unforeseen atomic state or unforeseen action via a random 35 exploration function that is a part of the mdpu. Our work contrasts with this in several ways. First, we support discovering unforeseen possibilities from evidence that stems from communication with an expert, not just via exploration. Secondly, and in light of this quite different kind of evidence, the agent is not simply discovering at most one new atomic state from the latest piece of evidence, but rather discovering an unforeseen concept, which instantly extends the set of atomic states considerably: e.g., an unforeseen concept corresponding to a Boolean random variable doubles the set of atomic states. Accordingly, and in contrast to mdpus, the set of atomic states in our task is not defined by a single random variable whose set of possible values change as the agent becomes more aware. Rather, the domain states are conceptualised via a set of random variables in a dependency structure, and the agent must learn that dependency structure so that computing joint probability distributions in the domain remains tractable. Learning the concepts and their dependencies is challenging but ultimately worth it, because the probabilistic conditional independence they encapsulate makes learning and reasoning (whether exact or approximate) more tractable. This enables us to conduct experiments in Section 5 where the (true) decision problem consists of 2 million distinct atomic states, compared with the few thousand distinct atomic states in the discretised models that are used in Rong’s experiments. Selective perception methods, such as McCallum’s (McCallum and Ballard, 1996) Utree algorithm, were designed for problems in which the true state space may technically be available, but is infeasibly large to reason with. The U-tree method initially treats all states as indistinguishable, then recursively splits states in two as the agent discovers significant differences in their expected reward. The agent thus learns an increasingly complex representation of the state space. The U-tree algorithm handles sequential planning while our model (currently) supports only single-stage decision problems; however, there are three main learning tasks that our model supports that the U-tree algorithm does not. First, our model accommodates situations where the agent is made aware of an entirely new possible action, while the U-Tree algorithm assumes that the set of actions remains fixed. Secondly, our model learns from (qualitative) evidence provided by a domain expert, as well as evidence from trial and error. And thirdly, our model learns unforeseen concepts and causal relations among them, while the U-tree algorithm does not reason about which dimensions define the state space, nor their causal dependencies. This third difference is related to the second: we ultimately want our model to enable an agent to learn about the domain and how to behave in it from a human expert, and it is quite natural for a human to justify why one state is different from another on the basis of the concepts on which optimal behaviour depends by saying, for instance, “sandy soil causes abundant barley yields”. Our model supports learning from this type of evidence. Deep reinforcement learning (drl, Mnih et al. (2015)) also aims to learn a suitable abstraction of the data to enhance convergence towards optimal policies. drl combines deep learning (i.e., a convolutional neural network or cnn (Bengio et al., 2013; Hinton et al., 2006)) with rl, and has proven extremely useful (e.g., Chouard (2016)). However, the major successes in drl have not so far considered changing state-action spaces in the sense of the examples we have discussed. Instead, the focus has been on using a large number (typically, in the millions or tens of millions) of domain trials to re-describe a large state-action space in terms of abstracted versions that render policy learning more tractable. We believe that agents can learn more efficiently if they exploit evidence from both domain trials and messages conveyed by an expert. Unfortunately, expert 36 evidence about causal relations (“X causes Y”) or preference (“If C is true, then doing X is better than doing Y”) are inherently symbolic. Adjusting weights in a sub-symbolic representation like a cnn so that it satisfies certain qualitative properties is currently an unsolved problem. Another limitation is that the implicit models generated by drl lack explainability—they are unable to elaborate on why a given action was recommended over another. Our approach complements methods like drl by dynamically building an interpretable model of the decision problem. Such interpretable models make it easier for the agent to explain the reasons behind a given decision, and also allow the agent to evaluate its interpretation of expert messages against its current conceptualisation of the decision problem via the standard logical technique of model checking. The agent must learn how to revise its model of the decision problem to incorporate newly discovered actions and concepts. Hence, part of our task is to learn the domain’s causal structure. Several approaches exist for jointly learning causal dependencies and probability distributions (e.g., Bramley et al. (2015); Buntine (1991); Friedman (1998)) and exploiting causal structure to speed-up inference (Albrecht and Ramamoorthy, 2016). We extend this work to meet our objectives. First, models for learning dependencies all assume that the vocabulary of random variables does not change during learning, but in our task it changes when the agent becomes aware of an unforeseen action or concept. Secondly, optimal action depends on payoffs as well as beliefs, and so we must integrate learning dependencies with learning potential payoffs. Finally, Bramley et al. (2015) and Friedman (1998) use only domain trials as evidence, and although Buntine (1991) uses expert evidence, the messages are only about causal relations and they are all declared prior to learning. In contrast, we want to interleave dialogue and learning: this enables the expert to offer advice in a timely and contextually relevant manner; consequently, she can explain particular outcomes and correct mistakes. The dns used to model the decision problems in this paper resemble a simplified version of influence diagrams (Howard and Matheson, 2005). Influence diagrams allow one to express multi-stage decision problems by defining information arcs between chance nodes and decision nodes, to help an agent assess whether it is worth observing a given trial or not (known as a value-of-information calculation). There has been some work on inferring the probabilistic structure and utilities of other agents in influence diagrams (Bielza et al., 2010; Nielsen and Jensen, 2004; Suryadi and Gmytrasiewicz, 1999). However, as explained in Section 2, the added complexity of the influence diagram definition was unnecessary to tackle the single-stage, fully observable tasks addressed in this paper. Moreover, in our work we assume that the agent knows its own utility function. There are several areas of research in which expert evidence is used to improve the performance of a learning agent. In Transfer learning— where knowledge of the optimal policy for a source task is used to improve performance on a related target task —the transfer of knowledge is sometimes captured via an expert “giving advice” to a learner (Torrey et al., 2006). Typically, both the source and target task must belong to the same domain. If they do not, an explicit mapping is usually provided from the states and actions in the source task to the states and actions in the target task. In contrast, our agent incrementally learns a single task, but is occasionally made aware of new concepts, which it must learn to accommodate into its existing knowledge. Another difference is that in transfer learning, the expert advice is all declared before the agent begins learning. In our model, the agent and expert engage in a dialogue throughout learning. Knox and Stone (2009) use human expert evidence to inform rl, but they confine 37 this evidence to updating the likely outcomes of actions and their rewards; they do not support cases where expert evidence reveals information that the agent was not aware was possible. On the other hand, researchers have developed models for learning optimal policies via a combination of domain actions and natural language instructions, where the instructions may include neologisms, whose semantics the agent must learn (e.g., Liang (2005)). But this work assumes that the neologism denotes an already known concept within the agent’s abstract planning language. On encountering the neologism “block” , for example, the agent’s task is to learn that it maps to the concept block that is already an explicit part of the agent’s domain model. In contrast, we support learning optimal policies when the neoglogism denotes a concept that the agent is currently unaware of; e.g., to support learning when block is not a part of the agent’s conceptualisation of the domain, and yet this (unforeseen) concept is critical to optimal behaviour. Forbes et al. (2015) use embodied natural language instructions to support teaching a robot a new skill (a task known as learning by demonstration). Their model learns how to map a natural language neologism to what might be a novel combination of sensory values—in this sense, the meaning of the neologism may be an unforeseen concept—and this novel concept then informs the task of learning new motor controls. In effect, this work links a rapidly growing body of research on learning how to ground natural language neologisms in the embodied environment (known as the symbol grounding problem; (Siskind, 1996; Dobnik et al., 2012; Yu et al., 2016; Hristov et al., 2017) inter alia) with learning a new skill. But it does not support integrating the newly acquired skill into an existing hypothesis space consisting of other actions, consequences and rewards; so they do not support learning optimal policies when not only this new skill but other actions (and related concepts) are needed as well. Our aim in this paper is to supply a complementary set of learning algorithms to this prior work. Like Forbes et al. (2015), our agent learns from both trial and error and from instruction. But we focus on a complementary task: instead of focussing, as they do, on learning how to execute a new skill, we focus on learning when it is optimal to execute it. Given that we wish to support larger planning tasks, we also broaden the goals to discovering and learning to exploit arbitrary unforeseen concepts, not just the learning of spatial concepts that Forbes et al. (2015) are limited to (see also Dobnik et al. (2012)). On the other hand, natural language ambiguity makes extracting the hidden message from natural language utterances a highly complex process (Grice, 1975; Bos et al., 2004; Zettlemoyer and Collins, 2007; Reddy et al., 2016). We bypass this complexity by using a formal language as the medium of conversation. This formal language can be broadly construed as the kind of language one uses to represent the output of natural language semantic parsing (Artzi and Zettlemoyer, 2013). Replacing the expert that we deploy in our experiments with an expert human would require linking the model we present in this paper with existing work on grounded natural language acquisition and understanding. This task is beyond the scope of the current paper, and forms a major focus of our future work. Lakkaraju et al. (2017) tackle learning “unknown unknowns” via interaction with an oracle. This work addresses a specific type of unawareness: an agent assigns an incorrect label to a trial with high confidence. Crucially however, they assume that the correct label for this trial must be a label that the agent is already currently aware of. In other words, they exclude the option that the hypothesis space itself is incomplete, which is the type of unawareness that we are interested in. 38 There is a growing body of work on modelling unaware agents (e.g., Feinberg (2004); Halpern and Rêgo (2013); Board et al. (2011); Heifetz et al. (2013)). These theories predict when the agent’s unawareness causes it to deviate from what is actually optimal. But with the exception of Rong (2016), this work does not address how an agent learns from evidence: i.e., how to use evidence to become aware of an unforeseen factor and to estimate how this gets incorporated into its updated conceptualisation of the decision problem. We fill this gap. This prior work interprets awareness with respect to models that include every possible option. A fully aware agent (e.g., the domain expert in our experiments) or an analyst can model an unaware agent this way, but it does not characterise the unaware agent’s own subjective perspective (Li, 2008). In contrast, our learning task requires the unaware agent to use evidence to change its set of possible options: it dynamically constructs this set and its causal structure from evidence. Finally, the barley example from Section 1 shows that becoming aware of an unforeseen possibility can prompt revisions, rather than refinements, to the reward function. But the models that support preference revision on discovering an unforeseen possibility assume a qualitative preference model (Hansson, 1995; Cadilhac et al., 2015). Following Cadilhac et al. (2015), we use evidence to dynamically construct an ever more specific partial description of preferences, and defeasible reasoning yields a complete preference model from the (partial) description—the agent defaults to indifference. But unlike Cadilhac et al. (2015), the learning agent uses evidence to estimate numeric payoffs rather than qualitative preference relations. 7. Conclusions and Future Work This paper presents a method for discovering and learning to exploit unforeseen possibilities while attempting to converge on optimal behaviour in single-stage decision problems. The method supports learning by trial and error as well as learning by instruction via messages from a domain expert. We model the problem as one of dynamically building an interpretable conceptualisation of the domain: we argued that building an interpretable model offers a straightforward way to exploit both the qualitative evidence and the quantitative evidence. Specifically, our model is the first to support learning all components of a decision network, including its set of random variables. Our algorithms build upon the common sense notions of Minimality and Conservativity. Minimality is encoded in the following ways: greedy search for a minimal vocabulary and domain for the reward function; defaulting to indifference; defeasibly low prior probabilities of dependencies; and the assumption that any superset of a sufficiently improbable parent set is at least as improbable. Conservativity is encoded by retaining the relative likelihoods among dependencies and cpts learned so far when a new variable gets added to the dn. Our experiments show that these principles significantly enhance the performance of the agent in its learning task, as measured by policy error and cumulative reward, when learning a dn of 21 random variables from 3000 pieces of evidence. The model was also shown to be robust to the topology of the true dn: in other words, it learns effective policies, whatever the true conceptualisation of the domain might be. An agent that starts with a minimal subset of the true hypothesis space is also competitive with one that starts with full knowledge of the set of random variables that define the atomic states. 39 There are several novel formal components to our model. For instance, we have combined symbolic constraint solving with Dirichlet distribution based estimates to guide learning, and the novel ILP step ensures that the estimated causal structure of the domain is valid—i.e., all nodes are connected to the utility node, and the dependencies satisfy all observed evidence to date. This component on its own presents an important extension to existing work on learning dependencies, since it supports learning a dn as opposed to just a Bayesian network. These are just the first steps towards building an agent that can learn to conceptualise and exploit its domain via its own action and via messages from teachers or experts. We would like to extend this model to handle decision problems where some of the critical factors for solving the task have hidden values even after the agent becomes aware of them; this would involve replacing our Parameter Update algorithm with a modified version of Structural EM (Friedman, 1998). We would also like to extend it to handle dynamic environments: i.e., to learn (factored) mdps, where the dns learned here correspond to just one time slice. This would not only extend the scope of this work from single-stage decision making to sequential planning; it would also be essential if we were to replace defining the agent’s and expert’s dialogue strategy with learning an optimal dialogue strategy. We would also like to enrich dialogue in three ways. First, we would like the learner to utilise defeasible messages about likelihood. Second, we would like to relax the assumption that the expert’s intended message is always true. And finally, we would like to support dialogues in natural language—the latter two enhancements are a necessary step for an agent to discover and exploit unforeseen possible options via interaction with a human teacher. References Albrecht, S., Ramamoorthy, S., 2016. Exploiting causality for selective belief filtering in dynamic Bayesian networks. Journal of Artificial Intelligence Research 55, 1135–1178, dOI: 10.1613/jair.5044. Alchourrón, C., Gärdenfors, P., Makinson, D., 1985. On the logic of theory change: Partial meeting contraction and revision functions. Journal of Symbolic Logic 50, 510–530. Artzi, Y., Zettlemoyer, L., 2013. Weakly supervised learning of semantic parsers for mapping instructions to actions. Transactions of the Association for Computational Linguistics 1, 49–62. Asher, N., Lascarides, A., 2003. Logics of Conversation. Cambridge University Press. Bengio, Y., Courville, A., Vincent, P., 2013. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence 35 (8), 1798–1828. Besbes, O., Gur, Y., Zeevi, A., 2014. Stochastic multi-armed-bandit problem with non-stationary rewards. In: Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N., Weinberger, K. (Eds.), Advances in Neural Information Processing Systems 27. Curran Associates, Inc., pp. 199–207. Bielza, C., Gomez, M., Shenoy, P., 2010. Modeling challenges with influence diagrams: Constructing probability and utility models. Decision Support Systems 49 (4), 354–364. Board, O., Chung, K., Schipper, B., 2011. Two models of unawareness: Comparing the object-based and subjective-state-space approaches. Synthese 179, 13–34. Bos, J., Clark, S., Steedman, M., Curran, J., Hockenmaier, J., 2004. Wide coverage semantic representations from a ccg parser. In: Proceedings of the International Conference on Computational Linguistics (COLING 2004). Geneva, Switzerland. Bramley, N., Dayan, P., Lagnado, D., 2015. Staying afloat on Neurath’s boat - heuristics for sequential causal learning. In: Proceedings of the 37th Annual Conference of the Cognitive Science Society. Austin, Texas, pp. 262–267. Buntine, W., 1991. Theory refinement on Bayesian networks. In: Proceedings of the 7th Conference on Uncertainty in Artificial Intelligence (UAI). Morgan Kaufmann, pp. 52–60. Cadilhac, A., Asher, N., Lascarides, A., Benamara, F., 2015. Preference change. Journal of Logic, Language and Information 24 (3), 267–288. 40 Chen, C., , Seff, A., Kornhauser, A., Xiao, J., 2015. Deepdriving: Learning affordance for direct perception in autonomous driving. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 2722–2730. Chouard, T., 2016. The GO files: AI computing wraps up 4-1 victory against human champion, posted online, March 2016. da Silva, B., Basso, E., Bazzan, A., Engel, P., 2006. Dealing with non-stationary environments using context detection. In: Proceedings of the 23rd International Conference on Machine Learning. ICML ’06. ACM, New York, NY, USA, pp. 217–224. DARPA-BAA-16-53, 2016. Broad agency announcement on explainable artificial intelligence (xai). Degris, T., Sigaud, O., Wuillemin, P., 2006. Learning the structure of Factored Markov Decision Processes in reinforcement learning problems. In: Proceedings of the 23rd international conference on Machine learning. ACM, pp. 257–264. Dobnik, S., Cooper, R., Larsson, S., 2012. Modelling language, action and perception in type theory with records. In: Duchier, D., Parmentier, Y. (Eds.), Constraint Solving and Language Processing. Springer, pp. 70–91. Feinberg, Y., 2004. Subjective reasoning - games with unawareness. Tech. Rep. 1875, Graduate School of Business, Stanford University. Forbes, M., Rao, R., Zettlemoyer, L., Cakmak, M., 2015. Robot programming by demonstration with situated spatial language understanding. In: Proceedings of ICRA. Friedman, N., 1998. The Bayesian Structural EM algorithm. In: Proceedings of the Fourteenth conference on Uncertainty in artificial intelligence. Morgan Kaufmann Publishers Inc. Friedman, N., Goldszmidt, M., 1997. Sequential update of Bayesian network structure. In: Proceedings of the Thirteenth conference on Uncertainty in artificial intelligence. Morgan Kaufmann Publishers Inc., pp. 165–174. Friedman, N., Koller, D., 2003. Being Bayesian about network structure. a Bayesian approach to structure discovery in bayesian networks. Machine learning 50 (1-2), 95–125. Grice, H. P., 1975. Logic and conversation. In: Cole, P., Morgan, J. L. (Eds.), Syntax and Semantics Volume 3: Speech Acts. Academic Press, pp. 41–58. Groenendijk, J., Stokhof, M., 1982. Semantic analysis of wh-complements. Linguistics and Philosophy 5 (2), 175–233. Halpern, J., Rêgo, L., 2013. Reasoning about knowledge of unawareness revisited. Mathematical Social Sciences 66, 73–84. Hansson, S., 1995. Changes in preference. Theory and Decision 38 (1), 1–28. Heifetz, A., Meier, M., Schipper, B., 2013. Dynamic unawareness and rationalizable behavior. Games and Economic Behavior 81, 50–68. Hinton, G., Osindero, S., Teh, Y., 2006. A fast learning algorithm for deep belief nets. Neural Computation 18 (7), 1527–1554. Hobbs, J., Stickel, M., Appelt, D., Martin, P., 1993. Interpretation as abduction. Artificial Intelligence 63 (1–2), 69–142. Howard, R., Matheson, J., 2005. Influence diagrams. Decision Analysis 2 (3), 127–143. Hristov, Y., Penkov, S., Lascarides, A., Ramamoorthy, S., 2017. Grounding symbols in multi-modal instructions. In: Proceedings of the ACL workshop Language Grounding for Robotics. Vancouver, Canada. Ide, J., Cozman, F., Ramos, F., 2004. Generating random Bayesian networks with constraints on induced width. In: Proceedings of the 16th european conference on artificial intelligence. IOS Press, pp. 353– 357. Knox, W., Stone, P., 2009. Interactively shaping agents via human reinforcement: The TAMER framework. In: Proceedings of the fifth interanational conference on Knowledge Capture. pp. 9–16. Kristensen, K., Rasmussen, I., 2002. The use of a Bayesian network in the design of a decision support system for growing malting barley without use of pesticides. Computers and Electronics in Agriculture 33 (3), 197–217. Lakkaraju, H., Kamar, E., Caruana, R., Horvitz, E., 2017. Identifying unknown unknowns in the open world: Representations and policies for guided exploration. In: AAAI. pp. 2124–2132. Larsson, S., 2013. Formal semantics for perceptual classification. Journal of Logic and Computation 25 (2), 335–369. Leonetti, M., Iocchi, L., Ramamoorthy, S., 2011. Reinforcement learning through global stochastic search in N-MDPs. In: Machine Learning and Knowledge Discovery in Databases. Springer, pp. 326–340. Li, J., 2008. Modelling unawareness in aribtrary state spaces. Tech. Rep. 08-021, Penn Institute for Economic Research. 41 Liang, P., 2005. Semi-supervised learning for natural language. Ph.D. thesis, Department of Electrical Engineering and Computer Science, MIT. Liebman, E., Zavesky, E., Stone, P., 2017. Autonomous model management via reinforcement learning. In: Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems. International Foundation for Autonomous Agents and Multiagent Systems, pp. 1601–1603. McCallum, A., Ballard, D., 1996. Reinforcement learning with selective perception and hidden state. Ph.D. thesis, University of Rochester. Dept. of Computer Science. Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A., Veness, J., Bellemare, M., Graves, A., Riedmiller, M., Fidjeland, A., Ostrovski, G., Petersen, S., Beattie, C., Sadik, A., Antonoglou, I., King, H., Kumaran, D., Wierstra, D., Legg, S., Hassabis, D., 2015. Human-level control through deep reinforcement learning. Nature 518 (7540), 529–533. Nielsen, T., Jensen, F., 2004. Learning a decision maker’s utility function from (possibly) inconsistent behavior. Artificial Intelligence 160 (1-2), 53–78. Pearl, J., 2017. Theoretical impediments to machine learning with seven sparks from the causal revolution. Tech. Rep. R-475, <http://ftp.cs.ucla.edu/pub/stat ser/r475.pdf>, Department of Computer Science, University of California, Los Angeles, CA. Poole, D., 1993. Probabilistic horn abduction and bayesian networks. Artificial Intelligence 64, 81–129. Reddy, S., Täckström, O., Collins, M., Kwiatkowski, T., Das, D., Steedman, M., Lapata, M., 2016. Transforming Dependency Structures to Logical Forms for Semantic Parsing. Transactions of the Association for Computational Linguistics 4, 127–140. Rong, N., 2016. Learning in the presence of unawareness. Ph.D. thesis, Computer Science, Cornell University. Silver, D., 2011. Machine lifelong learning: Challenges and benefits for artificial general intelligence. In: Proceedings of the 4th International Conference on Artificial General Intelligence. AGI’11. SpringerVerlag, Berlin, Heidelberg, pp. 370–375. Siskind, J., 1996. A computational study of cross-situational techniques for learning word-to-meaning mappings. Cognition 61 (1–2), 39–91. Suryadi, D., Gmytrasiewicz, P., 1999. Learning models of other agents using influence diagrams. In: UM99 User Modeling. Springer, pp. 223–232. Thrun, S., Pratt, L., 2012. Learning to learn. Springer Science & Business Media. Torrey, L., Shavlik, J., Walker, T., Maclin, R., 2006. Relational skill transfer via advice taking. In: ICML Workshop on Structural Knowledge Transfer for Machine Learning. Vanderbei, R., 2015. Linear Programming: Foundations and Extensions, 4th Edition. Springer. Yu, Y., Eshghi, A., Lemon, O., 2016. Training an adaptive dialogue policy for interactive learning of visually grounded word meanings. In: Proceedings of SIGDIAL. Los Angeles, pp. 339–349. Zettlemoyer, L., Collins, M., 2007. Online learning of relaxed CCG grammars for parsing to logical form. In: Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL). pp. 678–687. 42 Appendix The model for learning dn+ made use of a language L for partially describing dns. Its syntax and semantics is defined as follows: Definition 2. The syntax of the language L • Terms of various sorts: X, Y . . . are random variable (RV) constants; ΠY , V, A, O, B are Sets of Random Variables (SRV) constants (denoting sets of random variables in the model); where X is an RV constant, x is a proposition term (we also say that ¬x is a propositional term); s is an atomic state (AS) term (denoting an atomic state in the model). The language also includes RV variables and AS variables. • If p is a propositional term or an AS term, then it is a well-formed formula (wff) in L. • If p is a conjunction of positive and negative propositional terms and X is an SRV constant, then p  X is a well-formed formula (wff) in L. • If X is an RV term and Y is an SRV term, then X ∈ Y is a wff in L. • If s is an AS term and n is a number, then R(s) = n is a wff in L. • Where φ, ψ are wffs, so are ¬φ, φ ∧ ψ, ∃sφ, ∀sφ (where s is an AS variable variable) and ?λV φ (where V is an RV variable). Each model dn for interpreting L corresponds to a (unique) complete dn (see Definition 1). Definition 3 then evaluates the formulae of L as partial descriptions of dn. Definition 3. The semantics of L Let dn = hCdn , Adn , Πdn , θdn , Rdn i be a dn and g a variable assignment function. hdn,gi • For an RV constant X, [[X]] = X; similarly for SRV constants.8 dn,g dn,g dn,g This ensures that [[A]] , [[B]] and [[O]] denote sets of variables in the appropriate position in the causal structure of dn. hdn,gi • For an AS variable s, [[s]] = g(s) where g(s) ∈ 2Cdn ×Adn . For an hdn,gi RV variable V , [[V ]] = g(V ) ∈ Cdn ∪ Adn . • For an RV term a and an SRV term b, [[a ∈ b]] hdn,gi [[b]] . • Where p is a propositional term, [[p]] hdn,gi hdn,gi = 1 iff [[a]] hdn,gi ∈ = p. • For an AS term s and number n, [[R(s) = n]] hdn,gi = 1 iff Rdn ([[s]]) = n. hdn,gi 8 If X 6∈ C is undefined and Definition 3 ensures that any formula φ featuring dn ∪ Adn , then [[X]] X is such that dn 6|= φ; similarly for propositional terms p featuring a value of a variable that is not a part of dn. 43 • Where p is a conjunction of positive and negative propositional terms hdn,gi hdn,gi hdn,gi and X is a set constant, [[p  X ]] = [[p]]  [[X ]] (i.e., the projection of the denotation of p onto the set of variables denoted by X ). hdn,gi hdn,gi hdn,gi • For formulae φ, ψ: [[φ ∧ ψ]] = 1 iff [[φ]] = 1 and [[φ]] = 1; hdn,gi hdn,gi hdn,gi [[¬φ]] = 1 iff [[φ]] = 0; [[∃sφ]] = 1 iff there is a variable hdn,g 0 i assignment function g 0 = g[s/p] such that [[φ]] = 1. • Where V is a RV variable and φ is a formula: hdn,gi hdn,gi [[?λV φ]] = {φ[V /X] : X is an RV constant and [[φ[V /X]]] = 1}. These interpretations yield a satisfaction relation in the usual way: dn |= φ iff there is a hdn,gi function g such that [[φ]] = 1. Derivation of Parameter Update Given a Domain Trial We now show that (21)—the formula for incrementally updating the probability of a parent set given the latest domain trial—follows from the recursive Γ function in the Dirichlet distribution. (n +α −1) v=i|j P r(Πv |e0:t ) = P r(Πv |e0:t−1 ) (nv=i|j v=.|j +αv−.|j −1) (21) Exploiting the Dirichlet distribution to compute the posterior probability yields the following, where mv is the number of possible values for variable V (so in our case, mv = 2): P r(Πv |e0:t ) ∝ P r(Πv ) Y j∈values(Πv ) Betamv (nv=1|j + αv=1|j , . . . nv=mv |j + αv=mv |j ) Betamv (αv=1|j , . . . , αv=mv |j ) If et makes V = i, Πv = j, then the only term in the product that differs between updating with e0:t−1 vs. e0:t is when Πv = j. For e0:t−1 , this term is: Betamv (nv=1|j + αv=1|j , . . . , nv=i|j − 1 + αv=i|j , . . . , nv=mv |j + αv=mv |j ) Betamv (αv=1|j , . . . , αv=mv |j ) So P r(Πv |e0:t ) ∝ P r(Πv |e0:t−1 ) Betam Q = P r(Πv |e0:t−1 ) = Betamv (nv=1|j +αv=1|j ,...nv=mv |j +αv=mv |j ) v (nv=1|j +αv=1|j ,...,ni|j −1+αv=i|j ,...,nmv |j +αv=mv |j ) Γ(nv=.|j −1+αv=.|j ) k∈values(V ) Γ(nv=k|j +αv=k|j ) Q Γ(nv=.|j +αv=.|j ) Γ(nv=i|j −1+αv=i|j ) k∈values(V )\i Γ(nv=k|j +αv=k|j ) Γ(nn=i|j +αv=i|j ) Γ(nv=.|j −1+αv=.|j ) P r(Πv |e0:t−1 ) Γ(nv=.|j +mv αv=.|j ) Γ(nv=i|j −1+αv=i|j ) By the definition of Γ (i.e., Γ(α) = (α − 1)Γ(α − 1)), we have: (n −1+α )Γ(n (n −1+α ) −1+α ) Γ(nv=.|j −1+αv=.|j ) Γ(nv=i|j −1+αv=i|j ) v=i|j v=i|j v=i|j P r(Πv |e0:t ) = P r(Πv |e0:t−1 ) (nv=i|j v=.|j −1+αv=.|j )Γ(nv=.|j −1+αv=.|j ) v=i|j = P r(Πv |e0:t−1 ) (nv=i|j v=.|j −1+αv=.|j )  44 Decision Networks Used in Experiments Tables 4, 5, and 6 specify the true conditional probability tables (cpts) and reward worst functions for the three Barley dns used in the experiments of section 5 (dnbest , + , dn+ barley and dn+ ). For each cpt, each row lists a variable’s name, its immediate parents, and the probability of that variable having the value 1 given each possible assignment to the variable’s parents (assignments are enumerated according to the order specified in the second column). The reward table lists the reward domain and the reward received given each possible assignment to the domain. Table 4: dnbest + X ΠX P (X = 1 |ΠX ) B1 B5 0.596, 0.774 B2 ∅ 0.653 B3 B7 0.457, 0.457 B4 ∅ 0.354 B5 B3, B4 0.639, 0.224, 0.35, 0.273 B6 ∅ 0.738 B7 ∅ 0.313 O1 O2, O6, A3 0.286, 0.478, 0.401, 0.956, 0.53, 0.084, 0.766, 0.923 O2 A1, A7 0.31, 0.554, 0.213, 0.197 O3 A2, A5, B2 0.74, 0.945, 0.92, 0.721, 0.371, 0.963, 0.129, 0.029 O4 B2, O5, B1 0.937, 0.93, 0.484, 0.255, 0.637, 0.191, 0.136, 0.149 O5 O7 0.36, 0.43 O6 A6, B5 0.677, 0.209, 0.696, 0.521 O7 A4, B6 0.821, 0.379, 0.211, 0.383 ΠR R(ΠR ) O1, O4, O3, O5, B7 43.55, 27.42, 35.48, 8.06, 20.97, 11.29, 30.65, 50.0, 46.77, 6.45, 12.9, 32.26, 41.94, 0.0, 33.87, 37.1, 25.81, 4.84, 22.58, 29.03, 14.52, 9.68, 45.16, 24.19, 17.74, 19.35, 48.39, 16.13, 40.32, 3.23, 38.71, 1.61 45 Table 5: dnworst + X ΠX P (X = 1 |ΠX ) B1 ∅ 0.49 B2 B3, B7 0.779, 0.547, 0.727, 0.197 B3 ∅ 0.198 B4 ∅ 0.36 B5 ∅ 0.883 B6 ∅ 0.237 B7 B1 0.43, 0.992 O1 O7, A1, A3 0.088, 0.467, 0.13, 0.548, 0.7, 0.372, 0.498, 0.047 O2 B5, O7 0.461, 0.599, 0.806, 0.37 O3 A6 0.881, 0.125 O4 O3, A5, A4 0.111, 0.033, 0.315, 0.322, 0.034, 0.579, 0.94, 0.644 O5 O2, B4, O4 0.816, 0.979, 0.577, 0.467, 0.459, 0.751, 0.191, 0.541 O6 O4, A2 0.818, 0.583, 0.188, 0.957 O7 O6, A7, B1 0.314, 0.418, 0.48, 0.822, 0.957, 0.889, 0.697, 0.061 ΠR R(ΠR ) O1, B6, B7, O5, B2 43.55, 6.45, 22.58, 46.77, 37.1, 48.39, 1.61, 8.06, 16.13, 29.03, 50.0, 9.68, 11.29, 14.52, 19.35, 40.32, 4.84, 12.9, 38.71, 20.97, 45.16, 3.23, 32.26, 17.74, 33.87, 25.81, 24.19, 35.48, 27.42, 30.65, 41.94, 0.0 46 Table 6: dnbarley + X ΠX P (X = 1 |ΠX ) Soil Type ∅ 0.5 Temperature ∅ 0.5 Precipitation ∅ 0.5 Insect-Prevalence ∅ 0.5 Local-Concern ∅ 0.5 Nitrogen Soil Type, Precipitation, Pesticide, Fertiliser 0.4, 0.6, 0.5, 0.7, 0.3, 0.5, 0.4, 0.6, 0.65, 0.85, 0.75, 0.95, 0.55, 0.75, 0.65, 0.85 Gross Crops Harrow, Nitrogen, Grain 0.5, 0.4, 0.8, 0.7, 0.6, 0.5, 0.9, 0.8 Fungus Temperature, Fungicide, Grain 0.2, 0.5, 0.02, 0.04, 0.3, 0.6, 0.03, 0.06 Weeds Temperature, Harrow, Soil Type 0.2, 0.1, 0.02, 0.01, 0.3, 0.15, 0.03, 0.015 Infestation Insect-Prevalence, Pesticide 0.1, 0.5, 0.01, 0.05 Yield Gross Crops, Fungus, Weeds, Infestation 0.2, 0.95, 0.1, 0.5, 0.1, 0.7, 0.05, 0.3, 0.05, 0.65, 0.01, 0.2, 0.01, 0.45, 0.005, 0.1 Protein Nitrogen, Fertiliser, Grain 0.5, 0.9, 0.4, 0.8, 0.4, 0.8, 0.3, 0.7 Bad Press Local-Concern, Pesticide 0.0, 0.0, 0.01, 0.5 ΠR R(ΠR ) Yield, Protein, Fungus, Bad Press 10, 15, 15, 20, 0, 5, 5, 10, -10, -5, -5, 0, -20, -15, -15, -10 47
2cs.AI
IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 1 A Comprehensive Survey of Graph Embedding: Problems, Techniques and Applications arXiv:1709.07604v3 [cs.AI] 2 Feb 2018 Hongyun Cai, Vincent W. Zheng, and Kevin Chen-Chuan Chang Abstract—Graph is an important data representation which appears in a wide diversity of real-world scenarios. Effective graph analytics provides users a deeper understanding of what is behind the data, and thus can benefit a lot of useful applications such as node classification, node recommendation, link prediction, etc. However, most graph analytics methods suffer the high computation and space cost. Graph embedding is an effective yet efficient way to solve the graph analytics problem. It converts the graph data into a low dimensional space in which the graph structural information and graph properties are maximumly preserved. In this survey, we conduct a comprehensive review of the literature in graph embedding. We first introduce the formal definition of graph embedding as well as the related concepts. After that, we propose two taxonomies of graph embedding which correspond to what challenges exist in different graph embedding problem settings and how the existing work address these challenges in their solutions. Finally, we summarize the applications that graph embedding enables and suggest four promising future research directions in terms of computation efficiency, problem settings, techniques and application scenarios. Index Terms—Graph embedding, graph analytics, graph embedding survey, network embedding F 1 I NTRODUCTION G RAPHS naturally exist in a wide diversity of realworld scenarios, e.g., social graph/diffusion graph in social media networks, citation graph in research areas, user interest graph in electronic commerce area, knowledge graph etc. Analysing these graphs provides insights into how to make good use of the information hidden in graphs, and thus has received significant attention in the last few decades. Effective graph analytics can benefit a lot of applications, such as node classification [1], node clustering [2], node retrieval/recommendation [3], link prediction [4], etc. For example, by analysing the graph constructed based on user interactions in a social network (e.g., retweet/comment/follow in Twitter), we can classify users, detect communities, recommend friends, and predict whether an interaction will happen between two users. Although graph analytics is practical and essential, most existing graph analytics methods suffer the high computation and space cost. A lot of research efforts have been devoted to conducting the expensive graph analytics efficiently. Examples include the distributed graph data processing framework (e.g., GraphX [5], GraphLab [6]), new space-efficient graph storage which accelerate the I/O and computation cost [7], and so on. In addition to the above strategies, graph embedding provides an effective yet efficient way to solve the graph analytics problem. Specifically, graph embedding converts a graph into a low dimensional space in which the graph information is preserved. By representing a graph as a (or a set of) low dimensional vector(s), graph algorithms • • • H. Cai is with Advanced Digital Sciences Center, Singapore. E-mail: [email protected]. V. Zheng is with Advanced Digital Sciences Center, Singapore. Email: [email protected]. K. Chang is with University of Illinois at Urbana-Champaign, USA. Email: [email protected]. can then be computed efficiently. There are different types of graphs (e.g., homogeneous graph, heterogeneous graph, attribute graph, etc), so the input of graph embedding varies in different scenarios. The output of graph embedding is a low-dimensional vector representing a part of the graph (or a whole graph). Fig. 1 shows a toy example of embedding a graph into a 2D space in different granularities. I.e., according to different needs, we may represent a node/edge/substructure/whole-graph as a lowdimensional vector. More details about different types of graph embedding input and output are provided in Sec. 3. In the early 2000s, graph embedding algorithms were mainly designed to reduce the high dimensionality of the non-relational data by assuming the data lie in a low dimensional manifold. Given a set of non-relational highdimensional data features, a similarity graph is constructed based on the pairwise feature similarity. Then, each node in the graph is embedded into a low-dimensional space where connected nodes are closer to each other. Examples of this line of researches are introduced in Sec. 4.1. Since 2010, with the proliferation of graph in various fields, research in graph embedding started to take a graph as the input and leverage the auxiliary information (if any) to facilitate the embedding. On the one hand, some of them focus on representing a part of the graph (e.g., node, edge, substructure) (Figs. 1(b)-1(d)) as one vector. To obtain such embedding, they either adopt the state-of-the-art deep learning techniques (Sec. 4.2) or design an objective function to optimize the edge reconstruction probability (Sec. 4.3). On the other hand, there is also some work concentrating on embedding the whole graph as one vector (Fig. 1(e)) for graph level applications. Graph kernels (Sec. 4.4) are usually designed to meet this need. The problem of graph embedding is related to two traditional research problems, i.e., graph analytics [8] and representation learning [9]. Particularly, graph embedding 77 7 1.51.5 1.5 0.60.6 0.6 5 5 5 1.51.581.5 8 88 8 9 5 8 -3 -3 -3 0.00.0 0.0 1.51.5 1.5 3.0 3.03.0 IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 3 3 3 3 1 1.5 3 4 3 2 0.8 0.3 1 1.5 1.2 0.8 1.2 2 1 6 5 0.2 0.6 74 11 9 6 1.5 8 1.5 0.6 5 0.2 7 9 1 1.5 8 -3 0.0 7 8 1.5 0 0 4 9 5 -3 (b) Node Embedding 0.0 e23 e23 e12e12ee23 12 e13e13 e13 e46e46 ee4656e56 e56 0 e e e678e78 ee45 7845 45 7 e34e34 e34 e79e79 e79 9 e67e67 e67 8 -3 -3 -3 0.0 3.00.0 0.0 3 3 3 0 0 0 GG G{1,2,3} {1,2,3} {1,2,3} GG G{4,5,6} {4,5,6} {4,5,6} 00 0 GG 1 1G1 GG G{7,8,9} {7,8,9} {7,8,9} -3 -3 -3 3.03.0 3.0 0.00.0 0.0 1.51.5 1.5 (c) Edge Embedding 1.5 3.0 33 3 1.51.5 1.5 -3-3 -3 3.03.03.0 0.0 0.00.0 1.5 1.51.5 3.0 3.03.0 (d) Substructure Embedding (e) Whole-Graph Embedding Fig. 1. A toy example of embedding a graph into 2D space with different granularities. G{1,2,3} denotes the substructure containing node v1 , v2 , v3 . 3 3 3 e12 e23 3 3 3 G{1,2,3} aims to represent a graph as low dimensional vectors while e56 the structures are preserved. On the 0one hand, 0 e46 graph G{4,5,6} G1 graph e12 e23 G{1,2,3}graph e78 e45 analytics data. e13 aims to mine useful information from e34 e56 representation G{7,8,9} 0 learning obtains data e79 0 On the other e46 hand, 0 G{4,5,6} representations that make it easier to extract useful informae78e67 e45 -3 -3 0.0 1.5 or other3.0 0.0 1.5 e34classifiers 1.5 tion when 3.0 building predictors [9]. Graph G{7,8,9} e79 embedding liese in the overlap of the two problems and 67 focuses on learning the low-dimensional representations. -3 -3 -3 0.0 1.5 3.0 0.0 0.0 3.0 Note that 1.5 we distinguish graph representation learning and graph embedding in this survey. Graph representation learning does not require the learned representations to be low dimensional. For example, [10] represents each node as a vector with dimensionality equals to the number of nodes in the input graph. Every dimension denotes the geodesic distance of a node to each other node in the graph. e13 -3 0.0 3 6 0 5 2 1 4 (a) Input Graph G1 0 3 0 0.3 1.5 2 1 3 2 Embedding graphs into low dimensional spaces is not a trivial task. The challenges of graph embedding depend on the problem setting, which consists of embedding input and embedding output. In this survey, we divide the input graph into four categories, including homogeneous graph, heterogeneous graph, graph with auxiliary information and graph constructed from non-relational data. Different types of embedding input carry different information to be preserved in the embedded space and thus pose different challenges to the problem of graph embedding. For example, when embedding a graph with structural information only, the connections between nodes are the target to be preserved. However, for a graph with node label or attribute information, the auxiliary information provides graph property from other perspectives, and thus may also be considered during the embedding. Unlike embedding input which is given and fixed, the embedding output is task driven. For example, the most common type of embedding output is node embedding which represents close nodes as similar vectors. Node embedding can benefit node related tasks such as node classification, node clustering, etc. However, in some cases, the tasks may be related to higher granularity of a graph e.g., node pairs, subgraph, whole graph. Hence, the first challenge in terms of embedding output is to find a suitable embedding output type for the application of interest. We categorize four types of graph embedding output, including node embedding, edge embedding, hybrid embedding and whole-graph embedding. Different output granularities have different criteria for a “good” embedding and face different challenges. For example, a good node embedding preserves the similarity to its neighbouring nodes in the embedded space. In contrast, a good whole-graph embedding represents a whole graph as a vector so that the graph-level similarity is preserved. In observations of the challenges faced in different problem settings, we propose two taxonomies of graph embedding work, by categorizing graph embedding literature G1 based on the problem settings and the embedding tech3.0 niques. These two taxonomies correspond to what challenges exist in graph embedding and how existing studies address these challenges. In particular, we first introduce 1.5 settings 3.0 different of graph embedding problem as well as the challenges faced in each setting. Then we describe how existing studies address these challenges in their work, including their insights and their technical solutions. Note that although a few attempts have been made to survey graph embedding ( [11], [12], [13]), they have the following two limitations. First, they usually propose only one taxonomy of graph embedding techniques. None of them analyzed graph embedding work from the perspective of problem setting, nor did they summarize the challenges in each setting. Second, only a limited number of related work are covered in existing graph embedding surveys. E.g., [11] mainly introduces twelve representative graph embedding algorithms, and [13] focuses on knowledge graph embedding only. Moreover, there is no analysis on the insight behind each graph embedding technique. A comprehensive review of existing graph embedding work and a high level abstraction of the insight for each embedding technique can foster the future researches in the field. 1.1 Our Contributions Below, we summarize our major contributions in this survey. • We propose a taxonomy of graph embedding based on problem settings and summarize the challenges faced in each setting. We are the first to categorize graph embedding work based on problem setting, which brings new perspectives to understanding existing work. • We provide a detailed analysis of graph embedding techniques. Compared to existing graph embedding surveys, we not only investigate a more comprehensive set of graph embedding work, but also present a summary of the insights behind each technique. In contrast to simply listing how the graph embedding was solved in the past, the summarized insights answer the questions of why the graph embedding can be solved in a certain way. This can serve as an insightful guideline for future research. • We systematically categorize the applications that graph embedding enables and divide the applications as node IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 Graph Embedding Problem Settings Matrix Factorization Graph Laplacian Eigenmaps Homogeneous Graph Heterogeneous Graph Node Proximity Matrix Factorization Deep Learning With Random Walk Graph with Auxiliary Information Without Random Walk Graph Constructed from Non-relational Data Edge Reconstruction Graph Embedding Output Maximize Edge Reconstruct Probability Minimize Distance-based Loss Node Embedding Minimize Margin-based Ranking Loss Edge Embedding Graph Kernel Hybrid Embedding Based on Graphlet Whole-Graph Embedding Based on Subtree Patterns Based on Random Walks Generative Model Embed Graph into Latent Space Incorporate Semantics for Embedding Fig. 2. Graph embedding taxonomies by problems and techniques. related, edge related and graph related. For each category, we present detailed application scenarios as the reference. • We suggest four promising future research directions in the field of graph embedding in terms of computational efficiency, problem settings, solution techniques and applications. For each direction, we provide a thorough analysis of its disadvantages (deficiency) in current work and propose future research direction(s). Organization of The Survey The rest of this survey is organized as follows. In Sec. 2, we introduce the definitions of the basic concepts required to understand the graph embedding problem, and then provide a formal problem definition of graph embedding. In the next two sections, we provide two taxonomies of graph embedding, where the taxonomy structures are illustrated in Fig. 2. Sec. 3 compares the related work based on the problem settings and summarizes the challenges faced in each setting. In Sec. 4, we categorize the literature based on the embedding techniques.The insights behind each technique are abstracted, and a detailed comparison of different techniques is provided at the end. After that, we present the applications that graph embedding enables in Sec. 5. We then discuss four potential future research directions in Sec. 6 and concludes this survey in Sec. 7. 2 P ROBLEM F ORMALIZATION In this section, we first introduce the definition of the basic concepts in graph embedding, and then provide a formal definition of the graph embedding problem. 2.1 TABLE 1 Notations used in this paper. Graph Embedding Techniques Graph Embedding Input 1.2 3 Notation and Definition The detailed descriptions of the notations used in this survey can be found in Table 1. Definition 1. A graph is G = (V, E), where v ∈ V is a node and e ∈ E is an edge. G is associated with a node type mapping function fv : V → T v and an edge type mapping function fe : E → T e . T v and T e denote the set of node types and edge types, respectively. Each node vi ∈ V belongs to one particular type, i.e., fv (vi ) ∈ T v . Similarly, for eij ∈ E , fe (eij ) ∈ T e . Notations |·| G = (V, E) Ĝ = (V̂ , Ê) vi , eij A Ai Ai,j fv (vi ), fe (eij ) T v, T e Nk (vi ) X ∈ R|V |×N yi , yij , yĜ d Descriptions The cardinality of a set Graph G with nodes set V and edges set E A substructure of graph G , where V̂ ⊆ V, Ê ⊆ E A node vi ∈ V and an edge eij ∈ E connecting vi and vj The adjacent matrix of G The i-th row vector of matrix A The i-th row and j -th column in matrix A Type of node vi and type of edge eij The node type set and edge type set 2.4 0.6 The 2 k nearest 1neighbours 3of node vi A feature matrix, each row Xi is a N -dimensional vector for vi The embedding of node vi , edge eij , and structure Ĝ The dimensionality of the embedding A knowledge graph triplet, with head entity h, tail entity t and the relation between them r v < h, r, t > (1) v v5 (2) v v4 v6 sij , sij First- and second-order proximity between node vi and vj c An information cascade G c = (V c , E c ) A cascade graph which adopts the cascade c Alice isFriendOf Bob isSupervisorOf Chris Fig. 3. A toy example of knowledge graph. Definition 2. A homogeneous graph Ghomo = (V, E) is a graph in which |T v | = |T e | = 1. All nodes in G belong to a single type and all edges belong to one single type. Definition 3. A heterogeneous graph Ghete = (V, E) is a graph in which |T v | > 1 and/or |T e | > 1. Definition 4. A knowledge graph Gknow = (V, E) is a directed graph whose nodes are entities and edges are subject-property-object triple facts. Each edge of the form (head entity, relation, tail entity) (denoted as < h, r, t >) indicates a relationship of r from entity h to entity t. h, t ∈ V are entities and r ∈ E is the relation. In this survey, we call < h, r, t > a knowledge graph triplet. For example, in Fig. 3, there are two triplets: < Alice, isF riendOf, Bob > and < Bob, isSupervisorOf, Chris >. Note that the entities and relations in a knowledge graph are usually of different types [14], [15]. Hence, knowledge graph can be viewed as an instance of the heterogeneous graph. The following proximity measures are usually adopted to quantify the graph property to be preserved in the embedded space. The first-order proximity is the local pairwise similarity between only the nodes connected by edges. It compares the direct connection strength between a node pair. Formally, Definition 5. The first-order proximity between node vi and node vj is the weight of the edge eij , i.e., Ai,j . Two nodes are more similar if they are connected by an edge with larger weight. Denote the first-order proximity (1) (1) between node vi and vj as sij , we have sij = Ai,j . Let (1) (1) (1) (1) si = [si1 , si2 , · · · , si|V | ] denote the first-order proximity between vi and other nodes. Take the graph in Fig. 1(a) as an example, the first order between v1 and v2 is the weight of (1) (1) edge e12 , denoted as s12 = 1.2. And s1 records the weight of edges connecting v1 and other nodes in the graph, i.e., (1) s1 = [0, 1.2, 1.5, 0, 0, 0, 0, 0, 0]. Graph Analyti Graph Embedding v2 2.4 v1 0.6 v3 IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 The second-order proximity compares the similarity of the nodes’ neighbourhood structures. The more similar two nodes’ neighbourhoods are, the larger the second-order proximity value between them. Formally, (2) v2 (1) (2) Again, take Fig. 1(a) as an example: s12 is the (1) (1) similarity between s1 and s2 . As introduced before, (1) (1) s1 = [0, 1.2, 1.5, 0, 0, 0, 0, 0, 0] and s2 = [1.2, 0, 0.8, 0, 0, (2) 0, 0, 0, 0]. Let us consider cosine similarities s12 = (1) (1) (2) (1) (1) cosine(s1 , s2 ) = 0.43 and s15 = cosine(s1 , s5 ) = 0. We can see that the second-order proximity between v1 and v5 equals to zero as v1 and v5 do not share any common 1-hop neighbour. v1 and v2 share a common neighbour v3 , (2) hence their second-order proximity s12 is larger than zero. The higher-order proximity can be defined likewise. For example, the k -th-order proximity between node vi and (k−1) (k−1) vj is the similarity between si and sj . Note that sometimes the higher-order proximities are also defined using some other metrics, e.g., Katz Index, Rooted PageRank, Adamic Adar, etc [11]. It is worth noting that, in some work, the first-order and second-order proximities are empirically calculated based on the joint probability and conditional probability of two nodes. More details are discussed in Sect. 4.3.2. Problem 1. Graph embedding: Given the input of a graph G = (V, E), and a predefined dimensionality of the embedding d (d  |V |), the problem of graph embedding is to convert G into a d-dimensional space, in which the graph property is preserved as much as possible. The graph property can be quantified using proximity measures such as the first- and higher-order proximity. Each graph is represented as either a d-dimensional vector (for a whole graph) or a set of d-dimensional vectors with each vector representing the embedding of part of the graph (e.g., node, edge, substructure). Fig. 1 shows a toy example of graph embedding with d = 2. Given an input graph (Fig. 1(a)), the graph embedding algorithms are applied to convert a node (Fig. 1(b))/ edge (Fig. 1(c)), substructure (Fig. 1(d))/ whole-graph (Fig. 1(e)) as a 2D vector (i.e., a point in a 2D space). In the next two sections, we provide two taxonomies of graph embedding, by categorizing the graph embedding literature based on problem settings and embedding techniques respectively. 3 P ROBLEM S ETTINGS OF G RAPH E MBEDDING In this section, we compare existing graph embedding work from the perspective of problem setting, which consists of the embedding input and the embedding output. For each setting, we first introduce different types of graph embedding input or output, and then summarize the challenges faced in each setting at the end. We start with graph embedding input. As a graph embedding setting consists of both input and output, we use node embedding as an example embedding output setting during the introduction of different types of input. The v1 0.6 v3 (a) A weighted graph. v5 v4 v6 (b) A directed graph. Fig. 4. Examples of weighted and directed graphs. Definition 6. The second-order proximity sij between node vi and vj is a similarity between vi ’s neighbourhood si (1) and vj ’s neighborhood sj . 2.4 4 v v v 5 is that 4 although 6 reason there exist various types of embedding output, the majority of graph embedding studies focus on node embedding, i.e., embedding nodes to a low dimensional space where the node similarity in the input graph is preserved. More details about node embedding and other types of embedding output are presented in Sec. 3.2. 3.1 Graph Embedding Input The input of graph embedding is a graph. In this survey, we divide graph embedding input into four categories: homogeneous graph, heterogeneous graph, graph with auxiliary information and constructed graph. Each type of graph poses different challenges to graph embedding. Next, we introduce these four types of input graphs and summarize the challenges faced in each input setting. 3.1.1 Homogeneous Graph The first category of input graph is the homogeneous graph (Def. 2), in which both nodes and edges belong to a single type respectively. The homogeneous graph can be further categorized as the weighted (or directed) and unweighted (or undirected) graph as the example shown in Fig. 4. Undirected and unweighted homogeneous graph is the most basic graph embedding input setting. A number of studies work under this setting, e.g., [1], [16], [17], [18], [19]. They treat all nodes and edges equally, as only the basic structural information of the input graph is available. Intuitively, the weights and directions of the edges provide more information about the graph, and may help represent the graph more accurately in the embedded space. For example, in Fig. 4(a), v1 should be embedded closer to v2 than v3 because the weight of the edge e1,2 is higher. Similarly, v4 in Fig. 4(b) should be embedded closer to v5 than v6 as v4 and v5 are connected in both direction. The above information is lost in the unweighted and undirected graph. Noticing the advantages of exploiting the weight and direction property of the graph edges, the graph embedding community starts to explore the weighted and/or the directed graph. Some of them focus on only one graph property, i.e., either edge weight or edge direction. On the one hand, the weighted graph is considered in [20], [21], [22], [23], [24], [25]. Nodes connected by higher-weighted edges are embedded closer to each other. However, their work is still limited to undirected graphs. On the other hand, some work distinguishes directions of the edges during the embedding process and preserve the direction information in the embedded space. One example of the directed graph is the social network graph, e.g, [26]. Each user has both followership and followeeship with other users. However, the weight information is unavailable for the social user links. Recently, a more general graph embedding algorithm is proposed, in which both weight and direction properties are considered. In other words, these algorithms (e.g., [3], [27], [28]) can process both directed and undirected, as well as weighted and unweighted graph. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 TABLE 2 Graph Embedding Algorithms for cQA sites GE Algorithm [30] [31] [29] [32] Links Exploited user-user, user-question user-user, user-question, question-answer user-user, question-answer, user-answer users’ asymmetric following links, a ordered tuple (i, j, k, o, p) Challenge: How to capture the diversity of connectivity patterns observed in graphs? Since only structural information is available in homogeneous graphs, the challenge of homogeneous graph embedding lies in how to preserve these connectivity patterns observed in the input graphs during embedding. 3.1.2 Heterogeneous Graph The second category of input is the heterogeneous graph (Def. 3), which mainly exist in the three scenarios below. Community-based Question Answering (cQA) sites. cQA is an Internet-based crowdsourcing service that enables users to post questions on a website, which are then answered by other users [29]. Intuitively, there are different types of nodes in a cQA graph, e.g., question, answer, user. Existing cQA graph embedding methods distinguish from each other in terms of the links they exploit as summarized in Table 2, where (i, j, k, o, p) denotes that the j -th answer provided by user k obtains more votes (i.e., thumb-ups) than the o-th answer of user p for question i. Multimedia Networks. A multimedia network is a network containing multimedia data, e.g., image, text, etc. For example, both [33] and [34] embed the graphs containing two types of nodes (image and text) and three types of links (the co-occurrence of image-image, text-text and imagetext). [35] processes a social curation with user node and image node. It exploits user-image links to embed users and images into the same space so that they can be directly compared for image recommendation. In [36], a click graph is considered which contains images and text queries. The image-query edge indicates a click of an image given a query, where the click count serves as the edge weight. Knowledge Graphs. In a knowledge graph (Def. 4), the entities (nodes) and relations (edges) are usually of different types. For example, in a film related knowledge graph constructed from Freebase [37], the types of entities can be “director”, “actor”, “film”, etc. The types of relations can be “produce”, “direct”, “act in”. A lot of efforts have been devoted to embeding knowledge graphs (e.g., [38], [39], [40]). We will introduce them in details in Sec. 4.3.3. Other heterogeneous graphs also exist. For instance, [41] and [42] work on the mobility data graph, in which the station (s), role (r) and company (c) nodes are connected by three types of links (s-s, s-r, s-c). [43] embeds a Wikipedia graph with three types of nodes (entity (e), category (c) and word (w)) and three types of edges (e-e, e-c, w-w). In addition to the above graphs, there are some general heterogeneous graphs in which the types of nodes and edges are not specifically defined [44], [45], [46]. Challenge: How to explore global consistency between different types of objects, and how to deal with the imbalances of objects belonging to different types, if any? Different types of objects (e.g., nodes, edges) are embedded into the same space in heterogeneous graph embedding. How to explore the global 5 TABLE 3 Comparison of Different Types of Auxiliary Information in Graphs Auxiliary Information label attribute Description categorical value of a node/edge, e.g., class information categorical or continuous value of a node/edge, e.g., property information node feature text or image feature for a node information propagation the paths of how the information is propagated in graphs knowledge base text associated with or facts between knowledge concepts consistency between them is a problem. Moreover, there may exist imbalance between objects of different types. This data skewness should be considered in embedding. 3.1.3 Graph with Auxiliary Information The third category of input graph contains auxiliary information of a node/edge/whole-graph in addition to the structural relations of nodes (i.e., E ). Generally, there are five different types of auxiliary information as listed in Table 3. Label: Nodes with different labels should be embedded far away from each other. In order to achieve this, [47] and [48] jointly optimize the embedding objective function together with a classifier function. [49] puts a penalty on the similarity between nodes with different labels. [50] considers node labels and edge labels when calculating different graph kernels. [51] and [52] embed a knowledge graph, in which the entity (node) has a semantic category. [53] embeds a more complicated knowledge graph with the entity categories in a hierarchical structure, e.g., the category “book” has two sub-categories “author” and “written work”. Attribute: In contrast to a label, an attribute value can be discrete or continuous. For example, [54] embeds a graph with discrete node attribute value (e.g., the atomic number in a molecule). In contrast, [4] represents the node attribute as a continuous high-dimensional vector (e.g., user attribute features in social networks). [55] deals with both discrete and continuous attributes for nodes and edges. Node feature: Most node features are text, which are provided either as a feature vector for each node [56], [57] or as a document [58], [59], [60], [61]. For the latter, the documents are further processed to extract feature vectors using techniques such as bag-of-words [58], topic modelling [59], [60], or treating “word” as one type of node [61]. Other types of node features, such as image features [33], are also possible. Node features enhance the graph embedding performance by providing rich and unstructured information, which is available in many real-world graphs. Moreover, it makes inductive graph embedding possible [62]. Information propagation: An example of information propagation is “retweet” in Twitter. In [63], given a data graph G = (V, E), a cascade graph G c = (V c , E c ) is constructed for each cascade c, where V c are the nodes that have adopted c and E c are the edges with both ends in V c . They then embed G c to predict the increment of cascade size. Differently, [64] aims to embed the users and content information, such that the similarity between their embedding indicates a diffusion probability. Topo-LSTM [65] considers a cascade as not merely a sequence of nodes, but a dynamic directed acyclic graphs for embedding. Knowledge base: The popular knowledge bases include Wikipedia [66], Freebase [37], YAGO [67], DBpedia [68], etc. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 Take Wikipedia as an example, the concepts are entities proposed by users and text is the article associated with the entity. [66] uses knowledge base to learn a social knowledge graph from a social network by linking each social network user to a given set of knowledge concepts. [69] represents queries and documents in the entity space (provided by a knowledge base) so that the academic search engine can understand the meaning of research concepts in queries. Other types of auxiliary information include user checkin data (user-location) [70], user item preference ranking list [71], etc. Note that the auxiliary information is not just limited to one type. For instance, [62] and [72] consider both label and node feature information. [73] utilizes node contents and labels to assist the graph embedding process. Challenge: How to incorporate the rich and unstructured information so that the learnt embeddings are both representing the topological structure and discriminative in terms of the auxiliary information? The auxiliary information helps to define node similarity in addition to graph structural information. The challenges of embedding graph with auxiliary information is how to combine these two information sources to define the node similarity to be preserved. 3.1.4 Graph Constructed from Non-relational Data As the last category of input graph is not provided, but constructed from the non-relational input data by different strategies. This usually happens when the input data is assumed to lie in a low dimensional manifold. In most cases, the input is a feature matrix X ∈ R|V |×N where each row Xi is an N -dimensional feature vector for the i-th training instance. A similarity matrix S is constructed by calculating Sij using the similarity between (Xi , Xj ). There are usually two ways to construct a graph from S . A straightforward way is to directly treat S as the adjacency matrix A of an invisible graph [74]. However, [74] is based on the Euclidean distance and it does not consider the neighbouring nodes when calculating Sij . If X lies on or near a curved manifold, the distance between Xi and Xj over the manifold is much larger than their Euclidean distance [12]. To address these issues, other methods (e.g., [75], [76], [77] ) construct a K nearest neighbour (KNN) graph from S first and estimate the adjacency matrix A based on the KNN graph. For example, Isomap [78] incorporates the geodesic distance in A. It first constructs a KNN graph from S , and then finds the shortest path between two nodes as the geodesic distance between them. To reduce the cost of KNN graph construction (O(|V |2 )), [79] constructs an Anchor graph instead, whose cost is O(|V |) in terms of both time and space consumption. They first obtain a set of clustering centers as virtual anchors and find the K nearest anchors of each node for anchor graph construction. Another way of graph construction is to establish edges between nodes based on the nodes’ co-occurrence. For example, to facilitate image related applications (e.g., image segmentation, image classification), researchers (e.g., [80], [81], [82]) construct a graph from each image by treating pixels as nodes and the spatial relations between pixels as edges. [83] extracts three types of nodes (location, time and message) from the GTMS record and therefore forms six types of edges between these nodes. [84] generates a 6 graph using entity mention, target type and text feature as nodes, and establishes three kinds of edges: mention-type, mention-feature and type-type. In addition to the above pairwise similarity based and node co-occurrence based methods, other graph construction strategies have been designed for different purposes. For example, [85] constructs an intrinsic graph to capture the intraclass compactness, and a penalty graph to characterize the interclass separability. The former is constructed by connecting each data point with its neighbours of the same class, while the latter connects the marginal points across different classes. [86] constructs a signed graph to exploit the label information. Two nodes are connected by a positive edge if they belong to the same class, and a negative edge if they are from two classes. [87] includes all instances with a common label into one hyperedge to capture their joint similarity. In [88], two feedback graphs are constructed to gather together relevant pairs and keep away irrelevant ones after embedding. In the positive graph, two nodes are connected if they are both relevant. In the negative graph, two nodes are connected only when one node is relevant and the other is irrelevant. Challenge: How to construct a graph that encodes the pairwise relations between instances and how to preserve the generated node proximity matrix in the embedded space? The first challenge faced by embedding graphs constructed from nonrelational data is how to compute the relations between the non-relational data and construct such a graph. After the graph is constructed, the challenge becomes the same as in other input graphs, i.e., how to preserve the node proximity of the constructed graph in the embedded space. 3.2 Graph Embedding Output The output of graph embedding is a (set of) low dimensional vector(s) representing (part of) a graph. Based on the output granularity, we divide graph embedding output into four categories, including node embedding, edge embedding, hybrid embedding and whole-graph embedding. Different types of embedding facilitate different applications. Unlike embedding input which is fixed and given, the embedding output is task driven. For example, node embedding can benefit a wide variety of node related graph analysis tasks. By representing each node as a vector, the node related tasks such as node clustering, node classification, can be performed efficiently in terms of both time and space. However, graph analytics tasks are not always at node level. In some scenarios, the tasks may be related to higher granularity of a graph, such as node pairs, subgraph, or even a whole graph. Hence, the first challenge in terms of embedding output is how to find a suitable type of embedding output which meets the needs of the specific application task. 3.2.1 Node Embedding As the most common embedding output setting, node embedding represents each node as a vector in a low dimensional space. Nodes that are “close” in the graph are embedded to have similar vector representations. The differences between various graph embedding methods lie in how they define the “closeness” between two nodes. Firstorder proximity (Def. 5) and second-order proximity (Def. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 6) are two commonly adopted metrics for pairwise node similarity calculation. In some work, higher-order proximity is also explored to certain extent. For example, [21] captures the k -step (k = 1, 2, 3, · · · ) neighbours relations in their embedding. Both [1] and [89] consider two nodes belonging to the same community as embedded closer. Challenge: How to define the pairwise node proximity in various types of input graph and how to encode the proximity in the learnt embeddings? The challenges of node embedding mainly come from defining the node proximity in the input graph. In Sec 3.1, we have elaborated the challenges of node embedding with different types of input graphs. Next, we will introduce other types of embedding output as well as the new challenges posed by these outputs. 3.2.2 Edge Embedding In contrast to node embedding, edge embedding aims to represent an edge as a low-dimensional vector. Edge embedding is useful in the following two scenarios. Firstly, knowledge graph embedding (e.g., [90], [91], [92] ) learns embedding for both nodes and edges. Each edge is a triplet < h, r, t > (Def. 4). The embedding is learnt to preserve r between h and t in the embedded space, so that a missing entity/relation can be correctly predicted given the other two components in < h, r, t >. Secondly, some work (e.g., [28], [64]) embeds a node pair as a vector feature to either make the node pair comparable to other nodes or predict the existence of a link between two nodes. For instance, [64] proposes a content-social influential feature to predict user-user interaction probability given a content. It embeds both the user pairs and content in the same space. [28] embeds a pair of nodes using a bootstrapping approach over the node embedding, to facilitate the prediction of whether a link exists between two nodes in a graph. In summary, edge embedding benefits edge (/node pairs) related graph analysis, such as link prediction, knowledge graph entity/relation prediction, etc. Challenge: How to define the edge-level similarity and how to model the asymmetric property of the edges, if any? The edge proximity is different from node proximity as an edge contains a pair of nodes and usually denotes the pairwise node relation. Moreover, unlike nodes, edges may be directed. This asymmetric property should be encoded in the learnt edge representations. 3.2.3 Hybrid Embedding Hybrid embedding is the embedding of a combination of different types of graph components, e.g, node + edge (i.e., substructure), node + community. Substructure embedding has been studied in a quantity of work. For example, [44] embeds the graph structure between two possibly distant nodes to support semantic proximity search. [93] learns the embedding for subgraphs (e.g., graphlets) so as to define the graph kernels for graph classification. [94] utilizes a knowledge base to enrich the information about the answer. It embeds both path and subgraph from the question entity to the answer entity. Compared to subgraph embedding, community embedding has only attracted limited attention. [1] proposes to 7 consider a community-aware proximity for node embedding, such that a node’s embedding is similar to its community’s embedding. ComE [89] also jointly solves node embedding, community detection and community embedding together. Rather than representing a community as a vector, it defines each community embedding as a multivariate Gaussian distribution so as to characterize how its member nodes are distributed. The embedding of substructure or community can also be derived by aggregating the individual node and edge embedding inside it. However, such a kind of “indirect” approach is not optimized to represent the structure. Moreover, node embedding and community embedding can reinforce each other. Better node embedding is learnt by incorporating the community-aware high-order proximity, while better communities are detected when more accurate node embedding is generated. Challenge: How to generate the target substructure and how to embed different types of graph components in one common space? In contrast to other types of embedding output, the target to embed in hybrid embedding (e.g., subgraph, community) is not given. Hence the first challenge is how to generate such kind of embedding target structure. Furthermore, different types of targets (e.g., community, node) may be embedded in one common space simultaneously. How to address the heterogeneity of the embedding target types is a problem. 3.2.4 Whole-Graph Embedding The last type of output is the embedding of a whole graph usually for small graphs, such as proteins, molecules, etc. In this case, a graph is represented as one vector and two similar graphs are embedded to be closer. Whole-graph embedding benefits the graph classification task by providing a straightforward and efficient solution for calculating graph similarities [49], [55], [95]. To establish a compromise between the embedding time (efficiency) and the ability to preserve information (expressiveness), [95] designs a hierarchical graph embedding framework. It thinks that accurate understanding of the global graph information requires the processing of substructures in different scales. A graph pyramid is formed where each level is a summarized graph at different scales. The graph is embedded at all levels and then concatenated into one vector. [63] learns the embedding for a whole cascade graph, and then trains a multi-layer perceptron to predict the increment of the size of the cascade graph in the future. Challenge: How to capture the properties of a whole graph and how to make a trade-off between expressiveness and efficiency? Embedding a whole graph requires capturing the property of a whole graph and is thus more time consuming compared to other types of embedding. The key challenge of whole-graph embedding is how to make a choice between the expressive power of the learnt embedding and the efficiency of the embedding algorithm. 4 G RAPH E MBEDDING T ECHNIQUES In this section, we categorize graph embedding methods based on the techniques used. Generally, graph embedding aims to represent a graph in a low dimensional space which IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 preserves as much graph property information as possible. The differences between different graph embedding algorithms lie in how they define the graph property to be preserved. Different algorithms have different insights of the node(/edge/substructure/whole-graph) similarities and how to preserve them in the embedded space. Next, we will introduce the insight of each graph embedding technique, as well as how they quantify the graph property and solve the graph embedding problem. 4.1 Matrix Factorization Matrix factorization based graph embedding represent graph property (e.g., node pairwise similarity) in the form of a matrix and factorize this matrix to obtain node embedding [11]. The pioneering studies in graph embedding usually solve graph embedding in this way. In most cases, the input is a graph constructed from non-relational high dimensional data features as introduced in Sec. 3.1.4. And the output is a set of node embedding (Sec. 3.2.1). The problem of graph embedding can thus be treated as a structure-preserving dimensionality reduction problem which assumes the input data lie in a low dimensional manifold. There are two types of matrix factorization based graph embedding. One is to factorize graph Laplacian eigenmaps, and the other is to directly factorize the node proximity matrix. 4.1.1 Graph Laplacian Eigenmaps Insight: The graph property to be preserved can be interpreted as pairwise node similarities. Thus, a larger penalty is imposed if two nodes with larger similarity are embedded far apart. Based on the above insight, the optimal embedding y can be derived by the below objective function [99]. X (yi − yj 2 Wij ) = arg min y T Ly, (1) y ∗ = arg min i6=j where Wij is the “defined” similarity between node vi and vj ; L = D − W is the P graph Laplacian. D is the diagonal matrix where Dii = j6=i Wij . The bigger the value of Dii , the more important yi is [97]. A constraint y T Dy = 1 is usually imposed on Eq. 1 to remove an arbitrary scaling factor in the embedding. Eq. 1 then reduces to: yT W y y T Ly y ∗ = arg min y T Ly = arg min T = arg max T . y Dy y Dy y T Dy=1 (2) The optimal y ’s are the eigenvectors corresponding to the maximum eigenvalue of the eigenproblem W y = λDy . The above graph embedding is transductive because it can only embed the nodes that exist in the training set. In practice, it might also need to embed the new coming nodes that have not been seen in training. One solution is to design a linear function y = X T a so that the embedding can be derived as long as the node feature is provided. Consequently, for inductive graph embedding, Eq. 1 becomes finding the optimal a in the below objective function: X 2 a∗ = arg min kaTXi −aTXjk Wij = arg min aTXLX Ta. i6=j (3) Similar to Eq. 2, by adding the constraint aT XDX T a = 1, the problem in Eq. 3 becomes: a∗ = arg min aT XLX T a aT XW X T a = arg max T . T T a XDX a a XDX T a (4) 8 The optimal a’s are eigenvectors with the maximum eigenvalues in solving XW X T a = λXDX T a. The differences of existing studies mainly lie in how they calculate the pairwise node similarity Wij , and whether they use a linear function y = X T a or not. Some attempts [81], [85] have been made to summarize existing Laplacian eigenmaps based graph embedding methods using a general framework. But their surveys only cover a limited quantity of work. In Table 4, we summarize existing Laplacian eigenmaps based graph embedding studies and compare how they calculate W and what objective function they adopt. The initial study MDS [74] directly adopted the Euclidean distance between two feature vectors Xi and Xj as Wij . Eq. 2 is used to find the optimal embedding y ’s. MDS does not consider the neighbourhood of nodes, i.e., any pair of training instances are considered as connected. The follow-up studies (e.g., [78], [96], [97], [102]) overcome this problem by first constructing a k nearest neighbour (KNN) graph from the data feature. Each node is only connected with its top k similar neighbours. After that, different methods are utilized to calculate the similarity matrix W so as to preserve as much desired graph property as possible. Some more advanced models are design recently. For example, AgLPP [79] introduces an anchor graph to significantly improve the efficiency of earlier matrix factorization model LPP. LGRM [98] learns a local regression model to grasp the graph structure and a global regression term for out-ofsample data extrapolation. Finally, different from previous works preserving local geometry, LSE [103] uses local spline regression to preserve global geometry. When auxiliary information (e.g., label, attribute) is available, the objective function is adjusted to preserve the richer information. E.g., [99] constructs an adjacency graph W and a labelled graph W SR . The objective function consists of two parts, one focuses on preserving the local geometric structure of the datasets as in LPP [97], and the other tries to get the embedding with the best class separability on the labelled training data. Similarly, [88] also constructs two graphs, an adjacency graph W which encodes local geometric structures and a feedback relational graph W ARE that encodes the pairwise relations in users’ relevance feedbacks. RF-Semi-NMF-PCA [101] simultaneously consider clustering, dimensionality reduction and graph embedding by constructing an objective function that consists of three components: PCA, k-means and graph Laplacian regularization. Some other work thinks that W cannot be constructed by easily enumerating pairwise node relationships. Instead, they adopt semidefinite programming (SDP) to learn W . Specifically, SDP [104] aims to find an inner product matrix that maximizes the pairwise distances between any two inputs which are not connected in the graph while preserving the nearest neighbors distances. MVU [100] constructs such matrix and then applies MDS [74] on the learned inner product matrix. [2] proves that regularized LPP [97] is equivalent to regularized SR [99] if W is symmetric, doubly stochastic, PSD and with rank p. It constructs such kind of similarity matrix so as to solve LPP liked problem efficiently. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 9 TABLE 4 Graph Laplacian eigenmaps based graph embedding. GE Algorithm MDS [74] Isomap [78] W Wij = Euclidean distance (Xi , Xj ) KNN, Wij is the sum of edge weights along the shortest path between vi and vj LE [96] KNN, Wij = exp( ) LPP [97] KNN, Wij = ) AgLPP [79] anchor graph, W = ZΛ LGRM [98] ARE [88] SR [99] HSL [87] MVU [100] SLE [86] NSHLRR [76] [77] KNN, Wij = kXi −Xj k2 2t2 kX −X k2 exp( i t j −1 T Eq. 4 P Zik , Zik = K (Xi ,Uk ) P σ j Kσ (Xi ,Uj ) kXi −Xj k2 2t2 y ∗ = arg min a∗ = arg max aT XLARE X T a aT XLX T a aT XW SR X T a aT X(D SR +L)X T a a∗ = arg max a∗ = arg max tr(aT XSX T a), s.t. aT XX T a = Ik Eq. 2 Eq. 4 y ∗ = arg min Eq. 2 P W (e) kyi − yj k2 d(e) e y ∗ = arg min P y T y=1 i6=j Wij min(kyi − yj kp 2 , θ) Eq. 4 +(must-link and cannot link constraints) Eq. 2 +O (PCA) + O (kmeans) ) Node Proximity Matrix Factorization In addition to solving the above generalized eigenvalue problem, another line of studies tries to directly factorize node proximity matrix. Insight: Node proximity can be approximated in a lowdimensional space using matrix factorization. The objective of preserving node proximity is to minimize the loss of approximation. Given the node proximity matrix W , the objective is: min kW − Y Y c T k, aT U LU T a aT U DU T a T y (Lle +µLg )y yT y a∗ = arg min )  + +  −γ, Xi ∈ F &Xj ∈ F −ρ2 (Xi Xj ) ARE KNN, Wij = exp( ) , W = 1, L(X ) = 6 L(X ) i j ij t  0, otherwise F + denotes the images relevant to a query, γ controls the unbalanced feedback    1, L(Xi ) = L(Xj ) 1/lr , L(Xi ) = L(Xj ) = Cr SR = KNN, Wij = 0, L(Xi ) 6= L(Xj ) Wij 0, otherwise  Wij , otherwise Cr is the r -th class, lr =|Xi ∈ X : L(Xi ) = Cr | S = I − L, where L is normalized hypergraph Laplacian P KNN, W ∗ = arg max tr(W ), s.t. W ≥ 0, ij Wij = 0 and ∀i, j , where Wii − 2Wij + Wjj = kXi − Xj k2  1/lr , L(Xi ) = L(Xj ) = Cr KNN, Wij = −1, L(Xi ) 6= L(Xj ) Cr is the r -th class, lr =|Xi ∈ X : L(Xi ) = Cr | normal graph: KNN, Wij = 1 hypergraph:  W (e) is the weight of a hyperedge e P 1, v ∈ e h(v, e) = , d(e) = v∈V h(v, e) 0, otherwise  2 kXi −Xm+1 k2 −kX −X k  i j 2 2 Pk 2,j ≤ k kkXi −Xk+1 k2 Wij = 2 − m=1 kXi −Xk k2  0, j > k PUFS [75] KNN, Wij = exp(− RF-Semi-NMF-PCA [101] KNN , Wij = 1 4.1.2 Eq. 2 Z , Λkk = kX −X k2 exp( i 2t2 j Objective Function Eq. 2 Eq. 2 (5) where Y ∈ R|V |×d is the node embedding, and Y c ∈ R|V |×d is the embedding for the context nodes [21]. Eq. 5 aims to find an optimal rank-d approximation of the proximity matrix W (d is the dimensionality of the embedding). One popular solution is to apply SVD (Singular Value Decomposition) on W [110]. Formally, P|V | P W = i=1 σi ui uci T ≈ di=1 σi ui uci T , (6) where {σ1 , σ2 , · · · , σ|V | } are the singular values sorted in descending order, ui and uci are singular vectors of σi . The optimal embedding is obtained using the largest d singular values and corresponding singular vectors as follows: √ √ Y = [ σ1 u1 , · · · , σd ud ], (7) √ √ Y c = [ σ1 uc1 , · · · , σd ucd ]. Depending on whether the asymmetric property is preserved or not, the embedding of node i is either yi = Yi [21], [50], or the concatenation of Yi and Yic , i.e., yi = [Yi , Yic ] [106]. There exist other solutions for Eq. 5, such as regularized Gaussian matrix factorization [24], low-rank matrix factorization [56], and adding other regularizers to enforce more constraints [48]. We summarize all the node proximity matrix factorization based graph embedding in Table 5. Summary: Matrix Factorization (MF) is mostly used to embed a graph constructed from non-relational data (Sec. 3.1.4) for node embedding (Sec. 3.2.1), which is the typical setting of graph Laplacian eigenmap problems. MF is also used to embed homogeneous graphs [24], [50] (Sec. 3.1.1). 4.2 Deep Learning Deep learning (DL) has shown outstanding performance in a wide variety of research fields, such as computer vision, language modeling, etc. DL based graph embedding applies DL models on graphs. These models are either a direct adoption from other fields or a new neural network model specifically designed for embedding graph data. The input is either paths sampled from a graph or the whole graph itself. Consequently, we divide the DL based graph embedding into two categories based on whether random walk is adopted to sample paths from a graph. 4.2.1 DL based Graph Embedding with Random Walk Insight: The second-order proximity in a graph can be preserved in the embedded space by maximizing the probability of observing the neighbourhood of a node conditioned on its embedding. In the first category of deep learning based graph embedding, a graph is represented as a set of random walk paths sampled from it. The deep learning methods are then applied to the sampled paths for graph embedding which preserves graph properties carried by the paths. In view of the above insight, DeepWalk [17] adopts a neural language model (SkipGram) for graph embedding. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 10 TABLE 5 Node proximity matrix factorization based graph embedding. O(∗) denotes the objective function; e.g., O(SVM classifier) denotes the objective function of a SVM classifier. GE Algorithm W  [50] SPE [105] HOPE [106] GraRep [21] CMF [43] TADW [56] [24] MMDW [48] HSCA [57] MVE [107] M-NMF [1] ULGE [2] Wij = KNN, W ∗ Objective Function . 1, eij ∈ E 0, otherwise = arg max tr(W Â), s.t. Dij > (1 − Âij )max(Âim Dim ) Eq. 5 Eq. 5 m k≥0  is a connectivity matrix that describes local pairwise distances Katz Index W = (I − βA)−1 βA; Personalized Pagerank W = (1 − α)(I − αP )−1 P Eq. 5 Common neighbors W = A2 ; Adamic-Adar W = A(1/ j (Aij + Aji ))A  P k  k p Aip , i = j Wij Eq. 5 = log( P ijk ) − log( |Vλ | ), where  = D −1 S , Dij = 0, i 6= j t Âij PPMI Eq. 5 PMI Eq. 5 with text feature matrix P A y ∗ = arg min e ∈E (Aij − < yi , yj >)2 + ij PMI PMI P PN T T KNN, W ∗ = arg min tr(W ( d i=1 υi υi + i=d+1 υi υi )) where υi is eigenvector of a pairwise distance matrix, d is embedding dimensionality W = s(1) + 5s(2) W = Z∆−1 Z T , where Z ∗ = arg min z T 1=1,zi ≥0 i Pm j=1 kXi − uj k22 zij + γ kyi k2 Eq. 5 + O (SVM classifier) O (MMDW) + (1st order proximity constraint) Eq. 5 Eq. 5 + O (community detection) + (community proximity constraint) a∗ = arg min kaT X − Fp k2F + αkak2F 2 zij k (8) where w is the window size which restricts the size of random walk context. SkipGram removes the ordering constraint, and Eq. 8 is transformed to: P miny − log −w≤j≤w P (vi+j |yi ), (9) where P (vi+j |yi ) is defined using the softmax function: T exp(yi+j yi ) . P|V | T exp(y k=1 k yi ) i k min kF − F W T k2F + βkP T X − F k2F , s.t. P T P = I SikpGram [111] aims to maximize the co-occurrence probability among the words that appear within a window w. DeepWalk first samples a set of paths from the input graph using truncated random walk (i.e., uniformly sample a neighbour of the last visited node until the maximum length is reached). Each path sampled from the graph corresponds to a sentence from the corpus, where a node corresponds to a word. Then SkipGram is applied on the paths to maximize the probability of observing a node’s neighbourhood conditioned on its embedding. In this way, nodes with similar neighbourhoods (having large second-order proximity values) share similar embedding. The objective function of DeepWalk is as follows: P (vi+j |yi ) = j=1 P whereFp is the top p eigenvectors of W P P y ∗ = arg min i kyi − j Wij yj k2 P P kWk − Y Rk Y T k2F + λ(kY k2F + kRk k2F ) min P P KNN, W ∗ = arg min i kXi − j Wij Xj k2  1, (hi , rj , tk ) exists RESCAL [108] Wijk = 0, otherwise P P FONPE [109] KNN, W ∗ = arg min i kXi − j Wij Xj k2 LLE [102] miny − log P ({vi−w , · · · , vi−1 , vi+1 , · · · , vi+w }|yi ), Pm λ 2 (10) Note that calculating Eq. 10 is not feasible as the normalization factor (i.e., the summation over all inner product with every node in a graph) is expensive. There are usually two solutions to approximate the full softmax: hierarchical softmax [112] and negative sampling [112]. Hierarchical softmax: To efficiently solve Eq. 10, a binary tree is constructed in which the nodes are assigned to the leaves. Instead of enumerating all nodes as in Eq. 10, only the path from the root to the corresponding leaf needs to be evaluated. The optimization problem becomes maximizing the probability of a specific path in the tree. Suppose the path to leaf vi is a sequence of nodes (b0 , b1 , · · · , blog(|V |) ), where b0 = root, blog(|V |) = vi . Eq. 10 then becomes: Qlog(|V |) P (vi+j |yi ) = t=1 P (bt |yi ), (11) where P (bt ) is a binary classifier: P (bt |vi ) = σ(ybTt yi ). σ(·) denotes the sigmoid function. ybt is the embedding of tree node bt ’s parent. The hierarchical softmax reduces time complexity of SkipGram from O(|V |2 ) to O(|V |log(|V |)). Negative sampling: The key idea of negative sampling is to distinguish the target node from noises using logistic regression. I.e., for a node vi , we want to distinguish its neighbour vi+j from other nodes. A noise distribution Pn (vi ) is designed to draw the negative samples for node vi . Each log P (vi+j |yi ) in Eq. 9 is then calculated as: P T T log σ(yi+j yi ) + K (12) t=1 Evt ∼Pn [log σ(−yvt yi )], where K is the number of negative nodes that are sampled. Pn (vi ) is a noise distribution, e.g., a uniform distribution (Pn (vi ) ∼ |V1 | , ∀vi ∈ V ). The time complexity of SkipGram with negative sampling is O(K|V |). The success of DeepWalk [17] motivates many subsequent studies which apply deep learning models (e.g., SkipGram or Long-Short Term Memory (LSTM) [115]) on the sampled paths for graph embedding. We summarize them in Table 6. As shown in the table, most studies follow the idea of DeepWalk but change the settings of either random walk sampling methods ( [25], [28], [62], [62]) or proximity (Def. 5 and Def. 6) to be preserved ( [34], [47], [62], [66], [73]). [46] designs meta-path-based random walks to deal with heterogeneous graphs and a heterogeneous SkipGram which maximizes the probability of having the hetegeneous context for a given node. Apart from SkipGram, LSTM is another popular deep learning model adopted in graph embedding. Note that SkipGram can only embed one single node. However, sometimes we may need to embed a IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 TABLE 6 Deep Learning based graph embedding with random walk paths. GE Algorithm DeepWalk [17] [34] GenVector [66] Ransom Walk Methods truncated random walk truncated random walk truncated random walk Preserved Proximity 2nd 2nd (word-image) 2nd (user-user & concept-concept) sampling with edge weight 2nd DL Model SkipGram with Constrained hierarchical DeepWalk [25] softmax nd DDRW [47] truncated random walk 2 + class identity (Eq. 11) TriDNR [73] truncated random walk 2nd (among node, word & label) node2vec [28] BFS + DFS 2nd UPP-SNE [113] truncated random walk 2nd (user-user & SkipGram profile-profile) with Planetoid [62] sampling node pairs by la- 2nd + label identity negative bels and structure sampling NBNE [19] sampling direct neighbours 2nd (Eq. 12) of a node DGK [93] graphlet kernel: random 2nd (by graphlet) SkipGram sampling [114] (Eqs. 11–12 ) metapath2vec meta-path based random 2nd heterogeneous [46] walk SkipGram ProxEmbed [44] truncate random walk node ranking tuples HSNL [29] truncate random walk 2nd + QA ranking LSTM tuples RMNL [30] truncated random walk 2nd + user-question quality ranking DeepCas [63] Markov chain based ran- information cascade GRU dom walk sequence MRW-MN [36] truncated random walk 2nd + cross-modal DCNN+ feature difference SkipGram sequence of nodes as a fixed length vector, e.g., represent a sentence (i.e., a sequence of words) as one vector. LSTM is then adopted in such scenarios to embed a node sequence. For example, [29] and [30] embed the sentences from questions/answers in cQA sites, and [44] embeds a sequence of nodes between two nodes for proximity embedding. A ranking loss function is optimized in these work to preserve the ranking scores in the training data. In [63], GRU [116] (i.e., a recurrent neural network model similar to LSTM) is used to embed information cascade paths. 4.2.2 DL based Graph Embedding without Random Walk Insight:The multi-layered learning architecture is a robust and effective solution to encode the graph into a low dimensional space. The second class of deep learning based graph embedding methods applies deep models on a whole graph (or a proximity matrix of a whole graph) directly. Below are some popular deep learning models used in graph embedding. Autoencoder: An autoencoder aims to minimize the reconstruction error of the output and input by its encoder and decoder. Both encoder and decoder contain multiple nonlinear functions. The encoder maps input data to a representation space and the decoder maps the representation space to a reconstruction space. The idea of adopting autoencoder for graph embedding is similar to node proximity matrix factorization (Sec. 4.1.2) in terms of neighbourhood preservation. Specifically, the adjacency matrix captures a node’s neighbourhood. If we input the adjacency matrix to an autoencoder, the reconstruction process will make the nodes with similar neighbourhood have similar embedding. Deep Neural Network: As a popular deep learning model, Convolutional Neural Network (CNN) and its variants have been widely adopted in graph embedding. On 11 TABLE 7 Deep learning based graph embedding without random walk paths. GE Algorithm SDNE [20] DNGR [23] SAE [22] [55] SCNN [118] [119] Deep Learning Model autoencoder stacked denoising autoencoder sparse autoencoder CNN Spectral CNN Spectral CNN with smooth spectral multipliers MoNet [80] Mixture model network ChebNet [82] Graph CNN a.k.a. ChebNet GCN [72] Graph Convolutional Network GNN [120] Graph Neural Network [121] adapted Graph Neural Network GGS-NNs [122] adapted Graph Neural Network HNE [33] CNN + FC DUIF [35] a hierarchical deep model ProjE [40] a neural network model TIGraNet [123] Graph Convolutional Network Model Input A PPMI D −1 A node sequence graph graph graph graph graph graph molecules graph graph graph with image and text social curation network knowledge graph graph constructed from images the one hand, some of them directly use the original CNN model designed for Euclidean domains and reformat input graphs to fit it. E.g., [55] uses graph labelling to select a fixed-length node sequence from a graph and then assembles nodes’ neighbourhood to learn a neighbourhood representation with the CNN model. On the other hand, some other work attempts to generalize the deep neural model to non-Euclidean domains (e.g., graphs). [117] summarizes the representative studies in their survey. Generally, the differences between these approaches lie in the way they formulate a convolution-like operation on graphs. One way is to emulate the Convolution Theorem to define the convolution in the spectral domain [118], [119]. Another is to treat the convolution as neighborhood matching in the spatial domain [72], [82], [120]. Others: There are some other types of deep learning based graph embedding methods. E.g., [35] proposes DUIF, which uses a hierarchical softmax as a forward propagation to maximize the modularity. HNE [33] utilizes deep learning techniques to capture the interactions between heterogeneous components, e.g., CNN for image and FC layers for text. ProjE [40] designs a neural network with a combination layer and a projection layer. It defines a pointwise loss (similar to multi-class classification) and a listwise loss (i.e., softmax regression loss) for knowledge graph embedding. We summarize all deep learning based graph embedding methods (random walk free) in Table 7, and compare the models they use as well as the input for each model. Summary: Due to its robustness and effectiveness, deep learning has been widely used in graph embedding. Three types of input graphs (except for graph constructed from non-relational data (Sec. 3.1.4)) and all the four types of embedding output have been observed in deep learning based graph embedding methods. 4.3 Edge Reconstruction based Optimization Overall Insight: The edges established based on node embedding should be as similar to those in the input graph as possible. The third category of graph embedding techniques directly optimizes an edge reconstruction based objective functions, by either maximizing edge reconstruction probability or minimizing edge reconstruction loss. The later is IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 further divided into distance-based loss and margin-based ranking loss. Next, we introduce the three types one by one. 4.3.1 Maximizing Edge Reconstruction Probability Insight: Good node embedding maximizes the probability of generating the observed edges in a graph. Good node embedding should be able to re-establish edges in the original input graph. This can be realized by maximizing the probability of generating all observed edges (i.e., node pairwise proximity) using node embedding. The direct edge between a node pair vi and vj indicates their first-order proximity, which can be calculated as the joint probability using the embedding of vi and vj : p(1) (vi , vj ) = 1 1+exp(−yi T yj ) . (13) The above first-order proximity exists between any pair of connected nodes in a graph. To learn the embedding, we maximize the log-likelihood of observing these proximities in a graph. The objective function is then defined as: P (1) Omax = max eij ∈E log p(1) (vi , vj ). (14) Similarly, second-order proximity of vi and vj is the conditional probability of vj generated by vi using yi and yj : p(2) (vj |vi ) = exp(yjT yi ) . P|V | T k=1 exp(yk yi ) (15) It can be interpreted as the probability of a random walk in a graph which starts from vi and ends with vj . Hence the graph embedding objective function is: P (2) Omax = max {vi ,vj }∈P log p(2) (vj |vi ), (16) where P is a set of {start node, end node} in the paths sampled from the graph, i.e., the two end nodes from each sampled path. This simulates the second-order proximity as the probability of a random walk starting from the start node and ending with the end node. 4.3.2 Minimizing Distance-based Loss Insight: The node proximity calculated based on node embedding should be as close to the node proximity calculated based on the observed edges as possible. Specifically, node proximity can be calculated based on node embedding or empirically calculated based on observed edges. Minimizing the differences between the two types of proximities preserves the corresponding proximity. For the first-order proximity, it can be computed using node embedding as defined in PEq. 13. The empirical probability is p̂(1) (vi , vj ) = Aij / eij ∈E Aij , where Aij is the weight of edge eij . The smaller the distance between p(1) and p̂(1) is, the better first-order proximity is preserved. Adopting KL-divergence as the distance function to calculate the differences between p(1) and p̂(1) and omitting some constants, the objective function to preserve the first-order proximity in graph embedding is: P (1) Omin = min − eij ∈E Aij log p(1) (vi , vj ). (17) Similarly, the second-order proximity of vi and vj is the conditional probability of vj generated by node vi (Eq. 15). The empirical probability of p̂(2)P (vi |vj ) is calculated as p̂(2) (vj |vi ) = Aij /di , where di = eik ∈E Aik is the outdegree (or degree in the case of undirected graph) of node 12 TABLE 8 Edge reconstruction based graph embedding. O∗∗ (Tvvi , Tvvj ) refers to (2) one of Eq. 14, Eq. 16 ∼ Eq. 19; e.g., Omin (word-label) refers to Eq. 18 with a word node and a label node. Tvvi denote the type of node vi . GE Algorithm PALE [18] NRCL [4] Objectives Order of Proximity (1) Omax (node, node) Orank (node, neighbour node) + O (attribute loss) 1st (2) (2) Omin (word, word) + Omin (word, document) + (2) Omin (word, label) (2) APP [3] Omax (node, node)) (2) (2) GraphEmbed Omin (word, word) + Omin (word, time) + (2) (2) [83] Omin (word, location) + Omin (time, location) + (2) (2) Omin (location, location) + Omin (time, time) (2) (2) [41], [42] Omin (station, company), Omin (station, role), (2) Omin (destination, boarding) nd (2) PLE [84] Orank (mention-type) + Omin (mention, feature) + 2 (2) Omin (type, type) (2) IONE [26] Omin (node, node) + O (anchor align) (2) HEBE [45] Omin (node, other nodes in one hyperedge) (2) (2) GAKE [38] Omax (node, neighbour context)+Omax (node, path (2) context)+Omax (node, edge context) (2) CSIF [64] Omax (user pair, diffused content) (2) (2) ESR [69] Omax (entity, author) + Omax (entity, entity) + (2) (2) Omax (entity, words) + Omax (entity, venue) PTE [124] line [27] EBPR [71] [94] (1) (2) Omin (node, node) + Omin (node, node)) 1st + 2nd (2) (2) O (AUC ranking) + Omax (node, node) + Omax (node, node context) Orank (question, answer) 1st + 2nd + higher vi . Similar to Eq. 10, it is very expensive to calculate Eq. 15 and negative sampling is again adopted for approximate computation to improve the efficiency. By minimizing the KL divergence between p(2) (vj |vi ) and p̂(2) (vj |vi ), the objective function to preserve second-order proximity is: P (2) Omin = min − eij ∈E Aij log p(2) (vj |vi ). (18) 4.3.3 Minimizing Margin-based Ranking Loss In the margin-based ranking loss optimization, the edges of the input graph indicate the relevance between a node pair. Some nodes in the graph are usually associated with a set of relevant nodes. E.g., in a cQA site, a set of answers are marked as relevant to a given question. The insight of the loss is straightforward. Insight: A node’s embedding is more similar to the embedding of relevant nodes than that of any other irrelevant node. Denote s(vi , vj ) as the similarity score for node vi and vj , Vi+ as the set of nodes relevant to vi and Vi− as the irrelevant nodes set. The margin-based ranking loss is defined as: P P Orank = min max{0, γ−s(vi , vi+ )+s(vi , vi− )}, vi+ ∈Vi+ vi− ∈Vi− (19) where γ is the margin. Minimizing the loss rank encourages a large margin between s(vi , vi+ ) and s(vi , vi− ), and thus enforces vi to be embedded closer to its relevant nodes than to any other irrelevant nodes. In Table 8, we summarize existing edge reconstruction based graph embedding methods, based on their objective functions and preserved node proximity. In general, most methods use one of the above objective functions (Eq. 14, Eq. 16 ∼ Eq. 19). [71] optimizes an AUC ranking loss, which is a substitution loss for margin based ranking loss (Eq. 19). IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 TABLE 9 Knowledge graph embedding using margin-based ranking loss. GE Algorithm TransE [91] TKRL [53] TransR [15] CTransR [15] TransH [14] SePLi [39] TransD [125] TranSparse [126] m-TransH [127] Energy Function fr (h, t) kh + r − tkl1 kMrh h + r − Mrt tk khMr + r − tMr k22 khMr + rc − tMr k22 + αkrc − rk22 k(h − wrT hwr ) + dr − (t − wrT twr )k22 2 1 2 kWi eih + bi − eit k 2 kMrh h + r − Mrt tk2 kMrh (θrh )h + r − Mrt (θrt )tk2l /2 1 k P ρ∈M(Rr ) ar (ρ)Pnr (t(ρ)) + br k2 , t ∈ N M(Rr ) khd + r − td k + khd + r − ts k + khs + r − td k Sphere: kϕ(h) + ϕ(r) − ϕ(t)k2 Hyperplane: (ϕ(h) + ϕ(rhead ))T (ϕ(t) + ϕ(rtail )) ϕ is the mapping function to Hilbert space TransA [130] kh + r − tk puTransE [43] kh + r − tk KGE-LDA [60] kh + r − tkl1 SE [90] kRu h − Ru tkl1 SME [92] linear (Wu1 r + Wu2 h + bu )T (Wv1 r + Wv2 t + bv ) SME [92] bilinear (Wu1 r + Wu2 h + bu )T (Wv1 r + Wv2 t + bv ) DKRL [128] ManifoldE [129] SSP [59] NTN [131] HOLE [132] MTransE [133] −λke − sT esk22 + kek22 , S(sh , st ) = sh +st ksh +st k2 2 T uT r tanh(h Wr t + Wrh h + Wrt t + br ) r T (h ? t), where ? is circular correlation kh + r − tkl1 Note that when another task is simultaneously optimized during graph embedding, that task-specific objective will be incorporated in the overall objective. For instance, [26] aims to align two graphs. Hence an network alignment objective (2) function is optimized together with Omin (Eq. 18). It is worth noting that most of the existing knowledge graph embedding methods choose to optimize marginbased ranking loss. Recall that a knowledge graph G consists of a set of triplets < h, r, t > denoting the head entity h is linked to a tail entity t by a relation r. Embedding G can be interpreted as preserving the ranking of a true triplet < h, r, t > over a false triplet < h0 , r, t0 > that does not exist in G . Particularly, in knowledge graph embedding, similar to s(vi , vi+ ) in Eq. 19, an energy function is designed for a triplet < h, r, t > as fr (h, t). There is a slight difference between these two functions. s(vi , vi+ ) denotes the similarity score between the embedding of node vi and vi+ , while fr (h, t) is the distance score of the embedding of h and t in terms of relation r. One example of fr (h, t) is kh + r − tkl1 , where relationships are represented as translations in the embedded space [91]. Other options of fr (h, t) are summarized in Table 9. Consequently, for knowledge graph embedding, Eq. 19 becomes: P kg Orank = min max{0, γ + fr (h, t) − fr (h0 , t0 )}, <h,r,t>∈S, <h0 ,r,t0 >∈S / (20) where S is the triples in the input knowledge graph. Existing knowledge graph embedding methods mainly optimize Eq. 20 in their work. The difference among them is how they define fr (h, t) as summarized in Table 9. More details about the related work in knowledge graph embedding has been thoroughly reviewed in [13]. Note that some studies jointly optimize the ranking loss (Eq. 20) and other objectives to preserve more information. E.g., SSP [59] optimizes a topic model loss together with 13 Eq. 20 to utilize textual node descriptions for embedding. [133] categorizes monolingual relations and uses linear transformation to learn cross-lingual alignment for entities and relations. There also exists some work which defines a matching degree score rather than an energy function for a triplet < h, r, t >. E.g., [134] defines a bilinear score function vhT Wr vt It adds a normality constraint and a commutativity constraint to impose analogical structures among the embedding. ComplEx [135] extends embedding to complex domain and defines the real part of vhT Wr vt as the score. Summary: Edge reconstruction based optimization is applicable for most graph embedding settings. As far as can be observed, only graph constructed from non-relational data (Sec. 3.1.4) and whole-graph embedding (Sec. 3.2.4) have not been tried. The reason is that reconstructing manually constructed edges is not as intuitive as in other graphs. Moreover, as this technique focuses on the directly observed local edges, it is not suitable for whole-graph embedding. 4.4 Graph Kernel Insight: The whole graph structure can be represented as a vector containing the counts of elementary substructures that are decomposed from it. Graph kernel is an instance of R-convolution kernels [136], which is a generic way of defining kernels on discrete compound objects by recursively decomposing structured objects into “atomic” substructures and comparing all pairs of them [93]. The graph kernel represents each graph as a vector, and two graphs are compared using an inner product of the two vectors. There are generally three types of “atomic” substructures defined in graph kernel. Graphlet. A graphlet is an induced and non-isomorphic subgraph of size-k [93]. Suppose graph G is decomposed into a set of graphlets {G1 , G2 , · · · , Gd }. Then G is embedded as a d-dimensional vector (denoted as yG ) of normalized counts. The i-th dimension of yG is the frequency of the graphlet Gi occurring in G . Subtree Patterns. In this kernel, a graph is decomposed as its subtree patterns. One example is Weisfeiler-Lehman subtree [49]. In particular, a relabelling iteration process is conducted on a labelled graph (i.e., a graph with discrete node labels). At each iteration, a multiset label is generated based on the label of a node and its neighbours. The new generated multiset label is a compressed label which denotes the subtree patterns, which is then used for the next iteration. Based on Weisfeiler-Lehman test of graph isomorphism, counting the occurrence of labels in a graph is equivalent to counting the corresponding subtree structures. Suppose h iterations of relabelling are performed on graph G . Its embedding yG contains h blocks. The i-th dimension in the j -th block of yG is the frequency of the i-th label being assigned to a node in the j -th iteration. Random Walks. In the third type of graph kernels, a graph is decomposed into random walks or paths and represented as the counts of occurrence of random walks [137] or paths [138] in it. Take paths as an example, suppose graph G is decomposed into d shortest paths. Denote the i-th path as a triplet < lis , lie , ni >, where lis and lie are the labels of the starting and ending nodes, ni is the length of the path. Then IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 G is represented as a d-dimensional vector yG where the i-th dimension is the frequency of the i-th triplet occurring in G . Summary: A graph kernel is designed for whole-graph embedding (Sec. 3.2.4) only as it captures the global property of a whole graph. The type of input graph is usually a homogeneous graph (Sec. 3.1.1) [93] or a graph with auxiliary information (Sec. 3.1.3) [49]. 4.5 Generative Model A generative model can be defined by specifying the joint distribution of the input features and the class labels, conditioned on a set of parameters [139]. An example is Latent Dirichlet Allocation (LDA), in which a document is interpreted as a distribution over topics, and a topic is a distribution over words [140]. There are the following two ways to adopt a generative model for graph embedding. 4.5.1 Embed Graph Into The Latent Semantic Space Insight: Nodes are embedded into a latent semantic space where the distances among nodes explain the observed graph structure. The first type of generative model based graph embedding methods directly embeds a graph in the latent space. Each node is represented as a vector of the latent variables. In other words, it views the observed graph as generated by a model. E.g., in LDA, documents are embedded in a “topic” space where documents with similar words have similar topic vector representations. [70] designs a LDAlike model to embed a location-based social network (LBSN) graph. Specifically, the input is locations (documents), each of which contains a set of users (words) who visited that location. Users visit the same location (words appearing in the same document) due to some activities (topics). Then a model is designed to represent a location as a distribution over activities, where each activity has an attractiveness distribution over users. Consequently, both user and location are represented as a vector in the “activity” space. 4.5.2 Incorporate Latent Semantics for Graph Embedding Insight: Nodes which are close in the graph and having similar semantics should be embedded closer. The node semantics can be detected from node descriptions via a generative model. In this line of methods, latent semantics are used to leverage auxiliary node information for graph embedding. The embedding is decided not only by the graph structure information but also by the latent semantics discovered from other sources of node information. For example, [58] proposes a unified framework which jointly integrates topic modelling and graph embedding. Its principle is that if two nodes are close in the embedded space, they will also share similar topic distribution. A mapping function from the embedded space to the topic semantic space is designed so as to correlate the two spaces. [141] proposes a generative model (Bayesian non-parametric infinite mixture embedding model) to address the issue of multiple relation semantics in knowledge graph embedding. It discovers the latent semantics of a relation and leverages a mixture of relation components for embedding. [59] embeds a knowledge graph from both the knowledge graph triplets and the textual descriptions of entities and relations. It learns the 14 semantic representation of text using topic modelling and restricts the triplet embedding in the semantic subspace. The difference between the above two directions of methods is that the embedded space is the latent space in the first way. In contrast, in the second way, the latent space is used to integrate information from different sources, and help to embed a graph to another space. Summary: Generative model can be used for both node embedding (Sec. 3.2.1) [70] and edge embedding (Sec. 3.2.2) [141]. As it considers node semantics, the input graph is usually a heterogeneous graph (Sec. 3.1.2 ) [70] or a graph with auxiliary information (Sec. 3.1.3) [59]. 4.6 Hybrid Techniques and Others Sometimes multiple techniques are combined in one study. For example, [4] learns edge-based embedding via minimizing the margin-based ranking loss (Sec. 4.3), and learns attribute-based embedding by matrix factorization (Sect. 4.1). [51] optimizes a margin-based ranking loss (Sec. 4.3) with matrix factorization based loss (Sec. 4.1) as regularization terms. [32] uses LSTM (Sec. 4.2) to learn sentences embedding in cQAs and a margin-based ranking loss (Sec. 4.3) to incorporate friendship relations. [142] adopts CBOW/SkipGram (Sec. 4.2) for knowledge graph entity embedding, and then fine-tune the embedding by minimizing a margin-based ranking loss (Sec. 4.3). [61] use word2vec (Sec. 4.2) to embed the textual context and TransH (Sec. 4.3) to embed the entity/relations so that the rich context information is utilized in knowledge graph embedding. [143] leverages the heterogeneous information in a knowledge base to improve recommendation performance. It uses TransR (Sec. 4.3) for network embedding, and uses autoencoders for textual and visual embedding (Sec. 4.2). Finally, a generative framework (Sec. 4.5) is proposed to integrate collaborative filtering with items semantic representations. Apart from the introduced five categories of techniques, there exist other approaches. [95] presents embedding of a graph by its distances to prototype graphs. [16] first embeds a few landmark nodes using their pairwise shortest path distances. Then other nodes are embedded so that their distances to a subset of landmarks are as close as possible to the real shortest paths. [4] jointly optimizes a linkbased loss (maximizing the likelihood of observing a node’s neighbours instead of its non-neighbours) and an attributebased loss (learning a linear projection based on link-based representation). KR-EAR [144] distinguishes the relations in a knowledge graph as attribute-based and relation-based. It constructs a relational triple encoder (TransE, TransR) to embed the correlations between entities and relations, and an attributional triple encoder to embed the correlations between entities and attributes. Struct2vec [145] considers the structral identify of nodes by a hierarchical metric for node embedding. [146] provides a fast embedding approach by approximating the higher-order proximity matrices. 4.7 Summary We now summarize and compare all the five categories of introduced graph embedding techniques in Table 10 in terms of their advantages and disadvantages. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 15 TABLE 10 Comparison of graph embedding techniques. Category Subcategory graph Laplacian eigenaps matrix factorization node proximity matrix factorization deep learning with random walk Advantages Disadvantages consider global node proximity large time and space consumption effective and robust, no feature engineering a) only consider local context within a path b) hard to find optimal sampling strategy high computation cost without random walk maximize edge reconstruct probability edge reconstruction minimize distance-based loss minimize margin-based ranking loss graph kernel generative model based on graphlet based on subtree patterns based on random walks relatively efficient training efficient, only counting the desired atom substructure optimization using only observed local information, i.e., edges (1-hop neighbour) or ranked node pairs a) substructures are not independent b) embedding dimensionality grows exponentially embed graph in the latent space interpretable embedding a) hard to justify the choice of distribution incorporate latent semantics for graph embedding naturally leverage multiple information sources b) require a large amount of training data Matrix factorization based graph embedding learns the representations based on the statistics of global pairwise similarities. Hence it can outperform deep learning based graph embedding (random walk involved) in certain tasks as the latter relies on separate local context windows [147], [148]. However, either the proximity matrix construction or the eigendecomposition of the matrix is time and space consuming [149], making matrix factorization inefficient and unscalable for large graphs. Deep Learning (DL) has shown promising results among different graph embedding methods. We consider DL as suitable for graph embedding, because of its capability of automatically identifying useful representations from complex graph structures. For example, DL with random walk (e.g., DeepWalk [17], node2vec [28], metapath2vec [46]) can automatically exploit the neighbourhood structure through sampled paths on the graph. DL without random walk can model variable-sized subgraph structures in homogeneous graphs (e.g., GCN [72], struc2vec [145], GraphSAGE [150]), or rich interactions among flexible-typed nodes in heterogeneous graphs (e.g., HNE [33], TransE [91], ProxEmbed [44]), as useful representations. On the other hand, DL also has its limitations. For DL with random walks, it typically considers a nodes local neighbours within the same path and thus overlooks the global structure information. Moreover, it is difficult to find an ‘optimal sampling strategy as the embedding and path sampling are not jointly optimized in a unified framework. For DL without random walks, the computational cost is usually high. The traditional deep learning architectures assume the input data on 1D or 2D grid to take advantage of GPU [117]. However, graphs do not have such a grid structure, and thus require different solutions to improve the efficiency [117]. Edge reconstruction based graph embedding optimizes an objective function based on the observed edges or ranking triplets. It is more efficient compared to the previous two categories of graph embedding. However, this line of methods are trained using the directly observed local information, and thus the obtained embedding lacks the awareness of the global graph structure. Graph kernel based graph embedding converts a graph into one single vector to facilitate the graph level analytic tasks such as graph classification. It is more efficient than other categories of techniques as it only needs to enumerate the desired atomic substructures in a graph. However, such “bag-of-structure” based methods have two limitations [93]. Firstly, the substructures are not independent. For example, the graphlet of size k +1 can be derived from size k graphlet by adding a new node and some edges. This means there exist redundant information in the graph representation. Secondly, the embedding dimensionality usually grows exponentially when the size of the substructure grows, leading to a sparse problem in the embedding. Generative model based graph embedding can naturally leverage information from different sources (e.g., graph structure, node attribute) in a unified model. Directly embedding graphs into the latent semantic space generates the embedding that can be interpreted using the semantics. But the assumption of modelling the observation using certain distributions is hard to justify. Moreover, the generative method needs a large amount of training data to estimate a proper model which fits the data. Hence it may not work well for small graphs or a small number of graphs. 5 A PPLICATIONS Graph embedding benefits a wide variety of graph analytics applications as the vector representations can be processed efficiently in both time and space. In this section, we categorize the graph embedding enabled applications as node related, edge related and graph related. 5.1 5.1.1 Node Related Applications Node Classification Node classification is to assign a class label to each node in a graph based on the rules learnt from the labelled nodes. Intuitively, “similar” nodes have the same labels. It is one of the most common applications discussed in graph embedding literatures. In general, each node is embedded as a low-dimensional vector. Node classification is conducted by applying a classifier on the set of labelled node embedding for training. The example classifiers include SVM ( [1], [20], [33], [34], [41], [42], [45], [56], [57], [60], [73], [75], [81], [87]), logistic regression ( [1], [17], [19], [20], [21], [25], [27], [28], [45], [59], [124]) and k-nearest neighbour classification ( [58], [151]). Then given the embedding of an unlabelled node, the trained classifier can predict its class label. In contrast to the above sequential processing of first node embedding then node classification, some other work ( [47], [48], [62], IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 [72], [80]) designs a unified framework to jointly optimize graph embedding and node classification, which learns a classification-specific representation for each node. 5.1.2 Node Clustering Node clustering aims to group similar nodes together, so that nodes in the same group are more similar to each other than those in other groups. As an unsupervised algorithm, it is applicable when the node labels are unavailable. After representing nodes as vectors, the traditional clustering algorithms can then be applied on the node embedding. Most existing work [1], [2], [21], [22], [23], [33], [81] adopts k-means as the clustering algorithm. In contrast, [4] and [77] jointly optimize clustering and graph embedding in one objective to learn a clustering-specific node representation. 5.1.3 Node Recommendation/Retrieval/Ranking The task of node recommendation is to recommend top K nodes of interest to a given node based on certain criteria such as similarity [3], [16], [43], [45], [47], [106]. In realworld scenarios, there are various types of recommended node, such as research interests for researchers [66], items for customers [3], [71], images for curation network users [35], friends for social network users [3], and documents for a query [69]. It is also popular in community-based question answering. Given a question, they predict the relative rank of users ( [30], [31]) or answers ( [29], [32]). In proximity search [39], [44], they rank the nodes of a particular type (e.g., “user”) for a given query node (e.g., “Bob”) and a proximity class (e.g., “schoolmate”), e.g., ranking users who are the schoolmates of Bob. And there is some work focusing on cross-modal retrieval [33], [34], [36], [99], e.g., keywordbased image/video search. A specific application which is popularly discussed in knowledge graph embedding is entity ranking [51], [52], [53], [59], [61] . Recall that a knowledge graph consists of a set of triplets < h, r, t >. Entity ranking aims to rank the correct missing entities given the other two components in a triplet higher than the false entities. E.g., it returns the true h’s among all the candidate entities given r and t, or returns the true t’s given r and h. [19], [28]. For example, [28] predicts the friendship relation between two users. Relatively fewer graph embedding work deals with heterogeneous graph link prediction. For example, on a heterogeneous social graph, ProxEmbed [44] tries to predict the missing links of certain semantic types (e.g., schoolmates) between two users, based on the embedding of their connecting paths on the graph. D2AGE [152] solves the same problem by embedding two users connecting directed acyclic graph structure. 5.2.2 Triple Classification Triplet classification [14], [15], [38], [51], [52], [53], [61], [142] is a specific application for knowledge graph. It aims to classify whether an unseen triplet < h, r, t > is correct or not, i.e., whether the relation between h and t is r. 5.3 Edge Related Applications Next we introduce edge related applications in which an edge or a node pair is involved. 5.2.1 Link Prediction Graph embedding aims to represent a graph with lowdimensional vectors, but interestingly its output vectors can also help infer the graph structure. In practice, graphs are often incomplete; e.g., in social networks, friendship links can be missing between two users who actually know each other. In graph embedding, the low-dimensional vectors are expected to preserve different orders of network proximity (e.g., DeepWalk [17], LINE [27]), as well as different scales of structural similarity (e.g., GCN [72], struc2vec [145]). Hence, these vectors encode rich information about the network structure, and they can be used to predict missing links in the incomplete graph. Most attempts on graph embedding driven link prediction are on homogeneous graphs [3], [16], Graph Related Applications 5.3.1 Graph Classification Graph classification assigns a class label to a whole graph. This is important when the graph is the unit of data. For example, in [50], each graph is a chemical compound, an organic molecule or a protein structure. In most cases, whole-graph embedding is applied to calculate graph level similarity [49], [54], [55], [93], [95]. Recently, some work starts to match node embedding for graph similarity [50], [153]. Each graph is represented as a set of node embedding vectors. Graphs are compared based on two sets of node embedding. [93] decomposes a graph into a set of substructures and then embed each substructure as a vector and compare graphs via substructure similarities. 5.3.2 Visualization Graph visualization generates visualizations of a graph on a low dimensional space [20], [23], [48], [55], [58], [73]. Usually, for visualization purpose, all nodes are embedded as 2D vectors and then plotted in a 2D space with different colours indicating nodes’ categories. It provides a vivid demonstration of whether nodes belonging to the same category are embedded closer to each other. 5.4 5.2 16 Other Applications Above are some general applications that are commonly discussed in existing work. Depending on the information carried in the input graph, more specific applications may exist. Below are some example scenarios. Knowledge graph related: [15] and [14] extract relational fact from large-scale plain text. [62] extracts medical entities from text. [69] links natural language text with entities in a knowledge graph. [92] focuses on de-duplicating entities that are equivalent in a knowledge graph. [84] jointly embeds entity mentions, text and entity types to estimate the true type-path for each mention from its noisy candidate type set. E.g., the candidate types for “Trump” are {person, politician, businessman, artist, actor}. For the mention “Trump” in sentence “Republican presidential candidate Donald Trump spoke during a campaign event in Rock Hill.”, only {person, politician} are correct types. Multimedia network related: [83] embeds the geotagged social media (GTSM) records <time, location, IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 message> which enables them to recover the missing component from a GTSM triplet given the other two. It can also classify the GTSM records, e.g., whether a check-in record is related to “Food” or “Shop”. [85] uses graph embedding to reduce data dimensionality for face recognition. [88] maps images into a semantic manifold that faithfully grasps users’ preferences to facilitate content-based image retrieval. Information propagation related: [63] predicts the increment of a cascade size after a given time interval. [64] predicts the propagation user and identifies the domain expert by embedding the social interaction graph. Social networks alignment: Both [26] and [18] learn node embedding to align users across different social networks, i.e., to predict whether two user accounts in two different social networks are owned by the same user. Image related: Some work embeds graphs constructed from images, and then use the embedding for image classification ( [81], [82]), image clustering [101], image segmentation [154], pattern recognition [80], and so on. 6 F UTURE D IRECTIONS In this section, we summarize four future directions for the field of graph embedding, including computation efficiency, problem settings, techniques and application scenarios. Computation. The deep architecture, which takes the geometric input (e.g., graph), suffers the low efficiency problem. Traditional deep learning models (designed for Euclidean domains) utilize the modern GPU to optimize their efficiency by assuming that the input data are on a 1D or 2D grid. However, graphs do not have such a kind of grid structure and thus the deep architecture designed for graph embedding needs to seek alternative solutions to improve the model efficiency. [117] suggested that the computational paradigms developed for large-scale graph processing can be adopted to facilitate efficiency improvement in deep learning models for graph embedding. Problem settings. The dynamic graph is one promising setting for graph embedding. Graphs are not always static, especially in real life scenarios, e.g., social graphs in Twitter, citation graphs in DBLP. Graphs can be dynamic in terms of graph structure or node/edge information. On the one hand, the graph structure may evolve over time, i.e., new nodes/edges appear while some old nodes/edges disappear. On the other hand, the nodes/edges may be described by some time-varying information. Existing graph embedding mainly focuses on embedding the static graph and the settings of dynamic graph embedding are overlooked. Unlike static graph embedding, the techniques for dynamic graphs need to be scalable and better to be incremental so as to deal with the dynamic changes efficiently. This makes most of the existing graph embedding methods, which suffer from the low efficiency problem, not suitable anymore. How to design effective graph embedding methods in dynamic domains remains an open question. Techniques. Structure awareness is important for edge reconstruction based graph embedding. Current edge reconstruction based graph embedding methods are mainly based on the edges only, e.g., 1-hope neighbours in a general graph, a ranked triplet (< h, r, t > in a knowledge 17 (vi , vi+ , vi− ) graph, and in a cQA graph. Single edges only provide local neighbourhood information to calculate the first- and second-order proximity. The global structure of a graph (e.g., paths, tree, subgraph patterns) is omitted. Intuitively, a substructure contains richer information than one single edge. Some work attempts to explore the path information in knowledge graph embedding ( [38], [39], [40], [142]). However, most of them use deep learning models ( [38], [40], [142]) which suffer the low efficiency issue as discussed earlier. How to design the non-deep learning based methods that can take advantage of the expressive power of graph structure is a question. [39] provides one example solution. It minimizes both pairwise and longrange loss to capture pairwise relations and long-range interactions between entities. Note that in addition to the list/path structure, there are various kinds of substructures which carry different structure information. For example, SPE [155] has tried to introduce a subgraph-augmented path structure for embedding the proximity between two nodes in a heterogeneous graph, and it shows better performance than embedding simple paths for semantic search tasks. In general, an efficient structure-aware graph embedding optimization solution, together with the substructure sampling strategy, is in needed. Applications. Graph embedding has been applied in many different applications. It is an effective way to learn the representations of data with consideration of their relations. Moreover, it can convert data instances from different sources/platforms/views into one common space so that they are directly comparable. For example, [16], [34], [36] use graph embedding for cross-modal retrieval, such as contentbased image retrieval, keyword-based image/video search. The advantages of using graph embedding for representation learning is that the graph manifold of the training data instances are preserved in the representations and can further benefit the follow-up applications. Consequently, graph embedding can benefit the tasks which assume the input data instances are correlated with certain relations (i.e., connected by certain links). It is of great importance to exploring the application scenarios which benefit from graph embedding, as it provides effective solutions to the conventional problems from a different perspective. 7 C ONCLUSIONS In this survey, we conduct a comprehensive review of the literature in graph embedding. We provide a formal definition to the problem of graph embedding and introduce some basic concepts. More importantly, we propose two taxonomies of graph embedding, categorizing existing work based on problem settings and embedding techniques respectively. In terms of problem setting taxonomy, we introduce four types of embedding input and four types of embedding output and summarize the challenges faced in each setting. For embedding technique taxonomy, we introduce the work in each category and compare them in terms of their advantages and disadvantages. After that, we summarize the applications that graph embedding enables. Finally, we suggest four promising future research directions in the field of graph embedding in terms of computation efficiency, problem settings, techniques and application scenarios. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 R EFERENCES [28] [1] [29] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] X. Wang, P. Cui, J. Wang, J. Pei, W. Zhu, and S. Yang, “Community preserving network embedding,” in AAAI, 2017, pp. 203–209. F. Nie, W. Zhu, and X. Li, “Unsupervised large graph embedding,” in AAAI, 2017, pp. 2422–2428. C. Zhou, Y. Liu, X. Liu, Z. Liu, and J. Gao, “Scalable graph embedding for asymmetric proximity,” in AAAI, 2017, pp. 2942– 2948. X. Wei, L. Xu, B. Cao, and P. S. Yu, “Cross view link prediction by learning noise-resilient representation consensus,” in WWW, 2017, pp. 1611–1619. J. E. Gonzalez, R. S. Xin, A. Dave, D. Crankshaw, M. J. Franklin, and I. Stoica, “Graphx: Graph processing in a distributed dataflow framework,” in OSDI, 2014, pp. 599–613. Y. Low, D. Bickson, J. Gonzalez, C. Guestrin, A. Kyrola, and J. M. Hellerstein, “Distributed graphlab: A framework for machine learning and data mining in the cloud,” Proc. VLDB Endow., vol. 5, no. 8, pp. 716–727, 2012. P. Kumar and H. H. Huang, “G-store: High-performance graph store for trillion-edge processing,” in SC, 2016, pp. 71:1–71:12. N. Satish, N. Sundaram, M. M. A. Patwary, J. Seo, J. Park, M. A. Hassaan, S. Sengupta, Z. Yin, and P. Dubey, “Navigating the maze of graph analytics frameworks using massive graph datasets,” in SIGMOD, 2014, pp. 979–990. Y. Bengio, A. C. Courville, and P. Vincent, “Representation learning: A review and new perspectives,” PAMI, vol. 35, no. 8, pp. 1798–1828, 2013. A. Mahmood, M. Small, S. A. Al-Máadeed, and N. M. Rajpoot, “Using geodesic space density gradients for network community detection,” IEEE Trans. Knowl. Data Eng., vol. 29, no. 4, pp. 921– 935, 2017. P. Goyal and E. Ferrara, “Graph embedding techniques, applications, and performance: A survey,” CoRR, vol. abs/1705.02801, 2017. N. S. S and S. Surendran, “Graph embedding and dimensionality reduction-a survey,” IJCSET, vol. 4, no. 1, pp. 29–34, 2013. Q. Wang, Z. Mao, B. Wang, and L. Guo, “Knowledge graph embedding: A survey of approaches and applications,” IEEE Trans. Knowl. Data Eng., vol. 29, no. 12, pp. 2724–2743, 2017. Z. Wang, J. Zhang, J. Feng, and Z. Chen, “Knowledge graph embedding by translating on hyperplanes,” in AAAI, 2014, pp. 1112–1119. Y. Lin, Z. Liu, M. Sun, Y. Liu, and X. Zhu, “Learning entity and relation embeddings for knowledge graph completion,” in AAAI, 2015, pp. 2181–2187. X. Zhao, A. Chang, A. D. Sarma, H. Zheng, and B. Y. Zhao, “On the embeddability of random walk distances,” PVLDB, vol. 6, no. 14, pp. 1690–1701, 2013. B. Perozzi, R. Al-Rfou, and S. Skiena, “Deepwalk: Online learning of social representations,” in KDD, 2014, pp. 701–710. T. Man, H. Shen, S. Liu, X. Jin, and X. Cheng, “Predict anchor links across social networks via an embedding approach,” in IJCAI, 2016, pp. 1823–1829. T. Pimentel, A. Veloso, and N. Ziviani, “Unsupervised and scalable algorithm for learning node representations,” in ICLR, 2017. D. Wang, P. Cui, and W. Zhu, “Structural deep network embedding,” in KDD, 2016, pp. 1225–1234. S. Cao, W. Lu, and Q. Xu, “Grarep: Learning graph representations with global structural information,” in CIKM, 2015, pp. 891–900. F. Tian, B. Gao, Q. Cui, E. Chen, and T. Liu, “Learning deep representations for graph clustering,” in AAAI, 2014, pp. 1293– 1299. S. Cao, W. Lu, and Q. Xu, “Deep neural networks for learning graph representations,” in AAAI, 2016, pp. 1145–1152. A. Ahmed, N. Shervashidze, S. Narayanamurthy, V. Josifovski, and A. J. Smola, “Distributed large-scale natural graph factorization,” in WWW, 2013, pp. 37–48. Z. Jin, R. Liu, Q. Li, D. D. Zeng, Y. Zhan, and L. Wang, “Predicting user’s multi-interests with network embedding in health-related topics,” in IJCNN, 2016, pp. 2568–2575. L. Liu, W. K. Cheung, X. Li, and L. Liao, “Aligning users across social networks using network embedding,” in IJCAI, 2016, pp. 1774–1780. J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and Q. Mei, “Line: Large-scale information network embedding,” in WWW, 2015, pp. 1067–1077. [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] 18 A. Grover and J. Leskovec, “Node2vec: Scalable feature learning for networks,” in KDD, 2016, pp. 855–864. H. Fang, F. Wu, Z. Zhao, X. Duan, Y. Zhuang, and M. Ester, “Community-based question answering via heterogeneous social network learning,” in AAAI, 2016, pp. 122–128. Z. Zhao, Q. Yang, D. Cai, X. He, and Y. Zhuang, “Expert finding for community-based question answering via ranking metric network learning,” in IJCAI, 2016, pp. 3000–3006. H. Lu and M. Kong, “Community-based question answering via contextual ranking metric network learning,” in AAAI, 2017, pp. 4963–4964. Z. Zhao, H. Lu, V. W. Zheng, D. Cai, X. He, and Y. Zhuang, “Community-based question answering via asymmetric multifaceted ranking network learning,” in AAAI, 2017, pp. 3532–3539. S. Chang, W. Han, J. Tang, G.-J. Qi, C. C. Aggarwal, and T. S. Huang, “Heterogeneous network embedding via deep architectures,” in KDD, 2015, pp. 119–128. H. Zhang, X. Shang, H. Luan, M. Wang, and T. Chua, “Learning from collective intelligence: Feature learning using social images and tags,” TOMCCAP, vol. 13, no. 1, pp. 1:1–1:23, 2016. X. Geng, H. Zhang, J. Bian, and T. Chua, “Learning image and user features for recommendation in social networks,” in ICCV, 2015, pp. 4274–4282. F. Wu, X. Lu, J. Song, S. Yan, Z. M. Zhang, Y. Rui, and Y. Zhuang, “Learning of multimodal representations with random walks on the click graph,” IEEE Trans. Image Processing, vol. 25, no. 2, pp. 630–642, 2016. K. Bollacker, C. Evans, P. Paritosh, T. Sturge, and J. Taylor, “Freebase: A collaboratively created graph database for structuring human knowledge,” in SIGMOD, 2008, pp. 1247–1250. J. Feng, M. Huang, Y. Yang, and X. Zhu, “GAKE: graph aware knowledge embedding,” in COLING, 2016, pp. 641–651. F. Wu, J. Song, Y. Yang, X. Li, Z. M. Zhang, and Y. Zhuang, “Structured embedding via pairwise relations and long-range interactions in knowledge base,” in AAAI, 2015, pp. 1663–1670. B. Shi and T. Weninger, “Proje: Embedding projection for knowledge graph completion,” in AAAI, 2017, pp. 1236–1242. M. Ochi, Y. Nakashio, Y. Yamashita, I. Sakata, K. Asatani, M. Ruttley, and J. Mori, “Representation learning for geospatial areas using large-scale mobility data from smart card,” in UbiComp, 2016, pp. 1381–1389. M. Ochi, Y. Nakashio, M. Ruttley, J. Mori, and I. Sakata, “Geospatial area embedding based on the movement purpose hypothesis using large-scale mobility data from smart card,” IJCNS, vol. 9, pp. 519–534, 2016. Y. Zhao, Z. Liu, and M. Sun, “Representation learning for measuring entity relatedness with rich information,” in IJCAI, 2015, pp. 1412–1418. Z. Liu, V. W. Zheng, Z. Zhao, F. Zhu, K. C. Chang, M. Wu, and J. Ying, “Semantic proximity search on heterogeneous graph by proximity embedding,” in AAAI, 2017, pp. 154–160. H. Gui, J. Liu, F. Tao, M. Jiang, B. Norick, and J. Han, “Large-scale embedding learning in heterogeneous event data,” in ICDM, 2016, pp. 907–912. Y. Dong, N. V. Chawla, and A. Swami, “metapath2vec: Scalable representation learning for heterogeneous networks,” in KDD, 2017, pp. 135–144. J. Li, J. Zhu, and B. Zhang, “Discriminative deep random walk for network classification,” in ACL, 2016. C. Tu, W. Zhang, Z. Liu, and M. Sun, “Max-margin deepwalk: Discriminative learning of network representation,” in IJCAI, 2016, pp. 3889–3895. N. Shervashidze, P. Schweitzer, E. J. van Leeuwen, K. Mehlhorn, and K. M. Borgwardt, “Weisfeiler-lehman graph kernels.” Journal of Machine Learning Research, vol. 12, pp. 2539–2561, 2011. G. Nikolentzos, P. Meladianos, and M. Vazirgiannis, “Matching node embeddings for graph similarity,” in AAAI, 2017, pp. 2429– 2435. S. Guo, Q. Wang, B. Wang, L. Wang, and L. Guo, “Semantically smooth knowledge graph embedding,” in ACL, 2015, pp. 84–94. ——, “SSE: semantically smooth embedding for knowledge graphs,” IEEE Trans. Knowl. Data Eng., vol. 29, no. 4, pp. 884–897, 2017. R. Xie, Z. Liu, and M. Sun, “Representation learning of knowledge graphs with hierarchical types,” in IJCAI, 2016, pp. 2965– 2971. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] H. Dai, B. Dai, and L. Song, “Discriminative embeddings of latent variable models for structured data,” in ICML, 2016, pp. 2702– 2711. M. Niepert, M. Ahmed, and K. Kutzkov, “Learning convolutional neural networks for graphs,” in ICML, 2016, pp. 2014–2023. C. Yang, Z. Liu, D. Zhao, M. Sun, and E. Y. Chang, “Network representation learning with rich text information,” in IJCAI, 2015, pp. 2111–2117. D. Zhang, J. Yin, X. Zhu, and C. Zhang, “Homophily, structure, and content augmented network representation learning,” in ICDM, 2016, pp. 609–618. T. M. V. Le and H. W. Lauw, “Probabilistic latent document network embedding,” in ICDM, 2014, pp. 270–279. H. Xiao, M. Huang, L. Meng, and X. Zhu, “SSP: semantic space projection for knowledge graph embedding with text descriptions,” in AAAI, 2017, pp. 3104–3110. L. Yao, Y. Zhang, B. Wei, Z. Jin, R. Zhang, Y. Zhang, and Q. Chen, “Incorporating knowledge graph embeddings into topic modeling,” in AAAI, 2017, pp. 3119–3126. Z. Wang and J. Li, “Text-enhanced representation learning for knowledge graph,” in IJCAI, 2016, pp. 1293–1299. Z. Yang, W. W. Cohen, and R. Salakhutdinov, “Revisiting semisupervised learning with graph embeddings,” in ICML, 2016, pp. 40–48. C. Li, J. Ma, X. Guo, and Q. Mei, “Deepcas: An end-to-end predictor of information cascades,” in WWW, 2017, pp. 577–586. N. Zhao, H. Zhang, M. Wang, R. Hong, and T. Chua, “Learning content-social influential features for influence analysis,” IJMIR, vol. 5, no. 3, pp. 137–149, 2016. J. Wang, V. W. Zheng, Z. Liu, and K. C. Chang, “Topological recurrent neural network for diffusion prediction,” in ICDM, 2017, pp. 475–484. Z. Yang, J. Tang, and W. Cohen, “Multi-modal bayesian embeddings for learning social knowledge graphs,” in IJCAI, 2016, pp. 2287–2293. F. M. Suchanek, G. Kasneci, and G. Weikum, “Yago: a core of semantic knowledge,” in WWW, 2007, pp. 697–706. C. Bizer, J. Lehmann, G. Kobilarov, S. Auer, C. Becker, R. Cyganiak, and S. Hellmann, “Dbpedia - A crystallization point for the web of data,” J. Web Sem., vol. 7, no. 3, pp. 154–165, 2009. C. Xiong, R. Power, and J. Callan, “Explicit semantic ranking for academic search via knowledge graph embedding,” in WWW, 2017, pp. 1271–1279. B. Alharbi and X. Zhang, “Learning from your network of friends: A trajectory representation learning model based on online social ties,” in ICDM, 2016, pp. 781–786. Q. Zhang and H. Wang, “Not all links are created equal: An adaptive embedding approach for social personalized ranking,” in SIGIR, 2016, pp. 917–920. T. N. Kipf and M. Welling, “Semi-supervised classification with graph convolutional networks,” in ICLR, 2017. S. Pan, J. Wu, X. Zhu, C. Zhang, and Y. Wang, “Tri-party deep network representation,” in IJCAI, 2016, pp. 1895–1901. T. Hofmann and J. M. Buhmann, “Multidimensional scaling and data clustering,” in NIPS, 1994, pp. 459–466. Y. Han and Y. Shen, “Partially supervised graph embedding for positive unlabelled feature selection,” in IJCAI, 2016, pp. 1548– 1554. M. Yin, J. Gao, and Z. Lin, “Laplacian regularized low-rank representation and its applications,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 38, no. 3, pp. 504–517, 2016. M. Tang, F. Nie, and R. Jain, “Capped lp-norm graph embedding for photo clustering,” in MM, 2016, pp. 431–435. M. Balasubramanian and E. L. Schwartz, “The isomap algorithm and topological stability,” Science, vol. 295, no. 5552, pp. 7–7, 2002. R. Jiang, W. Fu, L. Wen, S. Hao, and R. Hong, “Dimensionality reduction on anchorgraph with an efficient locality preserving projection,” Neurocomputing, vol. 187, pp. 109–118, 2016. F. Monti, D. Boscaini, J. Masci, E. Rodolà, J. Svoboda, and M. M. Bronstein, “Geometric deep learning on graphs and manifolds using mixture model cnns,” in CVPR, 2017. M. Chen, I. W. Tsang, M. Tan, and C. T. Jen, “A unified feature selection framework for graph embedding on high dimensional data,” IEEE Trans. Knowl. Data Eng., vol. 27, no. 6, pp. 1465–1477, 2015. [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] 19 M. Defferrard, X. Bresson, and P. Vandergheynst, “Convolutional neural networks on graphs with fast localized spectral filtering,” in NIPS, 2016, pp. 3837–3845. C. Zhang, K. Zhang, Q. Yuan, H. Peng, Y. Zheng, T. Hanratty, S. Wang, and J. Han, “Regions, periods, activities: Uncovering urban dynamics via cross-modal representation learning,” in WWW, 2017, pp. 361–370. X. Ren, W. He, M. Qu, C. R. Voss, H. Ji, and J. Han, “Label noise reduction in entity typing by heterogeneous partial-label embedding,” in KDD, 2016, pp. 1825–1834. S. Yan, D. Xu, B. Zhang, H. Zhang, Q. Yang, and S. Lin, “Graph embedding and extensions: A general framework for dimensionality reduction,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 29, no. 1, pp. 40–51, 2007. C. Gong, D. Tao, J. Yang, and K. Fu, “Signed laplacian embedding for supervised dimension reduction,” in AAAI, 2014, pp. 1847– 1853. L. Sun, S. Ji, and J. Ye, “Hypergraph spectral learning for multilabel classification,” in KDD, 2008, pp. 668–676. Y.-Y. Lin, T.-L. Liu, and H.-T. Chen, “Semantic manifold learning for image retrieval,” in MM, 2005, pp. 249–258. S. Cavallari, V. W. Zheng, H. Cai, K. C. Chang, and E. Cambria, “Learning community embedding with community detection and node embedding on graphs,” in CIKM, 2017, pp. 377–386. A. Bordes, J. Weston, R. Collobert, and Y. Bengio, “Learning structured embeddings of knowledge bases,” in AAAI, 2011. A. Bordes, N. Usunier, A. Garcı́a-Durán, J. Weston, and O. Yakhnenko, “Translating embeddings for modeling multirelational data,” in NIPS, 2013, pp. 2787–2795. A. Bordes, X. Glorot, J. Weston, and Y. Bengio, “A semantic matching energy function for learning with multi-relational data - application to word-sense disambiguation,” Machine Learning, vol. 94, no. 2, pp. 233–259, 2014. P. Yanardag and S. Vishwanathan, “Deep graph kernels,” in KDD, 2015, pp. 1365–1374. A. Bordes, S. Chopra, and J. Weston, “Question answering with subgraph embeddings,” in EMNLP, 2014, pp. 615–620. S. F. Mousavi, M. Safayani, A. Mirzaei, and H. Bahonar, “Hierarchical graph embedding in vector space by graph pyramid,” Pattern Recognition, vol. 61, pp. 245–254, 2017. W. N. A. Jr. and T. D. Morley, “Eigenvalues of the laplacian of a graph,” Linear and Multilinear Algebra, vol. 18, no. 2, pp. 141–145, 1985. X. He and P. Niyogi, “Locality preserving projections,” in NIPS, 2003, pp. 153–160. Y. Yang, F. Nie, S. Xiang, Y. Zhuang, and W. Wang, “Local and global regressive mapping for manifold learning with out-ofsample extrapolation,” in AAAI, 2010. D. Cai, X. He, and J. Han, “Spectral regression: a unified subspace learning framework for content-based image retrieval,” in MM, 2007, pp. 403–412. K. Q. Weinberger, F. Sha, and L. K. Saul, “Learning a kernel matrix for nonlinear dimensionality reduction,” in ICML, 2004. K. Allab, L. Labiod, and M. Nadif, “A semi-nmf-pca unified framework for data clustering,” IEEE Trans. Knowl. Data Eng., vol. 29, no. 1, pp. 2–16, 2017. S. T. Roweis and L. K. Saul, “Nonlinear Dimensionality Reduction by Locally Linear Embedding,” Science, vol. 290, no. 5500, pp. 2323–2326, 2000. S. Xiang, F. Nie, C. Zhang, and C. Zhang, “Nonlinear dimensionality reduction with local spline embedding,” IEEE Trans. Knowl. Data Eng., vol. 21, no. 9, pp. 1285–1298, 2009. L. Vandenberghe and S. Boyd, “Semidefinite programming,” SIAM Rev., vol. 38, no. 1, pp. 49–95, 1996. B. Shaw and T. Jebara, “Structure preserving embedding,” in ICML, 2009, pp. 937–944. M. Ou, P. Cui, J. Pei, Z. Zhang, and W. Zhu, “Asymmetric transitivity preserving graph embedding,” in KDD, 2016, pp. 1105–1114. B. Shaw and T. Jebara, “Minimum volume embedding,” in AISTATS, 2007, pp. 460–467. M. Nickel, V. Tresp, and H. peter Kriegel, “A three-way model for collective learning on multi-relational data,” in ICML. ACM, 2011, pp. 809–816. J. H. Tianji Pang, Feiping Nie, “Flexible orthogonal neighborhood preserving embedding,” in IJCAI-17, 2017, pp. 2592–2598. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. XX, NO. XX, SEPT 2017 [110] G. H. Golub and C. Reinsch, “Singular value decomposition and least squares solutions,” Numer. Math., vol. 14, no. 5, pp. 403–420, 1970. [111] T. Mikolov, K. Chen, G. Corrado, and J. Dean, “Efficient estimation of word representations in vector space,” CoRR, vol. abs/1301.3781, 2013. [112] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean, “Distributed representations of words and phrases and their compositionality,” in NIPS, 2013, pp. 3111–3119. [113] D. Zhang, J. Yin, X. Zhu, and C. Zhang, “User profile preserving social network embedding,” in IJCAI, 2017, pp. 3378–3384. [114] N. Shervashidze, S. V. N. Vishwanathan, T. Petri, K. Mehlhorn, and K. M. Borgwardt, “Efficient graphlet kernels for large graph comparison,” in AISTATS, 2009, pp. 488–495. [115] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Computation, vol. 9, no. 8, pp. 1735–1780, 1997. [116] K. Cho, B. van Merrienboer, D. Bahdanau, and Y. Bengio, “On the properties of neural machine translation: Encoder-decoder approaches,” CoRR, vol. abs/1409.1259, 2014. [117] M. M. Bronstein, J. Bruna, Y. LeCun, A. Szlam, and P. Vandergheynst, “Geometric deep learning: going beyond euclidean data,” CoRR, vol. abs/1611.08097, 2016. [118] J. Bruna, W. Zaremba, A. Szlam, and Y. LeCun, “Spectral networks and locally connected networks on graphs,” in ICLR, 2013. [119] M. Henaff, J. Bruna, and Y. LeCun, “Deep convolutional networks on graph-structured data,” CoRR, vol. abs/1506.05163, 2015. [120] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini, “The graph neural network model,” IEEE Trans. Neural Networks, vol. 20, no. 1, pp. 61–80, 2009. [121] D. Duvenaud, D. Maclaurin, J. Aguilera-Iparraguirre, R. GómezBombarelli, T. Hirzel, A. Aspuru-Guzik, and R. P. Adams, “Convolutional networks on graphs for learning molecular fingerprints,” in NIPS, 2015, pp. 2224–2232. [122] Y. Li, D. Tarlow, M. Brockschmidt, and R. S. Zemel, “Gated graph sequence neural networks,” in ICLR, 2016. [123] R. Khasanova and P. Frossard, “Graph-based isometry invariant representation learning,” in ICML, 2017, pp. 1847–1856. [124] J. Tang, M. Qu, and Q. Mei, “Pte: Predictive text embedding through large-scale heterogeneous text networks,” in KDD, 2015, pp. 1165–1174. [125] G. Ji, S. He, L. Xu, K. Liu, and J. Zhao, “Knowledge graph embedding via dynamic mapping matrix,” in ACL, 2015, pp. 687– 696. [126] G. Ji, K. Liu, S. He, and J. Zhao, “Knowledge graph completion with adaptive sparse transfer matrix,” in AAAI, 2016, pp. 985– 991. [127] J. Wen, J. Li, Y. Mao, S. Chen, and R. Zhang, “On the representation and embedding of knowledge bases beyond binary relations,” in IJCAI, 2016, pp. 1300–1307. [128] R. Xie, Z. Liu, J. Jia, H. Luan, and M. Sun, “Representation learning of knowledge graphs with entity descriptions,” in AAAI, 2016, pp. 2659–2665. [129] H. Xiao, M. Huang, and X. Zhu, “From one point to a manifold: Knowledge graph embedding for precise link prediction,” in IJCAI, 2016, pp. 1315–1321. [130] Y. Jia, Y. Wang, H. Lin, X. Jin, and X. Cheng, “Locally adaptive translation for knowledge graph embedding,” in AAAI, 2016, pp. 992–998. [131] R. Socher, D. Chen, C. D. Manning, and A. Y. Ng, “Reasoning with neural tensor networks for knowledge base completion,” in NIPS, 2013, pp. 926–934. [132] M. Nickel, L. Rosasco, and T. Poggio, “Holographic embeddings of knowledge graphs,” in AAAI, 2016, pp. 1955–1961. [133] M. Chen, Y. Tian, M. Yang, and C. Zaniolo, “Multilingual knowledge graph embeddings for cross-lingual knowledge alignment,” in IJCAI, 2017, pp. 1511–1517. [134] H. Liu, Y. Wu, and Y. Yang, “Analogical inference for multirelational embeddings,” in ICML, 2017, pp. 2168–2178. [135] T. Trouillon, J. Welbl, S. Riedel, E. Gaussier, and G. Bouchard, “Complex embeddings for simple link prediction,” in ICML, 2016, pp. 2071–2080. [136] D. Haussler, “Convolution kernels on discrete structures,” Technical Report UCS-CRL-99-10, 1999. [137] S. V. N. Vishwanathan, N. N. Schraudolph, R. Kondor, and K. M. Borgwardt, “Graph kernels,” Journal of Machine Learning Research, vol. 11, pp. 1201–1242, 2010. 20 [138] K. M. Borgwardt and H. Kriegel, “Shortest-path kernels on graphs,” in ICDM, 2005, pp. 74–81. [139] C. M. Bishop and J. Lasserre, “Generative or Discrimative? Getting the Best of Both Worlds,” in Bayes. Stat. 8, 2007, pp. 3–24. [140] D. M. Blei, A. Y. Ng, and M. I. Jordan, “Latent dirichlet allocation,” in NIPS, 2001, pp. 601–608. [141] H. Xiao, M. Huang, and X. Zhu, “Transg : A generative model for knowledge graph embedding,” in ACL, 2016. [142] Y. Luo, Q. Wang, B. Wang, and L. Guo, “Context-dependent knowledge graph embedding,” in EMNLP, 2015, pp. 1656–1661. [143] F. Zhang, N. J. Yuan, D. Lian, X. Xie, and W. Ma, “Collaborative knowledge base embedding for recommender systems,” in KDD, 2016, pp. 353–362. [144] Y. Lin, Z. Liu, and M. Sun, “Knowledge representation learning with entities, attributes and relations,” in IJCAI, 2016, pp. 2866– 2872. [145] L. F. Ribeiro, P. H. Saverese, and D. R. Figueiredo, “Struc2vec: Learning node representations from structural identity,” in KDD, 2017, pp. 385–394. [146] C. Yang, M. Sun, Z. Liu, and C. Tu, “Fast network embedding enhancement via high order proximity approximation,” in IJCAI, 2017, pp. 3894–3900. [147] J. A. Bullinaria and J. P. Levy, “Extracting semantic representations from word co-occurrence statistics: stop-lists, stemming, and svd,” Behav. Res. Methods, vol. 44, no. 3, pp. 890–907, 2012. [148] O. Levy, Y. Goldberg, and I. Dagan, “Improving distributional similarity with lessons learned from word embeddings,” TACL, vol. 3, pp. 211–225, 2015. [149] J. Demmel, I. Dumitriu, and O. Holtz, “Fast linear algebra is stable,” Numerische Mathematik, vol. 108, no. 1, pp. 59–91, 2007. [150] W. L. Hamilton, Z. Ying, and J. Leskovec, “Inductive representation learning on large graphs,” in NIPS, 2017, pp. 1025–1035. [151] R. C. Wilson, E. R. Hancock, E. Pekalska, and R. P. W. Duin, “Spherical and hyperbolic embeddings of data,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 36, no. 11, pp. 2255–2269, 2014. [152] Z. Liu, V. W. Zheng, Z. Zhao, F. Zhu, K. C.-C. Chang, M. Wu, and J. Ying, “Distance-aware dag embedding for proximity search on heterogeneous graphs,” in AAAI, 2018. [153] F. D. Johansson and D. P. Dubhashi, “Learning with similarity functions on graphs using matchings of geometric embeddings,” in KDD, 2015, pp. 467–476. [154] Y. Yu, C. Fang, and Z. Liao, “Piecewise flat embedding for image segmentation,” in ICCV, 2015, pp. 1368–1376. [155] Z. Liu, V. W. Zheng, Z. Zhao, H. Yang, K. C.-C. Chang, M. Wu, and J. Ying, “Subgraph-augmented path embedding for semantic user search on heterogeneous social network,” in WWW, 2018. Hongyun Cai received the Ph.D. degree in Computer Science from the University of Queensland in 2016. She is currently a postdoctoral researcher at the Advanced Digital Sciences Center, Singapore. Her research focuses on graph mining, social data management and analysis. Vincent W. Zheng received the Ph.D. degree in Computer Science from the Hong Kong University of Science and Technology in 2011. He is a senior research scientist at the Advanced Digital Sciences Center, Singapore, and a research affiliate at the University of Illinois at Urbana-Champaign. His research interests include graph mining, information extraction, ubiquitous computing and machine learning. Kevin Chen-Chuan Chang is a Professor in University of Illinois at Urbana-Champaign. His research addresses large-scale information access, for search, mining, and integration across structured and unstructured big data including Web data and social media. He also cofounded Cazoodle for deepening vertical dataaware search over the Web.
2cs.AI
Logical Methods in Computer Science Vol. 11(4:12)2015, pp. 1–76 www.lmcs-online.org Submitted Published Jan. 16, 2015 Dec. 16, 2015 MODULAR SESSION TYPES FOR OBJECTS SIMON J. GAY a , NILS GESBERT b , ANTÓNIO RAVARA c , AND VASCO T. VASCONCELOS d a University of Glasgow e-mail address: [email protected] b Grenoble INP – Ensimag e-mail address: [email protected] c Universidade Nova de Lisboa e-mail address: [email protected] d Universidade de Lisboa e-mail address: [email protected] Abstract. Session types allow communication protocols to be specified type-theoretically so that protocol implementations can be verified by static type checking. We extend previous work on session types for distributed object-oriented languages in three ways. (1) We attach a session type to a class definition, to specify the possible sequences of method calls. (2) We allow a session type (protocol) implementation to be modularized, i.e. partitioned into separately-callable methods. (3) We treat session-typed communication channels as objects, integrating their session types with the session types of classes. The result is an elegant unification of communication channels and their session types, distributed object-oriented programming, and a form of typestate supporting non-uniform objects, i.e. objects that dynamically change the set of available methods. We define syntax, operational semantics, a sound type system, and a sound and complete type checking algorithm for a small distributed class-based object-oriented language with structural subtyping. Static typing guarantees that both sequences of messages on channels, and sequences of method calls on objects, conform to type-theoretic specifications, thus ensuring type-safety. The language includes expected features of session types, such as delegation, and expected features of object-oriented programming, such as encapsulation of local state. 1. Introduction Computing infrastructure has become inherently concurrent and distributed, from the internals of machines, with the generalisation of many- and multi-core architectures, to data storage and sharing solutions, with “the cloud”. Both hardware and software systems are now not only distributed but also collaborative and communication-centred. Therefore, the precise 2012 ACM CCS: [Theory of computation]: Semantics and reasoning—Program constructs—Type structures / Object oriented constructs; Models of computation—Concurrency—Parallel computing models; Semantics and reasoning— Program semantics— Operational semantics. Key words and phrases: typestate, session types, object-oriented calculus, Non-uniform method availability. l LOGICAL METHODS IN COMPUTER SCIENCE c DOI:10.2168/LMCS-11(4:12)2015 CC S. J. Gay, N. Gesbert, A. Ravara, and V. T. Vasconcelos Creative Commons 2 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS specification of the protocols governing the interactions, as well as the rigorous verification of their correctness, are critical factors to ensure the reliability of such infrastructures. Software developers need to work with technologies that may provide correctness guarantees and are well integrated with the tools usually used. Since Java is one of the most widely used programming languages, the incorporation of support to specify and implement correct software components and their interaction protocols would be a step towards more reliable systems. Behavioural types represent abstractly and concisely the interactive conduct of software components. These kind of types are simple yet expressive languages, that characterise the permitted interaction within a distributed system. The key idea is that some aspects of dynamic behaviour can be verified statically, at compile-time rather than at run-time. In particular, when working with a programming language equipped with a behavioural type system, one can statically ensure that an implementation of a distributed protocol, specified with types, is not only safe in the standard sense (“will not go wrong”), but also that the sequences of interactions foreseen by the protocol are realizable by its distributed implementation. Thorough descriptions of the state-of-the-art of research on the topic have been prepared by COST Action IC1201 (Behavioural Types for Reliable Large-Scale Software Systems, “BETTY”) [3, 46]. The problem we address herein is the following: can one specify the full interactive behaviour of a given protocol as a collection of types and check that a Java implementation of that protocol realises safely such behaviour? The solution we present works like this: first, specify as a session type (a particular idiom of behavioural types) the behaviour of each party involved in the protocol; second, using each such term to type a class, implement the protocol as a (distributed, using channel-based communication where channels are objects) Java program; third, simply compile the code and if the type checker accepts it, then the code is safe and realises the protocol. Details follow. Session types [43, 70] allow communication protocols to be specified type-theoretically, so that protocol implementations can be verified by static type checking. The underlying assumption is that we have a concurrent or distributed system with bi-directional point-topoint communication channels. These are implemented in Java by TCP/IP socket connections. A session type describes the protocol that should be followed on a particular channel; that is to say, it defines the permitted sequences, types and directions of messages. For example, the session type S = ! [Int] . ? [Bool] . end specifies that an integer must be sent and then a boolean must be received, and there is no further communication. More generally, branching and repetition can also be specified. A session type can be regarded as a finite-state automaton whose transitions are annotated with types and directions, and whose language defines the protocol. Session types were originally formulated for languages closely based on process calculus. Since then, the idea has been applied to functional languages [38, 39, 58, 64, 73], the process-oriented programming language Erlang [55], component-based object systems [72], object-oriented languages [17, 27, 28, 29, 30, 45], operating system services [31], and more general service-oriented systems [18, 23]. Session types have also been generalised from two-party to multi-party systems [11, 42], although in the present paper we will only consider the two-party case. In previous work [36] we proposed a new approach to combining session-typed communication channels and distributed object-oriented programming. Our approach extends MODULAR SESSION TYPES FOR OBJECTS 3 earlier work and allows increased programming flexibility. We adopted the principle that it should be possible to store a channel in a field of an object and allow the object’s methods to use the field like any other; we then followed the consequences of this idea. For example, consider a field containing a channel of type S above, and suppose that method m sends the integer and method n receives the boolean. Because the session type of the channel requires the send to occur first, it follows that m must be called before n. We therefore need to work with non-uniform objects, in which the availability of methods depends on the state of the object: method n is not available until after method m has been called. In order to develop a static type system for object-oriented programming with session-typed channels, we use a form of typestate [69] that we have previously presented under the name of dynamic interfaces [74]. In this type system, the availability of a class’s methods (i.e., the possible sequences of method calls) is specified in a style that itself resembles a form of session type, giving a pleasing commonality of notation at both the channel and class levels. The result of this combination of ideas is a language that allows a natural integration of programming with session-based channels and with non-uniform objects. In particular, the implementation of a session can be modularized by dividing it into separate methods that can be called in turn. This is not possible in SJ [45], the most closely related approach to combining sessions and objects (we discuss related work thoroughly in Section 9). We believe that we have achieved a smooth and elegant combination of three important high-level abstractions: the object-oriented abstraction for structuring computation and data, the typestate abstraction for structuring state-dependent method availability, and the session abstraction for structuring communication. Contributions In the present paper we formalize a core distributed class-based object-oriented language with a static type system that combines session-typed channels and a form of typestate. The language is intended to model programming with TCP/IP sockets in Java. The formal language differs from that introduced in our previous work [36] by using structural rather than nominal types. This allows several simplifications of the type system. We have also simplified the semantics, and revised and extended the presentation. We prove that static typing guarantees two runtime safety properties: first, that the sequence of method calls on every non-uniform object follows the specification of its class’s session type; second, as a consequence (because channel operations are implemented as method calls), that the sequence of messages on every channel follows the specification of its session type. This paper includes full statements and proofs of type safety, in contrast to the abbreviated presentation in our conference paper. We also formalize a type checking algorithm and prove its correctness, again with a revised and expanded presentation in comparison with the conference paper. There is a substantial literature of related work, which we discuss in detail in Section 9. Very briefly, the contributions of our paper are the following. • In contrast to other work on session types for object-oriented languages, we do not require a channel to be created and completely used (or delegated) within a single method. Several methods can operate on the same channel, thus allowing effective encapsulation of channels in objects, while retaining the usual object-oriented development practice. This is made possible by our integration of channels and non-uniform objects. This contribution was the main motivation for our work. 4 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS class F i l e { session I n i t where I n i t = { {OK, ERROR} open ( S t r i n g ) : hOK: Open , ERROR: I n i t i } Open = { {TRUE, FALSE } hasNext ( ) : hTRUE: Read , FALSE : Close i , Null close ( ) : I n i t } Read = { S t r i n g read ( ) : Open , N u l l c l o s e ( ) : I n i t } Close = { N u l l c l o s e ( ) : I n i t } open ( f i l e n a m e ) { . . . } hasNext ( ) { . . . } read ( ) { . . . } close ( ) { . . . } } 1 2 3 4 5 6 7 8 9 10 11 12 Figure 1: A class describing a file in some API • In contrast to other typestate systems, we use a global specification of method availability, inspired by session types, as part of a class definition. This replaces pre- and post-condition annotations on method definitions, except in the particular case of recursive methods. • When an object’s typestate depends on the result (in an enumerated type) of a method call, meaning that the result must be case-analyzed before using the object further, we do not force the case-analysis to be done immediately by using a combined “switch-call” primitive. Instead, the method result can be stored in a field and the case-analysis can happen at any subsequent point. Although this feature significantly increases the complexity of the formal system and could be omitted for simplicity, it supports a natural programming style and gives more options to future programming language designers. • Our structural definition of subtyping provides a flexible treatment of relationships between typestates, which can also support inheritance; this is discussed further in Section 4.7. The remainder of the paper is structured as follows. In Section 2 we illustrate the concept of dynamic interfaces by means of a sequential example. In Section 3 we formalize a core sequential language and in Section 4 we describe some extensions. In Section 5 we extend the sequential example to a distributed setting and in Section 6 we extend the formal language to a core distributed language. In Section 7 we state and prove the key properties of the type system. In Section 8 we present a type checking algorithm and prove its soundness and completeness, and describe a prototype implementation of a programming language based on the ideas of the paper. Section 9 contains a more extensive discussion of related work; Section 10 outlines future work and concludes. 2. A Sequential Example A file is a natural example of an object for which the availability of its operations depends on its state. The file must first be opened, then it can be read repeatedly, and finally it must be closed. Before reading from the file, a test must be carried out in order to determine whether or not any data is present. The file can be closed at any time. There is a variety of terminology for objects of this kind. Ravara and Vasconcelos [67] refer to them as non-uniform. We have previously used the term dynamic interface [74] to indicate that the interface, i.e. the set of available operations, changes with time. The term typestate [69] is also well established. MODULAR SESSION TYPES FOR OBJECTS 5 I ERROR open() close() close() OK O hasNext() close() read() TRUE R FALSE C Figure 2: Diagrammatic representation of the session type of class File in Figure 1 Figure 1 defines the class File , which we imagine to be part of an API for using a file system. The definition does not include method bodies, as these would typically be implemented natively by the file system. What it does contain is method signatures and, crucially, a session type definition which specifies the availability of methods. We will refer to a skeleton class definition of this kind as an interface, using the term informally to mean that method definitions are omitted. The figure shows the method signatures in the session type and not as part of the method definitions as is normal in many programming languages. This style is closer to the formal language that we define in Section 3. Line 3 declares the initial session type Init for the class. This and other session types are defined on lines 4–7. We will explain them in detail; they are types of objects, indicating which methods are available at a given point and which is the type after calling a method. In a session type, the constructor {...}, which we call branch, indicates that certain methods are available. In this example, Init declares the availability of one method (open), states Open and Read allow for two methods each, and state Close for a single method (close). For technical convenience, the presence of data is tested by calling the method hasNext, in the style of a Java iterator, rather than by calling an endOfFile method. If desired, method hasNext could also be included in state Read. The constructor h ... i, which we call variant, indicates that a method returns a value from an enumeration, and that the subsequent type depends on the result. For example, from state Init the only available method is open, and it returns a value from an enumeration comprising the constants (or labels) OK and ERROR. If the result is OK then the next state is Open; if the result is ERROR then the state remains Init . It is also possible for a session type to be the empty set of methods, meaning that no methods are available; this feature is not used in the present example, but would indicate the end of an object’s useful life. The session type can be regarded as a finite state automaton whose transitions correspond to method calls and results. This is illustrated in Figure 2. Notice the two types of nodes ( {...} and h ... i) and the two types of labels in arcs (method names issuing from {...} nodes and enumeration constants issuing from h ... i nodes). Our language does not include constructor methods as a special category, but the method open must be called first and can therefore be regarded as doing initialisation that might be included in a constructor. Notice that open has the filename as a parameter. Unlike a 6 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS class F i l e R e a d e r { session I n i t where I n i t = { N u l l i n i t ( ) : { N u l l read ( S t r i n g ) : F i n a l } } Final = { String toString ( ) : Final } f i l e ; text ; init () { f i l e = new F i l e ( ) ; t e x t = " " ; / / Evaluates to n u l l } read ( f i l e n a m e ) { switch ( f i l e . open ( f i l e n a m e ) ) { case ERROR: null ; case OK: while ( f i l e . hasNext ( ) ) t e x t = t e x t + f i l e . read ( ) ; f i l e . c l o s e ( ) ; / / Returns n u l l } } toString () { text ; } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Figure 3: A client that reads from a File typical file system API, creating an object of class File does not associate it with a particular file; instead this happens when open is called. The reader might expect a declaration void close() rather than Null close() ; for simplicity, we do not address procedures in this paper, instead working with the type Null inhabited by a single value, null. Methods open and hasNext return a constant from an enumeration: OK or ERROR for method open, and TRUE or FALSE for method hasNext. Enumerations are simply sets of labels, and do not need to be declared with names. Figure 3 defines the class FileReader, which uses an object of class File . FileReader has a session type of its own, defined on lines 2–3. It specifies that methods must be called in the sequence init , read, toString , toString , . . . . Line 5 defines the fields of FileReader. The formal language does not require a type declaration for fields, since fields always start with type Null, and are initialised to value null. Fields are always private to a class, even if we do not use a corresponding keyword. Lines 7–10 define the method init , which has initialisation behaviour typical of a constructor. Lines 12–19 illustrate the switch construct. In this particular case the switch is on the result of a method call. One of the distinctive features of our language is that it is possible, instead, to store the result of the method call in a field and later switch on the field; we will explain this in detail later. This contrasts with, for example, Sing# [31], in which the call/switch idiom is the only possibility. The while loop (lines 16–17) is similar in the sense that the result of file .hasNext must be tested in order to find out whether the loop can continue, calling file .read, or must terminate. Line 21 defines the method toString which simply accesses a field. Typechecking the class FileReader according to our type system detects many common mistakes. Each of the following code fragments contains a type error. • f i l e . open ( f i l e n a m e ) ; MODULAR SESSION TYPES FOR OBJECTS 7 class FileReadToEnd { session I n i t where I n i t = { { OK,ERROR} open ( S t r i n g ) : hOK: Open , ERROR: { I n i t } i } Open = { { TRUE, FALSE } hasNext ( ) : hTRUE: Read , FALSE : Close i } Read = { S t r i n g read ( ) : Open } Close = { N u l l c l o s e ( ) : { I n i t } } } Figure 4: Interface for class FileReadToEnd f i l e . read ( ) ...; The open method returns either OK or ERROR, and the type of file is the variant type hOK: Open, ERROR: Initi. The tag for this variant type is the result of open. Because the type of file is a variant, a method cannot be called on it; first we must use a switch statement to analyse the result of open and discover which part of the variant we are in. • switch ( f i l e . open ( f i l e n a m e ) ) case OK: t e x t = f i l e . read ( ) ; Here, a switch is correctly used to find out whether or not the file was successfully opened. However, if file is in state Open, the read method cannot be called immediately. First, hasNext must be called, with a corresponding switch. • r e s u l t = f i l e . open ( f i l e n a m e ) ; ... switch ( r e s u l t ) case ERROR: f i l e . c l o s e ( ) ; In state ERROR, method close is not available (because the file was not opened successfully). The only available method is open. • f i l e . close ( ) ; i f ( f i l e . hasNext ( ) ) ... After calling close, the file is in state Init , so the method hasNext is not available. Only open is available. Clearly, correctness of the code in Figure 3 requires that the sequence of method calls on field file within class FileReader matches the available methods in the session type of class File , and that the appropriate switch or while loops are performed when prescribed by session types of the form h ... i in class File . Our static type system, defined in Section 3, enables this consistency to be checked at compile-time. A distinctive feature of our type system is that methods are checked in a precise order: that prescribed by the session type ( init , read, toString in class FileReader, Figure 3). As such the type of the private reference file always has the right type (and no further annotations—pre/post conditions—are required when in presence of non-recursive methods). Also, in order to check statically that an object with a dynamic interface such as file is used correctly, our type system treats the reference linearly so that aliases to it cannot be created. This restriction is not a problem for a simple example such as this one, but there is a considerable literature devoted to more flexible approaches to unique ownership. We discuss this issue further in Sections 4.6, 9 and 10. In order to support separate compilation we require only the interface of a class, including the class name and the session type (which in turn includes the signature of each method). For example, in order to typecheck classes that are clients of FileReader, we only need its 8 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS interface. Similarly, to typecheck class FileReader, which is a client of File , it suffices to use the interface for class File , thus effectively supporting typing clients of classes containing native methods. Figure 4 defines the interface for a class FileReadToEnd. This class has the same method definitions as File , but the close method is not available until all of the data has been read. According to the subtyping relation defined in Section 3.4, type Init of File is a subtype of type Init of FileReadToEnd, which we express as File . Init <: FileReadToEnd.Init. Subtyping guarantees safe substitution: an object of type File . Init can be used whenever an object of type FileReadToEnd.Init is expected, by forgetting that close is available in more states. As it happens, FileReader reads all of the data from its File object and could use a FileReadToEnd instead. 3. A Core Sequential Language We now present the formal syntax, operational semantics, and type system of a core sequential language. As usual, the formal language makes a number of simplifications with respect to the more practical syntax used in the examples in Section 2. We summarise below the main differences with what was discussed in the previous section; in Section 4, we will discuss in more detail how some usual programming idioms, which would be expected in a full programming language, can be encoded into this formal core. • Every method has exactly one parameter. This does not affect expressivity, as multiple parameters can be passed within an object, and a dummy parameter can be added if necessary: we consider a method call of the form f.m() as an abbreviation for f.m(null). • Field access and assignment are defined in terms of a swap operation f ↔ e which puts the value of e into the field f and evaluates to the former content of f . This operation is formally convenient because our type system forbids aliasing. In Java, the expression f = e computes the result of e and then both puts it into f and evaluates to it, allowing expressions such as g = (f = e) which create aliases; reading a field without removing its content also allows creation of aliases. The swap operation is a combined read-write which does not permit aliasing. The normal assignment operation f = e is an abbreviation for f ↔ e; null (where the sequence operator explicitly discards the former content of f ) and field read as the standalone expression f is an abbreviation for f ↔ null. They differ from usual semantics by the fact that field read is destructive and that the assigment expression evaluates to null. • In the examples, all method signatures appearing in a branch session type indicate both a return type and a subsequent session type. In general, those types are two separate things. However, when the subsequent behaviour of the object depends on the returned value, like the case of Open in type Init on line 3 of Fig. 1, the return type is an enumerated set of labels and the subsequent session type is a variant which must provide cases for exactly these labels. To simplify definitions, we avoid this redundant specification in the formal language, and when the subsequent session type is a variant, the return type of the method is always the special type variant-tag, which indicates that the method will return a label from the variant. MODULAR SESSION TYPES FOR OBJECTS Class dec Class session types Method dec Types Label sets Values Expressions 9 ~} D ::= class C {S; f~; M S ::= {Ti0 mi (Ti ) : Si }i∈I | hl : Sl il∈E | X | µX.S M ::= m(x) {e} T ::= Null | S | E | variant-tag E ::= {l, . . . , l} v ::= null | l e ::= v | f.m(e) | x | e; e | switch (e) {l : el }l∈E | f ↔ e | new C() Figure 5: Top level syntax Types Field types T ::= . . . | link f | C[F ] F ::= {Ti fi }i∈I | hl : Fl il∈E Values v ::= . . . | o Paths r ::= o | r.f Expressions e ::= . . . | return e Object records R ::= C[{fi = vi }i∈I ] Heaps h ::= ε | h, {o = R} States Contexts s ::= (h ∗ r , e) E ::= [_] | E; e | switch (E) {l : el }l∈E | return E | f ↔ E | f.m(E) The productions for types, values and expressions extend those in Figure 5. Session types may never contain types of the form link f , even in the extended syntax. Figure 6: Extended syntax, used only in the type system and semantics 3.1. Syntax. We separate the syntax into the top-level language (Figure 5) and the extensions required by the type system and operational semantics (Figure 6). Identifiers C, m, f and l are taken from disjoint countable sets representing names of classes, methods, fields and labels respectively. The vector arrow indicates a sequence of zero or more elements of the syntactic class it is above. Similarly, constructs indexed by a set denote a finite sequence. We use E to specifically denote finite sets of labels l, whereas I is any finite indexing set. Field names always refer to fields of the current object; there is no qualified field specification o.f . In other words, all fields are private. Method call is only available on a field, not an arbitrary expression. This is because calling a method changes the session type of the object on which the method is called, and in order for the type system to record this change, the object must be in a specified location (field). Conversely, there is no unqualified method call in the core language. Calling a method on the current object this, which we call a self-call, behaves differently from external calls with respect to typing and will be discussed as an extension in Section 4.5, A program consists of a sequence of class declarations D. In the core language, types in a top-level program only occur in the session part of a class declaration: no type is declared for fields because they can vary at run-time and are always initially null, and method declarations are also typeless, as explained earlier. A session type S corresponds to a view of an object from outside. It shows which methods can be called, and their signatures, but the fields are not visible. We refer to {Ti0 mi (Ti ) : Si }i∈I as a branch type and to hl : Sl il∈E as a variant type. Session type end 10 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS abbreviates the empty branch type {}. The core language does not include named session types, or the session and where clauses from the examples; we just work with recursive session type expressions of the form µX.S, which are required to be contractive, i.e. containing no subexpression of the form µX1 .· · · µXn .X1 . We require contractivity so that every session type defines some behaviour. The µ operator is a binder, giving rise, in the standard way, to notions of bound and free variables and alpha-equivalence. A type is closed if it includes no free variables. We denote by T {U/X } the capture-avoiding substitution of U for X in T . Value types which can occur either as parameter or return type for a method are: Null which has the single value null, a session type S which is the type of an object, or an enumerated type E which is an arbitrary finite set of labels l. Additionally, the specific return type variant-tag is used for method occurrences after which the resulting session type is a variant, and means that the method result will be the tag of the variant. The set of possible labels appears in the variant construct of the session type, so it is not necessary to specify it in the return type of the method. However, in the example code, the set of labels is written instead of variant-tag, so that the method signature shows the return type in the usual way. The type system, which we will describe later, enforces the following restrictions on session types: the immediate components of a variant type are always branch types, and the session type in a class declaration is always a branch. This is because a variant type is used only to represent the effect of method calls and the dependency between a method result and the subsequent session type, so it only makes sense immediately within a branch type. Figure 6 defines additional syntax that is needed for the formal system but is not used in top-level programs. This includes: • some extra forms of types, which are used internally to type some subexpressions but cannot be the argument type or return type of a method, and thus are never written in a program; • intermediate expressions that cannot appear in a program but arise from the operational semantics; • syntax for the heap. Internal types. The first internal type we add is the type link f , where f is the name of a field. This type is related to variant session types and the variant-tag type, in the way illustrated by the following example: suppose that, in some context, field f of the current object contains an object whose type is {variant-tag m(Null) : hl : Sl il∈E }. This means that the expression f.m(null) is allowed in this context and will both: change the abstract state of the object in f to one of the Sl , and return the label l corresponding to that particular state. Thus, there is a link between the value of the expression and the type of field f after evaluating the expression, and the type system needs to keep track of this link; to this end, the expression f.m(null) is given, internally, the type link f , rather than variant-tag which does not contain enough information. The use of link f is also illustrated in Figure 13. The second internal type is an alternative form of object type, C[F ], which has a field typing instead of a session type. Recall that in our language, all object fields are private; therefore, normally the type of an object is a session type which only refers to methods. However, an object has access to its own fields, so for typechecking a method definition, the type environment needs to provide types for the fields of the current object (this). Since the types of the fields change throughout the life of the object, the class definition is not enough to know their types at a particular point. We thus use a field typing F , which is usually a MODULAR SESSION TYPES FOR OBJECTS 11 record type associating one type to each field of the object. For example, C[{Null f1 ; S f2 }] represents an object of class C with exactly two fields, f1 , which currently contains a value of type Null, and f2 which currently contains an object in state S. Note that in C[F ], F must provide types for exactly all the fields of class C. The other form of field typing is a variant field typing, which regroups several possible sets of field types indexed by labels. For example, C[hl1 : {Null f1 ; S f2 }; l2 : {E f1 ; S 0 f2 }i] represents an object of class C, whose two fields are f1 and f2 , and where either f1 has type Null and f2 has type S, or f1 has type E and f2 has type S 0 , depending on the value of the label. These field typings cannot be the type of expressions (which cannot evaluate to this); they only represent the type of the current object in type environments. The relation between field typings and session types will be discussed in Section 3.5.2. Internal expressions, heap, and states. These other additions are used to define the operational semantics. A heap h maps object identifiers o, taken from yet another countable set of names, to object records R. We write dom(h) for the set of object identifiers in h. The identifiers are values, which may occur in expressions. The operation h, {o = R} represents adding a record for identifier o to the heap h and we consider it to be associative and commutative, that is, h is essentially an unordered set of bindings. It is only defined if o 6∈ dom(h). Paths r represent locations in the heap. A path consists of a top-level object identifier followed by an arbitrary number of field specifications. We use the following notation to interpret paths relative to a given heap. Definition 3.1 (Heap locations). • If R = C[{fi = vi }i∈I ], we define R.fi = vi (for all i) and R.class = C. For any value v and any j ∈ I, we also define R{fj 7→ v} = C[{fi = vi0 }i∈I ] where vi0 = vi for i 6= j and vj0 = v. • If h = (h0 , {o = R}), we define h(o) = R, and for any field f of R, h{o.f 7→ v} = (h0 , {o = R{f 7→ v}}). • If r = r0 .f and h(r0 ).f = o, then we also define h(r) = h(o) and h{r.f 0 7→ v} = h{o.f 0 7→ v}. • In any other case, these operations are not defined. Note in particular that h(r) is not defined if r is a path that exists in h but does not point to an object identifier. There is a new form of expression, return e, which is used to represent an ongoing method call. Finally, a state consists of a heap and an expression, and the operational semantics will be defined as a reduction relation on states; E are evaluation contexts in the style of Wright and Felleisen [76], used in the definition of reduction. The semantic and typing rules we will present next are implicitly parameterized by the set of declarations D which constitute the program. It is assumed that the whole set is available at any point and that any class is declared only once. We do not require the sets of method or field names to be disjoint from one class to another. We will use the following ~ } is one of the declarations, C.session means S and C.fields notation: if class C {S; f~; M ~ then C.m is e. means f~, and if m(x) {e} ∈ M 3.2. Operational Semantics. Figure 7 defines an operational semantics on states (h ∗ r , e) consisting of a heap h, a path r in the heap indicating the current object, and an expression 12 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS (R-Call) m(x) {e} ∈ h(r.f ).class (h ∗ r , f.m(v)) −→ (h ∗ r.f , return e{v/x }) (R-Return) (h ∗ r.f , return v) −→ (h ∗ r , v) C.fields = f~ −→ (h ∗ r , new C()) −→ (h, {o = C[f~ = null]} ∗ r , o) o 6∈ dom(h) (R-New) h(r).f = v (R-Swap) (R-Switch) 0 (h ∗ r , f ↔ v ) −→ (h{r.f 7→ v 0 } ∗ r , v) l0 ∈ E (h ∗ r , switch (l0 ) {l : el }l∈E ) −→ (h ∗ r , el0 ) (R-Seq) (h ∗ r , v; e) −→ (h ∗ r , e) (h ∗ r , e) −→ (h0 ∗ r0 , e0 ) (R-Context) (h ∗ r , E[e]) −→ (h0 ∗ r0 , E[e0 ]) Figure 7: Reduction rules for states e. In general, e is an expression obtained by a series of reduction steps from a method body, where the method was called on the object identified by the path r. All rules have the implicit premise that the expressions appearing in them must be defined. For example, f ↔ v only reduces if h(r) is an object record containing a field named f . An example of reduction, together with typing, is presented in Figure 13 and discussed at the end of the present section. The current object path r is used to resolve field references appearing in the expression e. It behaves like a call stack: as shown in R-Call, when a method call on a field f (relative to the current object located at r) is entered, the object in r.f becomes the current object; this is indicated by changing the path to r.f . Additionally, the method body, with the actual parameter substituted for the formal parameter, is wrapped in a return expression and replaces the method call. When the body has reduced to a value, this value is unwrapped by R-Return which also pops the field specification f from the path, recovering the previous current object r. This is illustrated in Figure 13, which also shows the typing of expressions in a series of reductions. R-New creates a new object in the heap, with null fields. R-Swap updates the value of a field and reduces to its former value. R-Switch is standard. R-Seq discards the result of the first part of a sequential composition. R-Context is the usual rule for reduction in contexts. To complete the definition of the semantics we need to define the initial state. The idea is to designate a particular method m of a particular class C as the main method, which is called in order to begin execution. The most convenient way to express this is to have an initial heap that contains an object of class C, which is also chosen as the current object, and an initial expression e which is the body of m. The initial state is therefore ~ ∗ top , e) (top = C[C.fields = null] where top is the identifier of the top-level object of class C, which is the only object in the heap, and the current object path is also top. Strictly speaking, method m must have a parameter x; we take x to be of type Null and assume that it does not occur in e. 3.3. Example of reduction. Assume that the top-level class is C, containing fields f and g. Assume also that there is another class C 0 which defines the set of methods {mi | i ∈ I}. MODULAR SESSION TYPES FOR OBJECTS 13 (top = C[f = null, g = null] ∗ top , f = new C 0 (); g = f.mj (); switch (g) {l : el }l∈E ) ↓ (Expand) (top = C[f = null, g = null] ∗ top , f ↔ new C 0 (); null; g = f.mj (); switch (g) {l : el }l∈E ) ↓ (R-New) 0 (top = C[f = null, g = null], o = C [] ∗ top , f ↔ o; null; g = f.mj (); switch (g) {l : el }l∈E ) ↓ (R-Swap) (top = C[f = o, g = null], o = C 0 [] ∗ top , null; null; g = f.mj (); switch (g) {l : el }l∈E ) ↓ (R-Seq, R-Seq) (top = C[f = o, g = null], o = C 0 [] ∗ top , g = f.mj (); switch (g) {l : el }l∈E ) ↓ (Expand) (top = C[f = o, g = null], o = C 0 [] ∗ top , g ↔ f.mj (); null; switch (g ↔ null) {l : el }l∈E ) ↓ (Simplify) (top = C[f = o, g = null], o = C 0 [] ∗ top , g ↔ f.mj (); switch (g ↔ null) {l : el }l∈E ) ↓ (R-Call) (top = C[f = o, g = null], o = C 0 [] ∗ top.f , g ↔ return e; switch (g ↔ null) {l : el }l∈E ) ↓ (Evaluate e) (top = C[f = o, g = null], o = C 0 [] ∗ top.f , g ↔ return l0 ; switch (g ↔ null) {l : el }l∈E ) ↓ (R-Return) (top = C[f = o, g = null], o = C 0 [] ∗ top , g ↔ l0 ; switch (g ↔ null) {l : el }l∈E ) ↓ (R-Swap, R-Seq) (top = C[f = o, g = l0 ], o = C 0 [] ∗ top , switch (g ↔ null) {l : el }l∈E ) ↓ (R-Swap) (top = C[f = o, g = null], o = C 0 [] ∗ top , switch (l0 ) {l : el }l∈E ) ↓ (R-Switch) (top = C[f = o, g = null], o = C 0 [] ∗ top , el0 ) Figure 8: A series of reduction steps. Finally, assume that the body of the main method of C is f = new C 0 (); g = f.mj (); switch (g) {l : el }l∈E where j is some element of I. The initial state is (top = C[f = null, g = null] ∗ top , f = new C 0 (); g = f.mj (); switch (g) {l : el }l∈E ) where for simplicity we have ignored the parameter of mj . Figure 8 shows the sequence of reduction steps until one of the cases of the switch is reached. The first step is expansion of the syntactic sugar for assignment, translating it into a swap followed by null. Another similar translation step occurs later. The first real reduction step is R-New, creating an object o, followed by R-Swap to complete the assignment into field f and then R-Seq to tidy up. Next, the step labelled “simplify” informally removes null in order to avoid carrying it through to an uninteresting R-Seq reduction later. Now assume that the body of method mj is e. Reduction by R-Call changes the current object path to top.f because the current object is now o. Several reduction steps convert e to a particular element of the enumerated type E, which we call l0 . After that, R-Return changes the current object path back to top, and then some R-Swap and R-Seq steps bring l0 into the guard of the switch, finally allowing the appropriate case el0 to be selected. 14 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS (S-Record) ∀i ∈ I, Ti <: Ti0 {Ti fi }i∈I <: {Ti0 fi }i∈I (S-Field) (S-Variant) E ⊆ E0 ∀l ∈ E, Fl <: Fl0 hl : Fl il∈E <: hl : Fl0 il∈E 0 F <: F 0 C[F ] <: C[F 0 ] Figure 9: Subtyping rules for fields We will return to this example in Section 3.6, to show how each state is typed. 3.4. Subtyping. Subtyping is an essential ingredient of the theory of session types. Originally proposed by Gay and Hole [37], it has been widely used in other session-based systems, with subject-reduction and type-safety holding. The guiding principle is the “safe substitutability principle” of Liskov and Wing [51], which states that, if S is a subtype of T , then objects of type T in a program may be safely replaced with objects of type S. Two kinds of types in the top-level core language are subject to subtyping: enumerated types and session types. The internal language also has field typings; subtyping on them is derived from subtyping on top-level types by the rules in Figure 9. Subtyping for enumerated types is defined as simple set inclusion: E <: E 0 if and only if E ⊆ E 0 . We refer to subtyping for session types as the sub-session relation. Because session types can be recursive, the sub-session relation is defined coinductively, by defining necessary conditions it must satisfy and taking the largest relation satisfying them. The definition involves checking compatibility between different method signatures, which itself is dependent on the whole subtyping relation. We proceed as follows: given a candidate sub-session relation R, we define an R-compatibility relation between types and between method signatures which uses R as a sub-session relation. We then use R-compatibility in the structural conditions that R must satisfy in order to effectively be a sub-session relation. Let S denote the set of contractive, closed, class session types. We deal with recursive types using the following unfold operator: Definition 3.2 (Unfolding). The operator unfold is defined inductively on S by unfold(µX.S) = unfold(S{(µX.S)/X }) and unfold(S) = S if S is not of the form µX.S. Since the types in S are contractive, this definition is well-founded. We now define the two compatibility relations we need. Definition 3.3 (R-Compatibility (Types)). Let R be a binary relation on S. We say that type T is R-compatible with type T 0 if one of the following conditions is true. (1) T = T 0 (2) T and T 0 are enumerated types and T ⊆ T 0 (3) T, T 0 ∈ S and (T, T 0 ) ∈ R. Definition 3.4 (R-Compatibility (Signatures)). Let R be a binary relation on S. Let σ = U m(T ) : S and σ 0 = U 0 m(T 0 ) : S 0 be components of branch types, both for the same method name m, i.e. method signatures with subsequent session types. We say that σ is R-compatible with σ 0 if T 0 is R-compatible with T and either: (1) U is R-compatible with U 0 and (S, S 0 ) ∈ R, or (2) U is an enumerated type E, U 0 = variant-tag and (hl : Sil∈E , S 0 ) ∈ R. MODULAR SESSION TYPES FOR OBJECTS 15 The compatibility relation on method signatures is, as expected, covariant in the return type and the subsequent session type and contravariant in the parameter type, but with one addition: if a method has an enumerated return type E and subsequent session type S, then it can always be used as if it had a return type of variant-tag and were followed by the uniform variant session type hl : Sil∈E . Indeed, both signatures mean that the method can return any label in E and will always leave the object in state S. We can now state the necessary conditions for a sub-session relation. Definition 3.5 (Sub-session). Let R be a binary relation on S. We say that R is a sub-session relation if (S, S 0 ) ∈ R implies: (1) If unfold(S) = {Ui mi (Ti ) : Si }i∈I then unfold(S 0 ) is of the form {Uj0 mj (Tj0 ) : Sj0 }j∈J with J ⊆ I, and for all j ∈ J, Uj mj (Tj ) : Sj is R-compatible with Uj0 mj (Tj0 ) : Sj0 . (2) If unfold(S) = hl : Sl il∈E then unfold(S 0 ) is of the form hl : Sl0 il∈E 0 with E ⊆ E 0 and for all l ∈ E, (Sl , Sl0 ) ∈ R. For the sake of simplicity we will now, when we refer to this definition later on, make the unfolding step implicit by assuming, without loss of generality, that neither S nor S 0 is of the form µX.S 00 . Lemma 3.6. The union of several sub-session relations is a sub-session relation. S Proof. Let R = i∈I Ri , where the Ri are sub-session relations. Let (S, S 0 ) ∈ R. Then there is j in I such that (S, S 0 ) ∈ Rj . This implies that (S, S 0 ) satisfies the conditions in Definition 3.5 with respect to Rj . Just notice that, because Rj ⊆ R, the conditions are satisfied with respect to R as well — in particular, Rj -compatibility implies R-compatibility. Indeed, the conditions for R only differ from those for Rj by requiring particular pairs of session types to be in R rather than in Rj , so they are looser. We now define the subtyping relation <: on session types to be the largest sub-session relation, i.e. the union of all sub-session relations. The subtyping relation on general top-level types is just <:-compatibility. Subtyping on session types means that either both are branches or both are variants. In the former case, the supertype must allow fewer methods and their signatures must be compatible; in the latter case, the supertype must allow more labels and the common cases must be in the subtyping relation. Like the definition of subtyping for channel session types [37], the type that allows a choice to be made (the branch type here, the ⊕ type for channels) has contravariant subtyping in the set of choices. The following lemma shows that the necessary conditions of Definition 3.5 are also sufficient in the case of <:. Lemma 3.7. (1) Let S = {Ui mi (Ti ) : Si }i∈I and S 0 = {Uj0 mj (Tj0 ) : Sj0 }j∈J with J ⊆ I. If for all j ∈ J, Uj mj (Tj ) : Sj is <:-compatible with Uj0 mj (Tj0 ) : Sj0 , then S <: S 0 . (2) Let S = hl : Sl il∈E and S 0 = hl : Sl0 il∈E 0 with E ⊆ E 0 . If for all l in E we have Sl <: Sl0 , then S <: S 0 . Proof. The relation <: ∪ {(S, S 0 )} is a sub-session relation. 16 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Finally, we prove that this subtyping relation provides a preorder on types. Proposition 3.8. The subtyping relation is reflexive and transitive. Proof. First note that session types can only be related by subtyping to other session types; the same applies to enumerated types and, in the internal system, field typings. Since the relation for enumerated types is just set inclusion, we already know the result for it. We now prove the properties for session types; the fact that they hold for field typings is then a straightforward consequence. For reflexivity, just notice that the diagonal relation {(S, S) | S ∈ S} is a sub-session relation, hence included in <:. For transitivity, what we need to prove is that the relation R = {(S, S 0 ) | ∃S 00 , S <: 00 S ∧ S 00 <: S 0 } is a sub-session relation. Let (S, S 0 ) ∈ R and let S 00 be as given by the definition of R. In case (1) where we have S = {Ui mi (Ti ) : Si }i∈I , we know that: • S 00 = {Uj00 mj (Tj00 ) : Sj00 }j∈J with J ⊆ I, and for all j ∈ J, σj = Ui mi (Ti ) : Sj is <:-compatible with σj00 = Uj00 mj (Tj00 ) : Sj00 . • Therefore, S 0 is of the form {Uk0 mk (Tk0 ) : Sk0 }k∈K with K ⊆ J, and for all k ∈ K, σk00 is <:-compatible with σk0 = Uk0 mk (Tk0 ) : Sk0 . Straightforwardly K ⊆ I. For every k in K, we have to prove that σk is R-compatible with σk0 . We deduce it from the two <:-compatibilities we know by looking into the definition of compatibility point by point: • We have Tk00 <: Tk and Tk0 <: Tk00 . Either these types are all session types, and then (Tk0 , Tk ) ∈ R by definition of R, or none of them is and we have Tk0 <: Tk by transitivity of subtyping on base types. In both cases, Tk0 is R-compatible with Tk . • We also have either: – Uk <: Uk00 , Uk00 <: Uk0 , Sk <: Sk00 and Sk00 <: Sk0 . In this case, the former two conditions imply, similarly to the above, that Uk is R-compatible with Uk0 . The latter two imply (Sk , Sk0 ) ∈ R. – Or Uk is an enumerated type E, Uk00 = Uk0 = variant-tag, hl : Sk il∈E <: Sk00 and Sk00 <: Sk0 . Then we have (hl : Sk il∈E , Sk0 ) ∈ R, which is all we need. – Or, finally, Uk is an enumerated type E, Uk00 is an enumerated type E 00 such that E ⊆ E 00 , Sk <: Sk00 and hl : Sk00 il∈E 00 <: Sk0 . Then from Sk <: Sk00 and E ⊆ E 00 we deduce, using case (2) of Lemma 3.7, hl : Sk il∈E <: hl : Sk00 il∈E 00 . We thus have, again, (hl : Sk il∈E , Sk0 ) ∈ R which is the required condition. In case (2) where we have S = hl : Sl il∈E , we obtain S 00 = hl : Sl00 il∈E 00 and S 0 = hl : Sl0 il∈E 0 , with E ⊆ E 00 ⊆ E 0 and for any l in E, Sl <: Sl00 and Sl00 <: Sl0 , which imply by definition of R that (Sl , Sl0 ) is in R. Definition 3.9 (Type equivalence). We define equivalence of session types S and S 0 as S <: S 0 and S 0 <: S. This corresponds precisely to S and S 0 having the same infinite unfoldings (up to the ordering of cases in branches and variants). Henceforth types are understood up to type equivalence, so that, for example, in any mathematical context, types µX.S and S{(µX.S)/X } can be used interchangeably, effectively adopting the equi-recursive approach [63, Chapter 21]. MODULAR SESSION TYPES FOR OBJECTS (T-Null) Γ ∗ r B null : Null C Γ ∗ r (T-Label) Γ ∗ r B l : {l} C Γ ∗ r (T-New) Γ ∗ r B new C() : C.session C Γ ∗ r (T-LinVar) Γ, x : S ∗ r B x : S C Γ ∗ r T is not an object type Γ, x : T ∗ r B x : T C Γ, x : T ∗ r (T-Var) (T-Swap) 17 Γ ∗ r B e : T C Γ0 ∗ r0 Γ0 (r0 .f ) = T 0 T 6= variant-tag T 0 is not a variant Γ ∗ r B f ↔ e : T 0 C Γ0 {r0 .f 7→ T } ∗ r0 Γ ∗ r B e : Tj0 C Γ0 ∗ r0 Γ0 (r0 .f ) = {Ti mi (Ti0 ) : Si }i∈I j∈I T = link f if Tj = variant-tag, T = Tj otherwise (T-Call) (T-Seq) Γ ∗ r B f.mj (e) : T C Γ0 {r0 .f 7→ Sj } ∗ r0 Γ ∗ r B e : T C Γ0 ∗ r0 Γ0 ∗ r0 B e0 : T 0 C Γ00 ∗ r0 0 0 00 Γ ∗ r B e; e : T C Γ ∗ r 0 (T-Switch) 0 T 6= link _ or variant-tag 0 0 Γ∗r Be:E CΓ ∗r E0 ⊆ E ∀l ∈ E 0 , Γ0 ∗ r0 B el : T C Γ00 ∗ r0 Γ ∗ r B switch (e) {l : el }l∈E : T C Γ00 ∗ r0 Γ ∗ r B e : link f C Γ0 ∗ r0 Γ0 (r0 .f ) = hl : Sl il∈E 0 0 0 0 E ⊆E ∀l ∈ E , Γ {r .f 7→ Sl } ∗ r0 B el : T C Γ00 ∗ r0 0 (T-SwitchLink) (T-VarF) (T-Sub) Γ ∗ r B switch (e) {l : el }l∈E : T C Γ00 ∗ r0 Γ ∗ r B e : E C Γ0 ∗ r0 Γ0 (r0 ) = C[F 0 ] 0 F 0 is a record Γ ∗ r B e : variant-tag C Γ {r 7→ C[hl : F il∈E ]} ∗ r0 Γ ∗ r B e : T C Γ0 ∗ r0 T <: T 0 0 0 Γ ∗ r B e : T C Γ ∗ r0 0 (T-SubEnv) 0 Γ ∗ r B e : T C Γ0 ∗ r0 Γ0 <: Γ00 00 Γ ∗ r B e : T C Γ ∗ r0 −−→ ~ Null f ` C : S (T-Class) ~} ` class C {S; f~; M Figure 10: Typing rules for the top level language 3.5. Type System. We introduce a static type system whose purpose is to ensure that typable programs satisfy a number of safety properties. As usual, we make use of a type preservation theorem, which states that reduction of a typable expression produces another typable expression. Therefore the type system is formulated not only for top-level expressions but for the states (i.e. (heap, expression) pairs) on which the reduction relation is defined. An important feature of the type system is that the method definitions within a particular class are not checked independently, but are analyzed in the order specified by the session type of the class. This is expressed by rule T-Class, the last rule in Figure 10, which uses −−→ a consistency relation Null f~ ` C : S between field typings and session types, defined in Section 3.5.2. Checking this relation requires checking the definitions of the methods occurring in S, in order. Checking method definitions uses the typing judgement for expressions, which is defined by the other rules in Figure 10. In the following sections we describe the type system in several stages. 3.5.1. Typing expressions. Definition 3.10 (Type environments). We use type environments of the form Γ = α1 : T1 , . . . , αn : Tn where each α is either a method parameter x or an object identifier o. 18 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS The typing judgement for expressions is Γ ∗ r B e : T C Γ0 ∗ r0 . In such a judgement, Γ and Γ0 are type environments and r and r0 are paths. The paths parameters are in fact only necessary for typing runtime expressions; they are needed for our type preservation theorem, but not for type-checking a program, where they always have the value this. They will be discussed in Section 3.5.4. The expression e and its type T appear in the central part of the judgement. The Γ0 on the right hand side shows the change, if any, that e causes in the type environment. There are several reasons for Γ0 to differ from Γ; the most important is that if e contains a method call on an object, then the session type of that object is different in Γ0 than it was in Γ. Another one is linearity: if a linear parameter x is used in e, then x does not appear in Γ0 because it has been consumed. When type-checking a program (as opposed to typing a runtime expression, which needs not be implemented), the judgements for expressions always have the particular form this : C[F ], V ∗ this B e : T C this : C[F 0 ], V 0 ∗ this, with only one object identifier in the environment, this, representing the object to which fields referred to in e belong. The rest of the environment, V , is either empty or has the form x : U where U is the type of the parameter x of the method currently being type-checked, and is thus a top-level type. The initial type of this is the internal type C[F ], where F is a field typing; the final type is C[F 0 ], as e may change the types of the fields (for example, by calling methods on them). The final parameter typing V 0 is either the same as V or empty, depending whether the parameter was consumed by e. We extend subtyping to a relation on type environments, as follows. Definition 3.11 (Environment subtyping). Γ <: Γ0 if for every α ∈ dom(Γ0 ), where α is either a parameter or an object identifier, we have α ∈ dom(Γ) and Γ(α) <: Γ0 (α). Essentially Γ <: Γ0 if Γ is more precise (contains more information) than Γ0 : it contains types for everything in Γ0 (and possibly more) and those types are more specific. 3.5.2. Consistency between field typings and session types. There are two possible forms for the type of an object. One is a session type S, which describes the view of the object from outside, i.e. from the perspective of code in other classes. The session type specifies which methods may be called, but does not reveal information about the fields. The other form, C[F ], contains a field typing F , and describes the internal view of the object, i.e. from the perspective of code in its own methods. Consider a sequence of method calls in a particular class. There are two senses in which it may be considered correct or incorrect. (1) In the sense that it is allowed, or not allowed, by the session type of the class. (2) In the sense that each call in the sequence leaves the fields of the object in a state which ensures the next call does not produce a type error. For example, if we consider the class FileReader of Figure 3, we see that the session type allows calling read() just after init () , making the sequence init (); read() correct in sense (1). It is correct in sense (2) if and only if the body of read() typechecks under the precondition that the fields file and text have the types produced by the evaluation of init () . In order to type a class definition, these two senses of correctness must be consistent according to the following coinductive definition. Definition 3.12. Let C be a class and let R be a relation between field typings F and session types S. We say that R is a C-consistency relation if (F, S) ∈ R implies: MODULAR SESSION TYPES FOR OBJECTS 19 (1) If S = {Ti mi (Ti0 ) : Si }i∈I , then F is not a variant and for all i in I, there is a definition mi (xi ) {ei } in the declaration of class C, and a field typing Fi , such that this : C[F ], xi : Ti0 ∗ this B ei : Ti C this : C[Fi ] ∗ this and (Fi , Si ) ∈ R. (2) If S = hl : Sl il∈E , then F = hl : Fl il∈E 0 with E 0 ⊆ E and for all l in E 0 we have (Fl , Sl ) ∈ R. In clause (1), S is the session type (external view) before calling one of the methods mi , and F is the field typing (internal view). If a particular mi is called then the subsequent session type is Si , and the subsequent field typing, arising from the typing judgement for the method body, is Fi . These types must be related. Clause (2) requires variant session types and field typings, arising from a method call that returns an enumeration label, to match. The inclusion E 0 ⊆ E allows the method to return labels from a smaller set than the one defined by the session type. Lemma 3.13. The union of several C-consistency relations is a C-consistency relation. Proof. Similar to (but simpler than) the proof of Lemma 3.6. For any class C, we define the relation F ` C : S between field typings F and session types S to be the largest C-consistency relation, i.e. the union of all C-consistency relations. The relation F ` C : S represents the fact that an object of class C with internal (private) field typing F can be safely viewed from outside as having type S. Clause (2) in Definition 3.12 accounts for correspondence between variant types. The main clause is clause (1): if the object’s fields have type F and its session type allows a certain method to be called, then it means that the method body is typable with an initial field typing of F and the declared type for the parameter. Furthermore, the type of the expression must match the declared return type and the final type of the fields must be compatible with the subsequent session type. The parameter may or may not be consumed by the method, but T-SubEnv at the end of Figure 10 (see next section) allows discarding it silently in any case, hence its absence from the final environment. The definition implies that a method with return type variant-tag must be followed by a variant session type, for the following reason. Suppose that in clause (1), some Ti is variant-tag. The only way for ei to have type variant-tag is by using rule T-VarF (discussed in the next section), which implies that Fi must be a variant field typing. The condition (Fi , Si ) ∈ R implies, by clause (1), that Si is a variant. The rule T-Class, last rule in Figure 10, checks that the initial session type of a class is consistent with the initial Null field typing. It refers to the above definition of consistency, which itself refers to typing judgements built using the other rules in the figure. 3.5.3. Typing rules for top-level expressions. The typing rules for top-level expressions (the syntax in Figure 5) are in Figure 10. They use the following notation for interpreting paths relative to type environments, analogously to Definition 3.1 for heaps. Definition 3.14 (Locations in environments). • If Γ = Γ0 , o : T then we define Γ(o) = T and Γ{o 7→ T 0 } = Γ0 , o : T 0 • Inductively, if r = r0 .f , and if Γ(r0 ) = C[F ] where F is a record field typing containing f , then Γ(r) is defined as F (f ) and Γ{r 7→ T 0 } as Γ{r0 7→ C[F {f 7→ T 0 }]}. 20 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS • In any other case, these operations are not defined. In particular, if Γ(r0 ) is defined but is a session type, then Γ(r0 .f ) is not defined for any f . A pair Γ ∗ r only makes sense if Γ(r) is defined and is of the form C[F ]. We now comment on these rules: T-Null and T-Label type constants. A label is given a singleton enumerated type, which is the smallest type it can have, but subsumption can be used to increase its type. T-New types a new object, giving it the initial session type from the class declaration. T-LinVar and T-Var are used to access a method’s parameter, removing it from the environment if it has an object type (which is linear). For simplicity, this is the only way to use a parameter. In particular, we do not allow calling methods directly on parameters: to call a method on a parameter, it must first be assigned to a field. This is just a simplification for this formal presentation and does not limit expressivity; this will be discussed in Section 4. T-Swap types the combined read-write field access operation, exchanging the types of the field and expression. There are two restrictions on its use. T is not allowed to be variant-tag, because this particular type only makes sense as the return type of a method. This condition effectively forbids the use of rule T-VarF in the typing derivation for e, because e is not what the method returns. It also has the consequence that Γ0 (r0 ) is not a variant type, because the only rule that could produce one is T-VarF; hence Γ0 (r0 .f ) is defined. The other condition is that T 0 is not allowed to be a variant type, because it is not allowed in our system to extract from a field a variantly-typed value without having switched on the associated tag first. Indeed, link types refer to fields by name, so moving variantly-typed values around would lose the connection between the value and its tag. T-Call checks that field f has a session type that allows method mj to be called. The type of the parameter is checked as usual, and the final type environment is updated to contain the new session type of the object in f . If the return type of the method is variant-tag (method open() in Figure 2 is one such example), it means that the value returned is a label describing the state of this object; since the object is in f , it is changed into link f . Because the return type appears in the session type and is therefore expressed in the top-level syntax, it cannot already be of the form link f . Observe that although types of the form link f are not written by the programmer, they can nevertheless occur in a typechecking derivation as the types of top-level expressions (as in the example in Figure 13). T-Seq accounts for the effects of the first expression on the environment and checks that a label is not discarded, which would leave the associated variant unusable. T-Switch types a switch whose expression e does not have a link type. All relevant branches are required to have the same type and final environment, and the whole switch expression inherits them. A typical example is if the branches just contain different labels: in that case they are given singleton types by T-Label and then T-Sub is used to give all of them the same enumerated type. If the type E 0 of the parameter expression is strictly smaller than the set E of case labels in the switch expression, branches corresponding to the extra cases are ignored. T-SwitchLink is the only rule for deconstructing variants. It types a switch, similarly to the previous one, but the type of e must be a link to a field f with a variant session type. The relevant branches are then typed with initial environments containing the different case types for f according to the value of the label. As before, they must all have the same type and final environment, and if the switch expression defines extra branches for labels which do not appear in the variant type of f , they are ignored. MODULAR SESSION TYPES FOR OBJECTS (T-Ref) (T-VarS) 21 r= 6 o.f~ Γ, o : T ∗ r B o : T C Γ ∗ r Γ ∗ r B e : E C Γ0 ∗ r0 Γ0 (r0 .f ) = S 0 S is a branch 0 Γ ∗ r B e : link f C Γ {r .f 7→ hl : Sil∈E } ∗ r0 Γ ∗ r B e : T C Γ0 ∗ r0 .f Γ0 (r0 .f ) = C[F ] F `C:S 0 T 6= link _ T = link f if T = variant-tag, T 0 = T otherwise (T-Return) Γ ∗ r B return e : T 0 C Γ0 {r0 .f 7→ S} ∗ r0 Figure 11: Typing rules for expressions in the internal language (T-Hempty) ` ε : ∅ `h:Γ (T-Hadd) (T-Hide) Γ, o : C[{Null fi }16i6n ] ∗ o B f1 ↔ v1 ; . . .; fn ↔ vn : Null C Γ0 ∗ o ` h, {o = C[{fi = vi }16i6n ]} : Γ0 ` h : Γ, o : C[F ] F `C:S ` h : Γ, o : S (T-State) `h:Γ Γ ∗ r B e : T C Γ0 ∗ r0 Γ B (h ∗ r , e) : T C Γ0 ∗ r0 Figure 12: Typing rules for states T-VarF constructs a variant field typing for the current object. Here E is typically, but not necessarily, a singleton type, and e is typically a literal label. The field typing before applying the rule must be a record as nested variants are not permitted, and the rule transforms it into a variant with identical cases for all labels in E. It can then be extended to a variant with arbitrary other cases using rule T-SubEnv. This rule is used for methods leading to variant session types, which, as Definition 3.12 implies, must finish with a variant field typing. As a simple example, consider the following expression, which could end a method body in some class D: switch (e) {TRUE : f ↔ new C(); OK | FALSE : f ↔ null; ERROR} If S is the declared session type of class C, we have, using rules T-New, T-Swap, T-Label and T-Seq, the following judgements (T is just the initial type of f ): this : D[T f ] ∗ this B f ↔ new C(); OK : {OK} C this : D[S f ] ∗ this and this : D[T f ] ∗ this B f ↔ null; ERROR : {ERROR} C this : D[Null f ] ∗ this. Then T-VarF can be applied to both these judgements, giving both expressions the same type variant-tag, and giving at the same time to this, in the final environment, the variant types D[hOK : {S f }i] and D[hERROR : {Null f }i] respectively. These two types are both subtypes of the combined variant D[hOK : {S f }, ERROR : {Null f }i] and T-SubEnv can thus be applied to both judgements to increase the final type of this to this common supertype. It is then possible to use T-Switch to type the whole expression. Note that the final type of the expression is always variant-tag: as T-VarF is the only rule for constructing variants, this is the only possible return type for a method leading to a variant. T-Sub is a standard subsumption rule, and T-SubEnv allows subsumption in the final environment. The main use of the latter rule, as illustrated above, is to enable the branches of a switch to be given the same final environments. 22 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS 3.5.4. Typing rules for internal expressions, heaps and states. The type system described so far is all we need to type check class declarations and hence programs, which are sequences of class declarations. In order to describe the runtime consequences of well-typedness, we now introduce an extended set of typing rules for expressions that occur only at runtime (Figure 11) and for program states including heaps (Figure 12). When typing an expression e as part of a runtime state, the path r, which was always this when typing programs, varies and indicates the currently active object (the one the method at the top of the call stack belongs to). Any difference between r and r0 means that e contains return; in that case, r and r0 represent the call stack during and after a method call. Recall that return expressions are what a method call reduces to and are introduced by R-Call and suppressed by R-Return. Therefore, these expressions can be nested and can appear, at runtime, in any part of the expression in which reduction can happen. For example they can appear in the argument of a switch or of a function call, but not in the second term of a sequence (which does not reduce until the sequence itself has reduced). In the rules of Figure 10, the difference between r and r0 in some, but not all, of the premises, accounts for that fact. Runtime expressions may contain object identifiers, typed by T-Ref. In this rule, the current object path r must not be within o, meaning that the current object or any object containing it cannot be used within an expression. This is part of the linear control of objects: somewhere there must be a reference to the object at r, in order for a method to have been called on that object, which is what gives rise to the evaluation of an expression whose current object path is r. So obtaining another reference to the object at r, within the active expression, would violate linearity. Another new rule is T-VarS, which constructs a variant session type for a field of the current object. At the top level, the only expression capable of constructing a variant session type is a method call, but once the method call has reduced into something else this rule is necessary for type preservation. The last additional rule for expressions is T-Return, which types a return expression representing an ongoing method call. The subexpression e represents an intermediate state in a method of object r0 .f . If e itself does not contain return, we have r = r0 .f ; otherwise they are different. For example, if we have an expression of the form f.m(), the body of m is f 0 .m0 (), and the body of m0 is e0 (omitting parameters for simplicity), then (h ∗ r0 , f.m()) reduces to (h ∗ r0 .f.f 0 , return (return e0 )) in two steps of R-Call. The typing derivation for this last expression would look like: F 0 ` C0 : S0 Γ ∗ r .f.f B e : T C Γ ∗ r .f.f Γ (r0 .f.f 0 ) = C 0 [F 0 ] F `C:S 0 0 0 0 0 0 0 0 0 0 0 Γ ∗ r .f.f B return e : T C Γ {r .f.f 7→ S } ∗ r .f (Γ {r .f.f 7→ S 0 })(r0 .f ) = C[F ] 0 0 0 0 0 Γ ∗ r .f.f B return (return e ) : T C Γ {r .f 7→ S} ∗ r0 0 0 0 0 0 0 0 As e is an intermediate state in a method of r0 .f , it is typed with final current object and a final environment where the type of r0 .f is of the form C[F ], representing an inside view of the object, where the fields are visible. This T-Return rule then steps out of the object, hides its fields and changes its type into the outside view of a session type, which must be consistent with the internal type (F ` C : S). The particular case where T is variant-tag is the same as in T-Call. T is not allowed to already be of the form link f 0 since it would break encapsulation (f 0 would refer to a field of r0 .f which is not known outside of the object). An important point is that the only expression that changes the current object is return. Several rules besides T-Return can inherit in the conclusion a change of current object r0 .f MODULAR SESSION TYPES FOR OBJECTS 23 from a subexpression in a premise, but they do not add further changes. Thus the final current object path is always a prefix of the initial one, and the number of field specifications removed is equal to the number of returns contained in the expression. Also note that the second part of a sequence and the branches of a switch are not reduction contexts; therefore, they should not contain return and are not allowed by the rules to change the current object. As we saw in Section 3.2, a runtime state consists of a heap, a current object path, and a runtime expression. Figure 12 describes how these parts are related by typing: by rule T-State, a typing judgement for the expression gives one for the state provided the current object is the same and the initial environment reflects the content of the heap; this last constraint is represented by the judgement ` h : Γ. Such a judgement is constructed starting from the axiom T-HEmpty which types an empty heap and adding objects into the heap one by one with rule T-HAdd, converting their types into sessions using T-Hide as needed. As T-HAdd is the only rule that adds to Γ, we have the property that ` h : Γ implies that every identifier in Γ also appears in h. T-HAdd essentially says that adding a new object with given field values to the heap affects the environment in the same way as an expression that starts from an empty object and puts the values into the fields one by one. The most important feature of this rule is that whenever a vi is an object identifier, the typing derivation for the expression has to use T-Ref, which implies both that the initial environment contains vi and that the final one, which represents the type of the extended heap, does not. This means that a type environment corresponding to a heap never contains entries for object identifiers that appear in fields of other objects, and it also implies that a heap with multiple references to the same object is not typable. The numbering of the fields in the rightmost premise is arbitrary, meaning it must not be interpreted as requiring the sequence of swaps to be done in any particular order; all possible orders are valid instances of the premise. This is important if the type of the object being added is to contain links and variants: suppose that field f contains an object o and field g a label l; it must be possible to attribute a variant type to f and the type link f to g, but this can only be done as a result of typing the sequence of swaps if f ↔ o occurs before g ↔ l. 3.6. Example of reduction and typing. We now return to the example from Section 3.3, to illustrate the way in which the environment used to type an expression changes as the expression reduces (see Theorem 3.19 on page 26). To shorten the series of steps in which the current object path does not change, Figure 13 starts from the point at which the initial expression has reduced to g = f.mj (); switch (g) {l : el }l∈E . Recall that this expression is an abbreviation for g ↔ f.mj (); null; switch (g ↔ null) {l : el }l∈E which we simplify to g ↔ f.mj (); switch (g ↔ null) {l : el }l∈E The initial typing environment is top : C[{mi : Si }i∈I f, Null g] 24 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS top : C[{mi : Si }i∈I f, Null g] ∗ top . ↓ top : C[C 0 [F ] f, Null g] ∗ top.f . ↓∗ 0 top : C[C [Fl0 ] f, Null g] ∗ top.f . ↓ top : C[Sl0 f, Null g] ∗ top . ↓ top : C[hl : Sl il∈E f, (link f ) g] ∗ top . ↓ top : C[Sl0 f, Null g] ∗ top . ↓ top : C[Sl0 f, Null g] ∗ top . g ↔ f.mj (); switch (g ↔ null) {l : el }l∈E (R-Call) g ↔ return e; switch (g ↔ null) {l : el }l∈E g ↔ return l0 ; switch (g ↔ null) {l : el }l∈E (R-Return) g ↔ l0 ; switch (g ↔ null) {l : el }l∈E (R-Swap, R-Seq) switch (g ↔ null) {l : el }l∈E (R-Swap) switch (l0 ) {l : el }l∈E (R-Switch) el0 Figure 13: Example of the interplay between method call, switch and link types. The heap and the rightmost typing environment are omitted. with top as the current object, where Sj = hl : Sl il∈E . The body of method mj is e with the typing this : C 0 [F ] ∗ this B e : variant-tag C this : C 0 [hl : Fl il∈E ] ∗ this and we assume that mj returns l0 ∈ E. According to Definition 3.12 and the typing of the declaration of class C 0 we have Fl0 ` C 0 : Sl0 and F ` C 0 : {mi : Si }i∈I . The figure shows the environment in which each expression is typed; the environment changes as reduction proceeds, for several reasons explained below. The typing of an expression is Γ B e : T C Γ0 but we only show Γ because Γ0 does not change and T is not the interesting part of this example. We also omit the heap, showing the typing of expressions instead of states. However, an important point to keep in mind is that Γ corresponds to the typing environment obtained after typing the heap: ` Γ : h is obtained after a number of T-Hadd steps and corresponds to the final typing environment for the heap. Calling f.mj () changes the type of field f to C 0 [F ] because we are now inside the object; the current object path changes from top to top.f . As e reduces to l0 the type of f may change, finally becoming C 0 [Fl0 ] so that it has the component of the variant field typing C 0 [hl : Fl il∈E ] corresponding to l0 . The reduction by R-Return changes the type of f to Sl0 because we are now outside the object again, but the type is still the component of a variant typing corresponding to l0 . At this point f is popped from the current object path. Here the type of l0 is link f (which was the expected result type for f.mj ()), and this type is obtained by applying T-VarS, so in the intermediate typing environment after typing l0 , f has the variant type hl : Sl il∈E . The next step, swap, moves l0 from the expression to the heap. Therefore the application of T-VarS needed to type it now occurs in the derivation for typing the heap, of which Γ is the result. This is why in Γ the type of f is now hl : Sl il∈E , which is Sj , the type we were expecting after the method call. At this point the information about which component of the variant typing we have is stored in top.g, the field the label was swapped into: the type of the expression f.mj () is link f , which appears as the type of top.g after the swap is executed. When extracting the value of g in order to switch on it, the type link f disappears MODULAR SESSION TYPES FOR OBJECTS 25 from the environment and becomes the type of the subexpression g ↔ null, at the same time resolving the variant type of f according to the particular enumerated value l0 . 3.7. Typing the initial state. Recall the discussion of the initial state for execution of a ~ ∗ top , e) program, from the end of Section 3.2. The initial state is (top = C[C.fields = null] where class C has a designated main method m with body e. In order to type this initial state, we require that m is immediately available in C.session, and assume that the program is typable, i.e. that rule T-Class is applicable to every class definition. If C.fields = f~ then −−→ the hypothesis of T-Class is Null f~ ` C : C.session; this is what the type checking algorithm −−→ defined in Section 8 checks. The definition of F ` C : S gives this : C[Null f~], x : Null ∗ this B e : T C this : C[F ] ∗ this for some field typing F . The type T is irrelevant. Lemma 7.10 −−→ (Substitution), to be proved later, gives top : C[Null f~] ∗ top B e : T C top : C[F ] ∗ top, as we assumed that e{null/x } = e. Straightforward use of T-HEmpty and T-HAdd gives −→ ~ : top : C[− ` top = C[C.fields = null] Null f~] and then T-State gives a typing for the initial state. 3.8. Properties of the type system. The main results in this sequential setting are standard: type preservation under reduction (also known as Subject Reduction) and absence of stuck states for well-typed programs. Furthermore, the system also enjoys of a conformance property: all executions of well-typed programs follow what is specified by the classes’ session types. 3.8.1. Soundness of subtyping. In this section we prove that the subtyping relation is sound with respect to the type system, in the sense that it preserves not only typing judgements but also consistency between field typings and session typings, reflecting the safe substitution property. Lemma 3.15. If Γ ∗ r B e : T C Γ0 ∗ r0 and Γ00 <: Γ, then Γ00 ∗ r B e : T C Γ0 ∗ r0 . Proof. Straightforward induction on the derivation. Proposition 3.16 (Soundness of subtyping for fields). If F ` C : S and F 0 <: F then F 0 ` C : S. Proof. Straightforward using Lemma 3.15. Before proving the case where subtyping is on the right, we first remark that, similarly to sub-session, the necessary conditions in the definition of C-consistency (Definition 3.12) become sufficient once we consider the largest relation: Lemma 3.17. Let C be a class and F a field typing for that class. (1) Suppose F is not a variant, and suppose there is a set of method definitions {mi (xi ) {ei }}i∈I in the declaration of class C such that, for all i, we have: this : C[F ], xi : Ti0 ∗ this B ei : Ti C this : C[Fi ] ∗ this with Fi ` C : Si . Then F ` C : {Ti mi (Ti0 ) : Si }i∈I holds. (2) Suppose F = hl : Fl il∈E 0 and let (Sl )l∈E be a family of session types such that E 0 ⊆ E and Fl ` C : Sl for all l ∈ E 0 . Then F ` C : hl : Sl il∈E holds. 26 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Proof. Let S be either {Ti mi (Ti0 ) : Si }i∈I or hl : Sl il∈E depending on the case. Just notice that (• ` C : •) ∪ {(F, S)} is a C-consistency relation. Proposition 3.18 (soundness of subtyping for sessions). If F ` C : S and S <: S 0 then F ` C : S0. Proof. For any class C, we define the following relation: RC = {(F, S 0 ) | ∃S, F ` C : S and S <: S 0 } and prove that it is a C-consistency relation (Definition 3.12). Let (F, S 0 ) ∈ RC , and let S be as given by the definition of the relation. We have two cases depending on the form of S 0 (branch or variant). The first one is S 0 = {Uj0 mj (Tj0 ) : Sj0 }j∈J . Then S <: S 0 means (Definition 3.5) that we have: S = {Ui mi (Ti ) : Si }i∈I with J ⊆ I and for all j ∈ J, Uj mj (Tj ) : Sj is <:-compatible with Uj0 mj (Tj0 ) : Sj0 . Let j ∈ J, we know from F ` C : S that C contains a method declaration mj (x) {e} such that the following judgement: x : Tj , this : C[F ] ∗ this B e : Uj C this : C[Fj ] ∗ this holds, with Fj ` C : Sj . <:-compatibility between the two signatures of mj (Definition 3.4) gives us, first, Tj0 <: Tj , which allows us to apply Lemma 3.15 to this judgement and replace Tj by Tj0 in it, and second, either: (1) Uj <: Uj0 and Sj <: Sj0 . The former allows us to use T-Sub to replace Uj by Uj0 in the typing judgement for e, fulfilling the first condition in the definition of C-consistency. The latter, together with Fj ` C : Sj , implies (Fj , Sj0 ) ∈ RC , fulfilling the second one. (2) Uj is an enumerated type E, Uj0 = variant-tag and hl : Sj il∈E <: Sj0 . In this case we first apply T-VarF to the judgement, yielding: x : Tj0 , this : C[F ] ∗ this B e : variant-tag C this : C[hl : Fj il∈E ] ∗ this. From Fj ` C : Sj we deduce hl : Fj il∈E ` C : hl : Sj il∈E using Lemma 3.17, and conclude (hl : Fj il∈E , Sj0 ) ∈ RC . In the second case, where S 0 = hl : Sl0 il∈E 0 , then S = hl : Sl il∈E with E ⊆ E 0 and ∀l ∈ E, Sl <: Sl0 . From F ` C : S we know that F = hl : Fl il∈E 00 with E 00 ⊆ E and Fl ` C : Sl for any l in E 00 . Just notice that E 00 ⊆ E 0 (by transitivity of ⊆) and (Fl , Sl0 ) ∈ RC for any l in E 00 . 3.8.2. Type preservation. Theorem 3.19 (Subject Reduction). Let D be a set of well-typed declarations, that is, such that for every class declaration D in D we have ` D. If, in a context parameterised by D, we have Γ ∗ r B (h ∗ r , e) : T C Γ0 ∗ r0 , and if (h ∗ r , e) −→ (h0 ∗ r00 , e0 ), then there exists Γ00 such that Γ00 ∗ r00 B (h0 ∗ r00 , e0 ) : T C Γ0 ∗ r0 . Proof. This theorem is a particular case of Theorem 7.16 which will be proved in Section 7. MODULAR SESSION TYPES FOR OBJECTS 27 3.8.3. Type safety. Theorem 3.20 (No Stuck Expressions). Let D be a set of well-typed declarations, that is, such that for every class declaration D in D we have ` D. If, in a context parameterised by D, we have Γ ∗ r B (h ∗ r , e) : T C Γ0 ∗ r0 , then either e is a value or there exists (h0 ∗ r00 , e0 ) such that (h ∗ r , e) −→ (h0 ∗ r00 , e0 ). Proof. This theorem is also a consequence of Theorem 7.16, so we postpone its proof until Section 7. 3.8.4. Conformance. We show that, in well-typed programs, a sequence of method calls (interleaved with their respective return labels) of a given class is a path of its session type. In order to state this property precisely, we introduce a few definitions. Definition 3.21 (Call trace). A call trace is a sequence m1 l1 m2 l2 . . . mn ln in which each mi is a method name and each li may be absent or, if present, is a label. Definition 3.22 (LTS on session types). Define a labelled transition relation on class session types by the following rules. α stands for m or l. j∈I l0 ∈ E mj l {Ti0 mi (Ti ) : Si }i∈I −→ Sj 0 hl : Sl il∈E −→ Sl0 S is not a variant S{µX.S/X } −→ S 0 α α l µX.S −→ S 0 S −→ S Definition 3.23 (Call trace mapping). A call trace mapping for a heap h is a function tr from dom(h) to call traces. Definition 3.24 (Validity of mappings). A call trace mapping tr for a heap h is valid if for tr (o) every entry o = C[. . .] in h, we have C.session −→∗ . An element in a call trace which does not allow the corresponding session type to reduce is a type error. (Thus a call trace is valid if and only if it does not contain type errors). Definition 3.25. If tr is a call trace mapping for a heap h then we define tr (h, r) for references r such that h(r) is defined, as follows: tr (h, o) = tr (o) tr (h, r.f ) = tr (h(r).f ) Definition 3.26 (Original reduction rule). If (h ∗ r , e) −→ (h0 ∗ r0 , e0 ) then the derivation of this reduction consists of a number of applications of R-Context, preceded by another rule which forms a unique leaf node in the derivation. We say that the rule at the leaf node is the original reduction rule for the reduction, or that the reduction originates from this rule. Definition 3.27 (Extension of call traces). Suppose tr is a call trace mapping for h and (h ∗ r , e) −→ (h0 ∗ r0 , e0 ). Define a call trace mapping tr 0 for h0 as follows: • If the reduction originates from R-Call with method m and field f then tr 0 = tr {h(r.f ) 7→ tr (h(r.f ))m}. • If the reduction originates from R-Return with value v, and v is a label l, then tr 0 = tr {h(r) 7→ tr (h(r))l}. 28 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS • If the reduction originates from R-New and the fresh object is o then tr 0 = tr {o 7→ ε}. • Otherwise, tr 0 = tr . The conformance property is the following: in a sequence of reductions starting from the initial state of a well-typed program, the call traces built using the extension mechanism defined above are valid throughout the sequence. We need a couple of lemmas to properly relate call traces and typings in the case of variant types. Lemma 3.28. If ` h : Γ, then Γ does not contain type variant-tag or any variant field typing. Proof. It suffices to show that rule T-VarF cannot be used in the derivation of ` h : Γ, since it is the only rule that introduces variant-tag or variant field typings. This rule can only be used on an expression of enumerated type, and the only place where such an expression can occur in the derivation of ` h : Γ is as the right member of a swap in the second premise of T-Hadd (the swap expression itself has type Null because of the initial environment). It corresponds to the first premise of T-Swap. However, the third premise of T-Swap forbids that the type of the expression be variant-tag, hence T-VarF cannot be used there. Lemma 3.29 (Variant consistency). If ` h : Γ and Γ(r) = hl : Sl il∈E , then: (1) r is of the form r0 .f (2) there exists f 0 such that Γ(r0 .f 0 ) = link f and h(r0 .f 0 ) ∈ E. Proof. Consider how a variant session type can be introduced in the derivation of ` h : Γ. Because of Lemma 3.28, it cannot be a consequence of T-Hide: indeed, F ` C : S where S is a variant can only hold if F is a variant as well. Thus the only possibility is T-VarS, and it can only occur when typing one of the values in the right premise of T-Hadd. (1) follows from the fact that T-VarS acts on a field of the current object. Then T-SubEnv can be applied but the original label T-VarS was applied to is still in the final E. (2) follows from the structure of the derivation: the label T-VarS is applied to is then swapped into a field of the same object. Definition 3.30 (Actual session type). Let Γ and h be such that ` h : Γ. For any r in Γ such that Γ(r) is a session type S, we define S 0 , the actual session type of r in h according to Γ, as follows: • If S is a branch then S 0 = S. • If S is a variant hl : Sl il∈E , then S 0 = Sh(r0 .f 0 ) , where r0 and f 0 are as given by Lemma 3.29. Definition 3.31 (Consistency of call traces). Let tr be a call trace mapping for a heap h and let Γ be a type environment such that ` h : Γ. We say that tr is consistent with Γ if for tr (h,r) every r in Γ with actual session type S we have class(h(r)).session −→∗ S. Theorem 3.32 (Conformance). Suppose we are in a context parameterised by a set of well-typed declarations. Let (h1 ∗ r1 , e1 ) be a program state together with a valid call trace mapping tr 1 , and suppose that (h1 ∗ r1 , e1 ) −→ · · · −→ (hn ∗ rn , en ) is a reduction sequence such that r1 is a prefix of all ri . Definition 3.27 gives a corresponding sequence of call traces tr i . If there exists Γ such that tr 1 is consistent with Γ and Γ ∗ r1 B (h1 ∗ r1 , e1 ) : T C Γ0 ∗ r0 then for all i, tr i is valid. MODULAR SESSION TYPES FOR OBJECTS 29 Proof. Postponed, again, to Section 7 as it makes use of the proof of Theorem 7.16 which will be proved there. Corollary 3.33. Given a well-typed program, starting from the initial state described at the end of Section 3.2 with the initial call trace mapping {top 7→ m}, and given a reduction sequence from there, the call trace mappings obtained by Definition 3.27 following the reductions are valid throughout the sequence. Proof. We just have to see that: (1) the initial call trace mapping is valid, as the main method m is required to appear in the initial session type of the main class; (2) it is also consistent with the initial typing given in Section 3.7, as the initial Γ contains no session type; (3) the initial current object path is reduced to an object identifier and, therefore, stays a prefix of the current object path throughout any reduction sequence. 4. Towards a Full Programming Language In this section, we show how the core calculus presented in the previous section can be extended towards a full programming language. The extensions include constructs which can be considered abbreviations and may be translated into the core calculus without changing it, and actual extensions to the formal system. 4.1. Assignment and Field Access. As explained in the introduction of Section 3, we add to expressions: • the field access expression f (not followed by a dot or by ↔), which translates into the core expression f ↔ null. This expression evaluates to the content of f and has the side effect of setting f to null; • the assignment expression f = e, which translates into the core expression f ↔ e; null. This expression stores the value of e in field f and evaluates to null. 4.2. Multiple Parameters. It is straightforward to generalise the reduction and typing rules so that methods have multiple parameters. In rule T-Call, the environments would be threaded through a series of parameter expressions, in the same way as in rule T-Seq. 4.3. Local Variables. Local variables can be simulated by introducing extra parameters. 4.4. While Loops. The language can easily be extended to include while loops, by adding the rules in Figure 14. The reduction rule defines while recursively in terms of switch. There are two typing rules, derived from T-Switch and T-SwitchLink. The first deals with a straightforward while loop that has no interaction with session types, and the second deals with the more interesting case in which the condition of the loop is linked to the session type of an object. 30 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Top-level syntax (add to Figure 5): e ::= . . . | while (e) {e} Reduction rule (add to Figure 7): (R-While) (h ∗ r , while (e) {e0 }) −→ (h ∗ r , switch (e) {True : e0 ; while (e) {e0 }, False : null}) Top-level typing rules (add to Figure 10): Γ ∗ r B e : {True, False} C Γ0 ∗ r0 Γ0 ∗ r0 B e0 : Null C Γ ∗ r (T-While) 0 Γ ∗ r B while (e) {e } : Null C Γ0 ∗ r0 Γ ∗ r B e : link f C Γ0 ∗ r0 Γ0 (r0 .f ) = hTrue : STrue , False : SFalse i 0 0 Γ {r .f 7→ STrue } ∗ r0 B e0 : Null C Γ ∗ r (T-WhileLink) Γ ∗ r B while (e) {e0 } : Null C Γ0 {r0 .f 7→ SFalse } ∗ r0 Figure 14: Rules for while Top-level syntax (add to Figure 5) : M ::= . . . | req F ens F for T m(T x) {e} e ::= . . . | m(e) (T-SelfCall) Reduction rule (add to Figure 7): req _ ens _ for _ m(_ x) {e} ∈ h(r).class (R-SelfCall) (h ∗ r , m(v)) −→ (h ∗ r , e{v/x }) Top-level typing rules (add or replace in Figure 10): Γ ∗ r BC e : T C Γ0 ∗ r0 Γ0 (r0 ) = C[F ] req F ens F 0 for T 0 m(T x) {e0 } ∈ C (T-AnnotMeth) Γ ∗ r BC m(e) : T 0 C Γ0 {r0 7→ C[F 0 ]} ∗ r0 this : C[F ], x : T 0 ∗ this BC e : T C this : C[F 0 ], x : T 00 ∗ this 0 −−→ ~ Null f ` C : S (T-Class) F 0 6= h_i 0 `C req F ens F for T m(T x) {e} ~ . (M has req/ens ⇒ `C M ) ∀M ∈ M ~} ` class C {S; f~; M Figure 15: Rules for recursive methods and other self-calls 4.5. Self-Calls and Recursive Methods. The rules in Figure 15 extend the language to include self-calls (method calls on this). This extension also supports recursive calls, which are necessarily self-calls. Self-calls do not check or advance the session type, and a method that is only self-called does not appear in the session type. A method that is self-called and called from outside appears in the session type, and calls from outside do check and advance the session type. The reason why it is safe to not check the session type for self-calls is that the effect of the self-call on the field typing is included in the effect of the method that calls it. All of the necessary checking of session types is done because of the original outside call that eventually leads to the self-call. Because they are not in the session type, self-called methods must be explicitly annotated with their initial (req) and final (ens) field typings. The annotations are used to type self-calls (T-SelfCall) and method definitions (T-AnnotMeth). The result type and parameter type are also specified as part of the method definition, again because the method is not in the session type. If a method is in the session type then its body is checked by the first hypothesis of T-Class, but the annotations (if present) are ignored except when they are needed to check recursive calls. If a method has an annotation then its body is checked by the second MODULAR SESSION TYPES FOR OBJECTS 31 hypothesis of T-Class. If both conditions apply then the body is checked twice. An implementation could optimize this. An annotated method cannot produce a variant field typing or have a link type, because T-SwitchLink can only analyze a variant session type, not a variant field typing. 4.6. Shared Types and Base Types. The formal language described in this paper has a very strict linear type system. It is straightforward to add non-linear classes as an orthogonal extension: they would not have session types and their instances would be shared objects, treated in a completely standard way. Including them in the formalisation, however, would only complicate the typing rules. More interesting, and more challenging, is the possibility of introducing a more refined approach to aliasing and ownership, for example along the lines of the systems discussed in Section 9. We intend to investigate this in the future. Base types such as int are also straightforward to add, and would be treated non-linearly. 4.7. Inheritance. The formal language uses a structural type system in which class names are only used in order to obtain their session types; method availability is determined solely by the session type, and method signatures are also in the session type. In particular, the subtyping relation is purely structural and makes no reference to class names. It is straightforward to adapt the language to include features associated with nominal subtyping, such as an explicitly declared inheritance hierarchy for classes with inheritance and overriding of method definitions. In this case, if class C is declared to inherit from class D, and both define session types (alternatively, C might inherit its session type from D), then the condition C.session <: D.session would be required in order for the definition of C to be accepted. 5. A Distributed Example We now present an example of a distributed system, illustrating the way in which our language unifies session-typed channels and more general typestate. Recall that our programming model is based on communication over TCP/IP-style socket connections, which we refer to as channels. The scenario is a file server, which clients can communicate with via a channel. The file server uses a local file, represented by a File object as defined in Section 2, and responds to requests such as OPEN and HASNEXT on the channel. On the client side, the remote file is represented by an object of class RemoteFile, whose interface is similar to File . In this “stub” object, methods such as open are implemented by communicating with the file server. The channel between the client and the server has a session type in the standard sense [70], which defines a communication protocol. In our language, each endpoint of the channel is represented by an object of class Chan, with a class session type derived from the channel session type. This class session type also expresses the definition of the communication protocol, by specifying when the methods send and receive are available. For the purpose of this example, we imagine that the communication protocol (channel session type) is defined by the provider of the file server, while the class session type of RemoteFile is defined by the implementor of a file system API. We therefore present two versions of the example: one in which the channel session type, and the class session type of RemoteFile, have the same structure; and one in which they have different structures. 32 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS FileReadCh = &{OPEN: ? S t r i n g .⊕{OK: OpenCh , ERROR: FileReadCh } , QUIT : End } OpenCh = &{HASNEXT: ⊕{TRUE: CanReadCh , FALSE : MustCloseCh } , CLOSE: FileReadCh } MustCloseCh = &{CLOSE: FileReadCh } CanReadCh = &{READ: ! S t r i n g . OpenCh , CLOSE: FileReadCh } 1 2 3 4 Figure 16: Remote file server version 1: channel session type (server side) F i l e R e a d _ c l = { N u l l send ( {OPEN } ) : { N u l l send ( S t r i n g ) : { { OK, ERROR} receive ( ) : hOK: Open_cl , ERROR: F i l e R e a d _ c l i } } , N u l l send ( { QUIT } ) : { } } where Open_cl = { N u l l send ( { HASNEXT } ) : { { TRUE, FALSE } receive ( ) : hTRUE: CanRead_cl , FALSE : MustClose_cl i } , N u l l send ( { CLOSE } ) : F i l e R e a d _ c l } MustClose_cl = { N u l l send ( { CLOSE } ) : F i l e R e a d _ c l } CanRead_cl = { N u l l send ( { READ } ) : { S t r i n g receive ( ) : Open_cl } , N u l l send ( { CLOSE } ) : F i l e R e a d _ c l } 1 2 3 4 5 6 7 8 9 10 11 FileRead_s = { { OPEN, QUIT } receive ( ) : hOPEN: { S t r i n g receive ( ) : { N u l l send ( {OK } ) : Open_s , N u l l send ( {ERROR } ) : FileRead_s } , QUIT : { } i } where Open_s = { { HASNEXT, CLOSE} receive ( ) : hHASNEXT: { N u l l send ( { TRUE } ) : CanRead_s , N u l l send ( { FALSE } ) : MustClose_s } , CLOSE: FileRead_s i } MustClose_s = { { CLOSE} receive ( ) : hCLOSE: FileRead_s i } CanRead_s = { { READ, CLOSE} receive ( ) : hREAD: { N u l l send ( S t r i n g ) : Open_s } , CLOSE: FileRead_s i } 1 2 3 4 5 6 7 8 9 10 11 12 Figure 17: Remote file server version 1: client and server class session types generated from channel session type FileReadCh 5.1. Distributed Example Version 1. Figure 16 defines a channel session type for interaction between a file server and a client. The type of the server’s endpoint is shown, and the type FileReadCh is the starting point of the protocol. The type constructor & means that the server offers a choice, in this case between OPEN and QUIT; the client makes a choice by sending one of these labels. If OPEN is selected, the server receives (constructor ?) a String and then (the . constructor means sequencing) the constructor ⊕ indicates that the server can choose either OK or ERROR by sending the appropriate label. The remaining definitions are read in the same way; End means termination of the protocol. The type of the client’s endpoint is dual, meaning that receive (?) and send ( ! ) are exchanged, as are offer (&) and select (⊕). When the server offers a choice, the client must make a choice, and vice versa. The structure of the channel session type is similar to that of the class session type of File from Section 2, in the sense that HASNEXT is used to discover whether or not data can be read. We regard each endpoint of a channel as an object with send and receive methods. For every channel session type there is a corresponding class session type that specifies MODULAR SESSION TYPES FOR OBJECTS class RemoteFile { session { connect : I n i t } where I n i t = { open : hOK: Open , ERROR: I n i t i } Open = { hasNext : hTRUE: Read , FALSE : Close i , c l o s e : I n i t } Read = { read : Open , c l o s e : I n i t } Close = { c l o s e : I n i t } channel ; N u l l connect ( h FileReadCh i s e r v e r ) { channel = s e r v e r . request ( ) ; } {OK,ERROR} open ( S t r i n g name ) { channel . send (OPEN ) ; channel . send ( name ) ; switch ( channel . receive ( ) ) { OK: OK; ERROR: ERROR; } } {TRUE, FALSE } hasNext ( ) { channel . send (HAS_NEXT ) ; switch ( channel . receive ( ) ) { TRUE: TRUE; FALSE : FALSE ; } } S t r i n g read ( ) { channel . send (READ ) ; channel . receive ( ) ; } Null close ( ) { channel . send (CLOSE ) ; } } 33 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Figure 18: Remote file server version 1: client side stub the availability and signatures of send and receive. The general translation is defined in Section 6, Figure 26. For the particular case of FileReadCh, the client and server class session types are as defined in Figure 17: FileRead_cl for the client and FileRead_s for the server. The requirement to make a choice (⊕) in the channel session type corresponds to availability of send with a range of signatures, each with a parameter type representing one of the possible labels; here we are taking advantage of overloading, disambiguated by parameter type. The requirement to offer a choice (&) in the channel session type corresponds to availability of receive, with the subsequent session depending on the label that is received. Sending ( ! ) and receiving (?) data in the channel session type correspond straightforwardly to send and receive with appropriate signatures. Figure 18 defines the class RemoteFile, which acts as a local proxy for a remote file server. Its interface is similar to that of the class File from Section 2; the only difference is that RemoteFile has an additional method connect, which must be called in order to 34 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS class F i l e S e r v e r { session { N u l l main ( h FileReadCh i p o r t ) : { } } channel ; f i l e ; N u l l main ( h FileRead_c i p o r t ) { f i l e = new F i l e ( ) ; channel = p o r t . accept ( ) ; fileRead ( ) ; } req FileRead_s channel , I n i t f i l e ens { } channel , I n i t f i l e Null fileRead ( ) { switch ( channel . receive ( ) ) { OPEN: switch ( f i l e . open ( channel . receive ( ) ) ) { OK: open ( ) ; ERROR: f i l e R e a d ( ) ; } QUIT : n u l l ; } } req Open_s channel , Open f i l e ens { } channel , I n i t f i l e N u l l open ( ) { switch ( channel . receive ( ) ) { HASNEXT: switch ( f i l e . hasNext ( ) ) { TRUE: channel . send (TRUE ) ; canRead ( ) ; FALSE : channel . send ( FALSE ) ; mustClose ( ) ; } CLOSE: f i l e . c l o s e ( ) ; f i l e R e a d ( ) ; } req MustClose_s channel , Close f i l e ens { } channel , I n i t f i l e N u l l mustClose ( ) { switch ( channel . receive ( ) ) { CLOSE: f i l e . c l o s e ( ) ; f i l e R e a d ( ) ; } } req CanRead_s channel , Read f i l e ens { } channel , I n i t f i l e N u l l canRead ( ) { switch ( channel . receive ( ) ) { READ: channel . send ( f i l e . read ( ) ) ; open ( ) ; CLOSE: f i l e . c l o s e ( ) ; f i l e R e a d ( ) ; } } } Figure 19: Remote file server version 1: server code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 MODULAR SESSION TYPES FOR OBJECTS F i l e C h a n n e l = &{OPEN: ? S t r i n g .⊕{OK: CanRead , ERROR: F i l e C h a n n e l } , QUIT : End } CanRead = &{READ: ⊕{EOF: FileChannel , DATA : ! S t r i n g . CanRead } , CLOSE: F i l e C h a n n e l } 35 1 2 Figure 20: Remote file server version 2: channel session type (server side) C l i e n t C h = { N u l l send ( {OPEN } ) : { N u l l send ( S t r i n g ) : { { OK, ERROR} receive ( ) : hOK: CanRead_cl , ERROR: C l i e n t C h i } } , N u l l send ( { QUIT } ) : { } } where CanRead_cl = { N u l l send ( { READ } ) : { { EOF, DATA} receive ( ) : hEOF: ClientCh , DATA : { S t r i n g receive ( ) : CanRead_cl } i } , N u l l send ( { CLOSE } ) : C l i e n t C h } 1 2 3 4 5 6 7 8 ServerCh = { { OPEN, QUIT } receive ( ) : hOPEN: { S t r i n g receive ( ) : { N u l l send ( {OK } ) : CanRead_cl , N u l l send ( {ERROR } ) : ServerCh } } , QUIT : { } i } where CanRead_cl = { { READ, CLOSE} receive ( ) : hREAD: { N u l l send ( { EOF } ) : ServerCh , N u l l send ( { DATA ) } : { N u l l send ( S t r i n g ) : CanRead_cl } } , CLOSE: ServerCh i } 1 2 3 4 5 6 7 8 Figure 21: Remote file server version 2: client and server class session types generated from channel session type FileChannel establish a connection to the file server. The types RemoteFile.Init and File . Init are equivalent (Definition 3.9): each is a subtype of the other, and they can be used interchangeably. The methods of RemoteFile are implemented by communicating over a channel to a file server. The connect method has a parameter of type hFileReadChi. A value of this type represents an access point, analogous to a URL, on which a connection can be requested by calling the request method (line 11); the resulting channel endpoint has type FileRead_cl. The remaining methods communicate on the channel, and thus advance the type of the field channel. The similarity of structure between the channel session type FileReadCh and the class session type Init is reflected in the simple definitions of the methods, which just copy information between their parameters and results and the channel. There is one point of interest in relation to the close method. It occurs three times in the class session type, and according to our type system, its body is type checked once for each occurrence. Each time, the initial type environment in which the body is checked has a different type for the channel field: Open_cl, MustClose_cl or CanRead_cl. Type checking is successful because all of these types allow send({CLOSE}). Figure 19 defines the class FileServer, which accesses a local file system and uses the server endpoint of a channel of type FileReadCh. The session type of this class contains the single method main, with a parameter of type hFileReadChi. We imagine this main method to be the top-level entry point of a stand-alone application, with the parameter value (the access point or URL for the server) being provided when the application is launched. The server uses accept to listen for connection requests, and when a connection is made, it obtains a channel endpoint of type FileRead_s. 36 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS class RemoteFile { session { connect : I n i t } where I n i t = { open : hOK: Open , ERROR: I n i t i } Open = { hasNext : hTRUE: Read , FALSE : Close i , c l o s e : I n i t } Read = { read : Open , c l o s e : I n i t } Close = { c l o s e : I n i t } channel ; s t a t e ; N u l l connect ( h F i l e C h a n n e l i c ) { channel = c . request ( ) ; } {OK,ERROR} open ( S t r i n g name ) { channel . send (OPEN ) ; channel . send ( name ) ; switch ( channel . receive ( ) ) { OK: s t a t e = READ; OK; ERROR: ERROR; } } {TRUE, FALSE } hasNext ( ) { channel . send (READ ) ; switch ( channel . receive ( ) ) { EOF: s t a t e = EOF; FALSE ; DATA : s t a t e = DATA ; TRUE; } } S t r i n g read ( ) { s t a t e = READ; channel . receive ( ) ; } Null close ( ) { switch ( s t a t e ) { EOF: n u l l ; READ: channel . send (CLOSE ) ; DATA : channel . receive ( ) ; channel . send (CLOSE ) ; } } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 Figure 22: Remote file server version 2: client side stub The remaining methods of FileServer are mutually recursive in a pattern that matches the structure of FileRead_s. The methods are self-called, and do not appear in the class session type; instead, they are annotated with pre- and post-conditions on the types of the fields channel and file . The direct correspondence between the structure of the channel session type and the class session type of File is again reflected in the code, for example on lines 29 and 30 where the result of calling hasNext on file directly answers the HASNEXT query on channel. Most systems of session types support delegation, which is the ability to send a channel as a message on another channel. It is indicated by the occurrence of a session type as the type of the message in a send ( ! ) or receive (?) constructor. In our language, delegation is realised MODULAR SESSION TYPES FOR OBJECTS class F i l e S e r v e r { session { main : { } } channel ; f i l e ; N u l l main ( h F i l e C h a n n e l i c ) { f i l e = new F i l e ( ) ; channel = c . accept ( ) ; serverCh ( ) ; } req ServerCh channel , I n i t f i l e ens { } channel , I n i t f i l e N u l l serverCh ( ) { switch ( channel . receive ( ) ) { OPEN: switch ( f i l e . open ( channel . receive ( ) ) ) { OK: canRead ( ) ; ERROR: serverCh ( ) ; } QUIT : n u l l ; } } req CanRead_s channel , Open f i l e ens { } channel , I n i t f i l e N u l l canRead ( ) { switch ( channel . receive ( ) ) { READ: switch ( f i l e . hasNext ( ) ) { TRUE: channel . send (DATA ) ; channel . send ( f i l e . read ( ) ) ; canRead ( ) ; FALSE : channel . send (EOF ) ; f i l e . c l o s e ( ) ; serverCh ( ) ; } CLOSE: f i l e . c l o s e ( ) ; serverCh ( ) ; } } 37 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Figure 23: Remote file server version 2: server code by sending an object representing a channel endpoint; it corresponds to a send method with a parameter of type, for example, Chan[FileRead_cl]. Transfer of channel endpoints from one process to another is supported by the operational semantics in Section 6. 5.2. Distributed Example Version 2. This version has a different channel session type, FileChannel, defined in Figure 20, which does not match the class session type FileRead. The difference is that there is no HASNEXT option; instead, the READ option is always available. If there is no more data then EOF is returned in response to READ; alternatively, DATA is returned, followed by the desired data. The corresponding class session types for the client and server endpoints are defined in Figure 21. The implementation of RemoteFile must now mediate between the different structures of the class session type FileRead and the channel session type FileChannel. The new definition is in Figure 22. The main point is that the definition of the close method must depend on the state of the channel. For example, if close is called immediately after a call of hasNext 38 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS that returns TRUE, then the channel session type requires data to be read before CLOSE can be sent. We therefore introduce the field state , which stores a value of the enumerated type {EOF, READ, DATA}. This field represents the state of the channel (equivalently, the session type of the channel field): EOF corresponds to ClientCh, READ corresponds to CanRead, and DATA corresponds to the point after the DATA label in CanRead. The definition of close contains a switch on state , with appropriate behaviour for each possible value. It is also possible for state to be null, but this only occurs before open has been called, and at this point close is not available. In order to type check this example we take advantage of the fact that the body of the close method is repeatedly checked, according to its occurrence in the class session type. The value of state always corresponds to the state of channel. This correspondence is not represented in the type system — that would require some form of dependent type — but whenever the body of close is type checked, the type of channel is compatible with the value of state , and so typechecking succeeds. More precisely, each possible value of state corresponds to a different singleton type for state (typing rule T-Label), and rule T-Switch only checks the branches that correspond to possible values in the enumerated type of the condition. So each time the body of close is type checked, only one branch (because the type of state is a singleton) of the switch is checked, corresponding to the value of state for that occurrence of close. 6. A Core Distributed Language We now define the core of the distributed language illustrated in Section 5. For simplicity, communication is synchronous. Formalising asynchronous communication is well-understood (for example, Gay and Vasconcelos [39] define a functional language with similar communication primitives but adds the complication of message buffers to the operational semantics). Our integration of channel session types and the typestate system of this paper is based on binary session types [70] (actually, we adopt the now standard constructs of session types). It should be straightforward to adapt the technique to multi-party session types [42], because that system also depends on specifying the sequence of send and receive operations on each channel endpoint. The only additions to the top-level language are access points and their types hT i, channel session types and their translation to class session types, and the spawn primitive. However, there are significant changes to the internal language, in order to introduce a layer of concurrently executing components that communicate on channels. 6.1. Syntax. Figure 24 defines the new syntax. The types of access points are top-level declarations. Of the new values, access points n can appear in top-level programs, but channel endpoints, c+ and c− , are part of the internal language. If an access point n is declared with access hΣi n then we define n.protocol to mean Σ. The spawn primitive was not used in the example in Section 5, but its behaviour is to start a new thread executing the specified method on a new instance of the specified class (just like it happens in Java; other works, e.g. [27], use similar approaches). Although a parameter is required as in any method call, for simplicity the type system restricts the parameter’s type to be Null in this case, so that there is only one form of inter-thread communication. The syntax of channel session types Σ is included so that the types of access points can be declared. Channels are created by the interaction of methods request and accept in different threads, one thread MODULAR SESSION TYPES FOR OBJECTS Declarations D ::= . . . | access hΣi n Values v ::= . . . | c+ | c− | n Expressions Contexts Channel session types States 39 e ::= . . . | spawn C.m(e) E ::= . . . | spawn C.m(E) Σ ::= end | X | µX.Σ | ? [T ] . Σ | ! [T ] . Σ | & {l : Σl }l∈E | ⊕ {l : Σl }l∈E s ::= . . . | s || s | (νc) s Figure 24: Additional syntax for channels and states keeps the c− endpoint whereas the other keeps c+ . The two threads then communicate on channel c by reading and writing on their channel ends. The syntax of states is extended to include parallel composition and a channel binder νc, which binds both endpoints c+ and c− in the style of Gay and Vasconcelos [39]. In a parallel composition, the states are exactly states from the semantics of the sequential language; in particular, each one has its own heap. This means that spawn generates a new heap as well as a new executing method body. Communication between parallel expressions is only via channels. The syntax extensions do not include request, accept, send and receive, as they are treated as method names. 6.2. Semantics. Figure 25 defines the reduction rules for the distributed language, as well as the top-level typing rules. The reduction rules make use of a pi-calculus style structural congruence relation, again following Gay and Vasconcelos [39]. It is the smallest congruence (with respect to parallel and binding) that is also closed under the given rules. Rule R-Init defines interaction between accept and request, which creates a fresh channel c and substitutes one endpoint into each expression. There are two rules for communication, involving interaction between send and receive. Rule R-ComBase is for communication of non-objects and rule R-ComObj is for communication of objects. Let O be the set of all object identifiers. R-ComBase expresses a straightforward transfer of a value, while R-ComObj also transfers part of the heap corresponding to the contents of a transferred object. In R-ComObj, ϕ is an arbitrary renaming function which associates to every identifier in dom(h) an identifier not in dom(h0 ). This rule can easily be made deterministic in practice by using a total ordering on identifiers and a mechanism to generate fresh ones. R-Spawn creates a new parallel state whose heap contains a single instance of the specified class. As discussed above, communication between threads is only through channels in order to keep the formal system a reasonable size; therefore, no data is transmitted to the new thread and the body of the method being spawned always has its parameter replaced by the literal null. The type system will ensure that v = null, so that this semantics makes sense. The remaining rules are standard. Returning to R-ComObj, there is some additional notation associated with identifying the part of the heap that must be transferred; we now define it. Definition 6.1. Let h be a heap. For any entry o = C[{fi = vi }i∈I ] in h, we define the children of o in h to be the set of all vi which are object identifiers: childrenh (o) = {vi | i ∈ I} ∩ O. 40 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Structural congruence: s1 k s2 ≡ s2 k s1 s1 k (s2 k s3 ) ≡ (s1 k s2 ) k s3 (E-Comm,E-Assoc) s1 k (νc)s2 ≡ (νc)(s1 k s2 ) if c+ , c− not free in s1 (E-Scope) Reduction rules: h0 (r0 ).f 0 = n h(r).f = n (R-Init) 0 0 0  (h ∗ r , E[f.accept()]) || (h ∗ r , E [f .request()]) −→ (νc) (h ∗ r , E[c+ ]) || (h0 ∗ r0 , E 0 [c− ]) h0 (r0 ).f 0 = cp h(r).f = cp (R-ComBase) 0 h(r).f = cp 0 0 h0 (r0 ).f 0 = cp ϕ ∈ Inj(dom(h ↓ o), O \ dom(h0 )) (h ∗ r , E[f.send(o)]) || (h0 ∗ r0 , E 0 [f 0 .receive()]) −→ (h ↑ o ∗ r , E[null]) || (h0 + ϕ(h ↓ o) ∗ r0 , E 0 [ϕ(o)]) C.fields = f~ m(x) {e} ∈ C ~ ∗ o , e{null/x }) (h ∗ r , E[spawn C.m(v)]) −→ (h ∗ r , E[null]) || (o = C[f~ = null] o fresh (R-Spawn) 0 v 6∈ O (h ∗ r , E[f.send(v)]) || (h ∗ r , E [f .receive()]) −→ (h ∗ r , E[null]) || (h0 ∗ r0 , E 0 [v]) (R-ComObj) (R-Par) c fresh 0 0 (R-Str) s ≡ s s0 −→ s00 s00 ≡ s000 s −→ s000 Top-level typing rules: s −→ s0 s || s −→ s0 || s00 00 (T-Spawn) Γ ∗ r B e : Null C Γ0 ∗ r0 (R-NewChan) s −→ s0 (νc) s −→ (νc) s0 C.session = {_ m(Null) : _; . . .} Γ ∗ r B spawn C.m(e) : Null C Γ0 ∗ r0 (T-Name) access hΣi n Γ ∗ r B n : JhΣiK C Γ ∗ r Figure 25: Reduction and top-level typing rules for concurrency and channels We say that an object identifier o in dom(h) is a root in h if there is no o0 in dom(h) such that o ∈ childrenh (o0 ). We note roots(h) the set of roots in h. We say that h is complete if for any o in dom(h) we have childrenh (o) ⊆ dom(h). If h is complete, we define the descendants of o in h to be the smallest set containing o 0 and the childrenSof any object it contains. Formally, h (o) = {o} and for i > 1, S let children i i childrenh (o) = childrenh (ω). Then desch (o) = childrenh (o). ω∈childreni−1 h (o) i∈N Definition 6.2 (Heap separation). Let h be a complete heap and o a root of h. We define h ↓ o to be the sub-heap obtained by restricting h to the descendants of o, and h ↑ o to be the sub-heap obtained by removing from h the descendants of o. Note that h ↓ o is complete and has the property that o is its only root. Definition 6.3 (Additional notation). • Let h be a heap and let ϕ be a function from O to O. We denote by ϕ(h) the result of applying ϕ to all object identifiers in h, including inside object records. • We denote by Inj(A, B) the set of injective functions from A to B. • We denote by + the disjoint union of heaps or environments, i.e. the operation h + h0 is defined by merging h and h0 if their domains are disjoint and undefined otherwise. MODULAR SESSION TYPES FOR OBJECTS 41 Given a channel session type Σ, define a class session type JΣK as follows. JendK = {} JXK = X JµX.ΣK = µX.JΣK J? [T ] . ΣK = {T receive(Null) : JΣK} J ! [T ] . ΣK = {Null send(T ) : JΣK} J& {l : Σl }l∈E K = {variant-tag receive(Null) : hl : JΣl Kil∈E } J⊕ {l : Σl }l∈E K = {Null send({l}) : JΣl K}l∈E In the type system, a channel endpoint with session type Σ is treated as an object with type JΣK. Calls of send and receive are typed as standard method calls. Given an access type hΣi, define a class session type JhΣiK by JhΣiK = µX.{JΣK request(Null) : X, JΣK accept(Null) : X}. In the type system, an access point with type hΣi is treated as an object with type JhΣiK. Calls of request and accept are typed as standard method calls. Figure 26: Object types for channels and access points These rules add to or replace the rules in Figure 12. (T-Chan) Γ, cp : T ∗ r B cp : T C Γ ∗ r (T-Hempty) Θ ` ε : JΘK Θ`h:Γ (T-Hadd) (T-Hide) Γ, o : C[{Null fi }16i6n ] ∗ o B f1 ↔ v1 ; . . .; fn ↔ vn : Null C Γ0 ∗ o Θ ` h, {o = C[{fi = vi }16i6n ]} : Γ0 Θ ` h : Γ, o : C[F ] F `C:S Θ ` h : Γ, o : C[S] (T-Thread) (T-State) Θ; Γ B (h ∗ r , e) : T C Γ0 ∗ r0 Θ ` (h ∗ r , e) (T-NewChan) Θ`h:Γ Γ ∗ r B e : T C Γ0 ∗ r0 Θ; Γ B (h ∗ r , e) : T C Γ0 ∗ r0 0 0 (T-Par) Θ ` s 0 Θ ` 0s Θ + Θ ` s || s Θ, c+ : Σ, c− : Σ ` s Θ ` (νc) s Figure 27: Internal typing rules for the distributed language 6.3. Type System. The type system treats send, receive, request and accept as method calls on objects whose session types are defined by the translations in Figure 26. A channel endpoint with (channel) session type Σ is treated as an object with (class) session type JΣK. The type constructor & (offer) is translated into a receive method with return type variant-tag in order to capture the relationship between the received label and the subsequent type. The type constructor ⊕ (select) is translated into a collection of send methods with different parameter types, each being a singleton type for the corresponding label. In a similar but much simpler way, an access type hΣi is translated into a (class) session type that allows both request and accept to be called repeatedly and at any time. These two methods need to return dual channel endpoints, which requires the following definition. Definition 6.4 (Dual channel type). The dual type Σ of a channel session type Σ is defined by Σ = dual (Σ, ι) 42 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS 0 where ι is the identity substitution, σ{Σ /X } denotes the extension of substitution σ by the mapping X 7→ Σ0 , and Σσ denotes the application of the substitution σ to the session type Σ; the auxiliary function dual (Σ, σ) is defined on session types Σ and substitutions σ by: dual (end, σ) = end dual (X, σ) = X dual (µX.Σ, σ) = µX.dual (Σ, σ{Σσ/X }) dual ( ! [T ] . Σ, σ) = ? [T σ] . dual (Σ, σ) dual (? [T ] . Σ, σ) = ! [T σ] . dual (Σ, σ) dual (⊕ {l : Σl }l∈E , σ) = & {l : dual (Σl , σ)}l∈E dual (& {l : Σl }l∈E , σ) = ⊕ {l : dual (Σl , σ)}l∈E With this definition, duality commutes with unfolding [6]; this property is essential in order to use the equi-recursive convention (Definition 3.9). By convention, request returns a channel endpoint of type JΣK and accept returns an endpoint of type JΣK. Because access points n are global constants, they can be used repeatedly even though their session types are linear; there is no restriction to a single occurrence of a given name. The only new typing rules for the top-level language are in Figure 25. T-Spawn allows a method to be used in a spawn expression if it is available in the initial session type of the specified class. T-Name obtains the type of an access point from its declaration, and assigns an object type according to the translation described above. Figure 27 contains typing rules for the internal language with the concurrency extensions. Rules with the same names as rules in Figure 12 are replacements. Rule T-Chan takes the type of a channel endpoint from the typing environment. The remaining rules involve a new typing environment Θ, which maps channel endpoints to channel session types Σ; these are indeed channel session types, not their translations into class session types. T-HAdd, T-Hide and T-State are just the corresponding rules from Figure 12 with Θ added. In T-HEmpty the notation JΘK means that the translation from channel session types to class session types is applied to the type of each channel endpoint. In combination with T-State, this means that the typing of expressions uses class session types for channel endpoints; the T in T-Chan is a class session type. T-Thread lifts a typed state to a typed concurrent component, preserving only the channel typing Θ, which is used in T-Par and T-NewChan. In T-Par, Θ + Θ0 means union, with the assumption that Θ and Θ0 have disjoint domains. T-NewChan requires the complementary endpoints of each channel to have dual session types. 6.4. Subtyping. We have two subtyping relations between channel session types: Σ <: Σ0 as defined by Gay and Hole [37], and JΣK <: JΣ0 K as defined in this paper. To avoid a detour into the definition of Σ <: Σ0 , we state the following result without proof. Proposition 6.5. Σ <: Σ0 ⇒ JΣK <: JΣ0 K. Interestingly, the converse is not true, as subtyping between translations of channel session types is a larger relation. For example: MODULAR SESSION TYPES FOR OBJECTS 43 • for all Σ, JΣK <: JendK • if E is an enumeration then J? [E] . ΣK <: J& {l : Σ}l∈E K • J⊕ {l : Σ}K = J ! [{l}] . ΣK and therefore by transitivity any translated ⊕ type is a subtype of all the corresponding individual translated send types. This suggests the possibility, in the context of the work of Gay and Hole [37], of generalizing the subtyping relation between channel session types by considering branch/select labels as values in an enumerated type. We do not explore this idea further in the present paper. 7. results The key results concerning the distributed language supporting self-calls are, again, SubjectReduction, Type Safety, and Conformance. Notice that we can no longer guarantee the absence of stuck states for all well-typed programs, as one endpoint of a channel may try to send when the other endpoint is not available to receive. 7.1. Properties of typing derivations. This subsection is mostly a collection of lemmas which will be used to prove the main theorems in the following subsections. They draw various useful consequences from the fact that a program state is well-typed. Their proofs can be found in Appendix 10. We define chans(h) as the set of channel endpoints appearing in object records in h. We define chans(Γ) and objs(Γ) as the sets of, respectively, channel endpoints and object identifiers in dom(Γ). We have dom(Γ) = chans(Γ) ∪ objs(Γ). Lemma 7.1. Suppose Θ ` h : Γ. Then (a) h is complete, (b) chans(Γ) ⊆ dom(Θ) \ chans(h) and (c) objs(Γ) ⊆ roots(h). Lemma 7.2 (Rearrangement of typing derivations for expressions). Suppose we have Γ ∗ r B e : T C Γ0 ∗ r0 . Then there exists a typing derivation for this judgement in which: (1) T-Sub only occurs at the very end, just before T-Switch or T-SwitchLink as the last rule in the derivation for each of the branches, or just before T-Call as the last rule in the derivation for the parameter; (2) T-SubEnv only occurs immediately before T-Sub in the first three cases and does not occur at all in the fourth, i.e. T-Call. Lemma 7.3 (Rearrangement of typing derivations for heaps). Suppose Θ ` h : Γ holds. Let o be an arbitrary root of h. Then there exists a typing derivation for it such that: (1) T-Sub is never used; (2) T-SubEnv is used at most once, as the last rule leading to the right premise of the last occurrence of T-Hadd; (3) every occurrence of T-Hide follows immediately the occurrence of T-Hadd concerning the same object identifier; (4) the occurrence of T-Hadd concerning an identifier o0 is always immediately preceded (on the left premise) by the occurrences of T-Hadd/T-Hide concerning the descendants of o0 ; (5) the first root added is o. Lemma 7.4 (Splitting of the heap). Suppose Θ ` h : Γ, o : T . Let Θ1 = Θ \ chans(h ↓ o) and let Θ2 be Θ restricted to chans(h ↓ o). Then we have: Θ1 ` (h ↑ o) : Γ and Θ2 ` (h ↓ o) : o : T . 44 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Lemma 7.5 (Merging of heaps). Suppose Θ ` h : Γ and Θ0 ` h0 : Γ0 with dom(h)∩dom(h0 ) = ∅ and dom(Θ) ∩ dom(Θ0 ) = ∅. Then we have Θ + Θ0 ` h + h0 : Γ + Γ0 . These two lemmas show, if we apply them repeatedly, that a typing derivation for a heap can be considered as a set of separate typing derivations leading to each root of the heap. This will allow us in particular to show results for particular cases where a heap has only one root and generalize them. Lemma 7.6. Suppose Θ ` h : o : S. Let ϕ be an injective function from dom(h) to O. Then we have Θ ` ϕ(h) : ϕ(o) : S. Lemma 7.7 (Opening). If Θ ` h : Γ, if Γ(r) is a branch session type S and if h(r) is an object identifier o, then we know from Lemma 7.1 that h contains an entry for o. Let C be the class of this entry, then there exists a field typing F for C such that Θ ` h : Γ{r 7→ C[F ]} and F ` C : S. Lemma 7.8 (Closing). If Θ ` h : Γ and Γ(r) = C[F ] and F ` C : S, then Θ ` h : Γ{r 7→ S}. Lemma 7.9 (modification of the heap). Suppose that we have Θ ` h : Γ and Γ ∗ r B v 0 : T 0 C Γ0 ∗ r, and that Γ0 (r.f ) = T where T is not a variant. Let v = h(r).f . The modified heap h{r.f 7→ v 0 } can be typed as follows: (1) if v is an object identifier or a channel endpoint, then: Θ ` h{r.f 7→ v 0 } : Γ0 {r.f 7→ T 0 }, v : T (2) if v is not an object or channel and T is not a link type, then: Θ ` h{r.f 7→ v 0 } : Γ0 {r.f 7→ T 0 } (3) if v = l0 and T = link f 0 , then: • Γ0 (r.f 0 ) = hl : Sl il∈E for some E such that l0 ∈ E and some set of branch session types Sl . Note that this implies f 6= f 0 . • Θ ` h{r.f 7→ v 0 } : Γ0 {r.f 7→ T 0 }{r.f 0 7→ Sl0 } Lemma 7.10 (Substitution). If this : C[F ], x : T 0 ∗ this B e : T C this : C[F 0 ] ∗ this, and if Γ(r) = C[F ], then: (1) if T 0 is a base type (i.e. neither an object type nor a link) and v is a literal value of that type, or if v is an access point name declared with type hΣi and JhΣiK <: T 0 , we have: Γ ∗ r B e{v/x } : T C Γ{r 7→ C[F 0 ]} ∗ r. (2) if T 0 is an object type and v is an object identifier or a channel endpoint, we have: Γ, v : T 0 ∗ r B e{v/x } : T C Γ{r 7→ C[F 0 ]} ∗ r. Lemma 7.11 (Typability of Subterms). If D is a derivation of Γ ∗ r B E(e) : T C Γ0 ∗ r0 then there exist Γ1 , r1 and U such that D has a subderivation D0 concluding Γ ∗ r B e : U C Γ1 ∗ r1 and the position of D0 in D corresponds to the position of the hole in E. Lemma 7.12 (Replacement). If (1) D is a derivation of Γ ∗ r B E(e) : T C Γ0 ∗ r0 (2) D0 is a subderivation of D concluding Γ ∗ r B e : U C Γ1 ∗ r1 (3) the position of D0 in D corresponds to the position of the hole in E (4) Γ00 ∗ r00 B e0 : U C Γ1 ∗ r1 then Γ00 ∗ r00 B E(e0 ) : T C Γ0 ∗ r0 . MODULAR SESSION TYPES FOR OBJECTS 45 7.2. Type preservation. We use ` s as an abbreviation for ∅ ` s; this represents welltypedness of a closed configuration. We have the following result: Theorem 7.13 (Subject Reduction). If, in a context parameterised by a set of well-typed declarations, we have ` s and s −→ s0 , then ` s0 . This global result is a consequence of a subject reduction theorem for a single thread, which is similar but not identical to what we stated as Theorem 3.19 (which will be a particular case). The reason it is not identical is that we need to prove that the type of an expression is preserved not only when this expression reduces on its own but also when it communicates with another thread. In order to state precisely this thread-wise type preservation theorem, we introduce a labelled transition system for threads. Transition labels can be: τ indicating internal reduction, cp ! [v] or cp ? [v] indicating that the non-object value v is sent or received on channel cp , cp ! [h] or cp ? [h], where h is a heap with a single root o, indicating that the object o (together with its content) is sent or received on channel cp , n[cp ] indicating that the channel endpoint cp is received from access point n, or, finally, C.m() indicating that the thread spawns another one using method m of class C. Definition 7.14 (Labelled transition system). We define a labelled transition system for threads by the following rules: (Tr-Red) (h ∗ r , e) −→ (h0 ∗ r0 , e0 ) τ (h ∗ r , e) −→ (h0 ∗ r0 , e0 ) h(r).f = cp (Tr-Send) v 6∈ O cp ![v] (h ∗ r , E[f.send(v)]) −→ (h ∗ r , E[null]) h(r).f = cp (Tr-SendObj) cp ![h↓o] (h ∗ r , E[f.send(o)]) −→ (h ↑ o ∗ r , E[null]) h(r).f = cp (Tr-Receive) v 6∈ O cp ?[v] (h ∗ r , E[f.receive()]) −→ (h ∗ r , E[v]) (Tr-RcvObj) h(r).f = cp roots(h0 ) = {o} dom(h) ∩ dom(h0 ) = ∅ cp ?[h0 ] (h ∗ r , E[f.receive()]) −→ (h + h0 ∗ r , E[o]) (Tr-Accept) h(r).f = n n[c+ ] (h ∗ r , E[f.accept()]) −→ (h ∗ r , E[c+ ]) (Tr-Request) h(r).f = n n[c− ] (h ∗ r , E[f.request()]) −→ (h ∗ r , E[c− ]) C.m() (Tr-Spawn) (h ∗ r , E[spawn C.m(v)]) −→ (h ∗ r , E[null]) Note that both τ and C.m() correspond to the thread being able to reduce on its own. An important feature of this transition relation is that, for all rules, the right-hand state is fully determined by the left-hand one and the transition label. Moreover, the only case where 46 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS several different transitions are possible from a given state is when applying the rule receive, as the right-hand side depends on the value received. Definition 7.15. A similar transition relation, with the same set of labels, is defined on channel environments Θ as follows: Θ −→ Θ ∀p, cp 6∈ dom(Θ) n.protocol = hΣi C.m() τ Θ −→ Θ n[c+ ] Θ −→ Θ, c+ : Σ JΣ0 K <: T ∀p, cp 6∈ dom(Θ) n.protocol = hΣi n[c− ] Θ −→ Θ, c− 0p0 :Σ Θ, cp : ! [T ] .Σ, c : Σ0 h 0i cp ! c0p −→ Θ, cp : Σ JΣ0 K <: T Θ, cp : ? [T ] .Σ h 0i cp ? c0p −→ 0 Θ, cp : Σ, c0p : Σ0 ∅Bv:T C∅ ∅Bv:T C∅ cp ![v] cp ?[v] Θ, cp : ! [T ] .Σ −→ Θ, cp : Σ Θ, cp : ? [T ] .Σ −→ Θ, cp : Σ l0 ∈ E l0 ∈ E cp ![l0 ] cp ?[l0 ] Θ, cp : ⊕ {l : Σl }l∈E −→ Θ, cp : Σl0 Θ1 ` h : o : S Θ, cp : & {l : Σl }l∈E −→ Θ, cp : Σl0 dom(Θ1 ) ⊆ chans(h) cp ![h] Θ1 + Θ2 , cp : ! [S] .Σ −→ Θ2 , cp : Σ Θ0 ` h : o : S dom(Θ0 ) ⊆ chans(h) dom(Θ) ∩ dom(Θ0 ) = ∅ cp ?[h] Θ, cp : ? [S] .Σ −→ Θ + Θ0 , cp : Σ Where we use ∅ B v : T C ∅ as an abbreviation for dummy : C[] ∗ dummy B v : T C dummy : C[] ∗ dummy — meaning that v is a literal value (or access point name) of type T . We can now state our thread-wise type preservation theorem. Theorem 7.16 (Thread-wise progress and type preservation). Let D be a set of well-typed declarations, that is, such that for every class declaration D in D we have ` D. In a context parameterised by D, suppose we have Θ; Γ B (h ∗ r , e) : T C Γ0 ∗ r0 . λ Then either e is a value or there exists a transition label λ such that we have (h∗r , e) −→ (h0 ∗ r00 , e0 ) for some h0 , r00 and e0 . λ Furthermore, if λ is such that Θ −→ Θ0 for some Θ0 , then there exists Γ00 such that 0 Θ ; Γ00 B (h0 ∗ r00 , e0 ) : T C Γ0 ∗ r0 holds. Theorem 3.19 is the particular case where λ = τ . Corollary 7.17 (Theorem 3.20). If D contains no name declaration and Θ is empty, then there exists s0 such that (h ∗ r , e) −→ s0 . (Corollary). In that particular case, Θ ` h : Γ implies that the heap cannot contain any n or cp , hence λ can only be τ or of the form C.m(). MODULAR SESSION TYPES FOR OBJECTS 47 (Theorem). We always use typing derivations where subsumption steps only occur at the positions described in Lemma 7.2. Furthermore, it is sufficient to consider only cases where subsumption does not occur at the end: indeed, if it does occur, then we can add a similar subsumption step to the new judgement. The hypothesis in the theorem that Θ; Γ B (h ∗ r , e) : T C Γ0 ∗ r0 holds is necessarily a result of T-State and therefore is equivalent to the two hypotheses Θ ` h : Γ and Γ ∗ r B e : T C Γ0 ∗ r0 , which we will sometimes refer to directly. We prove the theorem by induction on the structure of e with respect to contexts, and present the inductive case first: If e is of the form E[e1 ] where e1 is not a value and E is not just [_], then Lemma 7.11 tells us that Γ ∗ r B e1 : U C Γ1 ∗ r1 appears in the typing derivation of Γ ∗ r B e : T C Γ0 ∗ r0 for some U , r1 and Γ1 . From there we can apply T-State and derive Θ; Γ B (h ∗ r , e1 ) : U C Γ1 ∗ r1 . This allows us to use the induction hypothesis and get λ, e2 , r00 and h0 such that λ λ (h ∗ r , e1 ) −→ (h0 ∗ r00 , e2 ). Then we straightforwardly have e −→ E[e2 ], either by applying R-Context if λ is τ or by replacing the context in the transition rule if it is something else. λ Now if λ is such that Θ −→ Θ0 , then the induction hypothesis1 also gives us Γ00 such that Θ0 ; Γ00 B (h0 ∗ r00 , e2 ) : U C Γ1 ∗ r1 holds. From this we get, by reading T-State upwards, Θ0 ` h0 : Γ00 and Γ00 ∗ r00 B e2 : U C Γ1 ∗ r1 . We use Lemma 7.12 with the latter in order to obtain Γ00 ∗ r00 B E[e2 ] : T C Γ0 ∗ r0 and conclude with T-State. The base cases are if e is of the form E[v] with E elementary (i.e. not of the form E 0 [E 00 ] with E 00 6= [_]) and if it is not of the form E[e1 ] at all. We list them below. • If e is a value, there is nothing to prove. • e cannot be a variable. Indeed, Θ ` h : Γ implies that dom(Γ) contains only object identifiers and channel endpoints. Therefore, Γ ∗ r B e : T C Γ0 ∗ r0 cannot be a conclusion of T-Var or T-LinVar, thus e is not a variable. • e = v; e0 . Then the expression reduces by R-Seq and the initial derivation is as follows: (1) ... Γ ∗ r B v : T 0 C Γ1 ∗ r Γ1 ∗ r B e0 : T C Γ0 ∗ r0 (b) 0 Γ ∗ r B v; e : T C Γ0 ∗ r0 Θ ` h : Γ (a) Θ; Γ B (h ∗ r , v; e0 ) : T C Γ0 ∗ r0 (T-Seq) (T-State) Furthermore, T 0 is not a link type. Therefore, (1) cannot be T-VarF or T-VarS and it is either T-Ref, T-Chan, T-Name, T-Label or T-Null, since these are the only rules for typing values. If it is T-Null, T-Label or T-Name, then Γ = Γ1 ; if it is T-Ref or T-Chan, then Γ <: Γ1 and we can use Lemma 3.15 to get Γ ∗ r B e0 : T C Γ0 ∗ r0 from (b) in both cases. We conclude from this using (a) and T-State. • e = new C(). Then the expression reduces by R-New and the initial reduction is as follows: (T-State) Γ ∗ r B new C() : C.session C Γ ∗ r Θ ` h : Γ (a) Θ; Γ B (h ∗ r , new C()) : C.session C Γ ∗ r (T-New) ~ }. Let S = C.session. From the hypothesis that D is well-typed, we have ` class C {S; f~; M −−→ ~ This must come from T-Class, therefore we have Null f ` C : S (b). We build the following derivation: λ λ 1clearly there is no λ such that we would have E[e ] −→ but not e1 −→, hence it is legitimate to use the 1 induction hypothesis here. 48 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS T-Null, T-Swap, T-Seq −−→ ~ −−→ −−→ (a) Γ, o : C[Null f ] ∗ o B f~ ↔ Null : Null C Γ, o : C[Null f~] ∗ o (T-Hadd) −→ −−→ Θ ` h, {o = C[f~ = null]} : Γ, o : C[Null f~] (T-Hide) −→ Θ ` h, {o = C[f~ = null]} : Γ, o : S (b) −→ then conclude Θ; Γ, o : S B (h, {o = C[f~ = null]} ∗ r , o) : S C Γ ∗ r using T-Ref (it is not possible that r starts with o since o is fresh) and T-State. • e = switch (v) {l : el }l∈E . Then we have two cases. The slightly more complex one is if the initial derivation is as follows: v is a label Γ ∗ r B v : {v} C Γ ∗ r Γ(r.f ) = S Γ ∗ r B v : link f C Γ{r.f 7→ hv : Si} ∗ r v ∈ E (b) Γ ∗ r B ev : T C Γ0 ∗ r (c) Γ ∗ r B switch (v) {l : el }l∈E : T C Γ0 ∗ r (using T-Label, T-VarS, T-SwitchLink top to bottom). As usual we also have Θ ` h : Γ (a) as the other premise of T-State (omitted for lack of space). The reason why the initial environment of judgement (c) is Γ is because it is obtained from the version of Γ with the type of r.f modified by modifying this type again, putting back S instead of the variant. (b) implies that the expression reduces by R-Switch. As regards type preservation, we can conclude Θ; Γ B (h ∗ r , ev ) : T C Γ0 ∗ r directly from (a), (c), and T-State. The other case is when the T-VarS step is absent and the following rule is T-Switch instead of T-SwitchLink; the argument is the same. • e = f ↔ v. Then the initial derivation is as follows: ... Γ ∗ r B v 0 : T 0 C Γ1 ∗ r (b) Γ1 (r.f ) = T (c) T is not a variant (d) Γ ∗ r B f ↔ v 0 : T C Γ1 {r.f 7→ T 0 } ∗ r (T-Swap) and we also have, as usual, Θ ` h : Γ (a). The fact that Γ1 (r.f ) is defined implies that Γ(r.f ) is also defined, indeed the effect of typing v can only remove from the environment or create a variant type, so it can only decrease the set of valid field references. Thus h(r).f is defined as well, and the expression reduces by R-Swap. Let v = h(r).f . From (a), (b), (c) and (d), we use Lemma 7.9 to get Γ00 such that Θ ` h{r.f 7→ v 0 } : Γ00 . We then notice that in each of the three cases of the lemma we have Γ00 ∗ r B v : T C Γ1 {r.f 7→ T 0 } ∗ r: (1) If v is an object identifier or channel endpoint, then Γ00 = Γ1 {r.f 7→ T 0 }, v : T . We use T-Ref or T-Chan. (2) If v is not an object or channel and T is not a link type, then v is either null, an access point name or a label. We use T-Null, T-Name or T-Label. (3) If T = link f 0 , then Γ1 (r.f 0 ) = hl : Sl il∈E with v ∈ E and we have Γ00 = Γ1 {r.f 7→ T 0 }{r.f 0 7→ Sv }. We use T-Label, T-VarS and T-SubEnv. Finally we conclude with T-State. • e = return v. Then the expression reduces by R-Return. The initial derivation is as follows: ... (1) Γ ∗ r.f B v : T1 C Γ1 ∗ r.f Γ1 (r.f ) = C[F ] F ` C : S (b) (T-Return) Γ ∗ r.f B return v : T C Γ1 {r.f 7→ S} ∗ r with also Θ ` h : Γ (a). We distinguish cases depending on what rule (1) is: – If (1) is T-Null, T-Name or T-Label, then Γ = Γ1 , and if it is T-Ref or T-Chan, then Γ = Γ1 , v : T1 . In both cases we have Γ(r.f ) = Γ1 (r.f ) and T1 = T . From (a) and (b) we deduce Θ ` h : Γ{r.f 7→ S} using the closing lemma (Lemma 7.8). We then use T-Null, T-Name, T-Label, T-Chan or T-Ref, as appropriate, to get Γ{r.f 7→ S} ∗ r B v : T1 C Γ1 {r.f 7→ S} ∗ r, and we conclude with T-State. MODULAR SESSION TYPES FOR OBJECTS 49 – (1) cannot be T-VarS because T-Return forbids that T1 be of the form link f 0 . – If (1) is T-VarF, then T1 = variant-tag and T = link f . Furthermore, v is a label, F = hv : F 0 i with F 0 not a variant, and Γ = Γ1 {r.f 7→ C[F 0 ]}. (b) then implies that S is of the form hl : Sl il∈E with v ∈ E and F 0 ` C : Sv . Note that because F 0 is not a variant, Sv must be a branch. Now, from that judgement and (a), we use the closing lemma to get Θ ` h : Γ{r.f 7→ Sv }. Let Γ00 = Γ{r.f 7→ Sv }. Since Γ only differs from Γ1 by the type of r.f , it is also the case of Γ00 , and as hv : Sv i is a subtype of S, we have Γ00 {r.f 7→ hv : Sv i} <: Γ1 {r.f 7→ S}. From all this, we build the following derivation: (T-Label) (T-VarS) Θ ` h : Γ{r.f 7→ Sv } (T-State) (T-SubEnv) 00 v is a label Γ00 ∗ r B v : {v} C Γ00 ∗ r Sv branch Γ00 ∗ r B v : T C Γ00 {r.f 7→ hv : Sv i} ∗ r Γ00 ∗ r B v : T C Γ0 ∗ r 0 Θ; Γ B (h ∗ r , v) : T C Γ ∗ r • e = spawn C.m(v). The initial derivation involves T-Spawn, and v is null. The premise that the method exists implies that the state can reduce by R-Spawn, which corresponds to a C.m() transition. The new derivation is obtained replacing T-Spawn with T-Null. • e = f.m(v). The initial derivation is as follows, with m = mj and j ∈ I: ... (1) Γ ∗ r B v : T 0 C Γ1 ∗ r (T-Sub) Γ ∗ r B v : Tj0 C Γ1 ∗ r Γ1 (r.f ) = {Ti mi (Ti0 ) : Si }i∈I (b) (T-Call) Γ ∗ r B f.mj (v) : T C Γ1 {r.f 7→ Sj } ∗ r and we also have Θ ` h : Γ (a). T is obtained from Tj as specified in T-Call, i.e. replacing variant-tag with link f if necessary. Let S = {Ti mi (Ti0 ) : Si }i∈I . First note that Tj0 is a part of a method signature and that only a restricted set of types is allowed there: it cannot be of the form link f 0 . Furthermore, (1) cannot be T-VarF because of (b), thus T 0 is not variant-tag either. Indeed, if Γ1 (r) were a variant, Γ1 (r.f ) would not be defined. Therefore (1) is either T-Null, T-Label, T-Chan, T-Name or T-Ref and in all cases we have Γ(r.f ) = Γ1 (r.f ). As it is a session type, it implies because of (a) that h(r).f exists and is either an object identifier, an access point name or a channel endpoint. We distinguish these three cases: – h(r).f is an object identifier o. We use (a) and the opening lemma (Lemma 7.7) to get a field typing C[F ] such that Θ ` h : Γ{r.f 7→ C[F ]} and F ` C : S. This last judgement implies, by definition, that F is not a variant; that, among others, method mj appears in the declaration of class C; and that, if ej is its body and x its parameter, we have x : Tj0 , this : C[F ] ∗ this B ej : Tj C this : C[Fj ] ∗ this and Fj ` C : Sj . The fact that the method is declared implies (h ∗ r , e) −→ (h ∗ r.f , return ej {v/x }); we now have to type this resulting state. For this, we apply the substitution lemma (Lemma 7.10) to the typing judgement for ej , using Γ1 {r.f 7→ C[F ]} as the Γ of the lemma and r.f as the r of the lemma. The first case of the lemma corresponds to (1) being T-Null, T-Label or T-Name; the second one corresponds to (1) being T-Ref or T-Chan. In both cases, the resulting judgement is: Γ{r.f 7→ C[F ]} ∗ r.f B ej {v/x } : Tj C Γ1 {r.f 7→ C[Fj ]} ∗ r.f Indeed, the difference between Γ and Γ1 depends on (1) in the same way as the lemma’s result. From this and Fj ` C : Sj we can now apply T-Return and get: Γ{r.f 7→ C[F ]} ∗ r.f B return ej {v/x } : T C Γ1 {r.f 7→ Sj } ∗ r 50 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS where T is the same as in the initial derivation. We then conclude, using the heap typing that was provided by the opening lemma, with T-State. – h(r).f is an access point name n. Then Γ(r.f ) must come, in the derivation of Θ ` h : Γ, from T-Name, which implies that n is declared, that mj is either accept or request, and that Tj :> JΣK where Σ is either the declared type or its dual depending on which one mj is. All this implies that the state does a n[cp ] transition where c is fresh and n[cp ] p depends, again, on mj , and that Θ −→ Θ, cp : Σ. The resulting state is typed using Γ00 = Γ, cp : JΣK and T-Chan. – h(r).f is a channel endpoint cp . Then Θ ` h : Γ implies that cp ∈ dom(Θ) and S :> JΘ(cp )K. Hence mj is either send or receive. We distinguish the two cases.h In ithe first case, the fact that S contains send implies that Θ(cp ) is either of the form ! Tj00 .Σ with Tj0 <: Tj00 or ⊕ {l : Σl }l∈E and then Tj0 = {v} and v ∈ E. If v is not an object identifier, then the state does a cp ! [v] transition. We can see that in both cases (send and select), Θ is able to follow that transition and evolves in such a way that Θ0 ` h : Γ0 holds: the session type of cp is advanced and if v was a channel it is removed from the environment, which corresponds to the difference between Γ and Γ0 , thus it suffices to change the instance of T-Hempty at the root of the derivation leading to (a) to get this new typing. Then the new state is typed using T-Null and T-State. If v is an object identifier, then (1) is T-Ref and thus v ∈ dom(Γ), which implies (using (a)) that v is a root of h, so the state does a cp ! [h ↓ v] transition. We use the splitting lemma (Lemma 7.4) to see that Θ is able to follow this transition and yields a Θ0 such that we have Θ0 ` h ↑ v : Γ0 . We can then again conclude using T-Null and T-State. In the case where mj is receive, the state can straightforwardly do a transition, which will be a receive on channel cp , however the transition label is not completely determined by the original state as we do not know what will be received. So we have to prove type λ preservation in all cases where the transition label λ is such that Θ −→ Θ0 for some Θ0 . If λ is of the form cp ? [v 0 ], then this hypothesis tells us that Θ(cp ) is either of the form ? [T0 ] .Σ, and then v 0 must be a literal value of type T0 or a channel endpoint which gets added to the environment with a type smaller that T0 , or of the form & {l : Σl }l∈E , and then v 0 ∈ E. In the first case we must have T0 <: Tj , thus the resulting expression, which is v 0 , can be typed using the appropriate literal value rule, or T-Chan, and subsumption. In the second one, Tj = variant-tag so that T = link f ; the resulting expression can be typed using T-Label and T-VarS. As for the new initial environment, it is obtained, as in the case of send, by replacing the instance of T-Hempty at the top of the derivation for (a) with one using Θ0 instead of Θ, so that v 0 gets added to the initial environment if it is a channel and that the session type of r.f is correctly advanced, meaning, in the case of a branch, that it is advanced to the particular session corresponding to v 0 , the variant type being reconstituted in the final environment by T-VarS. Finally, if λ is of the form cp ? [h0 ], then we have Θ0 = Θ + Θ00 with Θ00 ` h0 : o : Tj , where o is the only root of h0 . The merging lemma (Lemma 7.5) gives us a typing for the new heap and, as in the other cases, advancing the session type of cp yields a session type change in r.f , corresponding to the difference between Γ and Γ0 . We conclude using T-Ref and T-State. The following two lemmas will allow us to deduce from this theorem the proof of subject reduction for configurations. MODULAR SESSION TYPES FOR OBJECTS 51 Lemma 7.18. If Θ ` s and s ≡ s0 , then Θ ` s0 . Proof. By induction on the derivation of s ≡ s0 . Lemma 7.19. If s −→ s0 , then either: (1) s ≡ (ν~c) ((h ∗ r , e) || s00 ), s0 ≡ (ν~c) ((h0 ∗ r0 , e0 ) || s00 ) τ and (h ∗ r , e) −→ (h0 ∗ r0 , e0 ), or (2) s ≡ (ν~c) ((h1 ∗ r1 , e1 ) || (h2 ∗ r2 , e2 ) || s00 ), s0 ≡ (ν~c)(νd) ((h1 ∗ r1 , e01 ) || (h2 ∗ r2 , e02 ) || s00 ), n[d+ ] n[d− ] cp ![v] cp ?[v] (h1 ∗ r1 , e1 ) −→ (h1 ∗ r1 , e01 ) and (h2 ∗ r2 , e2 ) −→ (h2 ∗ r2 , e02 ), or (3) s ≡ (ν~c) ((h1 ∗ r1 , e1 ) || (h2 ∗ r2 , e2 ) || s00 ), s0 ≡ (ν~c) ((h1 ∗ r1 , e01 ) || (h2 ∗ r2 , e02 ) || s00 ), (h1 ∗ r1 , e1 ) −→ (h1 ∗ r1 , e01 ) and (h2 ∗ r2 , e2 ) −→ (h2 ∗ r2 , e02 ), or (4) s ≡ (ν~c) ((h1 ∗ r1 , e1 ) || (h2 ∗ r2 , e2 ) || s00 ), s0 ≡ (ν~c) ((h01 ∗ r1 , e01 ) || (h02 ∗ r2 , e02 ) || s00 ), cp ![h0 ] cp ?[ϕ(h0 )] (h1 ∗ r1 , e1 ) −→ (h01 ∗ r1 , e01 ) and (h2 ∗ r2 , e2 ) −→ (h02 ∗ r2 , e02 ) with h0 = h1 ↓ o, h01 = h1 ↑ o, and h02 = h2 + ϕ(h0 ), or (5) s ≡ (ν~c) ((h ∗ r , e) || s00 ), −→ s0 ≡ (ν~c) ((h ∗ r , e0 ) || (o = C[f~ = null] ∗ o , e00 {null/x }) || s00 ) C.m() and (h ∗ r , e) −→ (h ∗ r , e0 ), where C.fields = f~, o is fresh and m(x) {e00 } ∈ C. Proof. This is nothing more than a reformulation of the reduction rules in terms of labelled transitions: the derivation for s −→ s0 can contain any number of instances of R-Par, R-Str or R-NewChan but must have one of the other rules at the top. It is straightforward to see that depending on that top rule we are in one of the five cases listed: (1) for any of the single-thread rules in Figure 7, (2) for R-Init, (3) for R-ComBase, (4) for R-ComObj, and (5) for R-Spawn. We can now prove Theorem 7.13. (Theorem 7.13). Because of Lemma 7.18 we only need to look at the different cases described in Lemma 7.19. In cases (1) and (5), the initial derivation is as follows: Θ1 ; Γ B (h ∗ r , e) : T C Γ0 ∗ r00 (T-Thread) Θ1 ` (h ∗ r , e) Θ2 ` s00 (T-Par) Θ1 + Θ2 ` (h ∗ r , e) || s00 (T-NewChan) `s In case (1), Theorem 7.13 gives us Θ1 ; Γ00 B (h0 ∗ r0 , e0 ) : T C Γ0 ∗ r00 ; from there the final derivation is the same. In case (5), the theorem gives us the same result, but the final derivation is more complicated as there is one more parallel component. The C.m() transition tells us that e must be of the form E[spawn C.m(v)]. From Lemma 7.11, this implies that the subexpression spawn C.m(v) is typable, which must be a consequence of T-Spawn, implying that m appears in the initial session type S of C with a Null argument type. As, by hypothesis, the declaration −−→ of class C is well-typed, this implies (from T-Class) x : Null, this : C[Null f~] ∗ this B e00 : T C this : C[F ] ∗ this. We apply the substitution lemma (7.10) to this judgement to replace 52 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS −→ −−→ this with o and x with null, and we build the heap typing ∅ ` o = C[f~ = null] : o : C[Null f~] from T-Hempty and T-Hadd. This gives a typing for the new thread, with an empty Θ, using T-State and T-Thread and we can conclude with T-Par. In cases (2), (3), and (4), the initial derivation is: Θ1 ; Γ1 B (h1 ∗ r1 , e1 ) : T1 C Γ01 ∗ r10 Θ2 ; Γ2 B (h2 ∗ r2 , e2 ) : T2 C Γ02 ∗ r20 Θ1 ` (h1 ∗ r1 , e1 ) Θ2 ` (h2 ∗ r2 , e2 ) (T-Par) Θ1 + Θ2 ` (h1 ∗ r1 , e1 ) || (h2 ∗ r2 , e2 ) (T-Par) Θ1 + Θ2 + Θ ` (h1 ∗ r1 , e1 ) || (h2 ∗ r2 , e2 ) || s00 (T-NewChan) `s Θ ` s00 Furthermore, we can deduce from the transition labels that the expressions in the two topmost premises are of the form E1 [f1 .m1 (v1 )] and E2 [f2 .m2 (v2 )] with h1 (r1 ).f1 and h2 (r2 ).f2 being, in case (2), n, and in cases (3) and (4), respectively cp and cp . These two topmost premises must come from T-State, which implies Θ1 ` h1 : Γ1 and Θ2 ` h2 : Γ2 , from which we deduce, in case (2), that n is a declared access point name and in cases (3) and (4) that JΘ1 (cp )K <: Γ1 (r1 .f1 ) and JΘ2 (cp )K <: Γ2 (r2 .f2 ). We use Theorem 7.13 on these two topmost premises and distinguish cases. In case (2), Θ1 and Θ2 make transitions which introduce two dual types for d+ and d− , which are fresh so that the disjoint unions are still possible, and we just need to add an additional step of T-NewChan before the last one. In cases (3) and (4), we first remark that because T-NewChan in the derivation leads to an empty environment, c must be one of the channels in (ν~c) and we must have Θ1 (cp ) = Σ and Θ2 (cp ) = Σ for some Σ. Then we use Lemma 7.11 to get a typing judgement for the method call subexpression on the sending side (thread 1). This judgement has Γ1 as an initial typing environment and comes from T-Call; as we have Σ <: Γ1 (r1 .f1 ), this implies that Σ is either of the form ! [T ] .Σ0 with v (in case (3)) or o (in case (4)) of type T , or (only in case (3)) of the form ⊕ {l : Σl }l∈E with v ∈ E. The simplest case is (3): then this typing information, together with the duality of the two endpoint types, shows that Θ2 follows the transition with the new type of cp still dual to the new type of cp . In the case where v is a channel endpoint, its typing goes from Θ1 to Θ2 but stays the same, so that it is unchanged in the sum environment yielded by T-Par. Thus we can still apply T-NewChan. Case (4) is similar but, additionally, a renaming function is applied to the transmitted heap. We use Lemma 7.6 to see that the type of its only root, which is all we need, stays the same, so that again Θ2 can follow the transition. We also have that a whole part of the channel environment can go from Θ1 to Θ2 but the effect is the same as with just one channel: it does not affect the sum environment resulting from T-Par. So again we can still apply T-NewChan. 7.3. Type safety. We now have the following safety result, ensuring not only race-freedom (no two sends or receives in parallel on the same endpoint of a channel) but also that the communication is successful. Theorem 7.20 (No Communication Errors). Let s ≡ (ν~c)(s0 || (h ∗ r , E[r.f.m(v)]) || (h0 ∗ r0 , E[r0 .f 0 .m0 (v 0 )])) and suppose that ` s holds. If h(r).f = cp and h0 (r0 ).f 0 = cq then: (1) q = p, MODULAR SESSION TYPES FOR OBJECTS 53 (2) channel c does not occur in s0 , and (3) there exists s00 such that s −→ s00 . As the statement is true in particular when s0 is empty, it implies that communication between the two threads is possible. Proof. This is an essentially straightforward consequence of ` s. The typing derivation is similar to the one shown for cases 2/3/4 in Theorem 7.13 above; the two top premises must be consequences of T-State and the heap typing necessary to apply this rule implies, respectively, Γ1 (r.f ) :> JΘ1 (cp )K and Γ2 (r0 .f 0 ) :> JΘ2 (cq )K. Because of the disjoint unions in T-Par, cp ∈ dom(Θ1 ) and cq ∈ dom(Θ2 ) immediately imply (1) and (2); (3) is then a consequence of the duality constraint imposed by T-NewChan: looking at the translations of dual channel types, and because the method call subexpressions must be typed by T-Call, if m is send then m0 must be receive and vice-versa. This theorem, together with the progress aspect of Theorem 7.16, restricts the set of blocked configurations to the following: if ` s and s 6−→, then all parallel components in s are either terminated (reduced to values), unmatched accepts or requests, or method calls on pairwise distinct channels — this last case corresponding to a deadlock. 7.4. Conformance. We now have the technical material necessary to prove Theorem 3.32 (conformance). Note that we do not formally extend this result to the distributed setting, as stating a similar property in that case would require more complex definitions describing, among other things, how call traces are moved around between threads; however we can see informally that, because objects keep their content and session type when transmitted, all necessary information is kept such that we still have a conformance property. Proof. We first prove, by strong induction on n, a slightly different result, namely the following: for each i there is Γi such that Γi B (hi ∗ ri , ei ) : T C Γ0 ∗ r0 and tr i is consistent with Γi . We suppose that this property is true for any reduction sequence of length n or less whose initial state satisfies the hypotheses and prove that it is true also for length n + 1. The base case n = 1 is trivial. If the nth reduction step (hn ∗ rn , en ) −→ (hn+1 ∗ rn+1 , en+1 ) does not originate from R-Return, we use the induction hypothesis on the beginning of the sequence; we refer to the cases in the proof of Theorem 7.16 to show that the Γn+1 it allows to construct from Γn indeed is consistent with tr n+1 . Because we are only interested in Γn+1 and not Γ0 , in most cases we can use Lemmas 7.11 and 7.12 to ignore any context E and proceed as if the reduction is exactly an instance of its original rule. If the rule is R-Seq, R-Switch or R-Swap then tr n+1 = tr n . If the rule is R-Seq or R-Switch then the proof of Theorem 7.16 shows that we can choose Γn+1 = Γn , so there is nothing more to prove. If the rule is R-Swap then the proof of Theorem 7.16 indicates that Γn+1 (called Γ00 in subject reduction) can be defined using Lemma 7.9 from the Γ000 (called Γ1 in subject reduction) obtained after typing v 0 , the value that gets swapped into the field. First of all note that most objects, notably all those which are not v 0 and not in a field of r, have the same type and position in the heap in Γn+1 as they have in Γ. For all them the result is straightforward: we only concentrate on those objects that move or change type. Depending on the nature of T and T 0 (object, link, or base type), there may be one or two of them. 54 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Recall that neither type can be variant-tag as else the expression would not be typable. We distinguish cases separately for T and T 0 , knowing that any combination is possible (except both linking to the same field). Cases for T 0 : • If T 0 is an object type (thus v 0 is an object name o0 ), then Γn+1 (r.f ) = Γn (o0 ) (the rule used for v 0 is T-Ref). We also have tr n+1 (hn+1 (r.f )) = tr n+1 (o0 ) = tr n (o0 ), so tr n+1 is indeed consistent with Γn+1 with respect to reference r.f . • If T 0 is link f 0 , the rule used for v 0 is T-VarS, and Γn+1 (r.f 0 ) = hv 0 : Sv0 i. We have Γn+1 (r.f ) = link f 0 and hn+1 (r.f ) = v 0 , hence the actual session type of r.f 0 in hn+1 according to Γn+1 is Sv0 . Thus consistency is preserved for r.f 0 . Cases for T (corresponding respectively to cases 1 and 3 of Lemma 7.9): • If T is an object type (thus hn (r.f ) is an object name o), then Γn+1 contains a new entry for o, with type Γn (r.f ). Consistency for this new entry comes from consistency for r.f at the previous step. • If T is link f 00 , then Γn (r.f 0 ) = hl : Sl il∈E and hn (r.f ) = l0 is in E. Thus the actual session type of r.f 00 in hn according to Γn is Sl0 . Lemma 7.9 also gives us Γn+1 (r.f 0 ) = Sl0 , hence the actual session type of r.f 00 has not changed, and consistency is preserved. If the rule is R-New then the proof of Theorem 7.16 shows that a suitable Γn+1 is of the form Γn , o : C.session where o is the fresh object name introduced by the reduction. Definition 3.27 states that tr n+1 extends tr n by assigning an empty call trace to o; clearly tr n+1 is consistent with Γn+1 . If the rule is R-Call then the proof of Theorem 7.16 shows that a suitable Γn+1 is Γn with the type of r.f replaced by a type which is not a session. So there is no consistency requirement in Γn+1 for r.f , and every other reference is given the same call trace by tr n+1 as by tr n . Therefore tr n+1 is consistent with Γn+1 . Now if the nth step originates from R-Return, we reason slightly differently. We know by hypothesis that r1 is a prefix of rn+1 . Furthermore, since the nth step is R-Return, rn is of the form rn+1 .f . Reduction rules can only alter the current object by removing or adding one single field reference at once, therefore there must be a previous reduction step in the sequence, say the ith, that last went from rn+1 to rn+1 .f . That is, we chose i such that rn+1 .f is a prefix of all rj for j between i + 1 and n and that ri = rn+1 . That step must originate from R-Call as it is the only rule which adds a field specification to the current object. Thus, it is of the form (hi ∗ rn+1 , E(f.m(v 0 ))) −→ (hi+1 ∗ rn+1 .f , E(return e)), where e is the method body of m with the parameter substituted. Then it is straightforward to see that the whole reduction sequence from i + 1 to n consists of reductions of e inside the context E(return [_]). We first use the induction hypothesis on the first part of the reduction (1 to i) so as to get judgments up to Γi B (hi ∗ rn+1 , E(f.m(v 0 ))) : T C Γ0 ∗ r0 . We then use Lemma 7.11 to get Γi B (hi ∗ rn+1 , f.m(v 0 )) : T 0 C Γ00 ∗ r00 and note that this judgment must come from T-Call, which implies that r00 = rn+1 , that Γi (rn+1 .f ) is of the form {T 0 m(. . .) : S, . . .} and that Γ00 (rn+1 .f ) = S. Furthermore, T 0 is either a base type if S is a branch or link f if it tr i (o) is a variant. We know that tr i is consistent with Γi , therefore we have class(o).session −→∗ m {T 0 m(. . .) : S, . . .} −→ S. We now use the induction hypothesis again on the reduction sequence from i to n for this particular call subexpression, recalling that i has been defined such that the hypothesis on the current object is indeed satisfied by this sequence. We can also use Lemma 7.12 at each MODULAR SESSION TYPES FOR OBJECTS 55 step in order to lift the judgements thus obtained to the whole expression. To summarise, this means that for any j between i + 1 and n we have: ej = E(return e0j ) for some e0j , Γj B (hj ∗ rj , return e0j ) : T 0 C Γ00 ∗ rn+1 and Γj B (hj ∗ rj , ej ) : T C Γ0 ∗ r0 , and that trj is consistent with Γj . For the last reduction step, R-Return, the proof of Theorem 7.16 tells us that we can choose a Γn+1 which is identical to Γn except for the type of rn+1 .f , and as the call trace for other references is not modified, consistency is preserved for them. For rn+1 .f we have to look back at the initial subexpression on step i. First note that R-Swap can only act on a field of the current object, therefore since rn+1 .f is a prefix of the current object during the whole subsequence, its content cannot change and is the same object o throughout. Similarly, there is no other R-Call or R-Return acting on that particular object, hence tr n (o) = tr i+1 (o) = tr i (o)m. We saw above that this call trace leads the initial session of o to S. Then the judgement for the final subexpression, at step n + 1, is of the form Γn+1 B (hn+1 ∗ rn+1 , v) : T 0 C Γ00 ∗ rn+1 . There are two cases, as in the proof of Theorem 7.16. If T 0 is a base type then S is a branch and it is possible to decide that Γn+1 (rn+1 .f ) is equal to S. In that case the call trace either does not change or has a label appended, but as S is a branch it can do a transition to itself with any label, therefore tr n+1 (o) is consistent with Γn+1 (rn+1 .f ) in both cases. If T 0 is link f , then v is a label, S is a variant hl : Sl il∈E v and Γn+1 (rn+1 .f ) can be chosen equal to Sv . We have tr n+1 (o) = tr n (o)v and S −→ Sv , so consistency is preserved. This completes the inductive proof that for every step i in the reduction sequence there is Γi such that Γi B (hi ∗ ri , ei ) : T C Γ0 ∗ r0 and tr i is consistent with Γi . This fact obviously implies that tr i is valid for all the objects which have a session type in Γi ; we now argue that it is also the case for the other objects, namely those which either are not at all in Γi or do not have a session type. We know by hypothesis that it is the case for tr 1 and show by a very simple induction that it cannot change from i to i + 1. The ith step can only change the call trace for an object o if it originates from R-Call or R-Return concerning that object. R-Call can only occur if the reducible part of the expression is indeed a method call on a field which contains o, and that is only typable if Γi contains a session type for that field which is a branch containing the method, and thus allows the appropriate transition: therefore validity of the call trace for o is preserved in that case. R-Return on the other hand can only occur if the reducible part of the expression is a return and if the current object is (the address of) o, and we saw that in that case the Γi+1 constructed in our proof contains a session type for o, so this case is covered by the consistency result. 8. Type Checking Algorithm This section introduces a type checking algorithm, sound and complete with respect to the type system in Section 6, and describes a prototype implementation of a programming language based on the ideas of the paper. 8.1. The Algorithm. Figures 28 and 29 define a type checking algorithm for the distributed language, including the sequential extensions from Section 4. The algorithm is applied to each component of a distributed system, and in order to ensure type safety of the complete system there must be some separate mechanism to check that each access point n is given the same type everywhere. A program is type checked by calling algorithm W on each class 56 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS W(C) = AC (C.session, C.fields, ∅) if for every req F ens F 0 for T 0 m(T x) {e} ∈ C F 0 6= h_i and BC (e, F, x : T ) = (T 0 , F 0 , _) AC (S, F, ∆) = ∆ if (F, S) ∈ ∆ AC (µX.S, F, ∆) = AC (S{µX.S/X }, F, ∆ ∪ {(F, µX.S)}) AC ({Ti mi (Ui ) : Si }16i6n , F, ∆0 ) = ∆n where for i = 1 to n let (Ti0 , Fi0 , _) = BC (ei , F, xi : Ui ) where mi (xi ) {ei } ∈ C if Ti0 <: Ti then let ∆i = AC (Si , Fi0 , ∆i−1 ) else if Ti0 is an enumeration E and Ti = variant-tag then let ∆i = AC (Si , hl : Fi0 il∈E , ∆i−1 ) else if Ti0 = variant-tag andWTi is an enumeration E and Fi0 = hl : Fl il∈E 0 and E 0 ⊆ E then let ∆i = AC (Si , l∈E 0 Fl , ∆i−1 ) AC (hl : Sl il∈E , hl : Fl il∈E 0 , ∆0 ) = ∆n where E 0 = {l1 . . . ln } ⊆ E and for i = 1 to n, ∆i = AC (Sli , Fli , ∆i−1 ) Combining variants {Ti fi }i∈I ∨ {Ti0 fi }i∈I = {(Ti ∨ Ti0 ) fi }i∈I hl : Fl il∈I ∨ hl : Fl0 il∈J = hl : Fl00 il∈I∪J where Fl00 = Fl ∨ Fl0 if l ∈ I ∩ J, Fl if l 6∈ J, Fl0 if l 6∈ I Figure 28: Typechecking: algorithms W and A. definition and checking that no call generates an error. The definition of algorithm W follows the typing rule T-Class in Figure 15. It calls algorithm A to check the relation F ` C : S and algorithm B to type check the bodies of the methods that have req/ens annotations. Algorithm A also calls algorithm B to typecheck the bodies of the methods that appear in the session type. In both A and B there are several “if” and “where” clauses; they should be interpreted as conditions which, if not satisfied, cause termination with a typing error. Because of the coinductive definition of F ` C : S, algorithm A uses a set ∆ of assumed relationships between field typings F and session types S. If there is no error then the algorithm returns ∆, but at the top level we are only interested in success or failure, not in the returned value. Algorithm B checks the typing judgement for expressions, defined in Figure 10, specialized to the top-level form this : C[F ], V ∗ this B e : T C this : C[F 0 ], V 0 ∗ this as explained in Section 3.5.1. The definition of B follows the typing rules (Figure 10) except for one point: T-VarF means that the rules are not syntax-directed, as any expression with type E can also be given type variant-tag. For this reason, clause l of B produces type variant-tag and a variant field typing with the single label l. More general variant field typings are produced when typing switch expressions, as the ∨ operator is used to combine the field typings arising from the branches. This is the typical situation when typing the body of a method whose return type is variant-tag: the body contains a switch whose branches return different labels with different associated field typings. It is possible, however, that giving type variant-tag to l is incorrect. It might turn out that the expression needs to have an enumerated type E, for example in order to be passed as a method parameter or returned as a method result of type E. An expression that has been inappropiately typed with variant-tag can, in general, be associated with any variant field typing, for example if it contains a switch whose branches yield different field typings. In this case, the algorithm uses ∨ to combine the branches of the variant field typing into a MODULAR SESSION TYPES FOR OBJECTS 57 BC (null, F, V ) = (Null, F, V ) BC (n, F, V ) = (Jhn.protocoliK, F, V ) BC (x, F, y : T ) = (T, F, V ) if x = y, where V = ∅ if T is linear or y : T otherwise BC (f ↔ e, F, V ) = (U, F 00 , V 0 ) where (T, F 0 , V 0 ) = BC (e, F, V ) and F 0 (f ) is notWa variant and W if T = variant-tag then F 0 = hl : Fl il∈E and U = ( l∈E Fl )(f ) and F 00 = ( l∈E Fl ){f 7→ E} 0 00 0 else U = F (f ) and F = F {f 7→ T } BC (l, F, V ) = (variant-tag, hl : F i, V ) BC (new C 0 (), F, V ) = (C 0 .session, F, V ) BC (f.mj (e), F, V ) = (T, F 00 , V 0 ) where (T 0 , F 0 , V 0 ) = BC (e, F, V ) and W 0 if T 0 = variant-tag then F 0 = hl : Fl il∈E and ( l∈E Fl )(f W ) = {Ti mi (Ti ) : Si }i∈I and j ∈ I 0 0 0 and Tj is an enumeration E and E ⊆ E and F 00 = ( l∈E Fl ){f 7→ Sj0 } and T = link f if Tj = variant-tag, T = Tj otherwise else F 0 (f ) = {Ti mi (Ti0 ) : Si }i∈I and j ∈ I and T 0 <: Tj0 and F 00 = F 0 {f 7→ Sj0 } and T = link f if Tj = variant-tag, T = Tj otherwise BC (m(e), F, V ) = (T 0 , F 000 , V 0 ) where (T, F 0 , V 0 ) = BC (e, F, V ) and req F 00 ens F 00 for T 0 m(T 00 x) {e} ∈ C and 0 if T = variant-tag hl : Fl il∈E and T 00 is an enumeration E 0 and W then F = 00 0 E ⊆ E and l∈E Fl <: F else T <: T 00 and F 0 <: F 00 W BC (switch (e) {l : el }l∈E , F, V ) = (T, l∈E Fl00 , V 00 ) where (U, F 0 , V 0 ) = BC (e, F, V ) and if U = E 0 then E 0 ⊆ E and ∀l ∈ E 0 .(T, Fl00 , V 00 ) = BC (el , F 0 , V 0 ) 0 0 and E ⊆ E and else if U = variant-tag then F 0 = W hm : Gm im∈E 00 0 0 00 ∀l ∈ E .(T, Fl , V ) = BC (el , m∈E 0 Gm , V ) else if U = link f then F 0 (f ) = hl : Sl il∈E 0 and E 0 ⊆ E and ∀l ∈ E 0 .(T, Fl00 , V 00 ) = BC (el , F 0 {f 7→ Sl }, V 0 ) BC (while (e) {e0 }, F, V ) = (Null, F 00 , V 0 ) where (U, F 0 , V 0 ) = BC (e, F, V ) and if U = E 0 then E 0 ⊆ {True, False} and BC (e0 , F 0 , V 0 ) = (Null, F, V ) and F 00 = F 0 else if UW= variant-tag then F 0 = hl : Fl il∈E andWE ⊆ {True, False} and BC (e0 , l∈E Fl , V 0 ) = (Null, F, V ) and F 00 = l∈E Fl else if U = link f then F 0 (f ) = hTrue : STrue , False : SFalse i and BC (e0 , F 0 {f 7→ STrue }, V 0 ) = (Null, F, V ) and F 00 = F 0 {f 7→ SFalse } BC (e; e0 , F, V ) = BC (e0 , F 00 , V 0 ) where (T, F 0 , V 0 ) = BC (e, F, V ) and T 6= link _ and W if T = variant-tag then F 0 = hl : Fl il∈E and F 00 = l∈E Fl 00 0 else F = F BC (spawn C 0 .m(e), F, V ) = (Null, F 0 , V 0 ) where (Null, F 0 , V 0 ) = BC (e, F, V ) and Null m(Null) ∈ C 0 .session Figure 29: Typechecking: algorithm B. single field typing; the join is always over all of the labels in the variant. This happens in several places in algorithm B, indicated by conditions of the form “if T = variant-tag”, and in the final “else” branch of the third clause of algorithm A. The algorithm for checking subtyping is not described here but is similar to the one defined for channel session types by Gay and Hole [37]. We write S ∨ S 0 for the least upper bound of S and S 0 with respect to subtyping. It is defined by taking the intersection of sets 58 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS class C { session { l i n k t h i s m( i n t ) : h FALSE : SCf , TRUE: SCt i } where SCf = . . . , SCt = . . . ... } class D { session { l i n k t h i s a ( i n t ) : h FALSE : SDf , TRUE: SDt i , l i n k t h i s b ( i n t ) : h FALSE : SDf , TRUE: SDt i , { FALSE , TRUE } c ( i n t ) : SD1 , { FALSE , TRUE, UNKNOWN } d ( i n t ) : SD2 } where SDf = . . . , SDt = . . . , SD1 = . . . , SD2 = . . . f; a ( x ) { / / Not allowed , because r e t u r n t y p e i s l i n k f f ↔ new C ( ) ; f .m( x ) ; } aa ( x ) { / / Allowed , because body t y p e i s l i n k t h i s f ↔ new C ( ) ; switch ( f .m( x ) ) { case FALSE : FALSE ; case TRUE: TRUE; } } b ( x ) { / / Allowed , by c r e a t i n g a u n i f o r m v a r i a n t even ( x ) ; } bb ( x ) { / / Allowed , because body t y p e i s l i n k t h i s switch ( even ( x ) ) { case FALSE : FALSE ; case TRUE: TRUE; } } c ( x ) { / / Allowed , by t a k i n g a j o i n o f f i e l d t y p i n g s f ↔ new C ( ) ; switch ( f .m( x ) ) { case FALSE : FALSE ; case TRUE: TRUE; } } cc ( x ) { / / Allowed , by t a k i n g a j o i n o f equal f i e l d t y p i n g s switch ( even ( x ) ) { case FALSE : FALSE ; case TRUE: TRUE; } } d ( x ) { / / Allowed , because o f s u b t y p i n g between enumerations even ( x ) ; } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 Figure 30: Example for type checking. of methods and the least upper bound of their continuations. Details of a similar definition (greatest lower bound of channel session types) can be found in the work of Mezzina [52]. The type checking algorithm is modular in the sense that to check class C we only need to know the session types of other classes, not their method definitions. MODULAR SESSION TYPES FOR OBJECTS 59 We have not yet investigated type inference, but there are two ways in which it might be beneficial. One would be to infer the req/ens annotations. The other would be to support some form of polymorphism over field typings, along the lines that if method m does not use field f then it should be callable independently of the type of f . This might reduce the need to type check the definition of m every time it occurs in the session type. 8.2. Examples of Type Checking. Figure 30 defines classes C and D. In class C, only the outer layer of the session type is of interest; the example uses an object of class C but does not need the definition of method m. Class D, as well as the outer layer of the session type, contains a field f and one or two candidate definitions for each of the methods a, b, c and d. The definitions of a and aa are alternatives for the method a specified in the session type, and so on. The definition of a is not typable because the type of the returned expression is link f . Allowing this would let the caller of a have access to field f . Instead, the result of f .m(x) must be analyzed with a switch, as in the definition of aa, which is typable. The linkthis type required by the signature of a is introduced by the enumeration labels FALSE and TRUE in the branches of the switch. A compiler could insert switches of this kind automatically, allowing the definition of a as syntactic sugar. The remaining method definitions are all typable and illustrate different features of the type system and the algorithm. In the definition of b, the method even is supposed to be the obvious function for testing parity of an integer, returning TRUE or FALSE. This definition is typable even though the body of b does not introduce a linkthis type, because algorithm A constructs a variant field typing over {TRUE,FALSE} in which both options are the same. This is seen in the first else clause of A. The definition of bb achieves the same effect by using the labels FALSE and TRUE to introduce the type linkthis . Each label corresponds to a partial variant field typing, and checking the switch combines them by means of the ∨ operator. Because the field f is not involved in the method body, the field typing is the same in both options of the variant. Method c has the same definition as a, but this time the signature in the session type specifies a simple enumeration as the return type. This is allowed, by using the ∨ operator to construct the join of the field typings, in the second else clause of A. This means that when the algorithm proceeds to type check method definitions in the session type SD1, the type of f is taken to be the join of SCf and SCt. Whether or not this loss of information causes a problem will depend on the particular definitions of those types, which we have not shown. Method cc is handled in the same way, but this time there is no loss of information because the types being joined are identical; this in turn is because f is not involved in the method body. Finally, method d illustrates straightforward subtyping between enumerations, defined as set inclusion. 8.3. Correctness of the Algorithm. The following sequence of results outlines the proof of soundness and completeness of the algorithm. The detailed proofs are routine and are omitted. Theorem 8.1. Algorithm A always terminates, either with an error (and then the function A is undefined) or with a result. 60 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Proof. Similar to proofs about algorithms for coinductively-defined subtyping relations [63, Chapter 16]. Lemma 8.2. If this : C[F ], V ∗ this B e : variant-tag C this : C[F 0 ], V 0 ∗ this W then for some E and {Fl }l∈E , F 0 = hl : Fl il∈E and this : C[F ], V ∗ this B e : E C this : C[ l∈E Fl ], V 0 ∗ this. Proof. By induction on the typing derivation. Lemma 8.3. If BC (e, F, V ) = (T, F 0 , V 0 ) then this : C[F ], V ∗ this B e : T this : C[F 0 ], V 0 ∗ this. C Proof. By induction on the structure of e. Lemma 8.4. If this : C[F ], V ∗ this B e : T C this : C[F 0 ], V 0 ∗ this and BC (e, F, V ) = (T 0 , F 00 , V 00 ) then V 00 <: V 0 and either (1) T 0 <: T and F 00 <: F 0 , or (2) T = variant-tag, T 0 is an enumeration E, F 0 = hl : Fl il∈E 0 , E ⊆ E 0 and ∀l ∈ E. F 00 <: Fl , or (3) T is an enumeration E, T 0 = variant-tag, F 00 = hl : Fl il∈E 0 , E 0 ⊆ E and ∀l ∈ E 0 . Fl <: F 0 . Proof. By induction on the typing derivation. Theorem 8.5. If F ` C : S then AC (S, F, ∅) is defined. Proof. Consider the execution of AC (S, F, ∅). It terminates and has various calls of the form AC (S 0 , F 0 , ∆), including the top-level call. We prove the following statement, by induction on the number of recursive calls in the execution of AC (S 0 , F 0 , ∆): if ∆ ⊆ • ` C : • and F 0 ` C : S 0 then AC (S 0 , F 0 , ∆) is defined and AC (S 0 , F 0 , ∆) ⊆ • ` C : •. Lemma 8.6. If AC (S, F, ∆) is defined then for any ∆0 , AC (S, F, ∆ ∪ ∆0 ) = AC (S, F, ∆) ∪ ∆0 . Proof. Similar to the proof of Theorem 8.5, by induction on the recursive calls within a given top-level call. Lemma 8.7. Suppose AC (µX.S0 , F0 , ∅) is defined and (F0 , µX.S0 ) 6∈ ∆. Then for all S and F , if AC (S, F, ∆ ∪ {(F0 , µX.S0 )}) is defined then AC (S, F, ∆) is defined. Proof. Similar to the proof of Theorem 8.5, by induction on the recursive calls within a given top-level call. Lemma 8.8. If AC (µX.S, F, ∅) is defined then AC (S{µX.S/X }, F, ∅) is defined. Proof. By the definition of A, AC (µX.S, F, ∅) = AC (S{µX.S/X }, F, {(F, µX.S)}), which is therefore defined. By Lemma 8.7, AC (S{µX.S/X }, F, ∅) is defined. Corollary 8.9. If AC (S, F, ∅) is defined then AC (unfold(S), F, ∅) is defined. Theorem 8.10. If AC (S, F, ∅) is defined then F ` C : S. Proof. By Corollary 8.9 and the fact that F ` C : S is defined in terms of the unfolded structure of session types, it is sufficient to consider the case in which S is guarded. Similarly to the proof of Theorem 8.5, consider the recursive calls in the execution of AC (S0 , F0 , ∅). We show that the following relation is a C-consistency relation: R = {(F, S) | AC (S, F 0 , ∆) is called for some ∆ and F 0 with F <: F 0 }. This is easily checked, using the three cases of Lemma 8.4 to correspond to the three cases in the third clause of the definition of A. MODULAR SESSION TYPES FOR OBJECTS 61 8.4. Implementation. The ideas introduced in this paper can be used to extend a conventional Java compiler, by including @session annotations in classes and in method parameters, as well as @req and @ens annotations for recursive methods (cf. Section 4.5). The extension only concerns type checking; there is no need to touch the back-end of the compiler. To keep in line with the expectations of Java programmers, annotations follow the first style in Figure 1, page 4. Also, the type system is nominal (cf. Section 4.7); label sets (cf. Figure 5) are explicitly introduced via enum declarations. The concepts contained in our core language can then be extended towards the whole of Java. In particular: • The while loop technique described in Section 4.4 can be extended to handle for and do−while loops. • The same idea can be used to type the various goto instructions present in Java: exceptions, break, continue and return, labelled versions included. • All control flow instructions (including if −then, not discussed in the paper) can be used with conventional or with session-related boolean/enum values. • Classes not featuring a @session annotation are considered shared rather than linear. Their objects can be treated very much like the null value (cf. Section 4.6). We do not allow a shared class to contain a linear field, even though it is perfectly acceptable for a method of a shared class to have a linear parameter. • The same technique used for “top-level” classes can be used for inner, nested, local (defined within methods) and anonymous classes. • In order to mention overloaded methods in @session annotations, alias names for these methods can be introduced via extra annotations. • Static fields are always shared. • Class inheritance (cf. Section 4.7) can be supported. We have used the Polyglot [61] system for an initial prototype extension of Java, but a more thorough design and implementation are left for future work. 9. Related Work There is a large amount of related work, originating from several different approaches. Our discussion of related work is organised according to these approaches. Previous work on session types for object-oriented languages. Dezani-Ciancaglini, Yoshida et al. [17, 27, 28, 30] have taken an approach in which a class define sessions instead of methods. Invoking a session on an object creates a channel which is used for communication between two blocks of code: the body of the session, and a co-body defined by the invoker of the session. A session is therefore a generalization of a method, in which there can be an extended dialogue between caller and callee instead of a single exchange of parameters and result. The structure of this dialogue is defined by a session type. This approach proposes a new paradigm for concurrent object-oriented programming, and as far as we know it has not yet been implemented. In contrast, our approach maintains the standard execution model of method calls. The SJ (Session Java) language, developed by Hu [45], is a less radical extension of the object-oriented paradigm. Channels, described by session types, are essentially the same as those in the original work based on process calculus. Program code is located in methods, as usual, and can create channels, communicate on them, and pass them as messages. SJ has a well-developed implementation and has been applied to a range of situations. However, SJ 62 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS has one notable restriction: a channel cannot be stored in a field of an object. This means that a channel, once created, must be either completely used, or else delegated (sent along another channel), within the same method. It is possible for a channel to be passed as a parameter to another method, but it is not possible for a session to be split into methods that can be called separately, each implementing part of the session type of a channel that is stored in a field. A distinctive feature of our work is that we can store a channel in a field of an object and allow several methods to use it. This is illustrated in Figures 18 and 22. Hu et al. [44, 59] have also extended SJ to support event-driven programming, with a session type discipline to ensure safe event handling and progress. We have not considered event-driven programming in our setting. Campos and Vasconcelos [15, 16] developed MOOL, a simple class-based object-oriented language, to study object usage and access. The novelties are that class usage types are attached to class definitions, and the communication mechanism is based on method call instead of being channel-based. The latter feature is the main difference with respect to our work. Non-uniform concurrent objects/active objects. Another related line of research, started by Nierstrasz [60], aimed at describing the behaviour of non-uniform active objects in concurrent systems, whose behaviour (including the set of available methods) may change dynamically. He defined subtyping for active objects, but did not formally define a language semantics or a type system. The topic has been continued, in the context of process calculi, by several authors [13, 14, 21, 22, 56, 57, 65, 66, 67]. The work by Caires [13] is the most relevant work; it uses an approach based on spatial types to give very fine-grained control of resources, and Militão [53] has implemented a Java prototype based on this idea. Damiani et al. [24] define a concurrent Java-like language incorporating inheritance and subtyping and equipped with a type-and-effect system, in which method availability is made dependent on the state of objects. The distinctive feature of our approach to non-uniform objects, in comparison with all of the above work, is that we allow an object’s abstract state to depend on the result of a method call. This gives a very nice integration with the branching structure of channel session types, and with subtyping. Specifically related to the notion of subtyping between session types, the work of Rossie [68] is worth mentioning. He proposes a type-based approach to ensure that both component objects and their clients have compatible protocols. The typing discipline specifies not only how to use the component’s methods, but also the notifications it sends to its clients. Rossie calls this enhanced specification a Logical Observable Entity (LOE), which is a finite-state machine equipped with a subtyping notion. An LOE is a high-level description of an object, specifying which transitions (method executions) change its state, providing for each state both the available methods and notifications to be sent to the clients. LOEs support behavioural subtyping, in its afferent aspects (how clients may affect the LOE) — a subtype must allow at least the traces of its supertype, and in its efferent aspects (how a LOE processing a method request has effects on clients) — the subtype must not send more notifications than the supertype. This behavioural subtyping notion on finite-state machines, which is in its spirit very similar to the one of session types — "more offers, less requests", is defined as a simulation relation. Rossie shows that this relation ensures safe substitutability. Typestate. Based on the fact that method availability depends on an object’s internal state (the situation identified by Nierstrasz, as mentioned above), Strom and Yemini [69] proposed MODULAR SESSION TYPES FOR OBJECTS 63 typestate. The concept consists of identifying the possible states of an object and defining pre- and post-conditions that specify in which state an object should be so that a given method would be available, and in which state the method execution would leave the object. Vault [25, 32] follows the typestate approach. It uses linear types to control aliasing, and uses the adoption and focus mechanism [32] to re-introduce aliasing in limited situations. Fugue [26, 33] extends similar ideas to an object-oriented language, and uses explicit preand post-conditions. Bierhoff and Aldrich [7] also work on a typestate approach in an object-oriented language, defining a sound modular automated static protocol-checking setting. They define a state and method refinement relation achieving a behavioural subtyping relation. The work is extended with access permissions, that combine typestate with aliasing information about objects [8], and with concurrency, via the atomic block synchronization primitive used in transactional memory systems [5]. Like us, they allow the typestate to depend on the result of a method call. Plural is a prototype language implementation that embodies this approach, providing automated static analysis in a concurrent object-oriented language [9]. To evaluate their approach they annotated and verified several standard Java APIs [10]. Militão et al. [54] develop a new aliasing control mechanism, finer and more expressive than previous proposals, based on defining object views according to specific access constraints. The discipline is implemented in a type system combining views and a typestate approach, checking user defined aliasing patterns. Sing# [31] is an extension of C# which has been used to implement Singularity, an operating system based on message-passing. It incorporates session types to specify protocols for communication channels, and introduces typestate-like contracts. Bono et al. [12] have formalised a core calculus based on Sing# and proved type safety. A technical point is that Sing# uses a single construct switch receive to combine receiving an enumeration value and doing a case-analysis, whereas our system allows a switch on an enumeration value to be separated from the method call that produces it. Aldrich et al. [1] have proposed typestate-oriented programming. The aim is to integrate typestate into language design from the beginning, instead of adding typestate constraints to an existing language. Their prototype language is called Plaid. Instead of class definitions, a program consists of state definitions; each state has methods which cause transitions to other states when they are called. Like classes, states are organised into an inheritance hierarchy. The specifications of state transitions caused by methods are similar to the preand post-conditions of Plural. Aliasing is managed by a system of access permissions [8]. More recent work [35, 75] combines gradual typing and typestate, to integrate static and dynamic typestate checking. Session types and typestate are related approaches, but there are stylistic and technical differences. With respect to the former, session types are like labelled transition systems or finite-state automata, capturing the behaviour of an object. When developing an application, one may start from session types and then implement the classes. Typestates take each transition of a session type and attach it to a method as pre- and post-conditions. Because typestate systems allow pre- and post-conditions to be specified arbitrarily, the possible sequences of method calls are less explicit. With respect to technical differences, the main ones are: (a) session types unify types and typestates in a single class type as a global behavioural specification; (b) our subtyping relation is structural, while the typestates refinement relation is nominal; (c) Plural uses a software transactional model as concurrency control mechanism (thus, shared memory), which is lighter and easier than locks, but one has to mark atomic 64 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS blocks in the code, whereas our communication-centric model (using channels) is simpler and allows us to use the same type abstraction (session types) instead of a new programming construct; moreover, channel-based communication also allows us to specify the client-server communication protocol as the channel session type, and to implement it modularly, in several methods which may even be in different classes; (d) typestate approaches allow flexible aliasing control, whereas our approach uses only linear objects (to add better alias/access control is simple and an orthogonal issue). Affine types. Tov and Pucella [71] have developed Alms, a language in the style of OCaml with an affine type system as a generalisation of linear typing. Alms is a general-purpose programming language, in which the affine type system provides an infrastructure suitable for defining a variety of type-based resource control patterns including alias control, session types and typestate. It has been implemented, and type safety has been proved for a formal calculus. Representing a particular approach to typestate, such as our specifications of allowed sequences of method calls, would require an encoding; in contrast, our language aims to provide a convenient high-level programming style. Static verification of protocols. Cyclone [40] and CQual [34] are systems based on the C programming language that allow protocols to be statically enforced by a compiler. Cyclone adds many benefits to C, but its support for protocols is limited to enforcing locking of resources. Between acquiring and releasing a lock, there are no restrictions on how a thread may use a resource. In contrast, our system uses types both to enforce locking of objects (via linearity) and to enforce the correct sequence of method calls. CQual expects users to annotate programs with type qualifiers; its type system, simpler and less expressive than the above, provides for type inference. Unique ownership of objects. In order to demonstrate the key idea of modularizing session implementations by integrating session-typed channels and non-uniform objects, we have taken the simplest possible approach to ownership control: strict linearity of non-uniform objects. This idea goes back at least to the work of Baker [4] and has been applied many times. However, linearity causes problems of its own: linear objects cannot be stored in shared data structures, and this tends to restrict expressivity. There is a large literature on less extreme techniques for static control of aliasing: Hogg’s Islands [41], Almeida’s balloon types [2], Clarke et al.’s ownership types [20], Fähndrich and DeLine’s adoption and focus [32], Östlund et al.’s Joe3 [62] among others. In future work we intend to use an off-the-shelf technique for more sophisticated alias analysis. The property we need is that when changing the type of an object (by calling a method on it or by performing a switch or a while on an enumeration constant returned from a method call) there must be a unique reference to it. Resource usage analysis. Igarashi and Kobayashi [48] define a general resource usage analysis problem for an extended λ-calculus, including a type inference system, that statically checks the order of resource usage. Although quite expressive, their system only analyzes the sequence of method calls and does not consider branching on method results as we do. Analysis of concurrent systems using pi-calculus. Some work on static analysis of concurrent systems expressed in pi-calculus is also relevant, in the sense that it addresses the question MODULAR SESSION TYPES FOR OBJECTS 65 (among others) of whether attempted uses of a resource are consistent with its state. Igarashi and Kobayashi have developed a generic framework [47] including a verification tool [49] in which to define type systems for analyzing various behavioural properties including sequences of resource uses [50]. In some of this work, types are themselves abstract processes, and therefore in some situations resemble our session types. Chaki at al. [19] use CCS to describe properties of pi-calculus programs, and verify the validity of temporal formulae via a combination of type-checking and model-checking techniques, thereby going beyond static analysis. All of this pi-calculus-based work follows the approach of modelling systems in a relatively low-level language which is then analyzed. In contrast, we work directly with the high-level abstractions of session types and objects. 10. Conclusion We have extended existing work on session types for object-oriented languages by allowing the implementation of a session to be divided between several methods which can be called independently. This supports a modular approach which is absent from previous work. Technically, it is achieved by integrating session types for communication channels and a static type system for non-uniform objects. A session-typed channel is one kind of nonuniform object, but objects whose fields are non-uniform are also, in general, non-uniform. Typing guarantees that the sequence of messages on every channel, and the sequence of method calls on every non-uniform object, satisfy specifications expressed as session types. We have formalized the syntax, operational semantics and static type system of a core distributed class-based object-oriented language incorporating these ideas. Soundness of the type system is expressed by type preservation, conformance and correct communication theorems. The type system includes a form of typestate and uses simple linear type theory to guarantee unique ownership of non-uniform objects. It allows the typestate of an object after a method call to depend on the result of the call, if this is of an enumerated type, and in this situation, the necessary case-analysis of the method result does not need to be done immediately after the call. We have illustrated our ideas with an example based on a remote file server, and described a prototype implementation. By incorporating further standard ideas from the related literature, it should be straightforward to extend the implementation to a larger and more practical language. In the future we intend to work on the following topics. (1) More flexible control of aliasing. The mechanism for controlling aliasing should be orthogonal to the theory of how operations affect uniquely-referenced objects. We intend to adapt existing work to relax our strictly linear control and obtain a more flexible language. (2) In Section 4.7 we outlined an adaptation of our structural type system to a nominal type system as found in languages such as Java. We would also like to account for Java’s distinction and relationship between classes and interfaces. (3) Specifications involving several objects. Multi-party session types [11, 42] and conversation types [14] specify protocols with more than two participants. It would be interesting to adapt those theories into type systems for more complex patterns of object usage. Acknowledgements 66 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS We thank Jonathan Aldrich and Luís Caires for helpful discussions. Gay was partially supported by the UK EPSRC (EP/E065708/1 “Engineering Foundations of Web Services”, EP/F037368/1 “Behavioural Types for Object-Oriented Languages”, EP/K034413/1 “From Data Types to Session Types: A Basis for Concurrency and Distribution” and EP/L00058X/1 “Exploiting Parallelism through Type Transformations for Hybrid Manycore Systems”). He thanks the University of Glasgow for the sabbatical leave during which part of this research was done. Gay and Ravara were partially supported by the Security and Quantum Information Group at Instituto de Telecomunicações, Portugal. Vasconcelos was partially supported by the Large-Scale Informatics Systems Laboratory, Portugal. Ravara was partially supported the Portuguese Fundação para a Ciência e a Tecnologia FCT (SFRH/BSAB/757/2007), and by the UK EPSRC (EP/F037368/1). Gesbert was supported by the UK EPSRC (EP/E065708/1) and by the French ANR (project ANR-08-EMER-004 “CODEX”). All of the authors have received support from COST Action IC1201 “Behavioural Types for Reliable Large-Scale Software Systems”. References [1] J. Aldrich, J. Sunshine, D. Saini, and Z. Sparks. Typestate-oriented programming. In Proceedings of Onward!, 2009. [2] P. S. Almeida. Balloon types: Controlling sharing of state in data types. In Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP), volume 1241 of Lecture Notes in Computer Science, pages 32–59. Springer, 1997. [3] D. Ancona, V. Bono, M. Bravetti, J. Campos, P.-M. Deniélou, N. Gesbert, E. Giachino, R. Hu, E. B. Johnsen, F. Martins, V. Mascardi, F. Montesi, N. Ng, R. Neykova, L. Padovani, and V. T. Vasconcelos. BETTY WG3 – Languages: State of the Art Report. Report of the EU COST Action IC1201 – Behavioural Types for Reliable Large-Scale Software Systems. www.behavioural-types.eu/publications/WG3-State-of-the-Art.pdf, 2014. [4] H. G. Baker. ‘Use-once’ variables and linear objects — storage management, reflection and multithreading. ACM SIGPLAN Notices, 30(1):45–52, 1995. [5] N. E. Beckman, K. Bierhoff, and J. Aldrich. Verifying correct usage of atomic blocks and typestate. In Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 227–244. ACM, 2008. [6] G. Bernardi, 2014. Private communication. [7] K. Bierhoff and J. Aldrich. Lightweight object specification with typestates. In Proceedings of the 13th ACM SIGSOFT Symposium on Foundations of Software Engineering (FSE), pages 217–226. ACM, 2005. [8] K. Bierhoff and J. Aldrich. Modular typestate checking of aliased objects. In Proceedings of the 22nd ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 301–320. ACM, 2007. [9] K. Bierhoff and J. Aldrich. PLURAL: checking protocol compliance under aliasing. In Companion of the 30th International Conference on Software Engineering (ICSE), pages 971–972. ACM, 2008. [10] K. Bierhoff, N. E. Beckman, and J. Aldrich. Practical API protocol checking with access permissions. In Proceedings of the 23rd European Conference on Object-Oriented Programming (ECOOP), volume 5653 of Lecture Notes in Computer Science, pages 195–219. Springer, 2009. [11] E. Bonelli and A. Compagnoni. Multipoint Session Types for a Distributed Calculus. In Proceedings of the 3rd International Symposium on Trustworthy Global Computing (TGC), volume 4912 of Lecture Notes in Computer Science, pages 240–256. Springer, 2007. [12] V. Bono, C. Messa, and L. Padovani. Typing copyless message passing. In Proceedings of ESOP, number 6602 in LNCS, pages 57–76, 2011. [13] L. Caires. Spatial-behavioral types for concurrency and resource control in distributed systems. Theoretical Computer Science, 402(2–3):120–141, 2008. [14] L. Caires and H. T. Vieira. Conversation types. Theoretical Computer Science, 411(51–52):4399–4440, 2010. MODULAR SESSION TYPES FOR OBJECTS 67 [15] J. Campos. Linear and shared objects in concurrent programming. Master’s thesis, University of Lisbon, 2010. [16] J. Campos and V. T. Vasconcelos. Channels as objects in concurrent object-oriented programming. In Proceedings of the 3rd International Workshop on Programming Language Approaches to Concurrency and Communication-cEntric Software (PLACES), Electronic Proceedings in Theoretical Computer Science (EPTCS), 2010. To appear. [17] S. Capecchi, M. Coppo, M. Dezani-Ciancaglini, S. Drossopoulou, and E. Giachino. Amalgamating sessions and methods in object-oriented languages with generics. Theoretical Computer Science, 410(2–3):142–167, 2009. [18] M. Carbone, K. Honda, and N. Yoshida. Structured global programming for communication behaviour. In Proceedings of the 16th European Symposium on Programming Languages and Systems (ESOP), volume 4421 of Lecture Notes in Computer Science, pages 2–17. Springer, 2007. [19] S. Chaki, S. K. Rajamani, and J. Rehof. Types as models: model checking message-passing programs. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 45–57. ACM, 2002. [20] D. G. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. In Proceedings of the 13th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 48–64. ACM, 1998. [21] J.-L. Colaço, M. Pantel, F. Dagnat, and P. Sallé. Safety analysis for non-uniform service availability in Actors. In Proceedings of the IFIP TC6/WG6.1 3rd International Conference on Formal Methods for Open Object-Based Distributed Systems (FMOODS), volume 139 of IFIP Conference Proceedings. Kluwer, 1999. [22] J.-L. Colaço, M. Pantel, and P. Sallé. A set-constraint-based analysis of Actors. In Proceedings of the IFIP TC6/WG6.1 International Workshop on Formal Methods for Open Object-Based Distributed Systems (FMOODS), pages 107–122. Chapman & Hall, 1997. [23] L. Cruz-Filipe, I. Lanese, F. Martins, A. Ravara, and V. T. Vasconcelos. The stream-based service-centered calculus: a foundation for service-oriented programming. Formal Aspects of Computing, 26:865–918, 2014. [24] F. Damiani, E. Giachino, P. Giannini, and S. Drossopoulou. A type safe state abstraction for coordination in Java-like languages. Acta Informatica, 45(7–8):479–536, 2008. [25] R. DeLine and M. Fähndrich. Enforcing high-level protocols in low-level software. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 59–69. ACM, 2001. [26] R. DeLine and M. Fähndrich. The Fugue protocol checker: is your software Baroque? Technical Report MSR-TR-2004-07, Microsoft Research, 2004. [27] M. Dezani-Ciancaglini, S. Drossopoulou, E. Giachino, and N. Yoshida. Bounded session types for object-oriented languages. In Proceedings of the 5th International Symposium on Formal Methods for Components and Objects (FMCO 2006), volume 4709 of Lecture Notes in Computer Science, pages 207–245. Springer, 2007. [28] M. Dezani-Ciancaglini, S. Drossopoulou, D. Mostrous, and N. Yoshida. Objects and session types. Information and Computation, 207(5):595–641, 2009. [29] M. Dezani-Ciancaglini, D. Mostrous, N. Yoshida, and S. Drossopolou. Session types for object-oriented languages. In Proceedings of the 20th European Conference on Object-Oriented Programming (ECOOP), volume 4067 of LNCS, pages 328–352. Springer, 2006. [30] M. Dezani-Ciancaglini, N. Yoshida, A. Ahern, and S. Drossopolou. A distributed object-oriented language with session types. In Proceedings of the International Symposium on Trustworthy Global Computing (TGC), volume 3705 of Lecture Notes in Computer Science, pages 299–318. Springer, 2005. [31] M. Fähndrich, M. Aiken, C. Hawblitzel, O. Hodson, G. Hunt, J. R. Larus, and S. Levi. Language support for fast and reliable message-based communication in Singularity OS. In EuroSys, pages 177–190. ACM, 2006. [32] M. Fähndrich and R. DeLine. Adoption and focus: practical linear types for imperative programming. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 13–24. ACM, 2002. 68 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS [33] M. Fähndrich and R. DeLine. Typestates for objects. In Proceedings of the 13th European Symposium on Programming Languages and Systems (ESOP), volume 3086 of Lecture Notes in Computer Science, pages 465–490. Springer, 2004. [34] J. S. Foster, T. Terauchi, and A. Aiken. Flow-sensitive type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 1–12. ACM, 2002. [35] R. Garcia, E. Tanter, R. Wolff, and J. Aldrich. Foundations of typestate-oriented programming. ACM Transactions on Programming Languages and Systems, 2014. [36] S. Gay, V. T. Vasconcelos, A. Ravara, N. Gesbert, and A. Z. Caldeira. Modular session types for distributed object-oriented programming. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 299–312. ACM, 2010. [37] S. J. Gay and M. J. Hole. Subtyping for session types in the pi calculus. Acta Informatica, 42(2/3):191–225, 2005. [38] S. J. Gay, A. Ravara, and V. T. Vasconcelos. Session types for inter-process communication. Technical Report TR-2003-133, Department of Computing Science, University of Glasgow, 2003. [39] S. J. Gay and V. T. Vasconcelos. Linear type theory for asynchronous session types. Journal of Functional Programming, 20(1):19–50, 2010. [40] D. Grossman, G. Morrisett, T. Jim, M. Hicks, Y. Wang, and J. Cheney. Region-based memory management in Cyclone. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 282–293. ACM, 2002. [41] J. Hogg. Islands: aliasing protection in object-oriented languages. In Proceedings of the 6th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 271–285. ACM, 1991. [42] K. Honda, N. Yoshida, and M. Carbone. Multiparty asynchronous session types. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 273–284. ACM, 2008. [43] K. Honda, V. Vasconcelos, and M. Kubo. Language primitives and type discipline for structured communication-based programming. In Proceedings of the 7th European Symposium on Programming Languages and Systems (ESOP), volume 1381 of Lecture Notes in Computer Science, pages 122–138. Springer, 1998. [44] R. Hu, D. Kouzapas, O. Pernet, N. Yoshida, and K. Honda. Type-safe eventful sessions in Java. In Proceedings of the 24th European Conference on Object-Oriented Programming (ECOOP), volume 6183 of Lecture Notes in Computer Science, pages 329–353. Springer, 2010. [45] R. Hu, N. Yoshida, and K. Honda. Session-based distributed programming in Java. In Proceedings of the 22nd European Conference on Object-Oriented Programming (ECOOP), volume 5142 of Lecture Notes in Computer Science, pages 516–541. Springer, 2008. [46] H. Hüttel, I. Lanese, V. T. Vasconcelos, L. Caires, M. Carbone, P.-M. Deniélou, D. Mostrous, L. Padovani, A. Ravara, E. Tuosto, H. T. Vieira, and G. Zavattaro. Foundations of behavioural types. Report of the EU COST Action IC1201 – Behavioural Types for Reliable Large-Scale Software Systems. www.behavioural-types.eu/publications/WG1-State-of-the-Art.pdf, 2014. [47] A. Igarashi and N. Kobayashi. A generic type system for the pi-calculus. Theoretical Computer Science, 311(1–3):121–163, 2004. [48] A. Igarashi and N. Kobayashi. Resource usage analysis. ACM Transactions on Programming Languages and Systems, 27(2):264–313, 2005. [49] N. Kobayashi. Type-based information flow analysis for the pi-calculus. Acta Informatica, 42(4–5):291– 347, 2005. [50] N. Kobayashi, K. Suenaga, and L. Wischik. Resource usage analysis for the π-calculus. Logical Methods in Computer Science, 2(3:4):1–42, 2006. [51] B. Liskov and J. M. Wing. A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems, 16(6):1811–1841, 1994. [52] L. G. Mezzina. Typing Services. PhD thesis, IMT Institute for Advanced Studies, Lucca, Italy, 2009. [53] F. Militão. Design and implementation of a behaviorally typed programming system for web services. Master’s thesis, New University of Lisbon, 2008. [54] F. Militão, J. Aldrich, and L. Caires. Aliasing control with view-based typestate. In Proceedings of the 12th Workshop on Formal Techniques for Java-Like Programs (FTfJP). ACM, 2010. MODULAR SESSION TYPES FOR OBJECTS 69 [55] D. Mostrous and V. T. Vasconcelos. Session typing for a featherweight erlang. In Proceedings of the 13th International Conference on Coordination Models and Languages (COORDINATION’11), volume 6721 of Lecture Notes in Computer Science, pages 95–109. Springer, 2011. [56] E. Najm, A. Nimour, and J.-B. Stefani. Guaranteeing liveness in an object calculus through behavioral typing. In Proceedings of the IFIP TC6 WG6.1 Joint International Conference on Formal Description Techniques for Distributed Systems and Communication Protocols (FORTE XII) and Protocol Specification, Testing and Verification (PSTV XIX), pages 203–221. Kluwer, 1999. [57] E. Najm, A. Nimour, and J.-B. Stefani. Infinite types for distributed object interfaces. In Proceedings of the IFIP TC6 WG6.1 3rd International Conference on Formal Methods for Open Object-Based Distributed Systems (FMOODS), volume 139 of IFIP Conference Proceedings. Kluwer, 1999. [58] M. Neubauer and P. Thiemann. An implementation of session types. In Proceedings of the 6th International Symposium on Practical Aspects of Declarative Languages (PADL), volume 3057 of Lecture Notes in Computer Science, pages 56–70. Springer, 2004. [59] N. Ng, N. Yoshida, O. Pernet, R. Hu, and Y. Kryftis. Safe parallel programming with session java. In Proceedings of the 13th International Conference on Coordination Models and Languages (COORDINATION’11), volume 6721 of Lecture Notes in Computer Science, pages 110–126. Springer, 2011. [60] O. Nierstrasz. Regular types for active objects. In Object-Oriented Software Composition, pages 99–121. Prentice Hall, 1995. [61] N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: an extensible compiler framework for Java. In Proceedings of the 12th International Conference on Compiler Construction (CC), volume 2622 of Lecture Notes in Computer Science, pages 138–152. Springer, 2003. [62] J. Östlund, T. Wrigstad, D. Clarke, and B. Åkerblom. Ownership, uniqueness and immutability. In Objects, Components, Models and Patterns: 46th International Conference, TOOLS EUROPE, volume 11 of Lecture Notes in Business Information Processing, pages 178–197. Springer, 2008. [63] B. C. Pierce. Types and Programming Languages. MIT Press, 2002. [64] R. Pucella and J. A. Tov. Haskell session types with (almost) no class. In Proceedings of the 1st ACM SIGPLAN Symposium on Haskell, pages 25–36. ACM, 2008. [65] F. Puntigam. State inference for dynamically changing interfaces. Computer Languages, 27:163–202, 2002. [66] F. Puntigam and C. Peter. Types for active objects with static deadlock prevention. Fundamenta Informaticæ, 49:1–27, 2001. [67] A. Ravara and V. T. Vasconcelos. Typing non-uniform concurrent objects. In Proceedings of the 11th International Conference on Concurrency Theory (CONCUR), volume 1877 of Lecture Notes in Computer Science, pages 474–488. Springer, 2000. [68] J. G. Rossie, Jr. Logical observable entities. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 154–165. ACM, 1998. [69] R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Transactions on Software Engineering, 12(1):157–171, 1986. [70] K. Takeuchi, K. Honda, and M. Kubo. An interaction-based language and its typing system. In Proceedings of the 6th International Conference on Parallel Architectures and Langauges Europe (PARLE), volume 817 of Lecture Notes in Computer Science, pages 398–413. Springer, 1994. [71] J. A. Tov and R. Pucella. Practical affine types. In Proceedings of POPL, 2011. [72] A. Vallecillo, V. T. Vasconcelos, and A. Ravara. Typing the behavior of software components using session types. Fundamenta Informaticæ, 73(4):583–598, 2006. [73] V. T. Vasconcelos, S. J. Gay, and A. Ravara. Type checking a multithreaded functional language with session types. Theoretical Computer Science, 368(1–2):64–87, 2006. [74] V. T. Vasconcelos, S. J. Gay, A. Ravara, N. Gesbert, and A. Z. Caldeira. Dynamic interfaces. Presented at the International Workshop on Foundations of Object-Oriented Languages (FOOL), 2009. [75] R. Wolff, R. Garcia, E. Tanter, and J. Aldrich. Gradual typestate. In Proceedings of ECOOP, 2011. [76] A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994. 70 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Appendix: Proofs of lemmas from Section 7.1 Lemma 7.1. Suppose Θ ` h : Γ. Then (a) h is complete, (b) chans(Γ) ⊆ dom(Θ) \ chans(h) and (c) objs(Γ) ⊆ roots(h). Proof. By induction on the derivation of Θ ` h : Γ. The only axiom is T-Hempty for which the properties are true. Then T-Hide does not change either h or dom(Γ) so it preserves all three properties. The other case is T-Hadd. Let h0 be the heap in the conclusion. Then childrenh0 (o) is the set of vi which are object identifiers. Let K be the set of vi which are channel endpoints. The typing derivation for the sequence of swaps in the right premise must include an occurrence of T-Ref for each object identifier, and of T-Chan for each channel endpoint, each followed by T-Swap and a number of occurrences of T-Seq. Looking at these rules, we can see that this implies: (1) childrenh0 (o) ∪ K ⊆ dom(Γ) and (2) dom(Γ0 ) ⊆ (dom(Γ) \ (childrenh0 (o) ∪ K)) ∪ {o}. (Note that o cannot be one of the vi because it is the current object in the judgement: the premise of T-Ref forbids it.) From (1) and induction hypothesis (c) we get childrenh0 (o) ⊆ roots(h). We have roots(h) ⊆ dom(h) ⊆ dom(h0 ) and o is the only new object in h0 , so h0 is complete. If we project (2) onto just channel endpoints, we get chans(Γ0 ) ⊆ chans(Γ) \ K. From the definition of h0 , chans(h0 ) is equal to chans(h) ∪ K. Hence induction hypothesis (b) yields (b) again for h0 . If we project (2) onto just object identifiers, we get objs(Γ0 ) ⊆ (objs(Γ)\childrenh0 (o))∪{o}. From induction hypothesis (a) and the fact that o 6∈ dom(h) we get that o is a root in h0 . Furthermore, all roots of h which are not children of o are also roots of h0 . Thus induction hypothesis (c) allows us to conclude objs(Γ0 ) ⊆ roots(h0 ). Lemma 7.2 (Rearrangement of typing derivations for expressions). Suppose we have Γ ∗ r B e : T C Γ0 ∗ r0 . Then there exists a typing derivation for this judgement in which: (1) T-Sub only occurs at the very end, just before T-Switch or T-SwitchLink as the last rule in the derivation for each of the branches, or just before T-Call as the last rule in the derivation for the parameter; (2) T-SubEnv only occurs immediately before T-Sub in the first three cases and does not occur at all in the fourth, i.e. T-Call. Proof. First note that T-Sub and T-SubEnv commute and that any consecutive sequence of occurrences of one of these rules can collapse into a single occurrence using transitivity. What remains to be shown is that these rules can be pushed down in all cases but those mentioned in the statement. We enumerate the cases below. • T-Swap. T-Sub before the premise can be replaced with T-SubEnv after the conclusion as T has been transferred to the environment. If T-SubEnv was used before the premise, it means the initial derivation looks like: Γ ∗ r B e : T C Γ0 ∗ r0 (T-SubEnv) Γ ∗ r B e : T C Γ00 ∗ r0 Γ00 (r0 .f ) = T 0 ... (T-Swap) Γ ∗ r B f ↔ e : T 0 C Γ00 {r0 .f 7→ T } ∗ r0 with Γ0 <: Γ00 . Let T0 = Γ0 (r0 .f ); we have T0 <: T 0 since T 0 = Γ00 (r0 .f ). Because the type of r0 .f moves from the environment to the expression, when we push the subsumption step down, we have to use both T-SubEnv and T-Sub; we can transform the derivation into: MODULAR SESSION TYPES FOR OBJECTS 71 Γ ∗ r B e : T C Γ0 ∗ r0 Γ0 (r0 .f ) = T0 ... (T-Swap) 0 0 0 Γ ∗ r B f ↔ e : T0 C Γ {r .f 7→ T } ∗ r (T-SubEnv) Γ ∗ r B f ↔ e : T0 C Γ00 {r0 .f 7→ T } ∗ r0 (T-Sub) Γ ∗ r B f ↔ e : T 0 C Γ00 {r0 .f 7→ T } ∗ r0 • T-Call. If T-SubEnv is used on the premise to increase the type of something else than r0 .f it can be moved to the conclusion. If the type of r0 .f is changed, first note that the only relevant part is the signature of mj . Suppose the subsumption step changes it from Uj mj (Uj0 ) : Sj0 to Tj mj (Tj0 ) : Sj . For the parameter type we have Tj0 <: Uj0 so we can use T-Sub on the premise to increase the type of e from Tj0 to Uj0 instead. For the session and result types, we have two cases: – if Uj <: Tj and Sj0 <: Sj it can just be moved to a T-SubEnv step on the conclusion. – if Uj = E, Tj = variant-tag and hl : Sj0 il∈E <: Sj , then the original conclusion of the rule (with T-SubEnv on the premise) was: Γ ∗ r B f.mj (e) : link f C Γ0 {r0 .f 7→ Sj } ∗ r0 and the new one with the subsumption step removed is: Γ ∗ r B f.mj (e) : E C Γ0 {r0 .f 7→ Sj0 } ∗ r0 . • • • • • So in that case the original judgement can be obtained back from this new conclusion using T-VarS followed by T-SubEnv. T-Seq. T-Sub on the first premise is irrelevant and T-SubEnv on the same premise can be removed using Lemma 3.15. Subsumption on the second premise straightforwardly commutes to the conclusion. T-Switch. Lemma 3.15 allows us to remove T-SubEnv on the first premise. Straightforwardly T-Sub can be removed as well as it just makes E 0 smaller. T-SwitchLink. T-Sub is irrelevant; removing T-SubEnv can only make E 0 and the initial typing environments for the branches smaller and we can use Lemma 3.15. T-VarF and T-VarS. T-Sub can increase E which becomes the indexing set of the variant in the conclusion. By definition of subtyping for variants it is possible to increase it afterwards using T-SubEnv. T-SubEnv straightforwardly commutes. T-Return. T-Sub straightforwardly commutes, as well as the part of T-SubEnv not concerning r0 .f . Subsumption on Γ0 (r0 .f ) can be removed using Proposition 3.16. Lemma 7.3 (Rearrangement of typing derivations for heaps). Suppose Θ ` h : Γ holds. Let o be an arbitrary root of h. Then there exists a typing derivation for it such that: (1) T-Sub is never used; (2) T-SubEnv is used at most once, as the last rule leading to the right premise of the last occurrence of T-Hadd; (3) every occurrence of T-Hide follows immediately the occurrence of T-Hadd concerning the same object identifier; (4) the occurrence of T-Hadd concerning an identifier o0 is always immediately preceded (on the left premise) by the occurrences of T-Hadd/T-Hide concerning the descendants of o0 ; (5) the first root added is o. Proof. The first two points are a consequence of Lemma 7.2: the only expressions which appear in the typing derivation are sequences of swaps, not containing any switch or method 72 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS call; furthermore their type is always Null, making T-Sub at the end irrelevant. What remains to be checked is then just that T-SubEnv at the end of the derivation for one sequence of swaps can be pushed down to the next occurrence of T-Hadd whenever there is one. This is just a matter of using Proposition 3.16 in the case of T-Hide and Lemma 3.15 in the case of T-Hadd. Note that these points imply in particular that in all applications of T-Hadd but the last one, any element in dom(Γ) which is not one of the vi also occurs in Γ0 with exactly the same type. For the third point, first notice that the premise of T-Hide implies o is a root of h because of Lemma 7.1. This implies that the rule immediately above T-Hide either is a T-Hadd introducing o or does not concern o at all (in particular, o cannot be a vi , otherwise it would not be a root in the conclusion). In the second case, T-Hide can be pushed upwards. The fourth and fifth points are a consequence of the remark we made about the first two: if o0 is not a descendant of o nor vice-versa, then the occurrences of T-Hadd and T-Hide concerning o and its descendants commute with those concerning o0 and its descendants as they affect completely disjoint parts of the environment. In the case of the last occurrence of T-Hadd there may be a subsumption step but it is still possible to commute with it by pushing this subsumption step down again. Lemma 7.4 (Splitting of the heap). Suppose Θ ` h : Γ, o : T . Let Θ1 = Θ \ chans(h ↓ o) and let Θ2 be Θ restricted to chans(h ↓ o). Then we have: Θ1 ` (h ↑ o) : Γ and Θ2 ` (h ↓ o) : o : T . Proof. We know from Lemma 7.1 that o is a root in h. We consider the particular derivation given by Lemma 7.3 where o is the first root added to the heap. Now if we look at the conclusion of the last rule concerning o (T-Hadd or T-Hide depending whether T is a field or session type), we know that at this point the heap is h ↓ o, and therefore the only object identifier in the environment is its only root: o. Furthermore, this part of the derivation is still true if we replace the initial Θ with Θ2 , with the only difference that then the final Γ contains no channels, and thus is of the form o : T 0 . We also know that the type of o is not changed in the rest of the derivation except possibly by the subsumption step at the end; therefore T 0 is a subtype of T . If they are session types, using Proposition 3.18 we can change the last occurrence of T-Hide to use T instead of T 0 and get Θ2 ` (h ↓ o) : o : T . Otherwise, we can add a subsumption step to the derivation for the sequence of swaps on the right of T-Hadd to get the same result. For the rest of the derivation, we know that o is not used, therefore it can be removed from the initial environment without affecting the derivation except by the fact that it will not be in the final environment either. Furthermore, we know from Lemma 7.1 that the initial environment minus its only object identifier o is included in Θ \ chans(h ↓ o) = Θ1 . More precisely, the lemma gives us inclusion of domains, but because subsumption is not used in the first part of the derivation we also know that the types are the same. Thus we can replace the first part of the derivation by an instance of T-Hempty using Θ1 and the second part is still valid (with all the descendants of o removed from the heap), yielding Θ1 ` (h ↑ o) : Γ at the bottom. Lemma 7.5 (Merging of heaps). Suppose Θ ` h : Γ and Θ0 ` h0 : Γ0 with dom(h)∩dom(h0 ) = ∅ and dom(Θ) ∩ dom(Θ0 ) = ∅. Then we have Θ + Θ0 ` h + h0 : Γ + Γ0 . Proof. Since Θ and Θ0 are disjoint, the channels in Θ0 cannot appear anywhere in the typing derivation for h. Thus, it is possible to add Θ0 to every typing environment occurring in MODULAR SESSION TYPES FOR OBJECTS 73 the derivation for h without altering its validity, yielding Θ + Θ0 ` h : Γ + Θ0 . Looking now at the derivation for h0 , since the domains of the heaps are disjoint and objs(Γ) ⊆ roots(h), none of the identifiers in Γ can appear anywhere in it. Thus we can add Γ to every typing environment and h to every heap occurring in the derivation for h0 , replacing the T-Hempty at the top with the conclusion of the other derivation, which yields the result we want. Lemma 7.6. Suppose Θ ` h : o : S. Let ϕ be an injective function from dom(h) to O. Then we have Θ ` ϕ(h) : ϕ(o) : S. Proof. Straightforward. Changing the names does not affect the typing derivation in any way. Lemma 7.7 (Opening). If Θ ` h : Γ, if Γ(r) is a branch session type S and if h(r) is an object identifier o, then we know from Lemma 7.1 that h contains an entry for o. Let C be the class of this entry, then there exists a field typing F for C such that Θ ` h : Γ{r 7→ C[F ]} and F ` C : S. Proof. We prove this by induction on the depth of r. The base case is r = o. Using Lemmas 7.4 and 7.5, we can restrict ourselves to the case where o is the only root of h. In that case we know that the last rule used in the typing derivation for Θ ` h : o : S must be T-Hide. The result we want is constituted precisely by the premises of that rule. For the inductive case, r is of the form o0 .f.f~. We consider the case where o0 is the only root. The typing derivation then ends with T-Hadd and f gets populated in the sequence of swaps by some object identifier2 o00 . Let r0 = o00 .f~, and consider what Γ(r0 ) can be, knowing that in the conclusion r has a branch session type: the only way the type can be modified in the sequence of swaps is by subsumption. Indeed, T-VarS, the other possibility, introduces a variant type. Therefore Γ(r0 ) = S 0 with S 0 <: S. We can thus use the induction hypothesis to replace Γ with Γ{r 7→ C[F ]} on the left premise, with F ` C : S 0 . Then just use Proposition 3.18 to see that we also have F ` C : S and see that the type yielded in the conclusion by this new premise is what we want. Lemma 7.8 (Closing). If Θ ` h : Γ and Γ(r) = C[F ] and F ` C : S, then Θ ` h : Γ{r 7→ S}. Proof. Again we prove this by induction on the depth of r and the base case is r = o. In that case the lemma is nothing more than T-Hide. The inductive case is very similar to the above: we look at the type of r0 (defined as above) in the Γ on the left premise of the last T-Hadd, noticing that the type of r in the conclusion can only differ from it by subsumption, this time because we know from Lemma 3.28 that T-VarF is never used. Hence the original type is C[F 0 ] with F 0 <: F . Proposition 3.16 gives us F 0 ` C : S and thus we can use the induction hypothesis to change the type of r0 in this premise, which propagates to the type of r in the conclusion. Lemma 7.9 (modification of the heap). Suppose that we have Θ ` h : Γ and Γ ∗ r B v 0 : T 0 C Γ0 ∗ r, and that Γ0 (r.f ) = T where T is not a variant. Let v = h(r).f . The modified heap h{r.f 7→ v 0 } can be typed as follows: (1) if v is an object identifier or a channel endpoint, then: Θ ` h{r.f 7→ v 0 } : Γ0 {r.f 7→ T 0 }, v : T 2We know o00 is an object identifier and not a channel endpoint because, according to the hypotheses, either it is o itself or f~ is nonempty, implying o00 has fields. 74 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS (2) if v is not an object or channel and T is not a link type, then: Θ ` h{r.f 7→ v 0 } : Γ0 {r.f 7→ T 0 } (3) if v = l0 and T = link f 0 , then: • Γ0 (r.f 0 ) = hl : Sl il∈E for some E such that l0 ∈ E and some set of branch session types Sl . Note that this implies f 6= f 0 . • Θ ` h{r.f 7→ v 0 } : Γ0 {r.f 7→ T 0 }{r.f 0 7→ Sl0 } Proof. First of all, note that the hypothesis that Γ0 (r.f ) is defined implies that Γ0 (r) is not a variant, hence T 0 is not variant-tag. In other words, the judgement cannot be derived from T-VarF. Furthermore, the fact that T is not a variant either means that the judgement is not derived from an instance of T-VarS referring to field f . As this rule is the only possibility (beside subsumption) for a judgement typing a value to depend on, and modify, the type of a field, this implies that Γ(r.f ) is a subtype of T and also that the judgement would still hold with another type for f . In particular we have Γ{r.f 7→ Null} ∗ r B v 0 : T 0 C Γ0 {r.f 7→ Null} ∗ r (a). We will in the following use this judgement (a) rather than the one in the hypothesis. We prove the lemma by induction on the depth of r, but the inductive case is straightforward (just apply the induction hypothesis to the left premise of T-Hadd). In the base case, r is an object identifier o. We use Lemma 7.4 to consider a typing derivation for the sub-heap h ↓ o. Let Γo = o : To and Θo be the environments corresponding to that part of the heap. We look at the application of T-Hadd which ends the derivation for Θo ` ho : Γo . As T is not a variant, it is possible to consider that f is the last field to get populated in the swap sequence. We thus have something of the form: ... Γ2 ∗ o B v : Tv C Γ3 ∗ o (T-Swap) ... Γ2 ∗ o B f ↔ v : Null C Γ3 {o.f 7→ Tv } ∗ o (T-Seq) Γ1 ∗ o B . . .; f ↔ v : Null C Γ3 {o.f 7→ Tv } ∗ o (T-SubEnv) Θo ` (h ↓ o) \ o : Γ1 Γ1 ∗ o B . . .; f ↔ v : Null C Γo ∗ o (T-Hadd) Θo ` h ↓ o : Γo (1) with Tv <: T and Γ3 {o.f 7→ Tv } <: Γo . If we change the type of o.f , this last relation becomes Γ3 <: Γo {o.f 7→ Null} (b). What we want to do is to replace the judgement on the top right, which is an application of some rule (1), by a judgement typing v 0 . For this, we need the rest of the environment. We consider the judgement for the rest of the heap, Θ \ Θo ` h ↑ o : Γ \ o. Since the domains are disjoint, we can apply Lemma 7.5 to this and the leftmost premise of T-Hadd, yielding Θ ` h \ o : Γ \ o + Γ1 . If we replace our left premise with this, the initial environment we get on the top right is now Γ4 = Γ \ o + Γ2 , as the additional part is unaffected by the sequence of swaps. This environment is almost Γ{o.f 7→ Null}, but not quite. We now have three cases depending on what rule (1) is, which correspond to the three cases of the lemma. (1) If (1) is T-Ref or T-Chan, meaning v is an object identifier or a channel endpoint, then Γ2 = Γ3 , v : Tv . Using (b), this yields Γ2 <: Γo {o.f 7→ Null}, v : Tv . Adding Γ \ o to both sides, we get Γ4 <: Γ{o.f 7→ Null}, v : Tv . If we replace the initial environment in (a) with this one, we get the v : Tv back in the final environment. We then use Lemma 3.15 to replace this initial environment with Γ4 , and T-SubEnv to change Tv into T in the final one: Γ4 ∗ o B v 0 : T 0 C Γ0 {o.f 7→ Null}, v : T ∗ o. Just see that it yields what we want at the bottom of the derivation. MODULAR SESSION TYPES FOR OBJECTS 75 (2) If (1) is T-Label or T-Null or T-Name, i.e. if v is a literal value of non-link, non-linear type, then Γ2 is identical to Γ3 and we have, using (b) and adding Γ \ o to both sides, Γ4 <: Γ{o.f 7→ Null}, so we can directly (with Lemma 3.15) use judgement (a). (3) If (1) is T-VarS, the last possibility, then v is a label l0 and Tv is link f 0 for some f 0 . As it has no strict supertype, we have T = link f 0 as well. We also have Γ3 (o.f 0 ) = hl0 : Si. From (b) we have that Γo (o.f 0 ) = Γ(o.f 0 ) is a supertype of this variant type, thus also a variant. This implies that (a) cannot come from a T-VarS concerning f 0 ; therefore, Γ0 (o.f 0 ) is a supertype of Γ(o.f 0 ) and hence, by transitivity, of hl0 : Si, which gives us the first item of the conclusion, with S <: Sl0 . We now just have to notice that Γ2 = Γ3 {o.f 0 7→ S} and that (a) is independent of the type of f 0 just like it is of the type of f , and we can conclude similarly to the two previous cases. Lemma 7.10 (Substitution). If this : C[F ], x : T 0 ∗ this B e : T C this : C[F 0 ] ∗ this, and if Γ(r) = C[F ], then: (1) if T 0 is a base type (i.e. neither an object type nor a link) and v is a literal value of that type, or if v is an access point name declared with type hΣi and JhΣiK <: T 0 , we have: Γ ∗ r B e{v/x } : T C Γ{r 7→ C[F 0 ]} ∗ r. (2) if T 0 is an object type and v is an object identifier or a channel endpoint, we have: Γ, v : T 0 ∗ r B e{v/x } : T C Γ{r 7→ C[F 0 ]} ∗ r. Proof. In order to do an induction, we add the following case where x is still present in the final environment : if we have this : C[F ], x : T 0 ∗ this B e : T C this : C[F 0 ], x : T 00 ∗ this, and if T 0 is an object type and v is an object identifier, then we have Γ, v : T 0 ∗ r B e{v/x } : T C Γ{r 7→ C[F 0 ]}, v : T 00 ∗ r. We prove this by induction on the derivation of this : C[F ], x : T 0 ∗ this B e : T C this : C[F 0 ], V ∗ this (where V is either empty or v : T 00 depending on the case). For most toplevel rules, the result is immediate. The only ones for which it is not are T-Var and T-LinVar. For T-Var the result is obtained using either T-Null if T 0 is Null or T-Label and T-Sub if it is an enumerated type. In the case of an extension adding new base types, we assume there is a similar rule to type the corresponding literal values. For T-LinVar, if v is an access point name the result is obtained using T-Name and T-Sub. Otherwise, v is an object identifier and the result is obtained using T-Ref, noticing that because Γ(r) is defined and v is not in Γ, the path r does not start with v and the premise is satisfied. Lemma 7.11 (Typability of Subterms). If D is a derivation of Γ ∗ r B E(e) : T C Γ0 ∗ r0 then there exist Γ1 , r1 and U such that D has a subderivation D0 concluding Γ ∗ r B e : U C Γ1 ∗ r1 and the position of D0 in D corresponds to the position of the hole in E. Proof. A straightforward induction on the structure of E; the expression e is always at the extreme left of the typing derivation for E(e). Lemma 7.12 (Replacement). If (1) D is a derivation of Γ ∗ r B E(e) : T C Γ0 ∗ r0 (2) D0 is a subderivation of D concluding Γ ∗ r B e : U C Γ1 ∗ r1 (3) the position of D0 in D corresponds to the position of the hole in E (4) Γ00 ∗ r00 B e0 : U C Γ1 ∗ r1 then Γ00 ∗ r00 B E(e0 ) : T C Γ0 ∗ r0 . 76 S. J. GAY, N. GESBERT, A. RAVARA, AND V. T. VASCONCELOS Proof. Replace D0 in D by the derivation of Γ00 ∗ r00 B e0 : U C Γ1 ∗ r1 . This work is licensed under the Creative Commons Attribution-NoDerivs License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/2.0/ or send a letter to Creative Commons, 171 Second St, Suite 300, San Francisco, CA 94105, USA, or Eisenacher Strasse 2, 10777 Berlin, Germany
6cs.PL
Encoding Spike Patterns in Multilayer Spiking Neural Networks arXiv:1503.09129v1 [cs.NE] 31 Mar 2015 Brian Gardner* , Ioana Sporea, André Grüning Department of Computing, University of Surrey, Guildford, Surrey, United Kingdom * E-mail: [email protected] Abstract Information encoding in the nervous system is supported through the precise spike-timings of neurons; however, an understanding of the underlying processes by which such representations are formed in the first place remains unclear. Here we examine how networks of spiking neurons can learn to encode for input patterns using a fully temporal coding scheme. To this end, we introduce a learning rule for spiking networks containing hidden neurons which optimizes the likelihood of generating desired output spiking patterns. We show the proposed learning rule allows for a large number of accurate input-output spike pattern mappings to be learnt, which outperforms other existing learning rules for spiking neural networks: both in the number of mappings that can be learnt as well as the complexity of spike train encodings that can be utilised. The learning rule is successful even in the presence of input noise, is demonstrated to solve the linearly non-separable XOR computation and generalizes well on an example dataset. We further present a biologically plausible implementation of backpropagated learning in multilayer spiking networks, and discuss the neural mechanisms that might underlie its function. Our approach contributes both to a systematic understanding of how pattern encodings might take place in the nervous system, and a learning rule that displays strong technical capability. Introduction The importance of neuronal spike-timing in neural and cognitive information processing has been indicated at in a variety of studies [1]. For example, in the olfactory system the precision of spike-timing has been associated with accurate odor-classifications [2, 3], and populations of auditory neurons are known to signal input features by the relative timing of spikes [4, 5]. However, an understanding of how the brain learns to reliably associate specific input patterns with desired spike responses through synaptic strength modifications remains a significant challenge. From experimental observations, Spike-Timing-Dependent Plasticity (STDP) is widely believed to underpin learning in the brain [6], which can induce either long- or short-term potentiation in synapses based on local variables such as the relative timing of spikes, voltage and firing frequency [7, 8]. This closely follows Hebb’s postulate for associative learning: ‘Cells that fire together, wire together’ [9]. Drawing on this as inspiration, a variety of supervised learning rules have been proposed that can train either single- or multilayer networks to generate desired output spike patterns in response to spatio-temporal spiking input patterns (for a recent review, see [10]). With respect to single-layer networks, the learning rule introduced by Ponulak et al. [11], Remote Supervised learning Method (ReSuMe), is a notable example of how STDP can be applied in teaching a neuron to generate desired output spikes; from assuming an appropriate functional dependence of synaptic weight changes on the relative timing between actual and target output spikes, for example an exponential decay [12], the dissimilarity between an actual and target output spike train can be minimized by an analogous method to the Widrow-Hoff learning rule. Practical advantages of ReSuMe include being independent of the neuron model implementation, and its rapid convergence when learning to perform arbitrary input-output spike pattern associations. However, although ReSuMe retains a high degree of biological plausibility through its incorporation of STDP, it still remains a heuristically derived 1 learning rule, and therefore cannot be assumed to provide optimal solutions. An alternative and more rigorous formulation of ReSuMe using gradient descent has been proposed by Sporea & Grüning [13]. A further supervised rule, proposed by Pfister et al. [14], instead takes a statistical approach that optimizes by gradient ascent the likelihood of generating desired output spike times. In this case, a probabilistic spiking neuron model is used to provide a smooth functional dependence of output spike times with respect to network parameters. From simulations, the authors demonstrated a resemblance of the learning rule to experimentally observed STDP, and demonstrated its applicability on an example ‘detection’ learning task where input patterns were identified by the responses of readout neurons; in previous work, we have further demonstrated the high capacity achievable with this this rule when training networks to encode multiple input patterns by specific output spike patterns [15]. An important advantage of this method are its general applicability to a wide range of learning paradigms: from supervised [14, 16] to reinforcement [17, 18] learning. Furthermore, it has been shown that a unique global maximum in the log-likelihood of generating a desired target spike pattern can be found when taking gradient ascent for a single-layer network [19]. Despite this, there still exists little work that has aimed at exploring its performance when encoding for a large number input spike patterns, with a reasonable number of spikes, by the precise timing of output spikes. Additional single-layer learning rules have been developed for spiking neural network [20–25], many of which have used either an objective error function that is minimized by gradient descent or an analog of the Widrow-Hoff learning rule. Key examples include the Tempotron [25], which has shown a strong capability in learning binary classifications of input patterns, and the Chronotron [24], that can learn to classify a large number of input patterns into multiple categories by the precise timing of output spikes. Comparatively, the majority of research has focused on training single- rather than multilayer networks. Existing work that has examined networks containing hidden spiking neurons include SpikeProp proposed by Bohte et al. [1], multilayer ReSuMe by Sporea & Grüning [13] and the recurrent network learning rules formulated by Brea et al. [16] and Rezende & Gerstner [26]. Learning rules for spiking networks have proven to be a challenge to formulate, and especially given the discontinuous nature of neuronal spike-timing. A typical solution has been to assume a linear dependence of a neuron’s spike-timing on presynaptic inputs around its firing threshold, such that small changes in its input with respect to synaptic weights shifts the timing of an output spike. However, such an approach has the disadvantage of constraining the learning rate to a small value [1]. An alternative approach has instead treated a spiking neuron as a stochastically firing unit, where spikes are distributed according to an underlying instantaneous firing rate, that in turn has a smooth dependence on network parameters; for example, in multilayer ReSuMe a linear Poisson neuron model was used as a substitute for deterministic spiking neurons in each layer, during its derivation [13]. Multilayer learning rules have demonstrated success on several benchmark classification tests, including the linearly nonseparable XOR computation and Iris dataset [1, 13] that cannot otherwise be solved by single-layer networks. However, aside from the work of [13], no attempts have been made in establishing the performance of a multilayer spiking network when learning to perform a large number of input-output spike pattern mappings; it is likely that the presence of more than one layer can enhance the storage capacity of the network, by increasing the number of spiking neurons that can perform computations on network inputs. Progress in this area has been hindered by the complexity that arises from applying learning rules to multilayer spiking networks. Much of the previous work examining the performance of both single- and multilayer learning rules for spiking networks have considered simplified coding schemes. For example, both SpikeProp and the Chronotron have used the latency of single output spikes to encode for different input patterns, and the Tempotron used a binary spike / no-spike output code to discriminate between two classes of inputs. Ideally, for spiking networks a fully temporal coding scheme would be taken advantage of such that input patterns were encoded by the precise timing of multiple output spikes. We have previously indicated the advantages of using a fully temporal code in [15], and in particular found that multiple, rather than single output spikes, increased the reliability of classifications. Most learning rules have been applied to networks containing just a single output neuron. Biologically, however, it is well known that populations of neurons encode for similar patterns of activity, such that the 2 detrimental impact of synaptic noise on neural processing can be eliminated [27]. In a series of notable studies [17, 28, 29], groups of spiking neurons receiving shared input patterns were simulated to mimic such a population-based coding scheme: with the key result that the speed of learning increased with the population size. Such studies were devised in the framework of reinforcement learning and typically used a spike / no-spike or latency code to classify input patterns; hence, it would be of interest to investigate populations of spiking neurons utilizing a fully temporal code with multiple output spikes. Here we derive a supervised learning rule for a multilayer network of spiking neurons which is capable of encoding input spike patterns by the precise timings of multiple output spikes. Our rule extends the single-layer learning rule of Pfister et al. [14] to multiple layers by combining the method of stochastic gradient ascent with backpropagation. We demonstrate the efficacy of the proposed learning rule on a wide variety of learning tasks: both in terms of the accuracy of input pattern classifications and the time taken to converge in learning. We find the learning rule can encode for a large of number of input patterns, comparing favourably with previous multilayer learning rules, and results in increased classification accuracy when classifying inputs by the timings of multiple rather than single output spikes. The learning rule is further applied to multilayer networks containing multiple output neurons, where we measure the dependence of the performance on the specific network setup when mapping between spatio-temporal spike patterns. Finally, we propose a biologically plausible implementation of the multilayer learning rule, and predict the underlying neural mechanisms that might guide the learning of desired target output spike trains. Our multilayer learning rule differs from those proposed by Brea et al. [16] and Rezende & Gerstner [26], which have instead taken gradient descent on the KL-divergence in a supervised and reinforcement setting respectively. The novelty of our paper comes from the application of backpropagation, and its indicated high performance when encoding for a large number of input spike patterns as multiple and precisely timed output spikes. Results We introduce our learning rule for a feedforward network of spiking neurons containing a hidden layer. The performance of the proposed learning rule is then examined on a variety of benchmark tests: first for multilayer networks containing a single output neuron as the readout, and secondly for multilayer networks containing multiple output neurons. With respect to single-output networks, learning tasks include: measuring the resilience of the network to noise, solving the XOR computation, a comparison over specific network setups, the storage capacity of the network and its ability to generalize on a synthetic dataset. For multiple-output networks, the performance of the learning rule is tested on mapping between multiple input-output spatio-temporal spike patterns, and the ratio of hidden to output neurons required to attain reliable input classifications. Finally, we present an alternative and more biologically plausible formulation of backpropagated learning, and compare its performance against that of our derived rule for both single- and multiple-output multilayer networks. Learning rule Neuron model. We consider a postsynaptic neuron, indexed o, that receives its input from other presynaptic neurons h. If the postsynaptic neuron generates a list of spikes zo = {t1o , t2o , ...} in response to the presynaptic spike pattern yh ∈ y, then its membrane potential at time t is defined by the Spike Response Model (SRM) [12]: X uo (t) := woh (Yh ∗ )(t) + (Zo ∗ κ)(t) , (1) h where woh is the synaptic weight between neurons h and o, and both (Yh ∗ )(t) and (Zo ∗ κ)(t) denote a convolution between a spike train and a Postsynaptic Potential (PSP) kernel  and reset kernel κ P respectively (Methods). A spike train is given as a sum of Dirac δ functions: Yh (t) = f δ(t − tfh ), and a 3 convolution is defined by Z (Yh ∗ )(t) ≡ t Yh (t0 ) (t − t0 )dt0 . (2) 0 In our analysis we implement a stochastic neuron model, such that postsynaptic spikes are distributed according to an instantaneous firing rate: ρ(t) = g[u(t)] , (3) where g[u] is a monotonically increasing function of the neuron’s membrane potential (see also Eq. 13). Supervised learning. The learning rule is derived for a fully connected feedforward network containing a single hidden layer. Input layer neurons just present spike patterns to the network, while both hidden and output neurons are free to perform computations on their respective inputs. Input layer neurons are indexed as i ∈ I, hidden neurons h ∈ H and output neurons o ∈ O. Both hidden and output neurons have their spikes distributed according to Eq. 3; the advantage of implementing a stochastic neuron model is that it allows for the determination of the likelihood for generating a specific output spike pattern. Hence, if the likelihood of generating a list of target output spikes zoref = {t̃1o , t̃2o , ...} in response to y is P (zoref |y), then theQlikelihood of generating a spatio-temporal target pattern zoref ∈ zref is given by the product P (zref |y) = o P (zoref |y) with log-likelihood (Methods): XZ T ref log P (z |y) = log(ρo (t))Zoref (t) − ρo (t)dt , (4) o 0 where Zoref (t) = f δ(t − t̃fo ), T the duration over which y is presented and ρo the output firing rate. We aim to maximize the log-likelihood of generating a target output spike pattern by taking gradient ascent with respect to synaptic weights in the network. For clarity, we just consider a network containing a single hidden layer, although our technique can straightforwardly be extended to include multiple hidden layers. From taking gradient ascent on Eq. 4 (Methods), the output layer weight update rule is determined as Z T ∆woh = ηo δo (t) (Yh ∗ )(t) dt , (5) P 0 where ηo is the output learning rate and δo an output neuron error signal. This error signal measures the dissimilarity between a target response zoref and the actual output activity ρo , that is given by δo (t) =  1  ref Zo (t) − ρo (t) , ∆uo (6) where ∆uo is a parameter that controls the variability of output spike times (Eq. 13). From the above, we find positive values for δo signal the timings of desired output spikes, while negative values signal erroneous output activity. The above learning rule was originally derived by Pfister et al. [14] for a single-layer network, that has been found to well approximate the functional form of STDP observed experimentally in [7]. An example of a weight update taking place in the output layer is shown in Fig. 1. By taking gradient ascent on Eq. 4 and using the technique of backpropagation (Methods), the hidden layer weight update rule is found as Z T ηh X ∆whi = woh δo (t)([Yh (Xi ∗ )] ∗ )(t)dt , (7) ∆uh o 0 where ηh is the hidden learning rate, ∆uh a parameter that controls hidden neuron spiking variability and ([Yh (Xi ∗ )] denotes a double convolution (Eq. 35). An example of a weight update taking place in the hidden layer is shown in Fig. 2. Given the dependence of weight updates on the availability of hidden neuron spike, it is necessary that a degree of variable activity persists in the hidden layer: an absence of hidden activity would otherwise prevent updates from taking place and result in stagnated learning. To this end, hidden weights are additively modified through synaptic scaling (Methods). 4 uh − ϑ 0 uo − ϑ 0 0 0 0 T 0 T ∆w oh (Y h ∗ ǫ) Figure 1. Example of the output layer weight update rule, in terms of hidden and output neuron activity. Top row: The left panel shows the fluctuations of a hidden neuron membrane potential relative to a firing threshold ϑ, in response to an input pattern lasting duration T , where hidden spike times are indicated by vertical lines. Note that thicker lines indicate phasic bursting, that evoke stronger responses in output layer neurons. The right panel shows the membrane potential of an output neuron, that responds to stimulation from hidden layer neurons. In this example, the output neuron must learn to generate spikes at the times indicated by the dotted lines. Bottom row: The left panel is the PSP evoked at output layer neurons due to hidden neuron spikes, that is defined by Eq. 2. The right panel is the candidate weight change between the hidden and output neurons shown in this example, that depends on both the hidden-evoked PSP and the accuracy of the output activity, according to Eq. 5. Note the depressions in ∆woh correspond to the timings of actual output spikes, that are slightly too early with respect their targets, while the increases take place at the timings of target output spikes, subject to the output error signal δo (Eq. 21). In this case, the final update ∆woh at time T is positive, that demonstrates the causal role of the hidden neuron spikes in eliciting accurate output spike times. Network setup The multilayer learning rule was tested in simulations of networks of stochastic Leaky Integrate-and-Fire (LIF) neurons, that performed temporally precise input-output spike pattern mappings. In all simulations, input patterns were represented by the firing times of ni = 100 input layer neurons, where an input pattern consisted of a Poisson spike train at each input neuron with a mean firing rate of 6 Hz (Methods). Input patterns were presented episodically to the network in no particular order, and weight changes were applied at the end of each episode. Depending on the learning task, a variable number nh of hidden neurons were implemented in the network to establish the dependence of the performance on the hidden layer size. Here we first present results from simulations of a multilayer network containing a single output neuron as its readout, and then extend our analysis to include a network containing multiple output neurons. For each experiment, a more detailed description of the network setup can be found in the Methods section. Performance of the learning rule The performance of the learning rule is demonstrated by training a multilayer network to perform generic input-output spike pattern mappings. We first focus on the relatively simple task of performing a single input-output mapping, and then extend our analysis to more complex multiple input-output mappings that are subject to noise. 5 Xi uh − ϑ uo − ϑ 0 0 0 0 0 0 T 0 0 T 0 T ∆w hi ([Y h (X i ∗ ǫ)] ∗ ǫ) (X i ∗ ǫ) Figure 2. Example of the hidden layer weight update rule, in terms of input, hidden and output neuron activity. This figure has the same setup as in Fig. 1. Top row: The left panel shows an input neuron spike train, that is distributed according to a Poisson process. The middle panel shows the membrane potential of a selected hidden neuron, which is partly stimulated by input spikes from the preceding panel. The right panel shows the membrane potential of an output neuron, with target output spike-timings indicated by dotted lines. Bottom row: Shown along this row are a series of synaptic traces, that have a functional dependence on the last panel. The left panel is the PSP evoked at hidden layer neurons, due to the input spike train above. The middle panel is a double convolution (Eq. 35), that captures the correlation between input and hidden neuron spike-timing. In this case, only input and hidden neuron spikes up to the first half of T are correlated. The right panel shows the progression of the candidate weight change ∆whi between the input and hidden neurons selected in this example, that depends on the synaptic trace shown in the middle panel and the accuracy of output spikes, according to Eq. 7. In this case, the final update ∆whi effected at time T is positive: demonstrating the causal role of the input spike train in driving an accurate output spike train. Single input-output mapping. A multilayer network was trained to map between an input pattern and a target output spike train. The network contained 10 hidden neurons and a single output neuron, which was tasked with learning the timings of five target output spikes. An illustration of the network setup is shown in Fig. 3, along with example spike rasters depicting input, hidden and output neuron spiking activity over a typical simulation run. In this example, we examined a hidden neuron that contributed strongly to the responses of the output neuron close to the target spike times: 166, 249 and 415 ms (Fig. 3B). From this hidden neuron spike raster, highly variable spike times were observed over the first 200 episodes, that subsequently fine-tuned themselves to the timings of target output spikes; this initial phase of variable activity demonstrated a form of stochastic exploration by the network, during which time desirable hidden spike patterns were discovered by the network which contributed to accurate output spike times. As learning progressed, hidden neurons generated bursts of spikes around the timings of target output spikes, such that the likelihood of evoking accurate output responses was increased. In this simulation, the majority of hidden layer neurons contributed to driving accurate output spiking responses, hence the load imposed on the network in the form of hidden synaptic modifications was more evenly distributed amongst them. From the output spike raster (Fig. 3C) it is clear that every target output spike was learnt successfully, and within just 100 episodes. However, because a stochastic rather than a deterministic neuron model was implemented, a small degree of variation in the timings of output spikes about their respective targets was apparent. Despite this, the network still generated output responses to a sufficiently high level of accuracy, that is supported by the van Rossum Distance (vRD) measure (defined in Eq. 39) with 6 Input spike pattern 100 Input A Xi 80 60 40 20 0 Hidden D Hidden neuron B Episodes 1000 800 600 Output 400 200 0 Output neuron 1000 800 600 400 200 0 E Distance C Episodes 4 3 2 1 0 200 300 400 500 0 200 400 600 800 1000 Episodes Time (ms) Figure 3. Learning a target output spike train in response to a single, fixed input pattern. The network contained ni = 100 input neurons, nh = 10 hidden neurons and a single output neuron. The input pattern was repeatedly presented to the network over 1000 episodes, where each episode lasted duration T = 500 ms. The target output spike train contained five spikes at times: 83, 166, 249, 332 and 415 ms. (A) A spike raster of the input pattern that was presented to the network on each episode. (B) The activity of a hidden neuron with each episode, that contributed strongly to the firing times of the output neuron. (C) The activity of the output, where the five target output spike times are indicated by crosses. (D) An illustration of the multilayer network setup. (E) The evolution of the distance between the actual output and target output spike trains of the network, given as a moving average of the van Rossum Distance D̃ with each episode (Methods) and taken over 100 independent simulation runs. The shaded region shows the standard deviation. 0 100 a final average value D̃ = 0.55 ± 0.13 (Fig. 3E). For an impression of this vRD value, a distance of 0.55 corresponds to a typical time shift of 1.17 ms between paired actual and target output spikes. Synaptic weight distributions. Shown in Fig. 4 is an example of the evolution of both hidden and output synaptic weights with the number of learning episodes and their final distribution, that corresponds to the previous experimental setup. In the left panel (Fig. 4A), the weights on the hidden neuron can be seen to diverge continuously during learning, with almost twice as many positive as negative weights by the final episode. This contrasts with the evolution of the weights on the output neuron (Fig. 4B, left panel), which attained rapid convergence during learning. We note that in our implementation output weights were confined to positive values, while hidden weights had no such restriction (Methods); preliminary simulations indicated that negative output weight values for a single 7 10 0.3 f(w) 0.4 whi A 20 0 10 20 0.1 0 200 400 600 Episodes 0.0 20 800 1000 3 0 whi 10 20 1.5 f(w) woh 1 0 10 2.0 2 B 0.2 1.0 0.5 0.0 400 600 800 1000 0 1 2 3 woh Episodes Figure 4. Evolution and distribution of synaptic weights in a multilayer network, for the simulation shown in Fig. 3. Left column: An example of the evolution of synaptic weights with the number of learning episodes. Right column: The final distribution of synaptic weights f (w) after 1000 learning episodes. The panels in row (A) correspond to hidden layer weights whi : the left panel shows the evolution of the first 20 weights on the hidden neuron shown in Fig. 3, and the right panel shows the final distribution over all hidden layer weights. The panels in row (B) show output neuron weights woh : the left panel shows the evolution of all 10 weights on the output neuron shown in Fig. 3, and the right panel shows the final distribution of output weights. For both panels showing the final distribution of weights, 100 independent simulation runs were taken. 0 200 output neuron had little impact on its performance. At the end of learning, hidden weights closely followed a Gaussian distribution (Fig. 4A, right panel) and output weights a positively skewed distribution (Fig. 4B, right panel), with coefficients of variation 1.52 ± 0.01 and 0.375 ± 0.009 in the magnitude of hidden and output weight values respectively. Hence, in terms of the absolute value, hidden weights were more widely dispersed than output weights by a factor of just over four. Multiple input-output mappings with noise. We next tested the performance of the multilayer network when learning to map between 10 input-output spike pattern pairs and the impact of input noise on learning. In this case, each input pattern was identified by a unique target output spike time. The network contained nh = 10 hidden neurons and a single output neuron. In this experiment, we introduced two new measures: the time shift ∆t and the performance P̃c . The time shift was taken as a moving average of the absolute difference between matching actual and target output spikes: ∆t = |to − t̃o | with each episode, which was computed only for instances when exactly one actual output spike was generated which provided a correct input classification. The measure P̃c was taken as a moving average of the network classification performance (Methods). The time shift ∆t shared the same averaging window as for P̃c , and its motivation came from providing a more physical perspective of the spike train dissimilarity measure D. The performance P̃c measured the accuracy of network classifications based on a temporal code, as described in the Methods section. As shown in Fig. 5 learning took place over 104 episodes to ensure convergence, where an input-output 8 4 6 6 10 8 6 4 2 0 8 10 8 10 3 0 2 4 6 4 6 100 80 60 40 20 0 8 10 8 10 10 8 6 4 2 0 0 2 4 6 8 10 0 2 4 6 8 10 Episodes (x103) Episodes (x10 ) Δt (ms) Distance C 0 2 3 Episodes (x10 ) 1 0.8 0.6 0.4 0.2 0 0 P c ( %) 2 4 P c ( %) 0 2 100 80 60 40 20 0 P c ( %) 0 Δt (ms) 1 0.8 0.6 0.4 0.2 0 10 8 6 4 2 0 Δt (ms) Distance B Distance A 1 0.8 0.6 0.4 0.2 0 100 80 60 40 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 Jitter (ms) Jitter (ms) Jitter (ms) Figure 5. Learning to map between 10 input-output pattern pairs, with and without input noise. The network contained nh = 10 hidden neurons and a single output neuron. Each input pattern was associated with a unique target output spike. Left column: The vRD between actual and target output spike trains. Middle column: The time shift between matching actual and target output spikes. Right column: The performance P̃c of the network (Methods), when recognizing input patterns by the timing of an output spike. (A) Learning in the absence of any input noise, and (B) learning with intermediate input noise. Input noise was simulated by adding jitter to the timings of input spikes on each episode, where jitter with an amplitude of 10 ms was used in (B). (C) Averaged values after 104 learning episodes, as a function of the input jitter amplitude. In all panels, each value was averaged over 20 independent runs, and error runs show the standard deviation. pattern pair was randomly selected and presented to the network on each episode. Noise was introduced to the network by jittering the timing of each input spike according to a Gaussian distribution at the start of every episode, with a standard deviation or amplitude that ranged in value from between 0 and 20 ms. From the row of panels in Fig. 5A we found that noiseless input patterns resulted in the most accurate output spike times, providing a final distance of 0.11 ± 0.02 and a typical time shift of 0.8 ± 0.1 ms. By comparison, introducing 10 ms amplitude of input jitter (Fig. 5B) gave a final distance of 0.43 ± 0.02 and resulted in output spikes shifted by 4.0 ± 0.2 ms, thereby reducing the temporal precision of output spikes by a factor of five. In terms of the accuracy of input classifications, noiseless inputs resulted in a high performance level of 96 ± 2 %, which dropped to 70 ± 4 % with the addition of 10 ms amplitude of input jitter. Input noise increased the time taken to converge in learning, taking (1.5 ± 0.3) × 103 and (2.0 ± 0.2) × 103 episodes for noiseless and noisy (10 ms jitter) inputs respectively. The panels in Fig. 5C summarise results obtained for 0, 5, 10, 15 and 20 ms amplitude of input jitter, which show a smooth decrease in the network performance with the degree of input noise. However, even for up to 20 ms amplitude of input jitter output spikes still fell within 10 ms of their targets and inputs were classified correctly at least 40 % of the time. This remains well above the chance performance level 9 of 10 %, thereby demonstrating the robustness of the multilayer network to strong input noise. The learning rule has proven capable of training a multilayer network to perform generic input-output spike pattern mappings, and in particular when applied for inputs subject to a high level of noise. We have also indicated the necessity of both active and variable hidden neuronal spiking to ensure convergence of the learning rule, which was supported through synaptic scaling of hidden weights. Next, we examine in more detail the advantages of introducing a hidden layer, and compare the performance of our multilayer learning rule against that for a single-layer network. Dependence on network structure In this section we compare the performance of multi- and single-layer networks as applied to an example classification task, and when performing an increasing number of arbitrary input-output spike pattern mappings. The aim is to support the validity of our multilayer learning rule as an efficient neural classifier. The XOR computation. The learning rule was applied to solving the exclusive-or (XOR) computation, that is a non-trivial classification task. This is considered a standard benchmark for neural network training, given that a hidden layer is necessary for its solution [30]. An XOR computation maps two binary inputs to a single binary output as follows: {0, 0} → 0, {0, 1} → 1, {1, 0} → 1 and {1, 1} → 0. To represent binary values as spike patterns, we used a similar setup to that in [30, 31]. For the inputs, each binary value was encoded by a set of 50 Poisson spike trains with a mean firing rate of 6 Hz, predetermined at the start of each simulation run; hence, paired binary input values were represented by spike patterns over two groups of 50 neurons. For the output a latency coding scheme was used, where the binary values 0 and 1 corresponded to late/early output neuron spike-timings of 334 ms and 167 ms respectively. In our simulations we considered multi- and singlelayer networks: both networks contained 100 input neurons and a single output neuron, and the multilayer network contained 10 hidden neurons. For single-layer networks, Eq. 5 was applied to updating input-output weights. Binary inputs were presented to the network episodically in a random order. A correct classification of an input was made when an actual output spike train was closest to its target output as measured by the vRD. From Fig. 6A it can be seen that the multilayer network was successful at learning the XOR computation within 1000 episodes, with a final accuracy approaching 100 %. The single-layer network, however, maintained an accuracy around 40 % that is consistent with chance level. It is further apparent from Fig. 6B that the multilayer network was capable of separating the two classes, such that output spike responses for each input class matched their respective targets. In contrast, the single layer network generated erroneous output spikes in response to both input classes, which is indicative of its failure to discriminate between the two classes. Hence, these results support the necessity of including a hidden layer in a spiking network when solving the linearly non-separable XOR computation. Multiple input-output mappings. The performance of various network setups when learning to map between an increasing number of input-output spike patterns was tested. Specifically, the performance of three different network setups were examined: a ‘free’ multilayer network, a ‘fixed’ multilayer network and a single-layer network. Both free and fixed multilayer networks contained 10 hidden neurons and a single output neuron, but differed from each other by their restriction on hidden weight updates: a free multilayer network was allowed changes in the hidden weights during learning by Eq. 7, while hidden weights were not allowed to change in the fixed multilayer network other than through synaptic scaling. The single-layer network lacked a hidden layer and contained a single output neuron. For a more direct comparison, both multi- and single-layer networks contained 100 input neurons. Shown in Fig. 7 is the dependence of the network performance on the number of input patterns p, up to a maximum of 40, where each input pattern was associated with a unique target output spike. From the left panel, it is clear that both the free multilayer and single-layer networks outperformed the fixed multilayer network over the entire range of input patterns considered; for example, after learning 40 10 100 60 B 40 20 0 Episodes A Accuracy (%) 1000 80 980 960 Multilayer Single layer 940 200 400 600 800 1000 0 250 500 0 250 500 Episodes Time (ms) Time (ms) Figure 6. Learning the XOR function of two binary variables as a temporal code. Either a multilayer or single-layer implementation was used. Both networks contained ni = 100 input neurons and a single output neuron. The multilayer network contained nh = 10 hidden neurons. The two binary variables were encoded as predetermined spike patterns over two populations of input neurons, each of size 50. The latency of an output spike coded for the binary value 1 (early spiking) or 0 (late spiking). (A) Evolution of the classification accuracy for multi- and single layer networks, averaged over 20 independent runs. (B) Output spike rasters for multilayer (left panel) and single layer (right panel) networks, taken over the final 60 episodes on an example run. Black dots correspond to responses from inputs {0, 1} and {1, 0}, and grey dots correspond to responses from inputs {0, 0} and {1, 1}. Target spike times are indicated as crosses for each class of input. Results were averaged over 20 independent runs. 0 inputs the performance values were 95.2 ± 0.3 %, 11.8 ± 0.8 %, and 0.8 ± 0.2 % for free, single and fixed respectively. The performance of the fixed multilayer network remained consistently low over the entire range of inputs considered, with a maximum value of 22 ± 3 % for just two inputs. Hence, it is apparent that allowing hidden weight updates to take place is necessary in training a multilayer network to perform input-output pattern mappings. From comparing the free multilayer and single-layer networks, it can be seen that the performance of the single-layer network was greatest for less than 12 inputs; however, for a greater number of inputs the performance of the free multilayer network dominated over the single-layer network. Over the entire range of inputs considered, the performance of the free multilayer network remained around 96 %, and showed no indication of decreasing. Shown in the right panel are the number of episodes taken for each network to converge in learning (Methods), as a function of the number of inputs. It can be seen that the convergence time for a multilayer network increased with the number of inputs, and was an order of magnitude larger for free in comparison with fixed when learning 40 inputs. The difference in convergence time between the free and fixed multilayer networks was attributed to the increased performance of the free multilayer network: a larger number of episodes was necessary to reach an increased performance value. Finally, the convergence time for a single-layer network decreased when learning more than 18 inputs, which coincided with a rapid drop in its performance level. To summarise, these results are supportive of multilayer over single-layer learning, and importantly when linearly non-separable classifications are performed for which the presence of a hidden layer is essential. In order for single-layer networks to remain competitive with multilayer networks when mapping between a large number of patterns it would be necessary to scale up the number of input layer neurons, although clearly this would be disadvantageous when more sparse input representations are desired. Capacity of the multilayer network An important consideration when training any neural network is the maximum amount of information it can memorize. Therefore, we measured the dependence of the performance on the number of input patterns that were presented to a multilayer network, that extends the previous experiment in Fig. 7. Given our implementation of a multilayer network, we also explored the dependence of the performance on the hidden layer size. Finally, the dependence of the performance on the number of target output 11 15000 80 Episodes Performance (%) 100 60 40 10000 Free w hi Fixed w hi Single layer 5000 20 0 0 16 24 32 40 0 8 16 24 32 40 Input patterns Input patterns Figure 7. The dependence of the performance on the number of input patterns and network setup. Each input pattern was associated with a unique target output spike. Left: The performance as a function of the number of input patterns. Right: The number of episodes to convergence in learning (Methods). The blue curve shows the performance of a multilayer network where hidden weights whi are free to be updated according to Eq. 7, and the red curve is a multilayer network with fixed hidden weights. The green curve corresponds to a single-layer network with no hidden layer. Each network contained a single output neuron. Left panel error bars show the standard deviation, and right panel error bars show the Standard Error of the Mean (SEM); the convergence measure was subject to high variance in most cases, therefore just the average number of episodes taken to converge in learning was considered, and not its distribution. Results were averaged over 20 independent runs. 0 8 spikes used to identify inputs was tested. The aim was to establish the relationship between the hidden layer size and the number of target output spikes that could be supported, and how this impacted on the network capacity. In this experiment, the network was tasked with classifying an increasing number of input patterns p into c = 10 different classes. An equal number of input patterns were assigned to each class, and all inputs belonging to the same class were identified by a unique target output spike train containing between 1 and 10 spikes. In terms of the network setup, the network contained either 10, 20 or 30 hidden neurons and a single output neuron as the readout. Fig. 8 shows the multilayer performance as a function of the number of input patterns and the number of target output spikes ns identifying each class of input. From comparing results between the different hidden layer sizes, a larger number of hidden neurons was found to support more target output spikes at a given level of performance. For example, 10 hidden neurons resulted in decreased performance when trained on more than a single output spike, for more than 60 input patterns (Fig. 8A), while 30 hidden neurons resulted in increased performance when trained on at least five output spikes, over the entire range of input patterns considered (Fig. 8C). Furthermore, from a closer inspection of Fig. 8, it can be seen that over a small region of input patterns p < 50 the network performance approached 100 % when trained on multiple rather than single output spikes, which was more pronounced for a larger number of hidden neurons. To give an indicator of the network’s capacity, the maximum number of input patterns learnt at a performance greater than 90 % was around 100, 150 and 200 for 10, 20 and 30 hidden neurons respectively. In terms of the time taken by the network to perform input classifications, the number of episodes increased with both the number of hidden neurons and number of output spikes: taking up to 70 % longer for 30 over 10 hidden neurons when trained on 200 input patterns and 10 target output spikes. A decreased number of episodes taken to converge in learning was generally indicative of the networks inability to learn all input patterns. In Fig. 9 we show in more detail the dependence of the multilayer performance on the number of target output spikes, for different hidden layer sizes. This figure corresponds to the same setup as used in Fig. 8 when classifying 150 input patterns into 10 classes. As found previously, a larger number of hidden neurons supported more target output spikes; for example, in the case of 30 hidden neurons, the 12 x 10 90 Episodes A Performance (%) 100 80 70 nh = 10 60 50 0 50 100 150 200 90 Episodes B Performance (%) 100 80 70 nh = 20 60 50 0 50 100 150 200 90 Episodes C Performance (%) 100 80 70 nh = 30 60 50 0 50 14 12 10 8 6 4 2 0 14 12 10 8 6 4 2 0 14 12 10 8 6 4 2 0 4 ns = 1 ns = 5 ns = 10 0 4 x 10 50 100 150 200 100 150 200 ns = 1 ns = 5 ns = 10 0 4 x 10 50 ns = 1 ns = 5 ns = 10 100 150 200 0 50 100 150 200 Input patterns Input patterns Figure 8. The dependence of the network performance on the number of input patterns, the number of hidden neurons nh , and the number of target output spikes ns . In all cases, the network contained one output neuron. In this experiment, input patterns p were equally assigned between c = 10 classes. Left: The performance as a function of the number of input patterns, for nh = 10 (A), nh = 20 (B) and nh = 30 (C) hidden neurons. In each panel, different colour curves correspond to the number of target output spikes belonging to each class. Right: The number of episodes to convergence in learning. Results were averaged over 20 independent runs. performance reached a maximum value when trained on around four target output spikes. For just 10 hidden neurons, however, the performance was at its maximum value when trained on just a single target output spike, and decreased as the number of spikes increased. Also evident is an increase in the time taken to learn all inputs for more than 10 hidden neurons and an increasing number of spikes. From these experiments it is evident that an increase in the hidden layer size provides more capacity to the network, and is supportive of multiple-spike target output trains for more reliable input classifications. These results can be attributed to the internal representations of input patterns afforded by hidden layer neurons, such that class discriminations can be performed at an early stage before being processed by the readout. Qualitatively, it was observed from spike rasters that individual hidden neurons selectively responded to certain input patterns, and only contributed to generating a fraction of the total number of target output spikes. From this, it is apparent that neurons in the hidden layer are capable of 13 100 12 90 10 80 70 nh = 10 Episodes Performance (%) 4 nh = 20 60 8 6 4 2 nh = 30 50 x 10 0 2 4 6 8 10 0 2 4 6 8 10 Number of output spikes Number of output spikes Figure 9. The dependence of the performance on the number of target output spikes, and the number of hidden layer neurons. The number of input patterns was p = 150 that were equally assigned between c = 10 classes, that corresponds to Fig. 8. Left: The performance as a function of the number of target output spikes, for nh = 10, nh = 20 and nh = 30 hidden neurons. Right: The number of episodes to convergence in learning. Results were averaged over 20 independent runs. 0 distributing the synaptic load imposed upon them, as previously found for the experiment in Fig. 3 when performing single input-output mappings. Generalization ability The ability of the network to generalize from stored patterns to similar, new input patterns was tested. Here we built on the earlier experiment (c.f. Fig. 5) which examined the impact of noise on mapping between multiple input-output pattern pairs, by instead considering a more realistic data set that contained several classes of input patterns. The network was tasked with identifying similar inputs belonging to the same class by the timings of output spikes. We devised a synthetic data set that was inspired by Mohemmed et al. [22]. Specifically, the accuracy (or classification performance) of the network was tested on a generated dataset that consisted of both training and testing patterns, where the aim of the network was to learn to classify patterns between 10 classes. In generating the training patterns, a single reference spike pattern was randomly created for each class. Each of the 10 reference patterns were then duplicated 15 times, where every duplicate was subsequently jittered according to a Gaussian distribution with a noise amplitude between 2 and 20 ms. Hence, a total of 150 training patterns were generated. In the same way, 25 testing patterns were generated for each class, giving a total of 250 testing patterns. Each class of training and testing patterns were associated with a unique target output spike train, that contained between 1 and 5 spikes. On this task, only training patterns were used to train the network, and testing patterns were used to test the ability of the network to generalise. The network contained 20 hidden neurons and a single output neuron. Shown in Fig. 10 is the network accuracy as a function of the noise amplitude, used to generate input patterns at initialization, and the number of target output spikes. As can be expected, a high degree of noise presented a greater challenge to the network, given that the network had to learn to generalize well in order to accurately classify unseen patterns during the testing phase. Despite this, the network still managed to classify testing patterns at least 40 % of the time at 20 ms noise. Furthermore, it is clear that multiple target output spikes led to more accurate classifications in comparison with a single target output spike, giving an increase of almost 25 % at 10 ms noise. From the right panel, a smooth increase in the accuracy with the number of target output spikes at 10 ms noise can be seen, along with a reduction in the standard deviation; the accuracy of one target output spike was 64 ± 6 %, compared with 88 ± 2 % for five output spikes. However, the difference in the accuracy between single and multiple target output 14 100 80 90 60 40 Train, ns = 1 20 Train, ns = 5 Test, ns = 1 Accuracy (%) Accuracy (%) 100 80 70 10 ms of input jitter 60 Train Test Test, ns = 5 0 50 10 15 20 1 2 3 4 5 Jitter (ms) Number of output spikes Figure 10. The classification accuracy on a synthetic dataset, at varying noise levels. The network contained nh = 20 hidden neurons and a single output neuron. The number of training patterns was 150, and the number of testing patterns 250. Both training and testing patterns were equally assigned between 10 classes. Left: The testing and training accuracy as a function of the amplitude of input jitter in the generated dataset, for 5 and 10 target output spikes per class. Right: The testing and training accuracy as a function of the number of target output spikes, at 10 ms amplitude input jitter. To ensure convergence in learning, the number of training episodes was 75000. Results were averaged over 20 independent runs. 0 5 spikes became minimal as the noise amplitude approached 20 ms. The network is able to generalize well to similar input patterns, and especially when classifications are performed using multiple target output spikes. Two key reasons explain the increase in accuracy with the number of target spikes. The first relates to the redundancy inherent in multi-spike based classifications: even if an actual output spike train cannot match its target in terms of the number of spikes, an accurate classification can still be performed if those spikes which remain are close enough to their respective targets. The second reason comes from the larger separation between classes as the number of target output spikes increases: class discriminations made by the network are less prone to error from fluctuating output responses. Learning spatio-temporal output patterns Our learning rules support weight updates in a multilayer network containing more than one output neuron, therefore, we tested the performance of the network when learning to map between spatio-temporal input and output patterns. Here a spatio-temporal output pattern consisted of a unique target spike train at each output neuron, and were combined to identify specific input classes (Methods). Single input-output mapping. First, we considered a mapping between a single input-output pattern pair, where the network was tasked with learning a target spatio-temporal output pattern in response to a single, fixed input pattern. In this experiment, the network contained 20 hidden neurons and three output neurons, where each output was assigned a single, unique target spike time. For multiple output neurons, output weights were allowed to change sign during learning (Methods). Fig. 11 shows an example of a single simulation run, that depicts hidden (Fig. 11A) and output (Fig. 11B) neuron spike rasters towards the end of learning. Out of the 20 hidden neurons implemented in the network, three were selected for demonstrative purposes that contributed intensely to the target output timings. From Fig. 11A it can be seen that the selected hidden neurons generated stereotypical spike patterns, and particularly around the timings of target output spikes where phasic bursting was observed. In response to hidden layer activity, each output neuron demonstrated a successful learning of their respective target timing (Fig. 11B) and to a good degree of temporal accuracy, that is indicated by a 15 final vRD of 0.4 ± 0.1 (Fig. 11D) with a corresponding time shift of 1.9 ± 0.7 ms at each output. Furthermore, the network learnt to distribute the synaptic load between hidden layer neurons, such that hidden spiking activity became more diverse. This is supported by a heatmap of the output weight matrix shown in Fig. 11C, corresponding to the same simulation in panels A and B, which demonstrates a high variance in the synaptic strength between hidden and output neurons. Dependence on the hidden layer size. We next explored the performance of the network when input patterns were classified by spatio-temporal output patterns. In this experiment, a total of 50 input patterns were equally assigned between 10 classes, such that all five patterns belonging to the same class were identified by a unique, target spatio-temporal output pattern. Target output patterns were randomly predetermined for each class of input. To increase the separation between classes, target output spike trains assigned to each output neuron differed from each other by a vRD of at least ns /2 for 1 ≤ ns ≤ 10 output spikes, similarly as for a network containing a single output neuron. A correct input classification was made when the vRD between an actual and desired target output pattern assumed a minimum value (Methods). In measuring the relationship between the performance and network setup, an increasing fractional number nh /no of hidden to output neurons was implemented, for a fixed number of output neurons: no = 10, 20 or 30. From Fig. 12A it is clear that an increase in the fractional number of hidden-output neurons increased the performance of the network, with the performance approaching 100 % for between 2 < nh /no < 3. Furthermore, there was a dependence of the performance on the number of output neurons; for example, at a fixed fractional number nh /no = 1 the performance values were close to 48, 63 and 79 % for 10, 20 and 30 output neurons respectively. Hence, it was apparent that a larger number of output neurons increased the separation between classes, while a sufficiently large number of hidden neurons provided support to the output layer during learning. There was also a trend for fewer nh /no needed to reach a performance level of 100 % as the number of output neurons increased. In terms of the time taken to converge in learning, a maximum was found at the first value of nh /no for which the performance first approached 100 %. The dependence of the performance on the number of target output spikes was examined. In this case, the absolute number of output neurons was fixed at 10, and the number of target output spikes taken over the range: 1 ≤ ns ≤ 10. As before, the network was tasked with classifying 50 input patterns between 10 classes, with five input patterns assigned to each class. Fig. 12B shows the minimum fractional number nh /no of hidden to output neurons needed by the network to attain 90 % performance, as a function of the number of target output spikes. An increase in the minimum value of nh /no with the number of target output spikes was found, that showed an indication of levelling off between 8 and 10 output spikes. In terms of the time taken to converge in learning, a small increase of ∼ 25 % when learning 10 spikes compared with one spike was measured. When learning a single target output spike, the number of episodes to convergence was measured as (5.0 ± 0.6) × 104 in Fig. 12B and close to (2.8 ± 0.2) × 104 in Fig. 12A; this apparent discrepancy can be attributed to the more strict criterion used in Fig. 12B, that rejected trials where the performance failed to reach 90 % by the end of learning. An important consideration when designing any multilayer network is the hidden layer size, and whether it is sufficient to allow for reasonably accurate input classifications during learning. From the above experiments we have quantified the ratio of hidden to output neurons required by the network to allow for accurate classifications to be made, and in particular for the more general case of fully spatio-temporal based output encodings. To the best of our knowledge, this is the first attempt that has aimed to characterise a multilayer network setup for spiking neurons when classifying inputs based on spatio-temporal output patterns. Biological plausibility The technique of backpropagation is commonly associated with poor biological plausibility, an issue that has been challenged in [32]. To address this, we propose an alternative and more biologically plausible 16 A Episodes 1000 980 960 940 0 250 500 0 250 500 0 250 500 0 250 Time (ms) 500 0 250 Time (ms) 500 0 250 Time (ms) 500 B Episodes 1000 980 960 940 3 1 1 2 D Distance C Output neurons 2 2 1 0 3 0 8 10 12 14 16 18 20 0 200 400 600 8001000 Hidden neurons Episodes Figure 11. Learning a mapping between a single input-output pattern pair, in a network containing multiple output neurons. The network contained nh = 20 hidden neurons and no = 3 output neurons. Each output neuron was assigned a unique target spike for the input, at times: 125, 250 and 375 ms for the first, second and third output neurons respectively. Learning took place over 1000 episodes. (A) Example hidden neuron spike rasters, and (B) output neuron spike rasters, shown over the final 60 learning episodes. Each panel in row (A) shows a hidden neuron that contributes strongly to the output neuron response shown in the panel below. In (B), each panel indicates the target spike time of an output with a cross. The left, middle and right panels show the activity of the first, second and third output neurons respectively. (C) Heatmap of output layer weights woh after 1000 learning episodes. The intensity corresponds to the strength of synaptic weights. For reference, the left, middle and right panels in (A) show the activity of hidden neuron numbers 15, 9 and 2 respectively. (D) The evolution of the vRD, averaged over 40 independent runs. 2 4 6 implementation of our multilayer learning rule. Reformulation of backpropagation. As the learning rule currently stands, output weight updates (Eq. 5) can be considered biologically plausible, given that updates have a dependence on locally available 17 100 4 80 3 Episodes A Performance (%) 4 60 no = 10 40 no = 20 20 0 no = 30 0 0.5 1 1.5 2 nh / no 2.5 2 1 0 3 x 10 0 0.5 1 1.5 2 nh / no 2.5 3 8 4 6 Episodes B nh / no 4 5 3 2 1 0 no = 10 x 10 4 2 0 2 4 6 8 10 0 2 4 6 8 10 Number of output spikes Number of output spikes Figure 12. The dependence of the network performance on the ratio of hidden to output neurons, and the number of target output spikes. The network contained an increasing number nh of hidden neurons, and no = 10, 20 and 30 output neurons. p = 50 input patterns were equally assigned between c = 10 classes, where all patterns belonging to the same class were identified by a unique target output spike pattern. (A) Left: The performance as a function of the ratio of hidden to output neurons. Right: The number of episodes to convergence in learning. (B) Left: The minimum ratio of hidden to output neurons required to achieve 90 % performance, as a function of the number of target spikes at each output neuron. Right: The number of episodes taken to reach 90 % performance. Results were averaged over 10 independent runs. 0 pre- and postsynaptic activity variables at each synapse. It is, however, more realistic to effect output weight changes online, for example: ẇoh (t) = ηo δo (t) (Yh ∗ )(t) . (8) The supervisory error signals δo are specific to each output neuron, and it is reasonable to suppose that desired postsynaptic activity is provided by an ‘activity template’ external to the network [33], that is a reference output spike pattern originating in another network. This idea is illustrated in the schematic shown in Fig. 13. Hidden weight updates (Eq. 7), on the other hand, are more difficult to justify biologically. Although locality at each input-hidden synapse is satisfied in the causal, double convolution term P ([Yh (Xi ∗ )] ∗ ), there is also a non-local dependence on a summation over hidden-specific error signals o woh δo . It is unclear by which mechanism the strengths of output weights might be communicated back through the network, and further how these weights would then combine with specific error signals to inform synaptic updates. To provide a biologically plausible reformulation of backpropagated learning, it is therefore necessary to make a few heuristic assumptions regarding the network structure and plasticity. Specifically, we assume output weights are positively valued at initialization and share the same magnitude, and are constrained to positive values during learning. As a result, the dependence of hidden weight updates on 18 + Input Comparator Hidden Reference Output Comparator Figure 13. Biologically plausible implementation of backpropagation in a feedforward multilayer spiking network. Input layer neurons are fully connected with hidden layer neurons, which in turn are fully connected with two output neurons. Each output neuron must learn a prescribed target spike train in response to an input pattern presented to the network. It is posited that reference neurons external to the network are available to provide the required target output spike trains during learning. Same colour neurons have a one-one correspondence with each other, such that actual and target activity for each output neuron pair is fed into a unique comparator to provide separate error signals. These error signals are then backpropagated through the network in two stages. At the first stage, each error signal is used to inform the direction and magnitude of synaptic weight changes on its respective output neuron. At the final stage, all error signals are combined together to inform synaptic weight updates on shared hidden neurons. In this schematic, just two output neurons with corresponding reference outputs are used for clarity, but this setup is similarly extendable to any number of outputs. the values of output weights can be neglected, thereby providing the modified hidden weight update rule: ηh X δo (t)([Yh (Xi ∗ )] ∗ )(t) , (9) ẇhi (t) = ∆uh o P where the summation term o δo is now a linear combination of output error signals. The schematic shown in Fig. 13 illustrates this process, and indicates the shared dependence of input-hidden synaptic plasticity changes on multiple output error signals. We examine the backpropagated error signals δo , that are shared between all input-hidden synapses. Biologically, it is plausible that a neuromodulator might perform this function, and particularly given the evidence that neuromodulators can influence both the magnitude and direction of synaptic plasticity changes triggered by STDP [34]. It is further known that the firing activity of dopaminergic neurons can encode a form of error signal [35, 36], and influence cortiocostriatal plasticity by regulating the concentration of dopamine surrounding each synapse [37]. In light of this, and adopting the method used in [29] as applied to reinforcement learning, previously instantaneous output error signals δo used for hidden and output weight updates are instead substituted for concentration-like variables δ̃o , which evolve according to: ˙ τD δ̃o (t) = −δ̃o (t) + [Zoref (t) − Zo (t)] , (10) with a decay time constant τD = 50 ms. In the above, we have also substituted the instantaneous firing rate of an output neuron for its spike train (c.f. Eq. 6) that is transmittable distally. 19 100 80 60 B 40 Bio backprop Backprop 20 0 0 50 100 150 Input patterns Performance (%) A Performance (%) 100 80 60 40 0 200 Bio backprop Backprop 20 0 2 4 6 nh / no 8 10 Figure 14. Performance of a biologically plausible implementation of backpropagation. A biologically plausible implementation of backpropagation (bio-backprop) was used to drive hidden synaptic weight updates. In both (A) and (B), the network was trained to classify input patterns equally assigned between 10 classes by the timing of single output spikes. (A) The performance of bio-backprop as a function of the number of input patterns presented to the network, based on the experiment in Fig. 8. The network contained 10 hidden neurons and a single output neuron. Results were averaged over 20 independent runs. (B) The performance of bio-backprop as a function of the ratio of hidden to output neurons, based on the experiment in Fig. 12. The network contained an increasing number nh of hidden neurons, and no = 10 output neurons. A fixed number of input patterns p = 50 was used. For reference, results from the regular backpropagation learning rule on the same learning task (labelled Backprop) is included (Fig. 12). Results were averaged over 10 independent runs. Performance of biological backpropagation. The performance of the biological implementation of backpropagation (bio-backprop), using Eqs. 8 and 9, was compared against that of the regular multilayer learning rule (backprop). For bio-backprop, output error signals δo were substituted for the filtered signal δ̃o defined in Eq. 10. Both learning rules were applied to either a multilayer network containing a single output neuron as the readout, or a multilayer network containing multiple output neurons. In both cases, networks were trained to classify input patterns by the timings of single output spikes. The single-output network contained 10 hidden neurons, and was tasked with classifying an increasing number of input patterns into 10 classes (c.f. experiment of Fig. 8). As shown in Fig. 14A, little difference was found in the performance between the bio-backprop and backprop learning rules for less than 80 input patterns. However, as the number of input patterns increased there was a small performance difference in favour of backprop, approaching 8 % by 200 input patterns. In terms of the convergence time, bio-backprop was consistently slower than backprop, taking at least 1.5 times the number of episodes needed by backprop to complete learning. We next considered a multiple-output network containing no = 10 output neurons and an increasing number nh of hidden neurons. The network was tasked with classifying 50 input patterns into 10 classes (c.f. experiment of Fig. 12). From Fig. 14B, a marked difference in the performance favouring backprop over bio-backprop was apparent; while it took just two times the number of hidden to output neurons for backprop to reach a 90 % performance level, it took bio-backprop at least ten times the number of hidden to output neurons to reach the same performance level. In other words, bio-backprop needed five times the number of hidden neurons as backprop to accurately classify all 50 input patterns presented to the network. With respect to the convergence time, bio-backprop took almost 1.5 times as many episodes as backprop to reach a 90 % performance level, using nh /no = 10 and nh /no = 2 for bio-backprop and backprop respectively. From these results, it is clear that the heuristic bio-backprop rule can maintain a similar level of performance to the analytical backprop rule for networks containing a single output neuron. However, for networks containing more than one output neuron the performance of bio-backprop lagged behind that of backprop; a reasonable performance level for bio-backprop could only be recovered by a large increase in the number of hidden neurons. Furthermore, weight distributions (not shown) indicated a reduced ability of networks trained with bio-backprop to effectively distribute the synaptic load between hidden layer 20 neurons: individual hidden neurons either contributed intensely or weakly to the activity over all output neurons. Ideally, individual hidden neurons would instead be selected to contribute to specific output responses, which was evidenced for the backprop rule (c.f. Fig. 11C). Despite some limitations, bio-backprop still proved to be a capable learning rule, and maintained a performance level well above the chance level of 10 % in most cases. As such, bio-backprop represents an alternative to our analytical backprop rule when increased biological plausibility is desired. Discussion In this paper we have presented a multilayer learning rule for a spiking network containing a hidden layer that combines gradient ascent with the technique of backpropagation, and demonstrated its high performance when encoding a large number of input patterns by the precise timings of multiple output spikes. We have further provided an alternative and more biologically plausible implementation of our learning rule, and discussed the underlying neural mechanisms which might support a form of backpropagated learning in the nervous system. Our approach complements the recurrent network algorithms proposed in [16, 26, 38]. In our analysis we used the escape noise neuron model defined in [12], which has been shown to closely approximate the variable firing activity of neurons in-vivo [39]. Our choice of neuron model was primarily motivated by its general applicability in a wide range of learning paradigms, including supervised [14, 16] and reinforcement [40, 41] learning. A key advantage of implementing escape noise neurons comes from being able to determine the probability of generating a specific output spike pattern [14], which can then form the basis of a suitable objective function. Here we took the approach of maximizing the log-likelihood of generating a desired output spike pattern in a multilayer network through a combination of gradient ascent and backpropagation, that is an extension of the single-layer learning rule proposed by [14] to multilayer networks. Output weight updates result from a product of locally available pre- and postsynaptic activity terms, that bears a resemblance to Hebbian-like learning; the presynaptic term originates from filtered hidden neuron spike trains as a PSP, and the postsynaptic term an output error signal that guides the direction and magnitude of weight changes. Hidden weight updates, however, appear as a three-factor rule: PSPs due to input spikes are combined with hidden spike trains, to then be modulated by a linear combination of backpropagated error signals to allow for hidden weight changes. From training multilayer networks to map between input-output spiking patterns, it proved necessary to represent input patterns with a sufficiently high degree of spiking activity at each input neuron; sparse representations otherwise led to decreased performance. This requirement is apparent from an examination of the hidden layer weight update rule, which has a dependence on hidden neuron spike trains: a lack of input-driven hidden layer activity prevented weight updates from taking place, thereby resulting in diminished learning. Previous multilayer learning rules [1, 13] have faced a similar challenge in effectively presenting input patterns to the network, but instead took the approach of introducing multiple synaptic connections with varying conduction delays between neurons of neighbouring layers: also termed subconnections. For example, one presynaptic spike would evoke multiple PSPs at each of its postsynaptic targets through the many subconnections available, thereby driving a sufficient level of hidden layer activity. Combining sparsely encoded input patterns with multiple subconnections represents a plausible alternative to the method we employed in this paper, and could be advantageous when applied to real world datasets such as Iris, for which sparse representations of inputs can be ideal [13]. We were motivated to introduce synaptic scaling to the network to maintain an optimal range of hidden firing rates [42], a process that has been observed in biological networks [43]. Aside from effecting the firing rate, the introduction of synaptic scaling also has side benefits: such as removing the networks over-reliance on the initial values of synaptic weights [13], a critical issue that was identified in [1]. An important contribution of our paper is the large number of pattern encodings that can be performed by our learning rule: in comparison with multilayer ReSuMe [13], trained on a similar network setup, our learning rule was capable of at least 10× as many pattern encodings at a 90 % performance level (Fig. 8). Furthermore, we believe our encoding method better took advantage of spike-timing than most alternative methods [22, 24, 25]; for example, the Tempotron [25] can only classify input patterns 21 into two classes using a spike / no-spike coding scheme, and the experiments run for the Chronotron [24] and SPAN [22] required precisely matched output-target spike pairs, which could result in overlearning and impact negatively on generalizing to new input patterns. In particular, we found our encoding method allowed for increased performance when using multiple target output spikes, and especially for a larger number of hidden layer neurons. Multiple output spikes also allowed the network to better generalize to new input patterns. Backpropagated learning is commonly considered to lack biological plausibility for two key reasons: the first being mechanistic, in the sense that synapses are used bidirectionally to communicate activity variables both forwards and backwards throughout the network; the second reason is cognitively, since a fully specified target signal must be provided to the network during learning [32]. In this paper we have addressed the first implausibility, by reformulating our hidden layer weight update rule to depend on just local input-hidden synaptic activity variables and a global, linear combination of output-specific error signals (Fig. 13). Hence, our interpretation relies on the presence of error signals that are diffusely available across a large number of synapse. Biologically, this role might be fulfilled by a neuromodulator such as dopamine, which is known to act as an error-correcting signal by modulating synaptic plasticity changes in the cortico-striatal junction during behavioural learning tasks [37]. Like most existing learning rules for spiking networks we have assumed the presence of a supervisory signal, which is used to perform on-line comparisons between actual and target output spike patterns during learning. Although this might be deemed cognitively implausible, it is possible that such a signal originates from an external network that acts as an ‘activity template’ [33], which can explain functional plasticity changes in neurons encoding for auditory stimuli in the barn owl [5]. However, more recently, reward-modulated learning rules for spiking networks have emerged as a more plausible alternative to supervised learning [40, 44], which instead provide summary feedback on the correctness of network responses. It has been shown in [41, 45] and in our previous work [46] how reward-modulation can be applied to learning precise output spiking patterns. Conclusions and future work. In principle, our multilayer learning rule follows from those previously introduced in [1, 13] which have adapted backpropagaton for use in feedforward spiking networks. Through several benchmark tests in this paper we have indicated the high performance of our learning rule, thereby lending support to its practical deployment as an efficient neural classifier. We have further highlighted the advantages of using a fully temporal code based on multiple output spike-timings to reliably encode for input patterns. Finally, to address the biological shortcomings of backpropagated learning, we presented a heuristic reformulation of our learning rule which we argue can be considered biologically plausible. The framework in which we have developed our learning rule is general, and has found applications in the areas of both supervised and reinforcement learning for feedforward and recurrent network structures. It is therefore natural to assume that our supervised rule might have a reinforcement analogue, that instead uses a delayed feedback signal to indicate the overall ‘correctness’ of network responses during learning. In Grüning [32], it has been shown how backpropagation can be reimplemented as a cognitively more plausible reinforcement learning scheme, but for rate-coded neurons; future work could attempt to relate such a technique to our own rule for spiking neurons, with the intent of supporting a biological backpropagation rule. Methods Neuron model We start by considering a single postsynaptic neuron o in the network that receives input from 1 ≤ h ≤ nh presynaptic neurons. The list of presynaptic spikes due to neuron h, up to time t, is yh (t) = {t1h , ..., t̂h < t}, where t̂h is always the last spike before t. If the postsynaptic neuron o generates the list of output spikes zo (t) = {t1o , ..., t̂o < t} in response to the presynaptic pattern yh ∈ y, then its 22 membrane potential at time t is defined by the Spike Response Model (SRM) [12]: Z t Z t X uo (t|y, zo ) := woh Yh (t0 )(t − t0 )dt0 + Zo (t0 )κ(t − t0 )dt0 , 0 h (11) 0 where woh is the synaptic weight between neurons o and h, and Yh (t) and Zo (t) are the presynaptic and postsynaptic P spike trains respectively, with a spike train defined in terms of a sum of Dirac δ functions: Yh (t) = f δ(t − tfh ). (s) and κ(s) are the PSP and reset kernels respectively, taken as: (s) = 0 [e−s/τm − e−s/τs ] Θ(s) and κ(s) = κ0 e−s/τm Θ(s) , (12) where 0 = 4 mV and κ0 = −15 mV are scaling constants, τm = 10 ms the membrane time constant, τs = 5 ms the synaptic rise time and Θ(s) the Heaviside step function. Neuronal spike events are generated by a point process with stochastic intensity ρo (t), that is the instantaneous firing rate of a postsynaptic neuron, where the probability of generating a spike at time t over a small time interval [t, t + δt) is given by ρo (t)δt. The firing rate has a nonlinear dependence on the postsynaptic neuron’s membrane potential, that in turn depends on both its presynaptic input and the postsynaptic neuron’s firing history: ρo (t|y, zo ) = g[uo (t|y, zo )]. Here, we take an exponential dependence of the firing rate on the distance between the membrane potential and firing threshold ϑ [12]:   u−ϑ g[u] = ρ0 exp , (13) ∆u with the instantaneous firing rate at threshold ρ0 = 0.01 ms−1 and ϑ = 15 mV. The smoothness of the threshold was set to ∆uo = 0.2 mV for output layer neurons and ∆uh = 2 mV for hidden layer neurons. In the limit ∆u → 0 the deterministic LIF model can be recovered [12]. Our choice of ∆uh > ∆uo was motivated by the need for increased variation in hidden neuron spiking for learning to succeed, as indicated by preliminary results. Taking an exponential dependence of the firing rate on the membrane potential represents one choice for distributing output spikes; alternative functional dependencies exist, such as the Arrhenius & Current model [47], which we have previously applied to learning temporally precise spiking patterns in [46]. Learning rule We initially derive weight update rules for the connections between the hidden and output layers, as originally shown by Pfister et al. [14]. We then extend our analysis to include weight updates between the input and hidden layers using backpropagation, that is our novel contribution of a multilayer learning rule in a network of spiking neurons. In our notation, input layer neurons are indexed as i, hidden neurons h and output neurons o. Objective function. Implementing stochastic spiking neurons allows us to determine the likelihood of generating a prescribed target spike train. Specifically, the probability density of an output neuron o generating a list of target output spikes zoref = {t̃1o , t̃2o , ...} in response to a hidden spike pattern y is given by [14]: Z T  ref ref P (zo |y) = exp log (ρo (t|y, zo )) Zo (t) − ρo (t|y, zo )dt , (14) 0 P where Zoref (t) = f δ(t − t̃fo ) and T is the duration over which y is presented. It is noted that output neuron activity implicitly depends on variable hidden layer activity through the functional dependence ρo (t) = g[uo (t)] (c.f. Eqs. 11 and 13). For more than one output neuron, the probability density of generating a spatio-temporal target output pattern zoref ∈ zref is given by Y P (zref |y) = P (zoref |y) o = exp XZ o T  log (ρo (t|y, zo )) Zoref (t) − ρo (t|y, zo )dt . 0 23 (15) Taking the logarithm of Eq. 15 provides us with an objective function, that is a smooth function of the network parameters: log P (zref |y) = T XZ log (ρo (t|y, zo )) Zoref (t) − ρo (t|y, zo )dt . (16) 0 o By gradient ascent we seek to optimize the above function, through adjusting plastic parameters in the network. Here, we focus on changing the values of synaptic weights, although other network parameters such as conduction delays might also be trained. Output weight updates. Taking the positive gradient of the log-likelihood (Eq. 16) provides us with the direction of weight updates for neurons in the output layer, such that the expectation of generating a target output pattern zref is increased, i.e.: ∆woh = ηo ∂ log P (zref |y) , ∂woh (17) where ηo is the output layer learning rate. The derivative of the log-likelihood can be found as ∂ log P (zref |y) = ∂woh Z T 0  ρ0o (t|y, zo )  ref Zo (t) − ρo (t|y, zo ) (Yh ∗ )(t)dt , ρo (t|y, zo ) (18) 0 where ρ0o (t|y, zo ) = dg(u) du |u=uo (t|y,zo ) , and (Yh ∗ )(t) is the convolution of the hidden spike train Yh (t ) 0 with the PSP kernel (t − t ) that is defined in Eq. 2. Given our choice of an exponential dependence for the firing rate on the membrane potential, defined in Eq. 13, it follows that 1 ρ0o (t|y, zo ) = , ρo (t|y, zo ) ∆uo (19) hence combining Eqs. 17, 18 and 19 provides the output layer weight update rule: ∆woh ηo = ∆uo Z T  ref  Zo (t) − ρo (t|y, zo ) (Yh ∗ )(t)dt . (20) 0 We define the backpropagated error signal δo for the oth output neuron as  1  ref Zo (t) − ρo (t|y, zo ) , ∆uo δo (t|y, zo ) := (21) that is substituted into Eq. 20 for compactness: Z T δo (t|y, zo ) (Yh ∗ )(t) dt . ∆woh = ηo (22) 0 The above supervised learning rule was originally derived by Pfister et al. [14] for a single-layer network, that optimizes the log-likelihood of generating a desired postsynaptic spike train in response to a given input pattern. Hidden weight updates. Continuing through to the hidden layer, weights between input and hidden layer neurons are updated according to ∆whi = ηh ∂ log P (zref |y) , ∂whi 24 (23) where ηh is the hidden layer learning rate. Using Eq. 16, and by making use of the chain rule, the gradient of the log-likelihood with respect to hidden layer weights can be expressed as Z  ∂ log P (zref |y) X T ∂  = log (ρo (t|y, zo )) Zoref (t) − ρo (t|y, zo ) dt ∂whi 0 ∂whi o Z X T ρ0 (t|y, zo )   ∂uo (t|y, zo ) o Zoref (t) − ρo (t|y, zo ) dt . (24) = ∂whi 0 ρo (t|y, zo ) o Using Eqs. 19 and 21, the above can be compacted: Z ∂ log P (zref |y) X T ∂uo (t|y, zo ) δo (t|y, zo ) = dt . ∂whi ∂whi 0 o (25) The membrane potential of an output layer neuron has a dependence on the firing activity of neurons in the hidden layer according to Eq. 11, hence the second term on the right-hand side of Eq. 25 can be rewritten as ∂uo (t|y, zo ) ∂ = woh (Yh ∗ )(t) . (26) ∂whi ∂whi Weights changes take place on a time scale of T  τm , therefore the gradient of the convolution (Yh ∗ )(t) can be well approximated by Z t ∂ ∂Yh (t0 ) (Yh ∗ )(t) ≈ (t − t0 )dt0 . (27) ∂whi ∂w hi 0 The spike train Yh (t0 ) is a discontinuous random variable with no smooth dependence on network 0 h (t ) parameters, leaving the gradient ∂Y ∂whi difficult to solve analytically. Therefore, applying the technique used in [18], we heuristically make the substitution Yh (t0 ) → hYh (t0 )iyh |x , that is the expectation of the hidden spike train Yh (t0 ) conditioned on the input pattern x. The expectation of Yh (t0 ) has a smooth dependence on network parameters, and its gradient is given by: Z ∂ hYh (t0 )iyh |x ∂ = Q(t0 )P (yh = q|x)dq ∂whi ∂whi Z ∂ log P (yh = q|x) = S(t0 )P (yh = q|x) dq , (28) ∂whi log P ∂P = ∂∂w , the integral runs over all possible lists of spikes where we have used the relation P1 ∂w hi hi P q(t0 ) = {t1 , t2 , ..., t̂ < t0 } up to time t0 and Q(t0 ) = tf ∈q δ(t0 − tf ) is a spike train. P (yh = q|x) is the probability density of the list of hidden spikes yh being equal to q, conditioned on x. The probability density or likelihood of a hidden neuron generating a list of spikes q up to t0 in response to x is defined similarly to equation 14:  Z t0  P (yh = q|x) = exp log (ρh (s|x, q)) Q(s) − ρh (s|x, q) ds , (29) 0 and the gradient of the log-likelihood: ∂ log P (yh = q|x) 1 = ∂whi ∆uh Z t0 [Q(s) − ρh (s|x, q)] (Xi ∗ )(t) ds . (30) 0 Hence, Eq. 28 becomes: ∂ hYh (t0 )iyh |x ∂whi 1 = ∆uh Z Z 0 ! [Q(s) − ρh (s|x, q)] (Xi ∗ )(t) ds dq , S(t )P (yh = q|x) 0 25 t0 (31) such that a spike generated by the neuron at time t0 depends not only on recent input spikes, but also on its own entire spiking history q through the integration between times 0 and t0 . The above can be simplified if we choose to neglect the neuron’s firing history by taking the last hidden spike time t̂0h < t0 as given, that allows the substitution Yh (t0 ) → hYh (t0 )iyh |x,t̂0 for the h expectation of the hidden spike train Yh (t0 ) conditioned on both the input x and t̂0h [18]. In this case, neglecting the neuron’s firing history is not an unreasonable choice, given that the gradient of Yh (t0 ) is convolved by the exponential PSP kernel  in Eq. 27 that already captures the recent firing history of the neuron. Hence, the gradient of the hidden spike train in Eq. 27 can instead be expressed in terms of the value of a spike train Q at each point in time: ∂ hYh (t0 )iyh |x,t̂0 h = ∂whi ∂ ∂whi X Q(t0 )P (yh = q|x, t̂0h ) Q∈{0,δ(t0 )} = δ(t0 − t̂0 ) ∂ρh (t0 |x, t̂0h ) , ∂whi (32) where we have used the identity P (yh = q|x, t̂0h ) = ρh (t0 |x, t̂0h ) and δ(t0 − t̂0 ) is the Dirac distribution as a function of a last spike t̂0 . Using Eqs. 11 and 13 we find: ∂ hYh (t0 )iyh |x,t̂0 h ∂whi 1 δ(t0 − t̂0 )ρh (t0 |x, t̂0h )(Xi ∗ )(t0 ) ∆uh 1 = hYh (Xi ∗ )iyh |x,t̂0 . h ∆uh = (33) On each learning episode, our best estimate for the expected gradient comes from considering the current observation of yh given x; hence, the expectation can be dropped and the above can be combined with Eqs. 26 and 27 to give ∂uo (t|y, zo ) woh = ([Yh (Xi ∗ )] ∗ )(t) , (34) ∂whi ∆uh where we have defined a double convolution as: "Z 0 # Z t t 0 00 0 00 00 ([Yh (Xi ∗ )] ∗ )(t) ≡ Yh (t ) Xi (t )(t − t )dt (t − t0 )dt0 . (35) 0 0 Finally, combining Eq. 34 with Eqs. 23 and 25 provides the hidden layer weight update rule: Z T ηh X woh δo (t|y, zo )([Yh (Xi ∗ )] ∗ )(t)dt . ∆whi = ∆uh o 0 (36) Synaptic scaling For hidden layer weight updates to take place, a degree of background hidden neuron spiking is necessary during learning. This condition can be satisfied if we apply synaptic scaling to hidden layer weights, that has previously been shown to maintain a homeostatic firing rate and introduce competition between afferent connections [42]. Therefore, in addition to Eq. 36, hidden weights are modified at the end of each learning episode by the scaling rule: ( γ |whi | (νmax − νh ) if νh > νmax ∆whi = (37) γ |whi | (νmin − νh ) if νh < νmin , where γ = 1 × 10−2 is the scaling strength, νh the actual firing rate of the hth hidden neuron and νmax = 40 Hz and νmax = 2 Hz the maximum and minimum reference firing rates respectively. The above drives the firing rate of each hidden neuron to remain within the range 2 ≤ νh ≤ 40 Hz, that makes the network less sensitive to its initial state and prevents extremes in the firing activity of hidden neurons [13]. 26 Pattern statistics Input patterns were presented to the network by ni = 100 input layer neurons, where each input neuron contained an independent Poisson spike train with a mean firing rate of 6 Hz. A relative refractory period with a time constant of 10 ms was simulated when generating each spike train for biological realism. A random realization of each input pattern was used, for a total of p different patterns. Learning took place on an episodic basis, where each episode corresponded to the presentation of an input pattern to the network lasting duration T = 500 ms. The order in which input patterns were presented was random. Unless otherwise stated, simulations were run over 1000p episodes to ensure a sufficient amount of time for the network to learn the desired number of inputs. Hence, on average, each input pattern was presented 1000 times. Every input pattern was associated with a target output pattern, and multiple inputs belonging to the same class shared the same target output. A target output pattern consisted of a predetermined spike train at each output neuron, and target spike trains contained the same number of spikes ns ∈ {1, 10} at each output that depended on the learning task. Target spike trains were initialized by randomly selecting each target spike time t̃f from a uniform distribution over the interval t̃f ∈ [40, T ) ms, with an interspike separation of at least 10 ms to avoid conflicted output responses during learning. A minimum target spike-timing of 40 ms was taken given the evidence that values t̃f < 4τm led to reduced performance [24]. At each output neuron, target spike trains differed from each other by a minimum distance of Dmin > ns /2 to ensure each input class was assigned a unique target response, and to reduce crosstalk during learning. The minimum distance scaled with the number of target output spikes, which increased the separation between classes. For our definition of Dmin and choice of T , a maximum of c = 66 classes identified by a single target output spike was supported, and more correspondingly for multiple target output spikes. Pattern recognition Networks were trained to classify input patterns by the timing of output spikes, such that multiple inputs belonging to the same class shared the same target output. Target outputs were randomly set at the start of each simulation, and networks were trained to assign p input patterns between c classes. For each class, a target output contained between one and ten spikes, depending on the learning task. Instead of relying on precisely matched actual and target output spike trains to classify inputs, we instead allowed for sufficiently accurate output spike trains, that were closer to their desired targets in comparison with any other potential target. In discriminating between different classes of input patterns we used the van Rossum Distance (vRD) [48], that is a metric for the temporal distance between two spike trains. From considering Pa list of spikes tf ∈ z, the vRD is computed by first performing a convolution over a spike train Z(t) = f δ(t − tf ) with an exponential function: Z̃(t) = X f t − tf exp − τc   Θ(t − tf ) , (38) where we set the coincidence time constant τc = 10 ms. Hence, using the above, we can obtain Z̃o and Z̃oref from Zo and Zoref , that are the actual and target output spike trains of an output neuron o respectively. The vRD can then be determined from the definition [48]: Z 1 ∞ [Z̃o (t) − Z̃oref (t)]2 dt . (39) D(Zo , Zoref ) = τc 0 Using Eq. 39, the vRD between an output generated by the network and every potential target output is computed, giving the list of distances D = {D1 , D2 , ..., Dc } for a total of c different classes. A correct classification of the input is then made if its target class label l matches the index of the minimum distance, that is if l = arg mini D for Di ∈ D. 27 For a network containing more than one output neuron, responses consist of spatio-temporal output patterns Zo ∈ Z with corresponding target outputs Zoref ∈ Zref . To compute the distance between two spatio-temporal spike patterns, the vRD is summed over every output neuron: Z 1 X ∞ ref [Z̃o (t) − Z̃oref (t)]2 dt , (40) D(Z, Z ) = τc o 0 and is determined with respect to each class. Similarly to a network containing a single output neuron, a correct classification of an input is made if its target class label matches the index of the minimum spatio-temporal distance. Performance and convergence measures The classification performance of the network was taken as an exponential moving average P̃c up to the nth episode, given by P̃c (n) = (1 − λ)P̃c (n − 1) + λPc (n). On each episode, the performance either took a value of Pc = 100 % for a correct input classification or otherwise Pc = 0 (c.f. Pattern recognition). The timing parameter was taken as λ = 2/(1 + 20p), which corresponded to an averaging window of 20p for a total of p input patterns. The vRD was also taken as a moving average D̃, with the same averaging window as used for P̃c . A moving average of each measure was necessary, given our choice of a stochastic neuron model that gave rise to fluctuating network responses between episodes. In our simulations we measured the number of episodes taken for the network to converge in learning, that was defined in terms of its classification performance P̃c . Specifically, given a total of N learning episodes, we considered that learning had converged on the nth episode for the first value P̃c (n) > 0.99 P̃c (N ), by which point the network performance fell within 1 % of its final value. In the case of the network failing to learn any input patterns, with P̃c (N ) = 0, the number of episodes to convergence was taken as 0. Simulation details In all simulations, we used a fixed number ni = 100 of input neurons and a variable number nh of hidden neurons. Depending on the learning task, either a single output neuron or multiple output neurons determined the response of the network to presented input patterns. The simulation time step was set to δt = 1 ms. Multilayer networks. In all simulations of a multilayer network, hidden layer synaptic weights were initialized by independently selecting each value from a uniform distribution over the range: whi ∈ [0, 3), that gave rise to an initial hidden neuron firing rate of ∼ 24 Hz. Output weights were initialized depending on the number of output neurons. During learning, hidden weights were constrained to the range: 0 ≤ |whi | ≤ 100, and were free to take either positive or negative values. To increase the number of eligible synapses available to the network, and to increase the diversity of hidden neuron spiking, axonal conduction delays were introduced between the input and hidden layers [1, 49]. Conduction delays were selected from a uniform distribution over the range dhi ∈ (0, 40] ms and rounded to the nearest 1 ms, where dhi was the conduction delay between the ith and hth input and hidden neurons respectively. Hence, a conduction delay dhi resulted in a PSP evoked at h due to an input spike tfi with an effective time course of (t − tfi − dhi ) (c.f. Eq. 12). Conduction delays were neglected between the hidden and output layers. Hidden and output layer learning rates were set to ηh = 4/(ni no ns ) and ηo = 0.02/nh respectively, where it was indicated through preliminary simulations that the dependence of ηh on the number of output neurons no and number of target output spikes ns dominated over the number of input patterns p. Both ηh and ηo depended on the number of afferent synapses: ni and nh respectively. Single outputs. In simulations of a multilayer network with a single output neuron, initial values of output synaptic weights were all set to the same value woh = 12/nh that drove the output firing rate to ∼ 1 Hz. Each initial value of woh was identical to allow equal contributions from every hidden layer 28 neuron at the start of learning. During learning, output weights were constrained to the range 0.01 ≤ woh ≤ 100; the lower bound of 0.01 was enforced to enable hidden weight updates to keep taking place, given that updates depended on output weight values according to ∆whi ∝ woh (Eq. 36). Values of woh were positive and prevented from changing sign during learning to ensure sufficient excitatory drive in the output neuron from the hidden layer. Preliminary simulations indicated that constraining output weights to positive values for a single output neuron had no adverse impact on learning. Multiple outputs. In simulations of a multilayer network with multiple output neurons, output synaptic weights were initialized by independently selecting each value from a uniform distribution over the range woh ∈ [0, 30/nh ), that drove the firing rate of each output neuron to ∼ 1 Hz. Randomizing output weights was necessary to increase the diversity between output responses, which improved learning in the initial stages of each simulation run. Output weights were constrained to the range 0 ≤ |woh | ≤ 100, and were allowed to change sign during learning. Single-layer networks. In simulations of a single-layer network, synaptic weights were initialized by independently selecting each value from a uniform distribution over the range w ∈ [0, 1.7), that gave rise to an initial output firing rate of ∼ 1 Hz. The learning rate was set to η = 4/ni and weights were constrained to the range 0 ≤ |woh | ≤ 100, where the values of weights were allowed to change sign during learning. For a closer comparison, the model and parameter set used to generate output spikes in the single-layer network matched those used to generate output spikes in the multilayer network. Acknowledgments BG was funded by EPSRC grant EP/J500562/1. AG and IS were funded by the Human Brain Project (HBP). References 1. Bohte S (2004) The evidence for neural information processing with precise spike-times: A survey. Natural Computing 3: 195–206. 2. Laurent G, Wehr M, Davidowitz H (1996) Temporal representations of odors in an olfactory network. The Journal of Neuroscience 16: 3837–3847. 3. Vickers NJ, Christensen TA, Baker TC, Hildebrand JG (2001) Odour-plume dynamics influence the brain’s olfactory code. Nature 410: 466–470. 4. Christopher deCharms R, Merzenich M (1996) Primary cortical representation of sounds by the coordination of action-potential timing. Nature 381: 13. 5. Knudsen EI (2002) Instructed learning in the auditory localization pathway of the barn owl. Nature 417: 322–328. 6. Caporale N, Dan Y (2008) Spike timing-dependent plasticity: a hebbian learning rule. Annu Rev Neurosci 31: 25–46. 7. Bi G, Poo M (1998) Synaptic modifications in cultured hippocampal neurons: dependence on spike timing, synaptic strength, and postsynaptic cell type. The Journal of Neuroscience 18: 10464–10472. 8. Sjöström PJ, Turrigiano GG, Nelson SB (2001) Rate, timing, and cooperativity jointly determine cortical synaptic plasticity. Neuron 32: 1149–1164. 29 9. Hebb DO (1949) The organization of behavior: A neuropsychological approach. John Wiley & Sons. 10. Gütig R (2014) To spike, or when to spike? Current Opinion in Neurobiology 25: 134–139. 11. Ponulak F, Kasinski A (2010) Supervised learning in spiking neural networks with resume: Sequence learning, classification, and spike shifting. Neural Computation 22: 467–510. 12. Gerstner W, Kistler W (2002) Spiking neuron models: Single neurons, populations, plasticity. Cambridge University Press, Cambridge. 13. Sporea I, Grüning A (2013) Supervised learning in multilayer spiking neural networks. Neural Computation 25: 473–509. 14. Pfister J, Toyoizumi T, Barber D, Gerstner W (2006) Optimal spike-timing-dependent plasticity for precise action potential firing in supervised learning. Neural Computation 18: 1318–1348. 15. Gardner B, Grüning A (2014) Classifying patterns in a spiking neural network. In: Proceedings of the 22nd European Symposium on Artificial Neural Networks (ESANN 2014), Springer. pp. 23–28. 16. Brea J, Senn W, Pfister JP (2013) Matching recall and storage in sequence learning with spiking neural networks. The Journal of Neuroscience 33: 9565–9575. 17. Urbanczik R, Senn W (2009) Reinforcement learning in populations of spiking neurons. Nature Neuroscience 12: 250–252. 18. Frémaux N, Sprekeler H, Gerstner W (2013) Reinforcement learning using a continuous time actor-critic framework with spiking neurons. PLoS Computational Biology 9: e1003024. 19. Pillow JW, Paninski L, Simoncelli EP (2004) Maximum likelihood estimation of a stochastic integrate-and-fire neural model. In: Advances in Neural Information Processing Systems. pp. 1311–1318. 20. Albers C, Westkott M, Pawelzik K (2013) Perfect associative learning with spike-timing-dependent plasticity. In: Advances in Neural Information Processing Systems. pp. 1709–1717. 21. Memmesheimer RM, Rubin R, Ölveczky BP, Sompolinsky H (2014) Learning precisely timed spikes. Neuron 82: 925–938. 22. Mohemmed A, Schliebs S, Matsuda S, Kasabov N (2012) Span: Spike pattern association neuron for learning spatio-temporal spike patterns. International Journal of Neural Systems 22. 23. Xu Y, Zeng X, Han L, Yang J (2013) A supervised multi-spike learning algorithm based on gradient descent for spiking neural networks. Neural Networks 43: 99–113. 24. Florian RV (2012) The chronotron: A neuron that learns to fire temporally precise spike patterns. PLoS ONE 7: e40233. 25. Gütig R, Sompolinsky H (2006) The tempotron: a neuron that learns spike timing–based decisions. Nature Neuroscience 9: 420–428. 26. Rezende DJ, Gerstner W (2014) Stochastic variational learning in recurrent spiking networks. Frontiers in Computational Neuroscience 8. 27. Faisal A, Selen L, Wolpert D (2008) Noise in the nervous system. Nature Reviews Neuroscience 9: 292–303. 28. Friedrich J, Urbanczik R, Senn W (2010) Learning spike-based population codes by reward and population feedback. Neural Computation 22: 1698–1717. 30 29. Friedrich J, Urbanczik R, Senn W (2011) Spatio-temporal credit assignment in neuronal population learning. PLoS Computational Biology 7: e1002092. 30. Grüning A, Sporea I (2012) Supervised learning of logical operations in layered spiking neural networks with spike train encoding. Neural Processing Letters 36: 117–134. 31. Seung HS (2003) Learning in spiking neural networks by reinforcement of stochastic synaptic transmission. Neuron 40: 1063–1073. 32. Grüning A (2007) Elman backpropagation as reinforcement for simple recurrent networks. Neural Computation 19: 3108–3131. 33. Knudsen E (1994) Supervised learning in the brain. Journal of Neuroscience 14: 3985–3997. 34. Seol GH, Ziburkus J, Huang S, Song L, Kim IT, et al. (2007) Neuromodulators control the polarity of spike-timing-dependent synaptic plasticity. Neuron 55: 919–929. 35. Schultz W, Dayan P, Montague PR (1997) A neural substrate of prediction and reward. Science 275: 1593–1599. 36. Schultz W (2000) Multiple reward signals in the brain. Nature Reviews Neuroscience 1: 199–207. 37. Reynolds JN, Wickens JR (2002) Dopamine-dependent plasticity of corticostriatal synapses. Neural Networks 15: 507–521. 38. Brea J, Senn W, Pfister JP (2011) Sequence learning with hidden units in spiking neural networks. In: Advances in Neural Information Processing Systems. pp. 1422–1430. 39. Jolivet R, Rauch A, Lüscher HR, Gerstner W (2006) Predicting spike timing of neocortical pyramidal neurons by simple threshold models. Journal of Computational Neuroscience 21: 35–49. 40. Florian R (2007) Reinforcement learning through modulation of spike-timing-dependent synaptic plasticity. Neural Computation 19: 1468–1502. 41. Frémaux N, Sprekeler H, Gerstner W (2010) Functional requirements for reward-modulated spike-timing-dependent plasticity. The Journal of Neuroscience 30: 13326–13337. 42. Van Rossum M, Bi G, Turrigiano G (2000) Stable Hebbian learning from spike timing-dependent plasticity. The Journal of Neuroscience 20: 8812–8821. 43. Turrigiano GG, Leslie KR, Desai NS, Rutherford LC, Nelson SB (1998) Activity-dependent scaling of quantal amplitude in neocortical neurons. Nature 391: 892–896. 44. Izhikevich E (2007) Solving the distal reward problem through linkage of stdp and dopamine signaling. Cerebral Cortex 17: 2443–2452. 45. Farries M, Fairhall A (2007) Reinforcement learning with modulated spike timing–dependent synaptic plasticity. Journal of Neurophysiology 98: 3648–3665. 46. Gardner B, Grüning A (2013) Learning temporally precise spiking patterns through reward modulated spike-timing-dependent plasticity. In: Artificial Neural Networks and Machine Learning–ICANN 2013, Springer. pp. 256–263. 47. Plesser H, Gerstner W (2000) Noise in integrate-and-fire neurons: from stochastic input to escape rates. Neural Computation 12: 367–384. 48. Rossum M (2001) A novel spike distance. Neural Computation 13: 751–763. 49. Izhikevich EM (2006) Polychronization: Computation with spikes. Neural Computation 18: 245–282. 31
9cs.NE
Matchings with lower quotas: Algorithms and complexity⋆ arXiv:1412.0325v5 [cs.DM] 27 Mar 2016 Ashwin Arulselvan1 , Ágnes Cseh2 , Martin Groß3 , David F. Manlove4 , and Jannik Matuschke5 1 5 Department of Management Science, University of Strathclyde, UK [email protected] 2 School of Computer Science, Reykjavik University, Iceland [email protected] 3 Institute for Mathematics, TU Berlin, Germany [email protected] 4 School of Computing Science, University of Glasgow, UK [email protected] TUM School of Management, Technische Universität München, Germany [email protected] Abstract. We study a natural generalization of the maximum weight many-to-one matching problem. We are given an undirected bipartite graph G = (A ∪˙ P, E) with weights on the edges in E, and with lower and upper quotas on the vertices in P . We seek a maximum weight many-toone matching satisfying two sets of constraints: vertices in A are incident to at most one matching edge, while vertices in P are either unmatched or they are incident to a number of matching edges between their lower and upper quota. This problem, which we call maximum weight many-to-one matching with lower and upper quotas (wmlq), has applications to the assignment of students to projects within university courses, where there are constraints on the minimum and maximum numbers of students that must be assigned to each project. In this paper, we provide a comprehensive analysis of the complexity of wmlq from the viewpoints of classical polynomial time algorithms, fixed-parameter tractability, as well as approximability. We draw the line between NP-hard and polynomially tractable instances in terms of degree and quota constraints and provide efficient algorithms to solve the tractable ones. We further show that the problem can be solved in polynomial time for instances with bounded treewidth; however, the corresponding runtime is exponential in the treewidth with the maximum upper quota umax as basis, and we prove that this dependence is necessary unless FPT = W[1]. The approximability of wmlq is also discussed: ⋆ A preliminary version of this paper appeared at the 26th International Symposium on Algorithms and Computation (ISAAC 2015). The authors were supported by the Deutsche Telekom Stiftung, COST Action IC1205 on Computational Social Choice, DFG within project A07 of CRC TRR 154, EPSRC grant EP/K010042/1, DAAD with funds of BMBF and the EU Marie Curie Actions. Part of this work was carried out whilst Á. Cseh was visiting the University of Glasgow. we present an approximation algorithm for the general case with performance guarantee umax + 1, which is asymptotically best possible unless P = NP. Finally, we elaborate on how most of our positive results carry over to matchings in arbitrary graphs with lower quotas. 1 Introduction Many university courses involve some element of team-based project work. A set of projects is available for a course and each student submits a subset of projects as acceptable. For each acceptable student–project pair (s, p), there is a weight w(s, p) denoting the utility of assigning s to p. The question of whether a given project can run is often contingent on the number of students assigned to it. Such quota constraints also arise in various other contexts involving the centralized formation of groups, including organizing team-based activities at a leisure center, opening facilities to serve a community and coordinating rides within car-sharing systems. In these and similar applications, the goal is to maximize the utility of the assigned agents under the assumption that the number of participants for each open activity is within the activity’s prescribed limits. We model this problem using a weighted bipartite graph G = (A ∪˙ P, E), where the vertices in A represent applicants, while the vertices in P are posts they are applying to. So in the above student–project allocation example, A and P represent the students and projects respectively, and E represents the set of acceptable student–project pairs. The edge weights capture the cardinal utilities of an assigned applicant–post pair. Each post has a lower and an upper quota on the number of applicants to be assigned to it, while each applicant can be assigned to at most one post. In a feasible assignment, a post is either open or closed : the number of applicants assigned to an open post must lie between its lower and upper quota, whilst a closed post has no assigned applicant. The objective is to find a maximum weight many-to-one matching satisfying all lower and upper quotas. We denote this problem by wmlq. In this paper, we study the computational complexity of wmlq from various perspectives. We begin by defining the problem formally in Section 2. Then in Section 3, we show that wmlq can be solved efficiently if the degree of every post is at most 2, whereas the problem becomes hard as soon as posts with degree 3 are permitted, even when lower and upper quotas are all equal to the degree, and every applicant has a degree of 2. Furthermore, we show the tractability of the case of pair projects, i.e., when all upper quotas are at most 2. In Section 4, we study the fixed parameter tractability of wmlq. To this end, we generalize the known dynamic program for maximum independent set with bounded treewidth to wmlq. The running time of our algorithm is exponential in the treewidth of the graph, with umax , the maximum upper quota of any vertex, as the basis. This yields a fixed-parameter algorithm when parameterized by both the treewidth and umax . We show that this exponential dependence on the treewidth cannot be completely separated from the remaining input by establishing a W [1]-hardness result for wmlq parameterized by treewidth. Finally, in Section 5, we discuss the approximability of the problem. We show that a simple p greedy algorithm yields an approximation guarantee of umax +1 for wmlq and |A|+1 in the case of unit edge weights. We complement these results by showing that these approximation factors are asymptotically best possible, unless P = NP. We briefly comment on the generalizability our aforementioned results in Section 6 for matchings in arbitrary graphs with lower quotas. 1.1 Related work Among various applications of centralized group formation, perhaps the assignment of medical students to hospitals has received the most attention. In this context, as well as others, the underlying model is a bipartite matching problem involving lower and upper quotas. The Hospitals / Residents problem with Lower Quotas (hrlq) [3, 12] is a variant of wmlq where applicants and posts have ordinal preferences over one another, and we seek a stable matching of residents to hospitals. Hamada et al. [12] considered a version of hrlq where hospitals cannot be closed, whereas the model of Biró et al. [3] permitted hospital closures. Strategyproof mechanisms have also been studied in instances with ordinal preferences and no hospital closures [7, 10, 11]. The Student / Project Allocation problem [19, Section 5.6] models the assignment of students to projects offered by lecturers subject to upper and lower quota restrictions on projects and lecturers. Several previous papers have considered the case of ordinal preferences involving students and lecturers [1, 13, 20] but without allowing lower quotas. However two recent papers [14, 21] do permit lower quotas together with project closures, both in the absence of lecturer preferences. Monte and Tumennasan [21] considered the case where each student finds every project acceptable, and showed how to modify the classical “serial dictatorship” mechanism to find a Pareto optimal matching. Kamiyama [14] generalized this mechanism to the case where students need not find all projects acceptable, and where there may be additional restrictions on the sets of students that can be matched to certain projects. This paper also permits lower quotas and project closures, but our focus is on cardinal utilities rather than ordinal preferences. The unit-weight version of wmlq is also closely related to the D-matching problem [6, 18, 25], a variant of graph factor problems [23]. In an instance of the D-matching problem, we are given a graph G, and a domain of integers is assigned to each vertex. The goal is to find a subgraph G′ of G such that every vertex has a degree in G′ that is contained in its domain. Lovász [17] showed that the problem of deciding whether such a subgraph exists is NP-complete, even if each domain is either {1} or {0, 3}. On the other hand, some cases are tractable. For example, if for each domain D, the complement of D contains no consecutive integers, the problem is polynomially solvable [25]. As observed in [24], D-matchings are closely related to extended global cardinality constraints and the authors provided an analysis of the fixed-parameter tractability of a special case of the D-matching problem; see Section 4 for details. The problem that we study in this paper corresponds to an optimization version of the D-matching problem. We consider the special case where G is bipartite and the domain of each applicant vertex is {0, 1}, whilst the domain of each post vertex p is {0} ∪ {ℓ(p), . . . , u(p)}, where ℓ(p) and u(p) denote the lower and upper quotas of p respectively. Since the empty matching is always feasible in our case, our aim is to find a domain-compatible subgraph G′ such that the total weight of the edges in G′ is maximum. 2 Problem definition In this section we provide a formal definition of the maximum weight many-toone matching problem with lower quotas (wmlq). Basic notation Let G = (V, E) be a graph. For a subset of vertices U ⊆ V we denote by δ(U ) = {{v, w} ∈ E : v ∈ U, w ∈ V \ U } the set of edges incident to exactly one vertex in U . For a vertex v ∈ V , we write δ(v) = δ({v}), and for a subset of edges F ⊆ E we write degF (v) = |δ(v) ∩ F |. By Γ (v) = {w ∈ V : {v, w} ∈ E} we denote the neighborhood of v, i.e., the set of vertices that are adjacent to v. In our problem, a set of applicants A and a set of posts P are given. A and P constitute the two vertex sets of an undirected bipartite graph G = (V, E) with V = A ∪˙ P and E represents the set of acceptable applicant-post pairs. Each edge carries a weight w : E → R≥0 , representing the utility of the corresponding assignment. The set of posts is equipped with functions ℓ : P → Z≥0 and u : P → Z≥0 such that ℓ(p) ≤ u(p) for every p ∈ P . Here ℓ(p) is called the lower quota of p and u(p) is called the upper quota of p. These functions bound the number of admissible applicants for the post (independent of the weight of the corresponding edges). Furthermore, every applicant can be assigned to at most one post. Thus, an assignment is a subset M ⊆ E of the edges such that |δ(a) ∩ M | ≤ 1 for every applicant a ∈ A and |δ(p) ∩ M | ∈ {0, ℓ(p), ℓ(p) + 1, ..., u(p)} for every p ∈ P . With respect to an assignment M , a post is said to be open if the number of applicants assigned to it is greater than 0, and closed otherwise. The size of an assignment M , denoted |M |, is the number of assigned applicants, while theP weight of M , denoted w(M ), is the total weight of the edges in M , i.e., w(M ) = e∈M w(e). The goal is to find an assignment of maximum weight. Remark 1. Note that when not allowing closed posts, the problem immediately becomes tractable. It is easy to see this in the unweighted case as any algorithm for maximum flow with lower capacities can be used to determine an optimal solution in polynomial time. Maximum flow with lower capacities can be easily reduced to the classical maximum flow problem. The method can be naturally extended to the weighted case as the flow-based linear program has integral extreme points due to its total unimodularity property. Problem 1 wmlq Input: I = (G, w, ℓ, u); a bipartite graph G = (A ∪˙ P, E) with edge weights w, lower quotas ℓ and upper quotas u. Task: Find an assignment of maximum weight. If w(e) = 1 for all e ∈ E, we refer to the problem as mlq. Some trivial simplification of the instance can be executed right at the start. If u(p) > |Γ (p)| for a post p, then u(p) can be replaced by |Γ (p)|. On the other hand, if ℓ(p) > |Γ (p)|, then post p can immediately be deleted, since no feasible solution can satisfy the lower quota condition. Moreover, a post p with ℓ(p) = 1 behaves identically to the case that ℓ(p) = 0, so we assume that no post p has ℓ(p) = 1. From now on we assume that the instances have already been simplified this way. 3 Degree- and quota-restricted cases In this section we characterize the complexity of wmlq in the presence of upper bounds placed on vertex degrees or the posts’ upper quotas. Section 3.1 deals with degree-restricted cases, whilst Section 3.2 studies cases involving bounded upper quotas. 3.1 Degree-restricted cases In this subsection we will consider wmlq(i, j), the special case of wmlq in which |Γ (a)| ≤ i for all a ∈ A, and |Γ (p)| ≤ j for all p ∈ P . That is, every applicant submits at most i applications and every post receives at most j applications. In order to establish our first result, we reduce the maximum independent set problem (mis) to mlq. In mis, a graph with n vertices and m edges is given and the task is to find an independent vertex set of maximum size. mis is not approximable within a factor of n1−ε for any ε > 0, unless P = NP [27]. The problem remains APX-complete even for cubic (3-regular) graphs [2]. Theorem 2. mlq(2,3) is APX-complete. Proof. First of all, mlq(2,3) is in APX because the problem has a 4-approximation that can be found in polynomial time (see Theorem 9). To each instance I of mis on cubic graphs we create an instance I ′ of mlq such that there is an independent vertex set of size at least K in I if and only if I ′ admits an assignment of size at least 3K, yielding an approximation-preserving reduction. The construction is as follows. To each of the n vertices of graph G in I, a post with upper and lower quota of 3 is created. The m edges of G are represented as m applicants in I ′ . For each applicant a ∈ A, |Γ (a)| = 2 and Γ (a) comprises the two posts representing the two end vertices of the corresponding edge. Since we work on cubic graphs, |Γ (p)| = 3 for every post p ∈ P . First we show that an independent vertex set of size K can be transformed into an assignment of at least 3K applicants. All we need to do is to open a post with its entire neighborhood assigned to it if and only if the vertex representing that post is in the independent set. Since no two posts stand for adjacent vertices in G, their neighborhoods do not intersect. Moreover, the assignment assigns exactly three applicants to each of the K open posts. To establish the opposite direction, let us assume that an assignment of cardinality at least 3K is given. The posts’ upper and lower quota are both set to 3, therefore, the assignment involves at least K open posts. No two of them can represent adjacent vertices in G, because then the applicant standing for the edge connecting them would be assigned to both posts at the same time. Note that every solution of the constructed instance of mlq serves an integer multiple of 3 applicants. In particular, the mlq instance has a solution serving 3K applicants if and only if there is an independent set of size K in the mis instance. Hence, this reduction preserves the approximation factors. Since mlq(2,3) belongs to APX and mis is APX-complete in cubic graphs, it follows that mlq(2,3) is APX-complete. ⊓ ⊔ So far we have established that if |Γ (a)| ≤ 2 for every applicant a ∈ A and |Γ (p)| ≤ 3 for every post p ∈ P , then mlq is NP-hard. In the following, we also show that these restrictions are the tightest possible. If |Γ (p)| ≤ 2 for every post p ∈ P , then a maximum weight matching can be found efficiently, regardless of |Γ (a)|. Note that the case wmlq(1,∞) is trivially solvable. Theorem 3. wmlq(∞,2) is solvable in O(n2 log n) time, where n = |A| + |P |. Proof. After executing the simplification steps described at the end of Section 2, we apply two more changes to derive our helper graph H. Firstly, if ℓ(p) = 0, u(p) = 2 and |Γ (p)| = 2, we separate p’s two edges, splitting p into two posts with upper quota 1. After this step, all posts with u(p) = 2 also have ℓ(p) = 2. All remaining vertices are of upper quota 1. Then, we substitute all edge pairs of posts with ℓ(p) = u(p) = 2 with a single edge connecting the two applicants. This edge will carry the weight equal to the sum of the weights of the two deleted edges. Clearly, any matching in H translates into an assignment of the same weight in G and vice versa. Finding a maximum weight matching in a general graph with n vertices and m edges can be done in O(n(m + n log n)) time [9], which reduces to O(n2 log n) in our case. ⊓ ⊔ 3.2 Quota-restricted cases In this section, we consider restrictions of wmlq with bounded upper quotas. Note that Theorem 2 already tells us that the case of u(p) ≤ 3 for all posts p ∈ P is NP-hard to solve. We will now settle the complexity of the only remaining case, where we have instances with every post p ∈ P having an arbitrary degree and u(p) ≤ 2. This setting models posts that need to be assigned to none, one or pairs of applicants. Here we present a solution for wmlq with u(p) ≤ 2. Our algorithm is based on f -factors of graphs. In the f -factor problem, a graph G and a function f : V → Z≥0 is given. A set of edges F ⊆ E is called an f -factor if degF (v) = f (v) for every v ∈ V , where degF (v), as per our earlier definition, is the degree of v in the graph (V, F ). Constructing an f -factor of maximum weight in a graph with n vertices and m edges or proving that none exists can be done in O(φ(m+n log n)) time, where φ is the sum of all f -values in the graph [8, 9]. Theorem 4. wmlq with u(p) ≤ 2 for every p ∈ P can be solved in O(nm + n2 log n) time, where n = |V | and m = |E|. Proof. We partition P into P1 and P \ P1 , where P1 denotes the set of posts with u(p) = 1. For posts in P \ P1 we can assume that ℓ(p) = u(p) = 2 for every post p. For, a post p with ℓ(p) = 0 and u(p) = 2 can be transformed into a post with ℓ(p) = u(p) = 2 by giving it two dummy edges with zero weight, allowing us to pick the dummy edges in order to make up for the raised lower quota. The graph G′ = (V ′ , E ′ ) of the constructed f -factor instance contains the graph G = (V, E) of our wmlq instance, as shown in Fig. 1. We add a dummy post pd to V ′ and connect it to every applicant in A. We connect every post pi ∈ P1 to pd . For every post pi ∈ P \P1 we add two dummy vertices qi1 and qi2 and a triangle on the vertices pi , qi1 and qi2 . All new edges in E ′ \ E carry zero weight. We set f (pd ) = K, f (p) = u(p) for every p ∈ P and f (v) = 1 for the rest of the vertices. In the initial version of our algorithm, we solve a weighted f -factor problem for every K ∈ {0, 1, ..., |A| + |P1 |}, and later we will show a slightly modified version of the f -factor instance so that it is sufficient to construct only two instances. q11 pd q12 q41 p1 a1 p2 a2 p3 a3 q42 q51 p4 a4 q52 p5 a5 a6 Fig. 1. The transformation from wmlq to an f -factor problem. The solid edges form G, while the dotted edges are the added ones, carrying weight 0. Here, P1 = {p2 , p3 } and P \P1 = {p1 , p4 , p5 }. First we show that if there is a feasible assignment M in G so that the number of unmatched applicants and the number of closed posts in P1 add up to K, then it can be extended to an f -factor M ′ of the same weight in G′ . We construct M ′ starting with M and then adding the following edges to it: – – – – {pd , ai }  1 qi1 , p2i qi , qi {pd , pi } for every applicant ai that is unmatched in M ;  and qi2 , pi for every post pi ∈ P \P1 that is closed in M ; for every post pi ∈ P \P1 that is open in M ; for every post pi ∈ P1 that is closed in M ; For all vertices v 6= pd , it immediately follows from the construction that degM ′ (v) = f (v). The same holds for pd as well, because an edge is assigned to it either because an applicant is unmatched or because a post in P1 is closed and we assumed that these add up to K. It is easy to see that if there is an f -factor M ′ in G′ , then its restriction to G is a feasible assignment M of the same weight so that the number of unmatched applicants and the number of closed posts in P1 add up to K. Since every post pi ∈ P1 is connected to pd and f (pi ) = 1, it is either the case that pi is open in M or {pd , pi } ∈ M ′ . Regarding posts outside of P1 , we need to show that the two edges incident to them are either both in G or neither of them are in G. Assume without loss of generality that {pi , qi1 } ∈ M ′ and {pi , qi2 } ∈ / M ′ for some 2 2 ′ pi ∈ / P1 . Since f (qi ) = 1 and degM ′ (qi ) = 0, M cannot be an f -factor. So far we have shown that it is sufficient to test |A| + |P1 | + 1 values for f (pd ), and collect the optimal assignments given by the maximum weight f factors. Comparing the weight of these locally optimal solutions delivers a global optimum. A slight modification on the the graph corresponding to the f -factor instance will allow us to solve the problem by constructing just two instances, as against |A| + |P1 | + 1 instances. Similar to the triangles attached to posts in P \ P1 , triangles are added to pd as well. The added vertices have f -value 1 and l the added m edges carry weight 0. The number of such triangles hanging on pd |A|+|P1 | is . These triangles can take up all the f -value of pd if necessary, but by 2 choosing the edge not incident to pd they can also allow pd to fill up its f -value with other edges. Since a triangle either takes up 0 or 2 of pd ’s f -value, we need to separate the two different parity cases. Thus, to cover all the |A| + |P1 | + 1 cases for possible values for f (pd ), in one instance we set f (pd ) to |A| + |P1 | + 1 and in the other instance f (pd ) = |A| + |P1 |. ⊓ ⊔ 4 Bounded treewidth graphs In this section, we investigate wmlq from the point of view of fixed-parameter tractability and analyze how efficiently the problem can be solved for instances with a bounded treewidth. Fixed-parameter tractability. This field of complexity theory is motivated by the fact that in many applications of optimization problems certain input parameters stay small even for large instances. A problem, parameterized by a parameter k, is fixed-parameter tractable (FPT) if there is an algorithm solving it in time f (k) · φ(n), where f : R → R is a function, φ is a polynomial function, and n is the input size of the instance. Note that this definition not only requires that the problem can be solved in polynomial time for instances where k is bounded by a constant, but also that the dependence of the running time on k is separable from the part depending on the input size. On the other hand, if a problem is shown to be W[1]-hard, then the latter property can only be fulfilled if FPT = W[1], which would imply NP ⊆ DTIME(2o(n) ). For more details on fixed-parameter algorithms see, e.g., [22]. Treewidth. In case of wmlq we focus on the parameter treewidth, which, on an intuitive level, describes the likeness of a graph to a tree. A tree decomposition of graph G consists of a tree whose nodes—also called bags—are subsets of V (G). These must satisfy the following three requirements. 1. Every vertex of G belongs to at least one bag of the tree. 2. For every edge {a, p} ∈ E(G), there is a bag containing both a and p. 3. If a vertex in V (G) occurs in two bags of the tree, then it also occurs in all bags on the unique tree-path connecting them. The width of a tree decomposition with a set of bags B is maxB∈B |B| − 1. The treewidth of a graph G, tw(G), is the smallest width among all tree decompositions of G. It is well known that a tree decomposition of smallest width can be found by a fixed-parameter algorithm when parameterized by tw(G) [4]. In the following, we show that wmlq is fixed-parameter tractable when parameterized simultaneously by the treewidth and umax , whereas it remains W [1]-hard when only parameterized by the treewidth. A similar study of the fixed-parameter tractability of the related extended global cardinality constraint problem (egcc) was conducted in [24]. egcc corresponds to the special case of the D-matching problem where the graph is bipartite and on one side of the bipartition all vertices have the domain {1}. In contrast with wmlq, egcc is a feasibility problem (note that the feasibility version of wmlq is trivial, as the empty assignment is always feasible). The authors of [24] provided a fixed-parameter algorithm for egcc when parameterized simultaneously by the treewidth of the graph and the maximum domain size, and they showed that the problem is W[1]-hard when only parameterized by the treewidth. These results mirror our results for wmlq, and indeed both our FPT-algorithm for wmlq and the one in [24] are extensions of the same classic dynamic program for the underlying maximum independent set problem. However, our hardness result uses a completely different reduction than the one in [24]. The latter makes heavy use of the fact that the domains can be arbitrary sets, whereas in wmlq, we are confined to intervals. 4.1 Algorithm for bounded treewidth graphs We will now describe an algorithm for solving wmlq in polynomial time for graphs with constant treewidth. The algorithm is a dynamic program that in- ductively computes a set of partial solutions for each bag of the tree decomposition. We will show how to obtain these solutions for a bag from the solutions of the children of that bag by a sequence of lemmas. Before we state these lemmas, we need to introduce a few more concepts. Nice tree decomposition. For every tree decomposition with a specific treewidth, a nice tree decomposition of the same treewidth can be found in linear time [15]. A nice tree decomposition is characterized by an exclusive composition of the following four kinds of bags: – – – – leaf bag: |B| = 1 and B has no child; introduce bag: B has exactly one child B1 , so that B1 ⊂ B and |B \ B1 | = 1; forget bag: B has exactly one child B1 , so that B ⊂ B1 and |B1 \ B| = 1; join bag: B has exactly two children B1 and B2 , so that B = B1 = B2 . We will henceforth assume we are given such a nice tree decomposition. Basic notation. For ease of exposition, we will define ℓ(a) := u(a) := 1 for all a ∈ A. Furthermore, throughout this section we will deal with vectors α ∈ ZU for some U ⊆ V . We define the notion of extension and restriction of such a vector α. For U ′ ⊆ U and α ∈ ZU define α|U ′ as the restriction of α to U ′ , i.e., ′ α|U ′ ∈ ZU and α|U ′ (v) = α(v) for all v ∈ U ′ . For v ∈ V \ U and i ∈ Z let further [α, i]v be the extension of α to U ∪ {v} defined by [α, i]v (v ′ ) := α(v ′ ) for all v ′ ∈ U and [α, i]v (v) := i. For a set of edges S we define αS,U ∈ ZU by αS,U (v) := degS (v), for all v ∈ U . We will also use the standard notation E[S] for the set of edges with both endpoints in S ⊆ V . Assignment vectors. For any bag B, let VB ⊆ V denote the set of vertices contained in the union of bags present in the subtree rooted at B. We will define a graph GB = (VB , EB ) where EB := E[VB ]\E[B]. A partial assignment for bag B is an assignment M ⊆ EB of GB such that degM (v) = 0 or ℓ(v) ≤ degM (v) ≤ u(v) for all v ∈ VB \ B. Note that this definition allows applicants and posts in B to be assigned arbitrarily often and that by definition of GB , no vertex in B is assigned to another vertex in B. An assignment vector for bag B is a vector α ∈ XB := {0, . . . , umax }B . We say a partial assignment M for B agrees with an assignment vector α ∈ XB , if α(v) = degM (v) for all v ∈ B. For every bag B and every α ∈ XB , let MB (α) be the set of partial assignments for B that agree with α and let WB (α) := max {{w(M ) : M ∈ MB (α)} ∪ {−∞}} denote the optimal value of any assignment that agrees with α for the graph GB (note that a value of −∞ implies that no partial assignment M agrees with α). We further denote the set of optimal partial assignments agreeing with α by M∗B (α) := {M ∈ MB (α) : w(M ) = WB (α)}. In the following, we will provide a series of lemmas that reveals how to efficiently obtain an element of M∗B (α) for every α ∈ XB for a bag B (or showing WB (α) = −∞), assuming such representatives of each set M∗B ′ (α) have already been computed for every child B ′ of B for all α ∈ XB ′ . Lemma 1. Let B be a leaf bag. Then M∗B (0) = {∅} and M∗B (α) = ∅ for any α ∈ XB \ {0}. Proof. This follows directly from the fact that EB = ∅ for all leaf bags and thus the only element in B cannot be assigned. ⊓ ⊔ Lemma 2. Let B be an introduce bag such that B ′ is the only child of B and B \ B ′ = {v ′ }. Let α ∈ XB . Then ( M∗B ′ (α|B ′ ) if α(v ′ ) = 0, ∗ MB (α) = ∅ otherwise. Proof. Note that Γ (v ′ ) ∩ VB ⊆ B by Properties 2 and 3 of a tree decomposition. This implies δ(v ′ ) ∩ EB = ∅ and hence the lemma follows. ⊓ ⊔ Lemma 3. Let B be a forget bag such that B ′ is the unique child of B and B = B ′ \ {v ′ } for some v ′ ∈ B ′ . Let α ∈ XB . Let (S ∗ , i∗ ) be an optimal solution to [forget] max w(S) + WB ′ ([α − αS,B , i − |S|]v′ ) s.t. |S| ≤ i, αS,B ≤ α S ⊆ δ(v ′ ) ∩ δ(B), i ∈ {0, ℓ(v ′ ), . . . , u(v ′ )}. Then M ∪ S ∗ ∈ M∗B (α) for all M ∈ M∗B ′ ([α − αS,B , i − |S|]v′ ). If the optimal solution to [forget] has value −∞, then M∗B (α) = ∅. Proof. Assume MB (α) 6= ∅ and let M ′ ∈ M∗B (α). Let S ′ := M ′ ∩ δ(v ′ ) ∩ δ(B) and let i′ := degM ′ (v ′ ). Observe that (S ′ , i′ ) is a feasible solution to [forget] and that M ′ \ S ′ ∈ MB ′ ([α − αS ′ ,B , i′ − |S ′ |]v′ ). We conclude that w(M ′ ) ≤ w(S ′ ) + WB ′ ([α − αS ′ ,B , ], i′ − |S ′ |]v′ ) ≤ w(S ∗ ) + WB ′ ([α − αS ∗ ,B , i∗ − |S ∗ |]v′ ). In particular, this implies that the optimal solution value of [forget] is finite and thus there is some M ∈ M∗B ′ ([α − αS ∗ ,B , i∗ − |S ∗ |]v′ ). Thus let M ∗ := M ∪ S ∗ . Observe that indeed degM ∗ (v) = degM (v) + degS ∗ (v) = α(v) − αS ∗ ,B (v) + αS ∗ ,B (v) = α(v) for all v ∈ B. Furthermore degM ∗ (v) = degM (v) ∈ {0, ℓ(v), . . . , u(v)} for all v ∈ VB \ B ′ by feasibility of M . Finally, degM ∗ (v ′ ) = i∗ ∈ {0, ℓ(v ′ ), . . . , u(v ′ )}, implying M ∗ ∈ MB (α). As w(M ∗ ) = w(S ∗ ) + WB ′ ([α − αS ∗ , i∗ − |S ∗ |]v′ ) ≥ w(M ′ ), we conclude that indeed ⊓ ⊔ M ∗ ∈ M∗B (α). Lemma 4. Let B be a join bag such that B = B1 = B2 for the two children B1 , B2 of B. Let α ∈ XB . Let (α∗1 , α∗2 ) be optimal solutions to [join] max WB1 (α1 ) + WB2 (α2 ) s.t. α1 + α2 = α α1 ∈ XB1 , α2 ∈ XB2 Then M1 ∪M2 ∈ M∗B (α) for all M1 ∈ M∗B1 (α∗1 ), M2 ∈ M∗B2 (α∗2 ). If the optimal solution of [join] has value −∞, then M∗B (α) = ∅. Proof. Let M ∗ := M1 ∪ M2 for some M1 ∈ M∗B1 (α∗1 ), M2 ∈ M∗B2 (α∗2 ). We first observe that VB1 ∩ VB2 = B by Properties 2 and 3 of the tree decomposition and hence M1 ∩ M2 = ∅. This implies that   degM1 (v) ∈ {0, ℓ(v), . . . , u(v)} if v ∈ VB1 \ B, degM ∗ (v) = degM2 (v) ∈ {0, ℓ(v), . . . , u(v)} if v ∈ VB2 \ B,   degM1 (v) + degM2 (v) = α(v) if v ∈ B. Hence M ∗ ∈ MB (α). Now let M ′ ∈ MB (α). Let M1′ := M ′ ∩ EB1 and M2′ := M ′ ∩ EB2 . We observe that (αM1 ,B1 , αM2 ,B2 ) is a feasible solution to [join] and hence w(M ′ ) = w(M1′ ) + w(M2′ ) ≤ w(M1 ) + w(M2 ) = w(M ∗ ). ⊓ ⊔ Finally, we observe that after computing WR (α) and the corresponding elements of M∗R (α) for each α for the root bag R, an optimal assignment for G can be easily obtained. Lemma 5. Let (S ∗ , α∗ ) be an optimal solution of [root] max WR (α) + w(S) s.t. α(v) + degS (v) ∈ {0, ℓ(v), . . . , u(v)} ∀v ∈ R α ∈ XR , S ⊆ E[R]. Then S ∗ ∪ M is an optimal solution to wmlq for any M ∈ M∗R (α∗ ). Proof. Let M ∗ := S ∗ ∪ M for some M ∈ M∗R (α∗ ). Note that for v ∈ V \ R, we have S ∗ ∩ δ(v) = ∅ and hence degM ∗ (v) = degM (v) ∈ {0, ℓ(v), . . . , u(v)} by the feasibility of M . Furthermore, for v ∈ R, we have degM ∗ (v) = α∗ (v)+degS ∗ (v) ∈ {0, ℓ(v), . . . , u(v)} by the feasibility of S ∗ for [root]. We conclude that M ∗ is indeed a feasible solution to wmlq. Now let M ′ ⊆ E be any solution to wmlq. Define S ′ := M ′ ∩ E[R] and ′ α := αM ′ ,R − αS ′ ,R . Observe that (S ′ , α′ ) is a feasible solution to [root] and that further M ′ \ S ′ ∈ MR (α′ ). We conclude that w(M ′ ) ≤ WR (α′ ) + w(S ′ ) ≤ WR (α∗ ) + w(S ∗ ) = w(M ∗ ), and thus M ∗ is indeed an optimal solution to wmlq. ⊓ ⊔ Theorem 5. wmlq can be solved in time O(T + (umax )3 tw(G) |E|), where T is the time needed for computing a tree decomposition of G of width tw(G). In particular, wmlq can be solved in polynomial time when restricted to instances of bounded treewidth, and wmlq parameterized by max{tw(G), umax } is fixedparameter tractable. Proof. In order to solve a given wmlq instance, the algorithm starts by computing a nice tree decomposition of G of width tw(G). Note that T is of the same order for tree decompositions and nice tree decompositions. Using Lemmas 1 to 5, we can inductively compute a representative M ∈ M∗B (α) for every bag B and every α ∈ Xb , or deduce that M∗B (α) = ∅. We first observe that |XB | = (umax )tw(G) , thus only (umax )tw(G) representatives have to be computed per bag. Furthermore, for each of the above lemmas, the necessary computations to derive an M ∈ M∗B (α) from representatives of M∗B ′ (α′ ) of children B ′ of B can be done in time O((umax )2 tw(G)+1 ). This is obvious for Lemmas 1 and 2. For Lemmas 3 to 5 we observe that the sets of feasible solutions for the corresponding optimization problems [forget], [join], and [root] have size at most 2 2|B| · (umax + 1), (umax )2 tw(G) , and 2|R| · (umax )tw(G) , respectively (note that without loss of generality we can assume |R| to be of constant size by introducing at most tw(G) additional forget bags). The theorem then follows from the fact that the number of bags is linear. ⊓ ⊔ 4.2 W[1]-hardness for parameterizing by treewidth only While our algorithm runs in polynomial time for bounded treewidth, the degree of the polynomial depends on the treewidth and the algorithm only becomes a fixed-parameter algorithm when parameterizing by treewidth and umax simultaneously. We will now show by a reduction from Minimum Maximum Outdegree that this dependence is necessary under the assumption that FPT 6= W[1]. Problem 6 Minimum Maximum Outdegree Input: A graph G = (V, E), edge weights w : E → Z+ encoded in unary and a degree-bound r ∈ Z+ . P Task: Find an orientation D of G such that e∈δ+ (v) w(e) ≤ r for all v ∈ V , D + where δD (v) stands for the set of edges oriented so that their tail is v. Theorem 7 (Theorem 5 from [26]). Minimum Maximum Outdegree is W [1]-hard when parameterized by treewidth. Theorem 8. mlq is W[1]-hard when parameterized by treewidth, even when restricted to instances where ℓ(p) ∈ {0, u(p)} for every p ∈ P . Proof. Given an instance (G = (V, E), w, r) of Minimum Maximum Outdegree, we construct an instance (G′ = (A ∪˙ P, E ′ ), ℓ, u) of mlq as follows: – For every vertex v ∈ V we introduce a post pv ∈ P with lower quota ℓ(pv ) = 0 and upper quota u(pv ) = r. – For every edge e = {v, v ′ } ∈ E, we introduce two posts pe,v and pe,v′ with identical lower and upper quotas of w(e) + 1, i. e. , ℓ(pe,v ) = ℓ(pe,v′ ) = u(pe,v ) = u(pe,v′ ) = w(e) + 1. w(e) w(e) We also add 2w(e) + 1 applicants a1e,v , . . . , ae,v , a1e,v′ , . . . , ae,v′ , ze , which are connected to the posts by the edges {pv , aie,v }, {aie,v , pe,v }, {pv′ , aie,v′ }, {aie,v′ , pe,v′ } for i ∈ {1, . . . , w(e)} as well as {pe,v , ze } and {ze , pe,v′ }. This construction is shown in Fig. 2. w r=3 post vertex pv with lower quota 0 and upper quota r post vertex pe,v with lower quota and upper quota w(e) + 1 applicant vertex pe,v a1e,v a2e,v pe,w ze a1e,w pw a2e,w f e 1 2 3 g v pf,w a1f,w pf,x zf a1f,x x pg,x px a1g,x a2g,x a3g,x pg,v zg a1g,v pv a2g,v a3g,v Fig. 2. The transformation of the Minimum Maximum Outdegree instance in the upper right corner to a mlq instance. The numbers on the edges of the Minimum Maximum Outdegree instance are the edge weights. We show that the constructed instance has a solution serving all applicants if and only if the Minimum Maximum Outdegree instance has an orientation respecting the bound on the weighted outdegree. First assume there is an orientation D of G with maximum weighted outdegree at most r. Then consider the assignment that assigns for every oriented edge (v, v ′ ) ∈ D the w(e) applicants aie,v to pv and the w(e) + 1 applicants aie,v′ and ze to pe,v′ . As the weighted outdegree of vertex v is at most r, every post pv gets assigned at most r = u(pv ) applicants. Now assume M is a feasible assignment of applicants to posts serving every applicant. In particular, for every edge e = {v, v ′ } ∈ E, applicant ze is assigned to either pe,v or pe,v′ and exactly one of these two posts is open because the lower bound of w(e) + 1 can only be met if ze is assigned to the respective post. If pe,v is open then all w(e) applicants aie,v′ are assigned to pv′ and none of the applicants aie,v is assigned to pv , and vice versa if pe,v′ is open. Consider the orientation obtained by orienting every edge e from v to v ′ if and only if pe,v is open. By the above observations, the weighted outdegree of vertex v corresponds to the number of applicants assigned to post pv , which is at most r. Finally, note that G′ can be constructed in time polynomial in the input size of the Minimum Maximum Outdegree instance as the weights are encoded in unary there. Furthermore, the treewidth of G′ is at most max{tw(G), 3}. To see this, start with a tree decomposition of G and identify each vertex v ∈ V with the corresponding post pv . For every edge e = {v, v ′ } ∈ E, there is a bag B with pv , p′v ∈ B. We add the new bag Be = {pv , p′v , pe,v , pe,v′ } as a child to B. We further add the bags Bze = {pe,v , pe,v′ , ze }, Baie,v = {pv , pe,v , aie,v } and Bai ′ = {pv′ , pe,v′ , aie,v′ } for i ∈ {1, . . . , w(e)} as children to Be . Observe e,v that the tree of bags generated by this construction is a tree decomposition. Furthermore, since we did not increase the size of any of the existing bags and added only bags of size at most 4, the treewidth of G′ is at most max{tw(G), 3}. ⊓ ⊔ 5 Approximation Having established the hardness of wmlq even for very restricted instances in Theorem 2, we turn our attention towards approximability. In this section, we give an approximation algorithm and corresponding inapproximability bounds expressed in terms of |A|, |P | and upper quotas in the graph. The method, which is described formally in Algorithm 1, is a simple greedy algorithm. We say a post p is admissible if it is not yet open and |Γ (p)| ≥ ℓ(p). The algorithm iteratively opens an admissible post maximizing the assignable ′ weight, i.e., it finds a post p′ ∈ P and a set in its neighborhood P A of applicants ′ ′ ′ ′ Γ (p ) with ℓ(p ) ≤ |A | ≤ u(p ) such that a∈A′ w(a, p′ ) is maximized among all such (p′ , A′ ) pairs. It then removes the assigned applicants from the graph (potentially rendering some posts inadmissible) and re-iterates until no admissible post is left. Algorithm 1 Greedy algorithm for wmlq Initialize P0 = {p ∈ P : |Γ (p)| ≥ ℓ(p)}. Initialize A0 = A. while P0 6= ∅ do P Find a pair p′ ∈ P0 and A′ ⊆ Γ (p′ )∩A0 with |A′ | ≤ u(p′ ) such that a∈A′ w(a, p′ ) is maximized among all such pairs. Open p′ and assign all applicants in A′ to it. Remove p′ from P0 and remove the elements of A′ from A0 . for p ∈ P0 with ℓ(p) > |Γ (p) ∩ A0 | do Remove p from P0 . end for end while Remark 2. As an alternative to Algorithm 1, one could use a reduction from wmlq to the set packing problem. The elements in the universe of the set packing problem would be A ∪ P . For each post p and for each subset S ⊂ Γ (p), such that l(p) ≤ |S| ≤ u(p), we create a set S ∪ {p} for the set packing instance. A feasible set packing then corresponds to a feasible assignment of the same weight. However, if the difference between p’s upper and lower quota is not bounded by a constant, this would create an exponential-sized input for the set packing problem and we could only employ an oracle-based algorithm known for the set packing problem to solve wmlq. The greedy algorithm known for the set packing problem [5] can be made to work in a fashion similar to the algorithm presented above. In the following we give a tight analysis of the algorithm, establishing approximation guarantees in terms of the number of posts |P |, the number of applicants |A|, and the maximum upper quota umax := maxp∈P u(p) over all posts. We also provide two examples that show that our analysis of the greedy algorithm is tight for each of the described approximation factors. We further show that the approximation ratios given above for wmlq are almost tight from the point of view of complexity theory. Theorem 9. Algorithm 1 is an α-approximation algorithm for wmlq p with α = min{|P |, |A|, umax + 1}. Furthermore, for mlq, Algorithm 1 is a |A| + 1approximation algorithm. It can be implemented to run in time O(|E| log |E|). Proof. Let p′1 , . . . , p′n be the posts chosen by the algorithm and let A′1 , . . . , A′n be the corresponding sets of applicants. Furthermore, consider an optimal solution of weight OPT, consisting of open posts p1 , . . . , pk and the corresponding sets of applicants A1 , . . . , Ak assigned to those posts. We first observe that the first two approximation ratios of |P | and |A| are already achieved by the initial selection of p′1 and A′1 chosen in the first round of the algorithm. For every i ∈ {1, . . . , k}, post pi is an admissible post in the first iteration of the algorithm. choice of the pair (p′1 , A′1 ) P The first iteration’s P ′ ′ implies a∈A′ w(a, p1 ) ≥ a∈Ai w(a, pi ) ≥ w(a , pi ) for every a′ ∈ Ai . As the 1 optimal solution opens at most P |P | posts and serves at most |A| applicants, we deduce that min{|P |, |A|} · a∈A′ w(a, p′1 ) ≥ OPT. 1 We now turn our attention pto the remaining approximation guarantees, which are umax + 1 for wmlq and |A| + 1 for mlq. For every i ∈ {1, . . . , k}, let π(i) denote the first iteration of the algorithm such that A′π(i) ∩ Ai 6= ∅ or p′π(i) = pi . This is the first iteration in which post pi is opened or an applicant assigned to it in the optimal solution becomes assigned. Note that such an iteration exists, because pi is not the termination of the algorithm. Furthermore, P P admissible after ′ w(a, pi ), because the pair (pi , Ai ) w(a, p ) ≥ observe that a∈Ai a∈A′ π(i) π(i) was a valid choice for the algorithm in iteration π(i). Now for iteration j define Pj := {i : π(i) = j} and observe that |Pj | ≤ |A′j |+1, because Pj can only contain one index i′ with pi′ = p′j , and all other i ∈ Pj \ {i′ } must have Ai ∩ A′j 6= ∅ (where the sets Ai are disjoint). We conclude that OPT = k X X w(a, pi ) ≤ i=1 a∈Ai ≤ n X j=1 |Pj | k X X i=1 X w(a, p′j ) ≤ a∈A′j w(a, p′π(i) ) a∈A′π(i) n X (|A′j | + 1) j=1 X w(a, p′j ). a∈A′j Note that |A′j | ≤ umax and therefore OPT ≤ (umax + 1) n X X w(a, p′j ), j=1 a∈A′j proving the third approximation guarantee. p Now consider p the unit-weight mlq Sn case and define A′ = j=1 A′j . If |A′ | ≥ |A|, then |A||A′ | ≥ |A| ≥ OPT. p Therefore assume |A′ | < |A|. p Note that in this case, the above inequalities imply OPT ≤ (|A′ | + 1)|A′ | ≤ ( |A| + 1)|A′ |, proving the improved approximation guarantee for mlq. We now turn to proving the bound on the running time. We will describe how to implement the search for the greedy choice of the pair (p′ , A′ ) in each iteration efficiently using a heap data structure. Initially, for every post p, we sort the applicants in its neighborhood by non-increasing order of w(a,P p). This takes time at most O(|E| log |E|) as the total number of entries to sort is p∈P |Γ (p)| = |E|. We then introduce a heap containing all admissible posts, and associate with each post p the total weight of the first u(p) edges in its neighborhood list. Note that these entries can be easily kept up to date whenever the algorithm opens a post and assigns applicants to it: In the list of every other post p we simply replace the assigned applicants with the first not-yet-assigned entry in the list (or we remove the post if less than ℓ(p) applicants are available). As every edge in the graph can only trigger one such replacement, only O(|E|) updates can occur and each of these requires O(log |P |) time for reinserting the post at the proper place in the heap. Now, in each iteration of the algorithm, the optimal pair (p′ , A′ ) can be found by retrieving the maximum element from the heap. This happens at most |P | times and requires O(log |P |) time in each step. ⊓ ⊔ Example 10 The following two examples show that our analysis of the greedy algorithm is (asymptotically) tight for each of the described approximation factors. p (a) The bounds |P | and umax + 1 are tight, and |A| + 1 is asymptotically tight: Consider an instance of mlq with k + 1 posts p0 , . . . , pk and k(k + 1) applicants a0,1 , . . . , a0,k , a1,1 , . . . , ak,k . Let ℓ(pi ) = u(pi ) = k for i ∈ {0, . . . , k}. Each applicant ai,j applies to post i, and if i > 0, additionally to post 0. For the greedy algorithm, opening post p0 and assigning applicants a1,1 , . . . , ak,k to it is a valid choice in its first iteration, after which no further posts are admissible. Thus, it only assigns k applicants in total. The optimal solution, however, can assign all k(k + 1) applicants by assigning applicants ai,1 , . . . , ai,k to pi for each i. Therefore, the greedy algorithm cannot achieve an approximation factor better than k + 1 on this family of instances, for p which |P | = k + 1, |A| < k + 1, and umax = k. (b) The bound |A| is tight: To see that the approximation ratio of |A| is tight for wmlq consider the following instance with k posts p1 , . . . , pk and k applicants a1 , . . . , ak . Let ℓ(pi ) = 0 and u(pi ) = k for every i. Every applicant applies for every post, and w(ai , pi ) = 1 for every i but w(ai , pj ) = ε for every j 6= i for some arbitrarily small ε > 0. In its first iteration, the greedy algorithm might choose to open post p1 and assign all applicants to it. This solution accumulates a weight of 1 + (k − 1)ε, while the weight of the optimal solution is k = |A|. p 1−ε Theorem 11. mlq is not approximable within a factor of |P |1−ε or |A| or u1−ε max for any ε > 0, unless P = NP, even when restricting to instances where ℓ(p) = u(p) for every p ∈ P and |Γ (a)| ≤ 2 for every a ∈ A. Proof. Once again we use the maximum independent vertex set problem. Given an instance of mis on a graph G = (V, E) with |V | = n and |E| = m, we create an mlq instance with n posts p1 , . . . , pn , post pi corresponding to vertex vi . We also introduce n2 − m applicants as follows. Initially, we introduce n applicants ai,1 , ai,2 , ..., ai,n applying for each post pi . Then, for every edge {vi , vj } ∈ E, we merge the applicants ai,j and aj,i , obtaining a single applicant applying for both pi and pj . Furthermore, we set ℓ(pj ) = u(pj ) = n for every post. This construction is shown in Fig. 3. Note that due to the choice of upper and lower bounds, any open post must be assigned to all the applicants in its neighborhood. Thus, a solution to the wmlq instance is feasible if and only if Γ (pi ) ∩ Γ (pj ) = ∅ for all open posts pi and pj with i 6= j, which is equivalent to vi and vj not being adjacent in G by construction of the instance. Therefore, the mlq instance has a feasible solution opening k posts (and thus serving kn applicants) if and only if there is an independent set of size k in G. We conclude that OPTmlq = n · OPTmis for the two instances under consideration. p |A|. Note that in the constructed mlq instance, n = |P | = umax ≥ Therefore any approximation algorithm with a factor better than |P |1−ε or p 1−ε |A| or u1−ε max for ε > 0 yields a solution of the instance that serves at 1−ε least (1/n )OPTmlq applicants and therefore opens at least (1/n2−ε )OPTmlq = (1/n1−ε )OPTmis posts, corresponding to an independent set of the same size. By [27], this implies P = NP. ⊓ ⊔ 6 Matchings with lower quotas in general graphs Throughout this paper, we focused on many-to-one matchings in bipartite graphs because these fit most applications in the centralized formation of groups that v2 v3 post vertex pi with lower quota and upper quota n v1 applicant vertex v4 v5 p1 a1,1 p2 p3 a3,1 p4 a4,1 p5 a1,2 a1,3 a1,4 a1,5 a2,2 a2,3 a2,4 a2,5 a3,3 a3,4 a3,5 a4,4 a4,5 a4,2 a5,2 a5,3 a5,5 Fig. 3. The transformation of the mis instance in the upper left corner to a mlq instance. motivated our investigation. A straightforward generalization of wmlq to matchings in an arbitrary (not necessarily bipartite) graph G allows all vertices of the graph to have lower and upper quotas. Problem 12 gwmlq Input: I = (G, w, ℓ, u); a not necessarily bipartite graph G = (V, E) with edge weights w, lower quotas ℓ and upper quotas u. Task: Find an assignment of maximum weight. If w(e) = 1 for all e ∈ E, we refer to the problem as gmlq. One can see this generalization as a variant of the D-matching problem (see Section 1.1), where each vertex has a domain consisting of 0 and an interval. Clearly, the hardness results derived in the previous sections are valid for gwmlq as well. We now briefly argue that the positive results from Sections 3 and 4 carry over to this generalized setting. However, our approximation results do not hold even if G is bipartite and only a single applicant is equipped with lower and upper quotas. In fact, gwmlq does not allow for any approximation even in this very restricted case unless P = NP. The two positive results in Section 3, namely Theorems 3 and 4, are applicable to gwmlq. Note that Theorem 3 (bounded degree for all posts) is a special case of Theorem 4 (bounded upper quota for all posts). Theorem 13. gwmlq can be solved in polynomial time when restricted to instances with u(v) ≤ 2 for all v ∈ V . Proof. We will work with the proof of Theorem 4, which requires some simple modifications to fit the case of arbitrary graphs. All we need to do is to add a dummy vertex vd to G – this resembles dummy post pd in the proof of Theorem 4. The steps corresponding to a post vertex should now be executed for all vertices of the graph. We can assume there are no vertices with lower quota 0 and upper quota 2 by a similar reasoning given in Theorem 3. For every vertex vi with ℓ(vi ) = 2, we add two dummy vertices qi1 and qi2 and connect them to each other and vi . Then, the dummy vertex vd is connected to vertices with upper quota 1. We finish the construction by adding triangles to vd to ensure that only two f -factors need to be computed. The arguments in the proof of Theorem 4 can now be applied to this f -factor instance. ⊓ ⊔ As for Theorem 5, the algorithm for bounded treewidth and upper quota carries over to gwmlq without any modification. Note that in the proof we never used the bipartiteness of G or that u(a) = 1 for the applicants. Theorem 14. gwmlq can be solved in time O(T + (umax )3 tw(G) |E|), where T is the time needed for computing a tree decomposition of G of width tw(G). In particular, gwmlq can be solved in polynomial time when restricted to instances of bounded treewidth, and wmlq parameterized by max{tw(G), umax } is fixedparameter tractable. Finally, we prove that Algorithm 1 cannot be generalized even for bipartite mlq with lower and upper quotas on both sides. Theorem 15. It is NP-hard to decide whether OPT > 0 for an instance of gmlq, even if the graph is bipartite and on one side of the bipartition all vertices except for one have unitary upper and lower quota. Proof. To every instance of mis we construct an instance of gmlq so that the mis instance admits an independent set of size K if and only if OPT > 0 for the gmlq instance. We start with the same mlq instance that was constructed from an mis instance in the proof of Theorem 11. The changes are depicted in Fig. 4. A dummy applicant ad is added to the graph and connected to all posts. We set ℓ(ad ) = u(ad ) = K and change ℓ(p) = u(p) to n + 1 for every post p ∈ P . Since every post is adjacent to exactly n + 1 applicants, opening a post requires allocating all its applicants to it, including ad as well. Thus, opening any post implies allocating ad to exactly K posts. These K open posts do not share applicants other than ad , which is equivalent to the K vertices corresponding to them in the mis instance forming an independent set. ⊓ ⊔ 7 Conclusion We discussed the complexity, approximability and fixed-parameter tractability of wmlq from various viewpoints such as bounded degree, quota and treewidth. Further work on the topic might include imposing common quotas on some groups of posts. That is, we may have subsets P1 , . . . , Pk , where for each i (1 ≤ i ≤ k), Pi ⊆ P , Pi has a common quota u(Pi ) ≥ 1, where u(Pi ) ≤ P u(p), and any assignment M must now satisfy the additional property p∈PP i that p∈Pi |δ(p) ∩ M | ≤ u(Pi ). Common quotas can model constraints such as the limited availability of resources required for certain projects – for example P1 might correspond to those projects that require access to high-performance computing facilities. We have seen that wmlq as defined in Theorem 1 has a natural application in the context of student-project allocation, where the weight on a given edge (s, p) corresponds to the utility of student s being assigned to project p. However in many applications students have ordinal preferences over projects. Cardinal utilities can of course follow from these via the use of Borda scores, so we can obtain wmlq as before. But ordinal preferences themselves allow alternative optimality criteria to be formulated. For example we may optimize on the profile of a matching M , which is a vector whose ith position indicates the number of students who obtain their ith-choice project in M [19]. A greedy maximum matching is a matching whose profile is lexicographically maximum, taken over all maximum cardinality matchings, whilst a generous maximum matching is a matching whose reverse profile is lexicographically minimum, taken over all maximum cardinality matchings. There are efficient algorithms to find greedy and generous maximum matchings in the absence of lower quotas [16], but it remains open to extend the positive results in this paper to the setting involving both lower quotas and preferences. v2 post vertex pi with lower quota and upper quota n + 1 v3 v1 applicant vertex dummy applicant vertex with lower quota and upper quota K v4 v5 p1 a1,1 p2 ad p3 a3,1 p4 a4,1 p5 a1,2 a1,3 a1,4 a1,5 a2,2 a2,3 a2,4 a2,5 a3,3 a3,4 a3,5 a4,4 a4,5 a4,2 a5,2 a5,3 a5,5 Fig. 4. The transformation of the mis instance in the upper left corner to a generalized mlq instance. Acknowledgements We would like to thank András Frank and Kristóf Bérczi for their observations that led us to Theorem 4. Bibliography [1] D. J. Abraham, R. W. Irving, and D. F. Manlove. Two algorithms for the Student-Project Allocation problem. Journal of Discrete Algorithms, 5(1):79–91, 2007. [2] P. Alimonti and V. Kann. Some APX-completeness results for cubic graphs. Theoretical Computer Science, 237(1-2):123–134, 2000. [3] P. Biró, T. Fleiner, R. W. Irving, and D. F. Manlove. The College Admissions problem with lower and common quotas. Theoretical Computer Science, 411:3136–3153, 2010. [4] H. L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM Journal on Computing, 25(6):1305–1317, 1996. [5] B. Chandra and M. M. Halldórsson. Greedy local improvement and weighted set packing approximation. Journal of Algorithms, 39(2):223–240, 2001. [6] G. Cornuéjols. General factors of graphs. Journal of Combinatorial Theory, Series B, 45(2):185–198, 1988. [7] D. Fragiadakis, A. Iwasaki, P. Troyan, S. Ueda, and M. Yokoo. Strategyproof matching with minimum quotas. ACM Transactions on Economics and Computation, 4(1):6:1–40, Jan 2016. [8] H. N. Gabow. An efficient reduction technique for degree-constrained subgraph and bidirected network flow problems. In Proceedings of STOC ’83: the 15th Annual ACM Symposium on Theory of Computing, pages 448–456. ACM, 1983. [9] H. N. Gabow. Data structures for weighted matching and nearest common ancestors with linking. In Proceedings of SODA ’90: the 1st ACM-SIAM Symposium on Discrete Algorithms, pages 434–443. ACM-SIAM, 1990. [10] M. Goto, N. Hashimoto, A. Iwasaki, Y. Kawasaki, S. Ueda, Y. Yasuda, and M. Yokoo. Strategy-proof matching with regional minimum quotas. In Proceedings of the AAMAS ’14: the 13th International Conference on Autonomous Agents and Multi-agent Systems, pages 1225–1232. IFAAMAS, 2014. [11] M. Goto, R. Kurata, N. Hamada, A. Iwasaki, and M. Yokoo. Improving fairness in nonwasteful matching with hierarchical regional minimum quotas. In Proceedings of AAMAS ’15: the 14th International Conference on Autonomous Agents and Multiagent Systems, pages 1887–1888. IFAAMAS, 2015. [12] K. Hamada, K. Iwama, and S. Miyazaki. The hospitals/residents problem with lower quotas. Algorithmica, 74(1):440–465, 2014. [13] K. Iwama, S. Miyazaki, and H. Yanagisawa. Improved approximation bounds for the student-project allocation problem with preferences over projects. Journal of Discrete Algorithms, 13:59–66, 2012. [14] N. Kamiyama. A note on the serial dictatorship with project closures. Operations Research Letters, 41:559–561, 2013. [15] T. Kloks. Treewidth, Computations and Approximations, volume 842 of Lecture Notes in Computer Science. Springer, 1994. [16] A. Kwanashie, R.W. Irving, D.F. Manlove, and C.T.S. Sng. Profile-based optimal matchings in the Student/Project Allocation problem. In Proceedings of IWOCA ’14: the 25th International Workshop on Combinatorial Algorithms, volume 8986 of Lecture Notes in Computer Science, pages 213– 225. Springer, 2015. [17] L. Lovász. On the structure of factorizable graphs. Acta Mathematica Academiae Scientiarum Hungaricae, 23(1-2):179–195, 1972. [18] L. Lovász. Antifactors of graphs. Periodica Mathematica Hungarica, 4(23):121–123, 1973. [19] D. F. Manlove. Algorithmics of Matching Under Preferences. World Scientific, 2013. [20] D. F. Manlove and G. O’Malley. Student project allocation with preferences over projects. Journal of Discrete Algorithms, 6:553–560, 2008. [21] D. Monte and N. Tumennasan. Matching with quorums. Economics Letters, 120:14–17, 2013. [22] R. Niedermeier. Invitation to Fixed-Parameter Algorithms. Oxford University Press, 2006. [23] M. D. Plummer. Graph factors and factorization: 1985–2003: A survey. Discrete Mathematics, 307(7-8):791–821, 2007. [24] M. Samer and S. Szeider. Tractable cases of the extended global cardinality constraint. Constraints, 16:1–24, 2011. [25] A. Sebő. General antifactors of graphs. Journal of Combinatorial Theory, Series B, 58(2):174–184, 1993. [26] S. Szeider. Not so easy problems for tree decomposable graphs. CoRR, abs/1107.1177, 2011. [27] D. Zuckerman. Linear degree extractors and the inapproximability of max clique and chromatic number. Theory of Computing, 3(6):103–128, 2007.
8cs.DS
Bayesian Heuristics for Group Decisions M. Amin Rahimian & Ali Jadbabaie ? arXiv:1611.01006v1 [cs.MA] 2 Nov 2016 ? Institute for Data, Systems, and Society (IDSS), Massachusetts Institute of Technology (MIT), Cambridge, MA 02139, USA. Emails: rahimian , jadbabai @mit.edu We propose a model of inference and heuristic decision making in groups that is rooted in the Bayes rule but avoids the complexities of rational inference in partially observed environments with incomplete information. According to our model, the group members behave rationally at the initiation of their interactions with each other; however, in the ensuing decision epochs, they rely on a heuristic that replicates their experiences from the first stage. Subsequently, the agents use their time-one Bayesian update and repeat it for all future time-steps; hence, updating their actions using a so-called Bayesian heuristic. This model avoids the complexities of fully rational inference and also provides a behavioral and normative foundation for non-Bayesian updating. It is also consistent with a dual-process psychological theory of decision making, where a controlled (conscious/slow) system develops the Bayesian heuristic at the beginning, and an automatic (unconscious/fast) system takes over the task of heuristic decision making in the sequel. We specialize this model to a group decision scenario where private observations are received at the beginning, and agents aim to take the best action given the aggregate observations of all group members. We present the implications of the choices of signal structure and action space for such agents. We show that for a wide class of distributions from the exponential family the Bayesian heuristics take the form of an affine update in the self and neighboring actions. Furthermore, if the priors are non-informative (and possibly improper), then these action updates become a linear combination. We investigate the requirements on the modeling parameters for the action updates to constitute a convex combination as in the DeGroot model. The results reveal the nature of assumptions that are implicit in the DeGroot updating and highlights the fragility and restrictions of such assumptions; in particular, we show that for a linear action update to constitute a convex combination the precision or accuracy of private observations should be balanced among all neighboring agents, requiring a notion of social harmony or homogeneity in their observational abilities. Following the DeGroot model, agents reach a consensus asymptotically. We derive the requirements on the signal structure and network topology such that the consensus action aggregates information efficiently. This involves additional restrictions on the signal likelihoods and network structure. In the particular case that all agents observe the same number of i.i.d. samples from the same distribution, then efficiency arise in degree-regular balanced structures, where all nodes listen to and hear from the same number of neighbors. We next shift attention to a finite state model, in which agents take actions over the probability simplex; thus revealing their beliefs to each other. We show that the Bayesian heuristics, in this case, prescribe a log-linear update rule, where each agent’s belief is set proportionally to the product of her own and neighboring beliefs. We analyze the evolution of beliefs under this rule and show that agents reach a consensus. The consensus belief is supported over the maximizers of a weighted sum of the log-likelihoods of the initial observations. Since the weights of the signal likelihoods coincide with the network centralities of their respective agents, these weights can be equalized in degree-regular and balanced topologies, where all nodes have the same in and out degrees. Therefore, in such highly symmetric structures the support of the consensus belief coincides with the maximum likelihood estimators (MLE) of the truth state; and here again, balanced regular structures demonstrate a measure of efficiency. Nevertheless, the asymptotic beliefs systematically reject the less probable alternatives in spite of the limited initial data, and in contrast with the optimal (Bayesian) belief of an observer with complete information of the environment and private signals. The latter would assign probabilities proportionally to the likelihood of every state, without rejecting any of the possible alternatives. The asymptotic rejection of less probable alternatives indicates a case of group polarization, i.e. overconfidence in the group aggregate that emerges as a result of the group interactions. Unlike the linear action updates and the DeGroot model which entail a host of knife-edge conditions on the signal structure and model parameters, we observe that the belief updates are unweighted; not only they effectively internalize the heterogeneity of the private observations, but also they compensate for the individual priors. Thence, we are led to the conclusion that multiplicative belief updates, when applicable provide a relatively robust description of the decision making behavior. Key words : opinion dynamics; social learning; Bayesian learning; non-Bayesian learning; rational learning; observational learning; statistical learning; distributed learning; distributed hypothesis testing; distributed detection; DeGroot model; linear regression; conjugate priors; exponential families MSC2000 subject classification : Primary: 91B06; secondary: 91A35, 62C10 OR/MS subject classification : Primary: Games/group decisions: Voting/committees; secondary: Organizational studies: Decision making Effectiveness/performance Information; Networks/graphs: Heuristics History : This version is dated September 12th, 2016. A preliminary version was presented in NBER-NSF Seminar on Bayesian Inference in Econometrics and Statistics on April 30, 2016. 1 2 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 1. Introduction. Daniel Kahneman in his highly acclaimed work, “Thinking, Fast and Slow ”, points out that the proper way to elicit information from a group is not through a public discussion but rather confidentially collecting each person’s judgment [52, Chapter 23]. Indeed, decision making among groups of individuals exhibit many singularities and important inefficiencies that lead to Kahneman’s noted advice. As a team converges on a decision expressing doubts about the wisdom of the consensus choice is suppressed; subsequently teams of decision makers are afflicted with groupthink as they appear to reach a consensus.1 The mechanisms of uncritical optimism, overconfidence, and the illusions of validity in group interactions also lead to group polarization, making the individuals more amenable toward extreme opinions [92]. In more abstract terms, agents in a social network exchange opinions to benefit from each other’s experience and information when making decisions about adoption of technologies, purchasing products, voting in elections and so on. The problem of social learning is to characterize and understand such interactions and it is a classical focus of research in microeconomics [45, Chapter 8], [39, Chapter 5], [18]. Research on formation and evolution of beliefs in social networks and subsequent shaping of the individual and group behaviors have attracted much attention amongst diverse communities in engineering [58, 97], statistics [66], economics [47, 65], and sociology [82]. An enhanced understanding of decision making and learning in social networks sheds light on the role of individuals in shaping public opinion and how they influence efficiency of information transmissions. These in turn help us improve our predictions about group behavior and provide guidelines for designing effective social and organizational policies. 1.1. Rational social learning. The rational approach advocates application of Bayes rule to the entire sequence of observations successively at every step. However, such repeated applications of Bayes rule in networks become very complex, especially if the agents are unaware of the global network structure; and as they use their local data to make inferences about all possible contingencies that can lead to their observations. While some analytical properties of rational learning is deduced and studies in the literature [32, 1, 68, 66, 42], their tractable modeling and analysis remains an important problem in network economics and continues to attract attention. Some of the earliest results addressing the problem of social learning are due to Banerjee (1992) [9], and Bikhchandani et al. (1998) [13] who consider a complete graph structure where the agent’s observations are public information and also ordered in time, such that each agent has access to the observations of all the past agents. These assumptions help analyze and explain the interplay between public and private information leading to fashion, fads, herds etc. Later results by Gale and Kariv [32] relax some of these assumptions by considering the agents that make simultaneous observations of only their neighbors rather than the whole network, but the computational complexities limit the analysis to networks with only two or three agents. In more recent results, Mueller-Frank [68] provides a framework of rational learning that is analytically amenable. Mossel, Sly and Tamuz [66] analyze the problem of estimating a binary state of the world from a single initial private signal that is independent and identically distributed amongst the agents conditioned on the true state; and they show that by repeatedly observing each other’s best estimates of the unknown as the size of the network increases with high probability Bayesian agents asymptotically learn the true state. Hence, the agents are able to combine their initial private observations and learn the truth. Further results by Kanoria and Tamuz [53] provide efficient algorithms to calculate each agent’s estimate in the case of tree networks. On the one hand, the properties of rational learning models are difficult to analyze beyond some simple asymptotic facts such as convergence. On the other hand, these models make unrealistic 1 Gar Klein proposes a famous method of project premortem to overcome the groupthink through an exercise: imagining that the the planned decision was failed in implementation and writing a brief report of the failure [57]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 3 assumptions about the complexity and amount of computations that agents perform before committing to a decision. To avoid these shortcomings, an alternative “non-Bayesian” approach relies on simple and intuitive heuristics that are descriptive of how agents aggregate the reports of their neighbors before coming up with a decision. 1.2. Heuristic decision making. Heuristics are used widely in the literature to model social interactions and decision making [34, 35, 36]. They provide tractable tools to analyze boundedly rational behavior and offer insights about decision making under uncertainty. Hegselmann and Krause [43] investigate various ways of averaging to model opinion dynamics and compare their performance for computations and analysis. Using such heuristics one can avoid the complexities of fully rational inference, and their suitability are also verified in experimental studies by Grimm and Mengel [40] and Chandrasekhar, Larreguy and Xandri [19]. The study of such heuristics started in 1974 with the seminal work of DeGroot [20] in linear opinion pooling, where agents update their opinions to a convex combination of their neighbors’ beliefs and the coefficients correspond to the level of confidence that each agent puts in each of her neighbors. More recently, Jadbabaie, Molavi and Tahbaz-Salehi [47, 48, 65] consider a variation of this model for streaming observations, where in addition to the neighboring beliefs the agents also receive private signals. Despite their widespread applications, theoretical and axiomatic foundations of social inferences using heuristics and nonBayesian updates have received limited attention and only recently [65, 69], and a comprehensive theory of non-Bayesian learning that reconciles the rational and boundedly rational approaches with the widely used heuristics remains in demand. The main goal of our paper is to address this gap and to do so from a behavioral perspective. A dual process theory for the psychology of mind and its operation identifies two systems of thinking [24]: one that is fast, intuitive, non-deliberative, habitual and automatic (system one); and a second one that is slow, attentive, effortful, deliberative, and conscious (system two).1 Major advances in behavioral economics are due to incorporation of this dual process theory and the subsequent models of bounded rationality [51]. Reliance on heuristics for decision making is a distinctive feature of system one that avoids the computational burdens of a rational evaluation; system two on the other hand, is bound to deliberate on the options based on the available information before making recommendations. The interplay between these two systems and how they shape the individual decisions is of paramount importance [17]. Tversky and Kahneman argue that humans have limited time and brainpower, therefore they rely on simple rules of thumb, i.e. heuristics, to help them make judgments. However, the use of these heuristics causes people to make predictable errors and subjects them to various biases [96]. Hence, it is important to understand the nature and properties of heuristic decision making and its consequences to individual and organizational choice behavior. This premise underlies many of the recent advances in behavioral economics [93], and it motivates our work as well. 1.3. Our contribution. In this work we are concerned with the operations of system one: we aim to study heuristics for information aggregation in group decision scenarios when the relevant information is dispersed among many individuals. In such situations, individuals in the group are subjected to informational (but not strategic) externalities. By the same token, the heuristics that are developed for decision making in such situations are also aimed at information aggregation. In our model as the agent experiences with her environment her initial response would engage 1 While many decision science applications focus on developing dual process theories of cognition and decision making (cf. [25, 63] and the references therein); other researchers identify multiple neural systems that derive decision making and action selection: ranging from reflexive and fast (Pavlovian) responses to deliberative and procedural (learned) ones; and these systems are in turn supported by several motoric, perceptual, situation-categorization and motivational routines which together comprise the decision making systems [80, Chapyter 6]. 4 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions her system two: she rationally evaluates the reports of her neighbors and use them to make a decision. However, after her initial experience and by engaging in repeated interactions with other group members her system one takes over her decision processes, implementing a heuristic that imitates her (rational/Bayesian) inferences from her initial experience; hence avoiding the burden of additional cognitive processing in the ensuing interactions with her neighbors. On the one hand, our model of inference based on Bayesian (initial) heuristics is motivated by the real-world behavior of people induced by their system one and reflected in their spur-of-themoment decisions and impromptu behavior: basing decisions only on the immediately observed actions and disregarding the history of the observed actions or the possibility of correlations among different observations; i.e. “what you see is all there is” [52]. On the other hand, Bayesian heuristics offer a boundedly rational approach to model decision making over social networks. The latter is in the sense of the word as coined by Herbert A. Simon: to incorporate modifications that lead to substantial simplifications in the original choice problem [87].1 This in contrast with the Bayesian approach which is not only unrealistic in the amount of cognitive burden that it imposes on the agents, but also is often computationally intractable and complex to analyze. Our main contribution is to offer a normative framework for heuristic decision making, by relying on the time-one Bayesian update and using it for all future decision epochs. This model offers a behavioral foundation for non-Bayesian updating that is compatible with the dual-process psychological theory of decision making. In Section 2, we describe the mathematical details of our model; in particular, we explain the mathematical steps for deriving the so-called Bayesian heuristics in a given decision scenario. Specific cases of Bayesian heuristics that we explore in the following sections are the log-linear (multiplicative) updating of beliefs over the probability simplex, and the linear (weighted arithmetic average) updating of actions over the Euclidean space. In Section 3, we specialize our group decision model to a setting involving exponential family of distributions for both signal likelihoods and agents’ beliefs. The agents aim to estimate the expected values of the sufficient statistics for their signal structures. We show that the Bayesian heuristics in this case are affine rules in the self and neighboring actions, and we give explicit expressions for their coefficients. Subsequently, we provide conditions under which these action updates constitute a convex combination as in the DeGroot model, with actions converging to a consensus in the latter case. We also investigate the efficiency of the consensus action in aggregating the initial observations of all agents across the network. Next in Section 4, we discuss a situation where agents exchange beliefs about a truth state that can takes one of the finitely many possibilities. The Bayesian heuristics in this case set the updated beliefs proportional to the product of self and neighboring beliefs, as reported in every decision epoch. We investigate the evolution of beliefs under the prescribed update rules and compare the asymptotic beliefs with that of a Bayesian agent with direct access to all the initial observations; thus characterizing the inefficiencies of the asymptotic beliefs. We summarize our findings from the analysis of linear action and log-linear belief updates in Section 5, where we reiterate the assumptions that are implicit in the adoption of popular aggregation heuristics such as the DeGroot model; moreover, we discuss the inefficiencies that arise as a result of their application. Such heuristics allow us to aggregate the information in our environment, and provide for desirable asymptotic properties such as consensus; however, this consensus often fails as an efficient group aggregate for the individuals’ private data. We provide the mathematical proofs and the relevant details for many of the results in the appendices at end of the paper. 1 Simon advocates “bounded rationality” as compatible with the information access and the computational capacities that are actually possessed by the agents in their environments. Most importantly he proposes the use of so-called “satisficing” heuristrics; i.e. to search for alternatives that exceed some “aspiration levels” by satisfying a set of minimal acceptability criteria [88, 89]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 5 2. The model. Consider a group of n agents that are labeled by [n] and interact according to a digraph G = ([n], E ).1 The neighborhood of agent i is the set of all agents whom she observes including herself, and it is denoted by Ni = {j ∈ [n]; (j, i) ∈ E} ∪ {i}; every node having a self-loop: (i, i) ∈ E for all i. We refer to the cardinality of Ni as the degree of node i and denote it by deg(i). There is a state θ ∈ Θ that is unknown to the agents and it is chosen arbitrarily by nature from an underlying state space Θ, which is measurable by a σ-finite measure Gθ (·). For example if a space (Θ or S ) is a countable set, then we can take its σ-finite measure (Gθ or Gs ) to be the counting measure, denoted by K(·); and if the space is a subset of Rk with positive Lebesgue measure, then we can take its σ-finite measure to be the Lebesgue measure on Rk , denoted by Λk (·). Associated with each agent i, Si is a measurable space called the signal space of i, and given θ, Li (· | θ) is a probability measure on Si , which is referred to as the signal structure of agent i. Furthermore, (Ω, F , Pθ ) is a probability triplet, where Ω = S1 × . . . × Sn is a product space, and F is a properly defined sigma field over Ω. The probability measure on Ω is Pθ (·) which assigns probabilities consistently with the signal structures Li (· | θ), i ∈ [n]; and in such a way that with θ fixed, the random variables si , i ∈ [n] taking values in Si , are independent. These random variables represent the private signals that agents i ∈ [n] observe at time 0. Note that the private signals are independent across the agents. The expectation operator Eθ {·} represents integration with respect to Pθ (dω), ω ∈ Ω. 2.1. Beliefs, actions and rewards. An agents’ belief about the unknown allows her to make decisions even as the outcome is dependent on the unknown value θ. These beliefs about the unknown state are probability distributions over Θ. Even before any observations are made, every agent i ∈ [n] holds a prior belief Vi (·) ∈ ∆Θ; this represents her subjective biases about the possible values of θ. For each time instant t, let Mi,t (·) be the (random) probability distribution over Θ, representing the opinion or belief at time t of agent i about the realized value of θ. Moreover, let the associated expectation operator be Ei,t {·}, representing integration with respect to Mi,t (dθ). We assume that all agents share the common knowledge of signal structures Li (·|θ̂), ∀θ̂ ∈ Θ, their priors Vi (·), and their corresponding sample spaces Si and Θ for all i ∈ [n]. 2 Let t ∈ N0 denote the time index; at t = 0 the values θ ∈ Θ followed by si ∈ Si of si are realized and the latter is observed privately by each agent i for all i ∈ [n]. Associated with every agent i is an action space Ai that represents all the choices available to her at every point of time t ∈ N0 , and a utility ui (·, ·) : Ai × Θ → R which in expectation represents her von Neumann-Morgenstern preferences regarding lotteries with independent draws from Ai and/or Θ. These utilities are additive over time corresponding to successive independent draws. The utility functions and action spaces are common knowledge amongst the agents. Subsequently, at every time t ∈ N0 each agent i ∈ [n] chooses an action ai,t ∈ Ai and is rewarded ui (ai,t , θ). 1 Some notations: Throughout the paper, R is the set of real numbers, N denotes the set of all natural numbers, and N0 := N ∪ {0}. For n ∈ N a fixed integer the set of integers {1, 2, . . . , n} is denoted by [n], while any other set is represented by a capital Greek or calligraphic letter. For a measurable set X we use ∆X to denote the set of all probability distributions over the set X . Furthermore, any random variable is denoted in boldface letter, vectors are represented in lowercase letters and with a bar over them, measures are denoted by upper case Greek or calligraphic Latin letters, and matrices are denoted in upper case Latin letters. For a matrix A, its spectral radius ρ(A) is the largest magnitude of all its eigenvalues. 2 The signal structures Li (·|θ̂), ∀θ̂ ∈ Θ and the priors Vi (·), as well as the corresponding sample spaces Si and Θ are common knowledge amongst the agents for all i ∈ [n]. The assumption of common knowledge in the case of fully rational (Bayesian) agents implies that given the same observations of one another’s beliefs or private signals distinct agents would make identical inferences; in the sense that starting form the same belief about the unknown θ, their updated beliefs given the same observations would be the same; in Aumann’s words, rational agents cannot agree to disagree [5]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 6 2.2. Aggregation heuristics. Given si , agent i forms an Rinitial Bayesian opinion Mi,0 (·) about the value of θ and chooses her action ai,0 ←- arg maxai ∈Ai Θ ui (ai , θ̂)Mi,0 (dθ), maximizing her expected reward. Here for a set A, we use the notation a ←- A to denote an arbitrary choice from the elements of A that is assigned to a. Not being notified of the actual realized value for ui (ai,0 , θ), she then observes the actions that her neighbors have taken. Given her extended set of observations {aj,0 , j ∈ Ni } at time t = 1, she refines her opinion into Mi,1 (·) and makes a second, and possibly different, move ai,1 according to: Z ai,1 ←- arg max ui (ai , θ)Mi,1 (dθ), (1) ai ∈Ai Θ maximizing her expected pay off conditional on everything that R she has observed thus far; i.e. maximizing Ei,1 {ui (ai , θ)} = Eθ {ui (ai,1 , θ)|si , aj,0 : j ∈ Ni } = Θ ui (ai , θ)Mi,1 (dθ). Subsequently, she is granted her net reward of ui (ai,0 , θ) + ui (ai,1 , θ) from her past two plays. Following realization of rewards for their first two plays, in any subsequent time instance t > 1 each agent i ∈ [n] observes the preceding actions of her neighbors aj,t−1 : j ∈ Ni and takes an option ai,t out of the set Ai . Of particular significance in our description of the behavior of agents in the succeeding time periods t > 1, is the relation: fi (aj,0 : j ∈ Ni ) := ai,1 ←- arg max Ei,1 {ui (ai , θ)} (2) ai ∈Ai derived in (1), which given the observations of agent i at time t = 0, specifies her (Bayesian) pay-off maximizing action for time t = 1. Once the format of the mapping fi (·) is obtained, it is then used as a heuristic for decision making in every future epoch. The agents Q update their action by choosing: ai,t = fi (aj,t−1 : j ∈ Ni ) , ∀t > 1. We refer to the mappings fi : j∈Ni Aj → Ai thus obtained, as Bayesian heuristics.1,2,3 1 The heuristics thus obtained suffer from same fallacies of snap judgments that are associated with the recommendations of system one in “Thinking, Fast and Slow”; flawed judgments that rely on simplistic interpretations: “what you see is all there is”, in Kahneman’s elegant words [52]. Indeed, the use of the initial Bayesian update for future decision epochs entails a certain level of naivety on the part of the decision maker: she has to either assume that the structure of her neighbors’ reports have not departed from their initial format, or that they are not being influenced back by her own or other group members and can thus be regarded as independent sources of information. Such naivety in disregarding the history of interactions has been highlighted in our earlier works on Bayesian learning without recall [75], where we interpret the use of time-one Bayesian update for future decision epochs, as a rational but memoryless behavior: by regarding their observations as being direct consequences of inferences that are made based on the initial priors, the agents reject any possibility of a past history beyond their immediate observations. 2 Similar and related forms of naivety have been suggested in the literature. Eyster and Rabin [26, 27] propose the autarkic model of naive inference, where players at each generation observe their predecessors but naively think that any predecessor’s action relies solely on that player’s private information, thus ignoring the possibility that successive generations are learning from each other. Bala and Goyal [7]study another form of naivety and bounded-rational behavior by considering a variation of observational learning in which agents observe the action and pay-offs of their neighbors and make rational inferences about the action/pay-off correspondences, based on their observations of the neighboring actions; however, they ignore the fact that their neighbors are themselves learning and trying to maximize their own pay-offs. Levy and Razin look at a particularly relevant cognitive bias called correlation neglect, which makes individuals regard the sources of their information as independent [60]; they analyze its implications to diffusion of information, and focus in particular, on the voting behavior. 3 Cognitive and psychological roots of the Bayesian heuristics as aggregation rules can be traced to Anderson’s seminal theory of information integration, developed throughout 1970s and 1980s [3]. Accordingly, a so-called “value function” assigns psychological values to each of the stimuli and these psychological values are then combined into a single psychological (and later an observable) response through what is called the “integration function”. A fundamental assumption is that valuation can be represented at a higher (molar) level as a value on the response dimension for each stimulus, as well as a weight representing the salience of this stimulus in the overall response. These valuations and weights are themselves the result of integration processes in the lower (molecular) level. At the heart of information integration theory is the “cognitive algebra” which describes the rules by which the values and weights of stimuli are integrated into an overall response [4]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 7 3. Affine action updates, linear updating and DeGroot learning. In this section we explore the essential modeling features that lead to a linear structure in the Bayesian Heuristics. We present a general scenario that involves the exponential family of distributions and leads to linear action updates. To describe the signal structures, we consider a measurable sample space S with a σ-finite measure Gs (·), and a parametrized class of sampling functions {L(·|θ; σi ) ∈ ∆S : σi > 0 and δi > 0} belonging to the k-dimensional exponential family as follows: `(s|θ; σi , δi ) := T Λk (ξ(ds)) dL(·|θ; σi , δi ) = σi τ (σi ξ(s), δi ) eσi η(θ) ξ(s)−δi γ(η(θ)) , dGs Gs (ds) (3) where ξ(s) : S → Rk is a measurable function acting as a sufficient statistic for the random samples, η : Θ → Rk is a mapping from the parameter space Θ to Rk , τ : Rk ×(0, +∞) → (0, +∞) is a positive weighting function, and Z T 1 Λk (ξ(ds)) γ(η(θ)) := ln σi τ (σi ξ(s), δi )eσi η(θ) ξ(s) Gs (ds), δi Gs (ds) s∈S is a normalization factor that is constant when θ is fixed, even though δi > 0 and σi > 0 vary. This normalization constant for each θ is uniquely determined by the functions η(·), ξ(·) and τ (·). The parameter space Θ and the mapping η(·) are such that the range space Ω subset of the natural parameter space Ωη := {η ∈ Rk : R θ := {η(θ) : θ ∈ Θ} is an open η T ξ(s) |Λk (ξ(ds))/Gs (ds)|τ (ξ(s), 1) e Gs (ds) < ∞}. In (3), σi > 0 and δi > 0 for each i are scals∈S ing factors that determine the quality or informativeness of the random sample si with regard to the unknown θ: fixing either one of the two factors σi or δi , the value of the other one increases with the increasing informativeness of the observed value ξ(si ). The following conjugate family of priors1 are associated with the likelihood structure (3). This family is determined uniquely by the transformation and normalization functions: η(·) and γ(·), and it is parametrized through a pair of parameters (α, β), α ∈ Rk and β > 0:  Fγ,η := V (θ; α, β) ∈ ∆Θ, α ∈ Rk , βi > 0 : T Λk (η(dθ)) eη(θ) α−βγ(η(θ)) dV (·; α, β) , = ν(θ; α, β) := dGθ Gθ (dθ) κ(α, β)  Z Λk (η(dθ)) η(θ)T α−βγ(η(θ)) κ(α, β) := e Gθ (dθ) < ∞ . Gθ (dθ) θ∈Θ Furthermore, we assume that agents take actions in Rk , and that they aim for a minimum variance estimation of the regression function or conditional expectation (given θ) of the sufficient statistic T ξ(si ). Hence, we endow every agent i ∈ [n] with the R quadratic utility ui (a,kθ) = −(a − mi,θ ) (a − k mi,θ ), ∀a ∈ Ai = R , where mi,θ := Ei,θ {ξ(si )} := s∈S ξ(s)L(ds|θ; σi , δi ) ∈ R . Our main result in this section prescribes a scenario in which each agent starts from a prior belief V (·; αi , βi ) belonging to Fγ,η and she observes a fixed number ni of i.i.d. samples from the distribution L(· | θ; σi , δi ). The agents then repeatedly communicate their actions aimed at minimum variance estimation of mi,θ . These settings are formalized under the following assumption that we term the Exponential Family Signal-Utility Structure. 1 Consider a parameter space Θ, a sample space S, and a sampling distribution L(·|θ) ∈ ∆S, θ ∈ Θ. Suppose that s is a random variable which is distributed according to L(·|θ) for any θ. A family F ⊂ ∆Θ is a conjugate family for L(·|θ), if starting from any prior distribution V(·) ∈ F and for any signal s ∈ S, the posterior distribution given the observation s = s belongs to F. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 8 Assumption 1 (Exponential family signal-utility structure). (i) Every agent i ∈ [n] observes ni i.i.d. private samples si,p , p ∈ [ni ] from the common sample space S and that the random samples are distributed according to the law L(·|θ; σi , δi ) given by (3) as a member of the k-dimensional exponential family. (ii) Every agent starts from a conjugate prior Vi (·) = V (·; αi , βi ) ∈ Fγ,η , for all i ∈ [n]. (iii) Every agent chooses actions a ∈ Ai = Rk andR bears the quadratic utility ui (a, θ) = −(a − mi,θ )T (a − mi,θ ), where mi,θ := Ei,θ {ξ(si )} := s∈S ξ(s)L(ds|θ; σi , δi ) ∈ Rk . The Bayesian heuristics fi (·), i ∈ [n] under the settings prescribed by the exponential family signal-utility structure (Assumption 1) are linear functions of the neighboring actions with specified coefficients that depend only on the likelihood structure parameters: ni , σi and δi as well as the prior parameters: αi and βi , for all i ∈ [n].1 Theorem 1 (Affine action updates). Under the exponential family signal-utility structure specified in Assumption 1, the BayesianP heuristics describing the action update of every agent i ∈ [n] are given by: ai,t = fi (aj,t−1 : j ∈ Ni ) = j∈Ni Tij aj,t−1 + i , where for all i, j ∈ [n] the constants Tij and δi are as follows: Tij = δi σj (nj + δj−1 βj ) δ P Pi , i = − σi (βi + p∈Ni np δp ) σi (βi + p∈Ni np δp ) X αj . j∈Ni \{i} The action profile at time t is the concatenation of all actions in a column vector: at = (aT1,t , . . . , aTn,t )T . The matrix T with entries Tij , i, j ∈ [n] given in Theorem 1 is called the social influence matrix. The constant terms i in this theorem appear as the rational agents attempt to compensate for the prior biases of their neighbors when making inferences about the observations in their neighborhood; we denote  = (T1 , . . . , Tn )T and refer to it as the vector of neighborhood biases. The evolution of action profiles under conditions of Theorem 1 can be specified as follows: at+1 = (T ⊗ Ik )at + , where Ik is the k × k identity matrix and (T ⊗ Ik ) is a Kronecker product. Subsequently, the evolution of action profiles over time follows a non-homogeneous positive linear discrete-time dynamics, cf. [28]. If the spectral radius of T is strictly less than unity: ρ(T ) < 1, then I − T is non-singular; there is a unique equilibrium action profile given by ae = ((I − T )−1 ⊗ Ik )  and limt→∞ at = ae . If unity is an eigenvalue of T , then there may be no equilibrium action profiles or an infinity of them. If ρ(T ) > 1, then the linear discrete-time dynamics is unstable and the action profiles may grow unbounded in their magnitude, cf. [49]. Example 1 (Gaussian Signals with Gaussian Beliefs). Mossel and Tamuz [67] consider the case where the initial private signals as well as the unknown states are normally distributed and the agents all have full knowledge of the network structure. They show that by iteratively observing their neighbors’ mean estimates and updating their beliefs using Bayes rule all agents converge to the same belief. The limiting belief is the same as what a Bayesian agent with direct access to everybody’s private signals would have hold; and furthermore, the belief updates at each step can be computed efficiently and convergence occurs in a number of steps that is bounded in the network size and its diameter. These results however assume complete knowledge of the network structure by all the agents. Here, we consider the linear action updates in the Gaussian setting. Let Θ = R be the parameter space associated with the unknown parameter θ ∈ Θ. Suppose that each agent i ∈ [n] holds 1 Some of the non-Bayesian update rules have the property that they resemble the replication of a first step of a Bayesian update from a common prior. For instance, DeMarzo, Vayanos and Zwiebel [21] interpret the weights in the DeGroot model as those assigned initially by rational agents to the noisy opinions of their neighbors based on their perceived precision. However, by repeatedly applying the same weights over and over again, the agents ignore the need to update these weights and to account for repetitions in their information sources (the so-called persuasion bias); as one of our main objectives, we formalize this setup as a Bayesian heuristic. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 9 onto a Gaussian prior belief with mean αi βi−1 and variance βi−1 ; here, γ(θ) = θ2 /2 and η(θ) = θ. Further suppose that each agent observes an independent private Gaussian signal si with mean θ and variance σi−1 = δi−1 , for all i ∈ [n]; hence, ξ(si ) = si and τ (σi ξ(si ), δi ) = τ (σi si , σi ) = −1/2 (2π/σi ) exp(σi s2i /2). After observing their private signals all engage in repeated communications with their neighbors. Finally, we assume that each agents is trying to estimate the mean mi,θ = Ei,θ {si } of her private signal with as little variance as possible. Under the prescribed setting, Theorem 1 applies and the Bayesian heuristic update rules are affine with the coefficients as k specified in the theorem with ni = 1 and σi = δi for all i. In particular, P if αi = (0, . . . , 0) ∈ R and βi → 0 for all P i, then i = 0 for all i and the coefficients Tij = σj / p∈Ni σp > 0 specify a convex combination: j∈Ni Tij = 1 for all i. Example 2 (Poisson signals with gamma beliefs). As the second example, suppose that each agent observe ni i.i.d. Poisson signals si,p : p ∈ [ni ] with mean δi θ, so that Θ = Ai = (0, +∞) for all i ∈ [n]. Moreover, we take each agent’s prior to be a Gamma distribution with parameters αi > 0 and βi > 0, denoted Gamma(αi ,βi ): νi (θ) := dVi βi αi αi −1 −βi θ = θ e , dΛ1 Γ(αi ) for all θ ∈ (0, ∞) and each i ∈ [n]. Note that here η(θ) = log θ, γ(η(θ)) = exp(η(θ)) = θ, κ(αi , βi ) = s Γ(αi )βi −αi , mi,θ = δi θ, ξ(si,p ) = si,p , σi = 1 and τ (σi ξ(si,p ), δi ) = δi i,p /(si,p !), for all i, p. This setting corresponds also to a case of Poisson observers with common rate θ and individual exposures δi , i ∈ [n], cf. [33, p. 54]. The posterior distribution over Θ after observing of the sum P of ni Poisson ni mean δi θ samples is again a Gamma distribution with updated (random) parameters p=1 si,p + αi and ni δi + βi , [33, pp. 52–53]. Using a quadratic utility −(a − δi θ)2 , the expected pay-off at time zero is maximized by the δi -scaled mean of the posterior Gamma belief [33, p. 587]: ai,0 = Pni Pdistribution nj −1 δi ( p=1 si,p + αi )/(ni δi + βi ). Given the neighboring information p=1 sj,p = (nj + βj δP j )aj,0 − αj , ∀j ∈ Ni , agent i can refine her belief into a Gamma distribution with parameters αi + j∈Ni [(nj + P βj δj−1 )aj,0 − αj ] and βi + j∈Ni nj δj . The subsequent optimal action at time 1 and the resultant Bayesian heuristics are as claimed in Theorem 1 with σi = 1 for all i ∈ [n]. HerePif we let αi , βi → 0 and δi = δ > 0 for all i, then P i = 0 for all i and the coefficients Tij = nj / p∈Ni np > 0 again specify a convex combination: j∈Ni Tij = 1 for all i as in the DeGroot model. In the following two subsections, we shall further explore this correspondence with the DeGroot updates and the implied asymptotic consensus amongst the agents. 3.1. Linear updating and convergence. In general, the constant terms i in Theorem 1 depend on the neighboring prior parameters αj , j ∈ Ni \ {i} and can be non-zero. Accumulation of constant terms over time when ρ(T ) ≥ 1 prevents the action profiles from converging to any finite values or may cause them to oscillate indefinitely (depending upon the model parameters). However, if the prior parameters are vanishingly small, then the affine action updates in Theorem 1 reduce to linear update and i = 0. This requirement on the prior parameters is captured by our next assumption. Assumption 2 (Non-informative priors). For a member V (·; α, β) of the conjugate family Fγ,η we denote the limit limαi ,βi →0 V (·; α, β) by V∅ (·) and refer to it as the non-informative (and improper, if V∅ (·) 6∈ Fγ,η ) prior. 1 All agents start from a common non-informative prior: Vi (·) = V∅ (·), ∀i. 1 Conjugate priors offer a technique for deriving the prior distributions based on the sample distribution (likelihood structures). However, in lack of any prior information it is impossible to justify their application on any subjective basis or to determine their associated parameters for any agent. Subsequently, the use of non-informative priors is suggested by Bayesian analysts and various techniques for selecting non-informative priors is explored in the literature [55]. Amongst the many proposed techniques for selecting non-informative priors, Jeffery’s method sets its choice 10 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions As the name suggest non-informative priors do not inform the agent’s action at time 0 and the optimal action is completely determined by the observed signal si,p : p ∈ [ni ] and its likelihood structure, parameterized by σi and δi . If we let αi , βi → 0 in the expressions of Tij and i from Theorem1, then the affine action updates reduce to linear combinations and the preceding corollary is immediate. Corollary 1 (Linear updating). Under the exponential family signal-utility structure (Assumption 1) with non-informative priors (Assumption 2); the Bayesian heuristics describe each of the neighboring actions aj,t−1 , j ∈ Ni : ai,t = P updated action ai,t as a linear combination P j∈Ni Tij aj,t−1 , where Tij = δi σj nj /(σi p∈Ni np δp ). The action profiles under Corollary 1 evolve as a homogeneous positive linear discrete-time system: at+1 = (T ⊗ Ik )at and if the spectral radius of T is strictly less than unity, then limt→∞ at = 0. For a strongly connected social network with Tii > 0 for all i the Perron-Frobenius theory [85, Theorems 1.5 and 1.7] implies that T has a simple positive real eigenvalue equal to ρ(T ). Moreover, the left and right eigenspaces associated with ρ(T ) are both one-dimensional with the corresponding T T eigenvectors Pn l = (l1 , . . . , ln ) and r = (r1 , . . . , rn ) , uniquely satisfying klk2 = krk2 = 1, li > 0, ri > 0, ∀i and i=1 li ri = 1. The magnitude of any other eigenvalue of T is strictly less than ρ(T ). If T ρ(T ) = 1, then limt→∞ at = limt→∞ (T t ⊗ Ik )a0 = (rl ⊗ Ik ) a0 ; in particular, the asymptotic action profile may not represent a consensus although every action converges to some point within the convex hull of the initial actions {ai,0 , i ∈ [n]}. If ρ(T ) > 1, then the linear discrete-time dynamics is unstable and the action profiles may increase or decrease without bound; pushing the decision outcome to extremes, we can associate ρ(T ) > 1 to cases of polarizing group interactions. 3.2. DeGroot updates, consensus and efficiency. In order for the linear action updates in Corollary 1 to constitute a convex combination as in the DeGroot model,1 we need to introduce some additional restrictions on the likelihood structure of the private signals. Assumption 3 (Locally balanced likelihoods). The likelihood structures given in (3) are P P called locally balanced if for all i ∈ [n], (δi /σi ) = ( j∈Ni δj nj ) / j∈Ni σj nj . Assumption 3 signifies a local balance property for the two exponential family parameters σi and δi and across every neighborhood in the network. In particular, we need P for the likelihood P structures of every agent i and her neighborhood to satisfy: δi j∈Ni σj nj = σi j∈Ni δj nj . Since parameters σi and δi are both measures of accuracy or precision for private signals of agent i, the balance condition in Assumption 3 imply that the signal precisions are spread evenly over the agents; i.e. the quality of observations obey a rule of social balance such that no agent is in a proportional to the square root of Fisher’s information measure of the likelihood structure [81, Section 3.5.3], while Laplace’s classical principle of insufficient reason favors equiprobability leading to priors which are uniform over the parameter space. 1 The use of linear averaging rules for modeling opinion dynamics has a long history in mathematical sociology and social psychology [30]; their origins can be traced to French’s seminal work on“A Formal Theory of Social Power” [29]. This was followed up by Harary’s investigation of the mathematical properties of the averaging model, including the consensus criteria, and its relations to Markov chain theory [41]. This model was later generalized to belief exchange dynamics and popularized by DeGroot’s seminal work [20] on linear opinion pools. In engineering literature, the possibility to achieve consensus in a distributed fashion (through local interactions and information exchanges between neighbors) is very desirable in a variety of applications such as load balancing [6], distributed detection and estimation [15, 95, 54], tracking [56], sensor networks and data fusion [98, 99], as well as distributed control and robotics networks [46, 64]. Early works on development of consensus algorithms originated in 1980s with the works of Tsitsiklis et.al [94] who propose a weighted average protocol based on a linear iterative approach for achieving consensus: each node repeatedly updates its value as a weighted linear combination of its own value and those received by its neighbors. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 11 position of superiority to everyone else. Indeed, fixing δi = δ for all i, the latter condition reduces to a harmonic property for the parameters σi , when viewed as a function of their respective nodes (cf. [61, Section 2.1] for the definition and properties of harmonic functions): X n j σj P σi = , δi = δ, ∀i. (4) k∈Ni nk j∈N i However, in a strongly conceded social network (4) cannot hold true unless σi is a constant: σi = σ for all i. Similarly, when σi = σ is a constant, then under Assumption 3 δi is spread as a harmonic function over the network nodes, and therefore can only take a constant value δi = δ for all i, cf. [61, Section 2.1, Maximum Principle]. In particular, fixing either of the parameters σi or δi for all agents and under the local balance condition in Assumption 3, it follows that the other parameter should be also fixed across the network; hence, the ratio σi /δi will be a constant for all i. Later when we consider the efficiency of consensus action we introduce a strengthening of Assumption 3, called globally balanced likelihood (cf. Assumption 4), where the ratio δi /σi should be a constant for all agents across the network. Examples 1 and 2 above provide two scenarios in which the preceding balancedness conditions may be satisfied: (i) having σi = δi for all i, as was the case with the Gaussian signals in Example 1, erasures that the likelihoods are globally balanced; (ii) all agents receiving i.i.d. signals from a common distribution in Examples 2 (Poisson signals with the common rate θ and common exposure δ) makes a case for likelihoods being locally balanced. Theorem 2 (DeGroot updating and consensus). Under the exponential family signalutility structure (Assumption 1), with non-informative priors (Assumption 2) and locally balanced likelihoods (Assumption 3);Pthe updated action P ai,t is a convex combination of the neighboring actions aj,t−1 , j ∈ Ni : ai,t = j∈Ni Tij aj,t−1 , j∈Ni Tij = 1 for all i. Hence, in a strongly connected social network the action profiles converge to a consensus, and the consensus value is a convex combination of the initial actions ai,0 : i ∈ [n]. In light of Theorem 2, it is of interest to know if the consensus action agrees with the minimum variance unbiased estimator of mi,θ given all the observations of every agent across the network, i.e. whether the Bayesian heuristics efficiently aggregate all the information amongst the networked agents. Our next result addresses this question. For that to hold we need to introduce a strengthening of Assumption 3: Assumption 4 (Globally balanced likelihoods). The likelihood structures given in (3) are called globally balanced if for all i ∈ [n] and some common constant C > 0, δi /σi = C. In particular, under Assumption 4, σi δj = σj δi for all i, j, and it follows that the local balance of likelihoods is automatically satisfied. We call the consensus action efficient if it coincides with the minimum variance unbiased estimator of mi,θ for all i and given all the observations of every agent across the network. Our next result indicates that global balance is a necessary condition for the agents to reach consensus on a globally optimal (efficient) action. To proceed, let the network graph structure be encoded by its adjacency matrix A defined as [A]ij = 1 ⇐⇒ (j, i) ∈ E , and [A]ij = 0 otherwise. To express the conditions for efficiency of consensus, we need to consider the set of all agents who listen to the beliefs of a given agent j; we denote this set of agents by Njout := {i ∈ [n] : [I + A]ij = 1} and refer to them as the out-neighborhood of agent j. This is in contrast to her neighborhood Nj , which is the set of all agents whom she listens to. Both sets Nj and Njout include agent j as a member. Theorem 3 ((In-)Efficiency of consensus). Under the exponential family signal-utility structure (Assumption 1) and with non-informative priors (Assumption 2); in a strongly connected social network the agents at an efficient action if, and only if, the likelihoods are P achieve consensus P globally balanced and p∈N out np δp = p∈Ni np δp , for all i and j. The efficient consensus action is j  Pn  Pn ? then given by a = j=1 δj nj aj,0 / p=1 np δp . 12 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions Following our discussing of Assumption 3 and equation (4), we pointed out that if either of the two parameters σi and δi that characterize the exponential family distribution of (3) are held fixed amongst the agents, then the harmonicity condition required for the local balancedness of the likelihoods implies that the other parameter is also fixed for all the agents. Therefore the local balancedness in many familiar cases (see Example 2) restricts the agents to observing i.i.d. signals: allowing heterogeneity only in the sample sizes, but not in the distribution of each sample. This special case is treated in our next corollary, where we also provide the simpler forms of the Bayesian heuristics and their linearity coefficients in the i.i.d. case: Corollary 2 (DeGroot learning with i.i.d. samples). Suppose that each agent i ∈ [n] observes ni i.i.d. samples belonging to the same exponential family signal-utility structure (Assumption 1 with σi = σ and δi = δ for all i). If the agents have non-informative priors (Assumption 2) and the social network is strongly connected social network, then following P the Bayesian heuristics agentsPupdate their action according to the linear combination: ai,t = j∈Ni Tij aj,t−1 , where p∈Ni np , and reach a consensus. The consensus action is efficient if, and only P Tij = nj / P ? n = if, p∈Njout p p∈Ni np for all i and j, and the efficient consensus action is given by a =   Pn Pn j=1 aj,0 nj / p=1 np . It is notable that the consensus value pinpointed by Theorem 2 does not necessarily agree with the MVUE of mi,θ given all the private signals of all agents across the network; in other words, by following Bayesian heuristics agents may not aggregate all the initial data efficiently. As a simple example, consider the exponential family signal-utility structure with non-informative priors (Assumptions 1 and 2) and suppose that every agent observes an i.i.d. sample from a common distribution LP (·|θ; 1, 1). In this case, the action updates proceed by simple iterative averaging: ai,t = (1/|Ni |) j∈Ni aj,t−1 for all i ∈ [n] and any t ∈ N. For an undirected graph G it is well-known that theP asymptotic consensus action following simple iterative averaging is the degree-weighted n average i=1 (deg(i)/|E|)aP i,0 , cf. [38, Section II.C]; and the consensus action is different form the n global MVUE a? = (1/n) i=1 ai,0 unless the social network is a regular graph in which case, deg(i) = d is fixed for all i, and |E| = n.d. Remark 1 (Efficiency of Balanced Regular Structures). In general, if we assume that all agents receive the same number of i.i.d. P Psamples from the same distribution, then the condition for efficiency of consensus, p∈N out np = p∈Ni np , is satisfied for balanced regular structures. j In such highly symmetric structures, the number of outgoing and incoming links are the same for every node and equal to fixed number d. Our results shed light on the deviations from the globally efficient actions, when consensus is being achieved through the Bayesian heuristics. This inefficiency of Bayesian heuristics in globally aggregating the observations can be attributed to the agents’ naivety in inferring the sources of their information, and their inability to interpret the actions of their neighbors rationally, [38]; in particular, the more central agents tend to influence the asymptotic outcomes unfairly. This sensitivity to social structure is also due to the failure of agents to correct for the repetitions in the sources of the their information: agent i may receive multiple copies that are all influenced by the same observations from a far way agent; however, she fails to correct for these repetition in the sources of her observations, leading to the co-called persuasion bias, [21].1 1 Sobel [90] provides a theoretical framework to study the interplay between rationality and group decisions and points out the subsequent inefficiencies in information aggregation. The seminal work of Janis [50] provides various examples involving the American foreign policy in the mid-twentieth where the desire for harmony or conformity in the group have resulted in bad group decisions, a phenomenon that he coins groupthink. Various other works have looked at the choice shift toward more extreme options [23, 91] and group polarization [44, 83]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 13 4. Log-Linear belief updates. When the state space Θ is finite, the action space is the probability simplex and the agents bear a quadratic utility that measures the distance between their action and the point mass on the true state, the communication structure between the agents is rich enough for them to reveal their beliefs at every time period. The Bayesian heuristics in this case lead to a log-linear updating of beliefs similar to what we analyze in [73, 75] under the Bayesian without recall model; the chief question of interest to the latter works is whether the agents, after being exposed to sequence of private observations and while communicating with each other, can learn the truth using the Bayesian without recall update rules. 1 The learning framework of [73, 74, 75, 78] in which agents have access to an stream of new observations is in contrast with the group decision model of this paper; the difference being in the fact that here the agents have a single initial observation and engage in group decision making to come up with the best decision that aggregates their individual private data with those of the other group members. Consider an environment where the state space is a finite set of cardinality m and agents take actions over the (m − 1)-simplex of probability measures while trying to minimize their distance to a point mass on the true state. Specifically, let Θ = {θ1 , . . . , θm }, Ai = ∆Θ and for any probability measure M(·) ∈ Ai with probability mass function µ(·) := dM/dK, suppose that ui (M, θj ) = −(1 − µ(θj ))2 − m X µ(θk )2 . k=1, k6=j Subsequently, Mi,t = arg maxM∈∆Θ Ei,t {ui (M, θ)}, and the agents proceed by truthfully announcing their beliefs to each other at every time step. In particular, if we denote the belief probability mass functions νi (·) := dVi /dK and µi,t (·) := dMi,t /dK for all t, then we can follow the steps of [77] to derive the Bayesian heuristic fi in (2) by replicating the time-one Bayesian belief update for all future time-steps: Q  µj,t−1 (θ̂) µi,t−1 (θ̂) j∈Ni \{i} νj (θ̂) , Q µi,t (θ̂) = P (5) µj,t−1 (θ̃) µ ( θ̃) θ̃∈Θ i,t−1 j∈Ni \{i} ν (θ̃) j for all θ̂ ∈ Θ and at any t > 1.2,3 1 Naivety of agents in these cases impedes their ability to learn; except in simple social structures such as cycles or rooted trees (cf. [74]). Rahimian, Shahrampour and Jadbabaie [78] show that learning in social network with complex neighborhood structures can be achieved if agents choose a neighbor randomly at every round and restrict their belief update to the selected neighbor each time. In the literature on theory of learning in games [31], log-linear learning refers to a class of randomized strategies, where the probability of each action is proportional to an exponential of the difference between the utility of taking that action and the utility of the optimal choice. Such randomized strategies combine in a log-linear manner [14], and they have desirable convergence properties: under proper conditions, it can be shown that the limiting (stationary) distribution of action profiles is supported over the Nash equilibria of the game [62]. 2 In writing (5), every time agent i regards each of her neighbors j ∈ Ni as having started from some prior belief νj (·) and arrived at their currently reported belief µj,t−1 (·) upon observing their private signals, hence rejecting any possibility of a past history, or learning and correlation between their neighbors. Such a rule is of course not the optimum Bayesian update of agent i at any step t > 1, because the agent is not taking into account the complete observed history of beliefs and is instead, basing her inference entirely on the initial signals and the immediately observed beliefs. 3 It is notable that the Bayesian heuristic in (5) has a log-linear structure. Geometric averaging and logarithmic opinion pools have a long history in Bayesian analysis and behavioral decision models [37, 84] and they can be also justified under specific behavioral assumptions [65]. The are also quite popular as a non-Bayesian update rule in engineering literature for addressing problems such as distributed detection and estimation [86, 79, 71, 59, 8]. In [8] the authors use Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 14 4.1. An algebra of beliefs. Both the linear action updates studied in the previous chapter as well as the weighted majority update rules that arise in the binary case and are studied in [76, 75] have a familiar algebraic structure. It is instructive to develop similar structural properties for belief updates in (5) and over the space ∆Θ, i.e. the points of the standard (m − 1)-simplex. Given two beliefs µ1 (·) and µ2 (·) over Θ we denote their “addition” as µ1 (θ̂)µ2 (θ̂) µ1 ⊕ µ2 (θ̂) = P θ̂∈Θ µ1 (θ̂)µ2 (θ̂) . Indeed, let ∆Θo denote the (m − 1)-simplex of probability measure over Θ after all the edges are excluded; ∆Θo endowed with the ⊕ operation, constitutes a group (in the algebraic sense of the word). It is easy to verify that the uniform distribution µ̄(θ̂) = 1/|Θ| acts as the identity element for the group; in the sense that µ̄ ⊕ µ = µ for all µ ∈ ∆Θo , and given any such µ we can uniquely identify its inverse as follows: 1/µ(θ̂) . θ̃∈Θ 1/µ(θ̃) µinv (θ̂) = P Moreover, the group operation ⊕ is commutative and we can thus endow the abelian group (∆Θo , ⊕) with a subtraction operation: µ1 µ1 (θ̂)/µ2 (θ̂) . θ̃∈Θ µ1 (θ̃)/µ2 (θ̃) µ2 (θ̂) = µ1 ⊕ µinv 2 (θ̂) = P We are now in a position to rewrite the Bayesian heuristic for belief updates in terms of the group operations ⊕ and over the simplex interior: µi,t = ⊕ µj,t−1 j∈Ni j∈Ni \{i} νj . The above belief update has a structure similar to the linear action updates studied in (1): the agents incorporate the beliefs of their neighbors while compensating for the neighboring priors to isolate the observational parts of the neighbors’ reports. A key difference between the action and belief updates is in the fact that action updates studied in Section 3 are weighted in accordance with the observational ability of each neighbor, whereas the belief updates are not. Indeed, the quality of signals are already internalized in the reported beliefs of each neighbor; therefore there is no need to re-weight the reported beliefs when aggregating them. a logarithmic opinion pool to combine the estimated posterior probability distributions in a Bayesian consensus filter; and show that as a result: the sum of KullbackLeibler divergences between the consensual probability distribution and the local posterior probability distributions is minimized. Minimizing the sum of KullbackLeibler divergences as a way to globally aggregate locally measured probability distributions is proposed in [11, 10] where the corresponding minimizer is dubbed the KullbackLeibler average. Similar interpretations of the log-linear update are offered in [70] as a gradient step for minimizing either the KullbackLeibler distance to the true distribution, or in [72] as a posterior incorporation of the most recent observations, such that the sum of KullbackLeibler distance to the local priors is minimized; indeed, the Bayes’ rule itself has a product form and the Bayesian posterior can be characterized as the solution of an optimization problem involving the KullbackLeibler divergence to the prior distribution and subjected to the observed data [100]. In the past, we have investigated the implications of such log-linear behavior and properties of convergence and learning when agents are exposed to a stream of private observation [73, 74, 77, 78]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 15 Given the abelian group structure we can further consider the “powers” of each element µ2 = µ ⊕ µ and so on; in general for each inetger n and any belief µ ∈ ∆Θo , let the n-th power of µ be denoted by n µ := µn , defined as follows:1 µn (θ̂) . n θ̃∈Θ µ (θ̃) Using the ⊕ and µn (θ̂) = P notations, as well as the adjacency matrix A we get: µi,t+1 = ⊕ µj,t j∈Ni j∈Ni \{i} νj = ⊕ ([I + A]ij j∈[n] µj,t ) j∈[n] ([A]ij νj ). (9) With some abuse of notation, we can concatenate the network beliefs at every time t into a column vector µt = (µ1,t , . . . , µn,t )T and similarly for the priors ν = (ν1 , . . . , νn )T ; thus (9) can be written in the vectorized format by using the matrix notation as follows: µt = {(I + A) µt−1 } {A ν} Iterating over t and in the common matrix notation we obtain: n o nP t µt = (I + A)t µ0 ( τ =0 (I + A)τ A) (10) o ν . (11) The above is key to understanding the evolution of beliefs under the Bayesian heuristics in (5), as we will explore next. In particular, when all agents have uniform priors νj = µ̄ for all j, then (10) and (11) simplify as follows: µt = (I + A) µt−1 = (I + A)t µ0 . This assumption of a common uniform prior is the counterpart of Assumption 1 (non-informative priors) in Subsection 3.1, which paved the way for transition from affine action updates into linear ones. In the case of beliefs over a finite state space Θ, the uniform prior µ̄ is non-informative. If all agents start form common uniform priors, the belief update in (5) simplifies as follows: Q j∈Ni µj,t−1 (θ̂) µi,t (θ̂) = P . (12) Q θ̃∈Θ j∈Ni µj,t−1 (θ̃) Our main focus in the next section is to understand how the individual beliefs evolve under (5), or (12) which is a spacial case of (5). The gist of our analysis is encapsulated in the group theoretic iterations: µt = (I + A)t µ0 , derived above for the common uniform priors case. In particular, our understanding of the increasing matrix powers (I + A)t plays a key role. When the network graph G is strongly connected, the matrix I + A is primitive. The Perron-Frobenius theory [85, Theorems 1.5 and 1.7] implies that I + A has a simple positive real eigenvalue equal to its spectral radius ρ(I + A) = 1 + ρ, where we adopt the shorthand notation ρ := ρ(A). Moreover, the left and right eigenspaces associated with this eigenvalue are both one-dimensional and the corresponding eigenvectors can be taken such that they both have strictly positive entries. The magnitude of any other eigenvalue of I + A is strictly less than 1 + ρ. Hence, the eigenvalues of I + A denoted by λi (I + A), i ∈ [n], can be ordered in their magnitudes as follows: |λn (I + A)| ≤ |λn−1 (I + A)| ≤ 1 This notation extends to all real numbers n ∈ R, and it is easy to verify that the following distributive properties are satisfied: n (µ1 ⊕ µ2 ) = (n µ1 ) ⊕ (n µ2 ), (m + n) µ1 = (m µ1 ) ⊕ (n µ1 ), (m.n) µ1 = m (n µ1 ), for all m, n ∈ R and µ1 , µ2 ∈ ∆Θo . 16 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions . . . < λ1 (I + A) = 1 + ρ. Subsequently, we can employ the eigendecomposition of (I + A) to analyze the behavior of (I + A)t+1 . Specifically, we can take a set of bi-orthonormal vectors li , ri as the left and right eigenvectors corresponding to the ith eigenvalue of I + A, satisfying: kli k2 = kri k2 T T = 1, li ri = 1 for all i and li rj = 0, i 6= j; in particular, the left eigenspace associated with ρ is one-dimensional with the corresponding eigenvector l1 = α = (α1 , . . . , αn )T , uniquely satisfying Pn T T i=1 αi = 1, αi > 0, ∀i ∈ [n], and α A = (ρ + 1)α . The entry αi is called the centrality of agent i and as the name suggests, it measures how central is the location of agent in the network. We can now use the spectral representation of A to write [49, Section 6]: ! n X T T (I + A)t = (1 + ρ)t r1 α + (λi (I + A)/(1 + ρ))t ri li . (13) i=2 Asymptotically, we get that all eigenvalues other than the Perron-Frobenius eigenvalue 1 + ρ are T T µ0 as t → ∞; the latter holds subdominant; hence, (I + A)t → (1 + ρ)t r1 α and µt = (1 + ρ)t r1 α true for the common uniform priors case and also in general, as we shall see next. 4.2. Becoming certain about the group aggregate. We begin our investigation of the evolution of beliefs under (12) by considering the optimal response (belief) of an agents who has been given access to the set of all private observations across the network; indeed, such a response can be achieved in practice if one follows Kahneman’s advice and collect each individual’s information privately before combining them or allowing the individuals to engage in public discussions [52, Chapter 23]. Starting from the uniform prior and after observing everybody’s private data our aggregate belief about the truth state is given by the following implementation of the Bayes rule: µ? (θ̂) = P Q j∈Ni θ̃∈Θ Q `j (sj |θ̂) j∈Ni `j (sj |θ̃) . (14) Our next theorem describes the asymptotic outcome of the group decision process when the agents report their beliefs and follow the Bayesian heuristic (12) to aggregate them. The outcome indicated in Theorem 4 departs from the global optimum µ? in two major respects. Firstly, the Pn agents reach consensus on a belief that is supported over Θ♦ := arg maxθ̃∈Θ i=1 αi log(`i (si |θ̃)), as opposedPto the global (network-wide) likelihood maximizer Θ? := arg maxθ̃∈Θ µ? (θ̃) = n arg maxθ̃∈Θ i=1 log(`i (si |θ̃)); note that the signal log-likelihoods in the case of Θ♦ are weighted by the centralities, αi , of their respective nodes. Secondly, the consensus belief is concentrated uniformly over Θ♦ , its support does not include the entire state space Θ and those states which score lower on the centrality-weighted likelihood scale are asymptotically rejected as a candidate for the truth state; in particular, if {θ♦ } = Θ♦ is a singlton, then the agents effectively become certain about the truth state of θ♦ , in spite of their essentially bounded aggregate information and in contrast with the rational (optimal) belief µ? that is given by the Bayes rule in (14) and do not discredit or reject any of the less probable states. This unwarranted certainty in the face of limited aggregate data is a manifestation of the group polarization effect that derive the agent to more extreme beliefs, rejecting the possibility of any alternatives outside of Θ♦ . Theorem 4 (Certainty about the group aggregate). Following the Bayesian heuristic ♦ ? ♦ belief updates Pn in (5), limt→∞ µi,t (θ̃) = 1/|Θ | for all i ∈ [n] and any θ̃ ∈ Θ , where Θ := arg maxθ̃∈Θ i=1 αi log(`i (si |θ̃)). In particular, if the sum of signal log-likelihoods weighted by node centralities is uniquely maximized by θ♦ , i.e. {θ♦ } = Θ♦ , then limt→∞ µi,t (θ♦ ) = 1 almost surely for all i ∈ [n]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 17 Remark 2 (Efficiency of balanced regular networks). The fact that log-likelihoods in Θ♦ are weighted by the node centralities is a source of inefficiency for the asymptotic outcome of the group decision process. This inefficiency is warded off in especially symmetric typologies, where in and out degrees of all nodes in the network are the same. In these so-called balanced regular digraphs, there is a fixed integer d such that all agents receive reports from exactly d agents, and also send their reports to some other d agents; d-regular graphs are a special case, since all links are bidirectional and each agent sends her reports to and receive reports from the same d agents. In such structures α = (1/n)1 so that Θ? = Θ♦ and the support of the consensus belief identifies the global maximum likelihood estimator (MLE); i.e. the maximum likelihood estimator of the unknown θ, given the entire set of observations from all agents in the network. 5. Conclusions. We propose the Bayesian heuristics framework to address the problem of information aggregation and decision making in groups. Our model is consistent with the dual process theory of mind with one system developing the heuristics through deliberation and slow processing, and another system adopting the heuristics for fast and automatic decision making: once the time-one Bayesian update is developed, it is used as a heuristic for all future decision epochs. On the one hand, this model offers a behavioral foundation for non-Bayesian updating; in particular, linear action updates and log-linear belief updates. On the other hand, its deviation from the rational choice theory captures common fallacies of snap-judgments and history neglect that are observed in real life. Our behavioral method also complements the axiomatic approaches which investigate the structure of belief aggregation rules and require them to satisfy specific axioms such as label neutrality and imperfect recall, as well as independence or separability for log-linear and linear rules, respectively [65]. We showed that under a natural quadratic utility and for a wide class of distributions from the exponential family the Bayesian heuristics correspond to a minimum variance Bayes estimation with a known linear structure. If the agents have non-informative priors, and their signal structures satisfy certain homogeneity conditions, then these action updates constitute a convex combination as in the DeGroot model, where agents reach consensus on a point in the convex hull of their initial actions. In case of belief updates (when agents communicate their beliefs), we showed that the agents update their beliefs proportionally to the product of the self and neighboring beliefs. Subsequently, their beliefs converge to a consensus supported over a maximum likelihood set, where the signal likelihoods are weighted by the centralities of their respective agents. Our results indicate certain deviations from the globally efficient outcomes, when consensus is being achieved through the Bayesian heuristics. This inefficiency of Bayesian heuristics in globally aggregating the observations is attributed to the agents’ naivety in inferring the sources of their information, which makes them vulnerable to structural network influences: the share of centrally located agents in shaping the asymptotic outcome is more than what is warranted by the quality of their data. Another source of inefficiency is in the group polarization that arise as a result of repeated group interactions; in case of belief updates, this is manifested in the structure of the (asymptotic) consensus beliefs. The latter assigns zero probability to any alternative that scores lower than the maximum in the weighted likelihoods scale: the agents reject the possibility of less probable alternatives with certainty, in spite of their limited initial data. This overconfidence in the group aggregate and shift toward more extreme beliefs is a key indicator of group polarization and is demonstrated very well by the asymptotic outcome of the group decision process. We pinpoint some key differences between the action and belief updates (linear and log-linear, respectively): the former are weighted updates, whereas the latter are unweighted symmetric updates. Accordingly, an agent weighs each neighbor’s action differently and in accordance with the quality of their private signals (which are inferred from the actions). On the other hand, when communicating their beliefs the quality of each neighbor’s signal is already internalized in their Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 18 reported beliefs; hence, when incorporating her neighboring beliefs, an agent regards the reported beliefs of all her neighbors equally and symmetrically. Moreover, in the case of linear action updates the initial biases are amplified and accumulated in every iteration. Hence, the interactions of biased agents are very much dominated by their prior beliefs rather than their observations. This issue can push their choices to extremes, depending on the aggregate value of their initial biases. Therefore, if the Bayesian heuristics are to aggregate information from the observed actions satisfactorily, then it is necessary for the agents to be unbiased, i.e. they should hold non-informative priors about the state of the world and base their actions entirely on their observations. In contrast, when agents exchange beliefs with each other the multiplicative belief update can aggregate the observations, irrespective of the prior beliefs. The latter are asymptotically canceled; hence, multiplicative belief updates are robust to the influence of priors. The Bayesian heuristics approach is strongly motivated by the behavioral processes that underlie human decision making. These processes often deviate from the predictions of the rational choice theory, and our investigation of the Bayesian heuristics highlights both the mechanisms for such deviations and their ramifications. In our ongoing research, we expand this behavioral approach by incorporating additional cognitive biases such as inattentiveness, and investigate how the decision processes are affected. On the one hand, the obtained insights highlight the value of educating the public about benefits of rational decision making and unbiased judgment, and how to avoid common cognitive errors when making decisions. On the other hand, by investigating the effect of cognitive biases, we can improve the practice of social and organizational policies, such that new designs can accommodate commonly observed biases, and work well in spite of them. Appendix A: Proof of Theorem 1. If agent i starts from a prior belief Vi (·) = V (·; αi , βi ) ∈ Fγ,η , then we can use the Bayes rule to verify that, cf. [81, Proposition 3.3.13], the Radon-Nikodym derivative of the Bayesian posterior of agent i after observing ni samples si,p ∈ S , p ∈ [ni ], with Pni likelihood (3) is ν(·; αi + σi p=1 ξ(si,p ), βi + ni δi ), and in particular Pnithe Bayesian posterior at time zero belongs to the conjugate family Fγ,η : Mi,0 (·) = V (·; αi + σi p=1 ξ(si,p ), βi + ni δi ). T Subject to the quadratic utility ui (a, θ) = −(a − mi,θ ) (a − mi,θ ), the expected pay-off at any time time t is maximized is by choosing [12, Lemma 1.4.1]: ai,t = Ei,t {mi,θ } := Z θ∈Θ mi,θ Mi,t (dθ), which coincides with her minimum variance unbiased estimator (Bayes estimate) for mi,θ . The members of the conjugate family Fγ,η satisfy the following linearity property of the Bayes estimates that is key to our derivations.1 Lemma 1 (Proposition 3.3.14 of [81]). Let ζ ∈ Rk be a parameter and suppose that the parameter space Ωζ is an open set in Rk . Suppose further that ζ ∈ Ωζ has the prior distribution T W (·; α, β) with density κ0 (α, β)eζ α−βγ(ζ) w.r.t. Λk where κ0 (α, β) is the normalization constant. If t 0 s0 ∈ S 0 ⊂ Rk is a random signal with distribution D(·; ζ) and density τ 0 (s)eζ s−γ (ζ) w.r.t. Λk , then Z Z ζ∈Ωζ s0 ∈S 0 1 sD(ds; ζ)W (dζ; α, β) = α . β In fact, such an affine mapping from the observations to the Bayes estimate characterizes the conjugate family Fγ,η and every member of this family can be uniquely identified from the constants of the affine transform [22]. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 19 Hence for any V (·; α, β) ∈ Fγ,η we can write Z Z Z mi,θ V (dθ; α, β) = ξ(s)L(ds|θ; σ, δ)V (dθ; α, β) θ∈Θ = θ∈Θ s∈S Z T Λk (η(dθ)) eη(θ) α−βγ(η(θ)) Gθ (dθ)× Gθ (dθ) κ(α, β) Z θ∈Θ T Λk (ξ(ds)) ξ(s)σ τ (σξ(s), δ) eση(θ) ξ(s)−δγ(η(θ)) Gs (ds) Gs (ds) s∈S Z T Λk (η(dθ)) eη(θ) α−βγ(η(θ)) Gθ (dθ)× = Gθ (dθ) κ(α, β) Z ζ∈Ωθ T Λk (ξ(ds)) ξ(s)σ τ (σξ(s), δ) eση(θ) ξ(s)−δγ(η(θ)) Gs (ds) Gs (ds) s∈S Z Z β 0 T s0 τ 0 (s0 ) ζ T s0 −γ 0 (ζ) eζ α− δ γ (ζ) Λk (dζ) e Λk (ds0 ) = κ(α, β) σ s0 ∈S 0 ζ∈Ωη αδ = , σβ (15) where in the penultimate equality we have employed the following change of variables: ζ = η(θ), s0 = σξ(s), γ 0 (ζ) = δγ(ζ), τ 0 (s0 ) = τ (s0 , δ);P and the last equality is a direct application of Lemma 1. ni In particular, given Mi,0 (·) = V (·; αi + σi p=1 ξ(si,p ), βi + ni δi ), the expectation maximizing action at time zero coincides with: Pni −1 p=1 ξ(si,p ) + σi αi ai,0 = . (16) ni + δi−1 βi Subsequently, following her observations of aj,0 , j ∈ Ni and from her knowledge Pnj of her neighbor’s priors and signal likelihood structure, agent i infers the observed values of p=1 ξ(sj,p ) for all her neighbors. Hence, we get nj X p=1 ξ(sj,p ) = (nj + δj−1 βj )aj,0 − σj−1 αj , ∀j ∈ Ni . (17) The observations Pnj of agent i are therefore augmented by the set of independent samples from her neighbors: { p=1 ξ(sj,p ) : j ∈ Ni }, and her refined belief at time 1 is again a member of the conjugate family Fγ,η and is give by: Mi,1 (·) = V (·; αi + X j∈Ni σj nj X p=1 ξ(sj,p ), βi + X nj δj ). j∈Ni We can again invoke the linearity of the Bayes estimate for the conjugate family Fγ,η and the subsequent result in (15), to get that the expected pay-off maximizing action at time 1 is given by:   P Pnj δi αi + j∈Ni σj p=1 ξ(sj,p )   . (18) ai,1 = P σi βi + j∈Ni nj δj Finally, we can use (17) to replace for the neighboring signals and derive the expression of the action update of agent i at time 1 in terms of her own and the neighboring actions aj,0 , j ∈ Ni ; leading to the expression of linear Bayesian heuristics as claimed in Theorem 1.  20 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions Appendix B: Proof of Theorem 2. The balancedness of likelihoods (Assumption 3) ensures P that the coefficients of the linear conbination from Corollary 1 sum to one: j∈Ni Tij = 1, for all i; thus forming aP convex combination as in the DeGroot model. Subsequently, the agents begin ni by setting ai,0 = p=1 ξ(si,p )/ni according to (16), and at every t > 1 they update their actions according to at = T at−1 , where at = (a1,t , . . . , an,t )T and T is the n × n matrix whose i, j-th entry is Tij . Next note from the analysis of convergence for DeGroot model, cf. [38, Proporition 1], that for a strongly connected network G if it is aperiodic (meaning that one is the greatest common divisor of the lengths of all its circles; and it is the case for us, since the diagonal entries of T T are all non-zero), then limτ →∞ T τ = 1s , where s := P (s1 , . . . , sn )T is the unique left eigenvector n associated with the unit eigenvalue of T and satisfying i=1 si = 1, si > 0, ∀i. Hence, starting from non-informative priors agents follow DeGroot update and if G is also strongly connected, then Pthe Pni n they reach a consensus at sT a0 = i=1 si ( p=1 ξ(si,p )/ni ).  Appendix C: Proof of Theorem 3. We begin by a lemma that determines the so-called global MVUE for each i, i.e. the MVUE of mi,θ given all the observations of all agents across the network. Lemma 2 (Global MVUE). Under the exponential family signal-utility structure (Assumption 1), the (global) MVUE of mi,θ given the entire set of observations of all the agents across the network is given by:   Pn Pnj δi αi + j=1 σj p=1 ξ(sj,p )   a?i = . (19) Pn σi βi + j=1 nj δj If we further impose non-informative priors (Assumption 2), then the global MVUE for each i can be rewritten as P  Pnj n n δi σ ξ(s ) j,p j=1 j p=1 δ i X σj n j P  Pn a?i = aj,0 . (20) = n σi j=1 p=1 np δp σi n δ j j j=1 This lemma can be proved easily by following the same steps that lead to (18) to get (19); making the necessary substitutions under Assumption 2 yields (20). From (20), it is immediately clear that if some consensus action is to be the efficient estimator (global MVUE) for all agents i ∈ [n], then we need δi σj = σi δj for all i, j; hence, the global balance is indeed a necessary condition. Under this condition, the local balance of likelihoods (Assumption 3) is automatically satisfied and given noninformative priors Theorem 2 guarantees convergenceP to a consensus P in strongly connected social n n ? ? network. Moreover, we can rewrite (20) as ai = a = ( j=1 δj nj aj,0 )/ p=1 np δp , for all i. Hence, if T the consensus Pn action (s a0 in the proof of Theorem 2, Appendix B) is to be efficient then we need si = δi ni / j=1 nj δj for all i; s = (s1 , . . . , sn ) being the unique normalized left eigenvector associated with the unit eigenvalue of T : sT T = sT , as defined in Appendix B. Using δi σj = Pσi δj , we can also rewrite the coefficients Tij of the DeGroot update in Theorem 2 as Tij = δj nj /( p∈Ni np δp ). Therefore, by expanding the eigenvector condition sT T = sT we obtain that in order for the consensus action sT a0 to agree with the efficient consensus a? , it is necessary and sufficient to have that for all j ! n n X X δi ni δj nj [I + A]ij δ j nj P Pn , (21) si Tij = = sj = Pn p∈Ni np δp j=1 δj nj j=1 δj nj i=1 i=1 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 21 or equivalently, X i:j∈Ni X δi ni δn P i i = = 1, p∈Ni np δp p∈Ni np δp out P (22) i∈Nj for allPj. Under the global balance condition (Assumption 4), δi σj = δj σi , the weights Tij = δj nj /( p∈Ni np δp ) as given above, correspond to transition probabilities of a node-weighted random walk on the social network graph, cf. [16, Section 5]; where each node i ∈ [n] is weighted by wi = ni δi . Such a random walk is a special case of the more common type of random walks on weighted graphs where the edge weights determine the jump probabilities; indeed, if for any edge (i, j) ∈ E we set its weight equal to wi,j = wi wj then the random walk on the edge-weighted graph reduces to a random walk on the node-weighted graph with node weights wi , i ∈ [n]. If the social network graph is undirected and connected (so that wi,j = wj,i for all i, j), then the edgeweighted (whence also the node-weighted) random walks are time-reversible and their stationary distributions (s1 , . . . , sn )T can be calculated in closed form as follows [2, Section 3.2]: P j∈N wi,j . (23) si = Pn P i i=1 j∈Ni wi,j In a node-weighted random walk we can replace wi,j = wi wj for all j ∈ Ni and (23) simplifies into P wi j∈Ni wj P si = Pn . i=1 wi j∈Ni wj Similarly to (21), the consensus action will be efficient if and only if P wi j∈Ni wj wi P si = Pn = Pn , ∀i, i=1 wi j∈Ni wj k=1 wk or equivalently: n n X X X X ( wk ) wj = (wi wj ), ∀i, k=1 P j∈Ni i=1 j∈Ni which holds P true only if j∈Ni wj is a common constant that is the same for all agents, i.e. P 0 δ n = C > 0 for all i ∈ [n]. Next replacing in (22) yields that, in fact, C 0 = w = j∈Ni j j Pj∈Ni j  i∈N out δi ni for all j, completing the proof for the conditions of efficiency. j Appendix D: Proof of Theorem 4. We address the more general case of (5), which includes (12) as a special case (with common uniform priors). For any pair of states θ̂ and θ̌, define the log ratio of beliefs, likelihoods, and priors as follows:   φi,t (θ̂, θ̌) := log µi,t (θ̂)/µi,t (θ̌) ,   λi (θ̂, θ̌) := log `i (si |θ̂)/`i (si |θ̌) ,   γi (θ̂, θ̌) := log νi (θ̂)/νi (θ̌) , By concatenating the log-ratio statistics of the n networked agents, we obtain the following three vectorizations for the log-ratio statistics: φt (θ̂, θ̌) := (φ1,t (θ̂, θ̌), . . . , φn,t (θ̂, θ̌)), λ(θ̂, θ̌) := (λ1 (θ̂, θ̌), . . . , λn (θ̂, θ̌)), γ(θ̂, θ̌) := (γ1 (θ̂, θ̌), . . . , γn (θ̂, θ̌)). Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 22 Using the above notation, we can rewrite the log-linear belief updates of (5) in a linearized vector format as shown below: φt+1 (θ̂, θ̌) =(I + A)φt (θ̂, θ̌) − Aγ(θ̂, θ̌) t X t+1 (I + A)τ Aγ(θ̂, θ̌) =(I + A) φ0 (θ̂, θ̌) −  τ =0  t X =(I + A) λ(θ̂, θ̌) + γ(θ̂, θ̌) − (I + A)τ Aγ(θ̂, θ̌) τ =0 ! t X (I + A)τ A γ(θ̂, θ̌). =(I + A)t+1 λ(θ̂, θ̌) + (I + A)t+1 − t+1 τ =0 Next we use the spectral decomposition in (13) to obtain: φt+1 (θ̂, θ̌) = (1 + ρ)t+1 r1 Λ(θ̂, θ̌) + ((1 + ρ)t+1 − t+1 = (1 + ρ) r1 Λ(θ̂, θ̌) + (1 − → (1 + ρ)t+1 r1 Λ(θ̂, θ̌), t X τ =0 1 t X (1 + ρ)τ ρ)r1 β(θ̂, θ̌) + o((1 + ρ)t+1 ) τ =0 ! (1 + ρ)τ −t−1 ρ)r1 β(θ̂, θ̌) + o(1) (24) where we adopt the following notations for the global log likelihood and prior ratio statistics: β(θ̂, θ̌) := αT γ(θ̂, θ̌) and Λ(θ̂, θ̌) := αT λ(θ̂, θ̌); furthermore, P∞ in calculation of the limit in the last step of (24) we use the geometric summation identity τ =0 ρ(1 + ρ)τ −1 = 1. Pn To proceed denote Λ(θ̂) := i=1 αi `i (si |θ̂) so that Λ(θ̂, θ̌) = Λ(θ̂) − Λ(θ̌). Since Θ♦ consists of the set of all maximizers of Λ(θ̂), we have that Λ(θ̂, θ̌) < 0 whenever θ̌ ∈ Θ♦ and θ̂ 6∈ Θ♦ . Next recall from (24) that φt+1 (θ̂, θ̌) → (1 + ρ)t+1 r1 Λ(θ̂, θ̌) and r1 is the right Perron-Frobenius eigenvector with all positive entries; hence, for all θ̃ ∈ Θ♦ and any θ̂, φi,t (θ̂, θ̃) → −∞ if θ̂ 6∈ Θ♦ and φi,t (θ̂, θ̃) = 0 whenever θ̂ ∈ Θ♦ ; or equivalently, µi,t (θ̂)/µi,tP (θ̃) → 0 for all θ̂ 6∈ Θ♦ , while µi,t (θ̂) = µi,t (θ̃) for any θ̂ ∈ Θ♦ . The latter together with the fact that θ∈Θ ˜ µi,t (θ̃) = 1 for all t implies that with probability one: limt→∞ µi,t (θ̃) = 1/|Θ♦ |, ∀θ̃ ∈ Θ♦ and limt→∞ µi,t (θ̃) = 0, ∀θ̃ 6∈ Θ♦ as claimed in the Theorem. In the special case that Θ♦ is a singleton, {θ♦ } = Θ♦ , we get that limt→∞ µi,t (θ♦ ) = 1 almost surely for all i ∈ [n]. Acknowledgments. This work was supported by ARO MURI W911NF-12-1-0509. References [1] Acemoglu D, Dahleh MA, Lobel I, Ozdaglar A (2011) Bayesian learning in social networks. The Review of Economic Studies 78(4):1201–1236. [2] Aldous D, Fill J (2002) Reversible markov chains and random walks on graphs. Book in progress. [3] Anderson NH (1971) Integration theory and attitude change. Psychological review 78(3):171. [4] Anderson NH (1981) Foundations of information integration theory . [5] Aumann RJ (1976) Agreeing to disagree. The annals of statistics 1236–1239. [6] Baikerikar J, Surve S, Prabhu S (2011) Consensus based dynamic load balancing for a network of heterogeneous workstations. Advances in Computing, Communication and Control, 116–124 (Springer). [7] Bala V, Goyal S (1998) Learning from neighbours. The Review of Economic Studies 65(3):595–621. 1 Given two functions f (·) and g(·) we use the asymptotic notation f (t) = o(g(t)) to signify the relations limt→∞ |f (t)/g(t)| = 0. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 23 [8] Bandyopadhyay S, Chung SJ (2014) Distributed estimation using bayesian consensus filtering. American Control Conference 634–641. [9] Banerjee AV (1992) A simple model of herd behavior. The Quarterly Journal of Economics 107(3):797– 817. [10] Battistelli G, Chisci L (2014) Kullback–leibler average, consensus on probability densities, and distributed state estimation with guaranteed stability. Automatica 50(3):707–718. [11] Battistelli G, Chisci L, Morrocchi S, Papi F (2011) An information-theoretic approach to distributed state estimation. IFAC Proceedings Volumes 44(1):12477–12482. [12] Bickel PJ, Doksum KA (2015) Mathematical Statistics: Basic Ideas and Selected Topics, volume I (CRC Press). [13] Bikhchandani S, Hirshleifer D, Welch I (1998) Learning from the behavior of others: Conformity, fads, and informational cascades. The Journal of Economic Perspectives 12(3):pp. 151–170, ISSN 08953309. [14] Blume LE (1993) The statistical mechanics of strategic interaction. Games and Economic Behavior 5(3):387–424. [15] Borkar V, Varaiya P (1982) Asymptotic agreement in distributed estimation. IEEE Transactions on Automatic Control 27(3):650–655. [16] Brightwell GR, Winkler P (1999) Graph homomorphisms and phase transitions. Journal of Combinatorial Theory, Series B 77(2):221–262. [17] Brocas I, Carrillo JD (2014) Dual-process theories of decision-making: A selective survey. Journal of economic psychology 41:45–54. [18] Chamley CP (2004) Rational Herds: Economic Models of Social Learning (Cambridge University Press). [19] Chandrasekhar AG, Larreguy H, Xandri JP (2015) Testing models of social learning on networks: Evidence from a lab experiment in the field. Technical report, National Bureau of Economic Research. [20] DeGroot MH (1974) Reaching a consensus. Journal of American Statistical Association 69:118 – 121. [21] DeMarzo PM, Vayanos D, Zwiebel J (2003) Persuasion bias, social influence, and unidimensional opinions. The Quarterly Journal of Economics 118:909–968. [22] Diaconis P, Ylvisaker D (1979) Conjugate priors for exponential families. The Annals of statistics 7(2):269–281. [23] Eliaz K, Ray D, Razin R (2006) Choice shifts in groups: A decision-theoretic basis. The American economic review 1321–1332. [24] Evans JSB (2003) In two minds: dual-process accounts of reasoning. Trends in cognitive sciences 7(10):454–459. [25] Evans JSB, Stanovich KE (2013) Dual-process theories of higher cognition advancing the debate. Perspectives on psychological science 8(3):223–241. [26] Eyster E, Rabin M (2010) Naive herding in rich-information settings. American economic journal: microeconomics 2(4):221–243. [27] Eyster E, Rabin M (2014) Extensive imitation is irrational and harmful. The Quarterly Journal of Economics qju021. [28] Farina L, Rinaldi S (2011) Positive linear systems: theory and applications, volume 50 (John Wiley & Sons). [29] French Jr JR (1956) A formal theory of social power. Psychological review 63(3):181–194. [30] Friedkin NE (1986) A formal theory of social power. Journal of Mathematical Sociology 12(2):103–126. [31] Fudenberg D (1998) The Theory of Learning in Games (MIT Press). [32] Gale D, Kariv S (2003) Bayesian learning in social networks. Games and Economic Behavior 45:329– 346. [33] Gelman A, Carlin JB, Stern HS, Dunson DB, Vehtari A, Rubin DB (2014) Bayesian data analysis. Texts in Statistical Science Series (CRC Press, Boca Raton, FL), third edition. 24 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions [34] Gigerenzer G, Gaissmaier W (2011) Heuristic decision making. Annual review of psychology 62:451– 482. [35] Gigerenzer G, Goldstein DG (1996) Reasoning the fast and frugal way: models of bounded rationality. Psychological review 103(4):650. [36] Gigerenzer G, Todd PM (1999) Simple heuristics that make us smart (Oxford University Press, USA). [37] Gilardoni GL, Clayton MK (1993) On reaching a consensus using DeGroot’s iterative pooling. The Annals of Statistics 391–401. [38] Golub B, Jackson MO (2010) Naı̈ve Learning in Social Networks and the Wisdom of Crowds. American Economic Journal: Microeconomics 2(1):112–149. [39] Goyal S (2012) Connections: an introduction to the economics of networks (Princeton University Press). [40] Grimm V, Mengel F (2014) An experiment on belief formation in networks. Available at SSRN 2361007 . [41] Harary F (1959) A criterion for unanimity in french’s theory of social power. Studies in Social Power, 168–182 (University of Michigan), d. Cartwright, Ed. [42] Harel M, Mossel E, Strack P, Tamuz O (2014) When more information reduces the speed of learning ArXiv preprint arXiv:1412.7172. [43] Hegselmann R, Krause U (2005) Opinion dynamics driven by various ways of averaging. Computational Economics 25(4):381–405. [44] Isenberg DJ (1986) Group polarization: a critical review and meta-analysis. Journal of personality and social psychology 50(6):1141. [45] Jackson MO (2008) Social and Economic Networks (Princeton, NJ: Princeton University Press). [46] Jadbabaie A, Lin J, Morse AS (2003) Coordination of groups of mobile autonomous agents using nearest neighbor rules. IEEE Transactions on Automatic Control 48(6):988–1001. [47] Jadbabaie A, Molavi P, Sandroni A, Tahbaz-Salehi A (2012) Non-bayesian social learning. Games and Economic Behavior 76(1):210 – 225. [48] Jadbabaie A, Molavi P, Tahbaz-Salehi A (2013) Information heterogeneity and the speed of learning in social networks. Revise and Resubmit, Review of Economic Studies . [49] James G, Rumchev V (2005) Stability of positive linear discrete-time systems. Bulletin of the Polish Academy of Sciences. Technical Sciences 53(1):1–8. [50] Janis IL (1982) Groupthink: Psychological studies of policy decisions and fiascoes (Houghton Mifflin Boston). [51] Kahneman D (2003) Maps of bounded rationality: Psychology for behavioral economics. The American economic review 93(5):1449–1475. [52] Kahneman D (2011) Thinking, fast and slow (Farrar Straus Giroux). [53] Kanoria Y, Tamuz O (2013) Tractable bayesian social learning on trees. Selected Areas in Communications, IEEE Journal on 31(4):756–765. [54] Kar S, Moura JM (2009) Distributed consensus algorithms in sensor networks with imperfect communication: Link failures and channel noise. IEEE Transactions on Signal Processing 57(1):355–369. [55] Kass RE, Wasserman L (1996) The selection of prior distributions by formal rules. Journal of the American Statistical Association 91(435):1343–1370. [56] Katragadda S, SanMiguel JC, Cavallaro A (2014) Consensus protocols for distributed tracking in wireless camera networks. 17th International Conference on Information Fusion (FUSION), 1–8 (IEEE). [57] Klein G (2007) Performing a project premortem. Harvard Business Review 85(9):18–19. [58] Krishnamurthy V, Poor HV (2013) Social learning and bayesian games in multiagent signal processing: How do local and global decision makers interact? IEEE Signal Processing Magazine, 30(3):43–57. [59] Lalitha A, Sarwate A, Javidi T (2014) Social learning and distributed hypothesis testing. IEEE International Symposium on Information Theory 551–555. Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions 25 [60] Levy G, Razin R (2015) Correlation neglect, voting behavior, and information aggregation. The American Economic Review 105(4):1634–1645. [61] Lyons R, Peres Y (2016) Probability on Trees and Networks (Cambridge Series in Statistical and Probabilistic Mathematics). [62] Marden JR, Shamma JS (2012) Revisiting log-linear learning: Asynchrony, completeness and payoffbased implementation. Games and Economic Behavior 75(2):788–808. [63] Masicampo EJ, Baumeister RF (2008) Toward a physiology of dual-process reasoning and judgment: Lemonade, willpower, and expensive rule-based analysis. Psychological Science 19(3):255–260. [64] Mesbahi M, Egerstedt M (2010) Graph Theoretic Methods in Multiagent Networks (Princeton University Press). [65] Molavi P, Tahbaz-Salehi A, Jadbabaie A (2016) Foundations of non-bayesian social learning. Columbia Business School Research Paper . [66] Mossel E, Sly A, Tamuz O (2014) Asymptotic learning on bayesian social networks. Probability Theory and Related Fields 158(1-2):127–157, ISSN 0178-8051. [67] Mossel E, Tamuz O (2010) Efficient bayesian learning in social networks with gaussian estimators. arXiv preprint arXiv:1002.0747 . [68] Mueller-Frank M (2013) A general framework for rational learning in social networks. Theoretical Economics 8(1):1–40. [69] Mueller-Frank M, Neri C (2015) A general model of boundedly rational observational learning: Theory and experiment. Available at SSRN 2566210 . [70] Nedić A, Olshevsky A, Uribe C (2016) Distributed learning with infinitely many hypotheses. arXiv preprint arXiv:1605.02105 . [71] Nedić A, Olshevsky A, Uribe CA (2014) Nonasymptotic convergence rates for cooperative learning over time-varying directed graphs. arXiv preprint arXiv:1410.1977 . [72] Nedić A, Olshevsky A, Uribe CA (2015) Fast convergence rates for distributed non-bayesian learning. arXiv preprint arXiv:1508.05161 . [73] Rahimian MA, Jadbabaie A (2015) Learning without recall: A case for log-linear learning. 5th IFAC Workshop on Distributed Estimation and Control in Networked Systems . [74] Rahimian MA, Jadbabaie A (2015) Learning without recall in directed circles and rooted trees. American Control Conference 4222–4227. [75] Rahimian MA, Jadbabaie A (2016) Bayesian learning without recall Preprint. [76] Rahimian MA, Jadbabaie A (2016) Naive social learning in ising networks. American Control Conference . [77] Rahimian MA, Molavi P, Jadbabaie A (2014) (Non-) bayesian learning without recall. IEEE Conference on Decision and Control (CDC) 5730–5735. [78] Rahimian MA, Shahrampour S, Jadbabaie A (2015) Learning without recall by random walks on directed graphs. IEEE Conference on Decision and Control (CDC) . [79] Rahnama Rad K, Tahbaz-Salehi A (2010) Distributed parameter estimation in networks. 49th IEEE Conference on Decision and Control (CDC) 5050–5055. [80] Redish AD (2013) The mind within the brain: How we make decisions and how those decisions go wrong (Oxford University Press). [81] Robert C (2001) The Bayesian Choice: From Decision-Theoretic Foundations to Computational Implementation. Springer Texts in Statistics (Springer). [82] Rogers EM (2003) Diffusion of Innovations (Simon and Schuster), 5th edition. [83] Roux N, Sobel J (2015) Group polarization in a model of information aggregation. American Economic Journal: Microeconomics 7(4):202–32. [84] Rufo MJ, Martin J, Pérez CJ, et al. (2012) Log-linear pool to combine prior distributions: A suggestion for a calibration-based approach. Bayesian Analysis 7(2):411–438. 26 Rahimian and Jadbabaie: Bayesian Heuristics for Group Decisions [85] Seneta E (2006) Non-negative matrices and Markov chains (Springer). [86] Shahrampour S, Jadbabaie A (2013) Exponentially fast parameter estimation in networks using distributed dual averaging. 52nd IEEE Conference on Decision and Control (CDC) 6196–6201. [87] Simon HA (1955) A behavioral model of rational choice. The Quarterly Journal of Economics 99–118. [88] Simon HA (1956) Rational choice and the structure of the environment. Psychological review 63(2):129. [89] Simon HA (1979) Rational decision making in business organizations. The American economic review 69(4):493–513. [90] Sobel J (2014) On the relationship between individual and group decisions. Theoretical Economics 9(1):163–185. [91] Stoner JA (1968) Risky and cautious shifts in group decisions: The influence of widely held values. Journal of Experimental Social Psychology 4(4):442–459. [92] Sunstein CR (2000) Deliberative trouble? why groups go to extremes. The Yale Law Journal 110(1):71– 119. [93] Thaler RH (2015) Misbehaving: The making of behavioral economics (WW Norton & Company). [94] Tsitsiklis J, Bertsekas D, Athans M (1986) Distributed asynchronous deterministic and stochastic gradient optimization algorithms. IEEE Transactions on Automatic Control 31(9):803–812. [95] Tsitsiklis JN, Athans M (1984) Convergence and asymptotic agreement in distributed decision problems. Automatic Control, IEEE Transactions on 29(1):42–50. [96] Tversky A, Kahneman D (1975) Judgment under uncertainty: Heuristics and biases. Utility, probability, and human decision making, 141–162 (Springer). [97] Wang Y, Djuric PM (2015) Social learning with bayesian agents and random decision making. IEEE Transactions on Signal Processing 63(12):3241–3250. [98] Xiao L, Boyd S, Lall S (2005) A scheme for robust distributed sensor fusion based on average consensus. Fourth International Symposium on Information Processing in Sensor Networks (IPSN), 63–70. [99] Xiao L, Boyd S, Lall S (2006) A space-time diffusion scheme for peer-to-peer least-squares estimation. Proceedings of the 5th international conference on Information Processing in Sensor Networks, 168–176. [100] Zellner A (1988) Optimal information processing and bayes’s theorem. The American Statistician 42(4):278–280.
3cs.SY
Wavelet Based Load Models from AMI Data Shiyin Zhong, Student Member IEEE, Robert Broadwater Senior Member, IEEE, Steve Steffel, Senior Member. I. INTRODUCTION Power flow analysis, as well as many other power system analysis applications, can benefit from load data collected from Advanced Metering Infrastructure (AMI). Planning, forecasting, automated customer type identification and classification, real-time analysis, and even real-time control can benefit from information derived from AMI load data. Some previous efforts in using customer load measurements in power system analysis have used load research statistics to generate 8760 hourly statistical load models for classes of customers [1]. The AMI implementation gives a utility the ability to collect each individual customer’s detailed load profile. With such detailed load data the accuracy of load models can be improved [2]. A utility normally collects load data from each customer through AMI every 15 to 60 minutes. Thus, each customer can have 8,760 to 35,040 rows of load data annually. For a small circuit with 100 customers, an annual AMI load data table in a database can contain from 876,000 hourly load data rows to 3,540,000 million rows. The work here focuses on deriving load models that can be placed into computer memory and used in power flow time-series analysis in large scale models. The sheer size of the AMI load data sets makes the direct AMI data integration somewhat impractical for large scale systems. For example, using double precision numbers a utility with 1 million customers would require 1,000,000 × 8 bytes × 1 8,760 hours/year ≈ 65G bytes of RAM to store the annual hourly AMI load data in memory. The development of wavelet transformations began with Alfréd Haar’s work in the early 20th century [3]. The wavelet related research accelerated after the ground breaking works from Ingrid Daubechies [3] and Stéphane Mallat [4] in the 1980s. There are many applications of wavelets, including digital signal processing and image processing [5]. Two wavelet based load models are used in this paper. The first load model is the multi-resolution wavelet load model, which will often be referred to here as the wavelet load model. It uses the Discrete Wavelet Transformation (DWT) [4] to transform the original load profile from the time domain to the wavelet domain. With the multiresolution wavelet load model each individual customer’s AMI data is compressed, and load models are maintained for each individual customer. The second load model considered here is the classified wavelet load model. With the classified wavelet model a single load model is used for many customers that exhibit similar load behavior. With wavelet based load models, the determination of which class a given customer should be assigned to can be automated. Conventionally the classification of a load profile is based on either the load profile’s time domain [6] or frequency domain descriptors [7]. Time domain parameters used to describe load profile characteristics include Base Load, Peak Load, Rise Time, Fall Time, and High-Load Duration. After a set of variables is established to describe load profiles, various models, such as linear discriminant analysis, nearest neighbor classification, k-means, fuzzystatistics, neural networks, and support vector machines are used to classify load profiles [8-14]. A major challenge in classifying load profiles is that individual customer’ AMI load data may contain extreme data changes, such as the load rapidly going to zero. Sample Load Profile 350 300 250 200 kW Abstract—A major challenge of using AMI data in power system analysis is the large size of the data sets. For rapid analysis that addresses historical behavior of systems consisting of a few hundred feeders, all of the AMI load data can be loaded into memory and used in a power flow analysis. However, if a system contains thousands of feeders then the handling of the AMI data in the analysis becomes more challenging. The work here seeks to demonstrate that the information contained in large AMI data sets can be compressed into accurate load models using wavelets. Two types of wavelet based load models are considered, the multi-resolution wavelet load model for each individual customer and the classified wavelet load model for customers that share similar load patterns. The multi-resolution wavelet load model compresses the data, and the classified wavelet load model further compresses the data. The method of grouping customers into classes using the wavelet based classification technique is illustrated. Index Terms—Automated Meter Infrastructure, Wavelet, Clustering, Load classification 150 100 50 0 0 500 1000 1500 2000 2500 3000 3500 4000 Hour Index Figure 1: Sample AMI Load Profile Data 4500 5000 II. DISCRETE WAVELET TRANSFORMATION In the DWT process, a time-domain discrete signal S (n) can be decomposed into a set of Approximation Coefficients A j0 ,k (equation 1) and Detail Coefficients D j ,k (equation 2) with a predetermined discrete scaling A. Multi-Resolution DWT Mallat introduced an efficient multi-resolution DWT/Inverse DWT (IDWT) algorithm in 1989 [4] which made the DWT/IDWT implementation practical by taking advantage of the family of orthogonal, compact support wavelets introduced by Daubechies [3]. Mallat’s pyramid DWT/IDWT algorithm uses a set of discrete Quadrature Mirror Filters (QMF) ( h , h , h , h ) to decompose or reconstruct a discrete signal. The coefficients of this set of filters are pre-determined. The simplest Daubechies (DB) wavelet filters, DB1 (Haar wavelet), is used in the AMI load data DWT here. The DB1 scale and wavelet discrete filter coefficients are shown in Wavelet h   1 2 ,1 h  1 2 , 1 h  1 h  1 Scale Sometimes these extreme changes are errors, but not always. Figure 1 illustrates representative AMI hourly load samples for a commercial customer. The aforementioned classification methods, where relatively small variable sets are employed, have trouble in accurately capturing the pattern characteristics of Figure 1. In order to better visualize the load profiles’ pattern characteristics, a 2 dimensional, or 2D, wavelet load profile representation is introduced in this paper. It will be illustrated that the significant load patterns in an individual customer’s AMI load data can be modeled by the wavelet components from the load profile’s lower 2D DWT transformation. Furthermore, the 2D DWT transformation can be used in an unsupervised clustering process to identify load classes. The classified wavelet load models are derived from the load classes identified by the 2D DWT based clustering algorithm. In Section II both 1D and 2D multi-resolution wavelet decompositions are discussed. In Section III the procedure of compressing AMI load data using 1D multi-resolution wavelet decomposition coefficients is introduced. After that, the k-mean clustering algorithm using 2D wavelet decomposition coefficients is presented. In Section IV three sets of analysis results for a real-world circuit are compared. The comparisons utilize time series power flow analysis where the base case runs over the original AMI load measurements, and the other cases use the wavelet load model and the classified wavelet load model, respectively. Conclusions are presented in Section V. 2  2  2 ,1 2  2 ,1 2  Table 1: DB1 QMF Coefficients table 1. In the work that follows S[n] will represent the AMI data set for a single customer. Figure 2 illustrates a 3-level DWT process. The discrete signal S[n] convolutes with the low band-pass filter h (covers 0 to f n 2 frequency band as in figure 3) which generates n number of values. Half of this set of numbers is redundant. Therefore, it can be downsampled by 2 to obtain the Approximation Coefficients A j . function  j ,k (n) (equation 3) and wavelet function The down-sampling (decimation) process involves removing every other coefficient from the A j approximation  j ,k (n) (equation 4). The S (n) can be reconstructed using coefficients. its A j0 ,k and D j ,k in the inverse DWT (IDWT) process (equation 5). ↓ D1 ↓ D2 ↓ D3 ↓ A1 ↓ A2 ↓ A3 S[n] A j0 ,k  M  2 j  S (n) j0 ,k (n) 1 (1) n D j ,k  M  2 j  S (n) j ,k (n) 1 Figure 2: Multi-resolution DWT (2) n  j ,k (n)  2 Level 3  (2 j n  k ) (3)  j ,k (n)  2 j 2 (2 j n  k ) (4) S ( n)  M j 2  12 j   A j , k  j , k ( n)    D j , k  j , k ( n) 0 k 0 (5) A3 0 D3 Level 2 Level 1 D2 D1 fn/8 fn/4 fn/2 fn Frequency N/8 N/4 N/2 N Length Figure 3: Multi-resolution DWT Frequency Bands j 0 k S[n] also convolutes with the high band-pass filter h where n=0,1,...,M-1 and M=2J decomposing level j  1,..., J  1, j0  0 (covers f n 2 to f n frequency band) and is then down- coefficient index k  0,1,..., 2 j 1  j0 ,k (n),  j ,k ( n) are the scale and wavelet function approximation coefficients A j are then passed to the next 2 sampled by 2 to calculate the Detail Coefficients D j . The level to repeat the same transformation process to generate the j+1 level A j and D j as specified in equations 6 and 7. N  h [k] A j [2n  k ] D j 1[n]  process.  h [k] A j [2n  k ] S AJ [n]  (7) k 0 where N is the length of Finite Impulse Response Filters h , h Figure 4 illustrates a 3-level IDWT process which reverses the DWT process to reconstruct the S[n] using A j and D j . D3 ↑ D2 ↑ D1 ↑ A3 ↑ A2 ↑ A1 ↑ + sampled coefficients convolute with the mirror discrete filters h and h respectively. The two convolution products are added together to generate coefficients A j 1 at level j-1 as in equation 8. These steps are repeated until the S(n) is fully reconstructed. N k 0 k 0 (9) k 0 N A j 1[n]   h [k ] A j [2n  k ] (10) k 0 where N is the numboer of coefficients in h j  [2, J ] where J is the largest decomposition level. S[n] During the IDWT process, the coefficients A j and D j at level j are up-sampled by 2 and the up- N N  h [k ] A1[2n  k ] This process is illustrated in figure 6 which shows that detail coefficients are eliminated from the simplified IDWT. These synthesized load profiles cover the lower frequency sub-band of the original AMI load profile. Figure 4: Multi-Resolution IDWT A j 1[n]  using only the approximation coefficients A j at level j. The D j coefficients are not included in the synthesizing (6) k 0 N A j 1[n]  profiles S Aj (n) , which are reconstructed (equation 9-10) by A3 The DWT/IDWT algorithm described by equations (68) has a linear computational complexity O(n) that needs n operations to decompose a discrete load profile (n number of measurements) into the wavelet domain. Figure 5 presents a 3 level wavelet representation for a sample AMI load profile (with 5,208 measurements). The plots in the left column are the synthesized load A2 ↑ A1 ↑ SA3[n] Figure 6: Synthesized load profile S A 3 [ n] The second column plots are the synthesized S D j (n) , which is reconstructed (figure 7) with only the detail coefficient D j at level j. The A j coefficients are not included in the synthesized process. These synthesized load profiles represent the higher frequency information in the original AMI load profile  h [k ] A j [2n  k ]   h [k ]D j [2n  k ] (8) where N is the numboer of coefficients in h , h ↑ D3 ↑ A2 ↑ A1 ↑ Figure 7: Synthesized load profile S D 3 SD3[n] [ n] The synthesized level j approximation load profile S Aj [n] needs twice as many coefficients as the level j+1 synthesized load profile S Aj1 [n] . In figure 5, the S A1 [n] load profile is modeled by 5,208 / 21 = 2,604 coefficients, the S A2 [n] load profile is modeled by 5,208 / 22 = 1,302 coefficients, and the S A3 [n] load profile is modeled by 5,208 / 23 = 651 coefficients, which is 1/8 the size of the original load profile (figure 1). From visual inspection the level 3 synthesized load profile S A3 [n] is very similar to the original load profile presented in figure 1. In section 4 it will be illustrated that the majority of the energy content of the signal can be captured by S A3 [n] . Wavelet coefficients can be used in frequency-time localization analysis, such as the detection of large sudden changes in a load profile. In figure 8 a sample load profile and its 2 level DWT detail coefficients are presented. There are two sudden and significant load drops in the load profile: the first one takes place from the 51st to the 52nd hour, and the second one occurs at the 73rd hour. The 73rd Figure 5: Three Level DWT using Haar wavelet 3 vertical Wv ( j ) and the diagonal coefficients Wd ( j ) . Load Profile kW 300 The reconstruction process reverses the decomposition process which reconstructs the data by performing the IDWT along the row direction, followed by performing the IDWT along the column direction. 200 100 0 0 10 20 30 40 50 60 70 80 90 100 D2 100 III. 0 -100 0 10 20 30 40 50 60 70 80 90 100 60 70 80 90 100 D1 0 -50 -100 0 10 20 30 40 50 Hour Figure 8: Load Profile Detail Coefficient from 2-Level DWT hour drop has a higher frequency since its period is shorter. Once the load profile is transformed into the wavelet domain with 2-levels of resolution, the two load drops can be detected by analyzing the two detail coefficients sets (D1 and D2 plot in figure 8). The D1 coefficient from the level 1 DWT covers the higher half of the frequency band ( f n 2 to f n ). The higher frequency 73rd hour load drop can be observed when the D1 magnitudes suddenly drop below 100 at the 74th hour. The lower frequency 51st to 52nd hour load drop can be detected by analyzing the D2 coefficients, which covers the f n 4 to f n 2 frequency band. In this case the D2 coefficient spikes to over 100 at the 51st hour when the load drop occurs. In this example the approximation coefficients are left out because the sudden load changes are high frequency signals that should not be visible in the lower frequency band where the approximation coefficients reside. B. 2D Wavelet Transformation The 2D wavelet decomposition process is similar to the 1D DWT decomposition as the signal goes through a series of discrete wavelet filters h , h . The 2D discrete wavelet decomposition first decomposes the signal in columns, followed by a decomposition into rows, as illustrated in Figure 9. At each level, the 2D wavelet transformation will generate one approximation coefficient W ( j ) and three h different detail coefficient sets: the horizontal W ( j) , the LOAD DATA MODELING The real-world circuit used in this paper serves 323 customers whose hourly AMI load measurements were recorded from May 2013 to Dec 2013. These customers represent a diverse group of load patterns. For example, there are customers with the double-peak residential load type, businesses with the typical 9am to 5pm commercial load type, loads with on-off type behavior (similar to street light load patterns), and others. Identifying the various load patterns for the circuit will be considered shortly. In the analysis AMI measurements from 2013-05-27 00:00 to 2013-12-29 23:00 are used, representing a 31 week time window. Each customer had 5208 hourly kWHr measurements, for a total of 1,682,184 rows of AMI measurements for the 323 customers served by the circuit. A. Multi-resolution Wavelet Load Model For time-series analysis involving AMI data, SCADA data, and others, it is desirable to load the data into computer memory for the most rapid analysis. However, for models consisting of thousands of circuits with similar AMI coverage it is not be practical to load all of the AMI data directly into computer memory. The goal of a compressed AMI load data model is to construct a load model that accurately approximates the original load profile’s energy and significant pattern characteristics with a much smaller data set. Typical load profile patterns tend to be relatively slow changing, indicating that most of the load energy is located in the lower frequency band, which can be represented by the approximation coefficients Aj introduced earlier. The sudden, abnormal changes in a load profile have much higher frequencies which are modeled by the Dj detail coefficients. The high frequency behavior modeled by the detail coefficients generally represents a small portion of the load profile’s energy. From figure 3 it may be noted that the S D j (n) load profiles have much smaller magnitudes than the corresponding S Aj (n) load profiles. In this paper the S A3 (n) load profile is used as the load model. This model has a coefficient set that is 1/8 of the original AMI data size. The model retains most of the energy residing in the original load profile and captures much of the original load profile’s characteristics. However, it should be noted that it is possible to model the AMI load data at either higher (more coefficients) or lower (less coefficients) resolutions in the wavelet domain. But in this paper characteristics of using S A3 (n) will be Figure 9: 2D DWT 4 investigated. In order to evaluate the performance of the S A3 (n) load N SE    S Ai (n)2  n 1 N   S (n)2  100% n 1 (11)  Table 2 summarizes the values of SE for all 323 load profiles synthesized from S A3 (n) . In the worst case, three S A3 (n) synthesized load profiles captures less than 80% of the total energy of their original load profiles. Seventeen of the synthesized load profiles have a total energy that falls between 80 to 90% of the total energy of the original load profiles. The majority of the synthesized load profiles capture 90% or more of the original AMI load data energy. Number of S A 3 (n) Load Profiles No. of Measurments model, three parameters are used which are: the synthesized load profile’s total energy content compared to the energy content of the original AMI data; the distribution of the absolute value of the hourly error between the synthesized load profile and the original AMI load data; and the percentage error between the synthesized load profile and the original AMI load data. First, the variable SE defined in equation 11 is used to evaluate the synthesized load profile’s total energy as a percentage of the original load profile’s total energy. A 3 vs Original Load Profile Residual Histogram & Distribution 1500 1000 500 0 -100 -50 0 50 100 150 Residual kW Residual Distribution Mean -2.12e-13 Residual Distribution Variance 14.51 Figure 10: Error of Synthesized Load Profile The third parameter used to evaluate the performance of the S A3 (n) load model is the hourly percentage error, PE(n), defined as PE (n)  S A3 (n)  S (n) S ( n) 100% (13) Figure 11 presents the histogram for PE(n). The result shows that 74% of the S A3 (n) hourly loads are within 10% of the original AMI load measurements. SE 3 load profiles (0.93%) 17 load profiles (5.26%) 303 load profiles (93.81%) Less than 80.000% 80.000% to 90.000% 90.000% to 99.998% Table 2: Percentage of total energy modeled by load profiles synthesized from S A (n) 3 AMI load data contains sharp load changes that are similar to the spikes previously discussed for figure 8, and the energy contained in these spikes is modeled with the detail coefficients and not the approximation coefficients of S A3 (n) . The energy contained in these spikes is neglected when just S A3 (n) is used to synthesize the load profile. Thus, the energy errors shown in Table 2 are an indication of the variability of the loads, where three of the loads (i.e., those with an energy match less than 80%) have a much higher variability than the other 320 loads. The second parameter used to evaluate the performance of the S A3 (n) load model is the hourly error, E(n), which is defined as the difference between the synthesized load profile value and the original load profile value at each time point n, as given by E (n)  S A3 (n)  S (n) (12) Figure 10 presents a histogram for E(n). A normal curve fit to the E(n) distribution is shown as a red line in Figure 10. From Figure 10, it may be seen that the distribution of E(n) is approximately normal with a mean that is centered close to zero and a small variance. This indicates that the error between the wavelet based load model and the original load data is small and predictable. 5 Figure 11: Histogram of Percentage Synthesized S A3 (n) Hourly Load Model Data with Percentage Error Less Than Given x-axis Value B. Classified Wavelet Load Model With the classified wavelet load model individual customer load profiles are placed into groups, where the customers in each group have similar load patterns. The coefficients from each customer’s 2D DWT are used to classify customers into groups. In performing the grouping each of the 323 load profiles are normalized by its annual peak and converted into a matrix. In the matrix each row represents a week of hourly load measurements, from Monday at the 00 hour to Sunday at the 23rd hour. Thus, for the original AMI load data each row has 168 hourly readings. With 31 weeks of AMI data, the hourly AMI load profile is represented as a matrix with 31 columns and 168 rows. A similar matrix is built for the S A3 (n) synthesized load model. The matrix representation of the load data can be visualized as a set of color images as illustrated in figure normalized load Load Profile 1 1 2D Load Profile A3 Load Profile V3 V 4 0.5 0.9 0 0 2000 4000 6000 normalized load hour Load Profile 0.8 1 2D Load Profile A Load Profile V 3 V4 3 0.5 0 0.7 0 2000 4000 6000 normalized load normalized load normalized load hour Load Profile 0.6 1 2D Load Profile A3 Load Profile V3 V4 0.5 0 0.5 0 2000 4000 hour Load Profile 6000 0.4 1 2D Load Profile A3 Load Profile V3 V 4 0.3 0.5 0 0 2000 4000 hour Load Profile 6000 0.2 1 2D Load Profile A Load Profile V 3 V4 3 0.1 0.5 0 0 2000 4000 6000 0 hour Figure 12: Normalized load data color pattern visualizations where color map is shown on far right: First column is original AMI load data; Second column is color map visualization of original AMI data; Third column is color map visualization of synthesized S A (n) load model; Fourth and Fifth 3 columns are color maps of Vertical Coefficients of the 2D DWT at levels 3 and 4, respectively 12. All visual images share the color map shown on the right of figure 12. The plots in the first column of figure 8 represent the original normalized AMI load profiles. The second column in figure 12 presents a color map of the original AMI load data. The third column shows a color map for the S A3 (n) synthesized load model, which is a lower resolution of the second column’s image. The fourth and fifth columns provide a visualization of the Vertical Coefficients of the 2D DWT at levels 3 and 4, respectively. Some research proposes using Rise Time and Fall Time [2] to describe load patterns in the time domain. These sudden change in load profiles can be visually detected in the color maps of Figure 12 and also can be detected using the 2D DWT coefficients. The fourth row in figure 12 illustrates a relatively consistent load profile without significant hourly load variations. Its level 3 vertical coefficient, V3, shows a very consistent pattern without significant color variation. The other four load profiles in figure 7 all show daily patterns. The daily pattern differences in load profiles may be detected by using the vertical coefficients shown in columns 4 and 5 of figure 12. The level 4 vertical coefficients, V4, can be viewed as a “zoom-out” of V3, providing a lower resolution, but still capturing the significant patterns of the original load profile. Instead of using 5,208 hourly load data measurements to classify customers, the more compact form of the DWT load pattern representations are used in the classification process. The size of the V3 matrix size is 4 by 21 and the size of the V4 matrix is 2 by 11. A K-mean clustering algorithm [17] is used in the classification. The K-mean algorithm groups individual customer load profiles into one of k load classes, where the number of desired load class k is an input to the algorithm. The algorithm minimizes the mean of the Euclidean distance DVi ,Ck between the load profile Vertical 6 Coefficients Vi and the load class centroid Ck (equation 14) for each class, as indicated by N  (Vi,n  Ck ,n )2 DVi ,Ck  (14) n 1 . where i is the load profile index k is the load class index n is the data index The class k’s average hourly load profile, represented by TLPk (t ) , can be calculated from the load profiles of the class using equation 15: N  Sk ,i (t ) TLPk (t )  N (15) where k is the load class index, i is the index for a load profile in load class k. The proposed method can reconstruct a load profile  Sk ,i (t ) to replace AMI data using equation 16: n 0 Sk ,i (t )  TLPk (t )  Pk ,i M k ,i Pk ,i  max Sk ,i (t ) t[0,T ] (16) (17) T .M k ,i   TLPk (t )  Pk ,i t 0 T (18)  Sk ,i (t ) t 0 where k is the load class index i is the load profile index in load class k T is the largest time point index The method combines the individual load profile’s annual peak load factor Pk ,i (equation 17), average load scale M k ,i (equation 18) and the TLPk (t ) (equation 15) of the class’s normalized load profile. This load model reduces the size of the original AMI load data even further as the model only stores two measurements, Pk ,i and M k ,i , for each customer and k classified wavelet load models, TLPk (t ) . For the example study presented here using the 323 customers, the k is set to 5. Table 3 shows the number of customers assigned to each of the 5 classified wavelet load models. Number of Customers 89 166 39 14 15 Table 3: Number of customers assigned to each classified wavelet load model class k For the classified wavelet load model, 234 (72% of 323) of the SE (equation 11) values are within 10% of the original AMI load total energy. The other 28% of the synthesized classified wavelet load profiles have 60% to 80% of the original load energy. Table 4 shows several ranges of the classified wavelet load model’s percentage error values, PE(n) (equation 12), and the percentage of classified wavelet load model data that is within each respective PE(n) range. PE(n) 10% Less 10% to 20% 20% to 30% over 30% % synthesized load profiles 22% 24% 43% 11% Table 4: Synthesized Load Profiles’ PE(n) As expected, the classified wavelet load model is not as accurate as the wavelet load model. The goal of this paper is to show that the AMI load profile’s coarse-resolution representation can be used in load profile classification. It should be noted that the example given here has not been optimized relative to the number of classes. IV. LOAD ESTIMATION WITH WAVELET BASED LOAD MODELS In this section the three different load models (i.e., original AMI data, wavelet load model, and classified wavelet load model) for the 323 customers are integrated with a model of a real world circuit. The model of the circuit used in the study is shown in figure 13, in which the red dots represent the customer load points. A time-series power flow analysis is performed for the 5028 hours from 5/27/2013 00:00 to 12/29/2013 13:00 for each of the three load models. The power flows at the startof-the-circuit for phases A, B, and C are recorded for each hour, and the results of the wavelet models are compared with the results from the original AMI data. Figure 13: Load Model Verification Circuit The wavelet load model stores 651 level 3 approximation coefficients for each of the 323 customers. The classified wavelet load model stores 2 values for each customer plus 5 different hourly TLPs (each has 5,028 data points). Table 5 presents the data compression that is achieved by each wavelet-based load model. Wavelet Load Model Wavelet Classified Load Model No. of Wavelet Model Values No. of AMI Values % Compression 210,273 1,682,184 -87.50% 26,686 1,682,184 -98.41% Table 5: Data Compression Achieved by Wavelet Load Models Figure 14 shows a distribution of the hourly power flow percentage errors between the circuit with the wavelet load models and the circuit with the original AMI load data. From the figure it may be seen that 71% of the hourly power flows calculated with the wavelet load model are within 10% of the results using the original AMI data model. It may also be seen that 80% of the hourly power flows calculated with the classified wavelet load model are within 10% of the results using the original AMI data. Thus, using the original AMI data as a reference, the classified load model is providing more accurate results here than the wavelet model, which requires more storage. Table 6 presents a comparison of circuit peak estimates obtained with each of the three load models. The original DWT Based Model vs. Orgininal AMI % Error Histogram 40% % of all Hourly Records k 1 2 3 4 5 35% 30% 25% 20% 15% 10% 5% 0% DWT Classified -30% -20% -10% 0% 10% 20% 30% 40% 50% 60% 0.0% 0.3% 8.5% 37.3% 33.7% 16.3% 3.6% 0.3% 0.0% 0.0% DWT Compressed 0.3% 7.5% 19.5% 25.4% 25.9% 6.7% 6.6% 4.4% 3.3% 0.4% Figure 14: Hourly Load Estimation % Error Histogram 7 AMI data indicates the peak load time occurred on 7/18/2013 at 5PM for phases A and C phase, and on 7/18/2013 at 4PM for phase B. Both wavelet-based load model estimate the peak load occurred on 7/18/2013 at 5PM for all phases. Thus, there is a 1 hour difference in the phase B peak estimate. The peak load estimations from wavelet-base load models are within 12% of the peak estimate with the original AMI load data. Note that the wavelet load model provides a conservative estimate of the peak for all phases, whereas the classified wavelet load model underestimates the peak for all phases. AMI Peak Peak Wavelet Load (kW) Time Model Peak (kW) A 878.20 7/18 5 PM 968.71 B 1132.82 7/18 4 PM 1262.76 C 569.73 7/18 5 PM 629.88 Classified Wavelet AMI Peak Phase Load Model Peak (kW) (kW) A 878.20 7/18 5 PM 868.75 B 1132.82 7/18 4 PM 1010.68 C 569.73 7/18 5 PM 552.38 Phase Peak Time 7/18 5 PM 7/18 5 PM 7/18 5 PM Error % 10.3% 11.5% 10.6% 7/18 5 PM 7/18 5 PM 7/18 5 PM -1.1% -10.8% -3.0% Table 6: System Peak Load Estimation Table 7 shows that the total load estimates over the 5208 hours from the wavelet-based load models are within 1% of the estimates using the original AMI data. Phas e AMI (kWH) Wavelet Load Model (kWH) % Error A 2013192.71 2011098.14 -0.10% B 2321937.76 2321775.12 -0.01% C 1306861.05 1306961.94 Classified Wavelet Load Model 0.01% A 2013192.71 2007990.47 -0.26% B 2321937.76 2322710.13 0.03% C 1306861.05 1304125.65 -0.21% DWT detail coefficients. When the wavelet or classified wavelet load models are used, the large rapid load changes are filtered out. A matrix derived from a 2-dimensional DWT has been used to model individual load profiles. The vertical coefficients of the matrix can be used to detect periodic load patterns, such as daily or weekly patterns, and thus to classify customer load profiles into groups that have similar load behavior. This provides a new approach to classifying customers into groups that display similar load behavior. Using the Typical Load Profile model of the class along with an individual customer’s peak and average load measurements, a synthesized load profile can be reconstructed for each customer. Wavelet-based load models have the potential to be a standard way to process and store AMI load data to be used in analysis. The wavelet load models investigated provide very accurate results, always within 0.26%, for system loss calculations. When estimating the peak, the wavelet models investigated are always within 11% of the AMI load data estimate, where the wavelet load model always provides a conservative estimate of the peak. Coupling the wavelet load models with actual SCADA measurements should overcome the peak estimate error and represents a next step in this investigation. REFERENCES 1. A. Sargent, R. P. Broadwater, J. Thompson, J. 2. Table 7: Comparison of Wavelet Based Model Load Estimates for 5208 Hours with Estimate Using Original AMI Data V. CONCLUSIONS A major challenge to using big AMI data in large scale system power flow analysis is the size of the data. This paper evaluates two wavelet-based load models that can reduce the size of the AMI load data by approximately 88% (wavelet load model) and 98% (classified wavelet load model), respectively. Individual customer load profiles can be synthesized by using lower resolution coefficients of the Discrete Wavelet Transformation. For the AMI loads considered here most of the energy is located in the lower frequency band, and with the DWT the energy of the lower frequency bands are captured by a set of approximation coefficients at level k, with a data size that is 2 k of the original data size. The wavelet load model for k = 3 is investigated in this paper. It has been shown that the wavelet representation of sudden/abnormal, sudden duration load changes can be detected in the higher frequency band modeled with the 8 3. 4. 5. 6. 7. 8. Nazarko, “Estimation of Diversity and KWHR-toPeak-KW Factors from Load Research Data,” IEEE Transactions on Power Systems, Vol. 9, No. 3, pp. 1450-1456, August 1994. Ahmet Onen, Jeremy Woyak, Reza Arghandeh, Jaesung Jung, Charlie Scirbona, Robert P. Broadwater, “Time-varying Cost of Loss Evaluation in Distribution Networks Using Market Marginal Price,” International Journal of Electrical Power and Energy Systems, June 2014, pp. 712-717 Ingrid Daubechies: Ten Lectures on Wavelets, SIAM 1992 Mallat, S.G. (1989b). A theory for multi-resolution signal decomposition: The wavelet representation. IEEE Trans. on Patt. Anal. Mach. Intell., 11(7): 674693. P. Price. Methods for analyzing electric load shape and its variability. volume LBNL-3713E, 2010 Shiyin Zhong; Tam, K., "A Frequency Domain Approach to Characterize and Analyze Load Profiles," Power Systems, IEEE Transactions on , vol.27, no.2, pp.857,865, May 2012 Espinoza, M., Joye, C.; Belmans, R.; Moor, B., “ShortTerm load forecasting, profile identification, and customer segmentation: a methodology based on periodic time series,” IEEE Trans. On Power Syst., Vol.20, No3, pp.1622-1630, Aug. 2005. Ramos, S.; Duarte, J.M.; Duarte, F.J.; Vale, Z.; Faria, P., "A data mining framework for electric load 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. profiling," Innovative Smart Grid Technologies Latin America (ISGT LA), 2013 IEEE PES Conference On , vol., no., pp.1,6, 15-17 April 2013 Kim, Y.; Kang, S.; Ko, J; Choi, S-H, "A study for clustering method to generate Typical Load Profiles for Smart Grid," Power Electronics and ECCE Asia (ICPE & ECCE), 2011 IEEE 8th International Conference on , vol., no., pp.1102,1109, May 30 2011-June 3 2011 Zhang, T.; Zhang, G.; Lu, J.; Feng, X.; Yang, W., "A New Index and Classification Approach for Load Pattern Analysis of Large Electricity Customers," Power Systems, IEEE Transactions on , vol.27, no.1, pp.153,160, Feb. 2012 Gerbec, D.; Gasperic, S.; Smon, I.; Gubina, F., "An approach to customers daily load profile determination," Power Engineering Society Summer Meeting, 2002 IEEE , vol.1, no., pp.587,591 vol.1, 2525 July 2002 Gavrilas, M.; Sfintes, V.C.; Filimon, M.N., "Identifying typical load profiles using neural-fuzzy models," Transmission and Distribution Conference and Exposition, 2001 IEEE/PES , vol.1, no., pp.421,426 vol.1, 2001 Gerbec, D.; Gasperic, S.; Gubina, F., "Determination and allocation of typical load profiles to the eligible consumers," Power Tech Conference Proceedings, 2003 IEEE Bologna , vol.1, no., pp.5 pp. Vol.1,, 23-26 June 2003 Roger J. Lewis, “An Introduction to Classification and Regression Tree (CART) Analysis”, Annual Meeting of the Society for Academic Emergency Medicine, 2000, San Francisco, California M. Nagabushanam, S. Ramachandran, P. Kumar, “FPGA Implementation of 1D and 2D DWT Architecture using Modified Lifting Scheme”, WSEAS TRANSACTIONS on SIGNAL PROCESSING, Issue 4, Volume 9, October 2013 M. Antonini, M. Barlaud, P. Mathieu, and I. Daubechies, “Imaging coding using vector quantization in the wavelet transform domain,” in Proc. 1990 IEEE International Conference on Acoustic, Speech, Signal Processing, Albuquerque, NM, Apr. 3-6, 1990, pp. 2297-2300 Lloyd, Stuart P. "Least Squares Quantization in PCM." IEEE Transactions on Information Theory. Vol. 28, 1982, pp. 129–137 “Short Term Electricity Load Forecasting on Varying Levels of Aggregation” Shiyin Zhong (M’08) received his B.S (2000) and MS (2003) degrees in computer engineering from Virginia Tech. His research interests include data mining, load forecasting and computer aided engineering. Robert Broadwater is currently a faculty member in Virginia Tech. He received Ph.D. in electrical engineering from the Virginia Tech. 9 Steve Steffel (P.E). He is the manager of the distributed energy resources planning and analytics department in Pepco Holdings, Inc. 10
5cs.CE
1 Temporal Attention augmented Bilinear Network for Financial Time-Series Data Analysis arXiv:1712.00975v1 [cs.CE] 4 Dec 2017 Dat Thanh Tran∗ , Alexandros Iosifidis‡ , Juho Kanniainen† and Moncef Gabbouj∗ ∗ Laboratory of Signal Processing, Tampere University of Technology, Tampere, Finland ‡ Department of Engineering, Electrical & Computer Engineering, Aarhus University, Aarhus, Denmark † Laboratory of Industrial and Information Management, Tampere University of Technology, Tampere, Finland Email:{dat.tranthanh,juho.kanniainen,moncef.gabbouj}@tut.fi, [email protected] Abstract—Financial time-series forecasting has long been a challenging problem because of the inherently noisy and stochastic nature of the market. In the High-Frequency Trading (HFT), forecasting for trading purposes is even a more challenging task since an automated inference system is required to be both accurate and fast. In this paper, we propose a neural network layer architecture that incorporates the idea of bilinear projection as well as an attention mechanism that enables the layer to detect and focus on crucial temporal information. The resulting network is highly interpretable, given its ability to highlight the importance and contribution of each temporal instance, thus allowing further analysis on the time instances of interest. Our experiments in a large-scale Limit Order Book (LOB) dataset show that a two-hidden-layer network utilizing our proposed layer outperforms by a large margin all existing state-of-the-art results coming from much deeper architectures while requiring far fewer computations. Index Terms—Feed-forward neural network, Bilinear projection, Temporal Attention, Financial data analysis, Time-series prediction I. I NTRODUCTION Time-series classification and prediction have been extensively studied in different domains. Representative examples include natural language processing [1], [2], [3], medical data analysis [4], [5], human action/behavior analysis [6], [7], [8], meteorology [9], finance and econometrics [10], [11], [12] and generic time-series classification [13], [14]. Due to the complex dynamics of financial markets, the observed data is highly non-stationary and noisy, representing a limited perspective of the underlying generating process. This makes financial time-series forecasting one of the most difficult tasks among time-series predictions [15]. The development of both software and hardware infrastructure has enabled the extensive collection of trade data, which is both an opportunity and a challenge for the traders, especially high-frequency traders. Apart from long-term investment, HFT is characterized by high speed and short-term investment horizon. The ability to efficiently process and analyze large chunks of data within relatively short time is thus critical in HFT. During the past decades, several mathematical models have been proposed to extract financial features from the noisy, nonstationary financial time-series. Stochastic features and market indicators [16], [17] have been widely studied in quantitative analysis. Notable works include autoregressive (AR) [18] and moving average (MA) [19] features, which were later combined as a general framework called autoregressive moving average (ARMA). Its generalization, also known as autoregressive integrated moving average (ARIMA) [20], [21] which incorporates the differencing step to eliminate nonstationarity, is among popular methods for time-series analysis in econometrics. To ensure tractability, these models are often formulated under many assumptions of the underlying data distribution, leading to poor generalization to future observations [22]. In recent years, the development of machine learning techniques, such as support vector regression [23], [12] and random forest [24], have been applied to timeseries forecasting problems to alleviate the dependence on such strong assumptions. As a result, these statistical machines often outperform the traditional ARIMA model in a variety of scenarios [25]. Although the aforementioned machine learning models perform reasonably well, they are not particularly designed to capture the temporal information within time-series data. A class of neural network architecture called Recurrent Neural Networks (RNN) is specifically designed to extract temporal information from raw sequential data. Although RNNs were developed more than two decades ago [26], they started to become popular in many different application domains [27], [1], [28] only recently thanks to the development in optimization techniques and computation hardware, as well as the availability of large-scale datasets. Special types of RNNs, such as Long Short Term Memory (LSTM) [29] and Gated Recurrent Unit (GRU) [30] networks, which were proposed to avoid the gradient vanishing problem in very deep RNN, have become the state-of-the-art in a variety of sequential data prediction problems [27], [1], [28], [31]. The beauty of deep neural networks lies in the fact that these architectures allow end-to-end training, which works directly on the raw data representations instead of hand-crafted features. As a result, suitable data-dependent features are automatically extracted, improving the performance and robustness of the whole system. While deep neural networks in general and LSTM networks, in particular, are biologically inspired and work well in practice, the learned structures are generally difficult to interpret. It has been long known that there exists a visual attention mechanism in human cortex [32], [33], [34] in which visual stimuli from multiple objects compete for neural representation. To further imitate the human learning system, 2 attention mechanisms were developed for several existing neural network architectures to determine the importance of different parts of the input during the learning process [35], [3], [36], [37]. This not only improves the performance of the network being applied to, but also contributes to the interpretation of the obtained result by focusing at the specific parts of the input. For example, in image captioning task [35], by incorporating visual attention into a convolutional LSTM architecture, the model explicitly exhibits the correspondence between the generated keywords and the visual subjects. Similar correspondences between the source phrases and the translated phrases are highlighted in attention-based neural machine translation models [3]. While visual and textual data are easy to interpret and intuitive to humans, generic time-series data is more difficult to perceive, making the LSTM models a black box. This hinders the opportunity for post-training analysis. Few attempts have been made to employ attention functionality in LSTM in different timeseries forecasting problems such as medial diagnosis [38] and weather forecast [39] or finance [40]. Although adding attention mechanism into recurrent architectures improves the performance and comprehensibility, it incurs high computational cost for the whole model. This impedes the practicality of the model in many financial forecasting situations in which the ability to rapidly train the system and make predictions with continuously large chunks of incoming data plays an important role. Multivariate time-series data is naturally represented as a second-order tensor. This representation retains the temporal structure encoded in the data, which is essential for a learning model to capture temporal interaction and dependency. By applying a vectorization step, traditional vector-based models fail to capture such temporal cues, leading to inferior performance compared to tensor-based models that work directly on the natural representation of the input. Recent progress in mathematical tools and algorithms pertaining to tensor input have enabled the development of several learning systems based on multilinear projections. For example, popular discriminant and regression criteria were extended for tensor inputs, such as Multilinear Discriminant Analysis (MDA) [41], Multilinear Class-specific Discriminant Analysis (MCSDA) [42] or Tensor Regression (TR) [43]. Regarding neural network formulations, attempts have also been made to learn separate projections for each mode of the input tensors [44], [45]. Motivation to replace linear mapping by the multilinear counterpart stems from the fact that learning separate dependencies between separate modes of the input alleviates the so-called curse of dimensionality and greatly reduces the amount of memory and computation required. While large volume of literature employing multilinear projections was developed for data modalities such as image, video, and text, few works have been dedicated to time-series prediction in general and financial time-series in particular. In recent work [46], we have showed that a linear multivariate regression model could outperform other competing shallow architectures that do not take into account the temporal nature of HFT data. While performing reasonably well compared to other shallow architectures, the learning model in [46] has certain short-comings in practice: the analytical solution is computed based on the entire dataset prohibiting its application in an online learning scenario; with large amount of data, this model clearly underfits the underlying generating process with performance inferior to other models based on deep architectures [47], [48]. In this work, we propose a neural network layer which incorporates the idea of bilinear projection in order to learn two separate dependencies for the two modes of multivariate time-series data. Moreover, we augment the proposed layer with an attention mechanism that enables the layer to focus on important temporal instances of the input data. By formulation, the layer is differentiable. Thus it can be trained with any mini-batch gradient descend learning algorithm. The contribution of our work is as follows: • We propose a new type of layer architecture for multivariate time-series data. The proposed layer is designed to leverage the idea of bilinear projection by incorporating an attention mechanism in the temporal mode. The formulation of the attention mechanism directly encourages the competition between neurons representing the same feature at different time instances. The learned model utilizing our proposed layer is highly interpretable by allowing us to look at which specific time instances the learning model attends to. • We show both theoretically and experimentally that the proposed attention mechanism is highly efficient in terms of computational complexity, allowing development in practical financial forecasting systems. • Numerical experiments in a large-scale Limit Order Book (LOB) dataset that contains more than 4 million limit orders show that by using a shallow architecture with only two hidden layers, we are able to outperform by a large margin existing results of deep networks, such as CNN and LSTM, leading to new state-of-the-art results. Furthermore, we show that our proposed attention mechanism can highlight the contribution of different temporal information, opening up opportunities for further analysis on the temporal instances of interest. The rest of the paper is organized as follows: in section 2, we provide an overview of the related works focusing on time-series prediction problems. Section 3 describes our proposed layer architecture together with theoretical analysis on its computational complexity. Section 4 starts by describing the task of mid-price movement prediction given LOB data before providing details of our experimental procedures, results and quantitative analysis. Section 5 concludes our work and discusses possible future extension and analysis. II. R ELATED W ORK Deep neural networks have been shown to be the state-ofthe-art not only in human cognition tasks, such as language and image understanding but also in the prediction of complex time-series data. For example, RNN networks based on LSTM architectures have been used to predict the future rainfall intensity in different geographic areas [9], commodity consumption [39] or to recognize patterns in clinical time-series 3 [4]. In financial data analysis, Deep Belief Networks and AutoEncoders were used to derive portfolio trading models [49], [50]. In addition, Deep Reinforcement Learning methods are also popular among the class of financial asset trading models [51], [52]. Spatial relations between LOB levels was studied in [53] by a 3-hidden-layer multilayer perceptron (MLP) that models the joint distribution of bid and ask prices. Due to the erratic, noisy nature of stock price movement, many deep neural networks were proposed within a complex forecasting pipeline. For example, in high-frequency LOB data, the authors proposed to normalize the LOB states by the prior date’s statistics before feeding them to a CNN [47] or an LSTM network [48]. A more elaborate pipeline consisting of multiresolution wavelet transform to filter the noisy input series, stacked Auto-Encoder to extract high-level representation of each stock index and an LSTM network to predict future prices was recently proposed in [54]. Along with popular deep networks, such as CNN, LSTM being applied to time-series forecasting problems, a recently proposed Neural Bag of Feature (NBoF) model was also applied to the problem of stock price movement prediction [55]. The architecture consists of an NBoF layer which compiles histogram representation of the input time-series and an MLP that classifies the extracted histograms. By learning the parameters of the whole network through back-propagation algorithm, NBoF was shown to outperform its Bag-of-Feature (BoF) counterpart. In order to improve both performance and interpretability, attention mechanism was proposed for the recurrent sequenceto-sequence learning problem (ASeq-RNN) [3]. Given a sequence of multivariate inputs xi ∈ RD , 1 ≤ i ≤ T and an associated sequence of outputs yj , 1 ≤ j ≤ T ′ , the Seq-RNN model with attention mechanism learns to generate yj from xi by using three modules: the encoder, the memory and the decoder. The encoder maps each input xi to a hidden state hei using the nonlinear transformation hei = f (xi , hei−1 ) coming from a recurrent unit (LSTM or GRU). From the sequence of hidden states generated by the encoder hei , i = 1, . . . , T , the memory module generates context vectors cj , j = 1, . . . , T ′ for each output value yj , j = 1, . . . , T ′ . In a normal recurrent model, the context vector is simply selected as the last hidden state heT while in the attention-based model, the context vectors provide summaries of the input PT sequence by linearly combining the hidden states cj = i=1 αij hei through a set of attention weights αij learned by the following equations: T eij = vα tanh(Wα hdj−1 + Uα hei ) exp(eij ) αij = PT k=1 exp(ekj ) (1) (2) The softmax function in Eq. (2) allows the model to produce the context vectors that focus on some time instances of the input sequence and hdj = g(yj−1 , hdj−1 , cj ), j = 1, . . . , T ′ is the hidden state computed from the recurrent unit in the decoder module. From the hidden state hdj which is based on the previous state hdj−1 , the previous output yj−1 and the current context cj , the decoder learns to produce the output yj = Wout hdj + bout . Based on the aforementioned attention mechanism, [56] proposed to replace Eq. (1) with a modified attention calculation scheme that assumes the existence of pseudo-periods in the given time-series. Their experiments in energy consumption and weather forecast showed that the proposed model learned to attend particular time instances which indicate the pseudoperiods existing in the data. For the future stock price prediction task given current and past prices of multiple stock indices, the authors in [40] developed a recurrent network with two-stage attention mechanism which first focuses on different input series then different time instances. We should note that the formulations above of attention mechanism were proposed for the recurrent structure. Our work can be seen as direct extension of [46] in which the author proposed a regression model based on the bilinear mapping for the mid-price movement classification problem: f (X) = W1 Xw2 (3) where X ∈ RD×T is a multivariate time-series containing T temporal steps. W1 ∈ R3×D and w2 ∈ RT ×1 are the parameters to estimate. By learning two separate mappings that transform the input LOB states to class-membership vector of size 3 × 1 corresponding to 3 types of movements in midprice, the regression model in [46] was shown to outperform other shallow classifiers. Other related works that utilize a bilinear mapping function to construct a neural network layer include [45] and [44]. While [45] attempted to incorporate the bilinear mapping into the recurrent structure by processing a block of temporal instances at each recurrent step, both [45] and [44] focus on medium-scale visual-related tasks such as hand-written digit recognition, image interpolation and reconstruction. III. P ROPOSED M ETHOD A. Bilinear Layer We start this section by introducing some notations and definitions. Throughout the paper, we denote scalar values by either lower-case or upper-case character (a, b, A, B, . . . ), vectors by lower-case bold-face characters (x, y, . . . ), matrices by upper-case bold-face characters (X, Y, . . . ). A matrix X ∈ RD×T is a second order tensor which has two modes with D and T are the dimension of the first and second mode respectively. We denote Xi ∈ RD×T , i = 1, . . . , N the set of N samples, each of which contains a sequence of T past observations corresponding to its T columns. The time span of the past values (T ) is termed as history while the time span in the future value (H) that we would like to predict is known as prediction horizon. For example, given that the stock prices are sampled every second and Xi ∈ R10×100 contains stock prices at different LOB levels for the last T = 100 seconds, the prediction horizon H = 10 corresponds to predicting a future value, e.g. mid-price, at the next 10 seconds. Let us denote by X = [x1 , . . . , xTl ] ∈ RD×T the input to the Bilinear Layer (BL). The layer transforms an input of size D × T to a matrix of size D′ × T ′ by applying the following mapping:  Y = φ W1 XW2 + B (4) 4 interacts with other time instances or which time instances are important to the prediction at horizon T ′ . By incorporating the position information into the attention calculation scheme, the authors in [56] showed that the learned model only used a particular time instance in the past sequence to predict the future value at a given horizon for sequence-to-sequence learning. In order to learn the importance of each time instance in the proposed BL, we propose the Temporal Attention augmented Bilinear Layer (TABL) that maps the input X ∈ RD×T to the ′ ′ output Y ∈ RD ×T as follows: X̄ = W1 X Fig. 1. Illustration of the proposed Temporal Attention augmented Bilinear Layer (TABL) ′ ′ ′ E = X̄W exp(eij ) αij = PT k=1 exp(eik ) ′ where W1 ∈ RD ×D , W2 ∈ RT ×T , B ∈ RD ×T are the parameters to estimate. φ(·) is an element-wise nonlinear transformation function, such as ReLU [57] or sigmoid. One of the obvious advantages of the mapping in Eq. (4) is that the number of estimated parameters scales linearly with the dimension of each mode of the input rather than the number of input neurons. For an MLP layer, transforming an input of size DT to D′ T ′ requires the estimation of (DT + 1)D′ T ′ parameters (including the bias term), which are much higher than the number of parameters (DD′ + T T ′ + D′ T ′ ) estimated by a bilinear layer. A more important characteristic of the mapping in Eq. (4), when it is applied to time-series data, is that the BL models two dependencies (one for each mode of the input representation), each of which has different semantic meanings. In order to better understand this, denote each column and row of X as xct ∈ RD , t = 1, . . . , T and xrd ∈ RT , d = 1, . . . , D, respectively. Given the input time-series X, the t-th column represents D different features or aspects of the underlying process observed at the time instance t, while the d-th row contains the temporal variations of the d-th feature during the past T steps. Since   W1 X = W1 xc1 , . . . , W1 xcT (5)   (xr1 )T W2   .. (6) XW2 =   . X̃ = λ(X̄ ⊙ A) + (1 − λ)X̄  Y = φ X̃W2 + B B. Temporal Attention augmented Bilinear Layer Although the BL learns separate dependencies along each mode, it is not obvious how a representation at a time instance (8) (9) (10) (11) where αij and eij denote the element at position (i, j) of A and E, respectively, ⊙ denotes the element-wise multiplication operator and φ(·) is a predefined nonlinear mapping as in Eq. (4). ′ ′ ′ ′ W1 ∈ RD ×D , W ∈ RT ×T , W2 ∈ RT ×T , B ∈ RD ×T and λ are the parameters of the proposed TABL. Similar to the aforementioned BL, TABL models two separate dependencies through W1 and W2 with the inclusion of the intermediate attention step learned through W and λ. The forward pass through TABL consists of 5 steps, which are depicted in Figure 1: • • (xrD )T W2 , Eq. (5) shows that the interaction between different features/aspects at a time instance t = 1, . . . , T is captured by W1 while in Eq. (6), W2 models the temporal progress of the d-th feature/aspect. For example, given that X contains stock prices of D different LOB levels during the history T , the BL determines how different stock prices interact at a particular time instance by W1 and how the prices of a particular index progress over time by W2 . It has been shown in [53] that taking advantage of the spatial structure existing in the LOB yields better joint distribution of the future best bid and ask prices. (7) • • In Eq. (7), W1 is used to transform the representation of each time instance xct , t = 1, . . . , T of X (each column) ′ to a new feature space RD . This models the dependency along the first mode of X while keeping the temporal order intact. The aim of the second step is to learn how important the temporal instances are to each other. This is realized by learning a structured matrix W whose diagonal elements ′ are fixed to 1/T . Let us denote by x̄t ∈ RD and et ∈ D′ R the t-th column of X̄ and E respectively. From Eq. (8), we could see that et is the weighted combination ′ of T temporal instances in the feature space RD , i.e. T columns of X̄, with the weight of the t-th time instance always equal to 1/T since the diagonal elements of W are fixed to 1/T . Thus, element eij in E encodes the relative importance of element x̄ij with respect to other x̄ik , k 6= j. By normalizing the importance values in E using the softmax function in Eq. (9), the proposed layer pushes many elements to become close to zero, while keeping the values of few of them positive. This process, produces the attention mask A. The attention mask A obtained from the third step is used to zero out the effect of unimportant elements in ′ RD . Instead of applying a hard attention mechanism, the learnable scalar λ in Eq. (10) allows the model to learn a soft attention mechanism. In the early stage of the learning process, the learned features extracted 5 from the previous layer can be noisy and might not be discriminative, thus hard attention might mislead the model to unimportant information while soft attention could enable the model to learn discriminative features in the early stage, i.e. before selecting the most important ones. Here we should note that λ is constrained to lie in the range [0, 1], i.e. 0 ≤ λ ≤ 1 • Similar to BL, the final step of the proposed layer estimates the temporal mapping W2 , extracting higherlevel representation after the bias shift and nonlinearity transformation. Generally, the introduction of attention mechanism in the second, third and fourth step of the proposed layer encourages the competition among neurons representing different temporal steps of the same feature, i.e. competition between elements on the same row of X̄. The competitions are, however, ′ independent for each feature in RD , i.e. elements of the same column of X̄ do not compete to be represented. The proposed layer architecture is trained jointly with other layers in the network using the Back-Propagation (BP) algorithm. During the backward pass of BP, in order to update the parameters of TABL, the following quantities must be calculated: ∂L/∂W1 , ∂L/∂W, ∂L/∂λ, ∂L/∂W2 and ∂L/∂B with L is the loss function. Derivation of these derivatives is given in the Appendix A. C. Complexity Analysis As mentioned in the previous section, the memory complexity of the BL is O(DD′ + T T ′ + D′ T ′ ). The proposed TABL requires an additional amount of O(T 2 ) in memory. Computation of the BL requires the following steps: matrix multiplication W1 XW2 with the cost of O(D′ DT +D′ T T ′), bias shift and nonlinear activation with the cost of O(2D′ T ′ ). In total, the computational complexity of BL is O(D′ DT + D′ T T ′ + 2D′ T ′ ). Since TABL possesses the same computation steps as in BL with additional computation for the attention step, the total computational complexity of TABL is O(D′ DT + D′ T T ′ + 2D′ T ′ + D′ T 2 + 3D′ T ) with the last two terms contributed from the applying the attention mask A. In order to compare our proposed temporal attention mechanism in bilinear structure with the attention mechanism in a recurrent structure, we estimate the complexity of the attention-based Seq-RNN (ASeq-RNN) proposed in [3] as a reference. Let D′ denote the dimension of the hidden units in the encoder, memory and decoder module. In addition, we assume that input and output sequence have equal length. The total memory and computational complexity of ASeq-RNN are O(3D′ D + 11D′2 + 11D′ ) and O(11T D′2 + 20T D′ + 4T 2 D′ + 3T D′D + T 2 ) respectively. Details of the estimation are given in the Appendix B. While configurations of the recurrent and bilinear architecture are not directly comparable, it is still obvious that ASeq-RNN has much higher memory and computational complexity as compared to the proposed TABL. It should be noted that the given complexity of ASeqRNN is derived based on GRU, which has lower memory and computation complexities compared to LSTM. Variants of ASeq-RNN proposed to time-series data are, however, based on LSTM units [56], [40], making them even more computationally demanding. IV. E XPERIMENTS In this section, we evaluate our proposed architecture on the mid-price movement prediction problem based on a largescale high-frequency LOB dataset. Before elaborating on experimental setups and numerical results, we start by describing the dataset and the prediction task. A. High-Frequency Limit Order Data In stock markets, traders buy and sell stocks through an order-driven system that aggregates all out-standing limit orders in limit order book. A limit order is a type of order to buy or sell a certain amount of a security at a specified price or better. In a limit order, the trader must specify type (buy/sell), price and the respective volume (number of stock items he/she wants to trade). Buy and sell limit orders constitute two sides of the Limit Order Book (LOB), i.e. the bid and ask side. At time t, the best bid price (p1b (t)) and best ask price (p1a (t)) are defined as the highest bid and lowest ask prices in the LOB, respectively. When a new limit order arrives, the LOB aggregates and sorts the orders on both sides based on the given prices so that best bid and best ask price are placed at the first level. If there are limit orders where the bid price is equal or higher than the lowest ask, i.e. p1b (t) ≥ p1a (t), those orders are immediately fulfilled and removed from the orders book. In contrast to limit orders, a buy market order is executed immediately with the current best ask price while a sell market order is executed at the current best bid price. An arriving market order is immediately matched with the best available price in the limit order book and a trade occurs, which decreases the depth of the LOB by the amount of shares traded. There are multiple price levels in the order book and in this paper we consider 10 top price levels from both sides of the LOB. For more information on limit order books, we refer [58]. The LOB reflects the existing supply and demand for the stock at different price levels. Therefore, based on the availability of LOB data, several analysis and prediction problems can be formulated such as modeling the order flow distribution, the joint distribution of best bid and ask price or casualty analysis of turbulence in price change. The mid-price at a given time instance is a quantity defined as the mean between the best bid price and best ask price: p1a (t) + p1b (t) (12) 2 This quantity is a virtual price since no trade can take place at this exact price. Since this quantity lies in the middle of the best bid and best ask price, its movement reflects the dynamics of LOB and the market. Therefore, being able to predict the mid-price changes in the future is of great importance. We evaluate our proposed architecture with the task of predicting the future movement of mid-price given the past bid and ask prices with respective volumes. We use the pt = 6 TABLE I E XPERIMENT R ESULTS IN S ETUP 1 Models Fig. 2. Baseline Network Topologies publicly available dataset provided in [59], known as FI-2010 dataset. The data were collected from 5 different Finnish stocks in NASDAQ Nordic coming from different industrial sectors. The collection period is from 1st of June to 14th of June 2010, producing order data of 10 working days with approximately 4.5 million events. For each event, the prices and volumes of the top 10 orders from each side of the LOB were extracted, producing a 40-dimensional vector representation. In [59], the author extracts a 144-dimensional feature vector for every non-overlapping block of 10 events, with the first 40 dimensions containing the prices and volumes of the last event in the block, while the rest contain extracted information within the block. The feature extraction process results in 453, 975 feature vectors in total. For each feature vector, the dataset includes labels of the mid-price movement (stationary, increase, decrease) in 5 different horizons (H = 10, 20, 30, 50, 100) corresponding to the future movements in the next 10, 20, 30, 50, 100 events. There exist two experimental setups using FI-2010 dataset. The first setting is the standard anchored forward splits provided by the database which we will refer as Setup1. In Setup1, the dataset is divided into 9 folds based on a day basis. Specifically, in the k-th fold, data from the first k days is used as the train set while data in the (k + 1)-th day is used as a test set with k = 1, . . . , 9. The second setting, referred as Setup2, comes from recent works [47], [48] in which deep network architectures were evaluated. In Setup2, the first 7 days are used as the train set while the last 3 days are used as test set. We provide the evaluation of our proposed architecture in both settings using the z-score normalized data provided by the database. B. Network Architecture In order to evaluate the bilinear structure in general and the proposed Temporal Attention augmented Bilinear Layer (TABL) in particular, we construct three different baseline network configurations (A,B,C) with d = {0, 1, 2} hidden layers that are all Bilinear Layer (BL). Details of the baseline RR[59] SLFN[59] LDA[46] MDA[46] MCSDA[42] MTR[46] WMTR[46] BoF[55] N-BoF[55] A(BL) A(TABL) B(BL) B(TABL) C(BL) C(TABL) RR[59] SLFN[59] BoF[55] N-BoF[55] A(BL) A(TABL) B(BL) B(TABL) C(BL) C(TABL) RR[59] SLFN[59] BoF[55] N-BoF[55] A(BL) A(TABL) B(BL) B(TABL) C(BL) C(TABL) Accuracy % Precision % Recall % Prediction Horizon H = 10 48.00 41.80 43.50 64.30 51.20 36.60 63.82 37.93 45.80 71.92 44.21 60.07 83.66 46.11 48.00 86.08 51.68 40.81 81.89 46.25 51.29 57.59 39.26 51.44 62.70 42.28 61.41 44.48 47.56 50.78 66.03 56.48 58.09 72.80 65.25 66.92 73.62 66.16 68.81 76.82 70.51 72.75 78.01 72.03 74.06 Prediction Horizon H = 50 43.90 43.60 43.30 47.30 46.80 46.40 50.21 42.56 49.57 56.52 47.20 58.17 46.47 54.58 47.83 54.61 54.89 53.13 68.09 67.95 67.12 69.54 69.12 68.84 74.46 74.20 73.95 74.81 74.58 74.27 Prediction Horizon H = 100 42.90 42.90 42.90 47.70 45.30 43.20 50.97 42.48 47.84 56.43 47.27 54.99 48.90 53.23 45.41 51.35 51.37 52.02 66.02 65.78 66.63 69.31 68.95 69.41 73.80 73.43 73.40 74.07 73.51 73.80 F1 % 41.00 32.70 36.28 46.06 46.72 40.14 47.87 36.28 41.63 43.05 56.50 65.59 67.12 71.33 72.84 42.70 45.90 39.56 46.15 44.51 53.00 67.16 68.84 73.79 74.32 41.60 41.00 40.84 46.86 43.40 50.66 65.60 68.86 73.21 73.52 network configurations are shown in Figure 2. The input to all configurations is a matrix of size 40×10 which contains prices and volumes of the top 10 orders from bid and ask side (40 values) spanning over a history of 100 events1 . Here 120 × 5BL denotes the Bilinear Layer with output size 120 × 5. Based on the baseline network configurations, hereby referred as A(BL), B(BL) and C(BL), we replace the last BL classification layer by the proposed attention layer (TABL) to evaluate the effectiveness of attention mechanism. The resulting attentionbased configurations are denoted as A(TABL), B(TABL) and C(TABL). Although attention mechanism can be placed in any 1 Since the feature vector is extracted from a block of 10 events and we only use the first 40 dimensions of the given feature vector, which correspond to prices and volumes of the last event in the block 7 TABLE II E XPERIMENT R ESULTS IN S ETUP 2 Models SVM[48] MLP[48] CNN[47] LSTM[48] A(BL) A(TABL) B(BL) B(TABL) C(BL) C(TABL) SVM[48] MLP[48] CNN[47] LSTM[48] A(BL) A(TABL) B(BL) B(TABL) C(BL) C(TABL) SVM[48] MLP[48] CNN[47] LSTM[48] A(BL) A(TABL) B(BL) B(TABL) C(BL) C(TABL) Accuracy % Prediction 29.21 70.13 78.37 78.91 82.52 84.70 Prediction 42.01 62.54 70.33 70.80 72.05 73.74 Prediction 51.92 60.15 72.16 75.58 78.96 79.87 Precision % Recall % Horizon H = 10 39.62 44.92 47.81 60.78 50.98 65.54 60.77 75.92 44.08 48.14 56.28 58.26 67.73 68.89 68.04 71.21 73.89 76.22 76.95 78.44 Horizon H = 20 45.08 47.77 51.33 65.20 54.79 67.38 59.60 70.52 47.71 45.38 52.36 50.96 62.97 60.64 63.14 62.25 65.04 65.23 67.18 66.94 Horizon H = 50 46.05 60.30 55.21 67.14 55.58 67.12 60.03 68.58 51.59 50.35 59.05 55.71 71.28 68.69 74.58 73.09 77.85 77.04 79.05 77.04 F1 % 35.88 48.27 55.21 66.33 29.47 56.03 67.71 69.20 75.01 77.63 43.20 51.12 59.17 62.37 38.61 50.69 61.02 62.22 64.89 66.93 49.42 55.95 59.44 61.43 49.58 55.87 69.40 73.64 77.40 78.44 the training set stops decreasing. In total, all configurations were trained for maximum 200 epochs with the mini-batch size of 256 samples. Regarding regularization techniques, we used a combination of dropout and max-norm [62], which was shown to improve generalization capacity of the network. Dropout was applied to the output of all hidden layers with a fixed percentage of 0.1. Max-norm regularizer is a type of weight constraint that enforces an absolute upper bound on the l2 norm of the incoming weights to a neuron. The maximum norm was validated from the set {3.0, 5.0, 7.0}. Although weight decay is a popular regularization technique in deep neural network training, our exploratory experiments indicated that weight decay is not a suitable regularization option when training the bilinear structure. We followed similar approach proposed in [46] to weight the contribution of each class in the loss function. Since the evaluated network structures output the class-membership probability vector, the weighted entropy loss function was used: L=− 3 X c yi log(ỹi ) N i i=1 (13) where Ni , yi , ỹi are the number of samples, true probability and the predicted probability of the i-th class respectively. c = 1e6 is a constant used to ensure numerical stability by avoiding the loss values being too small when dividing by Ni . All evaluated networks were initialized with the random initialization scheme proposed in [63] except the attention weight W and λ of the TABL layer. Randomly initializing W might cause the layer to falsely attend to unimportant input parts, leading the network to a bad local minima. We thus initialized λ = 0.5 and all elements in W by a constant equal to 1/T with T is input dimension of the second mode. By initializing W with a constant, we ensure that the layer starts by putting equal focus on all temporal instances. D. Experiment Results layer, we argue that it is more beneficial for the network to attend to high-level representation, which is similar to visual attention mechanism that is applied after applying several convolution layers [35]. In our experiments, we made no attempt to validate all possible positions to apply attention mechanism by simply incorporating it into the last layer. C. Experiment Settings The following experimental settings were applied to all network configurations mentioned in the previous subsection. We have experimented by training the networks with two types of stochastic optimizers: SGD [60] and Adam [61]. For SGD, the Nesterov momentum was set to 0.9 while for Adam, the exponential decay rates of the first and second moment were fixed to 0.9 and 0.999 respectively. The initial learning rate of both optimizers was set to 0.01 and decreased by the following learning rate schedule SC = {0.01, 0.005, 0.001, 0.0005, 0.0001} when the loss in Following the experimental settings detailed in the previous subsection, we evaluated the proposed network structures in both Setup1 and Setup2. Besides the performance of our proposed network structures, we also report here all available experiment results coming from different models including Ridge Regression (RR), Single-Layer-Feedforward Network (SLFN), Linear Discriminant Analysis (LDA), Multilinear Discriminant Analysis (MDA), Multilinear Time-series Regression (MTR), Weighted Multilinear Time-series Regression (WMTR) [46], Multilinear Class-specific Discriminant Analysis (MCSDA) [42], Bag-of-Feature (BoF), Neural Bag-of-Feature (N-BoF) [55] in Setup1 and Support Vector Machine (SVM), Multilayer Perceptron (MLP), Convolutional Neural Network (CNN) [47] and LSTM [48] in Setup2. Since the dataset is unbalanced with the majority of samples belonging to the stationary class, we tuned the hyperparameters based on the average F1 score per class, which is a trade-off between precision and recall, measured on the training set. With the optimal parameter setting, the average 8 Movement: decrease Movement: stationary t-9 t-8 t-7 t-6 t-5 t-4 t-3 t-2 t-1 t 0.35 0.30 Movement: increase t-9 t-8 t-7 t-6 t-5 t-4 t-3 t-2 t-1 t 0.20 0.15 Average Attention Average Attention Average Attention 0.25 0.10 0.05 0.00 0 25 50 75 100 125 Epochs 150 175 200 0 25 50 75 100 125 Epochs 150 175 200 0 25 50 75 100 125 Epochs 150 175 200 Fig. 3. Average attention of 10 temporal instances during training in 3 types of movement: decrease, stationary, increase. Values taken from configuration A(TABL) in Setup2, horizon H = 10 performance on the test set over 9 folds is reported in Setup1 while in Setup2, each network configuration is trained 5 times and the average performance on the test set over 5 runs is reported. Besides the main performance metric F1, we also report the corresponding accuracy, average precision per class and average recall, also known as sensitivity, per class. Table I and II report the experiment results in Setup1 and Setup2, respectively. As can be seen in Table I, all the competing models in Setup1 belong to the class of shallow architectures with maximum 2 hidden layers (C(BL), C(TABL) and N-BoF). It is clear that all of the bilinear structures outperform other competing models by a large margin for all prediction horizons with the best performances coming from bilinear networks augmented with attention mechanism. Notably, average F1 obtained from the 2 hidden-layer configuration with TABL exceeds the previous best result in Setup1 achieved by WMTR in [46] by nearly 25%. Although NBoF and C(TABL) are both neural network-based architectures with 2 hidden layers, C(TABL) surpasses NBoF by nearly 30% on all horizons. This is not surprising since a regression model based on bilinear projection was shown to even outperform NBoF in [46], indicating that by separately learning dependencies in different modes is crucial in time-series LOB data prediction. While experiments in Setup1 show that the bilinear structure in general and the proposed attention mechanism in particular outperform all of the existing models that exploit shallow architectures, experiments in Setup2 establish the comparison between conventional deep neural network architectures and the proposed shallow bilinear architectures. Even with 1 hidden-layer, TABL performs similarly (H = 20) or largely better than the previous state-of-the-art results obtained from LSTM network (H = 10, 50). Although being deep with 7 hidden layers, the CNN model is greatly inferior to the proposed ones. Here we should note that the CNN proposed in [47] gradually extracts local temporal information by the convolution layers. On the other hand, the evaluated bilinear structures fuse global temporal information from the beginning, i.e. the first layer. The comparison between CNN model and bilinear ones might indicate that the global temporal cues learned in the later stage of CNN (after some convolution layers) lose the discriminative global information existing in the raw data. Comparing BL and TABL, it is clear that adding the attention mechanism improves the performance of the bilinear networks with only small increase in the number of parameters. More importantly, the attention mechanism opens up opportunities for further analyzing the contribution of the temporal instances being attended to. This can be done by looking into the attention mask A. During the training process, each element in A represents the amount of attention the corresponding element in X̄ receives. In order to observe how each of the 10 events in the input data contributes to the 9 TABLE III AVERAGE C OMPUTATION T IME O F S TATE -O F -T HE -A RT M ODELS Models C(BL) C(TABL) CNN LSTM Forward (ms) 0.0253 0.0254 0.0613 0.2291 Backward (ms) 0.0327 0.0344 0.1100 0.3487 Total (ms) 0.0580 0.0598 0.1713 0.5778 second, third and last column shows the average time (in millisecond) taken by the forward pass, backward pass and one training pass of a single sample in the state-of-the-art models. It is obvious that the proposed attention mechanism only increases the computational cost by a relatively small margin. On the contrary, previously proposed deep neural network architectures require around 3× (CNN) and 10× longer to train or make inference while having inferior performances compared to the proposed architecture. This points out that our proposed architecture excels previous best models not only in performance but also in efficiency and practicality in applications such as High-Frequency Trading. 0.975 0.950 V. C ONCLUSIONS lambda 0.925 0.900 0.875 0.850 0.825 0.800 0 25 50 75 100 125 Epochs 150 175 200 Fig. 4. Corresponding λ during training in A(TABL) in Setup2 and horizon H = 10 decision function, we analyze the statistics during the training process of the configuration A(TABL) in Setup2 with horizon H = 10. Figure 3 plots the average attention values of each column of A which correspond to the average attention the model gives to each temporal instance during the training process. The three plots correspond to attention patterns in three types of movement of the mid-price. It is clear that the given model focuses more on some events such as the second (t − 1), third (t − 2) and fourth (t − 3) most recent event in all types of movement. While the attention patterns are similar for the decrease and increase class, they are both different when compared to those of the stationary class. This indicates that when the mid-price is going to move from its equilibrium, the model can shift its attention to different events in order to detect the prospective change. Figure 4 shows the corresponding values of λ from the same model after every epoch during the training process. As can be seen from Figure 4, λ increases in the first few steps before stabilizing close to 1, which illustrates a soft attention behavior achieved by λ described in section III-B. The insights into the attention patterns and the amount of attention received by each event given by the proposed attention-based layer could facilitate further quantitative analysis such as casualty or pseudo-period analysis. Table III reports the average computation time of C(BL), C(TABL), CNN [47], LSTM [48] measured on the same machine with CPU core i7-4790 and 32 GB of memory. The In this paper, we proposed a new neural network layer type for multivariate time-series data analysis. The proposed layer leverages the idea of bilinear projection and is augmented with a temporal attention mechanism. We provide theoretical analysis on the complexity of the proposed layer in comparison with existing attention mechanisms in recurrent structure, indicating that the proposed layer possesses much lower memory and computational complexity. Extensive experiments in a largescale Limit Order Book dataset show the effectiveness of the proposed architecture: with only 2 hidden-layers, we can surpass existing state-of-the-art models by a large margin. The proposed temporal attention mechanism not only improves the performance of the bilinear structure but also enhances its interpretability. Our quantitative analysis of the attention patterns during the training process opens up opportunities in future research of the patterns of interest. A PPENDIX A TABL D ERIVATIVES In order to calculate the derivatives of TABL, we follow the notation: given X ∈ RI×J and X ∈ RM×N , ∂Y/∂X is a matrix of size IJ × M N with element at (ij, mn) equal to ∂Yij /∂Bmn . Similarly ∂L/∂X ∈ R1×MN with L ∈ R, X ∈ RM×N . Denote IM ∈ RM×M the identity matrix and 1MN ∈ RM×N a matrix with all elements equal to 1. In addition, our derivation heavily uses the following formulas: ∂(AXB) = BT ⊗ A (14) ∂X  ∂B ∂(A ⊙ B) = diag vec(A) ⊙ ∂C ∂C  ∂A + diag vec(B) ⊙ (15) ∂C where ⊗ denotes the Kronecker product, vec(A) denotes the vectorization operator that concatenates columns of A into one vector and diag(x) denotes the diagonal matrix with the diagonal elements taken from x. We proceed by calculating the derivate of the left-hand side with respect to every term on the right-hand side from Eq. (7) to (11): 10 • From Eq. (7) ∂ X̄ ∂(ID′ W1 X) = = XT ⊗ ID′ ∂W1 ∂W1 ∂(W1 XIT ) ∂ X̄ = IT ⊗ W1 = ∂X ∂W1 • • • ∂L ∂W1 ∂L ∂W ∂L ∂λ ∂L ∂W2 ∂L ∂B (16) (17) From Eq. (8) ∂(ID′ X̄W) ∂E (18) = = WT ⊗ ID′ ∂ X̄ ∂ X̄ ∂E ∂(X̄WIT ) = IT ⊗ X̄ (19) = ∂W ∂ X̄ From Eq. (9) ∂A/∂E is calculated by the following results: ∂αij = αij − α2ij , ∀i, j (20) ∂eij ∂αij αij (1 − αij ) , ∀p 6= j (21) =P ∂eip k6=j,p exp(eik ) ∂αij = 0, ∀p 6= i (22) ∂epq From Eq. (10)  ∂ X̃ ∂(X̄ ⊙ A) =λ = λdiag vec(X̄) ∂A ∂A ∂ X̃ ∂([λA + (1 − λ)1D′ T ] ⊙ X̄) = ∂ X̄ ∂ X̄  = diag vec(λA + (1 − λ)1D′ T )  ∂A  + diag vec(X̄) ⊙ λ ∂ X̄  = diag vec(λA + (1 − λ)1D′ T )  ∂A ∂E  + diag vec(X̄) ⊙ ∂E ∂ X̄ ∂ X̃ = (X̄ ⊙ A − X̄) ∂λ • in TABL can be calculated as below: ∂Y ∂Y ∂ Ȳ ∂φ(Ȳ) ∂(ID′ X̃W2 ) = = ∂ Ȳ ∂ X̃ ∂ Ȳ ∂ X̃ ∂ X̃ ∂φ(Ȳ) T W2 ⊗ ID′ = ∂ Ȳ ∂Y ∂Y ∂ Ȳ ∂φ(Ȳ) ∂(X̃W2 IT ) = = ∂W2 ∂W2 ∂ Ȳ ∂W2 ∂ Ȳ ∂φ(Ȳ) = IT ⊗ X̃ ∂ Ȳ ∂Y ∂Y ∂ Ȳ ∂φ(Ȳ) ∂(ID′ BIT ) = = ∂B ∂B ∂ Ȳ ∂B ∂ Ȳ ∂φ(Ȳ) IT ⊗ ID′ = ∂ Ȳ = = = (29) (30) (31) (32) (33) hei = (1 − zei ) ⊙ hei−1 + zei ⊙ h̃ei • (37) (38) Memory T tanh(Wα hdj−1 + Uα hei ) eij = vα exp(eij ) αij = PT k=1 exp(ekj ) T X αij hei cj = (24) In Eq. (11), denote Ȳ = X̃W2 + B, Eq. (11) becomes Y = φ(Ȳ) and we have: = ∂L ∂φ(Ȳ) ∂ Ȳ ∂ X̃ ∂ X̄ ∂Y ∂ Ȳ ∂ X̃ ∂ X̄ ∂W1 ∂L ∂φ(Ȳ) ∂ Ȳ ∂ X̃ ∂A ∂E ∂Y ∂ Ȳ ∂ X̃ ∂A ∂E ∂W ∂L ∂φ(Ȳ) ∂ Ȳ ∂ X̃ ∂Y ∂ Ȳ ∂ X̃ ∂λ ∂L ∂Y ∂Y ∂W2 ∂L ∂Y ∂Y ∂B A PPENDIX B C OMPLEXITY OF ATTENTION - BASED RNN The attention-based sequence to sequence learning proposed in [3] comprises of the following modules: • Encoder  (34) zei = σ Wze xi + Uez hei−1 + bez  e e e e e (35) ri = σ Wr xi + Ur hi−1 + br  e e e e e e (36) h̃i = tanh W xi + U (ri ⊙ hi−1 ) + b (23) (25) = (39) (40) (41) i=1 • Decoder zdj = σ wzd yj−1 + Udz hdj−1 + Cz cj + bdz rdj h̃dj =σ wrd yj−1 d = tanh w  + Udr hdj−1 + Cr cj + bdr yj−1 + Ud (rdj ⊙ hdj−1 ) + Ccj  (42) +b (43)  d (44) hdj (26) (27) (28) where ∂φ(Ȳ)/∂ Ȳ is the derivative of the element-wise activation function, which depends on the form of the chosen one. During the backward pass, given ∂L/∂Y and ∂φ(Ȳ)/∂ Ȳ, using chain rules and the above results, the derivatives required = yj = (1 − zdj ) ⊙ hdj−1 T wout hdj + bout + zdj ⊙ h̃dj (45) (46) where i = 1, . . . , T and j = 1, . . . , T denote the index in input and output sequence respectively, which we assume having equal length. In order to generate sequence of prediction rather than probability of a word in a dictionary, we use Eq. (46) similar to [56]. To simplify the estimation, let the number of hidden units in the encoder, memory and decoder module ′ equal to D′ , i.e. hei , hdj , vα ∈ RD , and the output yj is a scalar. The encoder module estimates the following parameters: ′ ′ ′ We , Wre , Wze ∈ RD ×D , Ue , Uer , Uez ∈ RD ×D , be , ber , bez ∈ ′ RD , which result in O(3D′ D + 3D′2 + 3D′ ) memory and O(T (3D′ D + 3D′2 + 8D′ ) computation. The memory module estimates the following parameters: ′ ′ ′ vα ∈ RD , Wα , Uα ∈ RD ×D , which cost O(2D′2 + D′ ) memory and O(2D′2 T + 4T 2 D′ + T 2 ) computation. 11 The decoder module estimates the following ′ ′ ∈ parameters: Udr , Udz , Ud , Cz , Cr , C RD ×D , ′ wrd , wzd , wd , bdz , bdr , bd , wout ∈ RD , which result in O(6D′2 + 7D′ ) memory and O(T (12D′ + 6D′2 )). In total, the attention model requires O(3D′ D + 11D′2 + 11D′ ) memory and O(11T D′2 +20T D′ +4T 2 D′ +3T D′ D + T 2 ) computation. R EFERENCES [1] A. Graves, A.-r. Mohamed, and G. Hinton, “Speech recognition with deep recurrent neural networks,” in Acoustics, speech and signal processing (icassp), 2013 ieee international conference on, pp. 6645–6649, IEEE, 2013. [2] K. Cho, B. Van Merriënboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio, “Learning phrase representations using RNN encoder-decoder for statistical machine translation,” arXiv preprint arXiv:1406.1078, 2014. [3] D. Bahdanau, K. Cho, and Y. Bengio, “Neural machine translation by jointly learning to align and translate,” arXiv preprint arXiv:1409.0473, 2014. [4] Z. C. Lipton, D. C. Kale, C. Elkan, and R. Wetzell, “Learning to diagnose with LSTM recurrent neural networks,” arXiv preprint arXiv:1511.03677, 2015. [5] M. Zabihi, A. B. Rad, S. Kiranyaz, M. Gabbouj, and A. K. Katsaggelos, “Heart sound anomaly and quality detection using ensemble of neural networks without segmentation,” in Computing in Cardiology Conference (CinC), 2016, pp. 613–616, IEEE, 2016. [6] A. Iosifidis, A. Tefas, and I. Pitas, “Class-specific Reference Discriminant Analysis with application in Human Behavior Analysis,” IEEE Transactions on Human-Machine Systems, vol. 45, no. 3, pp. 315–326, 2015. [7] A. Iosifidis, A. Tefas, and I. Pitas, “View-invariant action recognition based on Artificial Neural Networks,” IEEE Transactions on Neural Networks and Learning Systems, vol. 23, no. 3, pp. 412–424, 2012. [8] A. Iosifidis, A. Tefas, and I. Pitas, “Activity based Person Identification using Fuzzy Representation and Discriminant Learning,” IEEE Transactions on Information Forensics and Security, vol. 7, no. 2, pp. 530–2012, 2012. [9] S. Xingjian, Z. Chen, H. Wang, D.-Y. Yeung, W.-K. Wong, and W.-c. Woo, “Convolutional LSTM network: A machine learning approach for precipitation nowcasting,” in Advances in neural information processing systems, pp. 802–810, 2015. [10] I. Kaastra and M. Boyd, “Designing a neural network for forecasting financial and economic time series,” Neurocomputing, vol. 10, no. 3, pp. 215–236, 1996. [11] E. M. Azoff, Neural network time series forecasting of financial markets. John Wiley & Sons, Inc., 1994. [12] L.-J. Cao and F. E. H. Tay, “Support vector machine with adaptive parameters in financial time series forecasting,” IEEE Transactions on neural networks, vol. 14, no. 6, pp. 1506–1518, 2003. [13] A. Iosifidis, A. Tefas, and I. Pitas, “Multidimensional Sequence Classification based on Fuzzy Distances and Discriminant Analysis,” IEEE Transactions on Knowledge and Data Engineering, vol. 93, no. 6, pp. 1445–1457, 2013. [14] S. B. Taieb and A. F. Atiya, “A bias and variance analysis for multistepahead time series forecasting,” IEEE transactions on neural networks and learning systems, vol. 27, no. 1, pp. 62–76, 2016. [15] B. Wang, H. Huang, and X. Wang, “A novel text mining approach to financial time series forecasting,” Neurocomputing, vol. 83, pp. 136–145, 2012. [16] C. J. Neely, D. E. Rapach, J. Tu, and G. Zhou, “Forecasting the equity risk premium: the role of technical indicators,” Management Science, vol. 60, no. 7, pp. 1772–1791, 2014. [17] J. J. Murphy, Technical analysis of the financial markets: A comprehensive guide to trading methods and applications. Penguin, 1999. [18] G. Walker, “On periodicity in series of related terms,” Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character, vol. 131, no. 818, pp. 518–532, 1931. [19] E. Slutzky, “The summation of random causes as the source of cyclic processes,” Econometrica: Journal of the Econometric Society, pp. 105– 146, 1937. [20] G. E. Box, G. M. Jenkins, and J. F. MacGregor, “Some recent advances in forecasting and control,” Applied Statistics, pp. 158–179, 1974. [21] G. C. Tiao and G. E. Box, “Modeling multiple time series with applications,” journal of the American Statistical Association, vol. 76, no. 376, pp. 802–816, 1981. [22] J. M. Poterba and L. H. Summers, “Mean reversion in stock prices: Evidence and implications,” Journal of financial economics, vol. 22, no. 1, pp. 27–59, 1988. [23] N. I. Sapankevych and R. Sankar, “Time series prediction using support vector machines: a survey,” IEEE Computational Intelligence Magazine, vol. 4, no. 2, 2009. [24] G. G. Creamer and Y. Freund, “Predicting performance and quantifying corporate governance risk for latin american adrs and banks,” 2004. [25] M. J. Kane, N. Price, M. Scotch, and P. Rabinowitz, “Comparison of ARIMA and Random Forest time series models for prediction of avian influenza H5N1 outbreaks,” BMC bioinformatics, vol. 15, no. 1, p. 276, 2014. [26] J. J. Hopfield, “Neural networks and physical systems with emergent collective computational abilities,” in Spin Glass Theory and Beyond: An Introduction to the Replica Method and Its Applications, pp. 411– 415, World Scientific, 1987. [27] G. Hinton, L. Deng, D. Yu, G. E. Dahl, A.-r. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, et al., “Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups,” IEEE Signal Processing Magazine, vol. 29, no. 6, pp. 82–97, 2012. [28] J. Yue-Hei Ng, M. Hausknecht, S. Vijayanarasimhan, O. Vinyals, R. Monga, and G. Toderici, “Beyond short snippets: Deep networks for video classification,” in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4694–4702, 2015. [29] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, no. 8, pp. 1735–1780, 1997. [30] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio, “Empirical evaluation of gated recurrent neural networks on sequence modeling,” arXiv preprint arXiv:1412.3555, 2014. [31] K. Greff, R. K. Srivastava, J. Koutnı́k, B. R. Steunebrink, and J. Schmidhuber, “Lstm: A search space odyssey,” IEEE transactions on neural networks and learning systems, 2017. [32] R. A. Rensink, “The dynamic representation of scenes,” Visual cognition, vol. 7, no. 1-3, pp. 17–42, 2000. [33] M. Corbetta and G. L. Shulman, “Control of goal-directed and stimulusdriven attention in the brain,” Nature reviews neuroscience, vol. 3, no. 3, pp. 201–215, 2002. [34] S. K. Ungerleider and G. Leslie, “Mechanisms of visual attention in the human cortex,” Annual review of neuroscience, vol. 23, no. 1, pp. 315– 341, 2000. [35] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudinov, R. Zemel, and Y. Bengio, “Show, attend and tell: Neural image caption generation with visual attention,” in International Conference on Machine Learning, pp. 2048–2057, 2015. [36] V. Mnih, N. Heess, A. Graves, et al., “Recurrent models of visual attention,” in Advances in neural information processing systems, pp. 2204– 2212, 2014. [37] K. Chen, J. Wang, L.-C. Chen, H. Gao, W. Xu, and R. Nevatia, “Abccnn: An attention based convolutional neural network for visual question answering,” arXiv preprint arXiv:1511.05960, 2015. [38] E. Choi, M. T. Bahadori, J. Sun, J. Kulas, A. Schuetz, and W. Stewart, “Retain: An interpretable predictive model for healthcare using reverse time attention mechanism,” in Advances in Neural Information Processing Systems, pp. 3504–3512, 2016. [39] M. Riemer, A. Vempaty, F. Calmon, F. Heath, R. Hull, and E. Khabiri, “Correcting forecasts with multifactor neural attention,” in International Conference on Machine Learning, pp. 3010–3019, 2016. [40] Y. Qin, D. Song, H. Cheng, W. Cheng, G. Jiang, and G. Cottrell, “A dual-stage attention-based recurrent neural network for time series prediction,” arXiv preprint arXiv:1704.02971, 2017. [41] Q. Li and D. Schonfeld, “Multilinear discriminant analysis for higherorder tensor data classification,” IEEE transactions on pattern analysis and machine intelligence, vol. 36, no. 12, pp. 2524–2537, 2014. [42] D. T. Tran, M. Gabbouj, and A. Iosifidis, “Multilinear class-specific discriminant analysis,” Pattern Recognition Letters, 2017. [43] W. Guo, I. Kotsia, and I. Patras, “Tensor learning for regression,” IEEE Transactions on Image Processing, vol. 21, no. 2, pp. 816–827, 2012. [44] J. Gao, Y. Guo, and Z. Wang, “Matrix neural networks,” in International Symposium on Neural Networks, pp. 313–320, Springer, 2017. [45] K. Do, T. Tran, and S. Venkatesh, “Matrix-centric neural networks,” arXiv preprint arXiv:1703.01454, 2017. 12 [46] D. T. Tran, M. Magris, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Tensor representation in high-frequency financial data for price change prediction,” IEEE Symposium Series on Computational Intelligence (SSCI), 2017. [47] A. Tsantekidis, N. Passalis, A. Tefas, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Forecasting stock prices from the limit order book using convolutional neural networks,” in Business Informatics (CBI), 2017 IEEE 19th Conference on, vol. 1, pp. 7–12, IEEE, 2017. [48] A. Tsantekidis, N. Passalis, A. Tefas, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Using deep learning to detect price change indications in financial markets,” in Signal Processing Conference (EUSIPCO), 2017 25th European, pp. 2511–2515, IEEE, 2017. [49] J. Heaton, N. Polson, and J. Witte, “Deep portfolio theory,” arXiv preprint arXiv:1605.07230, 2016. [50] A. Sharang and C. Rao, “Using machine learning for medium frequency derivative portfolio trading,” arXiv preprint arXiv:1512.06228, 2015. [51] Y. Deng, F. Bao, Y. Kong, Z. Ren, and Q. Dai, “Deep direct reinforcement learning for financial signal representation and trading,” IEEE transactions on neural networks and learning systems, vol. 28, no. 3, pp. 653–664, 2017. [52] Y. Deng, Y. Kong, F. Bao, and Q. Dai, “Sparse coding-inspired optimal trading system for hft industry,” IEEE Transactions on Industrial Informatics, vol. 11, no. 2, pp. 467–475, 2015. [53] J. Sirignano, “Deep Learning for Limit Order Books,” ArXiv e-prints, Jan. 2016. [54] W. Bao, J. Yue, and Y. Rao, “A deep learning framework for financial time series using stacked autoencoders and long-short term memory,” PloS one, vol. 12, no. 7, p. e0180944, 2017. [55] N. Passalis, A. Tsantekidis, A. Tefas, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Time-series classification using neural bag-of-features,” in Signal Processing Conference (EUSIPCO), 2017 25th European, pp. 301–305, IEEE, 2017. [56] Y. G. Cinar, H. Mirisaee, P. Goswami, E. Gaussier, A. Aı̈t-Bachir, and V. Strijov, “Position-based content attention for time series forecasting with sequence-to-sequence rnns,” in International Conference on Neural Information Processing, pp. 533–544, Springer, 2017. [57] X. Glorot, A. Bordes, and Y. Bengio, “Deep sparse rectifier neural networks,” in Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 315–323, 2011. [58] R. Cont, “Statistical modeling of high-frequency financial data,” IEEE Signal Processing Magazine, vol. 28, no. 5, pp. 16–25, 2011. [59] A. Ntakaris, M. Magris, J. Kanniainen, M. Gabbouj, and A. Iosifidis, “Benchmark dataset for mid-price prediction of limit order book data,” arXiv preprint arXiv:1705.03233, 2017. [60] I. Sutskever, J. Martens, G. Dahl, and G. Hinton, “On the importance of initialization and momentum in deep learning,” in International conference on machine learning, pp. 1139–1147, 2013. [61] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. [62] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting.,” Journal of machine learning research, vol. 15, no. 1, pp. 1929–1958, 2014. [63] K. He, X. Zhang, S. Ren, and J. Sun, “Delving deep into rectifiers: Surpassing human-level performance on imagenet classification,” in Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
5cs.CE
1 Analysis of universal adversarial perturbations Seyed-Mohsen Moosavi-Dezfooli∗† [email protected] Alhussein Fawzi∗‡ [email protected] Omar Fawzi§ [email protected] Pascal Frossard† [email protected] Stefano Soatto‡ [email protected] arXiv:1705.09554v1 [cs.CV] 26 May 2017 Abstract Deep networks have recently been shown to be vulnerable to universal perturbations: there exist very small image-agnostic perturbations that cause most natural images to be misclassified by such classifiers. In this paper, we propose a quantitative analysis of the robustness of classifiers to universal perturbations, and draw a formal link between the robustness to universal perturbations, and the geometry of the decision boundary. Specifically, we establish theoretical bounds on the robustness of classifiers under two decision boundary models (flat and curved models). We show in particular that the robustness of deep networks to universal perturbations is driven by a key property of their curvature: there exists shared directions along which the decision boundary of deep networks is systematically positively curved. Under such conditions, we prove the existence of small universal perturbations. Our analysis further provides a novel geometric method for computing universal perturbations, in addition to explaining their properties. I. I NTRODUCTION Despite the recent success of deep neural networks in solving complex visual tasks [1], these classifiers have recently been shown to be highly vulnerable to perturbations in the input space. In [2], state-of-the-art deep networks are empirically shown to be vulnerable to universal perturbations: there exist very small image-agnostic perturbations that cause most natural images to be misclassified. These perturbations fundamentally differ from the random noise regime, and exploit essential properties of the deep network to misclassify most natural images with perturbations of very small magnitude. Why are state-of-the-art classifiers highly vulnerable to these specific directions in the input space? What do these directions represent? To answer these questions, we follow a theoretical approach and find the causes of this vulnerability in the geometry of the decision boundaries induced by deep neural networks. For deep networks, we show that the key to answering these questions lies in the existence of shared directions (across different datapoints) along which the decision boundary is highly positively curved. This establishes fundamental connections between geometry and robustness to universal perturbations, and thereby reveal unknown properties of the decision boundaries induced by deep networks. While [2] studies the vulnerability to universal perturbations of deep neural networks, our aim here is to derive a more generic analysis in terms of the geometric properties of the boundary. To this end, we introduce two decision boundary models: 1) the locally flat model assumes that the first order linear approximation of the decision boundary holds locally in the vicinity of the natural images, and 2) the locally curved model provides a second order description of the decision boundary, and takes into account the curvature information. We summarize our contributions as follows: • Under the locally flat decision boundary model, we show that classifiers are vulnerable to universal directions so long as the normals to the decision boundaries in the vicinity of natural images are correlated (i.e., approximately span a low dimensional space). This result formalizes and proves the empirical observations made in [2]. • Under the locally curved decision boundary model, the robustness to universal perturbations is instead driven by the curvature of the decision boundary; we show that the existence of shared directions along which the decision boundary is positively curved implies the existence of very small universal perturbations. • We show that state-of-the-art deep nets satisfy the assumption of our theorem derived for the locally curved model: there exist shared directions along which the decision boundary of deep neural networks are positively curved. Our theoretical result consequently captures the large vulnerability of state-of-the-art deep networks to universal perturbations. • We finally show that the developed theoretical framework provides a novel (geometric) method for computing universal perturbations, and further explains some of the properties observed in [2] (e.g., diversity, transferability). The robustness of classifiers to noise has recently gained a lot of attention. Several works have focused on the analysis of the robustness properties of SVM classifiers (e.g., [3]) and new approaches for constructing robust classifiers (based on robust optimization) have been proposed [4], [5]. More recently, several works have assessed the robustness of deep neural networks to different regimes such as adversarial perturbations [6], random noise [7], and realistic occlusions [8]. The robustness of ∗ The first two authors contributed equally to this work. † LTS4, École Polytechnique Fédérale de Lausanne, Switzerland ‡ UCLA Vision Lab, University of California, Los Angeles, CA 90095 § ENS de Lyon, LIP, UMR 5668 ENS Lyon - CNRS - UCBL - INRIA, Université de Lyon, France 2 v Class 2 v −v −v v −v Class 1 (b) Universal direction v of a linear binary classifier. (a) Local geometry of the decision boundary. Fig. 1 classifiers to adversarial perturbations has been specifically studied, leading to theoretical as well empirical explanations of the phenomenon [9], [10], [11], [12]. Although related, adversarial perturbations are fundamentally different from universal perturbations, as the latter is a single perturbation that is added to all images, while the former is adapted to each image (and adversarial perturbations are not universal as shown in [2]). While several works attribute the high vulnerability to perturbations of deep nets to their low flexibility [9], high linearity [10], or flat decision boundaries [7], we show here that it is, on the contrary, the large curvature of the decision boundary that causes the vulnerability to universal perturbations. Our bounds indeed show an increasing vulnerability with respect to the curvature of the decision boundary, and represent the first formal result showing the tight links between robustness and large curvature. Finally, it should be noted that few works have recently studied properties of deep networks from a geometric perspective (such as their expressivity [13], [14]); our focus is however different as we analyze the robustness with the geometry of the decision boundary. II. D EFINITIONS AND NOTATIONS d Consider an L-class classifier f : R → RL . Given a datapoint x0 ∈ Rd , we define the estimated label k̂(x0 ) = argmaxk fk (x0 ), where fk (x) is the kth component of f (x) that corresponds to the k th class. We define by µ a distribution over natural images in Rd . The main focus of this paper is to analyze the robustness of classifiers to universal (image-agnostic) noise. Specifically, we define v to be a universal noise vector if k̂(x + v) 6= k̂(x) for “most” x ∼ µ. Formally, a perturbation v is (ξ, δ)-universal, if the following two constraints are satisfied: kvk2 ≤ ξ,  P k̂(x + v) 6= k̂(x) ≥ 1 − δ.  This perturbation image v is coined “universal”, as it represents a fixed image-agnostic perturbation that causes label change for a large fraction of images sampled from the data distribution µ. In [2], state-of-the-art classifiers have been shown to be surprisingly vulnerable to this simple perturbation regime. It should be noted that universal perturbations are different from adversarial perturbations [6], which are datapoint specific perturbations that are sought to fool a specific image. An adversarial perturbation is specifically defined as the solution of the following optimization problem r(x) = arg min krk2 subject to k̂(x + r) 6= k̂(x), r∈Rd (1) which corresponds to the smallest additive perturbation that is necessary to change the label of the classifier k̂ for x. From a geometric perspective, r(x) quantifies the distance from x to the decision boundary (see Fig. 1a). In addition, due to the optimality conditions of Eq. (1), r(x) is orthogonal to the decision boundary at x + r(x), as illustrated in Fig. 1a. In the remainder of the paper, we analyze the robustness of classifiers to universal noise, with respect to the geometry of the decision boundary of the classifier f . Formally, the pairwise decision boundary, when restricting the classifier to class i and j is defined by B = {z ∈ Rd : fi (z) − fj (z) = 0} (we omit the dependence of B on i, j for simplicity). The decision boundary of the classifier hence corresponds to points in the input space that are equally likely to be classified as i or j. In the following sections, we introduce two models on the decision boundary, and quantify in each case the robustness of such classifiers to universal perturbation. We then analyze the robustness of deep networks in light of the two models. 3 III. ROBUSTNESS OF CLASSIFIERS WITH FLAT DECISION BOUNDARIES Several recent works have attempted to explain the vulnerability of classifiers to different types of perturbations (e.g., random noise, and adversarial perturbations) by assuming a flat decision boundary model. We start here our analysis with a similar hypothesis, and analyze the robustness of classifiers to universal perturbations under this decision boundary model. We specifically study the existence of a universal direction v, such that k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x), (2) where v is a vector of sufficiently small norm. It should be noted that a universal direction (as opposed to a universal vector) is sought in Eq. (2), as this definition is more adapted to the analysis of linear classifiers. For example, while a binary linear classifier has a universal direction that fools all the data points, only half of the data points can be fooled with a universal vector (provided the classes are balanced) (see Fig. 1b). We therefore consider this slightly modified definition in the remainder of this section. We start our analysis by introducing our local decision boundary model. For x ∈ Rd , note that x + r(x) belongs to the decision boundary and r(x) is normal to the decision boundary at x + r(x) (see Fig. 1a). A linear approximation of the decision boundary of the classifier at x + r(x) is therefore given by x + {v : r(x)T v = kr(x)k22 }. Under this approximation, the vector r(x) hence captures the local geometry of the decision boundary in the vicinity of datapoint x. We assume a local decision boundary model in the vicinity of datapoints x ∼ µ, where the local classification region of x occurs in the halfspace r(x)T v ≤ kr(x)k22 . Equivalently, we assume that outside of this half-space, the classifier outputs a different label than k̂(x). However, since we are analyzing the robustness to universal directions (and not vectors), we consider the following condition, given by Ls (x, ρ) : ∀v ∈ B(ρ), |r(x)T v| ≥ kr(x)k22 =⇒ k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x). (3) where B(ρ) is a ball of radius ρ centered at 0. An illustration of this decision boundary model is provided in Fig. 2a. It should be noted that linear classifiers satisfy this decision boundary model, as their decision boundaries are globally flat. This local decision boundary model is however more general, as we do not assume that the decision boundary is linear, but rather that the classification region in the vicinity of x is included in x + {v : |r(x)T v| ≤ kr(x)k22 }. Fig. 2a provides an example of nonlinear decision boundary that satisfies this model. In all the theoretical results of this paper, we assume that kr(x)k2 = 1, for all x ∼ µ, for simplicity of the exposition. The results can be extended in a straightforward way to the case where kr(x)k2 takes different values for points sampled from µ. The following result shows that classifiers following the flat decision boundary model are not robust to small universal perturbations, provided the normals to the decision boundary (in the vicinity of datapoints) approximately belong to a low dimensional subspace of dimension m  d. Theorem 1. Let ξ ≥ 0, δ ≥ 0. Let S be an m dimensional subspace such thatkPS r(x)k2 ≥ 1 − ξ for almost all x ∼ µ,, where √ em PS is the projection operator on the subspace. Assume moreover that Ls (x, ρ) holds for almost all x ∼ µ, with ρ = δ(1−ξ) .   Then, there exists a universal noise vector v, such that kvk2 ≤ ρ and P k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) ≥ 1 − δ. x∼µ The proof can be found in the appendix, and relies on the construction of a universal perturbation through randomly sampling from S. The vulnerability of classifiers to universal perturbations can be attributed to the shared geometric properties of the classifier’s decision boundary in the vicinity of different data points. In the above theorem, this shared geometric property across different data points is expressed in terms of the normal vectors r(x) in the neighborhood of the decision boundary. The main assumption of the above theorem is specifically that normal vectors r(x) in the neighborhood of the decision boundary approximately live in a subspace S of low √ dimension m < d. Under this assumption, the above result shows the existence of universal perturbations √ of `2 norm of order m. When m  d, Theorem 1 hence shows that very small (compared to random noise, which scales as d [7]) universal perturbations misclassifying most data points can be found. Remark 1. Theorem 1 can be readily applied to assess the robustness of multiclass linear classifiers to universal perturbations. In fact, when f (x) = W T x, with W = [w1 , . . . , wL ], the normal vectors are equal to wi − wj , for 1 ≤ i, j ≤ L, i 6= j. These normal vectors exactly span a subspace of dimension L − 1. Hence, by applying the result √ with ξ = 0, and m = L − 1, we obtain that linear classifiers are vulnerable to universal noise, with magnitude proportional to L − 1. In typical problems, we have L  d, which leads to very small universal directions. Remark 2. Theorem 1 formalizes the empirical observations made in [2] and therefore provides a partial expalantion to the vulnerability of deep networks, provided a locally flat decision boundary model is assumed (which is the assumption in e.g., [7]). In fact, normal vectors in the vicinity of the decision boundary of deep nets have been observed to approximately span a subspace S. However, unlike linear classifiers, the dimensionality of this subspace m is typically larger than the the number of classes L, leading to large upper bounds on the norm of the universal noise, under the flat decision boundary model. This simplified model of the decision boundary hence fails to exhaustively explain the large vulnerability of state-of-the-art deep neural networks to universal perturbations. We show in the next section that the second order information of the decision boundary contains crucial information (curvature) that captures the high vulnerability to universal perturbations. 4 r r ρ x ρ (a) Flat decision boundary model Ls (x, ρ). x (b) Curved decision boundary model Q(x, ρ). Fig. 2: Illustration of the decision boundary models considered in this paper. (a): For the flat decision boundary model, the set {v : |r(x)T v| ≤ kr(x)k22 } is illustrated (stripe). Note that for v taken outside the stripe (i.e., in the grayed area), we have k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) in the ρ neighborhood. (b): For the curved decision boundary model, the any vector v chosen in the grayed area is classified differently from k̂(x). IV. ROBUSTNESS OF CLASSIFIERS WITH CURVED DECISION BOUNDARIES We now consider a model of the decision boundary in the vicinity of the data points that allows to leverage the curvature of nonlinear classifiers. Under this decision boundary model, we study the existence of universal perturbations satisfying k̂(x + v) 6= k̂(x) for most x ∼ µ.1 r(x) r(x) x v v x r(x) v x Fig. 3: Link between robustness and curvature of the decision boundary. When the decision boundary is positively curved (left), small universal perturbations are more likely to fool the classifier. We start by establishing an informal link between curvature of the decision boundary and robustness to universal perturbations, that will be made clear later in this section. As illustrated in Fig. 3, the norm of the required perturbation to change the label of the classifier along a specific direction v is smaller if the decision boundary is positively curved, than if the decision boundary is flat (or with negative curvature). It therefore appears from Fig. 3 that the existence of universal perturbations (when the decision boundary is curved) can be attributed to the existence of common directions where the decision boundary is positively curved for many data points. In the remaining of this section, we formally prove the existence of universal perturbations, when there exists common positively curved directions of the decision boundary. Recalling the definitions of Sec. II, a quadratic approximation of the decision boundary at z = x + r(x) gives x + {v : (z)k2 (v − r(x))T Hz (v − r(x)) + αx r(x)T (v − r(x)) = 0}, where Hz denotes the Hessian of F at z, and αx = k∇F kr(x)k2 , with F = fi − fj . In this model, the second order information (encoded in the Hessian matrix Hz ) captures the curvature of the decision boundary. We assume a local decision boundary model in the vicinity of datapoints x ∼ µ, where the local classification region of x is bounded by a quadratic form. Formally, we assume that there exists ρ > 0 where the following condition holds for almost all x ∼ µ: Q(x, ρ) : ∀v ∈ B(ρ), (v − r(x))T Hz (v − r(x)) + αx r(x)T (v − r(x)) ≤ 0 =⇒ k̂(x + v) 6= k̂(x). An illustration of this quadratic decision boundary model is shown in Fig. 2b. The following result shows the existence of universal perturbations, provided a subspace S exists where the decision boundary has positive curvature along most directions of S: 1 Unlike for linear classifiers, we now consider the problem of finding a universal vector (as opposed to universal direction) that fools most of the data points. This corresponds to the notion of universal perturbations first highlighted in [2]. 5 Theorem 2. Let κ q> 0, δ > 0 and m ∈ N. Assume that the quadratic decision boundary model Q (x, ρ) holds for almost all x ∼ µ, with ρ = 2 log(2/δ) κ−1 + κ−1/2 . Let S be a m dimensional subspace such that m   P ∀u ∈ R2 , αx−1 uT Hzr(x),v u ≥ κkuk22 ≥ 1 − β for almost all x ∼ µ, v∼S r(x),v Hz where = ΠT Hz Π with Π an orthonormal basis of span(r(x), v), and S denotes the unit sphere in S. Then, there is a  universal perturbation vector v such that kvk2 ≤ ρ and P k̂(x + v) 6= k̂(x) ≥ 1 − δ − β. x∼µ r x ρ v Tx B v r x U 1/κ Fig. 4: Left: Normal section U of the decision boundary, along the plane spanned by the normal vector r(x) and v. Right: Geometric interpretation of the assumption in Theorem 4. Theorem 4 assumes that the decision boundary along normal sections (r(x), v) is locally (in a ρ neighborhood) located inside a disk of radius 1/κ. Note the difference with respect to traditional notions of curvature, which express the curvature in terms of the osculating circle at x + r(x). The assumption we use here is more “global”. The above theorem quantifies the robustness of classifiers to universal perturbations in terms of the curvature κ of the decision boundary, along normal sections spanned by r(x), and vectors v ∈ S (see Fig. 4 (left) for an illustration of a normal section). Fig. 4 (right) provides a geometric illustration of the assumption of Theorem 4. Provided a subspace S exists where the curvature of the decision boundary in the vicinity of datapoints x is positive, Theorem 4 shows that universal perturbations −1 can be found with a norm of approximately κ√m + κ−1/2 . Hence, when the curvature κ is sufficiently large, the existence of small universal perturbations is guaranteed with Theorem 4.2 Remark 1. We stress that Theorem 4 does not assume that the decision boundary is curved in the direction of all vectors in Rd , but we rather assume the existence of a subspace S where the decision boundary is positively curved (in the vicinity of natural images x) across most directions in S. Moreover, it should be noted that, unlike Theorem 1, where the normals to the decision boundary are assumed to belong to a low dimensional subspace, no assumption is imposed on the normal vectors. Instead, we assume the existence of a subspace S leading to positive curvature, for points on the decision boundary in the vicinity of natural images. Remark 2. Theorem 4 does not only predict the vulnerability of classifiers, but it also provides a constructive way to find such universal perturbations. In fact, random vectors sampled from the subspace S are predicted to be universal perturbations (see the appendix for more details). In Section V, we will show that this new construction works remarkably well for deep networks, as predicted by our analysis. V. E XPERIMENTAL RESULTS : UNIVERSAL PERTURBATIONS FOR DEEP NETS We first evaluate the validity of the assumption of Theorem 4 for deep neural networks, that is the existence of a low dimensional subspace where the decision boundary is positively curved along most directions sampled from the subspace. To construct the subspace, we find the directions that lead to large positive curvature in the vicinity of a given set of training points {x1 , . . . , xn }. We recall that principal directions v 1 , . . . , v d−1 at a point z on the decision boundary correspond to the eigenvectors (with nonzero eigenvalue) of the matrix Hzt , given by Hzt = P Hz P , where P denotes the projection operator on the tangent to the decision boundary at z, and Hz denotes the Hessian of the decision boundary function evaluated at z [15]. Common directions with large average curvature at z i = xi + r(xi ) (where r(xi ) P is the minimal perturbation defined in Eq. n (1)) hence correspond to the eigenvectors of the average Hessian matrix H = n−1 i=1 Hzt i . We therefore set our subspace, Sc , to be the span of the first m eigenvectors of H, and show that the subspace constructed in this way satisfies the assumption 2 Theorem 4 should not be seen as a generalization of Theorem 1, as the models are distinct. In fact, while the latter shows the existence of universal directions, the former bounds the existence of universal perturbations. 6 Fig. 5: Visualization of normal cross-sections of the decision boundary, for ImageNet (CaffeNet, left) and CIFAR-10 (LeNet, right). Top: Normal cross-sections along (r(x), v), where v is the universal perturbation computed using the algorithm in [2]. Bottom: Normal cross-sections along (r(x), v), where v is a random vector uniformly sampled from the unit sphere in Rd . of Theorem 4, for a deep net (LeNet) trained on CIFAR-10 with n = 100. To determine whether the decision boundary is positively curved in most directions of Sc (for unseen datapoints from the validation set), we compute the average curvature across random directions in Sc for points on the decision boundary, i.e. z = x + r(x); the average curvature is formally given by   (P v)T Hx (P v) κS (x) = E , v∼S kP vk22 where S denotes the unit sphere in Sc . In Fig. 6 (a), the average of κS (x) across points sampled from the validation set is shown (as well as the standard deviation) in function of the subspace dimension m. Observe that when the dimension of the subspace is sufficiently small, the average curvature is strongly oriented towards positive curvature, which empirically shows the existence of this subspace Sc where the decision boundary is positively curved for most data points in the validation set. This empirical evidence hence suggests that the assumption of Theorem 4 is satisfied, and that universal perturbations hence represent random vectors sampled from this subspace Sc . To show this strong link between the vulnerability of universal perturbations and the positive curvature of the decision boundary, we now visualize normal sections of the decision boundary of deep networks trained on ImageNet (CaffeNet) and CIFAR-10 (LeNet) in the direction of their respective universal perturbations. Specifically, we visualize normal sections of the decision boundary in the plane (r(x), v), where v is a universal perturbation computed using the universal perturbations algorithm of [2]. The visualizations are shown in Fig. 5. Interestingly, the universal perturbations belong to highly positively curved directions of the decision boundary, despite the absence of any geometric constraint in the algorithm to compute universal perturbations. To fool most data points, universal perturbations hence naturally seek common directions of the embedding space, where the decision boundary is positively curved. These directions lead to very small universal perturbations, as highlighted by our analysis in Theorem 4. It should be noted that such highly curved directions of the decision boundary are rare, as random normal sections are comparatively very flat (see Fig. 5, second row). This is due to the fact that most principal curvatures are approximately zero, for points sampled on the decision boundary in the vicinity of data points. Recall that Theorem 4 suggests a novel way to procedure to generate universal perturbations; in fact, random perturbations from Sc are predicted to be universal perturbations. To assess the validity of this result, Fig. 6 (b) illustrates the fooling rate of the universal perturbations (for the LeNet network on CIFAR-10) sampled uniformly at random from the unit sphere in subspace Sc , and scaled to have a fixed norm (1/5th of the norm of the random noise required to fool most data points). We assess the quality of such perturbation by further indicating in Fig. 6 (b) the fooling rate of the universal perturbation computed using the algorithm in [2]. Observe that random perturbations sampled from Sc (with m small) provide very poweful universal perturbations, fooling nearly 85% of data points from the validation set. This rate is comparable to that of the algorithm in [2], while using much less training points (only n = 100, while at least 2, 000 training points are required by [2]). The very large fooling rates achieved with such a simple procedure (random generation in Sc ) confirms that the curvature is the governing factor that controls the robustness of classifiers to universal perturbations, as analyzed in Section IV. In particular, such high fooling rates cannot be achieved by only using the model of Section III (neglecting the curvature information), as illustrated in Fig. 6 (b). The existence of this subspace Sc (and that universal perturbations are random vectors in Sc ) further explains the high diversity of universal perturbations. Fig. 7 illustrates different universal perturbations for CIFAR-10 computed by sampling random directions from Sc . The diversity of such perturbations justifies why re-training with perturbed images (as in [2]) does not significantly improve the robustness of such networks, as other directions in Sc can still lead to universal perturbations, even if the network becomes robust to some directions. Finally, it is interesting to note that this subspace Sc is likely to be shared not only across datapoitns, but also different networks (to some extent). To support this claim, Fig. 8 shows the cosine 7 × 10 7 -4 0.9 0.85 6 0.8 5 0.75 0.7 4 0.65 3 0.6 0.55 2 1 Sc Sf 0.5 0 100 200 300 400 500 0.45 0 100 200 (a) 300 400 500 (b) Fig. 6: (a) Average curvature κS , averaged over 1000 validation datapoints, as a function of the subspace dimension. (b) Fooling rate of universal perturbations (on an unseen validation set) computed using random perturbations in 1) Sc : the subspace of positively curved directions, and 2) Sf : the subspace collecting normal vectors r(x). The dotted line corresponds to the fooling rate using the algorithm in [2]. Sf corresponds to the largest singular vectors corresponding to the matrix gathering the normal vectors r(x) in the training set (similar to the approach in [2]). Fig. 7: Diversity of universal perturbations randomly sampled from the subspace Sc . The normalized inner product between two perturbations is less than 0.1. 1 0.9 ScLeNet vs ScNiN Two random subspaces Cosine of Principal Angles 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 100 200 300 400 500 Fig. 8: Cosine of principal angles between ScLeNet and ScNiN . For comparison, cosine of angles between two random subspaces is also shown. of the principal angles between subspaces ScLeNet and ScNiN , computed for LeNet and NiN [16] models. Note that the first principal angles between the two subspaces are very small, leading to shared directions between the two subspaces. A similar observation is made for networks trained on ImageNet in the appendix. The sharing of Sc across different networks explains the transferability of universal perturbations observed in [2]. VI. C ONCLUSIONS In this paper, we analyzed the robustness of classifiers to universal perturbations, under two decision boundary models. We showed that classifiers satisfying the flat decision model are not robust to universal directions, provided the normal vectors in the vicinity of natural images are correlated. While this model explains the vulnerability for e.g., linear classifiers, this model discards the curvature information, which is essential to fully analyze the robustness of deep nets to universal perturbations. We show in fact that classifiers with curved decision boundaries are not robust to universal perturbations, provided the existence of a shared subspace along which the decision boundary is positively curved (for most directions). We empirically verify this 8 assumption for deep nets. Our analysis hence explains the existence of universal perturbations, and further provides a purely geometric approach for computing such perturbations, in addition to explaining many properties of perturbations, such as their diversity. Our analysis hence shows that to construct robust classifiers, it is key to suppress this subspace of shared positive directions, which can possibly be done through regularization of the objective function. This will be the subject of future works. Acknowledgments: We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan X Pascal GPU used for this research. This work has been partly supported by the Hasler Foundation, Switzerland, in the framework of the ROBERT project. A.F was supported by the Swiss National Science Foundation under grant P2ELP2-168511. S.S. was supported by ONR N00014-17-1-2072 and ARO W911NF-15-1-0564. R EFERENCES [1] A. Krizhevsky, I. Sutskever, and G. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in Neural Information Processing Systems (NIPS), pp. 1106–1114, 2012. [2] S.-M. Moosavi-Dezfooli, A. Fawzi, O. Fawzi, and P. Frossard, “Universal adversarial perturbations,” in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. [3] H. Xu, C. Caramanis, and S. Mannor, “Robustness and regularization of support vector machines,” The Journal of Machine Learning Research, vol. 10, pp. 1485–1510, 2009. [4] C. Caramanis, S. Mannor, and H. Xu, “Robust optimization in machine learning,” in Optimization for machine learning (S. Sra, S. Nowozin, and S. J. Wright, eds.), ch. 14, Mit Press, 2012. [5] G. Lanckriet, L. Ghaoui, C. Bhattacharyya, and M. Jordan, “A robust minimax approach to classification,” The Journal of Machine Learning Research, vol. 3, pp. 555–582, 2003. [6] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, “Intriguing properties of neural networks,” in International Conference on Learning Representations (ICLR), 2014. [7] A. Fawzi, S. Moosavi-Dezfooli, and P. Frossard, “Robustness of classifiers: from adversarial to random noise,” in Neural Information Processing Systems (NIPS), 2016. [8] M. Sharif, S. Bhagavatula, L. Bauer, and M. K. Reiter, “Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition,” in Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 1528–1540, ACM, 2016. [9] A. Fawzi, O. Fawzi, and P. Frossard, “Analysis of classifiers’ robustness to adversarial perturbations,” arXiv preprint arXiv:1502.02590, 2015. [10] I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and harnessing adversarial examples,” in International Conference on Learning Representations (ICLR), 2015. [11] P. Tabacof and E. Valle, “Exploring the space of adversarial images,” IEEE International Joint Conference on Neural Networks, 2016. [12] T. Tanay and L. Griffin, “A boundary tilting persepective on the phenomenon of adversarial examples,” arXiv preprint arXiv:1608.07690, 2016. [13] B. Poole, S. Lahiri, M. Raghu, J. Sohl-Dickstein, and S. Ganguli, “Exponential expressivity in deep neural networks through transient chaos,” in Advances In Neural Information Processing Systems, pp. 3360–3368, 2016. [14] G. F. Montufar, R. Pascanu, K. Cho, and Y. Bengio, “On the number of linear regions of deep neural networks,” in Advances In Neural Information Processing Systems, pp. 2924–2932, 2014. [15] J. M. Lee, Manifolds and differential geometry, vol. 107. American Mathematical Society Providence, 2009. [16] M. Lin, Q. Chen, and S. Yan, “Network in network,” in International Conference on Learning Representations (ICLR), 2014. [17] S. Dasgupta and A. Gupta, “An elementary proof of a theorem of johnson and lindenstrauss,” Random Structures & Algorithms, vol. 22, no. 1, pp. 60–65, 2003. [18] J. Matousek, Lectures on discrete geometry, vol. 108. Springer New York, 2002. 9 A PPENDIX We first start by recalling a result from [7], which is based on [17]. Lemma 1. Let v be a random vector uniformly drawn from the unit sphere Sd−1 , and Pm be the projection matrix onto the first m coordinates. Then,  m m ≥ 1 − 2δ, (4) P β1 (δ, m) ≤ kPm vk22 ≤ β2 (δ, m) d d q p with β1 (δ, m) = max((1/e)δ 2/m , 1 − 2(1 − δ 2/m ), and β2 (δ, m) = 1 + 2 ln(1/δ) + 2 ln(1/δ) . m m We use the above lemma to prove our result, which we recall as follows: Theorem 3. Let ξ ≥ 0, δ ≥ 0. Let S be an m dimensional subspace such thatkPS r(x)k2 ≥ 1 − ξ for almost all √ x ∼ µ,, where PS is the em projection operator on the subspace. Assume moreover that Ls (x, ρ) holds for almost all x ∼ µ, with ρ = δ(1−ξ) . Then, there exists a   universal noise vector v, such that kvk2 ≤ ρ and P k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) ≥ 1 − δ. x∼µ √ em Proof. Define S to be the unit sphere centered at 0 in the subspace S. Let ρ = δ(1−ξ) , and denote by ρS the sphere scaled by ρ. We have    E P k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) v∼ρS x∼µ    = E P k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) x∼µ v∼ρS    ≥ E P |r(x)T v| − kr(x)k22 ≥ 0 x∼µ v∼ρS    = E P |(PS r(x) + PS orth r(x))T v| − kr(x)k22 ≥ 0 , x∼µ v∼ρS where PS orth denotes the projection operator on the orthogonal of S. Observe that (PS orth r(x))T v = 0. Note moreover that kr(x)k22 = 1 by assumption. Hence, the above expression simplifies to    T E P |(PS r(x)) v| − 1 ≥ 0 x∼µ v∼ρS    = E P |(PS r(x))T v| ≥ ρ−1 x∼µ v∼S    (PS r(x))T δ ≥ E P v ≥ √ , x∼µ v∼S kPS r(x)k2 em where we have used the assumption of the projection of r(x) on the subspace S. Hence, it follows from Lemma 1 that    ≥ 1 − δ. E P k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) v∼ρS x∼µ Hence, there exists a universal vector v of `2 norm ρ such that P x∼µ   k̂(x + v) 6= k̂(x) or k̂(x − v) 6= k̂(x) ≥ 1 − δ. Theorem q 4. Let κ > 0, δ > 0 and m ∈ N. Assume that the quadratic decision boundary model Q (x, ρ) holds for almost all x ∼ µ, with ρ = 2 log(2/δ) κ−1 + κ−1/2 . Let S be a m dimensional subspace such that m   P ∀u ∈ R2 , αx−1 uT Hzr(x),v u ≥ κkuk22 ≥ 1 − β for almost all x ∼ µ, v∼S r(x),v Hz T where = Π Hz Π with Π an orthonormal basis of span(r(x),v), and S denotes the unit sphere in S. Then, there is a universal perturbation vector v such that kvk2 ≤ ρ and P k̂(x + v) 6= k̂(x) ≥ 1 − δ − β. x∼µ Proof. Let x ∼ µ. We have    k̂(x + v) 6= k̂(x) v∼ρS x∼µ    = E P k̂(x + v) 6= k̂(x) x∼µ v∼ρS    ≥ E P αx−1 (v − r)T Hz (v − r) + r T (v − r) ≥ 0 x∼µ v∼ρS    = E P αx−1 (ρv − r)T Hz (ρv − r) + r T (ρv − r) ≥ 0 E x∼µ P v∼S 10 Using the assumptions of the theorem, we have   P αx−1 (ρv − r)T Hz (ρv − r) + r T (ρv − r) ≤ 0 v∼S   ≤ P κkρv − rk22 + r T (ρv − r) ≤ 0 + β v∼S   ≤ P ρ(1 − 2κ)v T r + κρ2 + (κ − 1) ≤ 0 + β v∼S    ≤ P ρ(1 − 2κ)v T r ≤ − + P κρ2 + (κ − 1) ≤  + β, v∼S v∼S 2  for  > 0. The goal is therefore to find ρ such that κρ + (κ − 1) ≥ , together with P ρ(1 − 2κ)v T r ≤ − ≤ δ. Let ρ2 = v∼S the concentration of measure on the sphere [18], we have     − m2 P vT r ≤ ≤ 2 exp − 2 . v∼S ρ(1 − 2κ) 2ρ (1 − 2κ)2 p To bound the above probability by δ, we set  = C √ρm , where C = 2 log(2/δ). We therefore choose ρ such that   ρ2 = κ−1 Cρm−1/2 + 1 +1 . κ Using The solution of this second order equation gives ρ= Cκ−1 m−1/2 + √ κ−2 C 2 m−1 + 4κ−1 ≤ Cκ−1 m−1/2 + κ−1/2 . 2 Hence, for this choice of ρ, we have by construction   P αx−1 (ρv − r)T Hz (ρv − r) + r T (ρv − r) ≤ 0 ≤ δ + β. v∼S  We therefore conclude that E v∼ρS  P x∼µ k̂(x + v) 6= k̂(x)  ≥ 1 − δ − β. This shows the existence of a universal noise vector v ∼ ρS such that k̂(x + v) 6= k̂(x) with probability larger than 1 − δ − β. Fig. 9: Transferability of the subspace Sc across different networks. The first row shows normal cross sections along a fixed direction in Sc for VGG-16, with a subspace Sc computed with CaffeNet. Note the positive curvature in most cases. To provide a baseline for comparison, the second row illustrates normal sections along random directions. Fig. 9 shows examples of normal cross-sections of the decision boundary across a fixed direction in Sc , for the VGG-16 architecture (but where Sc is computed for CaffeNet). Note that the decision boundary across this fixed direction is positively curved for both networks, albeit computing this subspace for a distinct network. The sharing of Sc across different nets explains the transferability of universal perturbations observed in [2].
2cs.AI
BATCH CODES FROM HAMMING AND REED-MÜLLER CODES arXiv:1710.07386v1 [cs.IT] 20 Oct 2017 TRAVIS BAUMBAUGH, YARIANA DIAZ, SOPHIA FRIESENHAHN, FELICE MANGANIELLO, AND ALEXANDER VETTER Abstract. Batch codes, introduced by Ishai et al. encode a string x ∈ Σk into an m-tuple of strings, called buckets. In this paper we consider multiset batch codes wherein a set of t-users wish to access one bit of information each from the original string. We introduce a concept of optimal batch codes. We first show that binary Hamming codes are optimal batch codes. The main body of this work provides batch properties of Reed-Müller codes. We look at locality and availability properties of first order Reed-Müller codes over any finite field. We then show that binary first order Reed-Müller codes are optimal batch codes when the number of users is 4 and generalize our study to the family of binary Reed-Müller codes which have order less than half their length. 1. Introduction Consider the situation where a certain amount of data, such as information to be downloaded, is distributed over a number of devices. We could have multiple users who wish to download this data. In order to reduce wait time, we look at locally repairable codes with availability as noted in [4]. A locally repairable code, with locality r and availability δ, provides us the opportunity to reconstruct a particular bit of data using δ disjoint sets of size at most r [11]. When we want to reconstruct a certain bit of information, this is the same as a Private Information Retrieval (PIR) code. However, we wish to examine a scenario where we reconstruct not necessarily distinct bits of information. A possible answer to the more complex scenario seems to be a family of codes called batch codes, introduced by Ishai et al. in [6]. Batch codes were originally studied as a schematic for distributing data across multiple devices and minimizing the load on each device and total amount of storage. We study (n, k, t, m, τ ) batch codes, where n is the code length, k is the dimension of the code, t is the number of bits we wish to retrieve, m is the number of buckets, and τ is the maximum number of bits used from each bucket for any reconstruction of t bits. In this paper we seek to minimize the number of devices in the system and the load on each device while maximizing the amount of reconstructed data. In other words, we want to minimize mτ while maximizing t. In Section 2, we formally introduce batch codes and summarize results from previous work on batch codes. We then introduce the concepts of locality and availability of a code. We conclude the section by introducing a concept of optimal batch codes. After the background, we study the batch properties of binary Hamming codes and Reed-Müller codes. Section 3 focuses on batch properties of binary Hamming codes. We show that Hamming codes are optimal (2s−1 , 2s − 1 − s, 2, m, τ ) batch codes for m, τ ∈ N such that mτ = 2s−1 . Section 4 is the main body of this work and provides batch properties of Reed-Müller codes. We first study the induced batch properties of a code C given that C ⊥ is of a (u | u+v)-code construction 1 with determined batch properties. In Section 4.1 we study the locality and availability properties of first order Reed-Müller codes over any finite field. We find that the locality of RM j q (1, k µ) is 2 when q 6= 2 and 3 when the q = 2. Furthermore, we also show that its availability is 2µ −1 3 q µ −1 2 when q 6= 2, 2µ −4 4 whereas when q = 2, the availability is if µ is even and at least otherwise. In Section 4.2 we show that binary first order Reed-Müller codes are optimal batch codes for t = 4. We first look at the specific RM(1, 4) case and achieve parameters (16, 5, 4, m, τ ) such that mτ = 10. We then prove a general result that any Reed-Müller code with ρ = 1 and µ ≥ 4 has batch properties (2µ , µ + 1, 4, m, τ ) for any m, τ ∈ N such that mτ = 10. Finally, in Section 4.3 we generalize our study of Reed-Müller codes and look at properties of RM(ρ, µ) for all values of ρ and conclude our study by presenting batch properties (2µ , k, 4, m, τ ) such that mτ = 10 · 22ρ−2 for RM(ρ′ , µ) where µ ∈ {2ρ + 2, 2ρ + 3} and ρ′ ≤ ρ. 2. Background In 2004, Ishai et al. [6] introduced the following definition of batch codes: Definition 2.1. An (n, k, t, m, τ ) batch code over an alphabet Σ encodes a string x ∈ Σk into an m-tuple of strings, called buckets, of total length n such that for each t-tuple of distinct indices, i1 , . . . , it ∈ [k], the entries xi1 , . . . , xit can be decoded by reading at most τ symbols from each bucket. We can view the buckets as servers and the symbols used from each bucket as the maximal load on each server. In the above scenario, a single user is trying to reconstruct t bits of information. This definition naturally leads to the concept of multiset batch codes which have nearly the same definition as above, but the indices i1 , . . . , ik ∈ [k] are not necessarily distinct. This means we have t users who each wish to reconstruct a single element. This definition in turn relates to private information retrieval (PIR) codes which are similar to batch codes but instead look to reconstruct the same bit of information t times. Another notable type of batch code defined in [6] is a primitive multiset batch code where the number of buckets is m = n. The following are useful lemmas proven in [6]: Lemma 2.2. An (n, k, t, m, τ ) batch code for any τ implies an (nτ, k, t, mτ, 1) batch code. Lemma 2.3. An (n, k, t, m, 1) batch code implies an (n, k, t, ⌈ m τ ⌉, τ ) batch code. Much of the related research involves primitive multiset batch codes with a systematic generator matrix. In [6], the authors give results for some multiset batch codes using subcube codes and ReedMüller codes. They use a systematic generator matrix, which often allows for better parameters. Their goal was to maximize the efficiency of the code for a fixed number of queries t. The focus of research on batch codes then shifted to combinatorial batch codes. These were first introduced by [9]. They are replication based codes using various combinatorial objects that allow for efficient decoding procedures. We do not consider combinatorial batch codes but some relevant results can be found in [9], [2], [3], and [10]. Next, the focus of research turned to linear batch codes, which use classical error-correcting codes. The following useful results are proven in [7]: 2 Theorem 2.4. Let C be an [n, k, t, n, 1] linear batch code over F2 with generator G. Then, G is a generator matrix of the classical error-correcting [n, k, d]2 linear code where d ≥ t. Theorem 2.5. Let C1 be an [n1 , k, t1 , n, 1]q linear batch code and C2 be an [n2 , k, t2 , n2 , 1]q linear batch code. Then, there exists an [n1 + n2 , k, t1 + t2 , n1 + n2 , 1]q linear batch code. Theorem 2.6. Let C1 be an [n1 , k1 , t1 , n1 , 1]q linear batch code and C2 be an [n2 , k2 , t2 , n2 , 1]q linear batch code. Then, there exists an [n1 + n2 , k1 + k2 , min(t1 , t2 ), n1 + n2 , 1]q linear batch code. Because of the vast amount of information on classical error-correcting codes, we use these as our central focus in this paper. As is often the case, studying the properties of the dual codes helps us find efficient batch codes. Next, [12] considers restricting the size of reconstruction sets. These are similar to codes with locality and availability: Definition 2.7. A code C has locality r ≥ 1 if for any c ∈ C, any entry in c can be recovered by using at most r other entries of c. Definition 2.8. A code C with locality r ≥ 1 has availability δ ≥ 1 if for any c ∈ C, any entry of c can be recovered by using one of δ disjoint sets of at most r other entries of y In [12], linear multiset batch codes with restricted reconstruction sets were presented. The restriction on the size of reconstruction sets can be viewed as trying to minimize total data distribution. We restrict the size of our reconstruction sets to the locality of the code. By using this restriction, we find multiset batch codes with optimal data distribution. For cyclic codes, the locality can be derived from the following in [5]: Lemma 2.9. Let C be an [n, k, d] cyclic code, and let d′ be the minimum distance of its dual code C ⊥ . Then, the code C has all symbol locality d′ − 1. This relies on each entry being in the support of a minimal weight dual code word. We generalize this lemma to the following one. Lemma 2.10. Let C ⊆ Fnq be a linear code and let d′ be the minimum distance of C ⊥ . If C ⊥ is generated by its minimum weight codewords and [ (1) supp(λ) = [n], λ∈C ⊥ then C has all symbol locality d′ − 1. Proof. Condition (1) implies that no coordinate of C is independent on the others. If the minimum weight codewords generate C ⊥ , then each coordinate of C is in the support of at least one minimum weight codeword of C ⊥ . This implies the all symbol locality d′ − 1 of C.  Condition (1) is a reasonable condition for a code. Without it the code C would have non recoverable coordinates. We give here a bound that relates the locality property of a linear code with its batch properties. 3 Lemma 2.11. Let C be an [n, k, t, m, τ ] linear batch code with minimal locality r. Then it holds that (2) mτ ≥ (t − 1)r + 1. Proof. We consider such a code C. If each entry has at least one reconstruction set with fewer than r elements, then by the definition of locality, C has locality less than r, a contradiction to r being the minimal locality. Therefore, there exists at least one entry for which all recovery sets are of size at least r. If we wish to recover this entry t times, then we may read the entry itself and then make use of t − 1 disjoint recovery sets, each of size r. This implies reading at least (t − 1)r + 1 entries, and since we may read only τ entries from each of the m buckets, we must have that mτ ≥ (t − 1)r + 1.  From the perspective of individual devices storing bits of data, mτ represents the total amount of data read to provide t pieces of the original data. To minimize bandwidth usage in the case where the entries of a codeword represent nodes on a network, we must minimize mτ . Definition 2.12. A [n, k, t, m, τ ] linear batch code C with minimal locality r is optimal if it satisfies Condition (2) with equality. We show now that Hamming codes are optimal linear batch codes. 3. Hamming Codes Hamming codes were first introduced in 1950 by Richard Hamming. In what follows, we consider binary Hamming odes over F2 . The parameters of binary Hamming codes are shown in [8]. s Definition 3.1. For some s ≥ 2, let H ∈ F22 −1×s be a matrix whose columns are all of the nonzero vectors of Fs2 . Let n = 2s − 1. We use H as our parity check matrix and define the binary Hamming Code: Hs := {c ∈ Fn2 | cH T = 0} It is well-known that Hs is a [2s − 1, 2s − 1 − s, 3] cyclic code. Its dual code, the simplex code, is a [2s − 1, s, 2s−1 ] cyclic code. Thus, by Lemmma 2.9, the locality of Hs is 2s−1 − 1. We now present the batch properties of binary Hamming Codes. Hamming codes are optimal linear batch codes. Theorem 3.2. A binary [n = 2s − 1, k = 2s − 1 − s] Hamming code is an optimal batch code with properties [2s − 1, 2s − 1 − s, 2, m, τ ], for any m, τ ∈ N such that mτ = 2s−1 . Proof. First, note that mτ ≥ (2 − 1)(2s−1 − 1) + 1 = 2s−1 . The buckets for m = 2s−1 , τ = 1 are constructed as follows. Let H be the parity check matrix of a binary Hamming code, H, with columns hj ∈ Fs2 for 1 ≤ j ≤ n. If ha + hb = 1 (the all ones column), then we place a and b into the same bucket. Note that because hℓ = 1 in H, ℓ is placed into its own bucket. Let rd ∈ Fn2 be the P rows in H such that 1 ≤ d ≤ (n − k) = s. For any c ∈ H, rd · cT = 0, and thus i∈supp(rd ) ci = 0. As a result of this construction, if a, b ∈ supp(rd ), then entry d of ha + hb is 0, so a and b cannot P be in the same bucket. Therefore, i∈supp(rd ) ci = 0 only involves bits in separate buckets. Hence, 4 any bit in a codeword can be written as a linear combination of bits in separate buckets. Now, we show how to reconstruct any two bits of information. • Case 1: If a and b are in separate buckets, then use ca and cb . • Case 2: Suppose a and b are in the same bucket. We can take ca itself. To construct cb , we P choose an rd such that b ∈ supp(rd ). Then, we can write cb = i∈supp(rd )\{b} ci , which we know only contains bits in disjoint buckets. Every bucket has cardinality 2 aside from the bucket corresponding to the all ones column in H, so this construction gives us exactly 2s−1 buckets. Thus, we have shown that the batch properties hold for m = 2s−1 and τ = 1. Further, Lemma 2.3 implies that this is true for any m, τ such that mτ = 2s−1 . Note that the locality of H is 2s−1 − 1, and therefore, t = 2 is also maximal. Suppose instead that we could have t ≥ 3. Then in particular, each entry must be reconstructible at least 3 times. We may take the entry itself, but then there must be at least 2 other reconstruction sets used which are disjoint and of size 2s−1 − 1. These would correspond to two codewords in the dual code of weight 2s−1 with the intersection of their support being only the given entry. The sum of these codewords will thus have weight 2s−1 + 2s−1 − 2 = 2s − 2. However, the all ones vector is also in the dual code. Adding this vector to the sum will produce a codeword of weight one, a contradiction. Thus, t = 2 is maximal.  Example 3.3. We now give an example for s = 3. This Hamming Code is a [7, 4]-linear code, and the dual code is a [7, 3]-linear code. The parity check matrix H is as follows:   1 0 1 0 1 0 1   H = 0 1 1 0 0 1 1 0 0 0 1 1 1 1 Thus, the buckets are: {1, 6}, {2, 5}, {3, 4}, {7} We note that for general batch codes we are only interested in reconstructing information bits. However, we are able to obtain any pair of bits in the codeword. Additionally, we note that although mτ is optimized, we wish to find batch codes where t > 2. We desire a larger value as we are concerned with practical applications, and the goal is to quickly distribute data. Thus we move on to Reed-Müller codes, where we are able to obtain larger t values. 4. Reed-Müller Codes Reed-Müller codes are well known linear codes. We give some basic properties of these codes but an interested reader can find more information in [1]. Definition 4.1. Let Fq [X1 , . . . , Xµ ] be the ring of polynomials in µ variables with coefficients in Fq and let Fµq = {P1 , . . . , Pn } (so n = q µ ). The q-ary Reed-Müller code, RMq (ρ, µ) is defined as: RMq (ρ, µ) := {(f (P1 ), . . . , f (Pn )) | f ∈ Fq [X1 , . . . , Xµ ]ρ }, 5 where Fq [X1 , . . . , Xµ ]ρ is the set of all multivariate polynomials over Fq of total degree at most ρ. It is known that if ρ < µ(q−1) then the dual of a Reed-Müller code RMq (ρ, µ) is the Reed-Müller code RMq (µ(q − 1) − 1 − ρ, µ) [1]. In the binary case, Reed-Müller codes can be equivalently defined using the (u | u + v)-code construction. For completeness, we first give a description of the (u | u + v)-code construction and the related generator matrix, which can be found in [8]. Definition 4.2. Given two linear codes C1 , C2 with identical alphabets and block lengths, we construct a new code C as follows: C := {(u | u + v) | u ∈ C1 , v ∈ C2 }. Let G, G1 , and G2 be the generator matrices for the codes C, C1 , and C2 , respectively, where C is obtained from C1 and C2 via the (u | u + v)-construction. Then we have ! G1 G1 G := 0 G2 From this, we have the following proposition. Proposition 4.3. Let C1 be an [n, k1 , d1 ]-linear code, C2 an [n, k2 , d2 ]-linear code, and C the code obtained from C1 , C2 via the (u | u + v)-construction. Then, C is an [2n, k, d]-code where k = k1 + k2 and d = min{2d1 , d2 }. Later, our focus will be on q = 2, so when referring to RM2 (ρ, µ) we omit the 2 for convenience. We obtain the following equivalent definition of a binary Reed-Müller code. Definition 4.4. Let ρ < µ. A binary Reed-Müller code RM(ρ, µ) is defined as follows: RM(ρ, µ) := {(u | u + v) | u ∈ RM(ρ, µ − 1), v ∈ RM(ρ − 1, µ − 1)} where RM(0, µ) := 1 of length 2µ , and RM(µ, µ) := I2µ . As a consequence if Gρ,µ is the generator matrix of the code RM(ρ, µ), then ! Gρ,µ−1 Gρ,µ−1 Gρ,µ := 0 Gρ−1,µ−1 We now examine the batch properties of the (u | v + u)-code construction. The first notable result comes from codes that are contained in other codes: Theorem 4.5. Let C1 , C2 be codes of length n and dimension k1 and k2 , respectively such that C2 ⊆ C1 . If C1 is a (n, k1 , t, m, τ ) batch code, then C2 is a (n, k2 , t, m, τ ) batch code. Proof. Note that C2⊥ ⊆ C1⊥ because C1 ⊆ C2 . Therefore the same parity check equations for C2 apply to C1 . Thus, to recover information in C1 , we may use the same parity check equations we would in C2 , which implies C1 is at least a (n, k1 , t, m, τ ) batch code.  We now introduce results for a (u | u + v)-code construction. 6 Theorem 4.6. Let n, k1 , k2 ∈ N such that n ≥ k1 ≥ k2 , and let C be a [n, k1 + k2 ] linear code. Then let C ⊥ be a (u | u + v)-code construction of C1⊥ and C2⊥ , where • C1 ⊥ is an [n, n − k1 ] linear code and C2 ⊥ is an [n, n − k2 ] linear code, and • C2⊥ ⊆ C1⊥ . If C2 is a (n, k, t, mτ ) batch code, then C is a (2n, k1 + k2 , t, m, τ ) batch code. Proof. The first two parameters of C follow from the definition of a (u | u + v) construction. Let C be constructed as described, and let C2 be an (n, k, t, m, τ ) batch code. Then consider any t-tuple of indices i1 , . . . , it ∈ [2n] and let i′j = ij if ij ∈ [n] and i′j = ij − n otherwise. Then we know that i′1 , . . . , i′t ∈ [n], and so by the batch properties of C2 there exist t disjoint recovery sets for the entries in these indices, the union of which consists of at most τ entries in each of the m buckets. If for all i ∈ {n + 1, . . . , 2n}, we place i in the same bucket as i − n, then this results in m buckets for C. If we consider the recovery sets from above, if Ri′j is the recovery set for i′j , and ij ∈ [n], then we claim that Ri′ ′ = Ri′j is a recovery set for ij in C. This is because the recovery set comes from j a vector v ∈ C2⊥ , and by construction, since C2⊥ ⊆ C1⊥ , we have that (v|0), (0|v) ∈ C ⊥ . Likewise, if ij ∈ / [n], then by using (0|v), we find that Ri′ ′ = {i + n|i ∈ Ri′j } is a recovery set for ij . j Since the original Ri′j are all disjoint, so are the Ri′ ′ , and so we have t disjoint recovery sets, j the union of which consists of at most τ elements from each of m buckets, and so C is a (2n, k1 + k2 , t, m, τ ) batch code.  Because binary Reed-Müller codes have parity check matrices that satisfy the above properties, we turn to that family of codes. 4.1. Locality and availability properties of RMq (1, µ). Reed-Müller codes for which ρ = 1 are known as first order Reed-Müller codes. We look at the properties using the polynomial evaluation definition of Reed-Müller codes. We begin with a result in the q-ary case. Theorem 4.7. Let Fµq = {Pi | 1 ≤ i ≤ 2µ = n} be the set of evaluation points for RMq (1, µ). Then (λ1 , . . . , λn ) ∈ RMq (1, µ)⊥ if and only if (3) n X λi Pi = 0 and n X λi = 0. i=1 i=1 Proof. First, if (λ1 , . . . , λn ) is in the dual code, then by definition, n X (4) λi f (Pi ) = 0 i=1 for every polynomial f ∈ Fq [x1 , . . . , xµ ]1 . In particular, note that for any 1 ≤ k ≤ µ, from fk (x1 , . . . , xµ ) = xk , we have n n X X λi pi,k = 0, λi fk (Pi ) = i=1 i=1 where pi,k is the kth entry of point Pi . We may gather these equations together for 1 ≤ k ≤ µ to write the linear combination n X λi Pi = 0. i=1 7 We then consider f0 = 1, and Equation (4) becomes For the other direction, assume that n X λi Pi = 0 and Pn i=1 λi n X = 0, and so we have this direction. λi = 0. i=1 i=1 P Then in particular, for any 1 ≤ k ≤ µ, we have ni=1 λi pi,k = 0, and so for any f ∈ Fq [x1 , . . . , xµ ]1 , by linearity we have that " # µ µ n n n n X X X X X X λi pi,k = 0, λi + λi f 0 + fk fk pi,k = f0 λi f (Pi ) = i=1 i=1 i=1 k=1 k=1 i=1 and thus (λ1 , . . . , λµ ) ∈ RM(1, µ)⊥ .  From Theorem 4.7 we obtain the following corollaries: Corollary 4.8. The minimum distance of RMq (1, µ)⊥ is 4 if q = 2 and 3 otherwise. Proof. Let q = 2 and suppose by way of contradiction that the minimum weight is 2. Then there exist two distinct points that sum to zero. This is not possible, and thus the minimum weight must be greater than 2. Note that the only choice of λi is 1, and thus the sum is 0 if and only if there are an even number of points. Therefore, the weight of the codewords is a multiple of 2, and thus the minimum weight is not 3. The following points are in P (for µ ≥ 2): P0 = (0, 0, 0, . . . , 0)T , P1 = (1, 0, 0, . . . , 0)T , P2 = (0, 1, 0, . . . , 0)T , and P3 = P1 + P2 . These points satisfy the conditions, and thus the minimum distance for characteristic 2 is 4. If instead q 6= 2, let P1 = (0, 0, 0, 0, . . . , 0)T , P2 = (1, 0, 0, 0, . . . , 0)T , P3 = (−a, 0, 0, 0, . . . , 0)T ∈ µ Fq and the entries of λ be −(a + 1), a, and 1 corresponding to the positions of P1 , P2 , and P3 , respectively, and 0 otherwise. Then, If a 6= −1, 0, λ satisfies Equations (3). Suppose there exists a λ ∈ RMq (1, µ)⊥ with weight 2. Then we have two distinct points Pi , Pj ∈ Fµq and λi , λj ∈ Fq such that λj = −λi and λk = 0 for all k 6= i, j. Our two conditions imply: λi Pi − λi Pj = 0 =⇒ Pi = Pj , A contradiction to the two points being distinct.  Corollary 4.9. When q = 2, every codeword in RM(ρ, µ) satisfies Theorem 4.7 for ρ ≤ µ − 2. Proof. The dual code of RM(1, µ) is RM(µ − 2, µ) and RM(ρ1 , µ) ⊂ RM(ρ2 , µ) if ρ1 < ρ2 . Thus, any codeword in RM(ρ, µ) is also in RM(µ − 2, µ). Therefore, Theorem 4.7 implies our claim.  j µ k Theorem 4.10. Let q 6= 2. Then RMq (1, µ) has locality 2 and availability δ = q 2−1 . Proof. Let Pa ∈ Fµq be an evaluation point. Then consider any α ∈ Fq such that α 6= 0, −1. We have that 1 + α + (−α − 1) = 0, and will find corresponding points to use in the reconstruction of Pa . For any choice of Pb ∈ Fµq , Pb 6= Pa , take Pc = (α + 1)−1 (Pa + αPb ). 8 Upon rearrangement, we have that Pa +αPb +(−α−1)Pc = 0. Furthermore, we find that Pc 6= Pa , Pb . If Pc = Pa , then our equation becomes Pa +αPb +(−α−1)Pa = 0, which simplifies to αPb −αPa = 0, which would contradict Pb 6= Pa . Likewise, Pc = Pb would imply Pa + αPb + (−α − 1)Pb = 0, which becomes j k Pa − Pb = 0, another contradiction. A simple counting argument tells us that there are q µ −1 choices of pairs Pb , Pc for Pa , and each of these corresponds to a unique λ ∈ RMq (1, µ)⊥ 2 of weight 3 that can be used to recover j µ cka , the supports of which intersect only in {a}. Thus, the locality is 2 and the availability is q 2−1 .  As proven in [1] the minimum-weight codewords are generators of a Reed-Müller code RMps (µ, ρ) where p is a prime number and 0 ≤ ρ ≤ µ(ps − 1) if and only if either m = 1 or µ = 1 or ρ < p or ρ > (µ − 1)(ps − 1) + ps−1 − 2. Together with Lemma 2.10 it follows that these Reed-Müller codes have all symbol availability. Thus, in the following theorems, we only consider the availability of P1 as this implies all symbol availability. Theorem 4.11. RM(1, µ) has availability δ = 2µ −1 3 when µ is even. Proof. An inductive argument on µ satisfies this claim. We look at the sum of evaluation points to µ prove our claim. We are looking for 2 3−1 disjoint sets of three points of Fµq that sum to (0, . . . , 0)T ∈ Fµq . It is easy to verify the claim for µ = 2 since there is only one equation for which this is true (0, 1)T + (1, 0)T + (1, 1)T = (0, 0)T . 2k Now assume the claim is true for µ = 2k, we show that it is true also for µ = 2k+2. We have 2 3−1 T 2k+2 . disjoint sets of three points that all sum to P̄1 = (0, . . . , 0)T ∈ F2k q . Let P1 = (0, . . . , 0) ∈ Fq 2k For any choice of set of points {S1 , S2 , S3 } ⊂ F2k q that sum to P̄1 in Fq it holds that (S1T |0, 0)T + (S2T |0, 0)T + (S3T |0, 0)T = P1 (5) (S1T |1, 0)T + (S2T |0, 1)T + (S3T |1, 1)T = P1 (S1T |0, 1)T + (S2T |1, 1)T + (S3T |1, 0)T = P1 (S1T |1, 1)T + (S2T |1, 0)T + (S3T |0, 1)T = P1 . Additionally it also holds that (6) (P̄1T |1, 1)T + (P̄1T |1, 0)T + (P̄1T |0, 1)T = P1T . The four equations in (5) all use distinct sets of points because S1 , S2 , and S3 are distinct. Now, 2k there are 2 3−1 sets of distinct points like S1 , S2 , and S3 . Thus, we have a total of 22k+2 − 1 22k − 1 +1= . 3 3 Note that the extra one comes from Equation (6). Also note that our total is an integer as 4· 22k+2 ≡ 4k+1 ≡ 1k+1 ≡ 1 (mod 3). Because of this, every single coordinate is used, and thus we have maximal availability. Theorem 4.12. RM(1, µ) has availability δ at least 9 2µ −4 4 when µ is odd.  Proof. We prove this by induction on µ. For µ = 3, let S1 = (1, 0, 0)T , S2 = (0, 1, 0)T and S3 = S1 + S2 , then S1 + S2 + S3 = P̄1 = (0, 0, 0)T . 3 No combination of the four remaining points of F32 sum to P̄1 . Here we have availability 1 = 2 4−4 , and so we have our base case. Now assume that, for µ = 2k + 1, where k ≥ 1, we have that the availability of RM(1, µ) is at µ least 2 4−4 , and there are at least 3 points that are not used in any recovery set for P1 . Let S1 , S2 , and S3 be any three points in a recovery set of P1 ∈ Fµ2 . Then for µ + 2, the disjoint sets of three points that sum to P̃1 = (0, . . . , 0) ∈ Fµ+5 can be defined by the equations: 2 (S1T |0, 0)T + (S2T |0, 0)T + (S3T |0, 0)T = P̃1 (S1T |1, 0)T + (S2T |0, 1)T + (S3T |1, 1)T = P̃1 (S1T |0, 1)T + (S2T |1, 1)T + (S3T |1, 0)T = P̃1 (S1T |1, 1)T + (S2T |1, 0)T + (S3T |0, 1)T = P̃1  µ This results in at least 4 2 4−4 = 2µ − 4 possible recovery sets. However, we also have points T1 , T2 , and T3 that are not used in Fµ2 , and so we may also define the following equations: (P̄1T |1, 0)T + (T1T |0, 1)T + (T1T |1, 1)T = P̃1 (P̄1T |0, 1)T + (T2T |1, 1)T + (T2T |1, 0)T = P̃1 (P̄1T |1, 1)T + (T3T |1, 0)T + (T3T |0, 1)T = P̃1 µ+2 Adding these, we have availability of at least 2µ − 4 + 3 = 2µ − 1 = 2 4 −4 , and so our property holds for µ + 2 as well. We also note that 3(2µ − 1) + 3 = 3 · 2µ < 4 · 2µ = 2µ+2 , and so there are at least 3 unused points. Thus, by induction, we have that for every k ≥ 1, when µ = 2k + 1, the µ availability of RM(1, µ) is at least 2 4−4 Thus we have achieved a lower bound on δ. Note, however, that we have not shown that this is necessarily an optimal construction.  We now study the batch properties of Reed-Müller codes. 4.2. Batch Properties of RM(1, µ). Theorem 4.13. The linear code RM(1, 4) is a (16, 5, 4, m, τ ) batch code for any m, τ ∈ N such that mτ = 10. Proof. First, note that the dual code of RM(1, 4) is RM(2, 4), which informs us how to reconstruct elements of the codewords. The generator matrix for RM(1, 4) can be recursively constructed as follows: G1,4 = G1,3 G1,3 0 G0,3 ! It can be verified that any query of 4 coordinates of a codeword in RM(1, 4) is possible with the following partition into buckets: 10 {1}, {2}, {3}, {4}, {5, 6}, {7, 8}, {9, 11}, {10, 12}, {13, 16}, {14, 15}. In the above case, m = 10 and τ = 1. By Lemma 2.3, this holds for any m, τ ∈ N such that mτ = 10.  We now show how to extend this construction to RM(1, µ) for any µ ≥ 4. Theorem 4.14. Any first order Reed-Müller code, RM(1, µ), with µ ≥ 4, has batch properties (n, k, 4, m, τ ) for any m, τ ∈ N such that mτ = 10. Proof. We will proceed by induction. First, we have just shown this for the base case where µ = 4. Now, assume that for some µ−1 ≥ 4, we have that RM(1, µ−1) has batch properties (n, k, 4, m, τ ). Recall that the dual code of C = RM(1, µ) is C ⊥ = RM(µ − 2, µ). Then as Reed-Müller codes follow the (u | u + v)-construction, C ⊥ is the (u | u + v)-code construction of C1⊥ = RM(µ − 2, µ − 1) and C2⊥ = RM(µ − 3, µ − 1). Since RM(µ − 3, µ − 1) ⊆ RM(µ − 2, µ − 1), we have C2⊥ ⊆ C1⊥ . This means we may apply Theorem 4.6. Since C2 = RM(1, µ − 1), we know that C is also a (n, k, 4, m, τ ) batch code. By induction, this is now true for any µ ≥ 4.  Since the locality of these codes is r = 3, for t = 4, we have mτ = 10 = (4−1)·3+1 = (t−1)r +1, and thus we have optimal batch properties. We now extend this even further for most RM(ρ, µ). 4.3. Batch Properties of RM(ρ, µ). We begin with a preliminary result that uses the recursive construction of Reed-Müller binary codes. Lemma 4.15. Let a ∈ RM(ρ − 1, µ − 2). Then (a|a|0|0), (a|0|a|0), (a|0|0|a), (0|a|a|0), (0|a|0|a), (0|0|a|a) ∈ RM(ρ, µ), where 0 ∈ Fµ2 . Proof. Let G= Gρ,µ−1 Gρ,µ−1 0 Gρ−1,µ−1 ! be the generator of RM(ρ, µ). Recursively, we obtain that   Gρ,µ−2 Gρ,µ−2 Gρ,µ−2 Gρ,µ−2  0 Gρ−1,µ−2 0 Gρ−1,µ−2    (7) G=   0 0 Gρ−1,µ−2 Gρ−1,µ−2  0 0 0 Gρ−2,µ−2 From the second and third block rows in matrix (7), we see that for any a ∈ RM(ρ − 1, µ − 2), the second row implies (0|a|0|a) ∈ RM(ρ, µ), and the third row implies (0|0|a|a) ∈ RM(ρ, µ). Note that our code is linear, and thus (0|a|0|a) + (0|0|a|a) = (0|a|a|0) ∈ RM(ρ, µ). Finally, note that since RM(ρ − 1, µ − 2) ⊆ RM(ρ, µ − 2), the first row implies (a|a|a|a) ∈ RM(ρ, µ), and so combining this with the previous vectors, we find that (a|a|0|0), (a|0|a|0), (a|0|0|a) ∈ RM(ρ, µ).  We now show the batch properties of RM(ρ, µ) for ρ ≥ 1 and µ ≥ 2ρ + 2. 11 Theorem 4.16. Let ρ ≥ 1 and µ ∈ {2ρ+ 2, 2ρ+ 3}. Then, for ρ′ ≤ ρ, RM(ρ′ , µ) is a (n, k, 4, m, τ ) linear batch code for any m, τ ∈ N such that mτ = 10 · 22ρ−2 . Proof. We focus on the case where µ = 2ρ + 2 as the case µ = 2ρ + 3 proceeds with similar steps. If RM(ρ, 2ρ + 2) is a (n, k, 4, m, τ ) linear batch code for any m, τ ∈ N such that mτ = 10 · 22ρ−2 , then it follows from Theorem 4.5 that for any ρ′ ≤ ρ, the code RM(ρ′ , 2ρ + 2) is a (n, k, 4, m, τ ) batch code for any m, τ ∈ N such that mτ = 10 · 22ρ−2 . Thus, we need only prove that this property holds for RM(ρ, 2ρ + 2). We proceed by induction on ρ. Note that in Section 4.2, the claim is true for ρ = 1, the base cases with µ = 4, 5. Assume that ρ ≥ 1. We show that the properties hold for RM(ρ + 1, 2(ρ + 1) + 2) = RM(ρ + 1, 2ρ + 4), assuming that RM(ρ, 2ρ + 2) is a (n, k, 4, m, τ ) linear batch code for any m, τ ∈ N such that mτ = 10 · 22ρ−2 . In particular, we may choose τ = 1 and have m = 10 · 22ρ−2 buckets. We now examine RM(ρ + 1, 2ρ + 4). The dual code of RM(ρ + 1, 2ρ + 4) is RM(ρ + 2, 2ρ + 4). By Lemma 4.15, for any a ∈ RM(ρ + 1, 2ρ + 2) = RM(ρ, 2ρ + 2)⊥ , we have (a|a|0|0), (a|0|a|0), (a|0|0|a), (0|a|a|0), (0|a|0|a), (0|0|a|a) ∈ RM(ρ + 2, 2ρ + 4). This provides a way to produce parity check equations for RM(ρ + 1, 2ρ + 4) from those for RM(ρ, 2ρ + 1), which in turn provides a way to make recovery sets for the former from those for the latter, as each vector corresponds to a recovery set for every index in its support. Each bucket B = {i1 , . . . , iℓ } for RM(ρ, 2ρ+2) can be made into 4 buckets for RM(ρ+1, 2ρ+4): B1 = B, B2 = B + n = {i1 + n, . . . , iℓ + n}, B3 = B + 2n, and B4 = B + 3n. This results in 4 · 10 · 22ρ−2 = 10 · 22ρ = 10 · 22(ρ+1)−2 buckets, and we must show that any set of 4 indices may be recovered by drawing at most 1 entry from each bucket. j k S Consider any tuple of 4 indices i1 , i2 , i3 , i4 ∈ [4n] = 3s=0 ([n]+sn) and let sk = ikn−1 for k ∈ [4]. Then let i′k = ik − sk n, so that i′1 , i′2 , i′3 , i′4 ∈ [n]. By the induction hypothesis, we have recovery sets R1′ , R2′ , R3′ , R4′ ⊆ [n] for these indices in RM(ρ, 2ρ + 2). These recovery sets are sets such that i′k ∈ Rk′ for all k ∈ [4] and (1) (Rk′ \ {i′k }) ∩ (Rj \ {i′j }) = ∅ for k, j ∈ [4] with k 6= j S (2) 4k=1 (Rk′ \ {i′k }) consists of at most 1 index in each bucket Each Rk′ is either {i′k } or the support of some vector a ∈ RM(ρ + 1, 2ρ + 2). If |Rk′ | = 1, then let Rk = Rk′ + sk n. Otherwise, let Rk = (Rk′ + sk n) ∪ (Rk′ + s′k n). By Lemma 4.15, we know that if s′k 6= sk , Rk is the support of some vector in RM(ρ + 2, 2ρ + 4), and so this is a valid recovery set. We must now show that these recovery sets have the desired properties given the correct choice of s′k values. We now note that since indices are being recreated from d = |{s1 , s2 , s3 , s4 }| different quarters of [4n], we can take at least d of the recovery sets to be singletons. Further, assume that we take as many recovery sets to be singletons as possible. In particular, this means that no recovery set will contain more than one index in each bucket. This is because the only way Rk could contain two indices in a bucket would be if Rk′ did. Since Rk′ is a proper recovery set, it could only contain 12 two indices in one bucket if one of those indices was i′k . Then that bucket is not used in any other recovery set, and so we could instead take Rk′ = {i′k }, as per our assumption. This leaves at most 4 − d recovery sets which are not singletons and require a subset in a second quarter. Assume without loss of generality that these are R1 , . . . , Rd−4 . Then we may let s′1 , . . . , s′d−4 be the elements of {0, 1, 2, 3} \ {s1 , s2 , s3 , s4 }. Since these are distinct, the only way some Rk \ {ik } and Rj \ {ij } could have a nonempty intersection would be if condition 1 was violated. Thus, condition 1 also holds for the Rk . We have already covered the fact that none of the Rk′ + s′k n will not contain more than one index in each bucket, and since these are in separate S quarters, the only way 4k=1 (Rk \ {ik }) would contain more than one index in a bucket would be if some elements being recovered in the same quarter had (Rk′ \ {i′k }) ∪ (Rj′ \ {ij }) consisting of more than 1 index in some bucket. This would violate condition 2, and so we know that the Rk s also satisfy 2. Thus, this code is a (4n, k′ , 4, 10 · 22(ρ+1)−2 , 1) batch code, and by Lemma 2.3, we know that RM(ρ+1, 2(ρ+1)+2) is a (4n, k′ , 4, m, τ ) batch code for any m, τ ∈ N such that mτ = 10·22(ρ+1)−2 . This completes the induction step, and so for any ρ ≥ 1, RM(ρ, 2ρ + 2) is a (4n, k ′ , 4, m, τ ) batch code for any m, τ ∈ N such that mτ = 10 · 22ρ−2 .  5. Conclusion This work focuses on batch properties of binary Hamming and Reed-Müller code. The high locality of binary Hamming codes implies their availability to be at most 1. Binary Hamming codes can be viewed as linear batch codes retrieving queries of at most 2 indices, the trivial case. Nonetheless, we prove that for t = 2, binary Hamming codes are actually optimal (2s−1 , 2s − 1 − s, 2, m, τ ) batch codes for m, τ ∈ N such that mτ = 2s−1 . We turn to binary Reed-Müller codes for optimal batch codes that allow larger queries, meaning t-tuples with t larger than 2. This research direction is motivated by the large availability of first order Reed-Müller codes as showed in the paper. We prove the optimality of first order Reed-Müller codes for t = 4. Finally we generalize our study to Reed-Müller codes RM(ρ, µ) which have order less than half their length by proving that they have batch properties (2µ , k, 4, m, τ ) such that mτ = 10 · 22ρ−2 for RM(ρ′ , µ) where µ ∈ {2ρ + 2, 2ρ + 3} and ρ′ ≤ ρ. Acknowledgments. The authors are grateful to Clemson University for hosting the REU at which this work was completed. The REU was made possible by an NSF Research Training Group (RTG) grant (DMS #1547399) promoting Coding Theory, Cryptography, and Number Theory at Clemson. References [1] E. F. Assmus, Jr. and J. D. Key. Designs and their codes, volume 103 of Cambridge Tracts in Mathematics. Cambridge University Press, Cambridge, 1992. [2] S. Bhattacharya, S. Ruj, and B. Roy. Combinatorial batch codes: a lower bound and optimal constructions. Adv. Math. Commun., 6(2):165–174, 2012. [3] C. Bujtás and Z. Tuza. Optimal combinatorial batch codes derived from dual systems. Miskolc Math. Notes, 12(1):11–23, 2011. [4] A. G. Dimakis, K. Ramchandran, Y. Wu, and C. Suh. A survey on network codes for distributed storage. Proceedings of the IEEE, 99(3):476–489, March 2011. 13 [5] P. Huang, E. Yaakobi, H. Uchikawa, and P. H. Siegel. Binary linear locally repairable codes. IEEE Trans. Inform. Theory, 62(11):6268–6283, 2016. [6] Y. Ishai, E. Kushilevitz, R. Ostrovsky, and A. Sahai. Batch codes and their applications. In Proceedings of the 36th Annual ACM Symposium on Theory of Computing, pages 262–271. ACM, New York, 2004. [7] H. Lipmaa and V. Skachek. Linear Batch Codes, pages 245–253. Springer International Publishing, Cham, 2015. [8] F. J. MacWilliams and N. J. A. Sloane. The theory of error-correcting codes. North-Holland Publishing Co., Amsterdam-New York-Oxford, 1977. North-Holland Mathematical Library, Vol. 16. [9] M. B. Paterson, D. R. Stinson, and R. Wei. Combinatorial batch codes. Adv. Math. Commun., 3(1):13–27, 2009. [10] N. Silberstein and A. Gál. Optimal combinatorial batch codes based on block designs. Des. Codes Cryptogr., 78(2):409–424, 2016. [11] V. Skachek. Batch and PIR codes and their connections to locally-repairable codes. CoRR, abs/1611.09914, 2016. [12] E. K. Thomas and V. Skachek. Explicit constructions and bounds for batch codes with restricted size of reconstruction sets. CoRR, abs/1701.07579, 2017. Department of Mathematical Sciences, Clemson University, Clemson, SC 29634 E-mail address: [email protected] Department of Mathematics & Statistics, Amherst College, Amherst, MA 01002 E-mail address: [email protected] Department of Mathematics, Willamette University, Salem, OR 97301 E-mail address: [email protected] Department of Mathematical Sciences, Clemson University, Clemson, SC 29634 E-mail address: [email protected] Department of Mathematics & Statistics, Villanova University, Villanova, PA 19085 E-mail address: [email protected] 14
7cs.IT
Local Descent for Temporal Logic Falsification of Cyber-Physical Systems (Extended Technical Report) arXiv:1802.04866v1 [cs.SY] 13 Feb 2018 Shakiba Yaghoubi, and Georgios Fainekos School of Computing, Informatics, and Decision Systems Engineering Arizona State University, Tempe, AZ, USA Email: {syaghoub, fainekos}@asu.edu Abstract. One way to analyze Cyber-Physical Systems is by modeling them as hybrid automata. Since reachability analysis for hybrid nonlinear automata is a very challenging and computationally expensive problem, in practice, engineers try to solve the requirements falsification problem. In one method, the falsification problem is solved by minimizing a robustness metric induced by the requirements. This optimization problem is usually a non-convex non-smooth problem that requires heuristic and analytical guidance to be solved. In this paper, functional gradient descent for hybrid systems is utilized for locally decreasing the robustness metric. The local descent method is combined with Simulated Annealing as a global optimization method to search for unsafe behaviors. Keywords: Falsification; Hybrid systems; Optimization. 1 Introduction In the last three decades, we have come to expect that we will be transported safely, reliably, and efficiently. Technologically, we have reached this point by increasingly adding sensors and embedded computers in ground vehicles, airplanes, and locomotives. However, as the software complexity increases so does the number of catastrophic software bugs. Therefore, Model-Based Development (MBD) and auto-coding technologies are currently used as the preferred development method for reducing errors [1]. Another benefit of MBD is that the system efficiency can be analyzed and optimized even before any prototypes are built. Even though MBD can reduce coding errors, it may not necessarily reduce system design errors with respect to functional requirements. This is particularly pronounced in Cyber-Physical Systems (CPS) where computer software interacts with and controls the physical environment. In order to analyze the safety of such systems, a variety of software tools have been developed for various classes of systems when the requirements concern reachable states in the system [2,3]. Nevertheless, when the system is complex in both the software and the physical dynamics, and the requirements have spatiotemporal constraints, e.g., as expressed in Metric [4] or Signal [5] Temporal Logic (TL), then current reachability analysis methods cannot provide an answer. In order to address the need of providing real-time analysis of the behavior of such systems, a variety of search-based falsification methods has been developed (for a survey see [6]). In search based falsification methods, the working assumption is that there is a design error in the system, and the goal of the falsifier is to search and detect system behaviors that invalidate (falsify) the system requirements. Among search-based methods, multiple shooting optimization techniques [7,8] have shown great promise with a modest preprocessing stage, but still they cannot handle temporal logic requirements. Hence, tree search methods [9] and single shooting TL robustness guided approaches [10] remain the state of the art in TL falsification. More recently, in [11], it was demonstrated that combining tree search based methods with TL robustness can improve the falsification detection rate in certain problem instances. In brief, different falsification methods are still needed for different problem instances. In this paper, we continue the progress on improving single shooting falsification methods for TL specifications [10]. This class of methods is guided by evaluating how robustly a system trajectory satisfies a TL specification [12,13]. Positive values mean that the system trajectory satisfies the specification, while non positive values mean that the specification has been falsified by the system trajectory. Single shooting falsification methods sample one or multiple system trajectories for the whole duration of the test time, they evaluate the TL robustness of each trajectory, and, then, they decide where to sample next in the search space. Ideally, at each iteration, the proposed new samples will produce trajectories with TL robustness less than the previously sampled trajectories. However, in general, this cannot be guaranteed unless some information is available about the structure of the system. In [14], it was shown that given a trajectory of a non-autonomous smooth non-linear dynamical system and a TL specification, it is possible to compute a direction in the search space along which the system will produce trajectories with reduced TL robustness. This direction is referred to as descent direction for TL robustness. Our main contribution in this paper is that we extend the results of [14] to computing local descent directions for falsification of TL specifications for hybrid systems. The extension is nontrivial since as discussed later in the paper, the sensitivity analysis is challenging in the case of hybrid systems. In particular, we focus on hybrid automata [15,16] with non-linear dynamics in each mode and external inputs (non-autonomous systems). Hybrid automata [15,16] is a mathematical model which can capture a wide range of CPS. We also present several examples of hybrid automata for which we can compute such descent directions for TL specifications. We remark that the descent directions computed can only point toward local reduction of TL robustness. Hence, we propose combining descent direction computations with a stochastic optimization engine in order to improve the overall system falsification rate. We highlight that the contributions of this paper have some important implications. First and foremost, it should be possible to derive results for approximating the descent direction for hybrid systems without requiring explicit knowledge of the system dynamics. For example, in [17], we showed that this is possible for smooth non-linear dynamical systems by using a number of successive linearizations along the system trajectory. The method was applied directly to Simulink models. Second, the local descent computation method could be further improved by utilizing recent results on a smooth approximation of TL robustness [18]. Therefore, the results in this paper could eventually lead to testing methods which do not require explicit knowledge of the system dynamics, and could be applied directly to a very large class of models, e.g., Simulink models, without the need for model translations or symbolic model extraction. 2 Problem Statement In order to formalize the problem that we deal with in this paper, we will describe the system under test and also the system requirements in this section. 2.1 System Description Hybrid automaton (HA) is a model that facilitates specification and verification of hybrid systems [16]. A hybrid automaton is specified using a tuple H = (H, H0 , U, Inv, E, Σ), where H = L × X denotes the ‘hybrid’ discrete and continuous state spaces of H: L ⊂ N is the set of discrete states or locations that the system switches through (each location attributes different continuous dynamics to the system), and X ⊆ Rn is the continuous state space of the system, H0 = L0 × X0 ⊆ H is the set of initial conditions, U is a bounded subset + of Rm that indicates the input signals ranges, Inv : L → 2X×R assigns an invariant set to each location, E is a set of tuples (E, Gu, Re) that determine transitions between locations. Here, E ⊆ L × L is the set of control switches, + Gu : E → 2X×R is the guard condition that enables a control switch (i.e, the system switches from li to lj when (x(t), t) ∈ X × R+ satisfies Gu((li , lj ))) and, Re : E × X → X is a reset map that given a transition e ∈ E and a point x for which Gu(e) is satisfied, maps x to a point in the state space X. Finally, Σ defines the continuous dynamics in each location l ∈ L: Σ(l) : ẋ = Fl (x, u(t), t), x ∈ X, ∀t : u(t) ∈ U (1) where ẋ = dx dt , x ∈ X is the system continuous state, and u : [0, T ] → U is the input signal map which is chosen from the set of all possible input signals U [0,T ] whose value at time t is denoted as u(t). Also, ∀l ∈ L, Fl : X × U × R+ → R is a C 1 flow that represents the system dynamics at location l. For more information about hybrid systems please refer to [15] and [16]. A hybrid trajectory η(h0 , u(t), t) starting from a point h0 = (l0 , x0 ) ∈ H0 and under the input u ∈ U [0,T ] is a function η : H0 × U × R+ → H which points to a pair (control location, state vector) for each point in time: η(h0 , u(t), t) = (l(h0 , u(t), t), s(h0 , u(t), t)), where l(h0 , u(t), t) is the location at time t, and s(h0 , u(t), t) is the continuous state at time t. We write the dynamical equations for the continuous system trajectory as: s(x0 , u(0), 0) = x0 ds(x0 , u(t), t) = Fl (s(x0 , u(t), t), u(t), t) dt while (s(x0 , u(t), t), t) ∈ Inv(l) (2) n − 0 , u(t), t ), t) ∈ Gu((li , lj )) s(x0 , u(t), t+ ) = Re((li , lj ), s(x, u(t), t− )) if (s(x (3) (s(x0 , u(t), t+ ), t) ∈ Inv(lj ) If the point (s(x0 , u(t), t+ ), t) lies outside Inv(lj ), there is an error in the design. We assume that such errors do not exist in the system. The times in which the location l and consequently the right-hand side of the equation (2) changes, are called transition times. In order to avoid unnecessary technicalities, in the above equations we use the notation of [19] and denote transition times as t− and t+ , where t− is the time right before the transition and t+ is the time right after that. However in more technical analysis of hybrid systems, one needs to consider the notion of hybrid time explained in [20] where a hybrid trajectory is parametrized not only by the physical time but also by the number of discrete jumps. When we consider the trajectory in a compact time interval [0, T ] and η is not Zeno1 , the sequence of transition times is finite. Assumption 1 We assume our system is deterministic, it does not exhibit Zeno behaviors and given (h0 , u) there is a unique solution η(h0 , u(t), t) to the system. Remark 1. The input signal map u, should be represented using a combination of finitely many basis functions. In this paper we use piecewise constant signals. 2.2 System Requirements Temporal logic formulas formally capture requirements concerning the system behavior. They could be expressing the requirements over Boolean abstractions of the behavior using atomic propositions as in MTL [4], or directly through predicate expressions over the signals as in STL [5]. Since the differences are only syntactic in nature (see [21]), in the following, we will just be using the term Temporal Logics (TL) to refer to either logic. TL formulas are formal logical statements that indicate how a system should behave and are built by combining atomic propositions (AP) or predicates using logical and temporal operators. The logical operators typically consist of conjunction (∧), disjunction (∨), negation (¬), and implication (→), while temporal operators include eventually (3I ), always (2I ) and until ( UI ) where the index I indicates a time interval. For example, the specification: “The absolute value of the trajectory s, should never go beyond α” can be captured using the TL formula 2(|s| ≤ α), or the timed specification “The value of the signal s should reach the bound (sref ± 5%) within δ seconds and stay there afterwards” can be formulated as 3[0,δ] (2(|(s − sref )/sref | < 5%)). 1 η is Zeno if it does an infinite number of jumps in a finite amount of time. A hybrid system is Zeno if at least one of its trajectories is Zeno. The robustness of a trajectory η(x0 , u, t) with respect to a TL formula is a function of that trajectory which shows how well it satisfies the specification (see [13] for details on how the robustness is defined and calculated). The function creates a positive value when the requirement is satisfied and a negative value otherwise. Its magnitude quantifies how far the specification is from being satisfied for non-positive values, or falsified for non-negative values. Software tools such as S-TaLiRo [22] compute the robustness value of a TL formula given a trajectory η(x0 , u, t). In order to detect unsafe system behaviors, we should falsify the specification, which means we need to find trajectories with non-positive robustness values. As a result, in a search based falsification, the effort is put on reducing the robustness value by searching in the parameter space. It can be easily shown that given a TL formula φ and a trajectory η(h0 , u, t) of a hybrid automaton H that satisfies the specification, if Assumption 1 holds, then there exists a critical time t∗ ∈ [0, T ] and a critical atomic proposition (or critical predicate) p∗ with respect to which the robustness is evaluated [23]. For example, in practice, the tool S-TaLiRo [22] computes the critical time t∗ and atomic proposition p∗ along with the robustness value of the specification. Reducing the distance of the trajectory η(h0 , u, t) from the set defined by p∗ at the critical time instance t∗ will not increase the robustness value; and in most practical cases it will actually decrease it. As a consequence, the TL falsification problem can be locally converted into a safety problem, i.e, always avoid the unsafe set U defined by p∗ . Hence, we need to compute a descent vector (h00 , u0 ) that will decrease the distance between η(h00 , u0 , t∗ ) and the unsafe set U. 2.3 Problem Formulation Let HU ⊆ H denote the system unsafe set, if η(h0 , u(t), t) enters HU then system specification is falsified. To avoid a digression into unnecessary technicalities, we will assume that, both the set of initial conditions and the unsafe set are each included in a single control location, i.e, H0 = {l0 } × X0 , and HU = {lU } × U, where l0 , lU ∈ L, and X0 , U ⊆ X. Definition 1. Let DHU : H 7→ R+ be the distance function to HU , defined by  dU (x) if l = lU DHU ((l, x)) = (4) +∞ otherwise where dU (x) = inf u∈U ||x − u||. Given a compact time interval [0, T ], h0 ∈ H0 , and the system input u ∈ U [0,T ] , we define the robustness of the system trajectory η(h0 , u(t), t) as f (h0 , u) , min DHU (η(h0 , u(t), t)) 0≤t≤T (5) and the respective critical time as t∗ = argmint∈[0,T ] DHU (η(h0 , u(t), t)). Since all trajectories start at l = l0 , we will write f (h0 , u) as f (w) where w = (x0 , u). Trajectories of minimal robustness indicate potentially unsafe behaviors, and if 𝑥′𝑜 , 𝑢′(𝑡) Local minimum Stochastic Search 𝑥𝑜 , 𝑢(𝑡) No Potential unsafe behavior? Yes Local Optimization around 𝑥𝑜 , 𝑢(𝑡) Fig. 1: 2-stage falsification: The stochastic search will search for the global optimizer while the local search improve the search speed. we can reduce the robustness value to zero, we have a falsifying trajectory. As a result robustness value should be minimized with respect to w. Our problem can be formulated generally as follows: minimize f (w) such that w ∈ X0 × U [0,T ] (6) Finding falsifying trajectories can be done in 2 stages. In the first stage, a higher level stochastic sampler determines a hybrid trajectory -a sequence of locations and state vectors- that exhibits system’s potential bad behavior, and in the second stage, out of all the neighboring trajectories that follow the same sequence of locations, we find the trajectory of minimal robustness (see Fig (1)). This can be done using local minimization. In this paper, we focus on solving the problem in this stage: we will find the trajectory of minimum robustness in the neighboring of a previously created trajectory in the first stage. Before we address our special problem of interest we should impose further assumptions on our system stated below: 1. The system is observable, i.e. we have access to all the system states, or we have a state estimator which is able to estimate them. 2. In the local search stage, we always are able to find a neighboring tube around each trajectory such that none of the trajectories inside that tube hit the guard tangentially. This ensures that trajectories of the system H starting close enough to x0 and under neighboring inputs of u undergo similar transitions/switches. In hybrid systems analysis, this property is called trajectory robustness (not to be confused with trajectory robustness in this paper) and is guaranteed if we can find an auto-bisimulation function of a trajectory and the trajectories starting from its neighboring initial conditions and under neighboring inputs [24]. 3. The system is deterministic and the transitions are taken as soon as possible. In order to have a deterministic system, if two transitions happen from the same location, their Guards should be mutually exclusive. 4. Guards are of the form g(x, t) = 0 and Reset maps are functions of the form x0 = h(x), where g and h are C 1 functions. For all the states that satisfy a Guard condition the corresponding Reset map should satisfy ∂h ∂x x 6= 0. 5. The trajectory η(h0 , u(t), t) returned by the first stage, from which we descend, enters the location of the unsafe set. The last assumption is made so that our problem be well-defined (note that the objective function (5) will have finite value only if trajectory enters unsafe location). The task of finding such an initial condition h0 is delegated to the higher-level stochastic search algorithm within which our method is integrated (Fig. 1). If finding such a trajectory for the higher-level stochastic algorithm is hard, we can still improve our trajectories locally by descending toward the guards. This will be discussed more in the next section. The problem is addressed in the following: Problem 1. Given a hybrid automaton H, a compact time interval [0, T ], a set of initial conditions H0 ⊆ H, a set of inputs U [0,T ] , a point h0 = (l0 , x0 ) ∈ H0 and an input u ∈ U [0,T ] such that the system trajectory satisfies 0 < f (w) < +∞, find a vector dw = (dx0 , du) ∈ X × U [0,T ] that satisfies the following property: ∃∆1 , ∆2 ∈ R+ such that ∀δ1 ∈ (0, ∆1 ), δ2 ∈ (0, ∆2 ), h00 = (l0 , x0 + δ1 dx0 ) ∈ H0 and u0 = u + δ2 du ∈ U [0,T ] , η(h00 , u0 (t), t) undergoes the same transitions as η(h0 , u(t), t), and also f (w + δdw) ≤ f (w) where δ = min{δ1 , δ2 }. Finding such a descent direction can help improve the performance of stochastic algorithms [10] that intend to solve the general problem in Eq. (6). Note that for the piecewise constant inputs u that we are working with in this paper, du is also a piecewise constant signal whose variables should be computed. Variables of du show the desired changes in that of the input signal u. 3 Finding a descent direction for the robustness In this section, given a trajectory η(h0 , u(t), t), we find dx0 and du such that the trajectory η(h00 , u0 (t), t), where h00 = (l0 , x0 + δdx0 ), u0 (t) = u(t) + δdu(t), attains a smaller robustness value; i.e f (w0 ) = f (x00 , u0 ) < f (x0 , u) = f (w). The robustness function in Eq. (5) is hard to deal with as it is non differentiable and non convex [23]. To solve this issue we calculate the descent direction with respect to a convex, almost everywhere differentiable function, and show that decreasing the value of this function yields a decrease in the robustness function: Theorem 1. Let x0 , x00 ∈ X0 , u, u0 ∈ U [0,T ] , and assume that the critical time for the continuous part of the hybrid trajectory s , s(x0 , u(t), t), is t∗ . Define  ks(x00 , u0 (t∗ ), t∗ ) − z(x0 , u(t∗ ), t∗ )k if l = lU J(x00 , u0 ) = (7) +∞ otherwise where l is the first argument of η(h00 , u0 (t∗ ), t∗ ), and z(x0 , u(t), t) = argminz∈U kz − s(x0 , u(t), t)k. (8) If we find a trajectory s0 , s(x00 , u0 (t), t) such that J(x00 , u0 ) < J(x0 , u), then the robustness of the trajectory s0 is smaller than that of s, i.e: f (x00 , u0 ) < f (x0 , u). Proof. By Eq. (5) we have f (x00 , u0 ) = min DHU (η(h00 , u0 (t), t)) ≤ J(x00 , u0 ) < 0≤t≤T J(x0 , u) = f (x0 , u).  Let x00 = x0 + dx and u0 = u + du. Consider J at the unsafe location and define: J(x00 , u0 ) = G(s(x00 , u0 (t∗ ), t∗ )), (9) where G(x) = kx − z(x0 , u(t∗ ), t∗ )k. Notice that the definition of G is based on a primary trajectory from which we want to descend. The total difference of a multi variable function shows the change in its value with respect to the changes in its independent variables while its partial differential is its derivative with respect to one variable, while others are kept constant. In the following, dx and du are calculated using the chain rule, such that J(x00 , u0 ) − J(x0 , u) = J(x0 + dx, u + du) − J(x0 , u) = dJ(x0 , u) < 0: dJ(x0 , u; dx, du) = where ∂G ∂x , ∂G ∂x s(x0 ,u(t∗ ),t∗ ) ∂G T ds(x0 , u, t∗ ) ∂x (10) ∈ Rn×1 is the steepest direction that increases distance from the unsafe set, i.e, − ∂G ∂x is along the approach vector mentioned in [23] that shows the direction of the shortest distance between s(x0 , u(t∗ ), t∗ ) and the unsafe set. Now observe that: ds(x0 , u, t∗ ) = D1 s(x0 , u, t∗ )dx0 + D2 s(x0 , u, t∗ )du (11) where Di denotes the partial differentiation with respect to the ith argument (for ∂s instance D1 s = ∂x ). Here, D1 s(x0 , u, t∗ ) and D2 s(x0 , u, t∗ ) are the sensitivity 0 of the trajectory to the initial condition and input at time t∗ , respectively. In the next section we show how to calculate sensitivity for a hybrid trajectory. Using Eq. (10) and (11), we choose: dx0 = −c1 ( ∂G T D1 s(x0 , u, t∗ ))T , ∂x du = −c2 ( ∂G T D2 s(x0 , u, t∗ ))T ∂x ∂s for some c1 , c2 > 0. As a result, we have dJ(x0 , u) = −c1 || ∂x 0 T (12) T ∂G 2 ∂s T ∂G 2 ∂x || −c2 || ∂u ∂x || T ∂G ∂s ∂u (x0 ,u,t∗ ) ∂x = 0. ∂s ∂G ≤ 0 and the equality holds if and only if ∂x ∂x = 0 (x0 ,u,t∗ ) All the above calculations are based on the assumption that the trajectory enters the unsafe location, but even if finding a trajectory that enters the unsafe location using stochastic higher level search is hard, we can still improve trajectories locally by descending toward the guard Gu∗ that takes the trajectory to the location with the shortest possible path to the unsafe set. This is shown in Fig. 2. For instance if the guard Gu∗ is activated when g(x) = 0, we can easily use zero finding methods to find a set M = {x | g(x) = 0} and replace U in all the previous calculations with the set M . 4 Sensitivity Calculation for a Hybrid Trajectory Extending sensitivity analysis to the hybrid case is not straightforward and even in the case that there is no reset in transitions and the state stays continuous, a 𝑥2 𝐺(𝑙2 , 𝑙3 ) 𝐴 𝑙2 𝑥2 U 𝑙3 𝐺(𝑙4 , 𝑙3 ) A 1 𝐵 𝑙1 B 𝑋0 𝐶 𝑙4 𝑋0 2 𝑥1 𝑥2 𝑥1 𝑔23 𝑥 = 0 𝒰 𝐴 𝑙2 ̵ 𝑔43 𝑥 = 0 𝑙3 𝑥0 𝐵 𝑙1 𝑋0 𝑠(𝑥'0,𝜏𝑥 0 ) 𝑥0′ 𝑠(𝑥̵0,𝜏 𝑥0′ ) 𝑠(𝑥0, 𝜏𝑥 0 ) 𝐶 𝑙4 𝑥1 Fig. 2: Trajectories B, A and C improve locally by descending toward the unsafe set, guard g43 and guard g23 respectively. 𝑠(𝑥 0,𝜏𝑥0′ ) Fig. 3: Assuming τx0 < τx00 , trajectories are under different dynamics for all the times t ∈ [τx0 , τx00 ], where τx0 and τx00 are transition times for s(x0 , .) and s(x00 , .) respectively. discontinuity often appears in the sensitivity function that needs to be evaluated [19]. In order to make the results comprehensive, in this section we analyze the sensitivity for trajectories of a Hybrid automaton. Without loss of generality, in order to focus on the complexity that happens under transitions, we consider a hybrid automaton with only two discrete locations (|L| = 2) and one control switch, also we assume l0 6= lU . There are 2 scenarios: 1. (s(x, u(t), t), t) is either inside Inv(l0 ) or Inv(lU ) 2. (s(x, u(t), t), t) ∈ Gu((l0 , lU )) Let us use px0 and pu to denote the sensitivity of the trajectory to changes in x0 and u respectively, i.e, px0 (t, t0 ) = D1 s(x0 , u, t) and pu (t, t0 ) = D2 s(x0 , u, t). It can be shown easily that in the first scenario, while (s(x0 , u, t), t) ∈ Inv(li ) and i ∈ {0, U}: ṗx0 (t, t0 ) = D1 Fli (s(x0 , u, t), u(t), t).px0 (t, t0 ), (13a) ṗu (t, t0 ) = D1 Fli (s(x0 , u(t), t),u(t), t).pu (t, t0 ) + D2 Fli (s(x0 , u(t), t), u(t), t), (13b) with the following initial and boundary conditions: px0 (t0 , t0 ) = In×n , pu (t0 , t0 ) = 0, + + px0 (τ , t0 ) = rx0 , pu (τ , t0 ) = ru . (14a) (14b) where τ + is the right hand side limit of the transition time τ that satisfies (s(x0 , u(τ ), τ ), τ ) ∈ Gu((l0 , lU )). We will calculate rx0 and ru in the following subsection. Consider that even if there is no reset, this jump happens in the state triggered transitions since neighboring trajectories have different transition times and as a result they are under different dynamics during the time between their transition times (see Fig. 3). 4.1 Sensitivity Jump Calculation Assume that if g(s(x0 , u(t), t), t) = 0 then (s(x0 , u(t), t), t) ∈ Gu((l0 , lU )). Let us denote the transition time by τ (x0 , u), which reminds us that this transition time differs for different trajectories; if the dependence was clear from context, we will write down τ , for brevity. Assume that Re(x, (l1 , l2 )) = h(x), we have: s(x0 , u(τ + ), τ + ) = h(s(x0 , u(τ − ), τ − )) (15) To calculate the value of px0 at τ + we take derivatives with respect to x0 from the above equation. We have: ∂h ds(x0 , u, τ − ) ds(x0 , u, τ + ) = ⇒ dx0 ∂x dx0 D1 s(x0 , u, τ + ) + D3 s(x0 , u, τ + ) ∂τ ∂τ ∂h (D1 (s(x0 , u, τ − )) + D3 s(x0 , u, τ − ) = ) ∂x0 ∂x ∂x0 ⇒ px0 (τ + , t0 ) = D1 s(x0 , u, τ + ) = ∂h ∂h px (τ − , t0 ) + ( f − − f + )D1 τ ) ∂x 0 ∂x (16) ∂h − where ∂h and f + are equal to Fl0 (s(x0 , u(τ − ), τ − ), ∂x = ∂x s(x0 ,u(τ − ),τ − ) , and f u(τ − ), τ − ) and FlU (s(x0 , u(τ + ), τ + ), u(τ + )), τ + ) respectively. To calculate D1 τ , consider that τ satisfies g(s(x0 , u, τ ), τ (x0 , u)) = 0, taking the derivatives with respect to x0 , we have: D1 g T (D1 s(x0 , u, τ ) + D3 s(x0 , u, τ ).D1 τ ) + D2 g.D1 τ = 0 ⇒ D1 τ = ∂τ D1 g T .px0 (τ − , t0 ) =− ∂x0 D1 g T .f − + D2 g (17) Using similar analysis we have: ∂h ∂h pu (τ − , t0 ) + ( f − − f + )D2 τ T ∂x ∂x D1 g T .pu (τ − , t0 ) D2 τ = − D1 g T .f − + D2 g pu (τ + , t0 ) = (18) (19) Using a hybrid automaton, sensitivity and system states can be calculated simultaneously (see Fig. 4). This will easily let us calculate the sensitivities by reseting their values at transition times. Note that using equations (16) to (19), for a system with time triggered transitions (g(x, t) = g 0 (t)) whose reset map is identity (h(x) = x), there are no jumps in sensitivities, i.e, px0 (τ + , t0 ) = px0 (τ − , t0 ) and pu (τ + , t0 ) = pu (τ − , t0 ). These types of hybrid systems can be handled using our previous work in [17] where we showed how to use system linearized matrices to approximately calculate the decent direction. However to have these kinds of gray box analysis for hybrid systems with state dependent transitions, we also need to have some information about the guards or be able to approximate them in order to model the jumps in the sensitivity. In the future we will work on the descent calculation using gray box models of the general hybrid systems. 𝑥2 O’ 𝐹1 𝑥3 O 𝐹2 𝑥1 𝑥 ∈ 𝑋0 , 𝑢 ∈ 𝑈, 𝑝𝑥0 = 𝐼𝑛×𝑛 , 𝑝𝑢 = 0 𝑥 = 𝐹2 𝑥, 𝑢, 𝑡 , 𝑥 = 𝐹1 𝑥, 𝑢, 𝑡 , ? 𝑝𝑥0 = 𝐷1 𝐹2 𝑥, 𝑢, 𝑡 . 𝑝𝑥0 , 𝑝𝑥0 = 𝐷1 𝐹1 𝑥, 𝑢, 𝑡 . 𝑝𝑥0 , 𝑥∈ 𝐺𝑢𝑎𝑟𝑑 𝑙1 , 𝑙2 , 𝑝𝑢 = 𝐷1 𝐹2 𝑥, 𝑢, 𝑡 . 𝑝𝑢 𝑝𝑢 = 𝐷1 𝐹1 𝑥, 𝑢, 𝑡 . 𝑝𝑢 +𝐷2 𝐹2 𝑥, 𝑢, 𝑡 , +𝐷2 𝐹1 𝑥, 𝑢, 𝑡 , 𝑥 = 𝑅𝑒(𝑥, 𝑙1 , 𝑙2 ) = ℎ 𝑥 , 𝑥 ∈ 𝑖𝑛𝑣(𝑙1 ) 𝑝𝑥0 = 𝑝𝑥0 𝜏 + , 𝑡0 , 𝑝𝑢 = 𝑝𝑢 𝜏 + , 𝑡0 𝑥 ∈ 𝑖𝑛𝑣(𝑙2 ) Fig. 4: HA of the system and trajectory sensitivity Algorithm (1) describes the procedure to find gradient descent (GD) directions for hybrid systems. The function “Simul&Sens&GetRob” calculates the sensitivity matrices px0 and pu as well as the robustness value r, the critical time t∗ and the approach vector ns = ∂G ∂x with respect to the specification ϕ. Given t∗ , ns , px0 , pu , “GD” calculates the gradient descent directions dx, du using Eq. (12). “INBOX” calculates the new initial condition and input while ensuring that they lie inside the desired sets X0 and U [0,T ] . 5 Experimental Results In order to show the utility of our method, we used the following three examples in which we deal with nonlinear hybrid systems. In all the experimens we used MATLAB 2015b on an Intel(R) Core(TM) i7-4790 CPU @3.6 GHZ with 16 GB memory processor with Windows Server 2012 R2 Standard OS. Example 1. The first example models the motion of a billiard ball. The ball is initially placed at (x0 , y0 ), and it is shot in direction a with speed v where a is the throw angle with the x-axis. We assume there is no friction between the table and the ball. When the ball hits the sides parallel to x-axis (lines y = 0, 2), its velocity on the y-direction flips sign while the velocity in x-direction remains unchanged. Also, when it hits the side x = 4, its velocity on the x-direction flips sign and the velocity on the y-direction remains unchanged. That is, the collisions of the ball with the table sides are perfect and no energy is lost. The system can be modeled using a simple hybrid automaton, as shown in Fig (5). Assume, we want to hit the ball such that it eventually falls in the hole centered in (0.2, 1.6) with radius 0.1. The search is done over 3 Dimensions: We allow the ball to be initially placed at [0, 0.2]2 and be shot using angle a ∈ [30◦ , 45◦ ] with v = 1. Starting from the initial condition (0.1, 0.1), and using a = 48.5◦ , the throwing process is refined using GD method. The trajectories are shown in Fig (6) where we refined light gray trajectories to the darker ones. Example 2. Our second example is a hybrid model of glycemic control in diabetic patients taken from [25] in which they used feedback control strategies by [26] and [27]. The variation of insulin glucose levels in diabetic patients is modeled using the following equations: Algorithm 1 Robustness Gradient Descent algorithm Require: Hybrid system model H, initial condition and input x0 and u, sets of possible initial conditions and input values X0 and U , system specification ϕ, finial time T , step size h, maximum number of iterations we descend k1 , maximum number of iterations we decrease the step size k2 and the multiplier of the step size p < 1. Ensure: local optimal initial condition x∗0 , local optimal input u∗ and the related optimal robustness value r∗ 1: (x00 , u0 , r ∗ ) ← (x0 , u0 , ∞) 2: for i = 1 to k1 do 3: (r, t∗ , ns , px0 , pu ) ← Simul&Sens&GetRob(x00 , u0 , H, T, ϕ) 4: if r ≤ r∗ then 5: (x0 , u) ← (x00 , u0 ), (x∗0 , u∗ , r∗ ) ← (x00 , u0 , r) 6: else 7: h0 ←h 8: for j = 1 to k2 do 9: h0 ← h0 .p 10: (x00 , u0 ) ← inbox(x0 , u, X0 , U0 , h0 , dx , du ) 11: (r, t∗ , ns , px0 , pu ) ← Simul&Sens&GetRob(x00 , u0 , H, T, ϕ) 12: if r ≤ r∗ then 13: (x∗0 , u∗ , r∗ ) ← (x00 , u0 , r) 14: Break 15: end if 16: end for 17: end if 18: (dx, du) ← GD(t∗ , ns , px0 , pu ). 19: (x00 , u0 ) ← inbox(x0 , u, X0 , U0 , h, dx , du ) 20: end for     −p1 G − X(G + GB ) + u1 (t) Ġ Ẋ  =   −p2 X + p3 I u2 (t) ˙ −n(I + I ) + I b vI (20) where the state G is the level of glucose in the blood above the basal value GB = 4.5, X is proportional to the insulin level that is effective in glucose level control, and I is the insulin level above the value Ib = 15. Typical parameter values for p2 , VI , and n are 0.025, 12 and 0.093, respectively, and parameters p1 and p3 are patient dependent. The functions u1 (t) and u2 (t) model the infusion of glucose and insulin into the bloodstream in order to control their levels, and their values are chosen based on the following equations: u1 (t) = ( 1+ 50 3 2G(t) 9 G(t) < 6 G(t) ≥ 6 , u2 (t) =  t   60 120−t  180  0 t ≤ 30 30 ≤ t ≤ 120 t ≥ 120 Using the above control schemes for u1 (t) and u2 (t) yields a hybrid automaton with 6 locations/modes with 4 timed-based and 6 state-based guards. While the 𝑠(𝑥0, 𝜏𝑥0′ ) 𝑥0 𝑠(𝑥0, 𝜏𝑥0 ) 𝑥0′ 𝑠(𝑥0, 𝜏𝑥0 ) 𝑠(𝑥0, 𝜏𝑥0′ ) 2 𝑦≥2/ 𝑎 = 2𝜋 − 𝑎 1.5 y 𝑙1 : {𝑥 = 𝑥0 , 𝑦 = 𝑦0 , 𝑎 = 𝑎0 } 1 [𝑦 ≤ 0]/ 𝑎 = 2𝜋 − 𝑎 𝑥 = 𝑣. cos 𝑎 , 𝑦 = 𝑣. sin(𝑎), 0.5 𝑥≥4/ 𝑎 =𝜋−𝑎 0 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 x Fig. 5: Billiard ball hybrid automaton. Fig. 6: Starting in the white box and using a ∈ [30◦ , 45◦ ], the ball should be placed in the red hole. The red arrows show the descent direction. 6 G(t) 4 2 0 -2 0 20 40 60 80 100 120 140 160 180 200 t Fig. 7: Falsification of the specification ϕ1 for the glycemic control model sensitivity-states px0 and pu go under jumps during the state-based transitions, they remain unchanged in timed transitions. Note that based on Eq. (17) and ∂τ ∂τ and τu = ∂u (19), in timed transitions, D1 g and as a result τx0 = ∂x are zero. 0 In this example the search is over 5 dimensions: [G, X, I] ∈ [6, 9.5]×[0.15, 0.18]× [−0.1, 0.1] and p1 ∈ [0, 0.02] and p3 ∈ [10−5 , 10−4 ]. The system should satisfy: ϕ1 =2[0,30] G ∈ [−3, 10] ∧ 2[30,120] G ∈ [−1.5, 5.1] ∧ 2[120,200] G ∈ [2, 5] Starting from x0 = (6.5, 0.17, 0), and using (p1 , p3 ) = (0.01, 1.3 × 10−5 ) with robustness 0.8287, the optimization process reduces the robustness to -0.0213 using x0 = (6.5001, 0.1506, −3.064 × 10−6 ), and (p1 , p3 ) = (0.0097, 1 × 10−4 ) which results in falsification of the requirement. Figure (7) shows the glucose trajectories G(t) where the search is started using the light gray trajectories and refined to the darker ones. Note that because of the local search property of the method, for trajectories in this this local search, the effort is put on decreasing the distance to the critical unsafe set, which is the set [5.1, ∞) at the critical time t∗ ∈ [30, 120]. Example 3. Our last example is a rotating planar vehicle. Consider the motion of a rigid object on a plane that uses a pair of off-centered thrusters as the control input. Since these thrusters are not aligned with the center of the mass, they will create both translational and rotational motions on the vehicle [24]. (see Fig. 8 for a better illustration). The system is supposed to satisfy the requirement in Eq. (21) which implies that the vehicle should avoid the unsafe sets U1 and U2 (shown in Fig. 10 with red boxes) and reaches the goal set G (shown with a blue box) within the simulation time T = 10. Here (x1 , x2 ) is the vehicle position. ϕ2 = 2[0,10] ¬((x1 , x2 ) ∈ U1 ∨ (x1 , x2 ) ∈ U2 ) ∧ 3[0,10] (x1 , x2 ) ∈ G (21) The location-based dynamics of the vehicle are mentioned in Eq. (22), where j ∈ {1, 2, 3}, x1 , x2 are the positions along the x and y axis, x3 is the angle with the x-axis and x4 , x5 and x6 are their derivatives. The hybrid model consists of 3 locations, where inv(l = 1) = {x|x1 < 4}, inv(l = 2) = {x|4 ≤ x1 ≤ 8}, and inv(l = 3) = {x|x1 > 8}. The guards are shown using dashed lines in Fig. 10. The unsafe sets have attractive non-centered forces in their corresponding locations. In particular, U1 is located in location 2 and U2 is located in location 3. At location 1, s1 (l = 1) = s2 (l = 1) = 0, at location 2, s1 (l = 2) = −1 and s2 (l = 2) = 0, and at location 3, s1 (l = 3) = 0 and s2 (l = 3) = −2. (α1 , β1 ) and (α2 , β2 ) are the centers of U1 and U2 , respectively.     xj+3 ẋj ẋ4  0.1x4 +Σi=1,2 si (l)(x1 −αi )+F1 cos(x5 )−F2 sin(x5 )   = (22) ẋ5   0.1x4 +Σi=1,2 si (l)(x2 −βi )+F1 sin(x5 )−F2 cos(x5 )  a b ẋ6 − I F1 + I F2 Our search is over the initial values in [0, 1] × [0.5, 1], and the input signals F1 (t), F2 (t) ∈ [−1, 1]; other states are zero initially. Since the search over all the continuous input signals is a search in infinite dimension, here, we used piecewise constant inputs with 11 variables for each F1 (t) and F2 (t). So the overall search is over 24 dimensions. We start our search from the trajectory with x0 = (0.5, 0.6, 0, 0, 0, 0), and input signals F1 (t) = 0.2, and F2 (t) = 0.1 for t ≤ 7.2 and F2 (t) = −0.2 for t > 7.2. This trajectory satisfies (21) with the robustness value equal to 0.2950. Using our method with step size h = 0.02, in the 8th iteration, the initial condition x0 = (0.3983, 0.6948, 0, 0, 0, 0) and the inputs shown in Fig (9) are chosen and the robustness is improved to the value 0.8599 (Note that while in a falsification problem we try to decrease the robustness value, in a related problem called satisfaction problem increasing the robustness value is desired). he projection of the trajectories into the x1 − x2 plane is shown in Fig. 10, where dark gray trajectories are refined to light gray ones. In Fig. 11, one can see that even if the trajectory from which we want to descend does not enter the goal set location, we are still able to improve the trajectory by descending toward the adjacent guard with the least distance from that set. In order to determine the effect of applying GD local search method to global search methods like Simulated Annealing (SA), we performed a statistical study in which we compare the combination of SA and GD (SA+GD) with SA only. To combine SA and GD, we apply GD algorithm whenever the samples taken by SA return a robustness value less than some threshold value rT . 0.23 F 1 (t) 0.22 𝑥2 0.21 0.2 0.19 O’ 𝑥3 1 2 3 4 0 1 2 3 4 5 6 7 8 9 5 6 7 8 9 0.2 O 𝐹1 0 F 2 (t) 𝐹2 0 𝑥1 -0.2 Fig. 8: The rigid body with off centered thrusters. O is the center of the mass but the force is applied to O’. t Fig. 9: Final inputs in the process of improving the robustness valuation of the system of Eq. (22) with respect to the specification ϕ2 . 6 5 5 4 4 3 x2 x2 3 2 2 1 1 0 -1 0 0 2 4 6 8 10 12 x1 Fig. 10: Improving the robustness of the trajectories of the system of Eq. (22) with respect to the specification ϕ2 from 0.2950 to 0.8599. Red arrows show the steepest ascent direction. 14 0 2 4 6 8 10 12 x1 Fig. 11: Trajectories that do not enter the goal set location (dashed trajectories here) can still improve by descending toward the guard set (dashed line at x1 = 8). In our experiment we ran SA and SA+GD for 150 times with equal total number of samples N = 100 and rT = 2.5. We set the parameters in Alg. (1) to k1 = 10, k2 = 2, h = 0.02 to automatically search for initial conditions and inputs that satisfy the specification ϕ2 with U1 = [5.5, 6.5] × [2.5, 3.5], U2 = [9.5, 10.5] × [1.5, 4.5], G = [12.5, 13] × [4.5, 5] for the system in Example (3). In order to satisfy ϕ2 , we try to falsify its negation ¬ϕ2 . The results are shown in Table (1). The improvement in finding falsifying trajectories is clear from the total number of falsifications in the first row. Also, since GD gets a chance to improve the performance only if SA finds a robustness value less than rT , we added the second row which shows in how many percents of the cases falsification is achieved if SA finds a robustness value less than rT . While average of the best robustness value for all the tests is better for SA+GD algorithm, it is slightly better for SA if we only consider non-falsified cases. We can conclude that even if SA finds small robustness values, it is hardly able to further decrease it. As the constant Table 1: Comparing SA and SA+GD results for the system of Example 3 Optim. method num. of total falsification SA SA+GD 4/150 16/150 % of falsification if SA finds r ≤ rT 13.33% 39.02% Avg. min-Rob. (all the cases) 9.1828 8.4818 Avg. min-Rob. (not falsified cases) 9.4278 9.4968 min. min-Rob. (not falsified cases) 0.0080 0.0059 max. min-Rob. (not falsified cases) 13.1424 13.0880 budget in the comparison is “equal total number of simulations”, we can claim that SA+GD can help improve the results if simulations/experiments are costly. Choosing different design parameters might lead to even better experimental results. 6 Related Work One possible categorization for falsification approaches divides them into Single Shooting (SS) vs. Multiple Shooting (MS) methods. The technique of numerically solving boundary value problems is called shooting. SS approaches search over the space of system trajectories initiated from the set of initial conditions and under possible inputs. S-TaLiRo [22] and Breach [28] lie in this category. In contrast, MS approaches create approximate trajectories from trajectory segments starting from multiple initial conditions (not necessarily inside the initial set). Hence, the trajectories contain gaps between segments. The works [7,8] fall in in this category. MS techniques cannot handle general TL requirements. Motion planning approaches such as Rapidly-exploring Random Trees (RRT) lie in a category between SS and MS approaches. Starting from an initial condition, the tree grows toward the unsafe set (or vice versa) to find an unsafe behavior of a non-autonomous system [11,9]. The applicability of these methods, however, is limited since it depends on many factors such as the dimensionality of the system, the modeling language, and the local planner. Another possible categorization of falsification methods divides them into the following categories: 1. Methods that rely on optimizing a metric (called robustness) to systematically search for falsification: These methods try to minimize a robustness value which is assigned to each trajectory using global optimization techniques like SA and Cross Entropy. S-TaLiRo [22] and Breach [28] are among the tools that use this strategy. 2. Methods that use constraint solvers to find falsification by translating the problem into constraint solving using Bounded Model Checking (BMC) approaches [29]. However, these approaches discretize the continuous dynamics and the resulting constraints become nonlinear even for linear hybrid systems by involving higher order terms, and, 3. Motion planning approaches such as Rapidly-exploring Random Trees (RRT): These methods lie in SS approach category where starting from an initial condition the tree grows toward the unsafe set (or vice versa) to find an unsafe behavior of a non-autonomous system [11]. The applicability of these methods, however, is limited since it depends on many factors such as system behavior itself and the used planner. The performance of SS falsification methods can be improved using different complementary directions. One direction is to provide alternative TL robustness metrics [30]. Another direction is to compute guaranteed or approximate descent directions [17,23] in order to utilize descent optimization methods. Our method in this paper is a SS approach that uses optimization and robustness metric to solve the falsification problem. In [23,14] robustness-based falsification is guided using descent direction; however, that line of work is only applicable to purely continuous systems. In [31], descent direction is calculated in the case of linear hybrid systems using optimization methods. In [8] authors use a MS approach to find falsifying trajectories of a hybrid system. Providing the gradient information to an NLP solver, they try to reduce the gaps between segments. Like our approach, they require knowledge of the system dynamics and solve a local search problem. Unlike our method, in their approach, falsifying trajectories are segmented trajectories which are not real system trajectories unless the gaps between segments become zero in the optimization procedure (for systems with identity reset maps), which may not be the case, in general. As a result, falsification cannot be concluded unless they can randomly find a neighboring real system trajectory that violates the specification. We think that our approach can help their method to effectively search over real trajectories neighboring the segmented trajectory. Furthermore, the specifications they have focused on in [8] are safety properties and because of the nature of the search, their method cannot easily be extended to search for system trajectories that falsify general MTL formulas. The general idea of using sensitivity to explore the parameter space of a problem that deals with robustness of a TL formula was first introduced in [32]. To solve a verification problem, they propose using the sensitivity of a robustness function to a parameter assuming that the function is differentiable to that parameter. There are however multiple factors which result in non-differentiability of the robustness function with respect to a parameter: First of all, the predicates themselves might be non smooth and non-differentiable. Secondly, hybrid systems may have non smooth and non-differentiable trajectories. Finally, logical operators in the TL formula impose min and max operators to robustness function. The paper suggests using left and right hand derivatives for dealing with min and max operators, but it does not propose solutions for the first two cases. In our framework, by introducing Eq. (7), we solve the non differentiability issue in the first case and the analysis in Sec. 4 deals with this issue in the second case. Also, the problem we try to solve is a different problem (a falsification problem). In [33], a smooth infinitely differentiable robustness function is introduced which solves – to some extent – the non-differentiability problem of the robustness function to parameters. In the case of hybrid systems however, we still deal with this problem as the non-differentiability is caused by the system model rather than the robustness function itself. In the future, we will investigate if the results in [33] could further improve the performance of gradient descent falsification methods as formulated in our work. In [34], an algorithm to approximate reachable sets using sensitivity analysis is introduced. Sensitivity of hybrid systems without reset maps is used to verify safety properties. Like all approaches that try to solve a coverage problem, the method suffers from the state explosion issue which happens when one tries to cover the high dimensional spaces induced by the variables in the input signal parameterization. Our framework solves a different problem and it is applicable to hybrid systems with reset maps under general TL formulas. Furthermore, as we are not solving a coverage problem, we do not face the state explosion issue. 7 Conclusion TL robustness guided falsification [10] has shown great potential in terms of black or gray box automatic test case generation for CPS [35,36,37]. In this paper, we presented a method that locally improves the search for falsifying behaviors by computing descent directions for the TL robustness in the search space of the falsification problem. Our proposed method computes such descent directions for non-linear hybrid systems with external inputs, which was not possible before in the literature. Using examples, we demonstrated that our framework locally decreases the TL robustness at each iteration. Furthermore, our preliminary statistical results indicate that it is possible to improve a global test-based falsification framework when the proposed local gradient descent method is utilized. Currently, the proposed framework requires a symbolic representation of the non-linear dynamics and the switching conditions of the hybrid automaton in order to compute the descent direction. As future research, we expect that we can relax this requirement by numerically computing approximations to the descent directions similarly to our work for smooth non-linear dynamical systems [17]. This will enable the application of the local descent method to a wide range of Simulink models without explicit extraction of the system dynamics. Acknowledgments This work was partially supported by the NSF awards CNS-1319560, CNS 1350420, IIP-1361926, and the NSF I/UCRC Center for Embedded Systems. References 1. Ferrari, A., Grasso, D., Magnani, G., Fantechi, A., Tempestini, M.: The metrô rio atp case study. In: 15th International Workshop on Formal Methods for Industrial Critical Systems. Volume 6371 of LNCS., Springer (2010) 1–16 2. Frehse, G., Guernic, C.L., Donz, A., Cotton, S., Ray, R., Lebeltel, O., Ripado, R., Girard, A., Dang, T., Maler, O.: Spaceex: Scalable verification of hybrid systems. In: Proceedings of the 23d CAV. (2011) 3. Chen, X., Abraham, E., Sankaranarayanan, S.: Flow*: An analyzer for non-linear hybrid systems. In: Computer-Aided Verification. (2013) 4. Koymans, R.: Specifying real-time properties with metric temporal logic. RealTime Systems 2(4) (1990) 255–299 5. Maler, O., Nickovic, D.: Monitoring temporal properties of continuous signals. In: Proceedings of FORMATS-FTRTFT. Volume 3253 of LNCS. (2004) 152–166 6. Kapinski, J., Deshmukh, J.V., Jin, X., Ito, H., Butts, K.: Simulation-based approaches for verification of embedded control systems: An overview of traditional and advanced modeling, testing, and verification techniques. IEEE Control Systems Magazine 36(6) (2016) 45–64 7. Zutshi, A., Deshmukh, J.V., Sankaranarayanan, S., Kapinski, J.: Multiple shooting, cegar-based falsification for hybrid systems. In: Proceedings of the 14th International Conference on Embedded Software, ACM (2014) 5 8. Zutshi, A., Sankaranarayanan, S., Deshmukh, J.V., Kapinski, J.: A trajectory splicing approach to concretizing counterexamples for hybrid systems. In: Decision and Control (CDC), 2013 IEEE 52nd Annual Conference on, IEEE (2013) 9. Plaku, E., Kavraki, L.E., Vardi, M.Y.: Falsification of ltl safety properties in hybrid systems. In: Proc. of the Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS). Volume 5505 of LNCS., Springer (2009) 368 – 382 10. Abbas, H., Fainekos, G.E., Sankaranarayanan, S., Ivancic, F., Gupta, A.: Probabilistic temporal logic falsification of cyber-physical systems. ACM Transactions on Embedded Computing Systems 12(s2) (May 2013) 11. Dreossi, T., Dang, T., Donzé, A., Kapinski, J., Jin, X., Deshmukh, J.V.: Efficient guiding strategies for testing of temporal properties of hybrid systems. In: 7th International Symposium NASA Formal Methods (NFM). Volume 9058 of LNCS., Springer (2015) 127–142 12. Fainekos, G.E., Pappas, G.J.: Robustness of temporal logic specifications. In: Formal Approaches to Testing and Runtime Verification. Volume 4262 of LNCS., Springer (2006) 178–192 13. Fainekos, G., Pappas, G.: Robustness of temporal logic specifications for continuous-time signals. Theoretical Computer Science 410(42) (2009) 4262–4291 14. Abbas, H., Winn, A., Fainekos, G., Julius, A.A.: Functional gradient descent method for metric temporal logic specifications. In: 2014 American Control Conference, IEEE (2014) 2312–2317 15. Tabuada, P.: Verification and control of hybrid systems: a symbolic approach. Springer Science & Business Media (2009) 16. Alur, R.: Principles of Cyber-Physical Systems. MIT Press (2015) 17. Yaghoubi, S., Fainekos, G.: Hybrid approximate gradient and stochastic descent for falsification of nonlinear systems. In: American Control Conference. (2017) 18. Pant, Y.V., Abbas, H., Mangharam, R.: Control using the smooth robustness of temporal logic. Technical Report MLAB paper 98, University of Pennsylvania Scholarly Commons (2017) 19. Donzé, A., Maler, O.: Systematic simulation using sensitivity analysis. In: International Workshop on Hybrid Systems: Computation and Control, Springer (2007) 20. Goebel, R., Teel, A.R.: Solutions to hybrid inclusions via set and graphical convergence with stability theory applications. Automatica 42(4) (2006) 573–587 21. Dokhanchi, A., Hoxha, B., Fainekos, G.: Metric interval temporal logic specification elicitation and debugging. In: 13th ACM-IEEE International Conference on Formal Methods and Models for System Design. (September 2015) 22. Annpureddy, Y., Liu, C., Fainekos, G., Sankaranarayanan, S.: S-taliro: A tool for temporal logic falsification for hybrid systems. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems, Springer (2011) 254–257 23. Abbas, H., Fainekos, G.: Computing descent direction of mtl robustness for nonlinear systems. In: 2013 American Control Conference, IEEE (2013) 4405–4410 24. Winn, A., Julius, A.A.: Safety controller synthesis using human generated trajectories. IEEE Transactions on Automatic Control 60(6) (2015) 1597–1610 25. Chen, X., Abraham, E., Sankaranarayanan, S.: Taylor model flowpipe construction for non-linear hybrid systems. In: Real-Time Systems Symposium (RTSS), 2012 IEEE 33rd, IEEE (2012) 183–192 26. Furler, S.M., Kraegen, E.W., Smallwood, R.H., Chisholm, D.J., et al.: Blood glucose control by intermittent loop closure in the basal mode: computer simulation studies with a diabetic model. Diabetes care 8(6) (1985) 553–561 27. Fisher, M.E.: A semiclosed-loop algorithm for the control of blood glucose levels in diabetics. IEEE transactions on biomedical engineering 38(1) (1991) 57–61 28. Donzé, A.: Breach, a toolbox for verification and parameter synthesis of hybrid systems. In: International Conference on Computer Aided Verification, Springer (2010) 167–170 29. Clarke, E.M., Grumberg, O., Peled, D.: Model checking. MIT press (1999) 30. Akazaki, T., Hasuo, I.: Time robustness in mtl and expressivity in hybrid system falsification. In: Computer Aided Verification. Volume 9207 of LNCS., Springer (2015) 356–374 31. Abbas, H., Fainekos, G.: Linear hybrid system falsification with descent. arXiv preprint arXiv:1105.1733 (2011) 32. Donzé, A., Maler, O.: Robust satisfaction of temporal logic over real-valued signals. In: FORMATS. Volume 6246., Springer (2010) 92–106 33. Pant, Y.V., Abbas, H., Mangharam, R.: Smooth operator: Control using the smooth robustness of temporal logic. (2017) 34. Donzé, A., Krogh, B., Rajhans, A.: Parameter synthesis for hybrid systems with an application to simulink models. In: International Workshop on Hybrid Systems: Computation and Control, Springer (2009) 165–179 35. Fainekos, G., Sankaranarayanan, S., Ueda, K., Yazarel, H.: Verification of automotive control applications using s-taliro. In: Proceedings of the American Control Conference. (2012) 36. Strathmann, T., Oehlerking, J.: Verifying properties of an electro-mechanical braking system. In Frehse, G., Althoff, M., eds.: ARCH14-15. 1st and 2nd International Workshop on Applied veRification for Continuous and Hybrid Systems. Volume 34 of EPiC Series in Computing., EasyChair (2015) 49–56 37. Sankaranarayanan, S., Kumar, S.A., Cameron, F., Bequette, B.W., Fainekos, G., Maahs, D.: Model-based falsification of an artificial pancreas control system. In: Medical Cyber Physical Systems Workshop. (2016)
3cs.SY
Rigorous accuracy and robustness analysis for two-scale reduced random Kalman filters in high dimensions arXiv:1606.09087v1 [math.ST] 29 Jun 2016 Andrew J Majda and Xin T Tong January 10, 2018 Abstract Contemporary data assimilation often involves millions of prediction variables. The classical Kalman filter is no longer computationally feasible in such a high dimensional context. This problem can often be resolved by exploiting the underlying multiscale structure, applying the full Kalman filtering procedures only to the large scale variables, and estimating the small scale variables with proper statistical strategies, including multiplicative inflation, representation model error in the observations, and crude localization. The resulting two-scale reduced filters can have close to optimal numerical filtering skill based on previous numerical evidence. Yet, no rigorous explanation exists for this success, because these modifications create unavoidable bias and model error. This paper contributes to this issue by establishing a new error analysis framework for two different reduced random Kalman filters, valid independent of the large dimension. The first part of our results examines the fidelity of the covariance estimators, which is essential for accurate uncertainty quantification. In a simplified setting, this is demonstrated by showing the true error covariance is dominated by its estimators. In general settings, the Mahalanobis error and its intrinsic dissipation can indicate covariance fidelity. The second part develops upper bounds for the covariance estimators by comparing with proper Kalman filters. Combining both results, the classical tools for Kalman filters can be used as a-priori performance criteria for the reduced filters. In applications, these criteria guarantee the reduced filters are robust, and accurate for small noise systems. They also shed light on how to tune the reduced filters for stochastic turbulence. Keywords: Model reduction, reduced Kalman filters, filter robustness, filter accuracy 1 Introduction Data assimilation, the numerical prediction procedure for partially observed processes, has been a central problem for science and engineering for decades. In this new age of technology, the dimensions of filtering problems have grown exponentially, as a result of the increasingly abundant observations and ever growing demand for prediction accuracy. In geophysical applications such as numerical weather forecasting, the dimensions are staggeringly high, often exceeding d = 106 for the prediction variables, and q = 104 for the observations. In 1 such a context, the well known Kalman filter is no longer computationally feasible. Its direct implementation requires high dimensional matrices product and inversion, resulting a computation complexity of O(d2 q), which far exceeds modern computing capability. One important strategy for high dimensional filtering is dimension reduction. Many geophysical and engineering problems have intrinsic multiscale structures [1, 2, 3], where the large scale variables have more uncertainty and of more prediction importance. In comparison, the small scale variables are driven by strong dissipation and fast oscillation, their values are more predictable but of less significance. Intuitively, one would like to apply the full filtering procedures for the large scale variables, while estimating the small scale variables with some simplified strategy. This paper investigates two such general strategies: estimate the small scale variables by their statistical equilibrium state, or use a constant statistical state as prior in each filtering step for the small scale. The resulting two-scale reduced filters will be called the dynamically decoupled reduced Kalman filter (DRKF) and general reduced Kalman filter (RKF) respectively. These ideas have been applied earlier to stochastic turbulence, and known as the reduced Fourier domain Kalman filter (RFDKF) and variance strong damping approximate filter (VSDAF), see chapters 3 and 7 of [4]. Numerous numerical tests on these reduced filters [4, 5] have shown their performances are close to optimal in various regimes. And because only the large scale variable of dimension p is fully filtered, the complexity is reduced significantly to O(dq 2 + p2 q). While the two-scale reduced filters have simple intuition and successful applications, there is no rigorous analysis framework for its performance. Precisely speaking, we are interested in the statistical and dynamical features of filter error en . In the classical Kalman filtering context, we have complete knowledge of en , as its covariance is correctly estimated by the optimal filter, which follows a Riccati equation that quickly converges to an equilibrium state [6]. As for the reduced filters, the filter error covariance Een ⊗en no longer matches its reduced estimator Cn because of unavoidable model errors, which create bias through multiplicative inflation, representation error in the observations, and crude localization. Instead, it follows an online recursion where model reduction procedures constantly introduce structural biases. As a consequence, there is an intrinsic barrier between the reduced filters and the optimal one [7, 5]. The classical framework of showing approximate filters are close to the optimal one is not valid in this scenario [8, 9, 10, 11]. This paper proposes and applies a new performance analysis strategy for the reduced filters in the subtle context of Kalman filters with random coefficients ([6], and chapter 8 of [4] for an application in large dimensions). It consists of two parts. The first part examines the fidelity of the reduced covariance estimator Cn , and aims to show the true error covariance is not underestimated, which is essential for rigorous uncertainty quantification. The direct approach, showing Een ⊗en  Cn , is applicable to RKF if the dimension reduction procedure preserves this inequality, while the system noises are uncorrelated with the system coefficients. Another more general but weaker approach considers the Mahalanobis error ken k2Cn = eTn Cn−1 en . By showing d1 Eken k2Cn is bounded by a dimension free constant, we show the error covariance estimator is not far off from the true value. This is carried out by the Mahalanobis error dissipation, which is an intrinsic dynamical mechanism for Kalman type updates. It holds for both RKF and DRFK even with system noises that are correlated. The second objective is to find a bound for the covariance estimator Cn . Two signal observation systems with augmented coefficients are considered, and we show their Kalman 2 filter covariances are respectively the covariance estimator of DRKF and an upper bound for the covariance estimator of RKF. By building this connection, we transfer our original problem of reduced filters to a problem of standard classical Kalman filters. The latter has a rich literature we can rely on, so there are multiple ways to bound Cn . In addition, we can rely on conditions of these augmented Kalman filters to ensure the dimension reduction procedures do not decrease the covariance. In combination, the previous results can also provide accuracy measurement for the reduced filters, in terms of the mean square error (MSE) E|en |2 , and how far off they are from the optimal filter. In practice, many models like stochastic turbulence could have various ways to do the two-scale separation [12, 13]. Moreover, most practical reduced filters employ various covariance inflation techniques to ensure no covariance underestimation [14, 15, 16]. Which dimension reduction method is better, and how to tune the filter parameters, are important practical questions, yet previously can only rely on extensive numerical experiments for answers. In this perspective, our framework can be used for a priori answers, or rigorous support for previous numerical findings. The remainder of this section intends to give a quick overview of our results, while the detailed formal statements along with the proofs are left in the later sections. 1.1 Kalman filtering in high dimension Consider a signal-observation system with random coefficients [6]: Xn+1 = An Xn + Bn + ξn+1 Yn+1 = Hn Xn+1 + ζn+1 (1.1) where ξn+1 and ζn+1 are two sequences of independent Gaussian noise, ξn+1 ∼ N (0, Σn ) and ζn+1 ∼ N (0, σn ). We assume the signal variable Xn is of dimension d, the observation variable Yn is of dimension q ≤ d, and the observation noise matrix σn is nonsingular to avoid illposed problems. The realizations of the dynamical coefficients (An , Bn , Σn ), the observation coefficients (Hn , σn ), as long as Yn are assumed to be available, and the objective is to estimate Xn . By considering general random coefficients, many interesting models involves intermittent dynamical regimes or observations can be included in our framework. Details will be discussed in Section 6. The optimal filter for system (1.1) is the Kalman filter [6, 17, 4], assuming (X0 , Y0 ) is Gaussian distributed. It estimates Xn with a Gaussian distribution N (mn , Rn ), where the mean and covariance follow a well known recursion: bn+1 ), mn+1 = An mn + Bn + Kn+1 (Yn+1 − Hn mn ), Rn+1 = K(R bn+1 = An Rn ATn + Σn , Kn+1 = R bn+1 Hn (σn + Hn R bn+1 HnT )−1 , R (1.2) K(C) = C − CHn (σn + Hn CHnT )−1 HnT C. The Kalman filter has found a wide range of applications in various fields. This is due to its theoretical optimality, robustness and stability in the classical low dimensional setting. However, in many modern day applications where the system dimension reaches 106 , direct application of (1.2) is no longer feasible, because the computation complexity of 3 (1.2) is roughly O(d2 q) = 1016 , which is far beyond the speed of standard high performance computing, 1012 . A simple complexity analysis with details is in Section A. Beside the dimension reduction strategies discussed below, there are various ways to approximate the Kalman filter by random sampling. These methods are known as the ensemble Kalman filters (EnKF) [18, 19]. They require various ad-hoc tuning techniques [14, 15, 16, 20]. Moreover, most of the theoretical properties of EnKF are not well understood, except recent results on well-posedness, nonlinear stability, and geometric ergodicity [21, 22, 23, 24]. Quantitative analysis of the filter error size remains an open question except in the limit of a large sample size that exceeds the dimension [10, 11]. 1.2 Two-scale separation and reduced Kalman filters Dynamical features of system (1.1) can often be exploited for dimension reduction and fast computation of Kalman filters. In this paper, we focus on scenarios where system (1.1) has a two-scale separation  L Xn Xn = . XnS Here, XnL consists of p( d) large scale variables, and XnS consists of d − p small scale variables. Throughout, PL and PS will denote the associated subspaces, and PL and PS will denoted the associated projections. In Section 6.3.2, we will consider a simple stochastic turbulence model (see [4]), where An is a constant matrix consists of 2 × 2 diagonal sub-blocks with spectral norm exp(−νh|k|2 ). For the small scale Fourier modes with large wavenumber |k|, An is a very strong damping. As a consequence, the small scale variables have very little uncertainty, and often are driven by fast oscillations. Their exact values are of little importance, and also stiff for numerical computations. This simple example captures a feature shared by many complicated turbulence models. In such a scenario, it is a common strategy to apply dimension reduction and try to filter only for the large scale part. One naive way of dimension reduction would be directly ignoring the the small scale part. But this is usually problematic. Despite that XnS has small uncertainty in each coordinate, the observation operator Hn = [HnL , HnS ] involves all coordinates: Yn+1 = HnL XnL + HnS XnS + ζn+1 . (1.3) As a sum, XnS could have significant contribution to the observation Yn . Directly ignoring the small scale would create a huge bias, as the filter would try to interpret the contribution of XnS in term of XnL , which is called representation error [12, 13]. The correct filter reduction requires some simple but educated estimation of the filter impact from the small scale variables. 1.2.1 Dynamical decoupled reduced Kalman filter (DRKF) One simple closure of the small scale variables would be their statistical equilibrium states. This idea was applied for stochastic turbulence in chapter 7 of [4] and named the RFDKF. To generalize it, we consider a simplified setting where the dynamics of the signal variable 4 Xn is decoupled between the two scales. In other words, the system coefficients of (1.1) have the following block structure:   L  L  L   L Bn ξn Σn 0 An 0 , Bn = , ξn = S , Σn = . (1.4) An = 0 ASn BnS ξn 0 ΣSn The diagonal An used for stochastic turbulence in Section 6.3.2 obviously fits this description. Notice that with observation mixing the two scales (1.3), the optimal Kalman filter does not necessarily have a block diagonal structure, so we cannot directly apply a large scale projection to (1.2). The DRKF filtering strategy comes as a combination of two ideas. First, if the small scale has very small fluctuation, then its mean conditioned on the system coefficients, µSn , will S be a good estimator. Second, the small scale observation HnS Xn+1 is interpreted as a noisy perturbation to the large scale observation. We can remove the mean of this perturbation by letting YnL = Yn − HnS µSn+1 . S S We also need to consider the fluctuation at the small scale ∆Xn+1 = Xn+1 − µSn+1 . By interpreting it as a mean zero Gaussian noise, we need to include the representative error covariance: S σnL = σn + HnS Vn+1 (HnS )T . Here VnS is the unfiltered covariance of XnS conditioned on the system coefficients. In this S } as an independent sequence. Unfortunately this is not the case in way, we treat {∆Xn+1 reality and creates model error, and we remedy it by inflating the covariance in the end with a factor r > 1. In summary, DRKF estimates XnL and XnS by Gaussian distributions (µLn , CnS ) and (µSn , VnS ) respectively. The mean and covariance sequences are updated as below: L µLn+1 = ALn µLn + BnL + Kn+1 (YnL − HnL (ALn µLn + BnL )), bL ), C bL = AL C L (AL )T + ΣL , C L = rKL (C n+1 L Kn+1 n+1 = n+1 bL (H L )T (σ L C n+1 n n + n n n n bL (H L )T )−1 , HnL C n+1 n L T −1 L b L bL (H L )T (σ L + H L C bL = −C n+1 n n n n+1 (Hn ) ) Hn Cn+1 , S YnL = Yn − HnS µSn+1 , σnL = σn + HnS Vn+1 (HnS )T , S = ASn CnS (ASn )T + ΣSn . µSn+1 = ASn µSn + BnS , Vn+1 bL ) KL (C n+1 bL C n+1 (1.5) DRKF uses an idea like 3DVar on the small scales [25, 26] with reduced filtering of the large scales. Since the filter essentially works only in the large scale subspace, the computational complexity is reduced to O(q 3 + p2 q) or O(q 3 + p2 q + d2 ) , see Section A. Also see chapter 8 of [4] for an application of DRKF to random filtering of geophysical turbulence. 1.2.2 General RKF When the two scales are not dynamically decoupled, the DRKF (1.5) may have bad performances. This is because DRKF does not filter the small scale part, while the small scale error feeds back to the large scale estimation through the cross scale dynamics (see page 5 43 of [4] for an example). Another more appropriate reduced filtering strategy would be filtering the small scale with a constant prior covariance DS as an estimate of the small scale dynamics. This will be called a general reduced Kalman filter (RKF). It has been applied to stochastic turbulence in chapter 7 of [4] and called VSDAF. To be specific, a fixed PS ⊗ PS matrix DS will be used as the prior for the small scale variables. So given a covariance estimator Cn for XnL , the effective covariance of Xn will be Cn+ := Cn + DS . In many applications, DS can be chosen as a multiple of the unfiltered equilibrium covariance of XnS . But it can also take other general matrix values. In summary, the RKF estimates Xn by a Gaussian distribution N (µn , Cn + DS ), with the mean and covariance generated by a recursion: bn+1 C b n+1 (Yn+1 − Hn µn ), µn+1 = An µn + Bn + K b n+1 = C bn+1 Hn (σn + Hn C bn+1 HnT )−1 , = An Cn+ ATn + Σn , K bn+1 )PL . Cn+1 = rPL K(C (1.6) With a complexity estimation in Section A, we see RKF reduces the complexity to O(d2 + dq 2 + dp2 ). Unlike DRKF, RKF applies a large scale covariance projection in the final step. This ensures the prior covariance for small scale variable at the next step is still DS . Its practical effect is similar to the localization techniques that are widely applied, as both simplify the covariance structures. On the other hand, this projection may underestimate the error covariance for the new update. To offset this effect, a multiplicative inflation with r > 0 is applied, and in the effective covariance estimator we also include the constant covariance DS . Ideally, such inflations will remedy the possible covariance underestimation, so that + bn+1 )  Cn+1 bn )PL + DS . K(C = rPL K(C (1.7) To be pragmatic, (1.7) holds only for large n, and we need to introduce a time series for the ratio between both sides. This will be formalized as Assumption 2.1 in Section 2. Note that RKF requires much less detailed dynamics of the small scale than DRKF but still includes an estimate of the effect of the small scale on the observations. 1.3 Covariance fidelity Just like many other practical filters, although the reduced Kalman filters produce good estimates in various numerical tests, there is no good rigorous explanation of their successes. A quantitative analysis for the filter error is required for this purpose. In our context, the filter error of RKF and DRKF are given respectively by eLn = XnL − µLn . e n = Xn − µn , Notice that we do not consider the small scale estimator error for DRKF, as the small scale variables are not filtered there. Error analysis for reduced filters is much more difficult than 6 the error analysis for the optimal filter. For the optimal filter (1.2), the covariance of the error Xn − mn is simply its estimator Rn , which can be easily studied by the associated Riccati equation [6]. For the reduced filters, the reduced estimators Cn+ and CnL clearly do not match the real filter error covariance, while the estimator is also biased by the dimension reduction. One classic error analysis strategy for non-optimal filters is to compare them with the optimal filter and show the differences are small [8, 9, 10, 11]. Roughly speaking, this strategy assumes the non-optimal filter is very close to the optimal filter at one time, and then exploits the intrinsic ergodicity and continuity of the optimal filter to show the difference remains small there after. Unfortunately this strategy is invalid for our reduced filters, because they are structurally different from the optimal filter (1.2). Evidently, Rn may not have a block diagonal structure like Cn+ does, it may not have its PS ⊗ PS sub-block being exactly DS , and this sub-block can never be zero as in the case for DRKF. This is also known as the information barrier for reduced filters, investigated by [7, 5]. A more pragmatic strategy would be looking for intrinsic error statistical relations. In particular, it is important to check whether the reduced covariance estimators dominate the real error covariance, as underestimating error covariance often causes severe filter divergence (see chapter 2 of [4]). The direct way will be looking for Een ⊗en  Cn+ . This is applicable for RKF if the system noises are independent of the system coefficients, for example when the latter are deterministic. But for general scenarios and DRKF, the error covariance matrix Een ⊗ en is hard to track, as nonindependent system noises are involved in the recursion. For these difficult situations, we need to look at other weaker scalar statistics. One natural choice would be the mean square error (MSE), E|en |2 . But MSE works best when the error is isotropic, in other words the error has equal strength in all directions. Our two-scale setting clearly does not fit into this description, as the small scale error is much weaker. In comparison, the Mahalanobis norm is a better error measurement. Given a nonsingular d × d positive definite (PD) matrix C, it generates a Mahalanobis norm on Rd : kvk2C := v T [C]−1 v. (1.8) This norm is central in many Bayesian inverse problems. For example, given the prior distribution of X as N (b, C), and a linear observation Y = HX + ξ with Gaussian noise ξ ∼ N (0, Σ), the optimal estimate is the minimizer of kx − bk2C + kY − Hxk2Σ . In our context, it is natural to look at the non-dimensionalized Mahalanobis error d1 ken k2C + and n 1 L 2 + ke k . Based on our RKF formulation, the true state is estimated by N (µ , C L n n Cn n ). A p 1 2 natural statistics that verifies this hypothesis is simply d Eken kC + . If the hypothesis holds, n this statics should roughly be of constant value. Comparing with the MSE, the Mahalanobis error discriminates directions, and penalizes errors in the small scale. Moreover, by showing the Mahalanobis error is bounded, we also show the error covariance estimate Cn+ more or less captures the real error covariance. The Mahalanobis error also has surprisingly good dynamical properties. In short, ken k2C + n is a dissipative (also called exponentially stable) sequence. This is actually carried by an intrinsic inequality induced by the Kalman covariance update operator K. It was exploited by previous works in the literature [6, 27] to show robustness of Kalman filters and extended Kalman filters (although the name Mahalanobis error is not explicitly used, but readers can 7 identify it easily in the proofs). One major result of this paper is informally stated as below: Theorem 1.1. When applying DRKF (1.5) to a dynamically decoupled system (1.4), the non-dimensionalized Mahalanobis filter error p1 EkeLn k2CnL decays exponentially fast and is eventually bounded by a dimension free constant. When applying RKF (1.6) to a general system described by (1.1), if the large scale projection does not decrease covariance estimate so (1.7) holds, the non-dimensionalized Mahalanobis filter error d1 Eken k2C + decays exponentially fast and is eventually bounded by a n dimension free constant. In addition, if the system noises are independent of all system coefficients, the second moment of error is dominated by its estimator: Een ⊗ en  Cn+ . The formal description is given by Theorems 2.1, 2.2, and 3.1. The requirement of (1.7) will be replaced by a concrete version Assumption 2.1, which is chosen to be always valid in e S  CDS for a suitable constant C > 0 depending Section 4 for RKF provided that PS RP e is the stationary asymptotic covariance for (1.6). on r, where R 1.4 Intrinsic filter performance criteria Theorem 1.1 essentially shows that the Mahalanobis error is a natural and convenient statistics to assess reduced filter performance. On the other hand it raises two new questions for us to address: • Bounds of the Mahalanobis error are informative only if the covariance estimator CnL or Cn+ is bounded. So how can these estimators be bounded? • A large scale projection is applied for RKF in the assimilation step. It may decrease covariance estimation. Ideally this can be offset by the covariance inflations so (1.7) holds. In principle, (1.7) requires online verifications during the implementation of RKF. Yet, offline a priori criteria that depend only on the system coefficients are more desirable. Moreover, since the long term performance is more useful, the answers to the previous questions should not depend on the filter initialization. Let us consider DRKF first, which requires answering only the first question. In fact, the answer is quite straightforward. Consider the following augmented signal-observation system: 0 0 L0 L0 L , , Yn+1 = HnL Xn+1 + ζn+1 Xn+1 = A0n Xn0 + Bn + ξn+1 (1.9) √ 0 0 0 L L L 0 An = rAn , ξn+1 ∼ N (0, Σn ), Σn = r Σn , ζn+1 ∼ N (0, σnL ). The optimal filter of the above system is a Kalman filter N (mLn , RnL ). It is easy to verify that RnL = CnL /r if it holds at n = 0, because RnL follows a Riccati recursion just like (1.5). The advantage we gain from this observation is that, as a Kalman filter covariance, enL , assuming the system (1.9) is stationary, RnL converges to a unique stationary solution R ergodic, weakly observable and controllable (See [6] and Theorem C.1). This stationary solution reflects the intrinsic filtering skills of (1.9). It is clearly bounded and independent of the filter initialization, and in many cases it can be computed or admits simple concrete upper bounds. 8 The same idea holds similarly for RKF. The corresponding inflated signal-observation system is slightly different from (1.1) with an inflation r0 > r: A0n = √ 0 0 Xn+1 = A0n Xn0 + Bn + ξn+1 , r 0 An , ξn+1 ∼ N (0, Σ0n ), 0 0 0 Yn+1 = Hn Xn+1 + ζn+1 , Σ0n = r0 Σn + r0 An DS ATn , ζn+1 ∼ N (0, σn ). (1.10) en denotes the associated stationary Kalman covariance sequence, then it possesses all the If R eL . Theorem 4.2 in below transfers theoretical and computational advantages mentioned for R n + en + DS . Moreover, Theorem 4.2 shows these advantages to RKF by showing that Cn  rR that the online condition (1.7) can be verified by a similar version for the stationary solution en , which will be Assumption 4.1; but because R en can be estimated a priori, we find an a R priori criterion that guarantees the performance of RKF. en can be bounded explicitly in enL and R In Section 6, we will discuss some scenarios when R spectral norm or with respect to the optimal covariance Rn . Then Theorem 1.1 implies the MSE Eken k2 is bounded, or the reduced filter performance is comparable with the optimal one. In many practical scenarios where the observation is frequent, the system noise Σn and observation noise σn are of scale  comparing to other system coefficients. Then it is easy to en and R eL scale like 2 , and so will the reduced filter errors. This verify in such a setting R n is a nontrivial property for the reduced filters and evidently very useful in practice. This is usually framed as the accuracy of system estimators [25, 26]. Other than accuracy, another important application for our framework is finding the transition point for two-scale separation, and how to setup the small scale covariance DS for RKF. These questions can be answered by studying the Kalman filters for (1.9) and (1.10). Section 6 discusses these issues with concrete examples in stochastic turbulence. 1.5 Preliminaries The remainder of this paper is arranged as follows. Although RKF (1.6) applies to more general systems, its error analysis is structurally simpler than the one of DRKF. Section 2 starts our discussion by first showing the second moment of RKF error is bounded by Cn+ in Theorem 2.1, and then the dissipation of the Mahalanobis error through Theorem 2.2, where a more pragmatic online Assumption 2.1 formalizes (1.7). A direct Corollary 2.4 shows that the filter is exponentially stable for the mean sequence. The additional structural complexity of DRKF comes from the fact that the small scale fluctuation sequence is not an independent one. Section 3 resolves this issue by proving Theorem 3.1. Section 4 introduces some intrinsic performance criteria for the reduced filters. This is carried out by a comparison with the Kalman filters for the inflated systems (1.9) and (1.10). The details are in Proposition 4.1 and Theorem 4.2. Immediate corollaries for RMS and accuracy are also drawn there. Section 5 generalizes this idea to more general stochastic settings. Finally, Section 6 reviews some classical methods to control the Kalman filter covariance, and applies it to stochastic turbulence in Fourier domain in various dynamical and observational settings. The related complexity estimates, convergence to stationary Kalman covariance and some matrix inequalities are discussed in the supplementary material. Before we start the discussion, here are a few standard notations we will use in the following. kCk denotes the spectral norm of a matrix C, and |x| is the l2 norm of a vector 9 x. We use x ⊗ x to denote the rank 1 matrix xxT generated by a column vector x. We use C ∈ P D(P SD) or simply C is PD (PSD) to indicate a symmetric matrix C is positive definite (semidefinite). [C]j,k denotes the (j, k)-th coordinate of a matrix C, and [C]I 2 is the sub-matrix with both indices in a set I. And A  B indicates that B − A ∈ P SD. dae is the smallest integer above a real number a. We assume the filter initializations are known and of deterministic values. Generally speaking, there are no specific requirements for their values. But some results implicitly rely on the invertibility of the covariance matrices. Following [6], we say a random sequence Z0 , Z1 , . . . is stationary, if (Z0 , Z1 , . . .) and (Zk , Zk+1 , . . .) have the same distribution. We say such sequence is ergodic, if there is only one invariant measure for the shifting map (Z0 , Z1 , . . .) 7→ (Z1 , Z2 , . . .). There will be three filterations in our discussion. The first one contains all the information of system coefficients up to time n, and the initial covariance for the filters: e0 , R eL }. Fnc = σ{Ak , Bk , Σk , Hk , σk , k ≤ n} ∨ σ{R0 , C0 , C0L , V0S , R 0 Noticeably, all the filter systems have their covariance inside this filteration: eL , Ck , R ek , k ≤ n + 1} ⊂ F c . σ{Rk , CkL , R k n We will use F c = ∨n≥0 Fnc to denote all the information regarding the system coefficients through the entire time line. When the system coefficient and initial filter covariances are deterministic, F c is trivial, so EF c = E. The second filteration in addition includes information of the observation and mean initialization Fno = σ{Yk , k ≤ n} ∨ σ{m0 , µ0 , µL0 } ∨ Fnc . This filteration also contains the filter mean sequence mn , µn , µLn . The last filteration contains all the information of system (1.1) up to time n, Fn = Fnc ∨ σ{ζk , ξk , k ≤ n}. We use En Z, EF Z to denote the conditional expectation of a random variable Z with respect to Fn or another fixed σ-field F respectively. 2 Covariance fidelity of RKF In the RKF formulation (1.6), the multiplicative inflation r > 1 in large scale, and the constant inflation in small scale Ds , intend to remedy the side effect of large scale projection PL and ensure the covariance estimate does not decrease after the dimension reduction. To be more pragmatic, we measure the actual covariance underestimation caused by this dimension reduction step, through the following sequence of ratios: + bn+1 )  bCn+1 βn+1 = sup{b ≥ 0, K(C }. (2.1) + Intuitively, if this sequence is bounded below from one eventually, Cn+1 does not underestimate the error covariance. More formally, we assume 10 aspt 2.1 (Acceptable reduction). We say the dimension reduction in RKF is asymptotically acceptable if there is a finite adjustment time n0 and a β ∗ < 1 such that βn ≤ β ∗ for all n ≥ n0 . Moreover, we say the RKF enters the acceptable reduction phase, when n ≥ n0 . Noticeably, this is an online criterion, so its verification requires an implementation of RKF. Section 4 will provide an a priori criterion Assumption 4.1 that is sufficient for Assumption 2.1. 2.1 Second moment of error with system independent noises In many scenarios, the system noises depend on the system coefficients only through Σn and σn . Precisely speaking: ξn+1 ∼ N (0, Σn ), ζn+1 ∼ N (0, σn ) conditioned on F c ∨ Fn . (2.2) For simplicity, we will describe (2.2) simply as the system noises are independent of the system coefficients. In the classical setting for Kalman filtering, where the system coefficients are deterministic, this holds automatically. But it may fail in some conditional Gaussian systems. Using (2.2), the monotonicity of Kalman updates operator, the second moment of error EF c en ⊗ en is traceable, and is in fact bounded by the effective covariance estimator Cn+ . Theorem 2.1. Suppose the system noises are independent of the system coefficients, so (2.2) holds. For any fixed inflation ratio r > 1, consider applying the RKF (1.6) to system (1.1). Suppose the dimension reduction in RKF is asymptotically acceptable as described in Assumption 2.1. Then with any fixed initial conditions, when n ≥ n0 + d− log k[EF c en0 ⊗ en0 ][Cn+0 ]−1 k/ log β ∗ e, the second moment of the error en = Xn − µn is dominated by the covariance estimator: EF c en ⊗ en  Cn+ a.s.. If we take average of both hands, this implies that Een ⊗ en  ECn+ . Notice that the dependence of n on EF c en0 ⊗ en0 is logarithmic, so in practice the exact value of EF c en0 ⊗ en0 is not very important. Proof. Define the following sequence using Lemma B.4 ψn = inf{ψ : EF c (en ⊗ en )  ψCn+ } = kEF c (en ⊗ en )[Cn+ ]−1 k, n ≥ m. We claim that ψn+1 ≤ max{1, ψn βn+1 }. (2.3) Then by Assumption 2.1, for n ≥ n0 , ψn+1 converges to 1 geometrically with ratio β ∗ , so the claim of this theorem holds. 11 In order to show (2.3), consider the forecast error ên+1 = Xn+1 − (An µn + Bn ). The following recursion can be established: ên+1 = An en + ξn+1 , b n+1 Hn )ên+1 − K b n+1 ζn+1 . en+1 = (I − K In combination: b n+1 Hn )An en + (I − K b n+1 Hn )ξn+1 − K b n+1 ζn+1 . en+1 = (I − K b n+1 Hn )An ∈ F c , where ξn+1 and ζn+1 are conditionally mean zero based on Because (I − K (2.2), we find T b n+1 ] b n+1 Hn )(An (en ⊗ en )ATn + Σn )(I − K b n+1 Hn )T + K b n+1 σn K EF c en+1 ⊗en+1 = EF c [(I − K b n+1 Hn )T + K b T σn K b n+1 ] (2.4) b n+1 Hn )(An EF c en ⊗ en ATn + Σn )(I − K = [(I − K n+1 b n+1 Hn )(ψn An C + AT + Σn )(I − K b n+1 Hn )T + K b T σn K b n+1  (I − K n n n+1 b n+1 Hn )(An C + AT + Σn )(I − K b n+1 Hn )T + K b T σn K b n+1 ] = ψn K(C bn+1 ).  ψn [(I − K n n n+1 In the penultimate step, we used that ψn ≥ 1, and also the well known matrix identity for Kalman update bn+1 ) = (I − K b n+1 Hn )C bn+1 (I − K b n+1 Hn )T + K b T σn K b n+1 . K(C n+1 bn+1 )  ψn βn+1 Cn+1  ψn+1 Cn+1 . By the definition of βn+1 (2.1), we have ψn K(C Remark 2.2. In fact, if EF c e0 = 0, one can also show EF c en = 0 in this setting, so EF c en ⊗ en is actually the error covariance. But rigorously speaking, the RKF mean µn is a biased estimator. Unbiasedness would require EFno en = 0 a.s., which in general does not hold. In order to avoid confusions, we did not mention this fact in the theorem. 2.2 Mahalanobis error dissipation If the system coefficients have dependence on the system noises, the Kalman gain matrix b n+1 may have correlation with the error term en . So the identity (2.4) no longer holds, K and the second moment of the error is not traceable. But even in this difficult scenario, an intrinsic matrix inequality still holds. In the context of the optimal Kalman filter (1.2), it can be formulated as −1 ATn (I − Kn+1 Hn )T Rn+1 (I − Kn+1 Hn )An  Rn−1 , and for RKF it becomes (2.8) in below. From this perspective, the Mahalanobis error ken k2C + n is a natural statistics that dissipates through time. Theorem 2.2. For any fixed inflation r > 1, consider applying the RKF (1.6) to system (1.1). Suppose the dimension reduction in RKF is asymptotically acceptable as described by Assumption 2.1, then Eken k2Cn+ ≤ (β ∗ )n−n0 Eken0 k2Cn+ + 0 2d . 1 − β∗ In other words, the Mahalanobis error is dissipative after the transition time n0 . 12 Proof. We will show that given any n, En ken+1 k2C + n+1 ≤ βn+1 ken k2Cn+ + 2dβn+1 . (2.5) Then the original claim of this theorem can be achieved by applying the Gronwall’s inequality in discrete time. To show (2.5), recall that in the proof of Theorem 2.1, the filter error has the following recursion: b n+1 Hn )An en + (I − K b n+1 Hn )ξn − K b n+1 ζn+1 . en+1 = (I − K Since ξn+1 and ζn+1 are independent of Fn conditioned on Σn and σn , we find that b n+1 Hn )T [C + ]−1 (I − K b n+1 Hn )An en En eT [C + ]−1 en+1 = En eT AT (I − K n+1 n+1 n n (2.6) n+1 T + −1 b b n+1 Hn )T [C + ]−1 (I − K b n+1 Hn )ξn+1 + En ζ T K bT + En ξn+1 (I − K n+1 n+1 n+1 [Cn+1 ] Kn+1 ζn+1 . (2.7) For the first part (2.6), we claim that b n+1 Hn )T [C + ]−1 (I − K b n+1 Hn )An  βn+1 [C + ]−1 . ATn (I − K n+1 n (2.8) + bn+1 )  (I − K b n+1 Hn )C bn+1 (I − K b n+1 Hn )T . To see that, notice by (2.1) βn+1 Cn+1  K(C b n+1 Hn ) = (I + C bn+1 HnT σn−1 Hn )−1 is clearly invertible. The inversion of the Moreover (I − K inequality above reads b n+1 Hn )T [C + ]−1 (I − K b n+1 Hn )  βn+1 C b−1 . (I − K (2.9) n+1 bn+1  Next, notice that C An Cn+ ATn , n+1 so + −1 b n+1 Hn )[Cn+1 b n+1 Hn )An  βn+1 C bn+1 An (I − K ]−1 (I − K  βn+1 An [An Cn+ ATn ]−1 ATn , which by Lemma B.2 leads to (2.8). To deal with (2.7), we use the identity aT Aa = tr(AaaT ) and the independence of ξn+1 , ζn+1 , b n+1 Hn )T [C + ]−1 (I − K b n+1 Hn )ξn+1 + ζ T K b T [C + ]−1 K b n+1 ζn+1 En ξ T (I − K n+1 n+1 n+1 n+1 n+1 b n+1 Hn )[C + ]−1 (I − K b n+1 Hn )T Σn + K b n+1 σn K b T [C + ]−1 ]. = En tr[(I − K n+1 n+1 n+1 bn+1  Σn , so Lemma B.2 implies: Note that by definition, C b n+1 Hn )[C + ]−1 (I − K b n+1 Hn )T Σn ] ≤ dβn+1 . tr[(I − K n+1 Also notice that T T bn+1 ) = (I − K b n+1 Hn )C bn+1 (I − K b n+1 Hn )T + K b n+1 σn K b n+1 b n+1 σn K b n+1 K(C K . (2.10) + + bn+1 )  K b n+1 σn K b T , tr(K b n+1 σn K b T [Cn+1 Then by βn+1 Cn+1  K(C ]−1 ) ≤ dβn+1 . By sumn+1 n+1 ming up (2.6) and (2.7), we have reached (2.5) and so ends the proof. Remark 2.3. In the analysis of the standard Kalman filter and extended Kalman filter, [6, 27] implicitly exploited the same mechanism but does not require a multiplicative inflation. The price they paid is that they require the covariance sequences Cn , Cn−1 , Σn and Σ−1 n to be bounded both from above. ([6] has weaker assumptions, but its results are qualitative rather than quantitative). With some extra works, we can as well removes the multiplicative inflation by adding similar conditions. But such conditions are usually very bad in high dimensional settings, as Σn may have many small scale entries being very close to zero. 13 2.3 Exponential stability Another useful property implied by the previous analysis is that RKF is exponentially stable. Let (µ0 , C0 ) and (µ00 , C0 ) be two implementations of RKF with the same covariance but different means. Then these two RKFs share the same covariance estimate, and the difference in their mean estimates is given by (µn − µ0n ) = Un,0 (µ0 − µ00 ), Un,m = n−1 Y b k+1 Hk )Ak . (I − K k=m So if kUn,0 k converges to zero exponentially fast, then so does the mean difference. In [6], this is called the exponential stability. cor 2.4. Under the conditions of Theorem 2.2, suppose also that supn kCn+ k < ∞, k[C0+ ]−1 k < ∞, then the RKF filter is exponentially stable as lim sup n→∞ Proof. Let Un,n0 = n−1 Y 1 b k+1 Hk )Ak ≤ 1 log β ∗ . log (I − K n 2 k=0 Qn−1 b k+1 Hk )Ak . By iterating (2.8) n times, we find that −K ! n Y + −1 T T + −1 kCn k Un,0 Un,0  Un,0 [Cn ] Un,0  βn [C0+ ]−1 . k=n0 (I k=1 Taking spectral norm on both hand side yields our claim. Sections 4 and 6 will discuss how to bound kCn+ k. 3 Covariance fidelity of DRKF In the dynamical decoupled scenario (1.4), DRKF has a significant advantage comparing with RKF: since no large scale projection is applied, there is no risk of underestimating the error covariance, so online criteria like Assumption 2.1 are not necessary. The disadvantages are two folds, first it has a special dynamical structural requirement, second the small scale fluctuation requires more technical treatments. To see the second point, it is straight forward to have the following recursion for the filter error, just like in the proof of Theorem 2.1, S L L L L L . HnL )ξn+1 − Kn+1 ζn+1 − Kn+1 HnS ∆Xn+1 HnL )An eLn + (I − Kn+1 eLn+1 = (I − Kn+1 S S Unlike ξn+1 and ζn+1 , in most situations, ∆Xn+1 = Xn+1 −µSn+1 has a nonzero correlation with the error eLn , as it is not an independent time series. Therefore the second moment matrix is not traceable because (2.4) no longer holds. On the other hand, the Mahalanobis error dissipation holds as a much more stable mechanism. In order to show that, we need additional conditions on the small scale dynamics ASn , and impose (2.2) type of independence condition on the small scale system. Fortunately, these conditions hold for many important examples in Section 6, and are trivial for a deterministic constant stable asymptotic covariances for the small scales. 14 Theorem 3.1. Consider applying DRKF (1.5) to system (1.1) with two-scale dynamical decoupling (1.4). Suppose there is a spectral gap λS < 1 such that ASk,j VjS (ASk,j )T  λSk−j VkS , ASk,j = ASk−1 · · · ASj+1 ASj . Assume also the distribution of the small scale system noise ξnS is N (0, σnS ), conditioned on the system coefficients σ-field F c . Then the following holds √ 2 4 λS rpγσ 2p(1 + γσ ) L 2 L 2 √ + √ (3.1) Eken kCnL ≤ n Eke0 kC L + 0 r r−1 ( r − 1)(1 − λS ) The last term comes from the time correlated small scale fluctuation, and the constant γσ is given by S γσ = sup{k[σnL ]−1 HnS Vn+1 (HnS )T k}. n≥0 Note that γσ ≤ 1, and it has the potential to be small if HnS VnS (HnS )T is small. Proof. The filter error follows the recursion: L L L L S eLn+1 = (I − Kn+1 HnL )ALn eLn + Kn+1 ζn+1 − Kn+1 HnL ξn+1 − Kn+1 HnS ∆Xn+1 . In order to take away the influence of ∆XnS , consider ẽLn = n X eLn − L Un,k QSk , S QSk := KkL Hk−1 ∆XkS , L L Un,k := (I−KnL Hn−1 )ALn−1 · · · (I−Kk+1 HkL )ALk . k=1 ẽLn follows the recursion L L L ẽLn+1 = (I − Kn+1 HnL )ALn ẽLn + Kn+1 ζn+1 − Kn+1 HnL ξn+1 . Then the proof of Theorem 2.2 is valid for ẽLn+1 completely the same, as long as we replace βn with 1r . In place of (2.5), we have En kẽLn+1 k2C L n+1 1 2d ≤ kẽLn k2CnL + . r r As a consequence of the Gronwall’s inequality, EkẽLn k2CnL ≤ r1n kẽL0 k2C L + 0 Young’s inequality 2 n X L Un,k QSk . EkeLn k2CnL ≤ 2EkẽLn k2CnL + 2E k=1 2d . r−1 Because of L Cn It suffices for us to bound E n X k=1 2 L Un,k QSk = L Cn X L T L E(QSj )T (Un,j ) [CnL ]−1 Un,k QSk . j,k≤n Following the proof of (2.8), a similar matrix inequality also holds for ERKF, 1 L L L HnL )ALn  [CnL ]−1 . (ALn )T (I − Kn+1 HnL )T [Cn+1 ]−1 (I − Kn+1 r 15 (3.2) L T L Therefore we have (Un,k ) [CnL ]−1 Un,k  rk−n [CkL ]−1 . The terms in the sum (3.2) with j = k can be bounded by L T L E(QSk )T (Un,k ) [CnL ]−1 Un,k QSk ≤ = ≤ = 1 rn−k 1 rn−k 1 rn−k 1 rn−k E(QSk )T [CkL ]−1 QSk S S Etr((KkL )T [CkL ]−1 KkL (Hk−1 ∆XkS ⊗ Hk−1 ∆XkS )) S S Etr((KkL )T [CkL ]−1 KkL EFkc (Hk−1 ∆XkS ⊗ Hk−1 ∆XkS )) S S Etr([CkL ]−1 KkL Hk−1 VkS (Hk−1 )T (KkL )T ). Similar to (2.10), we have S S L bkL )  rKkL σk−1 )T (KkL )T . VkS (Hk−1 (KkL )T  γσ−1 KkL Hk−1 CkL = rKL (C (3.3) As a consequence of Lemmas B.5 and B.3, the j = k terms in (3.2) can be further bounded by γσ pγσ L T L E(QSk )T (Un,k ) [CnL ]−1 Un,k QSk ≤ n−k Etr(Ip ) = n−k . (3.4) r r The j < k terms in (3.2) come from time correlations of ∆XkS . In order to bound them, notice that: L T L S L T L S E(QSj )T (Un,j ) [CnL ]−1 Un,k QSk = Etr((Hj−1 )T (KjL )T (Un,j ) [CnL ]−1 Un,k KkL Hk−1 )(∆XkS ⊗ ∆XjS )) L T L = Etr(WjT (Un,j ) [CnL ]−1 Un,k Wk )EFnc (∆XkS ⊗ ∆XjS )) S with Wk := KkL Hk−1 . The moving average representation of ∆XkS is: ∆XkS = ASk,j ∆XjS + k X ASk,i ξiS . i=j+1 Since for i > j, ξkS is distributed as N (0, σiS ) conditioned on Fnc ∨ Fj , EFnc ∨Fj (∆XkS ⊗ ∆XjS ) = EFnc ∨Fj (ASk,j ∆XjS ⊗ ∆XjS ) = ASk,j VjS . Therefore L T L L T L ) [CnL ]−1 Un,j QSj ) [CnL ]−1 Un,k QSk + (QSk )T (Un,k E(QSj )T (Un,j L T L L T L = Etr([WjT (Un,j ) [CnL ]−1 Un,k Wk ASk,j + (ASk,j )T WjT (Un,j ) [CnL ]−1 Un,k Wk ]VjS ). (3.5) In order to apply Lemma B.5, we are interested in bounding the symmetric matrix L T L L T L Zj,k := WjT (Un,j ) [CnL ]−1 Un,k Wk ASk,j + (ASk,j )T WkT (Un,k ) [CnL ]−1 Un,j Wj . Notice that for any PSD matrix C, matrices A and B, and γ > 0, the following holds (γ −1 A − γB)T C(γ −1 A − γB)  0 ⇒ γ −2 AT CA + γ 2 B T CB  AT CB + B T CA. 16 L L For our purpose, let A = Un,k Wk ASk,j , B = Un,j Wj , C = [CnL ]−1 , γ = (λS r) k−j 4 , and find L T L L T L Zj,k  γ −2 (ASk,j )T WkT (Un,k ) [CnL ]−1 Un,k Wk ASk,j + γ 2 WjT (Un,j ) [CnL ]−1 Un,j Wj . L T L To continue, recall that (Un,k ) [CnL ]−1 Un,k  rk−n [CkL ]−1 , and the relation (3.3). Then using Lemmas B.5 and B.3, S S L L T Wk ASk,j VjS ) ≤ rk−n tr((ASk,j )T (KkL Hk−1 )T [CkL ]−1 KkL Hk−1 ASk,j VjS ) ) [CnL ]−1 Un,k tr((ASk,j )T WkT (Un,k S S = rk−n tr([CkL ]−1 KkL Hk−1 ASk,j VjS (ASk,j )T (KkL Hk−1 )T ) S S VkS (KkL Hk−1 )T ). ≤ λSk−j rk−n tr([CkL ]−1 KkL Hk−1 Using (3.3) again, we find the quantity above is bounded by γσ λSk−j rk−n p. Likewise L T L S S )T ) ≤ rj−n γσ p. VjS (KjL Hj−1 tr(WjT (Un,j ) [CnL ]−1 Un,j Wj VjS ) ≤ rj−n tr([CjL ]−1 KjL Hj−1 As a consequence, (3.5) ≤ Etr(Zj,k VjS ) ≤ 2r k+j −n 2 k−j λS 2 γσ p. (3.6) Finally, we can bound (3.2) by (3.4) and (3.6): √ n X X j−n X k−j p rpγσ 2 λS rpγσ 2 √ (3.2) ≤ λS ≤ + 2p r 2 + √ . n−k r r − 1 ( r − 1)(1 − λ ) S j<n k≥j+1 k=1 Remark 3.1. In the first appearance, the formulation of the result may suggest the bigger the inflation strength r, the smaller the filter error. In fact, this is an artifact caused by the usage of Mahalanobis error. The covariance estimator CnL may have a super linear growth with respect to r. This is slightly discussed in the next section. On the other hand, bigger r does imply stronger stability. Following the same proof of Corollary 2.4, the exponential stability holds for DRKF as well: cor 3.2. Under the conditions of Theorem 3.1, suppose also that k[C0L ]−1 k < ∞, sup kCnL k < ∞, n then the DRKF filter is exponentially stable as n−1 Y 1 1 L (I − Kk+1 HkL )ALk ≤ − log r. lim sup log 2 n→∞ n k=0 17 4 Intrinsic performance criteria Sections 2 and 3 have demonstrated the covariance fidelity of the reduced filters. But in order for these results to be applicable to concrete problems, there are two issues: • The Mahalanobis error is informative for the filter error only when the covariance estimators CnL and Cn+ are bounded, and so is the claim that EF c en ⊗ en  Cn+ in Theorem 2.1. • Since RKF takes a large scale projection, it requires Assumption 2.1. This is an online criterion that can be verified only by implementing RKF. In practice, a priori criteria are more useful for verifications. Preferably, both questions should be answered independent of the reduced filters initialization. In this way, we capture the intrinsic reduced filter performance for system (1.1). The idea here is quite simple, we will consider two signal-observation systems (1.9) and en eL and R (1.10) as augmentations of system (1.1), and use their Kalman filters covariance R n as a performance reference. These reference filters are important for our reduced filters, been and C L , C + eL , R cause Proposition 4.1 and Theorem 4.2 show direct connections between R n n n respectively. This approach has four advantages: 1) The Kalman filter covariance Rn describes the smallest possible filter covariance for signalobservation systems like (1.1). Since the augmented systems (1.9) and (1.10) are roughly en are eL , R small perturbations of system (1.1), the associated Kalman filter covariance R n not too different from the proper part of Rn (Proposition 6.3 explores some sufficient enL , R en , the reduced filter covariance is conditions.) So if CnL or Cn+ are bounded by R comparable with the optimal. 2) Kalman filters are direct and intrinsic descriptions of how well systems like (1.1) can en on the system coefficients is very nonlinear. eL or R be filtered. The dependence of R n en instead of on the system coefficients makes our exposition Imposing conditions on R much simpler. 3) Unlike reduced filters, Kalman filter has been a classical research object for decades. There is a huge literature we can exploit. 4) In particular, Kalman filter covariance converges to a unique stationary solution of the associated Riccati equation in (1.2), assuming the system coefficients are ergodic stationary sequences, and other weak conditions hold. See [6] and Section C for details. This unique solution is independent of the initial condition. By imposing conditions on the stationary solution, our results for the reduced filters are independent of the initial conditions as well. When we refer to this stationary solution in the following discussion, we implicitly assume the existence of this unique stationary solution. 4.1 Kalman filters for comparison The connection of DRKF with the augmented system (1.9) is simple and direct: 18 Proposition 4.1. Consider applying DRKF (1.5) to system (1.1) with dynamical decoupling enL be the Kalman filter covariance for the large scale reference system (1.9) with (1.4). Let R enL = 1 CnL holds for n = 0, then it the same system coefficient realization as in (1.1). If R r holds for all n ≥ 0. Proof. Suppose our claim holds at time n. Then the Kalman filter covariance for system (1.9) follows: beL L L L L T L eL bL R n+1 = rAn Rn (An ) + Σn = An Cn An + Σn = Cn , therefore our claim holds at time n + 1 as well: 1 L beL L bL en+1 = KL (R R n+1 ) = KL (Cn+1 ) = Cn+1 . r In the case of RKF, we need to consider system (1.10), of which the Kalman filter en follows the recursion covariance R be en+1 = K(R R n+1 ), be 0 0 e T R n+1 = r An Rn An + Σn . (4.1) The Kalman update operator K is the same as in (1.2). Unlike Proposition 4.1, where we enL is directly a multiple of CnL , this time rR en will be an upper bound for Cn , which showed R en+  Cn+ . In addition, using this inequality, we can transfer the online Assumption leads to rR en : 2.1 to an assumption regarding R en be a (the unique stationary) positive definite (PD) aspt 4.1 (Reference projection). Let R solution of (4.1). Assume its small scale part is bounded as below with a 1r < β ∗ < 1 en PS  (β ∗ r − 1)DS . PS R As we discussed earlier in this section and with more details in Section C, the Riccati equation (4.1) has a unique stationary solution under weak conditions. Despite that Theorem 4.2 below works for any solution of (4.1), by considering the stationary solution it allows Assumption 4.1 to be independent of the initial conditions. Theorem 4.2. Consider applying RKF (1.6) to system (1.1), and the Kalman filter covarien for system (1.10). Then after a finite time n0 , the RKF error covariance estimate ance R en Cn+ is bounded by the reference covariance R en + DS , Cn+  rR e−1 C0 k)/ log(r0 /r)e. n ≥ n0 = dlog(kR 0 If in addition the reference projection Assumption 4.1 holds, then Assumption 2.1 also holds, and the acceptable reduction phase starts no later than n0 . 19 Proof. For all n ≥ 0, denote en } = k[R en ]−1 Cn k. νn = inf{ν : Cn  ν R Following the formulation of n0 , we assume ν0 < ∞. We claim that νn has the following recursive relation: (4.2) νn+1 ≤ r max{1, r10 νn }. en , we have This comes from a simple induction. Suppose that Cn  νn R bn+1 = An Cn AT + Σn + An DS AT  νn [An R en AT ] + Σ0  C n n n n be 1 ν R . r0 n n+1 Hence by the monotonicity and concavity of the operator K, Lemma B.1, be be 1 e bn+1 )  rK( 10 νn R Cn+1  rK(C n+1 )  r max{1, r0 νn }K(Rn+1 ) = νn+1 Rn+1 , r (4.3) which completes the induction. Then if we iterate (4.2) n0 time, we find that νn ≤ r, en , Cn  rR for all n ≥ n0 . Next, we prove the second claim of this theorem by showing a stronger result, that is the βn sequence defined by (2.1) can be bounded by νn ∗ 1 (β r − 1) + . 2 r r Then because νn ≤ r when n ≥ n0 , Assumption 2.1 is implied. To see (4.4), denote βn ≤ bn )PL = KLL , PL K(C bn )PS = KLS , PL K(C For any βn ≥ 1r , from p [ βn r − 1PL − bn )PL = KSL , PS K(C p βn r − 1PL − bn )[ √ 1 P ]K(C βn r−1 S (4.4) bn )PS = KSS . PS K(C √ 1 P ] βn r−1 S  0, we have (βn r − 1)KLL + 1 K βn r−1 SS  KSL + KLS . (4.5) en  1 νn (β ∗ r − 1)DS , so Finally note that, KSS  1r Cn  1r νn R r bn ) = KLL + KLS + KSL + KSS K(C   βn r νn (β ∗ r − 1)  βn rKLL + KSS  βn rKLL + DS . βn r − 1 r(βn r − 1) Note that our choice of βn in (4.4) makes the coefficient before DS less than 1, so the proof is finished. Remark 4.2. Assumption 4.1 is not the direct replacement of Assumption 2.1, as we need an additional constant β ∗ r − 1. This constant appears to be a necessary price to control the potential cross covariance between the two scales, which is achieved by a Cauchy Schwartz inequality (4.5). In certain scenarios, the cross covariance between two scales can be controlled by, say, localization structures, then the (4.5) is an overestimate, and β ∗ r − 1 can probably be replaced by 1. In other words, there might be scenarios where Assumption 2.1 holds while Assumption 4.1 does not. This is why we keep two assumptions in this paper instead of combining them. 20 4.2 Filter error statistics In applications, other than the Mahalanobis error generated by the estimated covariances CnL or Cn+ , there are other interesting error statistics: 1) The MSE E|en |2 . 2) The Mahalanobis error generated by the optimal filter covariance Rn . This statistics shows a comparison between the reduced filter and the optimal filter, as the optimal filter error satisfies EkXn − mn k2Rn = d. In many scenarios, we may find these error statistics equivalent to the Mahalanobis error generated by CnL or Cn+ . To see this, we can simply combine Theorems 2.2 and 4.2, cor 4.3. Suppose system (1.1) satisfies the reference projection Assumption 4.1, then the Mahalanobis error of RKF generated by the reference covariance is bounded uniformly in time: 2dr lim sup Eken k2Re+ ≤ . n 1 − β∗ n→∞ If in addition the system noises are independent of the system coefficients, (2.2), then en + DS . Een ⊗ en  rER As a consequence: en+ k ≤ R, then the MSE is bounded by lim sup E|en |2 ≤ • Suppose that lim sup kR in addition (2.2) holds, then E|en |2 ≤ rRd. 2Rdr . 1−β ∗ If e+  ρ2 Rn , where Rn is the covariance sequence of the optimal filter • Suppose that R n (1.2) and ρ ≥ 1, then the performance of RKF is comparable with the optimal filter, as 2 lim sup Eken k2Rn ≤ 2Rdrρ . If in addition (2.2) holds, then Een ⊗ en  ρ2 rERn . 1−β ∗ en+ k ≤ R or R en+  ρ2 Rn can be verified by various ways discussed The requirements that kR eL is not directly comparable in Section 6. As for DRKF, we consider only the MSE, because R n with Rn . cor 4.4. Suppose system (1.1) is dynamically decoupled in two scales (1.4), then if the e0L = 1 C0L and lim sup kR enL k ≤ R, the Kalman filter covariance of system (1.9) satisfies R r MSE of DRKF is bounded: √ 2Rp(1 + γσ ) 4 λS Rpγσ L 2 √ lim sup E|en | ≤ + . √ r2 − r (r − r)(1 − λS ) n→∞ 4.3 Reduced filter accuracy In many application scenarios, the observations are partial but very frequent and accurate. In such cases, one would expect the filter error to be small. This is quite easy to show for optimal Kalman filters, but not obvious for reduced filters. But with our framework, we can easily obtain the filter accuracy of the latter by the one of the former. 21 cor 4.5. Suppose system (1.1) is dynamically decoupled in two scales with the stationary enL k ≤ R; or suppose the reference Kalman filter covariance of system (1.9) being bounded kR projection Assumption 4.1 holds with the stationary Kalman filter covariance of system (1.10) en+ k ≤ R. In either case, assume the stationary Kalman covariance attracts being bounded kR other Kalman filter covariance sequence as in [6]. Then there is a DRKF, or RKF, for the following signal-observation system with small system and observation noises:   + ζn+1 . = Hn Xn+1 Yn+1  = An Xn + Bn + ξn+1 , Xn+1 (4.6) The MSE of this filter scales like 2 . More precisely, there is a constant DR such that lim sup E|en |2 ≤ 2 DR . n→∞   Here en stands for XnL, − µL, n for DRKF, or Xn − µn for RKF. Proof. In the dynamically decoupled case, the corresponding reference system will be 0 0 0 L = AnL XnL + Bn + ξn+1 , Xn+1 0 0 L 0 L + ζn+1 . = Hn Xn+1 Yn+1 enL, = 2 R enL , so The stationary Kalman filter covariance of this system will be R eL, k = 2 lim sup kR eL k ≤ 2 R. lim sup kR n n n≥0 n≥0 Then applying Corollary 4.4 we have our claim. As for the second case, we apply RKF with DS = 2 DS . The corresponding reference will be 0 0 0 Xn+1 = A0n Xn0 + Bn + ξn+1 , Yn+1 = Hn Xn+1 + ζn+1 . en , so e = 2 R The stationary solution of this system will be R n e+ k = 2 lim sup kR e+ k ≤ 2 R. lim sup kR n n n≥0 n≥0 Then applying Corollary 4.3 we have our claim. 5 General stochastic sequence setting en may not be a bounded In some challenging scenarios, the reference stationary covariance R sequence, then Assumption 4.1 cannot be verified. But weaker results may be obtainable, and interestingly the proofs do not need much of a change. The content of this section is not necessary for most parts of Section 6, and can be skipped in the first reading. An assumption that is more general than Assumption 2.1 would be requiring the truncation error converges to a sequence that is stable on average: aspt 5.1. Suppose there is a stochastic sequence βn∗ with a finite adjustment time n0 such that the sequence (2.1) satisfies βn ≤ βn∗ for all n ≥ n0 . 22 The generalization of Theorem 2.2 is Theorem 5.1. For any fixed inflation r > 1, consider applying the RKF (1.6) to system (1.1). Suppose the large scale truncation of the RKF satisfies Assumption 5.1, then for any fixed times n0 ≤ n, E(βn∗0 +1 · · · βn∗ )−1 ken k2Cn+ ≤ Eken0 k2Cn+ 0 + 2dE n X (βn∗0 +1 · · · βk∗ )−1 . (5.1) k=n0 +1 Proof. First of all, notice that the inequality (2.5) still holds, since it does not depend on Assumption 2.1. Then our claim is simply an induction, because ∗ ∗ + + ≤ E(βn∗0 +1 · · · βn∗ )−1 (ken k2Cn+ + 2d). = E(βn∗0 +1 · · · βn+1 )−1 En ken+1 kCn+1 E(βn∗0 +1 · · · βn+1 )−1 ken+1 kCn+1 If (5.1) holds for time n and we replace ken k2C + by its upperbound, then (5.1) holds also for n time n + 1. In order to verify the general Assumption 5.1, an a priori condition can also be derived from the reference Kalman covariance. en be a (stationary) PD solution of (4.1). Assume its small scale part is aspt 5.2. Let R bounded as below with a stochastic sequence βn∗ en PS  (βn∗ r − 1)DS . PS R Since in the proof of Theorem 4.2, we used nothing about the fact that β ∗ is a constant, so if we replace β ∗ with βn∗ in that proof, it is still valid. Therefore the following claim holds: Theorem 5.2. Suppose the general referenced projection Assumption 5.2 holds, then Assumption 5.1 also holds, and the acceptable reduction phase starts no later than e0−1 C0 k)/ log(r0 /r)e. n0 = dlog(kR en + DS for n ≥ n0 . Moreover the covariance estimator is bounded by Cn+  rR Remark 5.3. The previous discussion provides an easy generalization of our framework, but admittedly it buries some difficulties inside the result (5.1). If we want Theorem 5.1 to provide concrete Mahalanobis error dissipation and convergence like in Theorem 2.2, we roughly need to show ∗ • E(βn∗0 +1 · · · βn+1 )−1 ≥ exp(b∗ (n − n0 )) for a constant b∗ > 0. P • E nk=n0 +1 (βn∗0 +1 · · · βk∗ )−1 ≤ D exp(b∗ (n − n0 )) for the same constant b∗ > 0, and some D. Usually it is not difficult to establish either of these ingredients, the major difficulty is that the growth ratio b∗ needs to be the same in both. Some special structures, like βk∗ being independent of each other, will make the verification straightforward, but in general it is difficult. The authors also believe that (5.1) may not be the best way to demonstrate the error dissipation in some scenarios, instead one should look for a Lyapunov function. But this is far away from the main theme of this paper, which is developing a general filter error analysis framework for large scale truncation. 23 6 Applications and Examples Given a concrete system (1.1), there might be various ways that the two-scale separation can be done. It is of practical importance to find the minimal large scale subspace, the proper inflation ratio r, while keeping the filter error small. Based on our previous results, these problems can be solved by numerically computing the Kalman filter covariance for the augmented system with a fixed r > 1, (1.9) or (1.10), then verify Assumption 4.1 for RKF. The optimal two-scale separation and inflation can be obtained by minimizing the MSE upper bound in Corollary 4.3. In this section, we will discuss a few general principles that may facilitate the filter error quantification and the verification of Assumption 4.1, and how do they work in various dynamical scenarios. A simple stochastic turbulence model will be considered, and we will apply these principles to this model in different settings [4]. 6.1 Some general guidelines for covariance bounds Section 4 uses Kalman filters to provide a priori performance criteria. One of the advantages is that Kalman filters have a huge literature, so there are many known results on how to control the Kalman filter covariance. We present in below a few simple ones. For the simplicity of illustration, we convey them only for system (1.1) and its Kalman filter covariance Rn , while the same ideas are also applicable to the augmented systems (1.9), (1.10) and filter enL , R en . covariances R 6.1.1 Unfiltered covariance In most applications, system (1.1) has a stable dynamics itself, so the covariance of Xn conditioned on the system coefficients Fnc is bounded uniformly in time. The computation of this covariance Vn = EFnc (Xn ⊗ Xn ) − EFnc (Xn ) ⊗ EFnc (Xn ), follows a straightforward iteration: Vn+1 = An Vn ATn + Σn , if it holds at n = 0. In fact, we already used the small scale part VnS for the formulation of DRKF. Then clearly Vn  Rn . Although this seems trivial, it is useful as it is independent of the choice of observations, and involves very little computation. 6.1.2 Equivalent transformation on observation Sometime changing the way we view the observations may simplify the computation by a lot. Mathematically speaking, we can consider a sequence of invertible q × q matrix Ψn , and the signal-observation system as below Xn+1 = An Xn + Bn + ξn+1 , Yen+1 = Ψn Hn Xn+1 + Ψn ζn+1 . Intuitively, the Kalman filter performance of this system would be the same as (1.1). This is true, as one can check the Kalman covariance update operator K is invariant under this transformation. This equivalent transformation can be used to simplify our notation. For −1/2 example, we can let Ψn = σn , then the observation noise for Yen is a sequence of i.i.d. Gaussian random variables. 24 6.1.3 Benchmark principle Since the Kalman filter (1.2) is the optimal filter for system (1.1), for any other estimator bn of Xn , its error covariance is an upper bound for Rn : X bn ) ⊗ (Xn − X bn ) = EF c EF o (Xn − X bn ) ⊗ (Xn − X bn )  Rn . EFnc (Xn − X n n bn with computable error covariance, we find a way to bound Rn . So if there is an estimator X Although this idea is simple, it has been used many places to guarantee that Rn is bounded, and as to the authors’ knowledge, it is the only general strategy. The unfiltered covariance is actually a special application of this principle, where the estimator is simply the mean, bn = EF c Xn , which is updated through the recursion X bn+1 = An X bn + Bn . X n When the observation Hn is full rank, another simple estimator could be trusting the bn+1 = Hn−1 Yn+1 . The error covariance is [HnT ]−1 σn HnT . This idea can be observation: X generalized to the scenario where system (1.10) is detectable through a time interval [m, n]. Here we provide a simple and explicit estimate, while similar results can also be found in [28, 29, 30]. Proposition 6.1. Denote the observability Gramian matrix as On,m = n X ATk,m HkT σk−1 Hk Ak,m , Ak,m = Ak−1 · · · Aj+1 Aj k=m −1 bm bm is the prior covariance of Xm Suppose that Kn,m = On,m + R is invertible, where R without observing Ym . Then Rn  n X −1 Qjn,m Σj (Qjn,m )T + An,m Kn,m ATn,m , −1 Qjn,m = An,m Kn,m Kj,m A−1 j,m . j=m+1 −1 bm In case there is no prior knowledge of Xm , R can be set as a zero matrix, which is the inverse of the infinite covariance. Proof. For the simplicity of notations, in our proof, we do the general observation trans−1/2 formation, and replace Hk by σk Hk and σk by Iq . We will first build up a smoother for Xm and then propagate it through time [m, n]. Also, without lost of generality, we assume bm ) and Bk ≡ 0. Consider the estimator Xm ∼ N (0, R bm = K−1 X n,m n X T ATk,m Hk−1 Yk , bn = An,m X bm . X k=m Notice that Xk and Yk have the following moving average formulation: Xk = Ak,m Xm + k X Ak,j ξj , Yk = Hk−1 j=m+1 Ak,m Xm + k X j=m+1 25 ! Ak,j ξj + ζk . bn , can be written as The error made by this estimator, Xn − X # " n n n X X X T −1 T −1 T b ζk ATn,k Hk−1 Xn − Xn = An,j − An,m Kn,m Ak,m Hk−1 Hk−1 Ak,j ξj − An,m Kn,m j=m k=m+1 k=j −1 bm = 0, one can check that the quantity above is independent of with ξm = Xm . When R Xm . Note that Kn,m = ATj,m On,j Aj,m + Kj,m −1 An,j −An,m Kn,m n X T −1 ATk,m Hk−1 Hk−1 Ak,j = An,j − An,m Kn,m ATj,m On,j k=j −1 −1 −1 j = An,m [I − Kn,m ATj,m On,j Aj,m ]A−1 j,m = An,m Kn,m Kj,m Aj,m = Qn,m . −1 −1 b b In particular Qm n,m = An,m Kn,m Rm . The expected error covariance EFnc (Xn − Xn )⊗(Xn − Xn ) will be bounded by ! n n X X T −1 −1 −1 ATn,k Hk−1 Hk−1 An,k Kn,m ATn,m Qjn,m Σj (Qjn,m )T + An,m Kn,m Rm + j=m = n X k=m+1 −1 Qjn,m Σj (Qjn,m )T + An,m Kn,m ATn,m . j=m 6.1.4 Comparison principles of Riccati equation In order to control Rn , sometimes it suffices to find another set of system coefficients, such that its Kalman filter covariance Rn0  Rn . One way to generate such Rn0 is applying the comparison principle of Riccati equations for the forecast covariance [31]. Theorem 6.2 (Freiling and Jank 96). Consider a signal-observation system 0 0 , Xn+1 = A0n Xn0 + Bn0 + ξn+1 0 0 0 + ζn+1 , Yn+1 = Hn0 Xn+1 0 0 with ξn+1 ∼ N (0, Σ0n ) and ζn+1 ∼ N (0, σn0 ). Suppose the following holds a.s. with system coefficients of (1.1)    0  0 Σn ATn Σn AnT  . (6.1) 0 0 An −HnT σn−1 Hn A0n −HnT σn−1 HnT b1  R b0 , we have R bn  R b0 for all n ≥ 1. Then if the forecast covariance satisfies R 1 n In particular, we can compare the reference Kalman filter of (1.10) with the optimal filter (1.2): 26 Proposition 6.3. Suppose that there are constants c and C such that cΣn  An DS ATn and T −1 T An Σ−1 n An  CHn σn Hn , and there is a ρ ≥ 1 such that √   1 1 C(1 − r0 )2 1− 2 ≥ 2 . σ ρ ρ − r0 (1 + c) en of (4.1) is bounded by the stationary Kalman filter covariThen the stationary solution R ance Rn of (1.2) by the following en  ρ2 Rn . R It is worth noticing that if r0 is close to 1 and c is close to 0, ρ can be close to 1 as well. Proof. We apply the equivalent observation transformation mentioned in Section 6.1.2, and assume σn = Iq . Let us consider the following inflation of (1.1) with ρ ≥ 1 ρ Xn+1 = An Xnρ + Bn + ρξn+1 , ρ ρ Yn+1 = Hn Xn+1 + ρζn+1 . (6.2) Let Rnρ be the stationary filter covariance sequence of the associated Kalman filter, and Rn be the one for (1.1). Evidently, the stationary solution of this system satisfies Rnρ = ρ2 Rn , and bn . In order to apply Theorem 6.2 to the previous bnρ = ρ2 R so are the forecast covariances R system and (1.10), we consider the following matrix difference # √   0  " 2  2 (ρ − r0 )Σn√ − r0 An DS ATn (1 − r0 )ATn ρ Σn (An )T Σn (A0n )T − 0 = An − ρ21σ HnT Hn An − σ1 HnT Hn (1 − r0 )An ( σ1 − σρ1 2 )HnT Hn " # √ (ρ2 − (1√ + c)r0 )Σn (1 − r0 )ATn  . (1 − r0 )An ( σ1 − σρ1 2 )HnT Hn be bρ  R With the conditions in the proposition, the matrix above is PSD. Therefore R n , then n because ρ > 1 stands for a worse observation, it is straight forward to verify that be be 2 −2 bρ 2 2 en = K(R bρ b R n )  Kρ (Rn )  Kρ (Rn ) = ρ K(ρ Rn ) = ρ K(Rn ) = ρ Rn . Here Kρ denotes the forecast-posterior Kalman covariance update for the system (6.2). 6.2 Different settings The analysis framework of this paper can address system (1.1) with very general setups. Meanwhile in applications, particular dynamical and observation settings may require simplified computation or verification. 6.2.1 Classical setting In the classical setting, the system coefficients are deterministic and time homogenous, in other words they are of constant values. In this case, the stationary Kalman filter covariance 27 eL = R eL , R en = R. e Each of them solves an algebraic Riccati matrices are also constant R n equation(ARE) equation e = K(R) b =R b − RH b T (σ + H RH b T )−1 H R, b R b = r0 ARA e T + r0 ADS AT + r0 Σ, R e L = KL ( R bL ), R bL = rAL R eL (AL )T + ΣL . R (6.3) In general, the solution require numerical methods to compute. 6.2.2 Intermittent dynamical regimes One challenge that practical filters often face is that the dynamical coefficient An is not always stable with spectral norm less than 1. This is usually caused by the large scale chaotic dynamical regime transitions. One simple way of modeling this phenomenon, is letting An be a Markov jump process on two states {A+ , A− }, where kA− k ≤ 1 and kA+ k > 1. Chapter 8 of [4] has shown that this model could generate intermittent turbulence signals as seen in nature. Chapter 8 of [4] has also numerically tested the DRKF for the related filtering problem, showing close to optimal performance. Our analysis framework naturally applies to these scenarios. The only difficulty is that Assumption 5.1 may require additional works to verify. In general, one may need the general results of Section 5 or even other mechanisms mentioned in Remark 5.3. On the other hand, in many practical situations, the random dynamical regime switchings occur only on part of the model. If the large scale subspace includes this random part as in [4], the coefficients for small scale part are deterministic. This may make the conditions for verification of our theorems the same as the deterministic case. For example, the formulation of Theorem 3.1 for DRKF is independent of the large scale coefficients. For another example, if the large scale variables have no impact on the small scales, PS An PL ≡ 0, then when computing the unfiltered covariance for small scale V S , the large scale coefficients also play no role. 6.2.3 Conditional Gaussian systems If the system coefficients are functions of the observation, that is An = A(Yn ) and likewise for other terms, system (1.1) is a conditional Gaussian system. Although the evolution of (Xn , Yn ) in this case can be very nonlinear, the optimal filter is still (1.2) according to [17]. Such structure rises in many practical situations, like Lagrangian data assimilation, and turbulent diffusion with a mean flow. The conditional Gaussian structure can be exploited in these situations to gain significant advantages [32, 33]. In particular, dynamical structures like geostrophic balance can yield other types of reduced filters [34]. In our context of reduced filtering, one caveat of conditional Gaussian system is that the system noises are in general not independent of the future system coefficients. For example, Yn+1 may depend on ξn , and so does An+1 = A(Yn+1 ). As a consequence, Theorems 2.1 and 3.1 may not apply, while Theorem 2.2 still does. 6.2.4 Intermittent observations Due to equipment problems, observations sometimes are not available at each time step, but come in randomly. [35] models this feature by letting Hn = γn H where γn is a sequence 28 of independent Bernoulli random variables with Eγn = γ̄. When the signal dynamics is unstable, [35] has shown that there is a critical frequency γc , such that the average Kalman filter covariance ERn has a time uniform upper bound if and only if γ̄ < γc . Such results can be directly applied to the reference Kalman filters of systems (1.9) and (1.10), which leads to upper bounds for the reduced filter errors. On the other hand, if the system dynamics is stable, the reduced filter error can also be bounded using methods of Section 5. This will be discussed in Section 6.3.5. 6.3 Stochastic turbulence examples One of the most important applications of filtering is on atmosphere and ocean. These are challenging problems as the system dimensions are extremely high, and the system parameters are changing constantly. One simple way to model the planetary turbulence flows is linearizing the stochastic dynamics in the Fourier domain. In order to apply the reduced filters to these models, we are interested in finding the minimal amount of Fourier modes for the large scale subspace, and how to set up the small scale covariance DS for RKF. 6.3.1 Linearized stochastic turbulence in Fourier domain Consider the following stochastic partial differential equation [36, 4] ∂t u(x, t) = Ω(∂x )u(x, t) − γ(∂x )u(x, t) + F (x, t) + dW (x, t). (6.4) For the simplicity of discussion, the underlying space is assumed to be an one dimensional torus T = [0, 2π], while generalization to higher dimensions is quite straight forward. The terms in (6.4) have the following physical interpretations: 1) Ω is an odd polynomial of ∂x . This term usually arises from the Coriolis effect from earth’s rotation, or the advection by another turbulence flow. 2) γ is a positive and even polynomial of ∂x . This term models the general diffusion and damping of turbulences. 3) F (x, t) is a deterministic forcing and W (x, t) is a stochastic forcing. In this paper, we assume both forcing have a Fourier decomposition X X F (x, t) = fk (t)eik·x , W (x, t) = σku Wk (t)eik·x . k∈I k Here Wk (t) = √12 Wk,r (t) + √i2 Wk,i (t) is a standard Wiener process on C, and the conju∗ gacy condition is imposed to ensure terms in (6.4) are of real values: fk (t) = f−k (t), σku = u ∗ ∗ (σ−k ) , Wk (t) = W−k (t). Suppose P (∂x )eik·x = iωk eik·x , γ(∂x )eik·x = γk eik·x with γk P > 0. Then the solution of (6.4) can be written in terms of its Fourier coefficients, u(x, t) = k uk eik·x , where the real and imaginary parts follow  r        r  σku dWkr (t) uk (t) −γk −ωk urk (t) fk (t) d i = . (6.5) dt + i dt + √ i uk (t) ωk −γk uik (t) fk (t) 2 dWk (t) 29 To transform (6.4) to a discrete time formulation like (1.1) in real domain, we assume the intervals between observations are of constant length h > 0, and pick a Galerkin truncation range K ∈ N. Let Xn in (1.1) be a (2K + 1)-dim column vector, with coordinates being: [Xn ]0 = u0 (nh), [Xn ]k = urk (nh), [Xn ]−k = uik (nh), k = 1, . . . , K. (6.6) The system coefficients for the dynamic part of (1.1) then can be formulated as follows, where An = A is diagonal with 2 × 2 sub-blocks, and Σn = Σ is diagonal. Their entries are given below:   cos(ωk h) sin(ωk h) [A]{k,−k}2 = exp(−γk h) , [B]k = fkr (nh)h, [B]−k = fki (nh)h, − sin(ωk h) cos(ωk h) Z (σku )2 (n+1)h 1 [Σ]k,k = exp(−2γk s)ds = Eku (1 − exp(−2γk h)). 2 2 nh (6.7) 1 u u 2 Ek = 2γk (σk ) stands for the stochastic energy of the k-th Fourier mode, and also the sum of stochastic energy of [Xn ]k and [Xn ]−k . In practice, the damping often grows and the energy decays like polynomials of the wavenumber |k| γk = γ0 + ν|k|α , Eku = E0 |k|−β , α > 0, β ≥ 0. (6.8) As we will see in our discussion below, such formulation guarantees the existence of a large scale separation with good reduced filter performance. To show that our framework is directly computable, we will also consider the following specific set of physical parameters with a Kolmogorov energy spectrum used in [37]: α = 2, 6.3.2 5 β= , 3 r = 1.2, r0 = 1.21, h = 0.1, ν = 0.01, β ∗ = 0.9, E0 = 1. (6.9) Setups for reduced filters Since the system coefficients of (6.7) are all block diagonal, both DRKF and RKF can be applied for reduced filters. Naturally, the large scale set consists of modes with wavenumbers {|k| < N }. And for RKF, DS should be a diagonal matrix with entries {δk }|k|≥N . The question is how to pick these reduced filter parameters, and how do they depend on the system coefficients. DRKF does not have additional constraint, as Theorem 3.1 always provide an upper bound. But in order to have good practical performances, intuitively the error caused by small scale time correlation should be of scale  comparing with the other terms. In other words, √ √ 2 λS r( r + 1)γσ √ ≤ , (6.10) (1 − λS )(1 + γσ ) √ λS in our setting will be max|k|≥N exp(−γk h) = exp(−γN h). Ifpwe approximate (1 − λS ) with 1, and bound γσ with 1, we find that γN ≥ − h2 log(/ r(r + 1)). This relation is independent of the energy spectrum, and if the dissipation has a polynomial growth (6.8), we find that p 1 2 N ≥ [− log(/ r(r + 1))] a . hν 30 In the physical setup of (6.9) with  = 0.2, we find that N ≈ 65. RKF requires the verification of Assumption 4.1. Here we uses the unfiltered covariance e en . This applies independently of the V of the inflated system (1.10) as an upper bound for R observation setup. It is easy to find that Ve is diagonal with entries [Ve ]k,k = ṽk = r0 Eku (1 − r0 exp(−2γk h)) + δk r0 exp(−2γk h) . 2 − 2r0 exp(−2γk h) (6.11) In order for Assumption 4.1 to hold, we need that for some β ∗ ≤ 1 vek ≤ (β ∗ r − 1)δk k ≥ N. (6.12) r0 E u k . In order to achieve this, we need β ∗ r ≥ β ∗ rr0 exp(−2γk h) + 1 and δk ≥ β ∗ r−β ∗ rr0 exp(−2γ k h)−1 In the setting of (6.8), exp(−2γk h) → 0 for large |k|, so we roughly require δk ≥ r0 Eku β ∗r − 1 The small scale truncation requires γN 1 tion setting (6.8), this implies N ≥ [ 2hν parameters (6.9), N ≈ 25. 6.3.3 r 0 PS E u PS . (6.13) β ∗r − 1   1 ≥ 2h log r10 − β ∗1rr0 . In the polynomial dissipa  1 log r10 − β ∗1rr0 ] α . In particular with the physical ⇒ DS ≈ Intermittent physical environment A simple way to model intermittent physical environment for stochastic turbulence (6.7) is letting An be a Markov chain, while maintaining the sub-block structure: [An ]{k,−k}2 = [λn ]k [A]{k,−k}2 . Here λn is a Markov chain taking values in RK+1 . Then the system random instability can be modeled as the random fluctuation of [λn ]k , so that occasionally k[An ]{k,−k}2 k > 1 for some k. In many situations, such instability only occur on the a small subset I of Fourier modes. This is because when the wave numbers are high, the dissipation force is much stronger than the random environmental forcing. So for k ∈ I c , [An ]{k,−k} could remain of constant value like in (6.7). Then it suffices to let the large scale mode set include subset I, and the discussion of Section 6.3.2 remains the same. This idea also applies to systems with random coefficients on all modes as well, as long as another system with constant small scale coefficients exists as an upper bound in the sense of Theorem 6.2. 6.3.4 Advection from a strong jet flow One major nonlinearity source for planetary or engineering turbulence takes the form of a jet flow advection. For example, the meridional flows on earth are often advected by a eastward zonal flow [37, 33]. (6.4) can be extended to this scenario, by adding an auxiliary process wt ∈ R to describe the jet flow, with Bt being an independent standard Wiener process in R, dwt = Gwt (ut )dt + gt dt + σw dBt , (6.14) ∂t u(x, t) = (Ω(∂x ) + wt ∂x − γ(∂x ))u(x, t)dt + F (x, t)dt + dW (x, t). 31 The feedback of ut = u( · , t) on wt , Gwt (ut ), is assumed to be linear on ut , but may have nonlinear dependence on wt . Since strong jet flows often have close to accurate observations, we assume wt is part of the observation. The resulting system will be conditionally Gaussian. A time discretization like in Section 6.3.1 would lead to the same dynamical formulation as (6.7), except that the phase speed ωk is replaced by ωk + kWn . Wn = wnh is the time discretization of wt , and follows √ eWn Xn+1 h + Wn + gnh h + σw hζ v . Wn+1 = G n+1 ew X = Gw u, if X consists of the Fourier modes of field u like in (6.6). Wn+1 can be Here G v seen as the q + 1-th dimension of the observation vector Yn+1 , and ζn+1 is its observation noise. This makes the time discretized model in the form of (1.1). Jet flow advection in fact is a good example to show that system independent noise v is correlated with coefficients An+1 condition (2.2) may fail, since the observation noise ζn+1 and Hn+1 through Wn+1 . As a consequence, Theorems 2.1 and 3.1 no longer apply, but Theorem 2.2 still holds. 6.3.5 Intermittent observations Observations of turbulence in practice often come from a network of sensors, that are located at a group of points xj ∈ T, and the observation noise can be modeled by i.i.d. N (0, σ) random variables: [H]j,0 = 1, [H]j,k = 2 cos(kxj ), [H]j,−k = 2 sin(kxj ), σ = σ o Iq . (6.15) 2πj , j = 0, 1, . . . , 2J, One particular choice of sensor location will be equally spacing, xj = 2J+1 studied by chapter 7 of [4]. Consider an equivalent observation transformation [Ψ]0,j 1 , = 2J + 1 [Ψ]i,j 2πij cos( 2J+1 ) = , 2J + 1 [Ψ]−i,j 2πij sin( 2J+1 ) = , 2J + 1 so the transformed observation coefficients satisfies [ΨH]j,k = δj≡k mod 2J+1 , and ΨσΨT = σ o I2J+1 . When J < K, such observation network introduces aliasing effect among the Fourier 2J+1 modes, which is carefully studied in [38, 4]. Here after we focus only on the simple case where K = J so ΨH = I. In real applications, turbulence observations may not be available at each time step. Following the example of [35], we model this problem by letting Hn = γn H, where γn is a sequence of Bernoulli random variables with average Eγn = γ̄. We will look at how does such observation changes the reduced filter setup. For DRKF, the small scale unfiltered covariance V is diagonal with entries [V ]k,k = 21 Eku . (2K+1)Eku Following the discussion in Then γσ = supn k(σnL )−1 Hn V S HnT k = sup|k|≥N (2K+1)E u +2σ o. k Section 6.3.2, we are interested √ in maintaining (6.10). In the polynomial dissipation regime (6.8), if we approximate 1 − λS by 1, and replace 1 + γσ by a lower bound 1, we find that exp(− 21 hνN α )E0 N −β  ≤p 2σ o −β E0 N + 2K+1 r(r + 1) 32 In the physical setup of (6.9) with  = 0.2, σ o = 0.1, K = 200 and by numerical computing the quantities above, we find that N ≈ 59. As for RKF, for any fixed time n, the unfiltered covariance Ve is given by (6.11), and en  Ve . If at time n, the observations are we know the reference Kalman filter covariance R be e T e available, γn = 1, note that R n  AV A + Σ = V , by Proposition 6.1 with m = n, en ]k,k ≤ vk0 = [R Denote βo = maxk≥N we can let ṽk rδk ṽk σ o < ṽk . σ o + (2K + 1)ṽk + 1r , βu = maxk≥N ṽk rδk + 1r . Clearly βo < βu . So in Assumption 5.1, βn∗ = γn βo + (1 − γn )βu , which is an independent sequence. In order for the general Theorem 5.1 to give a meaningful upper bound, it suffices to require β̄ ∗ = Eβn∗ = γ̄βo + (1 − γ̄)βu < 1. (6.16) With (6.16), we will have Eken k2Cn ≤ β̄ ∗(n−n0 ) Eken0 k2Cn0 + 1−2dβ̄ ∗ . Since (6.12) is equivalent to βu < 1, so (6.16) is a weaker requirement and end up with a smaller N . In particular, if we pick DS as in (6.13), the parameters as in (6.9), and let γ̄ = 0.9, σ o = 0.1, K = 200, we find N ≈ 14. 7 Conclusion and discussion High dimensionality is an important challenge for modern day numerical filtering, as the classical Kalman filter is no longer computationally feasible. This problem can sometime be resolved by proper dimension reduction techniques, exploiting intrinsic multiscale structures. This paper considers two of such reduced filters. The DRKF works for dynamically decoupled systems, and estimates the small scale variables with their equilibrium statistical states. The RKF uses a constant statistical state for the small scale filtering prior, and requires the large scale projection not to decrease the error covariance. Both methods have been studied by [4] for stochastic turbulence filtering, and they have close to optimal performances in various regimes. On the other hand, rigorous error analysis of these reduced filter has been an open problem, since the dimension reduction techniques bring in unavoidable biases, just like in many other practical uncertainty quantification procedures. This paper fills in this gap by developing a two-step framework. The first step examines the fidelity of the reduced covariance estimators, showing that the real filter error covariance is not underestimated. For RKF with system independent noises, this can be verified by tracking the covariance matrix. For DRKF and more general scenarios, the covariance fidelity can be demonstrated by the intrinsic dissipation mechanism of the Mahalanobis error. The second step shows how to bound the reduced filter covariance estimators, by building a connection between them and proper Kalman filter covariances. The combination of these two steps yields an error analysis framework for the reduced filters, with exponential stability and accuracy for small system noises as simple corollaries. When applied to a linearized stochastic turbulence, this 33 framework provides a priori guidelines for large scale projection range and reduced filter parameterizations. Besides the major themes mentioned above, there are two related issues we have not focused on: • The multiplicative inflation is applied in our reduced filters to avoid covariance underestimation. This technique has been applied widely for various practical filters, but its theoretical importance has never been studied except in one dimension [39]. The error analysis of this paper implicitly studies this issue, as the inflation plays an important role in our proof. Based on the formulation of Theorems 2.2, 3.1, and 4.2, stronger inflation provides better filter stability. Moreover, as mentioned in Remark 2.3, this inflation is an essential high dimension replacement of the classical uniform bounded conditions in [27]. • For RKF, Theorem 2.1 has a much stronger result comparing with Theorem 2.2, while the additional condition on system independent noises often holds. But for many other practical filters such as the ensemble Kalman filter, the second moment of the filter error is not traceable, as the Kalman gain matrix is correlated with the filter error. The Mahalanobis error dissipation on the other hand still holds as it is a more intrinsic property. Acknowledgement This research is supported by the MURI award grant N00014-16-1-2161, where A.J.M. is the principal investigator, while X.T.T. is supported as a postdoctoral fellow. The author also thank Kim Chuan Toh for his discussion on Lemma B.1. A Complexity estimates In this section we do some simple computational complexity estimates for the Kalman filter (1.2) and the reduced Kalman filters (1.5) and (1.6). Through these estimations, we find that the reduced filters reduce computation complexity from O(d2 q) to O(d2 + p2 q + p3 ) and O(d2 + dp2 + dq 2 ), which is a significant reduction when the state space dimension d is much larger than the observation dimension q and large scale dimension p. For simplicity, we only consider the most direct numerical implementation of the related formulas, although there are many alternative implementation methods that increases numerical stability and accuracy [40]. We assume the complexity of matrix product of [A]a×b and [B]b×c is abc, and the complexity of the inversion and Cholesky decomposition of a general [A]a×a matrix is a3 [41]. There are also a few additional assumptions that hold for most applications, while without them similar qualitative claims hold as well. 1) We focus mostly on the online computational cost, which is the cost for the computation of filter iteration. This is the most significant cost in the long run. 34 2) When the system coefficients are deterministic, the Kalman gain matrix sequence in principle can be computed offline [40]. We do not consider this scenario as it oversimplifies the problem. 3) An is a sequence of sparse matrices. This holds for the stochastic turbulence models in Section 6. It rises in various differential equation context as most physical interaction bn+1 = An Cn ATn + Σn involves only elements in close neighbors. As a consequence, C involves only O(d2 ) complexity instead of O(d3 ). On the other hand, if this assumption is not true, then the leading computational cost is O(d3 ) and comes from the prescribed forecast step, while the reduced filters obviously reduce the cost to O(p2 d), so there is no need of further discussion. 4) Hn and σn are also sparse matrices with relatively time invariant structure, so matrix bn H T involves only O(d2 ) computation. This assumption holds as in product like Hn C n many applications, the observations are over a few dimensions and the observation noises are independent. Based on these assumptions, the complexity of Kalman filter is given by Table 1. Operation Complexity order T b Rn = An Rn+1 An + Σn d2 bn HnT )−1 (σn + Hn R d2 + q 3 + d2 q bn HnT (σn + Hn R bn+1 HnT )−1 Kn+1 = R d2 q mn+1 = An mn + Bn − Kn+1 (Yn+1 − Hn (An mn + Bn )) d + dq T T −1 b b b b Rn+1 = Rn+1 − Rn+1 Hn (σn + Hn Rn+1 Hn ) Hn Rn+1 d2 q total d2 q Table 1: Complexity estimate of the Kalman filter (1.2). A.1 DRKF DRKF essentially is applying a Kalman filter in the large scale subspace with dimension p. The only additional computation involves estimating the unfiltered small scale covariance VnS which involves O(d2 ) computation. When the system coefficients are constants, VnS is of constant value and there is no need to update it. We put such savable cost in brackets in the Table 2. A.2 RKF In the implementation of RKF, we need to exploit the fact that Cn is nonzero only for the upper p × p sub-block. Therefore its Cholesky decomposition involves a cost of O(p3 ). Also bn as the sum of An Cn ATn , which is a rank p matrix, and a sparse matrix one would like see C 35 Operation Complexity order L L L L T L b Cn+1 = An Cn (An ) + Σn p2 S Vn+1 = An VnS ATn + ΣSn , µSn+1 = ASn µSn + BnS (d2 ) bL H T )−1 (σnL + Hn C (d2 ) + q 3 n+1 n L L T −1 bL (H L )T (σ L + H L C bL Kn+1 =C p2 q n+1 n n n n+1 (Hn ) ) L L L L S S L L L L L µn+1 = An µn + Bn − Kn+1 (Yn+1 − Hn µn+1 − Hn (An µn + Bn )) pq L L L L T L L 3 L L T −1 L L b b b b Cn+1 = rC q + p2 q n+1 − r Cn+1 (Hn ) (σn + Hn Rn (Hn ) ) Hn Cn+1 total q 3 + p2 q + (d2 ) Table 2: Complexity estimate of the DRKF (1.5). An DS ATn + Σn , instead of a generic d × d matrix. The Woodbury matrix identity is also useful for gaining computational advantage. For example, when doing the matrix inversion bn HnT ]−1 = [Qn + Hn An Cn ATn HnT ]−1 , [σn + Hn C where Qn := [σn + Hn Σ0n HnT ] with Σ0n = Σn + DS , note that inverting Qn costs O(q 3 ). The Woodbury identity indicates that: −1 1/2 1/2 T T 1/2 −1 1/2 T T −1 [Qn + Hn An Cn ATn HnT ]−1 = Q−1 n − Qn Hn An Cn [I + Cn An Hn Hn An Cn ] Cn Hn An Qn . 1/2 1/2 1/2 1/2 Note that Cn [I + Cn ATn HnT Hn An Cn ]−1 Cn has only the upper p × p sub-block being nonzero, so its computation costs only O(p3 + pqd + p2 q). So the overall cost of computing bn H T ]−1 is O(pqd + p3 + q 3 ), while in the Kalman filter, it is qd2 . The estimate of [σn + Hn C n each step is given below in Table 3. Operation b Cn = An Cn ATn + An DS ATn + Σn bn H T )−1 (σn + Hn C n T T bn H T )−1 b Kn+1 = An Cn An Hn (σn + Hn C n 0 T T −1 b +Σn Hn (σn + Hn Cn Hn ) b n+1 (Yn − Hn (An µn + Bn )) µn+1 = An µn + Bn − K bn PL − rPL C bn HnT (σn + Hn C bn HnT )−1 Hn C bn PL Cn+1 = rPL C total Complexity order d2 pqd + q 3 + p3 p2 d + pqd dq 2 + d2 d + dq dp2 + dq 2 2 d + dp2 + dq 2 Table 3: Complexity estimate of the RKF (1.6). B Matrix inequalities The following lemma has been mentioned in [39] for dimension one. 36 Lemma B.1. The prior-posterior Kalman covariance update mapping K in (1.2), can also be defined as K(C) = (I − KHn )C(I − KHn )T + KσK T where K := CHn (σ+Hn CHnT )−1 is the corresponding Kalman gain. K is a concave monotone operator from PD to itself. Proof. The first matrix identity is straightforward to verify, and can be found in many references of Kalman filters [4]. In order to simplify the notations, we let H = Hn and J(X) = (σ+HXH T )−1 . Then picking any symmetric matrix A, the perturbation in direction A is given by d DA J(X) := J(X + At) t=0 = −JHAH T J. dt Therefore DA K = A−AH T JHX −XH T JHA+XH T JHAH T JHX = (I −H T JHX)T A(I −H T JHX) The Hessian is 2 DA K = −2AH T JHA + 2AH T JHAH T JHX + 2XH T JHAH T JHA − 2XH T JHAH T JHAH T JHX = −2(AH T J 1/2 − XH T HAH T J 1/2 ) · (AH T J 1/2 − XH T HAH T J 1/2 )T  0. Therefore, as long as X, X + A  0, then the convexity holds: K(X) + K(X + A)  2K(X + 21 A). When we require A to be PSD, DA K  0 implies the monotonicity of K. Lemma B.2. Suppose that A, C, D are PSD matrices, C is invertible, while A  [BCB T + D]−1 , then B T AB  C −1 , A1/2 DA1/2  Id . Proof. From the condition, we have A1/2 [BCB T + D]A1/2  Id . Therefore our second claim holds. Moreover, (B T AB)C(B T AB)  B T A1/2 A1/2 [BCB T + D]A1/2 A1/2 B  B T AB. This leads to our first claim by the next lemma. Lemma B.3. Let A and B be PSD matrices, if • A  Id , then ABA  B. • A  Id , then ABA  B. And for any real symmetric matrix C, CAC  C 2 . 37 Proof. If the null subspace of B is D and P is the projection onto the complementary subspace D⊥ , then it suffices to show that (PAP)(PBP)(PAP)  PBP. Therefore, without loss of generality, we can assume B is invertible, so it suffices to show (B −1/2 AB 1/2 )(B −1/2 AB 1/2 )T  I. But this is equivalent to checking the singular values of B −1/2 AB 1/2 are greater than 1, which are the same as the eigenvalues of A. If A and C are invertible, then the second claim follows as the direct inverse of the first claim. Else, it suffice to show the claim on the subspace where A and C are invertible. Lemma B.4. Let A and B be two PSD matrices, and A is invertible, then kABk = kA1/2 BA1/2 k = inf{λ : B  λA−1 }. Proof. kABk = kA1/2 BA1/2 k comes as conjugacy preserves eigenvalues, and kA1/2 BA1/2 k = inf{λ : B  λA−1 } is obvious. Lemma B.5. Let B ∈ P SD, then tr(AB) ≤ kAktr(B). Proof. Suppose the eigenvalue decomposition of B is ΨDΨT . Then we note that tr(AB) = tr(AΨDΨT ) = tr(ΨT AΨD), kAktr(B) = kΨT AΨktr(D). So we can assume B is a diagonal matrix. Then tr(AB) = d X Ai,i Bi,i ≤ kAk X Bi,i = kAktr(B). i=1 C Convergence to the unique stationary solution One of the remarkable property of Kalman filter covariance is that it converges to a unique stationary solution to the associated Riccati equation, assuming the system coefficients are stationary, and weak observability and controllability. Theorem C.1 (Bougerol 93). Suppose that (An , Bn , Hn , Σn ) is an ergodic stationary sequence. Define the observability and controllability Gramian as follows: On = n X k=1 ATk,1 HkT σk−1 Hk Ak,1 , Cn = n X ATn,k+1 Σk An,k+1 , Ak,j = Ak Ak−1 · · · Aj . k=1 Suppose the system(1.1) is weakly observable and controllable, that is there is an n such that P(det(On ) 6= 0, det(Cn ) 6= 0) > 0. 38 Suppose also the following random variables are integrable, log log+ kA−1 1 k, log log+ kA1 k, log log+ kΣ1 k, log log+ kH1T H1 k. en that follows where log+ x = max{0, log x}. Then there is a stationary PD sequence R en+1 = K(An R en ATn + Σn ). R And for the covariance matrix Rn of another Kalman filter started with an initial value en ) ≤ α. Here α is a negative R0 , will converge to Rns asymptotically: lim supn→∞ n1 δ(Rn , R + constant, and δ defines a Riemannian distance on Sd by v u d uX δ(P, Q) = t log2 λ , λ are eigenvalues of P Q−1 . i i i=1 One simple and useful fact is that, if the original system (1.1) meets the requirement of Theorem C.1, then so does the inflated systems (1.9) and (1.10). To see this, one need to write down the corresponding observability and controllability Gramians On0 and Cn0 . In the general scenarios, it’s straightforward to verify that the Gramians of reference system (1.10) are larger than the ones of (1.1) On0 = n X 0T Ak,1 HkT σk−1 Hk ATk,1  On , Cn0 = n X k=1 0 T An,k+1 Σ0k A0n,k+1  Cn . k=1 Since these Gramian matrices are PSD matrices, On and Cn are nonsingular indicate that On0 and Cn0 are nonsingular. Also note 1 e + log kA1 k, log kA01 k = log R 2 moreover, e + log+ (kΣn k + kAn DS AT k) log+ kΣ0 k ≤ log R 1 n + + e + max{log (2kΣn k), log (2kAn DS AT k)} ≤ log R n + + e + log 2 + log kΣn k + 2 log kAn k + log+ kDS k ≤ log R so the integrability condition holds naturally. When the system had dynamical two-scale decoupling (1.4), it is easy to see that Ak,j has a block-diagonal structure, and so do the Gramians Cn and On . It is also easy to verify the controllability Gramian of (1.9) satisfies Cn0 = n X 0T An,k+1 ΣLk A0n,k+1 k=1  n X ATn,k+1 ΣLk ALn,k+1 = PL Cn PL . k=1 As for the observability Gramian of (1.9), notice that σk−1 is invertible, so there is a constant Dn such that Dn σk−1  [σkL ]−1 , then it is straightforward to verify that Dn On0 = Dn n X 0 0 T T Ak,1 HkT σk−1 Hk Ak,1  PL On PL . k=1 This shows the weak observability and controllability of (1.1) implies the ones of (1.9). The integrability 39 References [1] A. J. Majda. Introduction to PDEs and Waves for the Atmosphere and Ocean, volume 9 of Courant lecture notes. American Mathematical Society, 2003. [2] A J Majda and X Wang. Nonlinear Dynamics and Statistical Theories for Basic Geophysical Flows. Cambridge University Press, Cambridge, UK, 2006. [3] I. Groom and A. J. Majda. Efficient stochastic superparameterization for geophysical turbulence. Proc. Natl. Acad. Sci., 110(12):4464–4469, 2013. [4] A. J. Majda and J. Harlim. Filtering complex turbulent systems. Cambridge University Press, Cambridge, UK, 2012. [5] M. Branicki and A. J. Majda. Quantifying bayesian filter performance for turbulent dynamical systems through information theory. Comm. Math. Sci., 12(5):901–978, 2014. [6] P Bougerol. Kalman filtering with random coefficients and contractions. SIAM J. Control Optim, 31(4):942–959, 1993. [7] A. J. Majda and M. Branicki. Lessons in uncertainty quantification for turbulent dynamical system. Discrete and Continuous Dynamical Systems, 32(9):3133–3221, 2013. [8] P. Del Moral. Nonlinear filtering: Interacting particle resolution. Markov Process. Related Fields, 2(4):558–580, 1996. [9] D. Crisan and A. Doucet. A survey of convergence results on particle filtering methods for practioners. IEEE Trans on Signal Processing, 50(3):736–746, 2002. [10] J. Mandel, L. Cobb, and J. D. Beezley. On the convergence of the ensemble Kalman filter. Applications of Mathematics, 56(6):533–541, 2011. [11] K. J. Law, H. Tembine, and R. Tempone. Deterministic mean-field ensemble kalman filtering. https://arxiv.org/abs/1409.0628, 2014. [12] I. Groom, Y. Lee, and A. J. Majda. Ensemble kalman filters for dynamical systems with unresolved turbulence. J. Comput. Phys., 273:435–452, 2014. [13] Y. Lee and A. J. Majda. Multiscale methods for data assimilation in turbulent systems. SIAM Multiscale Model. Simul., 12:691–713, 2015. [14] J. L. Anderson. An adaptive covariance inflation error correction algorithms for ensemble filters. Tellus A, 59(210-224), 2007. [15] J. L. Anderson. Spatially and temporally varing adaptive covariance inflation for ensemble filters. Tellus A, 61(1):72–83, 2009. [16] D. M. Livings, S. L. Dance, and N. K. Nichols. Unbiased ensemble square root filters. Physica D, 237:1021–1081, 2008. 40 [17] R S Liptser and A N Shiryaev. Statistics of random processes. I, II,, volume 5 of Applications of Mathematics. Springer-Verlag, 2001. [18] G. Evensen. Sampling strategies and square root analysis schemes for the EnKF. Ocean dynamics, 54(6):539–560, 2004. [19] J. L. Anderson. An ensemble adjustment Kalman filter for data assimilation. Mon. Weather Rev., 129(12):2884–2903, 2001. [20] H. Li, E. Kalnay, T. Miyoshi, and Danforthm C. M. Accounting for model errors in ensemble data assimilation. Mon. Wea. Rev., 137(10):3407–3419, 2009. [21] D. T. B. Kelly, K. J. Law, and A. M. Stuart. Well-posedness and accuracy of the ensemble Kalman filter in discrete and continuous time. Nonlinearity, 27:2579–2603, 2014. [22] X. T. Tong, A. J. Majda, and D. Kelly. Nonlinear stability and ergodicity of ensemble based kalman filters. Nonlinearity, 29:657–691, 2016. [23] D. Kelly, A. J. Majda, and X. T. Tong. Concrete ensemble kalman filters with rigorous catastrophic filter divergence. Proc. Natl. Acad. Sci., 112(34):10589–10594, 2016. [24] X. T. Tong, A. J. Majda, and D. Kelly. Nonlinear stability of the ensemble Kalman filter with adaptive covariance inflation. Commun. Math. Sci., 14(5):1283–1313, 2016. [25] D. Blömker, K. J. Law, A. M. Stuart, and K. C. Zygalakis. Accuracy and stability of the continuous-time 3DVAR filter for the Navier-Stokes equation. Nonlinearity, 26, 2013. [26] K. J. Law, A. Shukla, and A. M. Stuart. Analysis of the 3DVAR filter for the partially observed Lorenz’63 model. Discrete and Continuous Dynamical Systems, 34(3):1061– 1078, 2014. [27] K Reif, S Günther, E Yaz, and R Unbelhauen. Stochastic stability of the discrete-time extended kalman filter. IEEE Trans on Automatic Control, 44(4):714–728, 1999. [28] J. Deyst and C. Price. Conditions for asymptotic stability of the dicrete minimum variance linear estimator. IEEE Trans on Automatic Control, 13(6):702–705, 1968. [29] A. H. Jazwinski. Stochastic Processes and Filtering Theory. Academic Press, New York, 1972. [30] V. Solo. Stability of the Kalman filter with stochastic time-varying parameters. Decision and Control, Proceedings of the 35th IEEE conference on, 1:57–61, 1996. [31] G Freiling and G Jank. Existence and comparison theorems for algebraic riccati equations and riccati differential and difference equations. Journal of Dynaimical and control systems, 2(4):529–547, 1996. 41 [32] N Chen, A J Majda, and X T Tong. Information barriers for noisy lagrangian tracers in filtering random incompressible flows. Nonlinearity, 27:2133–2163, 2014. [33] A. J. Majda and X. T. Tong. Intermittency in turbulent diffusion models with a mean gradient. Nonlinearity, 28(11):4171–4208, 2015. [34] N Chen, A J Majda, and X T Tong. Noisy lagrangian tracers for filtering random rotating compressible flows. J. Non. Sci., 25(3):451–488, 2014. [35] B. et al Sinopoli. Kalman filtering with intermittent observations. Automatic Control, IEEE Transaction on, 49(9):1453–1464, 2004. [36] J. Harlim and A. J. Majda. Filtering nonlinear dynamical systems with linear stochastic models. Nonlinearity, 21:1281–1306, 2008. [37] A J Majda and B Gershgorin. Elementary models for turbulent diffusion with complex physical features: eddy diffusivity, spectrum, and intermittency. Phil. Trans. Roy. Soc., 371(1982), 2013. [38] J. Harlim and A. J. Majda. Mathematical strategies for filtering complex systems: regularly spaced sparse observations. J. Comput. Phys, 227:5304–5341, 2008. [39] R. Furrer and T. Bengtsson. Estimation of hign-dimensional prior and posterior covariance matrices in Kalman filter variants. Journal of Multivariate Analysis, 98:227–255, 2007. [40] M. Grewal and A. Andrews. Interscience Publication, 2001. Kalman filtering: Theory and Practice. A Wiley- [41] G. Golub and Van Loan. Matrix computations. The John Hopkins University Press, Baltimore, Maryland, 1983. 42
10math.ST
Human-Machine Symbiosis, 50 Years On 1 Human-Machine Symbiosis, 50 Years On Ian FOSTER Computation Institute, University of Chicago and Argonne National Laboratory Mathematics and Computer Science Division, Argonne National Laboratory Department of Computer Science, University of Chicago Abstract. Licklider advocated in 1960 the construction of computers capable of working symbiotically with humans to address problems not easily addressed by humans working alone. Since that time, many of the advances that he envisioned have been achieved, yet the time spent by human problem solvers in mundane activities remains large. I propose here four areas in which improved tools can further advance the goal of enhancing human intellect: services, provenance, knowledge communities, and automation of problem-solving protocols. Keywords. Licklider, man-computer symbiosis, provenance, services Introduction In his classic 1960 paper, Man-Computer Symbiosis [22], L.C.R Licklider wrote of how monitoring his time spent at work led him to discover that: About 85 per cent of my “thinking” time was spent getting into a position to think, to make a decision, to learn something I needed to know. Much more time went into finding or obtaining information than into digesting it. Hours went into the plotting of graphs, and other hours into instructing an assistant how to plot. When the graphs were finished, the relations were obvious at once, but the plotting had to be done in order to make them so. At one point, it was necessary to compare six experimental determinations of a function relating speech-intelligibility to speech-to-noise ratio. No two experimenters had used the same definition or measure of speech-to-noise ratio. Several hours of calculating were required to get the data into comparable form. When they were in comparable form, it took only a few seconds to determine what I needed to know. Throughout the period I examined, in short, my “thinking” time was devoted mainly to activities that were essentially clerical or mechanical: searching, calculating, plotting, transforming, determining the logical or dynamic consequences of a set of assumptions or hypotheses, preparing the way for a decision or an insight. Moreover, my choices of what to attempt and what not to attempt were determined to an embarrassingly great extent by considerations of clerical feasibility, not intellectual capability. These observations led him to advocate the use of computers to, in essence, “augment human intellect by freeing it from mundane tasks”—a goal that Doug Engelbart would soon also pursue, with great success [8]. Human-Machine Symbiosis, 50 Years On 2 Almost 50 years later, we have personal computers, immensely powerful software, huge online databases [18], and a ubiquitous Internet (another Licklider idea [21]). Our intellect has indeed been augmented: we can, for example, perform computations and data comparisons in seconds that might have taken Licklider hours, days, or years. In other respects, however, the situation is less rosy. While we could probably process Licklider’s six speech datasets in seconds rather than hours, we will probably still struggle with incompatible formats, and may well be dealing with six million or even six billion objects. Meanwhile, while the advent of the Web has dramatically increased access to data, it can still be exceedingly difficult to discover relevant data and to make sense of that data once it is located. And as we automate various aspects of the problem solving process, other activities emerge as the time-consuming “mechanical” steps. For example, in biology, DNA microarrays allows ten of thousands of measurements to be performed in the time that a researcher might have previously taken to perform a single measurement [35]. However, the amount of time per day that a researcher spends in “mechanical” labor may be no less: experiments must still be set up, data collected and stored, results analyzed. In other words, there are still just as many opportunities to automate the routine and mechanical. This discussion emphasizes that as we near the 50th anniversary of Licklider’s paper, the need for man-computer symbiosis is no less urgent. However, we must demand far more from our computers than we did in 1960. In the spirit of celebrating Licklider’s legacy, I discuss here four related areas in which I believe significant progress can be made in further augmenting human intellect via the automation of the mundane and mechanical. First, I examine how service-oriented architectures can make powerful information tools available over the network, for discovery and use by both people and programs. By permitting distribution of function, “service oriented science” (SOS) systems can both greatly reduce barriers to accessing existing intellectual tools—and permit (via the creation of networks of interacting services) the creation of new tools. Second, I discuss how we can automate the documentation of data and computational results, so that users and programs alike can determine how much confidence to place in computational results. Such provenance mechanisms are an essential prerequisite to any serious attempt to realize SOS on a large scale. Third, I point out how technology can facilitate the construction of effective communities, and thus increase the scale at which SOS techniques are applied and sustained. Fourth and finally, I propose that the reach and impact of SOS, provenance, and community tools can be expanded by automating science protocols: extending the reach of automation to encompass not just simple computational tasks but also more complex procedures that may include experimental activities. None of this material is new or rigorous. Nor is my review of the state of the art anything more than suggestive. Nevertheless, I hope that this presentation spurs some thoughts in my readers on where and how to advance the state of the art in scientific software and infrastructure. 1. Service Oriented Science Emerging “digital observatories” provide online access to hundreds of terabytes of data in dozens of archives, via uniform interfaces [39]. These systems allow astronomers to Human-Machine Symbiosis, 50 Years On 3 pose and answer in seconds, and from their desk, questions that might previously have required years of observation in remote observatories. For example, astronomers can combine data from different archives to identify faint objects that are visible in the infrared spectrum but not the optical—so called brown dwarves [40]. In order to build such systems, astronomers have defined conventions for describing the contents of data archives and for the messages used to request and receive data. Thus, clients can discover and access data from different sources without writing custom code for each specific data source. These conventions address both lowlevel details of the format of the messages exchanged between clients and services and higher-level details concerning message contents. Web Services [5] specifications and software are widely used to address lower-level concerns; higher-level concerns tend to be addressed by more application-specific conventions, such as the VOTable specification [28]. Codified interfaces allow not only humans but also programs to access services. Indeed, it is arguably automated access by software programs that really makes such systems significant. In the time that a human takes to locate one useful piece of information, a program may access and integrate data from many sources and identify relationships that a human would never discover unaided. Thus, we can discover brown dwarves, integrate information automatically from genome and protein sequence databases to infer metabolic pathways [29], and search environmental data for extreme events. Not only data but also programs that operate on data can be encapsulated as services, as can sensors, numerical simulations, and programs that perform other computational tasks. Networks of such services can be constructed that perform complex computational activities with little or no human intervention. Systems that are thus structured in terms of communicating services are called service-oriented architectures. I use the term service-oriented science (SOS) [12] to refer to scientific research assisted or performed by such distributed networks of interoperating services. Many believe that SOS methods are vital for dealing with the rapidly growing volume of scientific data and the increasing complexity of scientific computing and research. In principle, SOS methods make it possible to decompose and distribute responsibility for complex tasks, so that many members of a community can participate in the construction of an eventual solution. The successful realization of SOS is not simply a question of using Web Services or similar technologies to encapsulate data and software. We also need: • • Resources (data, software, sensors, etc.) that are viewed as valuable by multiple people, and reward systems that motivate people to construct and operate services that provide access to those resources. These “reward systems” can range from payment to peer approval and professional advancement. Supporting software and services that allow clients to discover services, determine whether services meet their needs, and make sense of results returned by services. Depending on context, these mechanisms can range from simple natural language descriptions of service capabilities and contents to sophisticated metadata, constructed according to agreed-upon ontologies, describing contents, provenance, and accuracy [36]. In many cases, authentication, authorization, and management mechanisms and policies are also required to control who can access services. Human-Machine Symbiosis, 50 Years On • • 4 The hardware infrastructure, operational support, and policies that allow services to be operated in a suitably convenient, reliable, secure, and performant manner, and that permit users to access services efficiently over local and wide area networks. A community of developers, operators, and users who have the technical expertise required to construct, operate, and use services. New approaches to education and training may be required to develop this community. Note that success in each area depends on both technological and sociological issues. Indeed, the nontechnical issue of incentives may be the most important of all. A scientist may work long hours in the pursuit of not only knowledge but also tenure, fame, and/or fortune. The same time spent developing a service may not be so rewarded. We need to change incentives and enable specialization so that being a service developer is as honorable as being an experimentalist or theorist. Intellectual property issues must also be addressed so that people feel comfortable making data available freely. It is perhaps not surprising that astronomy has led the way in putting data online, given that its data has no known commercial value [39]. 1.1. Creating, Discovering, and Accessing Services For SOS to flourish, we need to kick start a virtuous cycle in which the following steps are performed repeatedly by many participants: • • • Users discover interesting data and/or software services, and determine that they meet their purposes; They compose this service with others to create new capabilities; and They publish the resulting services for use by others (perhaps subject to access control). We can thus catalyze the creation of distributed networks of services, each constructed by a different individual or group, and each providing some original content and/or value-added product. The U.S. National Cancer Institute takes SOS seriously. Its caBIG project [34] (Figure 1) seeks to enable new approaches to cancer research and care by facilitating the sharing of data and software across the many cancer centers and related institutions. To this end, caBIG leaders have defined and implemented a comprehensive architecture that addresses every aspect of the service lifecycle, from authoring to publication, discovery, composition, and access. The resulting service oriented architecture builds on Web Services standards, vocabularies and ontologies developed within the medical community, and the Globus open source software [13]. Authoring is assisted by a tool called Introduce [17], which allows users to define stateful Globus-based services, specify deployment parameters, and specify access control policies for the new service. A complementary tool, the Remote Application Virtualization Environment (RAVE), builds on Introduce to allow for the wrapping of arbitrary applications as Web Services. Figure 2 shows the steps involved in IntroduceRAVE service creation and deployment: 5 Human-Machine Symbiosis, 50 Years On 1. Using the RAVE-enhanced Introduce, the application service is defined in terms of its executable, the form of its input and output messages, its access control policies, and other metadata. The service code is generated and stored in a repository. The service is also registered in a service registry, so that users can discover its existence. When required (e.g., proactively, or in response to a user request), the service implementation is copied to an execution site … … and deployed. 2. 3. 4. 5. Once a service is deployed, users can then proceed to discover it and access it in the usual way: 6. 7. A user or program can discover the service’s existence … … and invoke it via conventional Web Services mechanisms. Of course, standard vocabularies are not always a prerequisite for automated analysis. To give one example, the GeneWays system mines the raw biological literature to identify experimentally derived relationships and to infer what credence to put in those relationships [33]. Analytical Service Grid-Enabled Client Gene Database Tool 1 caArray Tool 2 Research Center NCICB Grid Data Service Grid Services Infrastructure (Metadata, Registry, Query, Invocation, Security, etc.) Protein Database Tool 3 Tool 4 Image Microarray Grid Portal Tool 2 Research Ceter Tool 3 Figure 1: A caBIG deployment, showing data and compute services, portals, NCI infrastructure, and other components 1.2. Hosting and Provisioning In order for this virtuous cycle to flourish, we must both minimize the costs of not only creating but also operating services and also make it possible to build services that can scale to meet application demands. Thus, we require efficient and convenient service hosting mechanisms. We take such mechanisms for granted when it comes to 6 Human-Machine Symbiosis, 50 Years On Web pages—few people run their own Web server nowadays—but they are still rare for services. These mechanisms should allow for the rapid and convenient deployment of new services, for the dynamic provisioning of services in response to changing demand, for access control, and for accounting and audit. Service deployment mechanisms need (in one way or another) to acquire required resources at a hosting site, configure those resources appropriately, install and configure service code, and initiate the service. Globus Toolkit support for these functions illustrates some of the different ways in which they can be achieved: • • • (1) Create Appln Service Introduce (2) Store Registry Repository (3) Advertize (4) Transfer (6) Discover (7) Invoke; get results USER Container (5) Deploy Figure 2: Service creation and deployment steps Dynamic deployment of Java Web Services into an existing container allows for the rapid and lightweight creation of new services [31]. However, this approach only works for Java Web Services, and the Apache Axis container that Globus uses does not provide for resource management among different services running in the same container. The GRAM service provides for the dynamic instantiation, and subsequent monitoring and management, of arbitrary executable programs, which may themselves then operate as services [9]. GRAM is widely used for service deployment, for example when “gliding in” Condor, Sun Grid Engine [41], or Falkon agents. However, GRAM only provides limited control over how the computational resource is configured. The virtual workspace service [19] provides for the dynamic deployment, and subsequent monitoring and management, of arbitrary virtual machine (VM) images. A VM instance provides a high degree of control over execution environment and resource allocations, but is a more heavyweight construct than a process. Amazon’s Extensible Computing Cloud (EC2) is one of several providers operating on-demand computing resources. Like the virtual workspace service, it provides a Web Services interface for virtual machine deployment and management; however, it provides only simple security mechanisms. A workspace service interface to EC2 makes it easy for service creators to deploy services onto EC2 resources. Once a service is deployed, clients need to be able to monitor and manage its execution. They may also want to negotiate support for dynamic provisioning, i.e., for varying the resources allocated to a service in response to changing load. Services must often deal with data volumes, computational demands, and numbers of users beyond the capacity of a typical PC. Responding to a user request—or to the arrival of new data—can involve large amounts of computation. For example, the Argonne GNARE system searches periodically through DNA and protein databases for new and updated genomes and then computes and publishes derived values [37]. Analysis of a single Human-Machine Symbiosis, 50 Years On 7 bacterial genome of 4,000 sequences by three bioinformatics tools (BLAST, PFAM, and BLOCKS) requires 12,000 steps, each taking on the order of 30 seconds of run time. GNARE is able to perform these tasks in a timely fashion only because it has access to distributed resources provided by two U.S. national-scale infrastructures, TeraGrid [7] and Open Science Grid [38]. Dynamic provisioning becomes increasingly important as data analysis tasks are increasingly automated. For example, it is improbable that even a tiny fraction of the perhaps 500,000 biologists worldwide will decide to access Genbank, GNARE, or any other service at the same time. However, it is quite conceivable that 50,000 “agents” operating on their behalf would do so—and that each such agent would generate thousands of requests. IBM’s Oceano project [4] pioneered important ideas in dynamic provisioning, which is now becoming quasi-mainstream in certain commercial sectors. In my group, we are applying dynamic provisioning to both individual scientific applications and to scientific workloads with time varying resource demands. Falkon [32] monitors application load and then uses GRAM commands to acquire and release resources. By varying resource acquisition and release policies, we can tradeoff responsiveness to user requests and total resource consumption. Finally, in a networked world, any useful service will become overloaded. Thus, we need to control who uses services and for what purposes. Particularly valuable services may become community resources requiring coordinated management. Grid architectures and software can play an important role [13]. We also need to be concerned with ensuring that SOS realize its promise of being a democratizing force, rather than increasing the gap between the “haves” and “have-nots.” 2. Provenance Progress in science depends on one researcher’s ability to build on the results of another. SOS can make it far easier, from a mechanical perspective, for researchers to do just this, by using service invocations to perform data access, comparison, and analysis tasks that might previously have required manual literature searches, analyses, or even experiments. However, the results of these activities are only useful when published if other researchers can determine how much credence to put in the results on which they build, and in turn convince their peers that their results are credible. One approach to this problem emphasizes reputation as the primary basis for evaluating and enforcing quality [44]. If each published result is associated with an author, then others can judge whether to trust a result based on their prior experience with results published by that author—and the author, being concerned with their reputation, will seek to maximize quality. This process is, in essence, that followed with print publications today, with the rigor of the reviewing process in a particular journal or conference also playing a role. However, while reputation certainly has a role to play in trust, few researchers will be comfortable trusting a result on that sole basis. They will also want to see details on the method used to obtain a result. Such information can be used to determine whether a result can be trusted, can provide insights into when and where the result can be trusted, and can help guide new research. Such documentation corresponds, in a broad sense, to the “methods” section in experimental papers, which should in principle provide enough information to allow a Human-Machine Symbiosis, 50 Years On 8 researcher to replicate an experiment. While that principle is perhaps honored more in the breach than in the observance, it is still a fundamental concept for science. Increased use of computational techniques introduces new challenges to the documentation of experimental procedures (e.g., what version of software was used? what parameters were set?), but also offers the potential for significant improvements in “reproducibility.” After all, while it may be impossible to capture the exact actions performed by an experimental scientist, the digital nature of computations means that it can be possible (in principle) to capture the exact sequence of computational steps performed during simulation or analysis. These observations have motivated growing interest in methods for recording the provenance of computational results. Initial work focused on databases [6, 43], but interest has broadened to encompass arbitrary computations [11, 23]. A series of workshops [24] have led to the formulation of a provenance challenge [25], in which many groups have participated. Approaches explored include the use of functional scripting languages to express application tasks [45], file system instrumentation [27], and the use of a general-purpose provenance store [23]. 3. Building Communities Research occurs within communities, and the formation and operation of communities can be enabled by appropriate technology. Thus, Bill Wulf introduced in 1993 the concept of the collaboratory: a center without walls, in which the nation’s researchers can perform their research without regard to geographical location—interacting with colleagues, accessing instrumentation, sharing data and computational resources, and accessing information in digital libraries [1]. Five years later, Carl Kesselman and I wrote that Grid technologies are concerned with: coordinated resource sharing and problem solving in dynamic, multi-institutional virtual organizations. The sharing that we are concerned with is not primarily file exchange but rather direct access to computers, software, data, and other resources, as is required by a range of collaborative problem-solving and resource brokering strategies emerging in industry, science, and engineering. This sharing is, necessarily, highly controlled, with resource providers and consumers defining clearly and carefully just what is shared, who is allowed to share, and the conditions under which sharing occurs. A set of individuals and/or institutions defined by such sharing rules form what we call a virtual organization (VO). [10] These two characterizations capture important aspects of the technology required to enable collaboration within distributed communities, emphasizing in particular the need for shared infrastructure, on-demand access, and mechanisms for controlling community membership and privileges. While great progress has been made in tools for forming and operating distributed scientific communities, many challenges remain. For example, mechanisms that work effectively for two or ten participants may not scale effectively to one thousand or one Human-Machine Symbiosis, 50 Years On 9 million—not necessarily because implementations cannot handle the number of tasks, but because softer issues such as trust, shared vocabulary, and other implicit knowledge break down as communities extend beyond personal connections. One approach to solving some scaling problems is to build infrastructures that allow clients to associate arbitrary metadata (“assertions”) with data and services. Assuming that we can also determine whether such assertions can be trusted (perhaps on the basis of digital signatures, and/or yet other assertions), consumers can then make their own decisions concerning such properties as quality, provenance, and accuracy. Various popular systems demonstrate the advantages, costs, and pitfalls of different approaches to building such community knowledge bases: for example, the Wikipedia collaborative authoring system, the Flickr and Connotaea collaborative tagging systems [16], and game-based systems for improving tag quality [3]. 4. Automating Protocols Science is not simply a matter of analyzing data or running simulations. Depending on context, it can involve planning and conducting experiments, collecting and analyzing data, deriving models from data, performing many different simulations to explore the implications of models, inferring new hypotheses from data, and planning new experiments. As the complexity of each of these steps increases, each becomes a candidate for automation. Thus, we encounter several related concerns: identifying what to automate, determining how to automate, and documenting automated procedures so that they can understood, validated, and replicated. In the natural sciences, a protocol is a: predefined written procedural method in the design and implementation of experiments [that] should establish standards that can be adequately assessed by peer review and provide for successful replication of results by others in the field [2]. These remarks were written in the context of procedures intended to be performed manually, albeit perhaps with the aid of automated equipment. However, they can also apply to procedures applied entirely by computers, in which case we may refer to an automated protocol. Because automated protocols are performed by computers and without human intervention, they can operate far faster than manual protocols. Thus, it becomes increasingly important to document precisely what operations are performed. Arguably, the fact that operations are performed under computer control also makes it more feasible to describe the protocol’s operation, although as Muggleton [26] notes, “there is a severe danger that increases in speed and volume of data generation in science could lead to decreases in comprehension of the results.” Two areas in which automation has already had a major impact are data collection and integration [15]. In astronomy, automated sky surveys collect many terabytes of digital data per year, enabling new approaches to astronomy, as discussed above. In biology, the cost of DNA sequencing has reduced from around $10 per base pair in 1990 to less than 1 cent per base pair today. Thus, it becomes possible to perform, for example, “genetic surveys” of many species, and integrate new data from different sources [29, 37]. Human-Machine Symbiosis, 50 Years On 10 Sky surveys and genome sequencing both involve a comprehensive survey of an entire object (the sky or genome). In other cases, decision procedures are required to guide data collection, as when searching for transient events in astronomy or when exploring combinatorial spaces, such as the result of one (set of) experiment(s) helps guide the selection of the next. In that case, automated protocols can involve not only data collection and analysis but also the decision procedures used to operate experimental apparatus. In one suggestive project, King et al. [20] describe a “robot scientist” that uses automated mechanisms to identify experiments that can discriminate among competing hypotheses. They report that their best algorithm can outperform humans in terms of number of experiments required to achieve a given accuracy of prediction. Such algorithms may become a standard part of the scientist’s repertoire, and future papers may note that “we obtained these results using equipment X controlled by algorithm Y.” Technological improvements continue to reduce the cost and increase the speed of experimental apparatus. For example, microfluidic devices allow for cheaper and more easily automated laboratory experiments, by allowing the delivery of precise and minute quantities of experimental reagents. In an interesting twist, Prakash and Gershenfeld [30] describe how such apparatus can be controlled by embedded digital control, via what they call microfluidic bubble logic. Thus experimental protocols may extend to the configuration of multiple forms of digital and analog devices. 5. Summary When Licklider expressed his vision of computer-human symbiosis, he was restating, in terms of the technology of his day, and with a particular focus on problem solving, Alfred Whitehead’s observation that: Civilization advances by extending the number of important operations which we can perform without thinking about them. [42] The computer has greatly expanded the number of operations that we can perform without thinking. However, as we have discussed in this paper, the number of operations that remain susceptible to automation remains large—indeed, is perhaps unbounded. In seeking further opportunities for optimization of human problem solving, we need to take a system-level [14] or end-to-end view, in which we study and seek opportunities for optimization in every aspect of the problem solving process, not only by the individual researcher or within an individual laboratory, but also within and across communities. For example, we may determine that (as I have argued here) service oriented architectures can be used to distribute and thus accelerate the processes of publishing, discovering, and accessing relevant data and software; that the encoding of provenance information can facilitate the reuse of computational resources; that software support for building communities can promote the collaborative development of knowledge; and that the representation as data objects of the protocols used to perform experiments, analyze data, construct simulations, test simulation codes, and so forth, can raise the level at which the results of thinking (“cognitive artifacts”) are reused. Many other opportunities can easily be identified. Human-Machine Symbiosis, 50 Years On 11 In examining these issues, I have focused on the concerns of scientists and science. Scientists are certainly not alone in grappling with these issues. However, science is perhaps unique in the scope and scale of its problems and the subtlety of the questions that the methods discussed here can be used to answer. We may expect that methods developed for science can find application elsewhere, even as scientists look increasingly to computer science and information technology for tools that maximize the time that they spend thinking. Acknowledgements I am grateful to Lucio Grandinetti for the opportunity to present some of these ideas at the HPC 2006 conference in Cetraro, Italy, and to many colleagues for discussions on these topics, notably Charlie Catlett, Carl Kesselman, Rick Stevens, and Mike Wilde. This work was supported by the Mathematical, Information, and Computational Sciences Division of the Office of Advanced Scientific Computing Research, U.S. Department of Energy (DE-AC02-06CH11357). References 1. National Collaboratories: Applying Information Technology for Scientific Research. National Research Council, 1993. 2. Protocol (natural sciences), http://en.wikipedia.org/wiki/Protocol_(natural_sciences), 2007. 3. Ahn, L.v. Games with a Purpose. IEEE Computer (June). 96-98. 2006. 4. Appleby, K., Fakhouri, S., Fong, L., Goldszmidt, G., Kalantar, M., Krishnakumar, S., Pazel, D., Pershing, J. and Rochwerger, B., Oceano - SLA Based Management of a Computing Utility. in 7th IFIP/IEEE International Symposium on Integrated Network Management, (2001). 5. Booth, D., Haas, H., McCabe, F., Newcomer, E., Champion, M., Ferris, C. and Orchard, D. Web Services Architecture. W3C, Working Draft http://www.w3.org/TR/2003/WD-ws-arch-20030808/, 2003. 6. Buneman, P., Khanna, S. and Tan, W.-C., Why and Where: A Characterization of Data Provenance. in International Conference on Database Theory, (2001). 7. Catlett, C. and others. TeraGrid: Analysis of Organization, System Architecture, and Middleware Enabling New Types of Applications. in High Performance Computing and Grids in Action, 2007. 8. Engelbart, D.C. and English, W.K. A Research Center for Augmenting Human Intellect. in Proceedings of AFIPS 1968 Fall Joint Computer Conference, San Francisco, CA, 1968. 9. Feller, M., Foster, I. and Martin, S., GT4 GRAM: A Functionality and Performance Study. in TeraGrid 07, (2007). 10. Foster, I., Kesselman, C. and Tuecke, S. The Anatomy of the Grid: Enabling Scalable Virtual Organizations. International Journal of Supercomputer Applications, 15 (3). 200-222. 2001. 11. Foster, I., Voeckler, J., Wilde, M. and Zhao, Y., The Virtual Data Grid: A New Model and Architecture for Data-Intensive Collaboration. in Conference on Innovative Data Systems Research, (2003). Human-Machine Symbiosis, 50 Years On 12 12. Foster, I. Service-Oriented Science. Science, 308. 814-817. 2005. 13. Foster, I. Globus Toolkit Version 4: Software for Service-Oriented Systems. Journal of Computational Science and Technology, 21 (4). 523-530. 2006. 14. Foster, I. and Kesselman, C. Scaling System-level Science: Scientific Exploration and IT Implications. IEEE Computer (November). 32-39. 2006. 15. Goble, C., Pettifer, S. and Stevens, R. Knowledge Integration: In silico Experiments in Bioinformatics. in The Grid: Blueprint for a New Computing Infrastructure, Morgan Kaufmann, 2004. 16. Golder, S. and Huberman, B.A. The Structure of Collaborative Tagging Systems. Journal of Information Science, 32 (2). 198-208. 2006. 17. Hastings, S.L., Oster, S., Langella, S., Ervin, D.W., Kurc, T.M. and Saltz, J.H. Introduce: An Open Source Toolkit for Rapid Development of Strongly Typed Grid Services. Journal of Grid Computing. 2007. 18. Hey, A.J.G. and Trefethen, A. The Data Deluge: An e-Science Perspective. in Berman, F., Fox, G.C. and Hey, A.J.G. eds. Grid Computing: Making the Global Infrastructure a Reality, John Wiley & Sons Publisher, Inc., 2003. 19. Keahey, K., Foster, I., Freeman, T. and Zhang, X. Virtual Workspaces: Achieving Quality of Service and Quality of Life in the Grid. Scientific Programming, 13 (4). 265-275. 2005. 20. King, R.D., Whelan, K.E., Jones, F.M., Reiser, P.J.K., Bryant, C.H., Muggleton, S., Kell, D.B. and Oliver, S. Functional Genomic Hypothesis Generation and Experimentation by a Robot Scientist. Nature, 427. 247-252. 2004. 21. Licklider, J.C.R. and Taylor, R.W. The Computer as a Communication Device. Science and Technology (April). 1968. 22. Licklider, J.R. Man-Computer Symbiosis. IRE Transactions on Human Factors in Electronics, HFE-1. 4-11. 1960. 23. Miles, S., Groth, P., Branco, M. and Moreau, L. The requirements of using provenance in e-science experiments. Journal of Grid Computing, 5 (1). 1-25. 2005. 24. Moreau, L. and Foster, I. (eds.). International Provenance and Annotation Workshop (IPAW'06). Springer LNCS, 2006. 25. Moreau, L., Ludaescher, B., Altintas, I., Barga, R., Bowers, S., Callahan, S., Chin Jr, G., Clifford, B., Cohen, S., Cohen-Boulakia, S., Davidson, S., Deelman, E., Digiampietri, L., Foster, I., Freire, J., Frew, J., Futrelle, J., Gibson, T., Gil, Y., Goble, C., Golbeck, J., Groth, P., Holland, D., Jiang, S., Kim, J., Koop, D., Krenek, A., McPhillips, T., Mehta, G., Miles, S., Metzger, D., Munroe, S., Myers, J., Plale, B., Podhorszki, N., Ratnakar, V., Santos, E., Scheidegger, C., Schuchardt, K., Seltzer, M. and Simmhan, Y. The First Provenance Challenge. Concurrency and Computation: Practice and Experience. 2007. 26. Muggleton, S. Exceeding Human Limits. Nature, 440. 409-410. 2006. 27. Muniswamy-Reddy, K., Holland, D., Braun, U. and Seltzer, M., ProvenanceAware Storage Systems. in 2006 USENIX Annual Technical Conference, (Boston, MA, 2006). 28. Ochsenbein, F., Williams, R., Davenhall, C., Durand, D., Fernique, P., Giaretta, D., Hanisch, R., McGlynn, T., A. Szalay, Taylor, M. and Wicenec, A. VOTable Format Definition Version 1.1. International Virtual Observatory Alliance, www.ivoa.net/Documents/latest/VOT.html, 2004. 29. Overbeek, R., Larsen, N., Pusch, G.D., D'Souza, M., Selkov Jr, E., Kyrpides, N., Fonstein, M., Maltsev, N. and Selkov, E. WIT: integrated system for high- Human-Machine Symbiosis, 50 Years On 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 13 throughput genome sequence analysis and metabolic reconstruction. Nucleic Acids Research, 28 (1). 123-125. 2000. Prakash, M. and Gershenfeld, N. Microfluidic Bubble Logic. Science, 315 (5813). 832-835. 2007. Qi, L., Jin, H., Foster, I. and Gawor, J. HAND: Highly Available Dynamic Deployment Infrastructure for Globus Toolkit 4. 2006. Raicu, I., Zhao, Y., Dumitrescu, C., Foster, I. and Wilde, M. Falkon: a Fast and Light-weight tasK executiON framework for Grid Environments, 2007. Rzhetsky, A., Iossifov, I., Koike, T., Krauthammer, M., Kra, P., Morris, M., Yu, H., Duboue, P.A., Weng, W., Wilbur, W.J., Hatzivassiloglou, V. and Friedman, C. GeneWays: a system for extracting, analyzing, visualizing, and integrating molecular pathway data. J. Biomed. Inform., 37. 43-53. 2004. Saltz, J.H., Oster, S., Hastings, S.L., Langella, S., Sanchez, W., Kher, M. and Covitz, P.A. caGrid: design and implementation of the core architecture of the cancer biomedical informatics grid. Bioinformatics, 22 (15). 1910-1916. 2006. Schena, M., Shalon, D., Davis, R. and Brown, P. Quantitative monitoring of gene expression patterns with a complementary DNA microarray. Science, 270. 467-470. 1995. Stein, L. Creating a Bioinformatics Nation. Nature, 317. 119-120. 2002. Sulakhe, D., Rodriguez, A., D'Souza, M., Wilde, M., Nefedova, V., Foster, I. and Maltsev, N. GNARE: An Environment for Grid-Based High-Throughput Genome Analysis. Journal of Clinical Monitoring and Computing. 2005. Sulakhe, D., Rodriguez, A., Wilde, M., Foster, I. and Maltsev, N., Using Multiple Grid Resources for Bioinformatics Applications in GADU. in IEEE/ACM International Symposium on Cluster Computing and Grid, (2006). Szalay, A. and Gray, J. The World-Wide Telescope. Science, 293. 2037-2040. 2001. Tsvetanov, Z.I., Golimowski, D.A., Zheng, W., Geballe, T.R., Leggett, S.K., Ford, H.C., Davidsen, A.F., Uomoto, A., Fan, X., Knapp, G.R., Strauss, M.A., Brinkmann, J., Lamb, D.Q., Newberg, H.J., Rechenmacher, R., Schneider, D.P., York, D.G., Lupton, R.H., Pier, J.R., Annis, J., Csabai, I., Hindsley, R.B., Ivesic, Z., Munn, J.A., Thakar, A.R. and Waddell, P. The Discovery of a Second Field Methane Brown Dwarf from Sloan Digital Sky Survey Commissioning Data. Astrophysical Journal, 531. L61. 2000. Walker, E., Gardner, J.P., Litvin, V. and Turner, E.L. Creating personal adaptive clusters for managing scientific jobs in a distributed computing environment Challenges of Large Applications in Distributed Environments, IEEE, 2006. Whitehead, A.N. Introduction to Mathematics, 1911. Woodruff, A. and Stonebraker, M., Supporting Fine-Grained Data Lineage in a Database Visualization Environment. in 13th International Conference on Data Engineering, (1997), 91-102. Zacharia, G. and Maes, P. Trust Management Through Reputation Mechanisms. Applied Artificial Intelligence, 14. 881-907. 2000. Zhao, Y., Dobson, J., Foster, I., Moreau, L. and Wilde, M. A Notation and System for Expressing and Executing Cleanly Typed Workflows on Messy Scientific Data. SIGMOD Record 34 (3). 37-43 2005.
5cs.CE
arXiv:1705.00047v2 [cs.AI] 2 May 2017 Kiwi — A Minimalist CP Solver Renaud Hartert UCLouvain, Belgium Abstract. Kiwi is a minimalist and extendable Constraint Programming (CP) solver specifically designed for education. The particularities of Kiwi stand in its generic trailing state restoration mechanism and its modulable use of variables. By developing Kiwi, the author does not aim to provide an alternative to full featured constraint solvers but rather to provide readers with a basic architecture that will (hopefully) help them to understand the core mechanisms hidden under the hood of constraint solvers, to develop their own extended constraint solver, or to test innovative ideas. 1 Introduction Nowadays, a growing number of real world problems are successfully tackled using constraint solvers. The hybridization of constraint solvers with other combinatorial technologies such as mixed integer programming [1,3,14], local search [12,15,17], and particularly conflict driven clause learning [6,7,16] has been at the center of substantial advances in many domains. Unfortunately, while many open-source constraint solvers exist [4,8,9,10,11], modifying these solvers to hybridize them with other technologies, to extend them with specific structured domains, or to enhance them with new functionalities, may prove to be a time consuming and discouraging adventure due to the impressive number of lines of code involved in those open-source projects. Also starting the development of a constraint solver from scratch may also prove itself to be quite a challenge even if one has a deep understanding of the mechanisms and techniques at play in constraint solvers and constraint propagators. The goal of this paper is to present Kiwi — a minimalist and extendable constraint solver. The source code of the core components of Kiwi is under 200 lines of Scala code and is the result of rethinking and simplifying the architecture of the opensource OscaR solver [11] to propose what we believe to be a good trade-off between performance, clarity, and conciseness. By developing Kiwi, the author does not aim to provide an alternative to full featured constraint solvers but rather to provide students with a basic architecture that will (hopefully) help them to understand the core mechanisms hidden under the hood of constraint solvers, to develop their own extended constraint solver, or to test innovative ideas.1 2 Overview of the Solver We start the presentation of Kiwi by briefly describing its three main components: propagation, search, and state restoration. 1 In this regard, Kiwi can be seen as an attempt to follow the initiative of minisat [5] but in the context of constraint programming. Propagation The propagation system reduces the domain of the variables by filtering values that are part of no solution according to the constraints. The architecture of this system is described in section 4. Search Unfortunately, propagation alone is usually not sufficient to solve a constraint satisfaction problem. Constraint solvers thus rely on a divide-and-conquer procedure that implicitly develops a search tree in which each node is a subproblem of its ancestors. Leaves of this search-tree are either failed nodes – i.e. inconsistent subproblems – or solutions. Propagation is used at the beginning of each node to reduce the domain of the variables and thus to prune fruitless branches of the search tree. The search procedure of Kiwi is described in section 5. State restoration The state restoration system manages the different search nodes explored during search. Precisely, it is the component that restores the domain of the variables to their previous state each time a backtrack occurs. Its main purpose is to reduce the cost of copying the entire state of each node to provide users with an efficient trade-off between memory and processing costs. State restoration mechanisms are presented in the next section. More than a constraint solver, Kiwi must be seen as a set of the components involved in the core of classic constraint solvers. Indeed, Kiwi does not provide users with abstraction to help them model and solve combinatorial problems. Also, we only give little attention to the filtering procedures involved in constraint propagation – which are arguably the most complex parts of every constraint solver. While the simplest binary constraints may only require a few lines of code, more complex global constraints usually rely on sophisticated algorithms and data structures. Scheduling constraints are a perfect example of such complex global constraints. The reader that is interested by global constraints and propagators may refer to [2] for a wide catalogue of global constraints and links towards the relevant literature. 3 State restoration Copying and storing the whole state of each search node is usually too memory consuming for a real constraint solver. The state restoration system thus has to rely on different trade-offs to restore the domain of the variables as efficiently as possible.2 There are three main approaches to implements such a system: – Copying. A complete copy of the domains is done and stored before changing their state. – Recomputation. Domains are recomputed from scratch when required. – Trailing. Domain changes are recorded incrementally and undone when required. 2 State restoration is of course not limited to domains and may also be used to maintain incremental data structures or other components. Trailing is the prominent approach used in many constraint solvers [4,5,9,10,11].3 The idea behind trailing is to maintain the sequence of changes that occured on a given branch since the root of the search tree. We call such a sequence the trail. Each node can be represented by a prefix of the trail that corresponds to the sequence of changes that lead to this node. Particularly, the sequence of changes that lead to a node is always an extension of the sequence that lead to its direct ancestor and so on (the root node being represented by the empty sequence). This incremental representation is convenient for backtracks as they can be performed by undoing the last changes of the trail until restoring the sequence of the desired node. For instance, let us consider the sequence of k changes depicted in Figure 1. The first node has been computed from the root node by applying 3 changes c1 , c2 , c3 , the second node has been computed from the first node by applying 4 changes c4 , c5 , c6 , c7 , and the third node has been computed from the second node by applying k − 7 changes. We can easily restore the state of the second node by undoing the last changes of the trail until c7 , i.e., ck , ck−1 , . . . , c8 . In Kiwi, we chose to manage state restoration with an extended trailing mechanism. The particularity of our system is that it allows each stateful object (e.g. the domain of a variable) to manage its own restoration mechanism internally. This mechanism can be based on trailing, copying, or even recomputation. 3 Although, some solvers such as Gecode [8] rely on an hybrid state restoration mechanism based on both copying and recomputation. empty (root node) sequence of node 1 sequence of node 2 sequence of node 3 Fig. 1: A trail made of a sequence of k changes. The sequence of changes that lead to node i is always an extension of the sequence of changes that lead to node i − 1. The remainder of this section is dedicated to the implementation of this system. 3.1 Changes as an Abstraction Each time a state changing operation is performed, the necessary information to undo this operation is stored on the trail. Such undo information can have many forms but is usually represented by a pair made of a memory location and of its corresponding value. In Kiwi, we chose to directly store the functions responsible of undoing state changes as first class objects, i.e., as closures. Each stateful object thus relies on its own restoration mechanism which is handled by the closure itself. The abstract class of an undo operation, namely Change, is presented in Code 3.1. It contains a single function undo which, as its name suggests, is responsible for undoing the change. The complete implementation of a stateful mutable integer is presented in section 3.3. 1 abstract class Change { def undo(): Unit // Undo the change 2 3 } Code 3.1: The Change abstract class. 3.2 The Trail Our trailing system is implemented with two stacks: – The first is a stack of Change objects that represents the trail. It is sorted chronologically such that the most recent change is on top of the stack (the root node being the empty stack). – The second stack maps each node of the current branch to its corresponding prefix in the trail. Thanks to the incrementality of the trail, only the position of the last change that lead to a node needs to be stored to characterize the whole sequence of changes that lead to this node. Figure 2 illustrates the relation between both stacks. The whole implementation of Trail, our trailing system, is presented in Code 3.2. Changes are registered using the store function that pushes them on top of trail (line 6). The newNode function registers the state of the current node by storing the current size of the trail (line 8). Conversely, the undoNode function restores the previous node by undoing the changes on top of the trail until its size corresponds to the size stored with the previous node (lines 10 to 12 and 15 to 17). 1 class Trail { 2 // Stacks to map nodes to the trail 3 private val trail = new Stack[Change]() 4 private val nodes = new Stack[Int]() 5 // Store the change 6 def store(change: Change): Unit = trail.push(change) 7 // Mark the beginning of a new node 8 def newNode(): Unit = nodes.push(trail.size) 9 // Restore the previous node 10 def undoNode(): Unit = { if (nodes.size > 0) undoUntil(nodes.pop()) 11 12 } 13 // Restore the root node 14 def undoAll(): Unit = undoUntil(0) 15 private def undoUntil(size: Int): Unit = { while (trail.size > size) trail.pop().undo() 16 } 17 18 } Code 3.2: Implementation of the trailing system of Kiwi change k+1 Last change of node 3 change k change k-1 change 4 Last change of node 2 Last change of node 1 change 3 k Node 3 change 2 3 Node 2 change 1 1 Node 1 trail nodes Fig. 2: The trailing system of Kiwi is implemented with two stacks. 3.3 Trailed Integer We now have all the pieces required to build our first stateful object: a stateful integer variable4 called TrailedInt. As for classic integer variables, the value of TrailedInt can be accessed and updated. It however keeps track of the different values it was assigned to in order to restore them each time a backtrack occurs. Similarly to most stateful objects in Kiwi, TrailedInt implements its own internal state restoration mechanism. It is based on a stack of integers that represents the sequence of values that were assigned to this TrailedInt since its initialization. Restoring the previous state of TrailedInt thus amounts to update its current value to the last entry of the stack (which is then removed from the stack). 4 Integer variable here refers to a mutable integer. The implementation of TrailedInt is presented in Code 3.3. The current value of the object is stored in the private variable currentValue. It is accessed with the getValue function. The setValue function is the one used to modify the value of the object. It pushes the current value on top of the stack of old values (line 7), updates currentValue (line 8), and notifies Trail that a change occurred (line 9). The particularity of this implementation is that TrailedInt directly implements the Change abstract class and its undo operation (lines 12 to 14). This has the advantage of reducing the overhead of instantiating a new Change object each time a state changing operation is performed on TrailedInt. 3.4 Improvements The trailing system we presented suffers from a major weakness. For instance, TrailedInt keeps track of all the values it was assigned to. However, only the values it was assigned to at the beginning of each state are required for state restoration. Hopefuly, we can easily fix this problem with timestamps. The idea is to associate a timestamp to each search node and to only register the current value of TrailedInt if it has not yet been registered at a given timestamp. The interested reader can refer to the 12th chapter of [13] for detailed explanations on how to improve trailing systems. 1 class TrailedInt(trail: Trail, initValue: Int) extends Change { 2 private val oldValues = new Stack[Int]() 3 private var currentValue: Int = initialValue 4 def getValue: Int = currentValue 5 def setValue(value: Int): Unit = { if (value != currentValue) { 6 7 oldValues.push(currentValue) 8 currentValue = value trail.store(this) 9 } 10 11 } 12 override def undo(): Unit = { currentValue = oldValues.pop() 13 } 14 15 } Code 3.3: Implementation of TrailedInt, a stateful integer variable with its own internal state restoration mechanism. 4 The Propagation System Propagation is the process of using the filtering procedure embedded in the constraints to reduce the domain of the variables. To achieve this, the propagation system of Kiwi relies on the following entities: – The propagators which are responsible of performing constraint propagation by updating the domain of the variables, or to notify that a conflict occured. They contain the actual filtering procedures of their respective constraint. Propagators are registered on different types of events, such as the reduction of a variable’s domain, and need to be propagated each time one of these events occurs. – The propagation queue that synchronizes propagators to perform propagation until no further filtering can be achieved or a conflict has been detected. – The variables which are updated by the propagators and are responsible for notifying the propagation queue if a propagator needs to be considered for further propagation. The interaction between those abstractions is illustrated in Figure 3. Observe that the propagation queue, PropagQueue, does not directly interact with the variables. 4.1 Propagators does not contain any object that actually represents a constraint. Instead, a constraint is implicitly defined by the set of Kiwi 1) propagate 2.a) reduce domain PROPAGATORS 2.b) fail PROPAGQUEUE VARIABLES 3) enqueue propagators Fig. 3: Interaction between the components at play in the propagation system of Kiwi. propagators which must ensure that the constraint’s logical relation holds. A constraint can thus be composed of a single propagator registered on all the variables in the constraint’s scope, or by a set of propagators, each one being registered on a subset of the constraint’s scope. The abstract class Propagator is presented in Code 4.1. It contains the following functions: – The enqueued boolean is a flag used by the propagation queue to indicate that the propagator is awake and waiting for propagation. – The init function registers the propagator on the events of interest and perform its initial propagation. It return true if the propagation suceed and false if it lead to a conflict. – The propagate function performs the actual filtering. Like init, it returns false if and only if propagation lead to a conflict. 1 abstract class Propagator { 2 var enqueued: Boolean // True if the propagator is awake 3 def init(): Boolean // Register the propagator and propagate 4 def propagate(): Boolean // Calls the filtering procedure 5 } Code 4.1: The Propagator abstract class. As an example, we present the complete implementation of a simple binary constraint in section 4.4. 4.2 The Propagation Queue The propagation queue, PropagQueue, contains all the propagators that are waiting for propagation. It is responsible for synchronizing these propagators until no further filtering can be achieved, or until a conflict has been detected. When running, the propagation process dequeues one propagator from the propagation queue and calls its propagate function to reduce the domain of some variables. Of course, reducing the domain of a variable usually awakes new propagators that are then enqueued in the propagation queue. This process is repeated until either the propagation queue becomes empty, meaning that no further propagation is possible, or until a conflict occured. The implementation of PropagQueue is presented in code 4.2. The enqueue function enqueues a propagator in the propagation queue but only if it is not already contained in it (lines 5 to 10). The propagate function contains the main loop of the propagation process (lines 12 to 22). It empties the queue by dequeuing each propagator and calling their propagate function if no conflict has occurred yet. The function concludes by returning true if no conflict occurred; it returns false otherwise. Observe that the propagation queue is emptied even if a conflict occured. 4.3 Variables Variables are the last piece of our propagation system. Interestingly enough, Kiwi does not provide variables with an interface to implement. This design choice is one of the reasons that facilitates the extension of Kiwi with additional structured domain representations [13]. While variables does not have to respect any requirements, they usually offer the following functionalities: – A variable has a domain that represents the set of all possible values it could be assigned to. – A variable offers functions to remove possible values from its domain until it becomes a singleton, in which case the variable is assigned, or it becomes empty, meaning that a conflict occured. This domain must be restored to its previous state when a backtrack occurs. – A variable allows propagators to watch particular modifications of its domain. The role of the variable is then to enqueue these propagators in the propagation queue when one of these modifications occur. 1 class PropagQueue { 2 // The propagation queue 3 private val queue = new Queue[Propagator]() 4 // Enqueue the propagator if it is not already enqueued 5 def enqueue(propagator: Propagator): Unit = { if (!propagator.enqueued) { 6 propagator.enqueued = true 7 queue.enqueue(propagator) 8 } 9 10 } 11 // Propagation process 12 def propagate(): Boolean = { var unfailed = true 13 14 // Propagate the propagators 15 while (!queue.isEmpty) { 16 val propagator = queue.dequeue() 17 // Only call propagate if no conflict occurred 18 unfailed = unfailed && propagator.propagate() propagator.enqueued = false 19 } 20 return unfailed 21 } 22 23 } Code 4.2: Implementation of the propagation queue of Kiwi. As an example, we focus on a particular type of integer variable that we call interval variable.5 The domain of an interval variable is characterized by its minimal value min and its maximal value max. It contains all the values contained in the interval min, max. Particularly, the domain of an interval variable can only be reduced by increasing its minimal value or by decreasing its maximal value. We subsequently refer to the minimal and maximal values of the domain as the bounds of the variables. The implementation of IntervalVar is presented in Code 4.3. As expected, it is made of two TrailedInt that represent the minimum and maximum value of the variable’s domain. The minWatchers and maxWatchers queues are used to store propagators that must respectively be awaken when the minimum value of the variable is increased or when the maximum value of the variable is decreased. These queues are filled using the watchMin and watchMax functions. The updateMin function is the one responsible for increasing the minimum value of the variable. It operates as follows: 1. If the new minimum value exceeds the maximum value of the variable, then the domain becomes empty and the function returns false to notify this conflict (line 14).6 2. If the new minimum value is lower or equal to the current minimum value, then nothing happens and the function returns true (line 15). 5 6 Interval variables are commonly used by bound-consistent propagators [13]. We do not actually empty the domain of the variable because this change will be directly undone by backtracking. 3. Otherwise, the function updates the minimum value to its new value, awakes all the propagators contained in the minWatchers queue and returns true to notify that no conflict occured (lines 17 to 19). For the sake of conciseness, we do not describe the implementation of watchMax and updateMax as they are symmetric to their min version. 4.4 The Lower or Equal Constraint We now have all the components at hand to understand and implement our first constraint. We focus on the simple binary constraint x ≤ y where both x and y are interval variables (see Code 4.3). The x ≤ y constraint is made of a single propagator called LowerEqual (see Code 4.4). Its propagate function ensures the following rules: – The maximum value of x is always lower or equal to the maximum value of y (line 12). – The minimum value of y is always greater or equal to the minimum value of x (line 13). The propagate function returns false if ensuring these rules empties the domain of either x or y; it returns true otherwise. The init function performs the initial propagation (line 4) and registers the propagator on its variables (lines 6 and 7). Like propagate, it returns true if the propagation succeeded and false if a conflict occurred. Note that the propagator does 1 class IntervalVar(pQueue: PropagQueue, trail: Trail, initMin: Int, initMax: Int) { 2 3 private val min = new TrailedInt(trail, initMin) 4 private val max = new TrailedInt(trail, initMax) 5 private val minWatchers = new Queue[Propagator]() 6 private val maxWatchers = new Queue[Propagator]() 7 def getMin: Int = min.getValue 8 def getMax: Int = max.getValue 9 def isAssigned: Boolean = getMin == getMax 10 def watchMin(propagator: Propagator): Unit = { minWatchers.enqueue(propagator) 11 12 } 13 def updateMin(newMin: Int): Boolean = { if (newMin > max.getValue) false 14 15 else if (newMin <= min.getValue) true 16 else { 17 min.setValue(newMin) 18 for (propagator <- minWatchers) pQueue.enqueue(propagator) true 19 } 20 21 } 22 // Similar to watchMin 23 def watchMax(propagator: Propagator): Unit = { ... } 24 // Similar to updateMin def updateMax(newMax: Int): Boolean = { ... } 25 26 } Code 4.3: Implementation of an interval variable. not have to be awaken when the maximum value of x or the minimum value of y change since they have no impact on both previous rules. 1 class LowerEqual(x: IntervalVar, y: IntervalVar) extends Propagator { override def init(): Boolean = { 2 3 if (!propagate()) false 4 else { 5 x.watchMin(this) 6 y.watchMax(this) true 7 } 8 9 } 10 override def propagate(): Boolean = { 11 if (!x.updateMax(y.getMax)) false 12 else if (!y.updateMin(x.getMin)) false 13 else true } 14 15 } Code 4.4: Implementation of a propagator to enforce the relation x ≤ y. 4.5 Improvement and Discussion There are many ways to improve our propagation system. For instance, let us consider the LowerEqual propagator from the previous section. If the maximal value of x becomes lower or equal to the minimum value of y, then no further filtering is possible. We say that the propagator is entailed and thus does not have to be propagated anymore. We could implement this additional condition by adding a stateful boolean to the Propagator interface and by checking the value of this boolean each time the propagator is enqueued in the propagation queue. Another improvement is to add different levels of priority to propagators. Indeed, some propagators have a much faster filtering procedure than others. It is therefore useful to propagate these propagators first in order to give as much information as possible to slower propagators. The interested reader can refer to the 4th and 12th chapters of [13] for detailed additional improvements. 5 Search The final part of our solver is the search system. Its aim is to explore the whole search space of the problem looking for solutions or proving that no solution exists. It uses trailing to manage the nodes of the search tree and applies propagation to prune fruitless branches. The search system is based on a depthfirst-search algorithm that relies on heuristics to determine the order in which nodes are explored. The following sections are dedicated to the description of these components. 5.1 Heuristics and Decisions The aim of the heuristic is to define and order the children of any internal node of the search tree. It does so by associating each node with a sequence of decisions, where a decision is any operation that transforms a node into one of its children – e.g. assigning a variable to a value, or removing that value from the domain of the variable. The order in which decisions are returned corresponds to the order in which children have to be visited in the search tree. Particularly, the heuristic returns an empty sequence of decisions if the current node is a valid leaf, i.e., a solution. Let us first take a look at the interface of a Decision (see Code 5.1). It contains the single function apply that is responsible of applying the decision. It returns false if applying the decisions directly lead to a conflict (e.g. if we try to assign a variable to a value that is not part of its domain for instance); it returns true otherwise. 1 abstract class Decision { def apply(): Boolean 2 3 } Code 5.1: The Decision abstract class. As an example, we consider the implementation of both decisions in Code 5.2. The GreaterEqual decision updates the min- imal value of x to v. It returns true if v is lower or equal to the maximal value of x; it returns false otherwise. The Assign decision assign the variable x to the value v. It returns true if v is part of the domain of x; it returns false otherwise. 1 class GreaterEqual(x: IntervalVar, v: Int) extends Decision { override def apply(): Boolean = x.updateMin(v) 2 3 } 4 class Assign(x: IntervalVar, v: Int) extends Decision { override def apply(): Boolean = x.updateMin(v) && x.updateMax(v) 5 6 } Code 5.2: Implementation of two decisions. Code 5.3 presents the interface of Heuristic. It contains the single function nextDecisions which, as mentioned above, returns a sequence – an iterator precisely – of Decision objets that will be used by the search system to build the search tree. We illustrate the use of this interface with the StaticMin heuristic (see Code 5.4). It builds a binary search tree in which each left branch tries to assign a variable to its minimal value and each right branch tries to remove that value from the domain of its variable (see Figure 4). The order in which StaticMin tries to assign variables is statically determined by the order of the variables in the vars array. The first part of the heuristic (lines abstract class Heuristic { 1 def nextDecisions(): Iterator[Decision] 2 } 3 Code 5.3: The Heuristic abstract class. 6 to 7) searches for the index of the first unassigned variable in This index is stored in the nextUnassigned stateful integer (line 8) – the use of a stateful integer is not required here but reduces the overhead of systematically scanning the first already assigned variables. If all variables have been assigned, the heuristic returns an empty iterator to inform the search system that the current node is a leaf (line 10). Otherwise, it selects the next unassigned variable and tries to assign it with its minimum value – left branch – or to remove that value from the variable’s domain – right branch – (lines 12 to 15).7 vars. 5.2 The Depth-First-Search Our depth-first-search algorithm explores the search tree defined by the heuristic. It relies on propagation to reduce the domain of the variables and thus pruning fruitless branches of the search tree. The particularity of our implementation is that it manages its own stack of nodes instead of relying on recursion. The link 7 The LowerEqual and the GreaterEqual decisions have similar implementations. 1 class StaticMin(trail: Trail, vars: Array[IntervalVar]) extends Heuristic { 2 3 private val nextUnassigned = new TrailedInt(trail, 0) 4 override def nextDecisions: Iterator[Decision] = { 5 // Search for the next unassigned variable 6 var i = nextUnassigned.getValue 7 while (i < vars.length && vars(i).isAssigned) i += 1 8 nextUnassigned.setValue(i) 9 // Compute the sequence of decisions 10 if (i == vars.length) Iterator() // leaf node 11 else { val x = vars(i) 12 13 val v = x.getMin 14 // Assign x to v or remove v from the domain of x Iterator(new LowerEqual(x, v), new GreaterEqual(x, v + 1)) 15 } 16 } 17 18 } Code 5.4: Implementation of a static binary search heuristic that tries to assign variables to their minimum value. Fig. 4: Search tree built by the StaticMin heuristic on variable x ∈ 1, 4. between the stack and the actual search tree is illustrated in Figure 5 (note that, by abuse of language, we subsequently refer to ‘decisions’ as ‘nodes’ and vice-versa). The stack (depicted on the left) contains the iterator of decisions of each node in the currently explored branch of the search tree. Precisely, the first iterator corresponds to the children of the root node, the second iterator corresponds to the children of node C, and so on. The gray element of each iterator is its current element. Hence, dashed elements have already been read while white elements still have to be. The search tree (depicted on the right) follows the same color code. Dashed nodes are the root of already explored subtrees, gray nodes are part of the branch that is currently explored by the search, and white nodes still have to be visited. Node G is the node that is currently visited by the search. The stack starts empty at the beginning of the search to indicate that the root node has not yet been visited. The search Iterators A B C stack root A B D E F G H C D F G E H Fig. 5: Relation between the stack of iterators and the search tree. then uses the heuristic to expand the root node by pushing its sequence of children on the stack. The first unvisited child on top of the stack is then selected and expanded in the same way. This process is repeated until, eventually, the search reaches a node with an empty sequence of decisions, i.e., a leaf. It then operates as follows: 1. If the iterator on top of the stack still contains unvisited nodes, then the search backtracks by visiting the next element of this iterator – the next sibling of the current node. 2. Otherwise, we know that the iterator on top of the stack does no contain any unvisited nodes. The search thus removes this iterator from the top of the stack and repeats this process. Figure 6 illustrates this operation where steps (a) and (b) respectively correspond to the second and the first above situations. The search keeps exploring the search tree by pushing and popping iterators on the stack until it becomes empty, meaning that the whole search tree has been explored. (a) Iterators A B C stack root A D E F Iterators A B C C D F G H (b) B E G H root A B C stack D E D E Fig. 6: Relation between the stack and the search tree in case of backtrack. The implementation of our depth-first-search algorithm is presented in Codes 5.5 and 5.6. As expected, it contains an internal stack of iterators that we call decisions (line 2). The onSolution function (line 4) is a hook to be overridden by the user. It defines the action to perform each time the search encounter a solution. The propagateAndExpand function (lines 5 to 15) is called each time a new node is visited. It returns false if and only if the currently visited node is a leaf (either it is a solution or not); it returns true otherwise. The first part of that function is to propagate the visited node (line 6). This operation may lead to a conflict in which case false is returned to indicate that the node is a failed leaf. Otherwise, we call the nextDecisions function of heuristic to get the children of the node as a sequence of decisions (line 7). If this sequence is empty, then we know that the node is a solution, we call the onSolution function, and returns false (lines 8 to 10). If the node actually has children, its iterator of decisions is pushed on the stack and the function returns true (lines 11 to 13). The search function is probably the most complex piece of code of Kiwi (see Code 5.6). It is the one that is actually responsible of exploring the search tree. It takes a maximum number of nodes to visit in parameter to limit the time spent exploring the search tree – which grows exponentially with the size of the problem to solve. The function returns true if it was able to explore the whole search tree without exceeding the maximum number of nodes; it returns false otherwise. The first part of the search is to call propagateAndExpand to perform the initial root propagation and expand the root node (line 4). If that call returns false, then we know that the root node is already a leaf (either it is a solution or not). The search thus returns true to notify the user that the whole search tree – which is made of a single node – has been explored. Otherwise, we know that the decisions stack contains its first non-empty iterator (i.e. the children of the root) and that we can start exploring the search tree. The actual search starts if the decisions stack contains at 1 class Search(solver: Solver, trail: Trail, heuristic: Heuristic) { 2 private val decisions = new Stack[Iterator[Decision]]() 3 // Called each time a solution is found 4 def onSolution(): Unit = {} 5 private def propagateAndExpand(): Boolean = { 6 if (!solver.propagate()) return false 7 val nextDecisions = heuristic.getDecisions() 8 if (nextDecisions.isEmpty) { onSolution() 9 false 10 else { 11 decisions.push(nextDecisions) 12 true 13 } 14 } 15 def search(maxNodes: Int): Boolean = { ... } 16 17 } Code 5.5: Solver least one iterator – which is always true at this step – and if the maximum number of nodes is not exceeded (line 6). The first step of the loop is to check that the iterator on top of the stack still contains unapplied decisions, i.e., unvisited nodes (lines 7 and 8). The next step is one of the following: 1. If the iterator still contains some decisions, then the search visits the next node by notifying the trailing system that we are building a new node (line 10), and then by applying the next decision of the top iterator (lines 11 and 12). The search undo the state of this new node if it is a leaf (line 13), i.e., if applying the decision directly lead to a conflict or if the propagateAndExpand function returned false. 2. If the iterator does not contain any unapplied decision, then it is removed from the decisions stack (line 15) and the state of the current node is undone (line 16) (see Figure 6). The main loop is repeated until either the decisions stack becomes empty or until the maximum number of visited nodes has been exceeded. The search then concludes by undoing all the not yet undone nodes and by removing all the remaining iterators from decisions (lines 20 and 21). It finally returns true if and only if it was able to explore the whole search tree (line 23). References 1. J Christopher Beck and Philippe Refalo. A hybrid approach to scheduling with earliness and tardiness costs. Annals of Operations Research, 118(1-4):49–71, 2003. 1 def search(maxNodes: Int): Boolean = { 2 var nodes = 0 3 // Root propagation 4 if (!propagateAndExpand()) return true 5 // Start DFS 6 while (!decisions.isEmpty && nodes < maxNodes) { 7 val nextDecisions = decisions.top 8 if (nextDecisions.hasNext) { 9 nodes += 1 10 trail.newNode() 11 val decision = nextDecisions.next() 12 val success = decision.apply() if (!success || !propagateAndExpand()) trail.undoNode() 13 } else { 14 decisions.pop() 15 trail.undoNode() 16 } 17 18 } 19 // Clear trail and decisions 20 trail.undoAll() 21 decisions.clear() 22 // Return true if the search is complete return nodes < maxNodes 23 24 } Code 5.6: The depth-first-search algorithm of Kiwi. 2. Nicolas Beldiceanu, Mats Carlsson, Sophie Demassey, and Thierry Petit. Global constraint catalogue: Past, present and future. Constraints, 12(1):21–62, 2007. 3. Alexander Bockmayr and Nicolai Pisaruk. Detecting infeasibility and generating cuts for mip using cp. In Proceedings of the 5th International Workshop on Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, CPAIOR, volume 3, 2003. 4. Xavier Lorca Charles Prud’homme, Jean-Guillaume Fages. Choco3 documentation. TASC, INRIA Rennes, LINA CNRS UMR 6241, COSLING S.A.S., 2014. 5. Niklas Eén and Niklas Sörensson. An extensible sat-solver. In Theory and applications of satisfiability testing, pages 502–518. Springer, 2003. 6. Thibaut Feydy, Andreas Schutt, and Peter J Stuckey. Semantic learning for lazy clause generation. In Proceedings of TRICS Workshop: Techniques foR Implementing Constraint programming Systems, TRICS’13, Uppsala, Sweden, 2013. 7. Thibaut Feydy and Peter J Stuckey. Lazy clause generation reengineered. In Principles and Practice of Constraint Programming-CP 2009, pages 352–366. Springer, 2009. 8. Gecode Team. Gecode: Generic constraint development environment, 2006. Available from http://www.gecode.org. 9. IBM ILOG CPLEX CP Optimizer. V12.6. 10. Or-tools Team. or-tools: Google optimization tools, 2015. Available from https://developers.google.com/optimization/. 11. OscaR Team. OscaR: Scala in OR, 2012. Available from https://bitbucket.org/oscarlib/oscar. 12. Laurent Perron, Paul Shaw, and Vincent Furnon. Propagation guided large neighborhood search. Principles and Practice of Constraint Programming–CP 2004, pages 468–481, 2004. 13. Francesca Rossi, Peter Van Beek, and Toby Walsh. Handbook of constraint programming. Elsevier Science, 2006. 14. Domenico Salvagnin and Toby Walsh. A hybrid mip/cp approach for multi-activity shift scheduling. In Principles and practice of constraint programming, pages 633–646. Springer, 2012. 15. Pierre Schaus. Variable objective large neighborhood search. Submitted to CP13, 2013. 16. Andreas Schutt, Thibaut Feydy, Peter J Stuckey, and Mark G Wallace. Why cumulative decomposition is not as bad as it sounds. In Principles and Practice of Constraint ProgrammingCP 2009, pages 746–761. Springer, 2009. 17. P. Shaw. Using constraint programming and local search methods to solve vehicle routing problems. Principles and Practice of Constraint Programming—CP98, pages 417–431, 1998.
2cs.AI
Multidimensional Binary Search for Contextual Decision-Making arXiv:1611.00829v2 [cs.DS] 26 Apr 2017 Ilan Lobel NYU [email protected] Renato Paes Leme Google Research NY [email protected] Adrian Vladu∗ MIT [email protected] Abstract We consider a multidimensional search problem that is motivated by questions in contextual decision-making, such as dynamic pricing and personalized medicine. Nature selects a state from a d-dimensional unit ball and then generates a sequence of d-dimensional directions. We are given access to the directions, but not access to the state. After receiving a direction, we have to guess the value of the dot product between the state and the direction. Our goal is to minimize the number of times when our guess is more than ǫ away from the true answer. We construct a polynomial time algorithm that we call Projected Volume achieving regret O(d log(d/ǫ)), which is optimal up to a log d factor. The algorithm combines a volume cutting strategy with a new geometric technique that we call cylindrification. 1 Introduction Binary search is one of the most basic primitives in algorithm design. The binary search problem consists in trying to guess an unknown real number θ ∈ [0, 1] given access to an oracle that replies for every guess xt if xt ≤ θ or xt > θ. After log(1/ǫ) guesses, the binary search algorithm is able to estimate θ within ǫ precision. We study a multidimensional and online version of the binary search problem. The unknown quantity is a vector θ ∈ Rd with kθk2 ≤ 1 and in each iteration an adversary selects a direction ut ∈ Rd such that kut k2 = 1. At each iteration, the algorithm is asked to guess the value of the dot product θ ⊤ ut . After the algorithm makes a guess xt , it is revealed to the algorithm whether xt ≤ θ ⊤ ut or xt > θ ⊤ ut . The goal of the algorithm designer is to create an algorithm that makes as few mistakes as possible, where a mistake corresponds to a guess with an error larger than ǫ. This problem has recently come up as a key building block in the design of online algorithms for contextual decision-making. In contextual decision-making, the direction ut corresponds to a context relevant for the period t decision and θ ⊤ ut corresponds to the optimal period t decision. Contextual decision-making is increasingly important in an economy where decisions are ever more customized and personalized. We now mention two applications: Personalized Medicine [3]: Determining the right dosage of a drug for a given patient is a well-studied problem in the medical literature. For example, for certain anticoagulant drugs, the appropriate dosage can vary by up to a factor of 10 from individual to individual. Increasingly, doctors are using not only demographic information to decide dosage levels, but are also using higher-dimensional clinical and genetic data. Bastani and Bayati [3] propose a mathematical formulation for this problem and tackle it using tools from statistical learning and contextual bandits. At its core, the problem studied is a multidimensional binary search problem: each patient is associated with a vector of features ut which describes his or her demographic, genetic and clinical ∗ Partially supported by NSF grants CCF-1111109 and CCF-1553428 data. The algorithm outputs a recommended dosage xt and then observes only whether the dosage was below or above the ideal level. If the ideal dosage is a linear function of the features with unknown coefficients θ then what the algorithm observes is whether θ ⊤ ut ≥ xt or θ ⊤ ut < xt . Feature-based Pricing [2, 6, 17, 11]: Consider a firm that sells a very large number of differentiated products. Instead of attempting to learn the market value of each product independently, it might be more sensible for the firm to build a pricing model based on features of each product. In internet advertising, for example, each impression sold by an ad exchange is unique in its combination of demographic and cookie data. While it is hopeless for the exchange to learn how to price each combination in isolation, it is reasonable for the firm to learn a model of the market value of its different products. In this setting, each product t is described by a vector ut of features. Assume the market value is a linear function with unknown coefficients θ. If the firm sets a price xt for this item it will learn that θ ⊤ ut ≥ xt if the product is sold and that θ ⊤ ut < xt otherwise. The goal in this setting is not minimizing guesses that are ǫ far from the θ ⊤ ut as in the personalized medicine setting, but to maximize revenue. Revenue, however, is a very asymmetric objective: if the price is above the market value we lose the sale and incur a large loss, while underpricing still leads to a sale where the loss in revenue is the difference θ ⊤ ut − xt . Nevertheless, Cohen et al [6] showed that an algorithm for the multidimensional binary search problem can be converted into an algorithm for the feature-based pricing problem in a black-box manner. The first approach to this problem was due to Amin, Rostamizadeh and Syed [2] in the context of the pricing problem and is based on stochastic gradient descent. The stochastic gradient approach requires the features ut to be drawn from an unknown iid distribution, so that each feature can be used to obtain an unbiased estimator of a certain function. Subsequent approaches by Bastani and Bayati [3] and Qiang and Bayati [17] use techniques from statistical learning such as greedy least squares or LASSO. Javanmard and Nazerzadeh [11] apply a regularized maximum likelihood estimation approach and obtain an improved regret guarantee. One could also use a general purpose contextual bandit algorithm (such as Agarwal et al. [1]) to tackle the iid version of the multidimensional binary search problem, but such an algorithm would have regret that is polynomial in 1/ǫ instead of the logarithmic regret obtained by the specialized algorithms. All the previously discussed work rely on assuming that the directions ut are sampled iid. The only approach that makes no assumptions about the directions ut is by Cohen et al [6]. They do so by tackling directly the multidimensional binary search problem with adversarial feature vectors ut and describe an algorithm with a bound of O(d2 log(d/ǫ)) on the number of mistakes. To obtain that bound, the paper builds on the ellipsoid method from convex optimization. The algorithm always maintains a knowledge set in the shape of an ellipsoid and then chooses an xt that cuts the ellipsoid through its center whenever there is significant uncertainty on the value of θ ⊤ ut . The algorithm then replaces the resulting half-ellipsoid with the smallest ellipsoid that encloses it, and proceeds to the next iteration. Our Contributions: Our paper significantly improves the regret bound on the multidimensional binary search problem, providing nearly matching upper√and lower bounds for this problem. In Proposition 3.1, we construct a lower bound of Ω(d log(1/ǫ d)) via a reduction to d one-dimensional problems, which is significantly lower than the O(d2 log(d/ǫ)) regret bound from Cohen et al [6]. Under Cohen et al’s ellipsoid-based algorithm, a fraction 1 − e−1/2d of the volume is removed at each iteration. This fraction is significantly less than half because the step of replacing a half-ellipsoid with its own enclosing ellipsoid is expensive in the sense that it adds back to the knowledge set most of the volume removed in the latest cut. Thus, any ellipsoid-based method requires d steps in order to remove a constant fraction of the volume. Therefore, an algorithm that 2 removes a constant fraction of the volume at each iteration has the potential to perform significantly better than an ellipsoid-based method and, thus, might close the gap between the upper and lower bounds. We can thus conjecture that an algorithm that selects xt in each iteration so as to create two potential knowledge sets of approximately equal volume would perform nearly optimally. Cutting a convex set into two sets of approximately equal volume is not a difficult task. In a classical result, Grünbaum showed that cutting a set through its centroid generates two sets, each with at least a 1/e fraction of the original volume (see Theorem 5.1). Computing a centroid is a #Phard problem, but finding an approximate value of the centroid is sufficient for our purposes, and an approximation can be computed in polynomial time. An idea similar to this one was proposed by Bertsimas and Vempala [4], in a paper where they proposed a method for solving linear programs via an approximate Grünbaum theorem. However, removing constant fractions of the volume at each iteration is not sufficient for our purposes. Even if the knowledge set has tiny volume, we might not be able to guess the value of θ ⊤ u for some directions u with ǫ accuracy. To solve our problem, we need to ensure that the knowledge set becomes small along all possible directions. An algorithm that does not keep track of the width of the knowledge set along different directions might not perform well. Perhaps surprisingly, our conjecture that an algorithm that cuts through the centroid at each iteration would have nearoptimal regret is false. We√show in Theorem 8.3 that such a centroid algorithm generates a worstcase regret of Ω(d2 log(1/ǫ d)). This occurs precisely because the centroid algorithm does not keep track of the different widths of the knowledge set. In an ellipsoid-based algorithm, keeping tracks of the widths of a knowledge set is a relatively easy task since they correspond to the eigenvalues of the matrix that represents the ellipsoid. Keeping track of widths is a more difficult task in an algorithm that does not rely on ellipsoids. This brings us to our key algorithmic idea: cylindrification. Cylindrification is the technique we introduce of maintaining a set of directions along which the width of the knowledge set is small and expanding the set in those directions, thus converting the set into a high-dimensional cylinder. A cylindrified set when projected onto its subspace of small directions becomes a hypercube. When projected onto its subspace of large directions, a cylindrified set looks exactly like the original set’s projection onto the same subspace. Cylindrification reduces regret by significantly increasing the usefulness of each cut. Our main algorithm, the Projected Volume algorithm, maintains two objects at all times. It maintains a knowledge set (as the previous algorithms did), but it also maintains a set of orthogonal directions along which the knowledge set is small. At each iteration, it cylindrifies the knowledge set and then computes an approximate value of the centroid of the cylindrified set. It then chooses xt in order to cut through this approximate centroid. In Theorem 4.3, the main result of our paper, we prove that this algorithm has a near-optimal regret of O(d log(d/ǫ)). The analysis of our algorithm relies on a series of results we prove about convex bodies. We first prove a directional version of Grünbaum’s theorem (Theorem 5.3), which states that the width of the two sets along any direction u after a cut through the centroid are at least 1/(d+1) of the width along u of the original set. We also prove that Grünbaum’s theorem is robust to approximations (Lemma 5.5) and projections (Lemma 7.1). We also prove that the process of cylindrification does not add too much volume to the set (Lemma 6.1). We then use these geometric results to prove that the volume of the knowledge set projected onto its large directions serves as a potential function and show that it decreases exponentially fast, proving our main result. Relation to Standard Online Learning Problems: Our problem bears resemblance with the classic problem in online classification of learning halfspaces with a margin, which can be solved by the grandfather of all online learning algorithms, the Perceptron. See [19, 15] for the original papers and [12] for the closely related Winnow algorithm. Elegant and modern presentations of 3 those can be found in [5, 20] and [10]. In this problem, there is an unknown θ and, in each iteration, we are given a vector ut and are asked to guess the sign of the dot product sgn(θ ⊤ ut ). If we are guaranteed that all feature vectors ut are far enough from the separating hyperplane (i.e., there is a margin) we can bound the total number of mistakes the algorithm makes. Both multidimensional binary search and learning halfspaces with a margin have a similar feedback: which side we are from an unknown hyperplane each point is. This begs the question of whether the techniques developed for learning halfspace with a margin or similar online classification problems can be applied to multidimensional binary search. There is a subtle difference between the two problems: in multidimensional binary search we don’t observe if a mistake occurred or not. This feature is crucial for the pricing application that motivates the problem: in the pricing application, we do not get feedback of whether the price was barely below the buyer’s valuation or much below. We argue in Appendix C that this subtle difference poses a significant obstacle to applying the techniques from one problem to the other. 2 The Model We consider an infinite horizon game between a player and nature. The game begins with nature selecting a state θ from the d-dimensional unit ball centered at the origin. We label this ball K0 , i.e., K0 = {θ ∈ Rd : ||θ||2 ≤ 1}. The player knows K0 , but does not know the value of θ. 1 At every period t = 0, 1, 2, ..., nature selects a vector ut from the d-dimensional unit sphere, i.e., U = {u ∈ Rd : ||u||2 = 1}, that we refer to as the period t direction. At every period, after nature reveals ut , the player must choose an action xt ∈ R. The player’s goal is to choose a value of xt that is close to u⊤ t θ. Formally, we try to minimize the number of mistakes we make, where a mistake occurs whenever |xt − u⊤ t θ| > ǫ for a given ǫ > 0. We incur regret in period t whenever we make a mistake: ( 0 if |xt − u⊤ t θ| ≤ ǫ ; rt = ⊤ 1 if |xt − ut θ| > ǫ . ⊤ At the end of each period, nature reports to the player whether xt ≤ u⊤ t θ or xt > ut θ. We note that we do not learn the regret rt in each period, only whether xt − u⊤ t θ is positive. Our goal is to find a policy that minimizes our total regret, or equivalently, the total number of mistakes we P make over an infinite time horizon, i.e., R = ∞ r . t=1 t 3 Lower Bound We now construct a lower bound on the regret incurred by our algorithm. The lower bound is obtained via a straightforward reduction to d one-dimensional problems. √ Proposition 3.1. Any algorithm will generate regret of at least Ω(d log(1/ǫ d)). √ Proof. Assume nature selects θ from within a d-dimensional cube with sides of length 1/ d. This is a valid choice since the unit ball K0 contains such a cube. Let ei represent the vector with value 1 in coordinate i ∈ {1, ..., d} and value 0 in all other coordinates. Suppose nature selects directions that correspond to the vectors ei in round-robin fashion, i.e., ut = e(t mod d)+1 . Because of the symmetry of the cube from which θ is selected, and the orthogonality of the directions ut , this problem √ is equivalent to d independent binary searches over one-dimensional intervals with length l = 1/ d. Our result follows since a one-dimensional binary search over an interval with length l up to precision ǫ incurs Ω(log(l/ǫ)) mistakes. 1 Although we assume for simplicity that K0 is a ball throughout our paper, we could have let K0 be an arbitrary convex body contained inside the unit ball. 4 We note that the lower bound above applies even for the iid version of the multidimensional binary search problem, as nature could be given a distribution over d orthogonal direction vectors. Making the problem offline would also not lower the regret, as having advance knowledge of the direction vectors is useless in the instance above. 4 The Projected Volume Algorithm In this section, we describe the central idea for obtaining near-optimal regret. In the standard single-dimensional binary search algorithm, the error of the algorithm at any given iteration is proportional to the length of the interval. The length of the interval thus provides a clear measure in which to make progress. In the multi-dimensional case, there is no global measure of error, but only a measure of error for each direction. To make this precise, consider a knowledge set K ⊆ Rd corresponding to the set of values of θ that are compatible with what the algorithm has observed. Given a direction u (i.e., u is a unit vector), the error incurred by the algorithm to predict the dot product u⊤ θ corresponds to the directional width of K along u: w(K, u) = max u⊤ (x − y) . (4.1) x,y∈K which is a measure that is particular for direction u. Since the algorithm does not know which directions it faces in future iterations, it must decrease some measure that implies progress in a more global sense. A natural such measure is the volume of K. However, measuring volume alone might be misleading. Consider that case where our current knowledge set is the thin rectangle represented in Figure 1. ǫ Figure 1: Decreasing volume might not lead to progress with respect to width. Both horizontal and vertical cuts remove half the volume, but only the vertical cut makes progress towards our goal. Cutting the knowledge set along either the red horizontal or the blue vertical line and keeping one of the sides would decrease the volume by half. From the perspective of our problem, however, the red cut is useless since we already have a good estimate of the width along that direction. Meanwhile, the blue cut is very useful since it decreases the width along a direction that has still a lot of uncertainty to be resolved. Motivated by this observation we keep track of the volume of the knowledge set projected onto a subspace for which there is still a non-trivial amount of uncertainty. Precisely, our algorithm will be parametrized by a value δ > 0 which defines the notion of ‘small’. We maintain two objects: 1. the knowledge set Kt ⊆ Rd which will consist of all vectors θ which are consistent with the observations of the algorithm so far. 2. a set of orthonormal vectors St = {s1 , . . . , snt } spanning a subspace Ut of dimensionality nt such that the knowledge set has small width along any of those directions and has large width along any direction perpendicular to them. Formally: Ut = span(St ) s.t. w(Kt , s) ≤ δ, ∀s ∈ St and w(Kt , u) > δ, for all u perpendicular to Ut , where span(·) denotes the span of a set of vectors. It will be useful to refer to Lt = {u|u⊤ s = 0, ∀s ∈ St } as the subspace of large directions. Our plan will be to ignore a dimension once it becomes small enough and focus on bounding the volume of the projection of the knowledge set Kt onto the subspace of large directions Lt . To 5 formalize this notion, let us define the notion of cylindrification of a set with respect to orthonormal vectors. Definition 4.1 (Cylindrification). Given a set of orthonormal vectors S = {s1 , . . . , sn }, let L = {u|u⊤ s = 0; ∀s ∈ S} be the subspace orthogonal to span(S) and ΠL (K) be the projection 2 of K onto L. Given a convex set K ⊆ Rd and a set of orthonormal vectors S = {s1 , . . . , sn } we define: ) ( n X yi si x ∈ ΠL (K) and min θ ⊤ si ≤ yi ≤ max θ ⊤ si . Cyl(K, S) := x + θ∈K i=1 θ∈K Or more concisely, but less intuitively: Cyl(K, S) = ΠL (K) + Πspan(s1 ) (K) + . . . + Πspan(sn ) (K) where the sums applied to sets are Minkowski sums. 3 Informally, the cylindrification operation is designed to create a set with the same projection onto the subspace of large directions, i.e., ΠLt Cyl(Kt , St ) = ΠLt (Kt ), while regularizing the projection of the set onto the subspace of small directions: ΠSt Cyl(Kt , St ) is a box. We are now ready to present our algorithm, focusing on its geometric aspects and ignoring (for now) the question on how to efficiently compute each step. The algorithm is parametrized by a constant δ > 0. It starts with K0 being the ball of radius 1 and with S0 = ∅. In each iteration the algorithm receives a unit vector ut from nature. The algorithm then predicts xt using the centroid zt of Cyl(Kt , St ), by setting xt = u⊤ t zt . The definition of the centroid is given below: Definition 4.2. The centroid z of a convex set KZis defined as 1 x dx , z= vol(K) x∈K where vol(·) denotes the volume of a set. Upon learning if the estimate was too small or too large, we update Kt to Kt+1 = Kt ∩{θ|θ ⊤ut ≤ xt } or Kt+1 = Kt ∩ {θ|θ ⊤ ut ≥ xt }. The next step in our algorithm is to verify if there exists any direction v orthogonal to St such that w(Kt+1 , v) ≤ δ. As long as such directions exists, we add them to St and call the resulting set St+1 . Our main result in this paper is: Theorem 4.3. The Projected Volume algorithm has regret O(d log(d/ǫ)) for the multi-dimensional binary search problem. Our strategy for proving Theorem 4.3 is to use the volume of the projection of Kt onto the subspace of large directions as our potential function: Φt := vol(ΠLt Kt ) . In each iteration, either the set of small directions remains the same or it grows. We first consider the case where the set of small directions remains the same, i.e., St+1 = St . In this case, we want to argue that the volume of the projection of Kt onto Lt decreases in that iteration. If St = ∅, then ΠLt Kt = Kt and the volume decreases by at least a constant factor. This follows from Grünbaum’s Theorem, which we review in the next section. However, if St 6= ∅, then a decrease in the volume of Kt does not necessarily guarantee a decrease in the volume of the projection. For example, consider the example in Figure 2 where we cut through the center of a rectangular Kt . Even though the volume of Kt+1 is half the volume of Kt , the volume of the projection onto the x-axis doesn’t decrease as much. We will argue that the decrease in volume due to Grünbaum’s Theorem extends to projections (with a small loss) if the width along the cut direction is much larger than the width 6 ΠLt+1 Kt+1 ΠLt Kt Kt+1 Kt Figure 2: The volume of the projection ΠLt Kt decreases slower than the volume of Kt . along the directions orthogonal to the projection subspace. We now consider the case where we add a new direction to St . In this case, we will measure the volume in the next iteration as projected onto a subspace of smaller dimension than in period t. In general, the volume of a projection can be arbitrarily greater than then volume of the original set. We will use, however, the fact that the Kt is “large” along every direction of Lt to argue that adding a vector to St can blow up the potential by at most a factor of O(d2 /δ). While this is a non-trivial volume increase, this can happen at most d times, leading to a volume increase by a factor of at most O(d2 /δ)d . We can use this fact to obtain that the algorithm will take at most O(d log(d/δ)) steps before Lt becomes zero-dimensional. An inquisitive reader might wonder if we truly need cylindrification to obtain near-optimal regret. We could consider an algorithm that simply chooses xt = u⊤ is the t zt at each iteration, where zt √ centroid of Kt . We show in Theorem 8.3 that such an algorithm incurs regret of Ω(d2 log(1/ǫ d)). Without cylindrification, nature might select directions such that most of the volume reduction corresponds to widths in directions along which the set is already small. Cutting at the centroid of the cylindrified set, instead of the centroid of the original set, is thus crucial to ensure we make progress in the large directions. The Projected Volume algorithm as discussed above does not actually run in polynomial time since computing the centroid of a convex set is a #P-hard problem. Fortunately, we can turn Projected Volume into a polynomial time algorithm with a few tweaks, as we show in Theorem 9.4. The key step is to approximate the value of the centroid instead of relying on an exact computation. The polynomial time version of Projected Volume presented in Section 9 also contains a technique for efficiently finding small directions to add to the set St . 5 Convex Geometry Tools In this section, we begin to develop the technical machinery required by the plan outlined in the previous section. In the heart of the proof will be a statement relating the volume of a convex body and a volume of its cylindrification with respect to dimensions along which the body is ‘small’. In order to obtain this result, we will require customized versions of Grünbaum’s Theorem. Let us start by revisiting the basic statement of the theorem: Theorem 5.1 (Grünbaum). Let K be a convex set, and let z be its centroid. Given an arbitrary nonzero vector u, let K+ = K ∩ {x|u⊤ (x − z) ≥ 0}. Then,   1 1 · vol(K) ≤ vol(K+ ) ≤ 1 − · vol(K) . e e In other words, any hyperplane through the centroid splits the convex set in two parts, each of which having a constant fraction of the original volume. See Grünbaum [9] for the original proof of this theorem, or Nemirovski [16] for a more recent exposition. The first step in the proof of P Formally if {ℓ1 , . . . , ℓk } is an orthonormal basis of L, then πL (x) = ki=1 ℓi ℓ⊤ i x and ΠL (K) = {πL (x)|x ∈ K}. 3 By Minkowski sum between two sets, we mean A + B = {a + b : a ∈ A, b ∈ B}. 2 7 Grünbaum’s Theorem consists of applying Brunn’s Theorem, which is an immediate consequence of the Brunn-Minkowski inequality: Theorem 5.2 (Brunn). Given a convex set K, and let g(t) be the (d − 1)-dimensional volume of the section K(t) := K ∩ {x|x⊤ e1 = t}. Then the function r(t) := g(t)1/(d−1) is concave in t over its support. We will rely on Brunn’s Theorem to prove our customized versions of Grünbaum’s Theorem. 5.1 Directional Grünbaum Theorem We begin by proving a theorem which characterizes how much directional widths of a convex body can change after a cut through the centroid. In some sense, this can be seen as a version of Grünbaum’s Theorem bounding widths rather than volumes. Theorem 5.3 (Directional Grünbaum). If K is a convex body and z is its centroid, then for every unit vector u 6= 0, the set K+ = K ∩ {x|u⊤ (x − z) ≥ 0} satisfies 1 · w(K, v) ≤ w(K+ , v) ≤ w(K, v) , d+1 for all unit vectors v. The first step will be to prove Theorem 5.3 when v is the direction of u itself. We prove this in the following lemma. Lemma 5.4. Under the conditions of Theorem 5.3, w(K+ , u) ≥ 1 d+1 · w(K, u). We defer the proof of this lemma to Appendix A.1. We are now ready to prove the Directional Grünbaum Theorem: Proof of Theorem 5.3. By translating K we can assume without loss of generality that z = 0. Consider three cases: ⊤ 1. There exists a point x+ v ∈ K+ ∩ arg maxx∈K v x. In such case, we know by the previous lemma that 1 w(K, v) . w(K+ , v) ≥ v ⊤ (x+ v − z) ≥ d+1 ⊤ 2. The second case is where there exists a point x− v ∈ K+ ∩ arg minx∈K v x. Then, 1 w(K+ , v) ≥ v ⊤ (z − x− w(K, v) . v)≥ d+1 ⊤ − ⊤ 3. In the remaining case, let x+ v ∈ arg maxx∈K v x and xv ∈ arg minx∈K v x be such that ⊤ + ⊤ − ⊤ u xv < 0 and u xv < 0. Also, let xu = arg maxx∈K u x. In such a case, choose real numbers λ+ , λ− between zero and one such that:   ⊤ u⊤ xu + λ+ (x+ xu + λ− (x− v − xu ) = 0 and u v − xu ) = 0 . We can bound λ+ and λ− as follows: 1 + w(K, u) ≤ u⊤ xu = λ+ · u⊤ (xu − x+ v ) ≤ λ · w(K, u) . d+1 1 1 + + So λ+ ≥ d+1 . By the same argument λ− ≥ d+1 . Now, the points, x̃+ v = xu + λ (xv − xu ) − − − + and x̃v = xu + λ (xv − xu ) are in K , since they are convex combinations of points in K and their dot product with u is non-negative. Now: − w(K, v) v ⊤ (x+ v − xv ) − + ⊤ + − ⊤ − = . w(K + , v) ≥ v ⊤ (x̃+ − x̃ ) = λ v (x − x ) + λ v (x − x ) ≥ u u v v v v d+1 d+1 8 5.2 Approximate Grünbaum Theorem We will use the Directional Grünbaum Theorem to give an approximate version of the standard volumetric Grünbaum Theorem. Essentially, we will argue that if we cut through a point sufficiently close to the centroid, then either side of the cut will still contains a constant fraction of the volume. Lemma 5.5 (Approximate Grünbaum). Let K be a convex body, and let z be its centroid. For δ = {x ∈ an arbitrary unit vector u, and scalar δ such that 0 ≤ δ ≤ w(K, u)/(d + 1)2 , let K+ ⊤ K|u (x − z) ≥ δ}. Then, 1 δ vol(K+ ) ≥ 2 · vol(K) . e The proof of this lemma follows from a modification of the original proof for Grünbaum’s theorem, and it can be found in Appendix A.2. 6 Cylindrification Next we study how to relate the volume of a convex body to the volume of its projection onto a subspace. Lemma 6.1 (Cylindrification). Let K ⊂ Rd be a convex body such that w(K, u) ≥ δ for every unit vector u, then for every (d − 1) dimensional subspace L: d(d + 1) · vol(K) . vol(ΠL K) ≤ δ As one of the ingredients of the proof, we will use John’s Theorem: Theorem 6.2 (John). If K ⊂ Rd is a bounded convex body, then there is a point z and an ellipsoid E centered at the origin such that: 1 z+ E ⊆K ⊆z+E. d In particular, we will use the following consequence of John’s Theorem: Lemma 6.3. If K ⊂ Rd is a convex body such that w(K, u) ≥ δ for every unit vector u, then K contains a ball of diameter δ/d. Proof. Applying John’s theorem and translating K if necessary so that z = 0, there exists an ellipsoid E such that d1 E ⊆ K ⊆ E. Since the width of K in each direction is at least δ, the width of E must be at least δ in each direction. Since E is an ellipsoid, it must contain a ball of diameter δ. Thus, d1 E contains a ball of diameter dδ . Hence, K also contains such a ball. We now prove our cylindrification lemma. Proof of Lemma 6.1. Our proof proceeds in two steps: Step 1: Squashing K. Assume without loss of generality that the (d − 1)-dimensional subspace L is the space defined by the d − 1 first coordinates. Represent by xL the projection of each x onto the d − 1 first components and define f : Rd−1 → R such that f (xL ) is the length of the segment in the intersection of K and the line {(xL , y) : y ∈ R} (see the top of Figure 3). Formally: Z 1K (xL , y)dy . f (xL ) = y∈R 9 R R Figure 3: Illustration of the squashing procedure: the height of Rd−1 all segments orthogonal to a d−1 subspace is preserved, but the segments are translated so to start in the origin of the d-th did−1 mension. R We now argue that f is concave. Given xL ∈ Rd−1 let ax , bx be such that (xL , ax ), (xL , bx ) ∈ K and f (xL ) = bx − ax . Let yL , ay , by be defined analogously. To see that f is concave, given 0 < tx , ty < 1 with tx + ty = 1 we have: (tx xL + ty yL , tx ax + ty ay ) and (tx xL + ty yL , tx bx + ty by ) are in K by convexity, so: f (tx xL + ty yL ) ≤ (tx bx + ty by ) − (tx ax + ty ay ) = tx f (xL ) + ty f (yL ) , which allows us to define the squashed version of K (depicted in the bottom of Figure 3) as: K ′ = {(xL , h) : xL ∈ ΠL K, 0 ≤ h ≤ f (xL )} . By construction, vol(K ′ ) = vol(K). Step 2: Conification. We know by Lemma 6.3 that K contains a ball of diameter δ/d so there exists xL such that f (xL ) ≥ h := δ/d. Define then the cone C to be the convex hull of {(x, 0) : x ∈ ΠL K} and (xL , h). Such cone is a subset of K ′ , so vol(K) = vol(K ′ ) ≥ vol(C). Since the volume of a d-dimensional cone is given by the volume of the base times the height divided by d + 1, δ h · vol(ΠL K) = · vol(ΠL K) . vol(K) ≥ vol(C) = d+1 d(d + 1) 7 Analysis of the Projected Volume Algorithm We are now almost ready to analyze our algorithm. To do so, we first consider a version of Grünbaum’s Theorem which concerns cuts through the centroid of a cylindrified set. The set being cut is still the original set, but we focus on what happens to the volume of its projection onto the subspace of large directions. The proof of this lemma can be found in Appendix A.3. Lemma 7.1 (Projected Grünbaum). Let K be a convex set contained in the ball of radius 1, and ǫ2 let S be a set of orthonormal vectors along which w(K, s) ≤ δ ≤ 16d(d+1) 2 , for all s ∈ S. Let L be the subspace orthogonal to S, and let ΠL be the projection operator onto that subspace. If u is a direction along which w(Cyl(K, S), u) ≥ ǫ, z is the centroid of the cylindrified body Cyl(K, S), and K+ = {x ∈ K : u⊤ (x − z) ≥ 0}, then:   1 vol(ΠL K+ ) ≤ 1 − 2 · vol(ΠL K) , e where vol(·) corresponds to the (n − |S|)-dimensional volume on the subspace L. We now employ the tools we have developed to analyze the regret of the Projected Volume algorithm. As outlined in Section 4, we will keep in each iteration a convex set Kt of candidate θ vectors and we will keep a orthonormal basis St of directions for which Kt is small. If Lt is the subspace of directions that are orthogonal to St then our plan is to bound the potential Φt = vol(ΠLt Kt ). Notice that if Lt is empty, then St must be an orthonormal basis such that w(Kt , s) ≤ δ, ∀s ∈ St . In particular, for every unit vector u and any two x, y ∈ Kt we must have: X u⊤ s · s⊤ (x − y) ≤ dδ . u⊤ (x − y) = s∈St If δ ≤ ǫ/d, then the algorithm will be done once Lt becomes empty. Our goal then is to bound how many iterations can we have where Lt is non-empty. First we provide a lower bound on the potential. We will use in this section the symbol γd to denote the volume of the d-dimensional unit ball. The following loose bound on γd will be sufficient for our needs: Ω(d−d ) ≤ γd ≤ O(1). Lemma 7.2. If Lt is non-empty then Φt ≥ Ω( dδ )2d . Proof. Let KL = ΠLt Kt and k be the dimension of L. Then w(KL , u) ≥ δ for all u ∈ L implies 10 by Lemma 6.3 that KL contains a ball of radius kδ , so vol(KL ) ≥ γk γk ≥ Ω( 1d )d we have that Φt ≥ Ω( dδ )2d .  δ k k . Since  δ k k ≥  δ d d and Now we will give an upper bound on Φt as a function of t. Together with the previous lower bound, we will get a bound on the number of iterations that can happen before Lt becomes empty. The main ingredient will be a Grünbaum-type bound on the volume of the projection that is specifically tailored to our application. For this purpose, we use Lemma 7.1, which will specifically address the issue discussed in Figure 2. We are now ready for the proof of our main theorem: Proof of Theorem 4.3. Our goal is to bound the number of steps for which the algorithm guesses with at least ǫ error. Let Rt be the total regret after t steps. Let Nt be 1 if w(Cyl(K Pt t , Lt ), ut ) > ǫ ⊤ and zero otherwise. Since ut (zt − θ) ≤ ǫ whenever w(Cyl(Kt , Lt ), ut ) ≤ ǫ, Rt ≤ τ =1 Nτ . ǫ2 Let Kt and Lt be the respective set and subspace after t iterations. Setting δ ≤ 16d(d+1) 2 we can apply Lemma 7.1 directly to obtain that:   1 Nt vol(ΠLt Kt+1 ) ≤ 1 − 2 vol(ΠLt Kt ) . e If Lt+1 = Lt , then vol(ΠLt+1 Kt+1 ) = vol(ΠLt Kt+1 ). If we add one new direction v ∈ Lt to S, then we replace KL = ΠLt Kt by its projection on the subspace L′ = {x ∈ Lt : v ⊤ x = 0}. Since δ , so applying w(Kt , u) ≥ δ, ∀u ∈ Lt , then by Theorem 5.3 after we cut Kt we have w(Kt+1 , u) ≥ d+1 the Cylindrification Lemma (Lemma 6.1) we obtain: d(d + 1)2 vol(ΠLt Kt+1 ) . vol(ΠL′ Kt+1 ) ≤ δ   2 r If we need to add r new directions to Lt the volume can blow up by at most d(d+1) . In δ particular, since the initial volume is bounded by O(1), then:  Ptτ =1 Nτ d   2d d(d + 1)2 1 δ , · 1− 2 ≤ Φt = vol(ΠLt Kt ) ≤ O(1) · Ω d δ e which means that:     t X d d = O d log . Nτ ≤ O d log Rt ≤ δ ǫ τ =1 8 Why Cylindrification? At the heart of our algorithm lies the simple idea that we should cut a constant fraction of the volume at each iteration if we want to achieve a Õ(d log(1/ǫ)) regret bound. Our algorithm, however, is quite a bit more complex than that. It also keeps a set of ‘small’ directions St and it cuts through the center of a cylindrified version of the knowledge set Kt at each iteration. An inquisitive reader might wonder whether this additional complexity is really necessary. In this section we argue that cylindrification is actually necessary to obtain our near-optimal regret bound. We prove there exists an instance where the algorithm that only √ cuts through the center of the knowledge set (without cylindrifying it first) incurs Ω(d2 log(1/ǫ d)) regret. Formally, consider Kt and in each iteration guesses xt = u⊤ t zt R the algorithm that only keeps + 1 where zt = vol(Kt ) Kt xdx and updates Kt to Kt or Kt− . We call this procedure the Centroid √ algorithm. In order to construct an instance with Ω(d2 log(1/ǫ d)) regret for this algorithm, we first define the following set. Given s = (s1 , . . . , sk ) with si > 0 for all i, define: P xi ∆(s) = {x ∈ Rk+ : i si ≤ 1} = conv({0, s1 e1 , . . . , sk ek }), where conv(·) denotes the convex hull of a set of points. 11 Lemma 8.1. The centroid of ∆(s) is given by s k+1 . We now consider how the Centroid algorithm performs on a particular set, when nature selects a specific sequence of directions. The set we start from is the product between a (d−k)-dimensional hypercube and a k-dimensional set ∆(s), where only the kth entry of s is significantly larger than ǫ. We now argue that nature might require us to take Ω(k log(1/ǫ)) into a similarly structured set with k replaced by k + 1. Repeating this argument d times will lead to our negative conclusion on the performance of the Centroid algorithm. Lemma 8.2. Let 1 ≤ k < d, s ∈ Rk with 0 ≤ si ≤ ǫ for i < k, d−k 1 4 ≤ sk ≤ 1. If K = ∆(y) × [0, 1] then there is a sequence of Ω(k log(1/ǫ)) directions ut such that the Centroid algorithm incurs Ω(k log( 1ǫ )) regret and by the end of the sequence, the knowledge set has the form: K ′ = ∆(s′ ) × [0, 1]d−k−1 where s′ ∈ Rk+1 , 0 ≤ s′i ≤ ǫ for i < k + 1, 41 ≤ s′i ≤ 1. 1 s1 s2 Figure 4: Illustration of Step 2 in the proof of Lemma 8.2 for k = 2 and d = 3. Proof sketch. Starting from K, as a first step we select Ω(k log( 1ǫ )) vectors in the direction ek which cause the side of the k-th side of the simplex ∆(s) to reduce to ǫ getting one unit of regret in each step. At the end of this step we are left with the situation illustrated in Figure 8.2. In step 2 we choose a direction slightly bent towards ek+1 to carve a (k + 1)-dimensional simplex out of K. The resulting shape will be, as depicted in Figure 8.2, only partially what we want. In the third step we select more directions along ek+1 to remove the ‘leftover’ and keep only the part corresponding to the (k + 1)-dimensional simplex. A complete proof is provided in Appendix A.5. This is the main √ ingredient necessary to show that the algorithm without cylindrification can incur Ω(d2 log(1/ǫ d)) regret. ⊤ Theorem 8.3. The √ algorithm that always chooses xt = ut zt where zt is the centroid of Kt can 2 incur Ω(d log(1/ǫ d)) regret. Proof. Start with the set K0 = [0, 1]d . Apply Lemma 8.2 for k = 1, 2, 3, . . . , d − 1. The total P 1 1 2 regret is d−1 k=1 Ω(k log( ǫ )) = Ω(d log( ǫ )). To construct a valid instance (one that fits within a h √ id ball of radius 1), we replace our initial set with K0 = 0, 1/ d , leading to an aggregate regret of √ Ω(d2 log(1/ǫ d)). We did not do our computations above using this scaled down instance instead √ of [0, 1]d in order to avoid carrying extra d terms. 12 9 Computation The Projected Volume algorithm described earlier, while yielding optimal regret with respect to the number of dimensions d, can’t be implemented as presented in polynomial time. The reason is that it requires implementing two steps, both of which involve solving highly nontrivial problems. The first is computing the centroid, which is known to be #P-hard [18]. The second is finding a direction along which a convex body K is “thin” (i.e. finding a unit vector u such that w(K, u) ≤ δ), for which we are not aware of a polynomial time algorithm. In order to make these problems tractable, we relax the requirements of our algorithm. More specifically, we will show how our algorithm is robust, in the sense that using an approximate centroid, and finding approximately thin directions does not break the analysis. In the following subsections, we show how to implement both of these steps. Then, we put them together into a polynomial time version of our algorithm. 9.1 Approximating the Centroid An approximation of the centroid sufficient for our purposes follows from a simple application of standard algorithms for sampling points from convex bodies (hit-and-run [13], ball-walk [14]). A similar application can be found in Bertsimas and Vempala [4], where the authors use approximate centroid computation in order to solve linear programs. Our application faces the same issues as in [4]. Namely, in order to efficiently sample from a convex body, one requires that the body is nearly isotropic. Although the body we start with is isotropic, after cutting or projecting this property is lost. Therefore we require maintaining a linear transformation under which the body ends up being in isotropic position. The many issues encountered when approximating the centroid are carefully handled in [4], so we will restate the following result which is implicit there (see Lemma 5 and Theorem 12): Theorem 9.1 ([4]). Given a d-dimensional convex body K, one can compute an approximation z ′ to the centroid z of K in the sense that kz − z ′ k ≤ ρ in Õ(d4 /ρ) steps of a random walk in K. Note that for hit-and-run sampling, one only requires determining the intersection between a line and the given convex body; in our case this only requires one iteration through the inequality constraints determining the body. 9.2 Finding Approximately Thin Directions Instead of exactly recovering directions u satisfying w(K, u) ≤ δ, we instead recover all the directions along which w(K, u) ≤ αδ , and potentially some along which αδ ≤ w(K, u) ≤ δ. We do this by computing an ellipsoidal approximation of K. Indeed, having access to an ellipsoid E such that E ⊆ K ⊆ αE , we can: 1. find a direction u such that w(K, u) ≤ δ, by checking whether E has a direction u such that w(E, u) ≤ δ/α, or 2. decide that w(K, u) ≥ δ/α for all u simply by showing that the smallest directional width of E is greater than or equal to δ/α. This task can be performed simply by inspecting the eigenvalues of E. A natural notion for such an ellipsoid is the John ellipsoid. However, computing it is NP-hard. Instead, by relaxing the approximation factor, a polynomial time algorithm can be obtained. Such a result is provided in Grötschel et al [8], which we reproduce below for completeness (see Corollary 4.6.9). 13 Theorem 9.2 ([8]). Given a convex body K containing a ball of radius r, and contained inside a ball of radius R, along √ with access to a separation oracle for K, one can compute an ellipsoid E such that E ⊆ K ⊆ d(d + 1)E using dO(1) · log(R/r) oracle calls. This immediately yields the following Corollary, which we will use in our algorithmic result. Corollary 9.3. Given a convex body K containing a ball of radius r, and contained inside a ball of radius R, along with a separation oracle √ for K, one can either find a direction u such that w(K, u) ≤ δ, or certify that w(K, u) ≥ δ/( d(d + 1)) for all u using dO(1) · log(R/r) oracle calls. 9.3 Obtaining a Polynomial Time Algorithm The polynomial time version of our algorithm is very similar to the initial one. The differences that make computation tractable are: 1. Instead of computing the centroid exactly, we compute the centroid to within distance ρ = (ǫ/d)O(1) , via Theorem 9.1. 2. Every iteration of the algorithm the set St is updated by repeatedly computing the ellipsoidal approximation described in Corollary 9.3, and adding the direction u corresponding to the smallest eigenvalue of the ellipsoid, if it certifies √ that w(K, u) ≤ δ. When no such direction is found, we know that w(K, u) ≥ δapprox := δ/ d(d + 1) for all u. A complete description of the new algorithm, along with its analysis, can be found in Appendix B. Combining the results in this section, we obtain the following theorem: Theorem 9.4. There exists an algorithm that runs in time (d/ǫ)O(1) achieving regret O(d log(d/ǫ)) for the multi-dimensional binary search problem. References [1] Alekh Agarwal, Daniel J. Hsu, Satyen Kale, John Langford, Lihong Li, and Robert E. Schapire. Taming the monster: A fast and simple algorithm for contextual bandits. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, volume 32 of JMLR Workshop and Conference Proceedings, pages 1638–1646. JMLR.org, 2014. 2 [2] Kareem Amin, Afshin Rostamizadeh, and Umar Syed. Repeated contextual auctions with strategic buyers. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 622–630, 2014. 2 [3] Hamsa Bastani and Mohsen Bayati. Online decision-making with high-dimensional covariates. Working paper, Stanford University, 2016. 1, 2 [4] Dimitris Bertsimas and Santosh Vempala. Solving convex programs by random walks. J. ACM, 51(4):540–556, 2004. 3, 13 [5] Sébastien Bubeck. Introduction to online optimization. Lecture Notes, pages 1–86, 2011. 4 [6] Maxime C. Cohen, Ilan Lobel, and Renato Paes Leme. Feature-based Dynamic Pricing. In Proceedings of the 2016 ACM Conference on Economics and Computation, EC ’16, Maastricht, The Netherlands, July 24-28, 2016, page 817, 2016. 2 [7] John Dunagan and Santosh Vempala. A simple polynomial-time rescaling algorithm for solving linear programs. Math. Program., 114(1):101–114, 2008. 23 [8] Martin Grötschel, László Lovász, and Alexander Schrijver. Geometric algorithms and combinatorial optimization, volume 2. Springer Science & Business Media, 2012. 13, 14 [9] Branko Grünbaum. Partitions of mass-distributions and of convex bodies by hyperplanes. Pacific Journal of Mathematics, 10(4):1257–1261, 1960. 7 14 [10] Elad Hazan et al. Introduction to online convex optimization. Foundations and Trends R in Optimization, 2(3-4):157–325, 2016. 4 [11] Adel Javanmard and Hamid Nazerzadeh. Dynamic pricing in high-dimensions. arXiv preprint arXiv:1609.07574, 2016. 2 [12] Nick Littlestone. Learning quickly when irrelevant attributes abound: A new linear-threshold algorithm. Machine learning, 2(4):285–318, 1988. 4 [13] László Lovász. Hit-and-run mixes fast. Mathematical Programming, 86(3):443–461, 1999. 13 [14] László Lovász and Ravi Kannan. Faster mixing via average conductance. In Proceedings of the thirty-first annual ACM symposium on Theory of computing, pages 282–287. ACM, 1999. 13 [15] Marvin Minsky and Seymour Papert. Perceptrons. 1969. 3 [16] Arkadi Nemirovski. Efficient methods in convex programming. 2005. 7 [17] Sheng Qiang and Mohsen Bayati. Dynamic pricing with demand covariates. Available at SSRN 2765257, 2016. 2 [18] Luis Rademacher. Approximating the centroid is hard. In Proceedings of the 23rd ACM Symposium on Computational Geometry, Gyeongju, South Korea, June 6-8, 2007, pages 302–305, 2007. 13 [19] Frank Rosenblatt. The perceptron: A probabilistic model for information storage and organization in the brain. Psychological review, 65(6):386, 1958. 3 [20] Shai Shalev-Shwartz et al. Online learning and online convex optimization. Foundations and Trends R in Machine Learning, 4(2):107–194, 2012. 4, 23 A A.1 Deferred Proofs Proof of Lemma 5.4 Since width is invariant under rotations and translations we can assume, without loss of generality, that u = −e1 . Also, since scaling the convex set along the direction of u also scales the corresponding coordinate of the centroid by the same factor, we can assume that the projection of K onto the e1 axis is [0, 1]. Using the notation from Theorem 5.2, we can write the first coordinate of the centroid z as R ⊤ R1 Z t · r(t)d−1 dt 1 ⊤ ⊤ KR x e1 dx . x e1 dx = = 0R 1 z e1 = d−1 dt vol(K) K r(t) K 1 dx 0 1 Our goal is to show that z ⊤ e1 ≥ d+1 . We will do it in a sequence of two steps. To simplify notation, let us define V := vol(K). Step 1: linearize r. We prove that the linear function r̃ : [0, 1] → R given by r̃(t) = (V d)1/(d−1) · (1 − t) satisfies Z 1 0 d−1 t · r̃(t) dt ≤ Z 0 1 d−1 t · r(t) dt and Z 0 1 d−1 r̃(t) dt = Z 1 r(t)d−1 dt = V . 0 We immediately see that the second condition is satisfied, simply by evaluating the integral. Next we show that r̃ satisfies the first condition. Since by definition, r is supported everywhere over [0, 1], it means that r(1) ≥ r̃(1) = 0, and therefore r(0) ≤ r̃(0) (since otherwise, by concavity, it would be the case that r(t) ≥ r̃(t) everywhere, and the second identity could not possibly hold). Again, using the concavity of r, this implies that there exists a point p ∈ [0, 1] such that r(t) ≤ r̃(t) for all t ∈ [0, p], and r(t) ≥ r̃(t) for all t ∈ [p, 1]. 15 Hence, we can write Z Z 1   d−1 d−1 dt = t · r(t) − r̃(t) 0 0 p Z   d−1 d−1 dt + t · r(t) − r̃(t) 1 p   t · r(t)d−1 − r̃(t)d−1 dt , where all the coefficients of t from the first term are nonpositive, and all the coefficients of t from the second term are nonnegative. Therefore we can lower bound this integral by  Z 1 Z 1 Z 1  Z p    d−1 d−1 d−1 d−1 d−1 d−1 r̃(t) dt = 0 , r(t) dt − dt = p· p· r(t) − r̃(t) dt+ p· r(t) − r̃(t) 0 p 0 0 which proves that the first condition also holds. Step 2: solve for the linear function. We can explicitly compute Z 1 Z 1 1 V d−1 t · r̃(t) dt = V d · t · (1 − t)d−1 dt = V d · = . d(d + 1) d+1 0 0 Therefore, combining the results from the two steps, we see that R1 R1 d−1 dt t · r(t)d−1 dt 1 0 t · r̃(t) = R1 ≤ 0R 1 = z ⊤ e1 , d−1 d−1 d+1 r̃(t) dt r(t) dt 0 0 which yields the desired conclusion. A.2 Proof of Lemma 5.5 Since our problem is invariant under rotations and translations, let us assume that u = e1 , and z = 0. Furthermore, notice that our problem is invariant to scaling K along the direction of u. Therefore we can assume without loss of generality that [a, 1] is the projection of K onto the e1 axis. Then, in the notation of Lemma 5.2, we have: Z 1 Z 1 d−1 δ r(t)d−1 dt . r(t) dt , vol(K+ ) = vol(K+ ) = δ 0 δ) ≥ From Theorem 5.1, we know that vol(K+ ) ≥ vol(K)/e. We will show that vol(K+ vol(K+ )/e, which yields the sought conclusion. From Theorem 5.3 we know that w(K, u)/(d + 1) ≤ 1. Hence, using our bound on δ, we obtain δ ≤ 1/(d + 1). We are left to prove, using the fact that r is a nonnegative concave function, that: Z 1 Z 1 1 r(t)d−1 dt . r(t)d−1 dt ≥ · e 0 1/(d+1) To see that this is true, it is enough to argue that the ratio between the two integrals is minimized when r is a linear function r(t) = c · (t − 1), for any constant c; in that case, an explicit computation of the integrals produces the desired bound. To see that the ratio is minimized by a linear function, we proceed in two steps. First, consider the function r̃ obtained from r by replacing in on the [1/(d + 1), 1] interval with a linear function starting at r(1/(d + 1)) and ending at 0:  i h 1 r(t), , if t ∈ 0, d+1 h i   r̃(t) = r 1 · d · (t − 1), if t ∈ 1 , 1 . d+1 d+1 d+1 16 Notice that this function is still concave, and its corresponding ratio of integrals can not be greater than the one for r (since the same value gets subtracted from both integrals when switching from r to r̃). Next, consider the function   1 d · (t − 1), t ∈ [0, 1] . r̂(t) = r · d+1 d+1 Since r̃ is concave, it is upper bounded by r̂ everywhere on [0, 1/(d + 1)]. Therefore, the ratio of integrals corresponding to r̂ can only decrease, compared to the one for r̃. Finally, the result follows from evaluating the integrals for r(t) = t − 1. A.3 Proof of Lemma 7.1 Since the problem is invariant under rotations and translations, we can assume without loss of generality that z = 0, S = {e1 , . . . , ek } and L = span{ek+1 , . . . , en }. For every vector x we will consider the projections of x onto the two corresponding subspaces, xS = (x1 , . . . , xk ) and xL = (xk+1 , . . . , xn ). For simplicity, will also use the notation KL := ΠL K. The proof consists of four steps. Step 1: the direction u has a large component in L. Since w(Cyl(K, S), u) ≥ ǫ, and z = 0 is the centroid of the cylinder, there must exist y ∈ Cyl(K, S) such that u⊤ y = u⊤ (y − z) ≥ 2ǫ . ǫ ⊤ Therefore u⊤ S yS + uL yL ≥ 2 . Since the width of Cyl(K, S) is at most δ along all small directions, we have kyS k∞ ≤ δ. Therefore, by Cauchy-Schwarz, kuL k kyL k ≥ u⊤ L yL ≥ ǫ − kδ . 2 Now, remember that since y ∈ Cyl(K, S), K is contained inside the unit ball, and all the small directions have length at most δ, it must be that kyk ≤ 1 + kδ. Since this implies the same upper bound on kyL k, combining with the bound above we see that kuL k ≥ ǫ/2 − ǫ2 /(16(d + 1)) ǫ ǫ/2 − kδ ≥ ≥ . 2 1 + kδ 1 + ǫ /(16(d + 1)) 4 Step 2: lower bound the width of KL along the direction of uL . Let ûL = uL / kuL k be the unit vector in the direction uL . We know by the last step that ⊤ w(KL , uL ) ≥ û⊤ L yL ≥ uL yL ≥ ǫ ǫ − kδ ≥ . 2 4 2 ⊤ Step 3: show that for all x ∈ K+ , one has û⊤ L xL ≥ −ǫ/(4(d + 1) ). If x ∈ K+ , then uL xL + ⊤ ≥ 0. Since kxS k∞ ≤ δ, we have uL xL ≥ −kδ. Hence u⊤ S xS û⊤ L xL ≥ − 4dδ ǫ kδ ≥− ≥− , kuL k ǫ 4(d + 1)2 where we used the fact that δ ≤ ǫ2 /(16d(d + 1)2 ). Step 4: upper bound the volume of ΠL K+ . From the previous step, we know that if x ∈ ΠL (K+ ), then xL ∈ {xL ∈ KL |û⊤ L xL ≥ −ǫ/(4(d + 1))}. Therefore:     1 ǫ ⊤ vol(ΠL K+ ) ≤ vol(KL ) − vol xL ∈ KL (−ûL ) xL ≥ ≤ vol(KL ) · 1 − 2 , 4(d + 1)2 e 17 where the first inequality follows from the previous step, since   ǫ . ΠL K+ ⊆ xL ∈ KL (−ûL )⊤ xL ≤ 4(d + 1)2 The second inequality follows from Lemma 5.5, since in Step 2 we showed that in this proof, we meet the conditions of that lemma. We note that it is very important that z is the centroid of Cyl(K, S) and not the centroid of K, since the application of Lemma 5.5 relies on the fact the projection of z onto the subspace L is the centroid of KL . A.4 Proof of Lemma 8.1 R 1 Let zi = vol(∆(s)) ∆(s) xi dx be the i-th component of the centroid of ∆(s). So if s−i is the vector k−1 in R obtained from s by removing the i-th component, then the intersection of ∆(s) with the s−i )}. Therefore, we can write the hyperplane xi = a can be written as: {x| xi = a, x−i ∈ ∆( 1−a/s i integral defining zi as: !!   Z si Z si 1 1 xi k−1 s−i dxi = zi = dxi xi vol ∆ xi vol (∆ (s−i )) · 1 − vol(∆(s)) 0 1 − xsii vol(∆(s)) 0 si since scaling each coordinate a constant factor scales the volume by this constant powered to the number of dimensions. Solving this integral, we get: zi = s2i vol(∆(s−i )) · . vol(∆(s)) k(k + 1) We can apply the same trick to compute the volume:   Z si xi k−1 si vol (∆ (s−i )) · 1 − vol(∆(S)) = . dxi = vol(∆(s−i )) · si k 0 Substituting the volume vol(∆(S)) in zi we get zi = A.5 si k+1 . Proof of Lemma 8.2 We break the sequence of directions chosen by nature in three parts. We will show that the first part alone has regret O(k log( 1ǫ )) and the other two parts will be used to bring the knowledge set to the desired format. We won’t specify the exact value of θ. We only assume that θ is an arbitrary point in the final knowledge set produced. choosing the K Step 1 : Nature picks Ω(k log( 1ǫ )) vectors in the direction ek ,  + side. s , 21 , . . . , 21 . The set obtained The knowledge set is initially ∆(s)×[0, 1]d−k with centroid at k+1 by cutting through this point using a hyperplane orthogonal to ek can be described as ) ( k X x s i k , ≤ 1, 0 ≤ xi ≤ 1 , x ∈ R d : xk ≥ k+1 si i=1 1 )s) × [0, 1]d−k . By applying such cuts which is, up to translation, equal to the set ∆((1 − k+1 Ω(k log( 1ǫ )) we are left with a set ∆(ŝ) × [0, 1]d−k where 0 ≤ ŝ ≤ ǫ. Since we assumed that θ is in k the last knowledge set while sk ≥ 2ǫ k+1 we must be incurring one unit of regret, so we must have 1 incurred at least Ω(k log( ǫ )) regret. 18   1 k+1 1 Step 2 : Nature picks a single vector in the direction v = k+1 , 1, 0, . . . , 0 , · , . . . , · 2k ŝ1 2k ŝk choosing the K− side. ŝ Since the centroid is z = ( k+1 , 12 , . . . , 21 ) the half-space defining K− is given by: v ⊤ x ≤ v ⊤ z = 1, therefore K− is described by: ) ( k k X X xi xi k + 1 d + xk+1 ≤ 1, ≤ 1, 0 ≤ xi ≤ 1 K− = x ∈ R : ŝi 2k ŝi i=1 i=1 To understand the shape of K− it is useful to decompose it in two parts based on the value of xk+1 . 1 Let y = 1 − 12 k+1 k which is a quantity between 0 and 2 . P P • for x ∈ K− with xk+1 ≥ y the constraint ki=1 xŝii ≤ 1 is implied by ki=1 xŝii k+1 2k + xk+1 ≤ 1, Pk x i since we can re-write the second constraint as: i=1 ŝi (1− y) ≤ 1− xk+1 ≤ 1− y. This means in particular that {x ∈ K− : xk+1 ≥ y} is equal, up to translation to ∆(ŝ, 1 − y) × [0, 1]d−k−1 . Pk x i P • For x ∈ K− with xk+1 ≤ y then the constraint ki=1 xŝii k+1 i=1 ŝi ≤ 2k +xk+1 ≤ 1 is implied by Pk x i 1 since i=1 ŝi (1−y) ≤ 1−y ≤ 1−xk+1 . In particular, this means that {x ∈ K− : xk+1 ≤ y} is the set ∆(ŝ) × [0, y] × [0, 1]d−k−1 . Step 3 : Nature picks r vectors in direction ek+1 choosing the K+ side, where r will be decided later. After Step 2, the set is a concatentation of ∆(ŝ) × [0, y] × [0, 1]d−k−1 and ∆(ŝ, 1 − y) × [0, 1]d−k−1 as displayed in Figure 4. By cutting in the ek+1 direction, we will eventually be left only with the ∆(ŝ, 1 − y) × [0, 1]d−k−1 part of the set. Pick r to be the minimum value such that this happens. Since the volume of the sections along the xk+1 dimension are non-increasing, the set after the cut must keep at least half of the width along ek+1 . Therefore, after r cuts, we must be left with ′ ∆(s′ ) × [0, 1]d−k−1 where s′ ∈ Rk+1 and 41 ≤ 1−y 2 ≤ sk+1 ≤ 1 − y. B Polynomial Time Algorithm Correctness. Correctness of this algorithm follows from a simple modification of our original analysis. In order to tolerate the fact that the centroid produced by the sampling scheme is only approximate, we need to resort to the Approximate Grünbaum Theorem (see Lemma 5.5) in order to track the decrease in volume, and also to an approximate version of the Directional Grünbaum Theorem (see Lemma B.1 below), in order to argue that directional widths still do not decrease faster than they are supposed to. Lemma B.1 (Approximate Directional Grünbaum). Let K be a convex body with centroid z. Let z ′ be an approximate centroid in the sense that kz − z ′ k ≤ ρ. Then for every vector u 6= 0, the set K+ = {x|u⊤ (x − z ′ ) ≥ 0} satisfies   w(K, v) 1 · w(K, v) − ρ · max 1, ≤ w(K+ , v) ≤ w(K, v) d+1 w(K, u) for any unit vector v. Proof sketch. The analysis follows from minor modifications in the analysis of Theorem 5.3. First we modify Lemma 5.4 in order to show that 1 w(K, u) − ρ ≤ w(K+ , u) ≤ w(K, u) . d+1 19 Indeed, since kz − z ′ k ≤ ρ, taking a cut perpendicular to u that passes through z ′ instead of z changes the directional width along u by at most ρ. Therefore the bound above holds in the worst case. Second, we consider the three cases considered in the proof. In the first two cases, 1 · w(K, v) − ρ via the previous bound. In the third case, let λ+ and λ− we have w(K+ , v) ≥ d+1 1 w(K, u) − ρ ≤ λ+ · w(K, u) and similarly for λ− . Therefore defined similarly. Then we have d+1 ρ 1 min{λ+ , λ− } ≥ d+1 − w(K,u) . Finally, this yields w(K+ , v) ≥ w(K, v) ·  1 ρ − d + 1 w(K, u)  , and our conclusion follows. Similarly, we require a robust version of projected Grünbaum, which we sketch below. Lemma B.2 (Approximate Projected Grünbaum). Let K be a convex set contained in the ball ǫ2 of radius 1, and let S be a set of orthonormal vectors along which w(K, s) ≤ δ ≤ 32d(d+1) 2 , for all s ∈ S. Let L be the subspace orthogonal to S, and let ΠL be the projection operator onto that subspace. If u is a direction along which w(Cyl(K, S), u) ≥ ǫ, z is the centroid of the cylindrified ǫ ⊤ ′ body Cyl(K, S), z ′ satisfies kz − z ′ k ≤ ρ := 8(d+1) 2 , and K+ = {x ∈ K : u (x − z ) ≥ 0}, then: vol(ΠL K+ ) ≤  1 1− 2 e  · vol(ΠL K) , where vol(·) corresponds to the (n − |S|)-dimensional volume on the subspace L. Proof sketch. The proof follows the same steps as the proof of Lemma 7.1. Below we sketch the essential differences, and show how they affect the analysis. The first two steps are identical, since they do not involve the perturbed centroid z ′ . For the third step, we proceed identically to show that û⊤ L xL ≥ − where we used δ ≤ 4dδ ǫ ≥− , ǫ 8(d + 1)2 ǫ2 . 32d(d+1)2 Finally, for the fourth step we use the fact that if x ∈ ΠL (K+ ) then xL ∈ {xL ∈ KL |û⊤ L xL ≥ 2 −ǫ/(8(d + 1) ) − ρ}. Hence   ǫ ⊤ ΠL K+ ⊆ xL ∈ KL (−ûL ) xL ≤ . 4(d + 1)2 and thus we obtain the same bound on vol(ΠL K+ ). Putting everything together, we can show that the algorithm using these approximation primitives yields the same regret asymptotically. The constants we will use throughout the our algorithm √ 2 /(2(d + 1)). The two key will be δapprox = δ/( d(d + 1)) = ǫ2 /(16d1.5 (d + 1)3 ), and ρ = δapprox results required for our robust analysis are: 1. If the cardinality of S does not increase, then  vol(ΠLt Kt+1 ) ≤ 1 − 1/e2 vol(ΠLt Kt ) . This is given by the approximate projected Grünbaum theorem (Lemma B.2). 20 2. When adding an extra direction to S, we know that w(Kt , u) ≥ δapprox , for all u ∈ Lt . Then by Lemma B.1 after we cut Kt we have that for any vector v ∈ Lt ,   w(Kt , u) 1 δapprox δapprox w(Kt , v) − ρ · max 1, −ρ· ≥ , ≥ w(Kt+1 , v) ≥ d+1 w(Kt , v) d+1 δapprox 2(d + 1) 2 /(2(d + 1)). So applying the Cylindrification Lemma (Lemma by our choice of ρ = δapprox 6.1) we obtain that the volume of the convex body projected onto the new subspace of large directions L′ is bounded by vol(ΠL′ Kt+1 ) ≤ d(d + 1) 32d1.5 (d + 1)3 vol(ΠLt Kt+1 ) = vol(ΠLt Kt+1 ) . δapprox /(2(d + 1)) δ This follows just like before from Lemma 6.1. Our method of finding thin directions based on the approximate John ellipsoid (Corollary 9.3) guarantees that all directional widths in the large subspace L are at least δapprox . Therefore the blow up in volume is at most by a factor of (32d1.5 (d + 1)3 )/δ. Since all the new bounds are within polynomial factors from the ones used in the analysis using exact centroids, by plugging in the old analysis, we easily obtain the same regret, up to constant factors. Running time. For the running time analysis, note that the centroid approximation can be implemented using Õ(d4 /ρ) = (d/ǫ)O(1) calls to the separation oracle for the convex body. Such a separation oracle needs to take into account both the linear inequalities added during each iteration, and the at most d projections. Such an oracle can be implemented by maximizing a linear functional over a set determined by the intersection between the initial unit ball and the linear constraints (whose number is bounded by the number of iterations of the algorithm Õ(d log(1/ǫ)); therefore this step can be implemented in polynomial time, and therefore all the centroid approximation steps require time (d/ǫ)O(1) . The routine for finding the thin directions will be called at least once every iteration, and will find a thin direction at most d times. Therefore this contributes dO(1) log(R/r) · log(1/ǫ) to the running time, where r is a lower bound on the smallest ball contained in the body, while R is an upper bound. From the setup we have R = 1; also, since we are finished after Õ(d log(1/ǫ)) iterations, and each iteration shrinks the smallest directional width by at most a factor of dO(1) , according to Lemma 6.3, we have that at all times the body will contain a ball of radius d−Ω(d) . Therefore the running time contribution of the routine required for finding thin directions is dO(1) log(1/ǫ). All the other steps require at most polynomial overhead, therefore the total running time is (d/ǫ)O(1) . C Relation to standard online learning problems We now discuss in detail the relationship between multidimensional binary search (MBS) and standard problems in online learning. We start by describing the problem of learning a halfspace with a margin (LHM). C.1 Learning Halfspaces with Margin As in our multidimensional binary search problem, this problem starts by assuming there exists a fixed but unknown vector of weights θ ∈ Rd with kθk = 1. We receive vectors of features 21 ut ∈ Rd with kut k = 1 in an online fashion. The algorithm needs to guess on which side of the hyperplane defined by θ the feature vector xt lies. If ŷt ∈ {−1, +1} is the guess, the loss/regret is ⊤ 1 if ŷt · u⊤ t θ ≤ 0 and zero otherwise. The feedback after each guess is sgn(ut θ), which also tells us how much regret we incur in each step. The problem also comes with a promise. All feature vectors satisfy a condition related to the hyperplane being learned: θ ⊤ ut ≥ γ. C.2 Halving Algorithm We start by discussing the Halving Algorithm for LHM. While not the most popular method for this problem, it is the one closest to our approach. In this algorithm, we also maintain a knowledge set of all candidate vectors θ. We start with K0 = {θ| kθk ≤ 2}, which is slightly larger than usual to guarantee we have a small ball around the real θ. For each incoming ut , we find xt such that ⊤ vol(Kt ∩ {θ| u⊤ t θ ≤ xt }) = vol(Kt ∩ {θ| ut θ ≥ xt }) and guess ŷt = sgn(xt ). If the guess is correct, we don’t incur any loss and we don’t update the knowledge set. If the guess is wrong, we update the knowledge set either to Kt+1 = Kt ∩{θ| u⊤ t θ ≤ 0} (if we guessed yt = +1) or Kt+1 = Kt ∩ {θ| u⊤ θ ≥ 0} (if we guessed y = −1). After each incorrect t t guess, we have that vol(Kt+1 ) ≤ 12 vol(Kt ). If we can provide a lower bound to the final volume, we are able to provide a mistake bound. By the promise we know that for the real θ, θ ⊤ ut ≥ γ. If we add a constraint θ ⊤ ut ≥ 0 to the knowledge set, then this constraint should be satisfied for any θ ′ such that kθ − θ ′ k ≤ γ, since: ′ ⊤ ⊤ ′ ′ u⊤ t θ = ut θ + ut (θ − θ ) ≤ γ − θ − θ · kut k ≥ 0. Therefore the algorithm never removes a ball of radius γ around the real θ from the knowledge set. Therefore, the volume of the knowledge set is always at least Ω(γ d ), which yields a O(d log(1/γ)) mistake bound. Can we adapt halving to MBS? The key obstacle is that we do not know if we made a mistake or not in MBS. If we knew whether we made a mistake or not, we could keep a knowledge set as before. For each ut , we again would choose xt such that: ⊤ vol(Kt ∩ {θ| u⊤ t θ ≤ xt }) = vol(Kt ∩ {θ| ut θ ≥ xt }). If we do not make a mistake, we again don’t update the knowledge set. As in the previous problem, if we make a mistake, we update the knowledge set to one of half the volume. If we guessed ⊤ ⊤ u⊤ t θ = xt and it was a mistake, we can update either to Kt ∩ {θ| ut θ ≤ 0} or Kt ∩ {θ| ut θ ≥ 0} depending on the feedback. If we update to Kt ∩ {θ| u⊤ t θ ≥ 0}, we know by the fact that we made ′ within a ball of radius ǫ of the real θ will never be removed from θ ≥ ǫ. So any θ a mistake that u⊤ t the knowledge set by the same argument as before, using ǫ instead of γ. This gives us by the same volume argument a O(d log(1/ǫ)) regret algorithm. However, this algorithm is not implementable in our setting because we do not know if we made a mistake or not. We could always cut the knowledge set after the feedback, but then we are no longer guaranteed to preserve a ball of radius ǫ around the true θ and no longer can make the volume argument. Can we always cut and use a different analysis to show the same regret bound? In Section 8, we argued that if we always cut through the centroid we might incur Ω(d2 log(1/ǫ)) regret. The same argument holds if we cut in half the volume instead of cutting through the centroid. Therefore, the answer is no if we want to obtain a linear bound on d. 22 C.3 Online Convex Optimization The other family of algorithms for learning halfspaces with a margin is based on online convex optimization. Using the classic Perceptron algorithm, one can obtain a mistake bound of O(1/γ 2 ) for learning halfspaces with a margin and using the closely related Winnow algorithm we obtain a much better dependency on γ at the expense of a dependency in the dimension: O(d log(d/γ)).4 We refer the reader to Section 3.3 in [20] for a comprehensive exposition. Instead of keeping a candidate set of possible values of θ, those algorithms keep a single value θ̂ ∈ Rd and for each incoming vectors of features ut , we make a prediction according to u⊤ t θ̂. If we make a mistake, we perform a first-order update to θ̂ according to a surrogate loss function. For the learning halfspaces problem, the actual loss function is replaced by a convex function that is an upper bound to the actual loss function and for which we can compute the gradient as a function of ut and yt . That function is taken to be the hinge loss. Depending on which type of first order update we do, we get a different algorithm: the Perceptron is obtained by performing a gradient descent step and Winnow is obtained by performing an exponentiated gradient step. Both algorithms depend on not performing an update whenever we do not incur a mistake. For our problem, since we do not know if we made a mistake or not, to instantiate the online convex optimization framework we would need to perform an update in each iteration and there does not ⊤ seem to be an adequate surrogate for our loss function ℓ(θ̂, ut ) = 1{|u⊤ t θ̂ − ut θ| > ǫ}. 4 We also point out that Perceptron-style algorithms like the one of [7], despite exhibiting the apparently useful number of O(d log d/ǫ) iterations, are not applicable to this problem. Crucially, the problem studied in those settings is offline: it requires knowing all the vectors given by the adversary ahead of time. 23
8cs.DS
A Modified DTC with Capability of Regenerative Braking Energy in BLDC driven Electric Vehicles Using Adaptive Control Theory Shiva Geraeea,*, Hamed Mohammadbagherpoorb, Mehdi Shafieic, Majid Valizadehd, Farshad Montazerie, Mohammad Reza Feyzia a Faculty of Electrical and Computer Engineering, University of Tabriz, Iran b Faculty of Electrical and Computer Engineering, North Carolina State University, USA c Department of Electrical and Electronic Engineering and Computer Science, Queensland University of Technology, Australia d Department of Electrical and Electronic Engineering, University of Ilam, Iran e Center of Excellence for Power System Automation and Operation Electronic Engineering, Iran University of science and Technology, Iran Abstract This paper represents a novel regenerative braking approach for the Electric Vehicles. The proposed method solves the short-range problem which is corresponding to the charge of the battery pack. The DTC switching algorithm has been modified to recover the electrical energy from Electrical Vehicle (EV), driven by Brushless DC motor, without using the additional power converter or the other electrical energy storage devices. During regenerative braking process, different switching pattern is applied to the inverter to convert the mechanical energy to the electrical energy through the reverse diodes. This switching pattern is different from the normal operation due to the special arrangement of voltage vectors which is considered to convert the mechanical energy to electrical energy. The state of charge of the battery is used as a performance indicator of the method. Simultaneously, a model reference adaptive system has been designed to tune the system’s parameters. Several simulations are carried out to validate 1 the performance and effectiveness of the proposed methods. The results show the high capability and performance of the designed method. Keywords: Electric Vehicle, Regenerative Braking, Brushless DC Motor, Direct Torque Control, Model Reference Adaptive System. Introduction Nowadays, due to the concern of global warming, fossil fuels cost and uncertainty of oil supply, the necessity of using renewable energies become more obvious [1-3]. Therefore, the government’s policies have been changed to encourage automobile manufactures to allocate research budget for EVs [1,4]. In compare with the conventional vehicles there is still some drawbacks of EVs that can be noted such as, battery pack, charging system and a short driving mileage due to battery charging capacity [4-6]. Therefore, under government’s instruction and the people demands, automobile manufacturers have tried to improve the products in terms of standard quality and fuel efficiency [7]. In order to increase the efficiency of the EVs, high-tech equipment such as sensors, extra storage devices, and inverter circuits can be employed. However, these technologies on one hand may make EVs complicated, and on the other hand increase the total cost of producing EVs [23]. Therefore, researchers are trying to tackle this problem by modifying the regenerative EVs’ braking system. The battery pack, the motor drive system, and the converter controller are three significant components of EVs [5]. Motor drive system technology plays a crucial role in power transfer mechanism [3]. The common electric motors that are used in EVs are switched reluctance machine (SRM), induction motor (IM) and brushless direct-current (BLDC) motor [3]. Among them the BLDC motors are the preferred one. The most applications 2 of the Brushless DC motors can be categorized into the servo drives, appliances, medical equipment and a broad spectrum of power systems [8,9]. Its popularity goes back to the great efficiency, suitable torque–speed characteristic, dependability, stableness, lower noise and simple structure to control [9-11]. However, the significant defect of BLDC motors is related to the torque ripple which is resulted to cogging torque [12]. Also, awareness of the exact position of the rotor is one of the key issues in this kind of motor to sustain the windings in the right direction of rotation [13]. These positions are sensed by the Hall sensors owing to their cost-effectiveness, especially where the phase currents should be commutated on and off [14, 15]. The proximity sensors detect the pole’s sign of the rotor when the rotor magnetic poles are passing in front of the sensors [15]. Assessing the received signals determines the precise sequence of commutation. The signals can be decoded by understanding the combinational logic. The outputs are 6 voltage vectors. Therefore, the firing commands are applied to the phases to conduct them to 120 electrical degrees. Various methods have been proposed to control BLDC motor such as dc link current control, direct torque control, hysteresis current control and pulse width modulator control [16,17], that among them Direct Torque Control (DTC) is more reliable [18]. A three-phase switching circuit is used to control the motors based on the received command from the controller [3]. Switching pattern in DTC can be altered in diverse ways which differ in purpose. Heretofore, a multitude of articles has published to improve the regenerative braking approaches of EVs in various procedures in distinct motors [19-26]. The energy efficiency is a crucial attribute [27], and reusing the brake energy can make a profound contribution, a distinct difference between conventional vehicles and EVs. By regenerative braking the energy is reversed into the battery within braking so that torque is used for braking the motor, and the motor generates power 3 consequently [13,15]. Recovering potential and kinetic energy during declaration or stopping can increase the range of the car's path. Adding equipment such as sensors, extra storage devices, and new inverter circuits, in some of the proposed methods only make system complicated [23]. In the proposed method, it has been attempted to recover the kinetic energy only by changing the switching pattern without the major revolution in structure. Voltage vectors are sorted based on the roles that they play in reducing or augmenting in torque and flux. The controller is the heart of the system for both driving and regenerative braking of motors. A very typical control system is proportional-integral (PI) controller, which is popular due to a simple structure and high torque and speed responses. Nonetheless, the performance of this controller is not acceptable in the presence of speed changes, parameters fluctuation and load effect [8,28]. In this paper, a Model Reference Adaptive System (MRAS) is applied for tuning the controller parameters automatically and track the reference speed signal. Dynamic model of Electric Vehicle The motion and acceleration of the vehicle can be analyzed by the forces applied to it. In the motoring mode, resistance forces acting on EV as shown in Figure 1, can be equivalent to the following formulas [5]: (1) Ftot  Frr  Fhc  Fad  Fla Frr  M .g. f . is the rolling resistance (2) Fhc  M .g .sin is the hill climbing force (3) is the aerodynamic drag (4) Fad  1  .Cd . A.v 2 2 4 Fla  M . dv is the acceleration force (5) dt Fhc ψ ψ mg Figure. 1. The forces acting on a vehicle moving along slope Where g is the acceleration of gravity, f is the coefficient of rolling resistance,  is the density of the ambient air, C d is aerodynamic drag coefficient, v is vehicle speed, A is vehicle frontal area, M is the overall mass of the vehicle,  is the slope angle. The total torque load can be calculated as (6) in: T  F *R L tot w (6) where Rw stands for the radius of the tire. An electric motor is responsible to prevail over load force by producing tractive force [29]. BLDC motors are the common motors that are used in EVs to increase their performances. A general switching circuit of the BLDC drive system has been shown in Figure 2. The equivalent dynamic model of BLDC is represented as equation (7) [18], 5 Van   R 0 0  ia   L 0 0  ia  ea  V    0 R 0  i    0 L 0  d i   e   bn    b    dt  b   b  Vcn   0 0 R  ic   0 0 L ic  ec  (7) L  Ls  Lm (8) where Van, Vbn, and Vcn are the phase voltages, ia, ib, and ic are the phase currents, R is the phase resistances, L is the equivalent inductance in each stator windings, Ls are inductance of each phase, Lm isthe mutual inductance between phases, and ea, eb, and ec are back-EMFs of each phase [8]. Iphase + S1 S3 S5 Model of BLDC Motor L a R Vin ea L b n R L c S2 S4 eb R S6 ec - Figure. 2. A general schematic of BLDC drive The ideal current and back-EMF signals for one of the phases have been illustrated in Figure 3. Em Back-EMF Phase Current Im 0 ωt π 2π Figure. 3. Ideal waveform of back-EMF and curren 6 Direct torque control of BLDC Direct Torque Control (DTC) was proposed by Takahashi and Noguchi in 1986 and Depenbrock in 1988, which was implemented on induction motors [30]. Due to its high performance in controlling the variable speed drivers, it is prevalent among the industrial applications. This method controls the flux linkage and electromagnetic torque simultaneously and independently. Also, DTC is robust against uncertain parameters, swift torque response, simplicity and high dynamic performance. However, it suffers from the torque ripples and fluctuating frequencies [15,18]. The electromagnetic torque plays an important role in DTC method. Equation (9) (9) describes the electromagnetic torque in stationary (αβ) reference frame [30]: d r e 3 P d r 3 P e Tem  [ is  is ]  [ is   is ] 2 2 d e d e 2 2 e e where ωe are the electrical rotor position, isα, isβ are stator currents and eα, eβ are back- EMF respectively, θe is the electrical rotor position and φrα and φrβ are reference frame electromagnetic torque. DTC operates based on the set of specific instructions to decide on the right voltage vector between six or eight space vectors. Table 1 shows the possible space vectors and patterns that DTC uses to choose the right voltage. Commands are chosen based on the hysteresis controller outputs. The difference between estimated and real values of torque and flux are the inputs of hysteresis controller. This error between real and estimated amount for flux linkage is named FST and for electromagnetic torque TST. “TI” expression indicates the demand for increasing the torque since the actual extent torque is lower than the estimated extent.“TD” expression shows that less electromagnetic torque is required. The “FI” and “FD” expressions are the same as torque which indicates the demand for increasing or decreasing of the flux, respectively. Furthermore, “F” expression is used to show the unchanged cases [31]. 7 Fst Tst Ө1 TI V1(100001) FI TD V6(100100) TI V2(001001) TD V1(100001) TI V0(010101) FD TD V2(001001) Sector Ө3 Ө4 V3(011000) V4(010010) V2(001001) V3(011000) V4(010010) V5(000110) V3(011000) V4(010010) V0(010101) V0(010101) V4(010010) V5(000110) Ө2 V2(001001) V1(100001) V3(011000) V2(001001) V0(010101) V3(011000) Ө5 V5(000110) V4(010010) V6(100100) V5(000110) V0(010101) V6(100100) Ө6 V6(100100) V5(000110) V1(100001) V6(100100) V0(010101) V1(100001) Table.1. Switching Pattern for inverter in conventional DTC Figure 4 shows the DTC block diagram which is included the speed and hysteresis controllers, flux and torque estimators and switching table. During the operation of the DTC switching system, the reference electromagnetic signal is produced by the PI speed controller using the error between the reference and the measured speeds. The errors between the desired and actual extent flux linkage and electromagnetic torque are forwarded to the hysteresis controller to produce the command based on the switching pattern table for the inverter [11,30]. Voltage Vector Selection Table V2 Speed Controller ωref + ωr ∑ PI Hysteresis Controller Tref + - ∑ -1 1 +∑ 0 V1 V3 S2 S1 S3 S5 S3 30◦ S4 - |φs*| Voltage Source Inverter S1 1 1 V4 -1 1 S2 S4 S6 S6 V5 2 |φs|=0 S5 BLDC Motor Clarck Transformation - V6 2 Position Sensors θm Stator Flux Linkage Estimator Electromagnetic Torque Estimator Direct Torque Control Figure. 4. General configuration of DTC with BLDC motor [18] 8 θe The modified regenerative braking DTC In the motoring mode of BLDC motor stator flux vector moves ahead of the rotor flux. To produce inverse torque, the rotor and stator flux must be rotated in the opposite directions. As a result, the suitable voltage vector should be sent to the inverter in a way that the stator flux follows the rotor flux to return power to the battery. In conventional DTC for the switching pattern, there is no state to create inverse torque. Hence, the zeros vectors are selected when sharp drops when torque is required. Consequently, removing reversibility brings the motor speed down and makes dynamic response slower [32]. Selecting zeros vectors instead of vectors causes regeneration energy and rapid braking. In addition, reversibility brings the motor speed down and makes dynamic response slower [32]. In each sextet sector, a couple of active voltage vectors are determined to control flux-linkage magnitude. The exerted arrangements are shown in Figure 5. V5 V4 V5 V4 V4 θ3 V3 θ2 V3 V2 V3 θ1 V6 30◦ V5 V4 V2 V4 V1 θ4 V6 V2 V5 V6 θ5 V6 V4 θ6 V1 V2 V1 V1 V2 Figure. 5. Voltage vectors and their role In this paper, the switching pattern has been modified to improve the conventional DTC method and regenerate energy from the braking system. Table 2 and Figure 6 show the vectors for 9 different cases to increase or decrease the electromagnetic torque and flux and modify the results. Using the updating switching pattern, the negative torque is applied to the motor and the produced electrical energy which is transferred through the inverse diodes to charge the storage devices. In this method, the estimated flux error is applied to the two levels hysteresis controller. Also, a three levels hysteresis controller has been utilized to control the torque as: 1 𝐼𝑛𝑐𝑟𝑒𝑎𝑠𝑒 𝑡ℎ𝑒 𝑡𝑜𝑟𝑞𝑢𝑒 𝐻𝑦𝑠𝑡𝑒𝑟𝑠𝑖𝑠 𝑂𝑢𝑡𝑝𝑢𝑡 = { 0 𝑁𝑜 𝑐ℎ𝑎𝑛𝑔𝑒 −1 𝐷𝑒𝑐𝑟𝑒𝑎𝑠𝑒 𝑡ℎ𝑒 𝑇𝑜𝑟𝑞𝑢𝑒 By considering k sector for the stator flux, the voltage vectors 𝑉𝑠,𝑘+1 and inverse voltage vector 𝑉𝑠,𝑘−2 are used to increase and decrease and the torque and the flux respectively. Also, two zero voltage vectors are applied to reach the unchanged flux and the low torque reduction. The modified switching pattern has been presented in table 3. Vk+2 Vk+1 k-th sector Vk+3 Vk-2 ωs Vk Vk-1 Figure. 6. The effect of selecting a voltage vector if the flux is in the k sector VOLTAGE VECTOR Flux Torque Increase Vk, Vk+1, Vk-1 Vk+2, Vk+1 Decrease Vk+3, Vk+2, Vk-2 Vk-2, Vk-2 Table. 2. Select vectors based on increasing or decreasing flux and torque 10 Fst Tst Ө1 FI V2(001001) TI FD V3(011000) Tt FI V0(010101) FD V0(010101) FI V6(100100) TD FD V5(000110) Ө2 V3(011000) V4(010010) V7(101010) V7(101010) V1(100001) V6(100100) Sector Ө3 Ө4 V4(010010) V5(000110) V5(000110) V6(100100) V0(010101) V7(101010) V0(010101) V7(101010) V2(001001) V3(011000) V1(100001) V2(001001) Ө5 V6(100100) V1(100001) V0(010101) V0(010101) V4(010010) V6(100100) Ө6 V1(100001) V2(001001) V7(101010) V7(101010) V5(000110) V4(010010) Table.3. Proposed switching table Model reference adaptive control Since the conventional PI controller is not robust in presence of parameters uncertainty and the disturbance signal [33-34], a MRAS controller is used to overcome these problems and guarantee the zero-tracking error. The block diagram of MRAS has been shown in Figure 7 [3]. y ref Refetence Model G m (s ) Adjustment mechanism uC u MRAS Controller KP Plant G P (s ) y Figure.7. General form of MRAS 𝐺𝑚 (𝑠) is the model reference transfer function which is equal to k pG p (s ) . 𝐺𝑝 (𝑠) is equivalent transfer function of the system and 𝑘𝑝 is the proportional adaptive controller parameter that controls the system in a way that the desired output signals track the reference signals. 𝑢 is the control signal which is equal to 𝑘𝑝 𝑢𝑐 . The adaptive controller uses the error signal to build the desired command. The main objectives of the adaptive controller are to guarantee the stability of the system in presence of uncertainty and disturbances and zero tracking error. The tuning mechanism is known as MIT rule and the algorithm can be derived by control error: 11 e  y  y m  L1  k pG p (s )U (s )  k pG p (s )U (s )  (10) The cost function that should be minimized to adjust the adaptation gain will be as: (11) 1 J (k p )  e 2 (k p ) 2 It is rescannable to use the negative gradient of the J to adjust the adaptation parameter. The tracking error is computed as: e  y  y m  L1 G p (s )k pU (s )  G p (s )k pU (s )    L1 G p (s )U (s )  k p  k p  (12)   G p (s )U (s )k p  k p  k p    k p  k p    L1  L1  k pG p (s )U (s )    kp kp    k p kp  kp L1 G m (s )U (s )   k p kp  kp L1 Y m (s )   k p kp  kp ym Also from the equation (11): 1 J k p   e 2 k p  2 dk p J e     e dt k p k p Where (13) e is the sensitivity derivative of the system and𝛾 is the adaptation gain [35]. k p Using the Equations (12) and (13) the MIT adaptation rule will be: dk p dt   e e   ey m k p (14) 12 Simulation results and discussion Simulations have been done in MATLAB/Simulink to prove the efficiency of the proposed method. To illustrate the performance of the proposed method different scenarios have been considered. The system transfer function is given as: Gp  (15) b0 s  bs  a 2 The reference model is chosen to be: Gm  (16) bm s  bs  a 2 where a = R/L+B/J, b = RB/LJ 6.1 Conventional DTC A driving cycle which is similar to the standard ECE-driving-cycle, has been applied to the motor. w(rad/s) 60 Refrence Speed Speed 40 20 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time(sec) (a) 40 Torque(N.m) TL Te 20 0 -20 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time(sec) (b) Figure. 8. (a) Speed tracking and demanded speed, (b) Torque tracking of BLDC motor in common DTC 13 In order to demonstrate the proper functioning of the DTC in BLDC motor, tracking torque and speed have been monitored. The speed and torque control of the conventional DTC based on the measured standard cycle and load torque are shown in Figure 8. As it can be seen, low torque ripple and fast dynamic response show the good performance of this method. Also, the output signals track the desired reference signals. The main difference between the conventional DTC and the proposed modified DTC is the State of Charge (SOC) of the systems which will be explained in the next sections. 6.2 Modified DTC Figure 9 shows the speed and torque signals resulted by evaluating the modified DTC method. The driving cycle with a braking state and a negative acceleration, provides a situation that can be used to recover the kinetic energy and charge the batteries. The SOC of the battery in the regenerative braking mode has been shown in Figure 9 (c). As it can be seen from the result, the SOC of the battery has been improved. The faster speed reduction results in the significant drop in the SOC. w(rad/s) 60 Refrence Speed Speed 40 20 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time(sec) (a) 40 Torque(N.m) TL Te 20 0 -20 0 0.1 0.2 0.3 0.4 0.5 Time(sec) (b) 14 0.6 0.7 0.8 SOC(%) 100 99.998 99.996 99.994 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time(sec) (c) Figure. 9. (a) Speed tracking and references speed, (b) Actual Torque tacking with desired torque, (c) SOC in regeneration mode of DTC 6.3 SOC of the DTC and the modified DTC In this scenario, the SOC of the conventional DTC and modified DTC have been compared in Figure 10. As it can be seen, in the same circumstances the modified DTC method has regenerated the power at the end of the cycle and has charged the batteries. However, in the conventional DTC method the SOC has decreased at the end of the cycle. By employing the modified DTC, the kinetic energy is converted to the electric energy when the acceleration is negative. 100 Conventional DTC Modified DTC 99.999 SOC(%) 99.998 99.997 99.996 99.995 99.994 99.993 99.992 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time(sec) Figure. 10. SOC for battery with and without regenerative braking 6.4 MRAS controller In the last scenario, an adaptive controller has been designed to control the system and improve the performance of the system. By applying the adaptive controller, the system will have a good performance to track the reference signals and also can help the system to damp the torque 15 ripples as shown in Figure 11. By comparing the results of the modified DTC and the conventional DTC, the DTC method has less tracking error than the modified DTC, while the modified DTC removes the torque and speed ripples. To have a simple and reliable algorithm, the adaptive controller is a good option to satisfy the system’s performance without changing the parameters. Based on the simulated results, not only the speed and the torque are tracked well, but also the torque ripple is significantly reduced in comparison with PI controller. w(rad/s) 60 Refrence Speed Speed 40 20 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time(sec) Offset=0 (a) Torque(N.m) 40 TL Te 20 0 -20 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time(sec) Offset=0 (b) 150 Kp 100 50 0 0 0.3 0.6 0.9 Time(sec) (c) Figure. 11. (a) Speed tracking, (b) Torque, (c) Adaptive proportional gain Also, adaptability is another important point to prove its efficiency, therefore a new reference signal is applied to monitor the speed tracking. As shown in Figure 12, PI controller cannot 16 follow the new reference signal, whilst the proposed adaptive controller has a good performance without any changes in parameters. Also, comparing the SOCs clearly shows that battery energy usage is the lowest in this state. 60 Reference Speed Speed w(rad/s) 50 40 30 20 10 0 0 0.1 0.2 0.3 0.4 0.5 Time(sec) 0.6 0.7 0.8 0.9 (a) 60 Reference Speed Speed w(rad/s) 50 40 30 20 10 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time(sec) (b) 100 99.999 SOC(%) 99.998 99.997 99.996 99.995 99.994 99.993 99.992 99.991 0 Conventional DTC 0.1 0.2 Modified DTC with PI controller 0.3 0.4 Modified DTC with MRAS controller 0.5 0.6 0.7 0.8 0.9 Time(sec) Figure. 12. (a) Speed tracking of MRAS, (b) Speed tracking of PI, (c) SOCs 17 Conclusion In this study, a new approach is presented to regenerate electrical energy from the kinetic energy of EVs and bringing it back to the batteries in BLDC motor. Driving cycle experiences ups and downs with positive, negative and zero accelerations. These fluctuations lead to variations in the load torque. Consequently, the simulations are brought closer to the actual situation. In the proposed method, a new switching pattern has been implemented tothe system to generate the electrical energy without mechanical changes. The simulation results show that the new switching pattern improves the speed and torque tracking signals and the torque ripples. Comparing the SOC trends of conventional and modified DTC exhibits the good performance of the proposed algorithm and improvement in the energy return to batteries. In order to improve the tracking error and the torque ripples, an adaptive controller is designed. The results show the good performance of the designed controller in different speed reference signals. References [1] Xie Da, Chu Haoxiang, Gu Chenghong, Li Furong, Zhang Yu. A Novel Dispatching Control Strategy for EVs Intelligent Integrated Stations. IEEE Trans Smart Grid 2015;8(2):1–10. [2] Mohan V, Singh JG, Ongsakul W. Sortino Ratio Based Portfolio Optimization Considering EVs and Renewable Energy in Microgrid Power Market. IEEE Trans Sustainable Energy 2017;8(1):219-29. [3] Chi-lan C, Xiao-gang W, Yue-wei B, Yan-chun X, Kai L. Motor Drive System Design for Electric Vehicle. IEEE International Electric Information and Control Engineering Conf 2011:15-17. [4] Wai CK, Rong YY, Morris S. Simulation of distance estimator for battery electric vehicle. Alexandria Engineering Journal 2015;54(3);359-71. [5] Long B, Lim ST, Ryu JH, Chong KT. Energy-Regenerative Braking Control of Electric Vehicles Using Three-Phase Brushless Direct-Current Motors. Energies 2014;7:99–114. [6] Tashakor N, Farjah E, Ghanbari T. A Bi-directional Battery Charger with Modular Integrated Charge Equalization Circuit. IEEE Trans Power Electronics 2017;32(3): 213345. 18 [7] Sarlioglu B, Morris CT, Han D, Li DS. Driving Toward Accessibility. IEEE Industry Applications Magazine 2016;23(1):14-25. [8] Parhizkar N, Shafiei M, Kouhshahi MB. Direct torque control of brushless DC motor drives with reduced starting current using fuzzy logic controller. IEEE Uncertainty Reasoning and Knowledge Engineering Conf 2011:129-132. [9] Niapour, S. K. M., Garjan, G. S., Shafiei, M., Feyzi, M. R., Danyali, S., & Kouhshahi, M. B. (2014). Review of Permanent-Magnet Brushless DC Motor Basic Drives Based on Analysis and Simulation Study. International Review of Electrical Engineering (IREE), 9(5), 930-957. [10] Viswanathan V, Seenithangom J. Commutation Torque Ripple Reduction in BLDC Motor Using Modified SEPIC Converter and Three-level NPC Inverter. IEEE Trans Power Electronics 2017;99:1-12. [11] Sharifian, M. B. B., Shafiei, M., Sadeghi, M. S., & Golestaneh, F. (2011, August). Direct torque control of brushless DC motor drives based on ANFIS controller with fuzzy supervisory learning. In Electrical Machines and Systems (ICEMS), 2011 International Conference on (pp. 1-6). IEEE. [12] ShirvaniBoroujeni M, ArabMarkadeh GR, Soltani J. Torque ripple reduction of brushless DC motor based on adaptive input-output feedback linearization. ISA Transaction in press 2017. [13] Nian X, Peng F, Zhang H. Regenerative braking system of electric vehicle driven by brushless DC motor. IEEE Trans Ind Electron 2014;61(10):5798–808. [14] Shafiei, M., Kouhshahi, M. B., Sharifian, M. B. B., & Feyzi, M. R. (2011). Position sensorless for controlling brushless DC motor drives based on sliding mode and RLS estimators using NSGA-II algorithm optimization. system, 1, 2. [15] Sajitha P, Jashper A. Direct Torque Control of a BLDC Motor Based on Computing Technique. IOSR Journal of Electrical and Electronics Engineering 2013;6(6):01-08. [16] Moussi A, Torki A. An Improved efficiency permanent magnet brushless DC motor pv pumping system. Larhyss Journal 2002;1:139-56. [17] Karthikeyan J, Sekaran RD. Current Control of Brushless DC Motor based on a Common DC Signal for Space Operated Vehicles. Electrical Power and Energy Systems 2011;33:1721–7. [18] Feyzi, M. R., Niapour, S. K. M., Danyali, S., & Shafiei, M. (2010, October). Supplying a brushless DC motor by Z-source PV power inverter with FLC-IC MPPT by DTC drive. In Electrical Machines and Systems (ICEMS), 2010 International Conference on (pp. 694699). IEEE. [19] Sadat AR, Pashaei A, Tohidi S, Sharifian MBB. A Novel SVM-DTC Method of InWheel Switched Reluctance Motor Considering Regenerative Braking Capability in Electric Vehicle. International Journal on Technical and Physical Problems of Engineering (IJTPE) 2016;8(4):19-25. [20] Naseri F, Farjah E, Ghanbari T. An Efficient Regenerative Braking System Based on Battery/Supercapacitor for Electric, Hybrid and Plug-In Hybrid Electric Vehicles with BLDC Motor. IEEE Trans Vehicular Technology 2017;66(5):3724-38. [21] Pothirasan N, Rajasekaran MP. Regenerative E-Vehicle using BLDC Motor. IEEE International Emerging Technological Trends Conf; 2016. [22] Qiu CN ,Wanga G. New Evaluation Methodology of Regenerative Braking Contribution to Energy Efficiency Improvement of Electric Vehicles. Energy Conversion and Management 2016;119:389–98. 19 [23] Mohammad A, ZiaurRahmanKhan MD. BLDC Motor Controller for Regenerative Braking. International Conference on Electrical Engineering and Information & Communication Technology (ICEEICT) 2015:1-6. [24] Zhang X, Wang Y, Liu G, Yuan X. Robust Regenerative Charging Control based on T-S Fuzzy Sliding-Mode Approach for Advanced Electric Vehicle. IEEE Trans Transportation Electrification 2016;2(1):52-65. [25] Ananthababu B , Ganesh C , Pavithra CV. Fuzzy Based Speed Control of BLDC Motor With Bidirectional DC-DC Converter. In Online International Conf on Green Engineering and Technologies (IC-GET); 2016. [26] Lv C, Zhang J, Li Y, Yuan Y. Novel Control Algorithm of Braking Energy Regeneration System for an Electric Vehicle during Safety–Critical Driving Maneuvers. Energy Conversion and Management 2015;106: 520–9. [27] Haddoun A, Benbouzid MEH, Diallo D, Abdessemed R, Ghouili J, Srairi KA. A Lossminimization D.T.C. scheme for EV induction motors. IEEE Trans Veh Technol 2007;56(1):81–8. [28] Zaky M.S, Metwaly MK. A Performance Investigation of a Four-Switch Three-Phase Inverter-Fed IM Drives at Low Speeds Using Fuzzy Logic and PI Controllers. IEEE Trans Power Electronics 2016;32(5):3741-53. [29] Kaleg S, Hapid A , Kurnia MR. Electric Vehicle Conversion based on Distance, Speed and Cost Requirements. In: 2nd International Conference Sustainable Energy Engineering and Application, Energy Procedia 2015;68:446 – 54. [30] Han W, Lee TY, Kim YJ, Jung SY. Jung. Comparative Analysis on Efficiency of Brushless DC Motor Considering Harmonic Component of Phase Current and Iron Loss. In 18th International Conf on Electrical Machines and System (ICEMS): Pttaya Thailand;2015. [31] Parhizkar, N., Shafiei, M., & Kouhshahi, M. B. (2011, August). Direct torque control of brushless DC motor drives with reduced starting current using fuzzy logic controller. In Uncertainty Reasoning and Knowledge Engineering (URKE), 2011 International Conference on (Vol. 1, pp. 129-132). IEEE. [32] Lee BK. Modern Power Electronics and Ac Drives. Prentice in hall 2001. [33] Krishna SM, Daya JLF. MRAS Speed Estimator with Fuzzy and PI Stator Resistance Adaptation for Sensorless Induction Motor Drives Using RT- lab. Perspectives in Science 2016; 8: 121-6. [34] Bagherpoor, H.M., Salmasi, F.R.: ‘Robust model reference adaptive output feedback tracking for uncertain linear systems with actuator fault based on reinforced dead-zone modification’, ISA Trans., 2015, 57, pp. 51–56 [35] Rehman WU, Wang S, Wang X, Shi C, Zhang C, Tomovic M. Adaptive Control for Motion Synchronization of HA/EHA System by Using Modified MIT Rule. In 11th IEEE Conference Industrial Electronics and Applications;2016. 20
3cs.SY
arXiv:1710.01288v1 [cs.CV] 3 Oct 2017 Decoding visemes: improving machine lip-reading (PhD thesis) Helen L. Bear University of East Anglia School of Computing Sciences July 2016 ©This copy of the thesis has been supplied on condition that anyone who consults it is understood to recognise that its copyright rests with the author and that no quotation from the thesis, nor any information derived therefrom, may be published without the author’s prior written consent. Abstract This thesis is about improving machine lip-reading, that is, the classification of speech from only visual cues of a speaker. Machine lip-reading is a niche research problem in both areas of speech processing and computer vision. Current challenges for machine lip-reading fall into two groups: the content of the video, such as the rate at which a person is speaking or; the parameters of the video recording for example, the video resolution. We begin our work with a literature review to understand the restrictions current technology limits machine lip-reading recognition and conduct an experiment into resolution affects. We show that high definition video is not needed to successfully lipread with a computer. The term “viseme” is used in machine lip-reading to represent a visual cue or gesture which corresponds to a subgroup of phonemes where the phonemes are indistinguishable in the visual speech signal. Whilst a viseme is yet to be formally defined, we use the common working definition ‘a viseme is a group of phonemes with identical appearance on the lips’. A phoneme is the smallest acoustic unit a human can utter. Because there are more phonemes per viseme, mapping between the units creates a many-to-one relationship. Many mappings have been presented, and we conduct an experiment to determine which mapping produces the most accurate classification. Our results show Lee’s [82] is best. Lee’s classification also outperforms machine lip-reading systems which use the popular Fisher [48] phoneme-to-viseme map. Further to this, we propose three methods of deriving speaker-dependent phoneme-to-viseme maps and compare our new approaches to Lee’s. Our results show the sensitivity of phoneme clustering and we use our new knowledge i ii for our first suggested augmentation to the conventional lip-reading system. Speaker independence in machine lip-reading classification is another unsolved obstacle. It has been observed, in the visual domain, that classifiers need training on the test subject to achieve the best classification. Thus machine lip-reading is highly dependent upon the speaker. Speaker independence is the opposite of this, or in other words, is the classification of a speaker not present in the classifier’s training data. We investigate the dependence of phoneme-to-viseme maps between speakers. Our results show there is not a high variability of visual cues, but there is high variability in trajectory between visual cues of an individual speaker with the same ground truth. This implies a dependency upon the number of visemes within each set for each individual. Finally, we investigate how many visemes is the optimum number within a set. We show the phoneme-to-viseme maps in literature rarely have enough visemes and the optimal number, which varies by speaker, ranges from 11 to 35. The last difficulty we address is decoding from visemes back to phonemes and into words. Traditionally this is completed using a language model. The language model unit is either: the same as the classifier, e.g. visemes or phonemes; or the language model unit is words. In a novel approach we use these optimum range viseme sets within hierarchical training of phoneme labelled classifiers. This new method of classifier training demonstrates significant increase in classification with a word language network. Contents 1 Introduction 1 1.1 Applications of machine lip-reading . . . . . . . . . . . . . . . . 1 1.2 The research problem . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Features and classification methods 8 2.1 Linear predictors . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 Active shape and appearance models . . . . . . . . . . . . . . . 9 2.3 Discrete cosine transforms . . . . . . . . . . . . . . . . . . . . . 11 2.4 Comparison of available feature types . . . . . . . . . . . . . . . 11 2.5 Hidden Markov models . . . . . . . . . . . . . . . . . . . . . . . 13 2.5.1 HTK: an HMM toolkit . . . . . . . . . . . . . . . . . . . 14 3 Datasets 16 3.1 Pronunciation dictionaries . . . . . . . . . . . . . . . . . . . . . 17 3.2 AVLetters2 - an isolated word dataset . . . . . . . . . . . . . . . 17 3.3 Rosetta Raven - a stylised continuous speech dataset . . . . . . 19 3.4 RMAV - a context-independent continuous speech dataset . . . 20 4 Current difficulties in machine lip-reading 25 4.1 Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.2 Pose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3 Multiple people . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.4 Video conditions . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.5 Speech methods and rates . . . . . . . . . . . . . . . . . . . . . 28 4.6 Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5 Resolution limits in lip-reading 30 5.1 Image pre-processing for feature modification . . . . . . . . . . . 30 5.2 Classification method . . . . . . . . . . . . . . . . . . . . . . . . 34 iii CONTENTS iv 5.3 Analysis of resolution affects on classification . . . . . . . . . . . 36 5.4 The effect of resolution on lip-reading classifiers . . . . . . . . . 42 6 A performance evaluation of visemes 44 6.1 Measuring the contribution of individual visemes . . . . . . . . 45 6.2 Analysis of viseme contribution . . . . . . . . . . . . . . . . . . 45 6.3 Viseme contribution observations . . . . . . . . . . . . . . . . . 50 7 Bear speaker-dependent visemes 52 7.1 Current viseme studies . . . . . . . . . . . . . . . . . . . . . . . 52 7.2 Data preparation . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.3 Classification method . . . . . . . . . . . . . . . . . . . . . . . . 58 7.4 Comparison of current phoneme to viseme maps . . . . . . . . . 58 7.5 New phoneme to viseme maps . . . . . . . . . . . . . . . . . . . 63 7.5.1 Common phoneme-pair visemes . . . . . . . . . . . . . . 65 7.5.2 Viseme classes with strictly confusable phonemes . . . . 66 7.5.3 Viseme classes with relaxed confusions between phonemes 70 7.6 Bear speaker-dependent visemes . . . . . . . . . . . . . . . . . . 71 7.7 Improving lip-reading with speaker-dependent phoneme-to-viseme maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 8 Speaker-independence in phoneme-to-viseme maps 80 8.1 Speaker independence . . . . . . . . . . . . . . . . . . . . . . . 80 8.2 Method overview . . . . . . . . . . . . . . . . . . . . . . . . . . 81 8.3 Experiment design . . . . . . . . . . . . . . . . . . . . . . . . . 82 8.3.1 Baseline: Same Speaker-Dependent (SSD) maps . . . . . 82 8.3.2 Different Speaker-Dependent maps & Data (DSD&D) . . 83 8.3.3 Different Speaker-Dependent maps (DSD) . . . . . . . . 83 8.3.4 Multi-Speaker maps (MS) . . . . . . . . . . . . . . . . . 85 8.3.5 Speaker-Independent maps (SI) . . . . . . . . . . . . . . 86 8.4 The homophone risk factor . . . . . . . . . . . . . . . . . . . . . 88 8.5 Measuring similarity between phoneme-to-viseme maps . . . . . 88 8.6 Analysis of speaker independence in phoneme-to-viseme maps . 95 8.7 Speaker independence between sets of visemes . . . . . . . . . . 106 9 Finding phonemes 9.1 108 Step One: phoneme classification . . . . . . . . . . . . . . . . . 109 CONTENTS v 9.2 Step Two: phoneme clustering . . . . . . . . . . . . . . . . . . . 109 9.3 Step Three: viseme classification . . . . . . . . . . . . . . . . . . 110 9.4 Searching for an optimum . . . . . . . . . . . . . . . . . . . . . 111 9.5 Hierarchical training for weak-learned visemes . . . . . . . . . . 120 9.6 Classifier training adaptation . . . . . . . . . . . . . . . . . . . 122 9.6.1 Language network units . . . . . . . . . . . . . . . . . . 123 9.6.2 Linguistic content . . . . . . . . . . . . . . . . . . . . . . 123 9.7 Effects of weak learning in viseme classifier training . . . . . . . 125 9.8 Decoding visemes . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10 Summary of research outputs 135 10.1 Conclusions of research . . . . . . . . . . . . . . . . . . . . . . . 135 10.2 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Bibliography 137 11 Phonetic notation 151 Acknowledgements This is my opportunity to say thank you to some extraordinary people without whom I really couldn’t have completed my PhD. My heartfelt thanks go to each and every one of you for so much more than I am capable of conveying in words. Professor Richard Harvey (aka PhD supervisor extraordinare), you are my dream supervisor and friend. Your intelligence, patience, support and humour have been invaluable and I have loved working with you this past four years. To the rest of my supervisory team: Dr Barry-John Theobald, Dr Yuxuan Lan, Professor Stephen Cox, and Dr Anthony Bagnall, you are amazing. Thank you all for your patient education, support and guidance. I am also grateful for my examiners Professor Andy Day and Dr Naomi Harte for assessing my viva performance. To my lab colleagues Mr Thomas Le Cornu and Mr Danny Websdale - you guys are the best lab buddies I could ever have dreamed of. Thank you for making coming in to work every day so good. Finally, thank you to my family, Barbara (aka Mum), Jeremy (aka Dad), Philip, Michelle, and Amelia, who know barely anything about what I’ve been doing for the past four years and understand it even less, but have supported me throughout this crazy endeavour, #proudtobeabear vi Chapter 1 Introduction Speech is bimodal. This means there are two modes of information: acoustic and visual. Humans use both signals to understand the speech of others [101]. Given that acoustic recognition has been studied for over fifty years [38], it is not surprising that acoustic recognition is far more mature than visual-only recognition and there have been significant increases in performance in speech recognition systems, although they remain susceptible to noise [51]. Imagine trying to recognise a pilot’s speech over the background noise of the aeroplane engine in a cockpit. In this case, the audio signal is severely deteriorated by the noise of the environment. However, this noise does not affect the visual signal. Thus, a desire to recognise speech from the visual signal alone is born. The visual signal can be used in combination with the acoustic signal, this is audio-visual speech recognition (AVSR) [120], or, there is the possibility of using the visual signal alone. This latter configuration is machine lip-reading which is the topic of this thesis. Lip-reading is a challenging task. When researchers investigate AVSR, it is common for audio recognition to dominate any benefit from lip-reading, nevertheless, if we can make pure lip-reading successful there would be benefits for audio-visual recognition. Furthermore, there are a few scenarios where it is impractical or senseless to install a close microphone. An example might be an interactive booth in a busy station or airport where there is poor signalto-noise ratio (SNR) or some distance between the person and the screen. In practice however, a major use of a good machine lip-reading system would be as part of an AVSR system. 1.1 Applications of machine lip-reading There are a range of scenarios where a machine lip-reading system would be beneficial. We discuss a few examples here. During sports events there are often headlines about arguments between players, referees and even supporters. In the 2006 football World Cup Final between France and Italy, it was 19 minutes into extra time when Zinedine 1 CHAPTER 1. INTRODUCTION 2 Zidane, on the opposite end of the pitch to the football, head-butted an Italian player without apparent justification. This action earned him a red card and consequently France went on to lose both the match and the world cup [103]. It later transpired, as admitted by Materazzi (the recipient of the head-butt), Zidane was provoked by a targeted insult of a late family member. In this case, if a machine lip-reading system had been present to confirm the provocation, whilst Zidane would have still been red carded, so would have Materazzi. Thus playing ten men against ten, the outcome of the match, and the World Cup, could have been different. In history there are a great number of silent videos. Common examples are silent entertainment films and historical documentaries. In [136] we see a professional human lip-reader assist researchers comprehend what soldier’s conversations were before they went into battle and during battle preparations. Similarly, in [3] we are shown how lip-readers used on the home movies of Hitler give historians an insight to an infamous figure of interest. There has been long debate about if, in silent entertainment films of the era 1895-1927, films were ever scripted as the audio could not be captured with the video channel. In [6] we learn that, not only were these films in fact fully scripted, but in human lip-reading experiments, variation from the scripts were fully noticeable. Collectively, this human nature to be interested in history and learn from historical evidence is a further motivator for achieving robust automatic lip-reading systems. Theobald et al. [137] examine lip-reading for law enforcement. They note that in law-enforcement there are many departments who would benefit from an automatic lip-reading system. They present a new technique for improved lip-reading whereby the extracted features are modified to increase the classification performance. The modification is amplifying the feature parameters (they use Active Appearance Models which we explain fully in Chapter 2), to exaggerate the lip gestures recorded on camera. The technique was tested using a phonetically balanced corpus of syntactically correct sentences. The data set had very little contextual information [138] to remove effects of context network support. Machine lip-reading would help in law enforcement as robust lip-reading of filmed conversations during criminal acts, e.g. on CCTV could be evidence for the prosecution of offenders. In the murder case of Arelene Fraser, Nat Fraser was caught and imprisoned. Evidence used by the prosecution included transcripts provided by professional lip-reader Jessica Rees [115]. Whilst the perpetrator thought he had committed the ‘perfect’ murder, and took steps to avoid any conversations being overheard, he had not thought about those who could read lips. With the transcripts of Fraser’s conversations, prosecutors turned the co-conspirators into witnesses and Nat Fraser was prosecuted. However later, the reliability of lip-reading transcripts as evidence was successfully challenged, because human lip-readers are unreliable. The reliability of human lip-readers is debatable. It has been said that this reliability varies not just between different pairings of speakers within a CHAPTER 1. INTRODUCTION 3 conversation, but also subject to the situation (context and environment) of the conversation (with the same speakers) [86]. This means that a good lip-reader on one day with a particular speaker could either misinterpret an alternative speaker or if lip-reading the same person in another place, fail to comprehend the speech uttered. Furthermore, human lip-readers are expensive, examples of Consuelo Gonsales [52] and Jessica Rees [122] operate on an as quoted basis. So we know that robust lip-readers are rare [86] and often we have no way of verifying the accuracy of the lip-reading performance as a ground truth is rarely available. It is only in controlled experiments that a ground truth exists [20, 132, 63]. In [86] an investigation into the effect of likeability between individuals in a lip-read conversation, such as the status of their relationship, showed that a good relationship increases the accuracy of the lip-reading interpretation. To apply this observation to a real world scenario of introducing a lip-reader to someone they do not know personally, such as on a video documentary, deteriorates the confidence that their lip-reading ability will be robust. This idea is supported in Nichie’s lip-reading and practice handbook [109] where in Chapter two it is suggested that the value of practicing lip-reading is rightly attached to the teacher’s personality for success. In [133] Summerfield describes some reasons which can distinguish poor from good lip-readers. This list is deduced from the results of a series of experiments ([61, 40, 92, 91, 148]) which show that the achievement rates in lip-reading tests can range from 10% to over 70%. These achievement rates vary due to the parameter selections for each experiment which are chosen for the specific task being addressed. In particular, the accuracy metric (some present word error rate, w.e.r whereas others present percent true positive matches, %, others alternative metrics like the HTK correctness and accuracy scores (explained in full in section 2.5.1, Equations 2.7 & 2.8 respectively) and the classification unit (there are a number of options here - matching on phonemes, visemes or words) have a significant affect on how one should compare such investigations. Some affects on human lip-reading performance are: • intelligence and verbal reasoning - McGrath [100] showed that a fundamental level of intelligence and verbal reasoning are essential to be able to lip-read at all, but beyond a limit these skills could not raise human comprehension further. • Training - human lip-readers who have either self-studied or have been trained in some manner to practice the skill of lip-reading are shown to be no better than those who have received no training [31, 40]. Also it has been shown that human lip-readers can actually get worse with training [21], and this effect is more present when humans lip read from videos rather than in the presence of the speaker [76]. • Low-level visual-neural processing - Summerfield [133] discusses the physiological matter of the processing speed of these neural processes in the CHAPTER 1. INTRODUCTION 4 human brain. The suggestion is that lip-reading is difficult to learn because it is dependent upon these low-level neural processes. This suggestion has however, not received reproducible results to support the proposition which comforts us that human lip-reading is possible, however challenging. • Closeness between the conversation participants - studies show that a relationship of some description between those talking, or personable knowledge of the speaker by the interpreter can improve human lipreading [86, 123, 46]. • Knowledge of conversation context - without the constraint that is the ‘rules’ of a language to limit what a probable utterance is, lip-reading becomes almost impossible, or akin to guessing [126]. In [125] experiments showed that recognising isolated sentences was as low scoring as simply guessing from the context alone. In summary, the main application of a machine lip-reading system would be any situation where the audio signal in a video is either absent or too noisy to comprehend, or where the alternative, human lip-readers, are too expensive or too unreliable. 1.2 The research problem A conventional lip-reading system consists of a sequence of tasks as shown in Figure 1.1. Our work focuses on the classification task. Currently we have to make some assumptions by tracking a face in a video in order to extract some features before we can undertake machine lip-reading. Figure 1.1: The three main functions in a traditional lip-reading system The first task on the left hand side of Figure 1.1, is face tracking. This means to locate a face in an image (one frame of a video) and track it throughout the whole video sequence. By the end of the tracking process, often completed by fitting a model to each frame, we have a data structure containing information about the face through time. Examples of work showing face finding and tracking are in [128] and [139]. Example tracking methods are, with Active Appearance Models [33], or with Linear Predictors [112]. We discuss these two methods in Chapter 2. The second task, in the centre of Figure 1.1, is visual feature extraction. Using the fitted data parameters from task one, we can extract features which contain solely information pertaining to the speaker’s lips. The third and final task on the right hand side of Figure 1.1 is CHAPTER 1. INTRODUCTION 5 classification. This is where we train some kind of classification model, using some visual features as training data, and use the classifiers to classify some unseen test data. Classification produces an output which can be compared with a ground truth to evaluate the accuracy of the classifiers. There is a lot of literature on methods of feature extraction methods [111, 9, 65, 149, 119, 90] and tracking faces through images, [33, 146, 102, 83, 36] for lip-reading. However, to date, there is no one accepted method as the de facto method for extracting lip-reading features. In lieu of this, in [155], Zhou et al. ask two questions about feature extraction, specifically for lip reading: primarily, how to cope with the speaker identity dependency in visual data? But also, how to incorporate the temporal information of visual speech? The intent of this second question is for capturing co-articulation effects into features. Zhou et al. categorise a comprehensive range of feature extraction techniques into four groups: Image-based e.g. [53], Motion-based e.g. [93], Geometric-feature-based e.g. [107], or, Model-based e.g. [45]. This categorisation serves to show the breadth of current research into features. However, this attention on feature extraction does not address the only challenges in machine lip-reading. Improvements can still be made in the classification stage of lip-reading also. Therefore much of this thesis is focused on classification, rather than additional tasks such as tracking and feature extraction. That is not to say we are dismissive of the feature extraction and tracking requirements, rather that we wish focus our work to improve the classification methods. Figure 1.2: Sources of variability in computer lip-reading: affects on automatic lip-reading systems Figure 1.2 shows the situation in which we are trying to recreate the text in the mind of the speaker. Each speaker articulates differently, and so the identity of the individual speaker is a significant affect on the efficacy of lipreading. The visual signal is also affected by the speaker’s pose, motion and expression. Cameras typically have many parameters that might affect lipreading. Of these, we mention frame rate and resolution as highly probable to be significant. CHAPTER 1. INTRODUCTION 6 Table 1.1: A list of affects on automatic lip-reading systems Evaluation Motion Pose Expression Frame rate Resolution Colour Classifier unit choice Feature type Classifier technology Multiple persons Speaker identity Rate of speech Previously studied, in Yes, [111, 97] Yes, [78] Yes, [106] Yes, [22, 124] No Yes, [71] Yes, [28] Yes, [98, 77] Yes, [96, 151] Yes, [68] Yes, [89] Yes, [134] Likely sensitivity Low Medium Low Low Unknown Low High High Medium Medium High High In Table 1.1 we have listed and assessed a number of environmental affects on machine lip-reading. There are a number of factors that can be difficult to control in machine lip-reading. These include, but are not limited to, lighting, identity, motion, emotion, and expression. Table 1.1 is an attempt at a systematic study of the affects. Considering initially the problem of speakerdependent lip-reading, then three factors are of immediate interest: resolution because it does not appear to have been studied systematically, and unit choice, and feature type because they are likely to be highly significant to performance. For the time-being, speaker identity and rate of speech can be ignored since they are constant for a given speaker. The choice of feature has been studied quite well and there have been a number of ‘contests’ between feature types (e.g. [77, 28]) which have led to the conclusion that state of the art Active Appearance Models (AAMs) are highly likely to give the best known performance. These are the features we use and the subject of the next chapter. However the choice of visual unit, the analogous quantity to a phoneme is more intriguing. A phoneme is the smallest sound which can be uttered [5]. A viseme is not so precisely defined [30, 48, 58]. However, a working definition is that a viseme is a set of phonemes that have identical appearance on the lips. Therefore many phonemes fall into one viseme class: a many-to-one mapping. There are alternative definitions of visemes in which the viseme is, for example, seen as a repeatable, visual gesture. In [27] two alternative definitions are explored: visemes based upon articulatory gestures or on similar visual appearance. The tentative conclusion is that visemes based upon the articulatory gestures definition perform better. This study only looks at recognition, in synthesis studies, visemes are considered as ‘temporal units that describe distinctive speech movements of the visual speech articulators’ [135]. As there are many definitions to choose from, we continue with the recognition working definition of ‘a viseme is a group of phonemes with identical appearance on the lips’. Thus, our study starts with two key problems: resolution which has CHAPTER 1. INTRODUCTION 7 not been systematically studied before in isolation from observing the effects of noise, and unit selection because it is likely to be highly significant. But, before we can study these items, it is necessary to discuss the third affect to which classification is highly sensitive: feature selection. Thus, our research question is; ‘can we augment or replace the current lip-reading classifiers to improve machine lip-reading?’ Chapter 2 Features and classification methods In the previous chapter it was asserted that feature choice was likely to be highly significant. In this chapter therefore, we examine the full processing chain in more detail from tracking to classification, dwelling on the methods of special relevance to this thesis. 2.1 Linear predictors Linear Predictors (LPs) are a person-specific and data-driven facial tracking method. Devised primarily for observing visual changes in the face during speech, these make it possible to cope with facial feature configurations not present in the training data by treating each feature independently. For speech, this means isolating the lips from the eyes, outline of the face, etc. The linear predictor itself is a part of the tracking mechanism. It is the central point around which support pixels are used to identify the change in position of the central point over time. The central point is visually seen as a landmark on the outline of a feature. A set of these landmarks represent the changing shape of something (in our case lips) morphing over time. In this method both the shape (comprised of landmarks) and the pixel information surrounding the linear predictor position are intrinsically linked. A single LP alone is not enough to provide robust and accurate tracking, so [111] explains how rigid flocks (a small group) of selected LPs are grouped around a central feature (not the linear predictor central point, but as an example, the feature mean position) restrict the motion of the LPs within a boundary and reduce their susceptibility to noise. These LPs have been successfully used to track objects in motion [95]. Further improvements to the LPs selection method are described in [111, 112], both of which show improvement of over original LP tracking accuracy. An interactive LP tracking tool has been made at the University of Surrey. Its benefits are the real-time tracking and autonomous use, but a limitation of 8 CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 9 this tool is when a face is partially off-screen, the real-time tracking requires the user to guess in real time where the appropriate LP should be. This is not a simple task to perform with any accuracy or consistency and when tested with our Rosetta Raven dataset (see Chapter 3) we found the AAM features still outperformed the LP features. 2.2 Active shape and appearance models An Active Appearance model (AAM) [33] is a combined shape and appearance trained model used in tracking a face throughout a video sequence. The model is constructed from a small training subset (Table 3.3) and is a type of Point Distribution Model (PDM) used to represent the shape of a face and how it varies during speech. The shape s of an AAM is the coordinates of the v vertices which make up a mesh, s = (x1 , y1 , x2 , y2 , ..., xv , yv )T (2.1) Training creates a mean model permitting deviations within a predetermined range of variance. Any of the training co-ordinate vectors used for model creation with 30% or more of occluded landmarks are omitted from the mean shape formation. Normalised meshes are built from the manually trained data (landmarks) for translation, scale and rotation (i.e. movement between the image frames).We now have a vector of 2n values for n landmarks upon the face. Principal Component Analysis (PCA) provides us with eigenvectors so an independent shape model becomes a set of meshes, s = s0 + n X p i si (2.2) i=1 where s0 is the mean shape, pi are coefficient shape parameters, and si are the eigenvectors of the covariance matrix of the n largest eigenvalues. We can assume si is orthonormal because we can always perform a linear reparameterisation [97]. The landmarks are chosen to model the sub-shapes within the face such as: the outline of the hairline and jaw, eyes, nose or lips. We have to hand label these training images. The meshes constructed with our hand labelling are normalised by Procrustes analysis [54] before we apply PCA. An example of a full face shape model is shown in Figure 2.1. In this Figure there are 104 landmarks, the majority (44) of which are modelling the inner and outer lip contours. An independent appearance AAM uses appearance data over the base mesh, S0 . This allows linear variation in the shape whilst maintaining a compact model. S0 also denotes the set of pixels that lie inside the base mesh. Thus A(x) (or AMM appearance) is an image defined over the pixels x ∈ S0 . This means pixels are mapped into the triangles of the shape model by Procrustes analysis [54] over the shape model vector (the aligned the set of points) to CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 10 Figure 2.1: Example Active Appearance Model shape mesh. build the statistical model. Each training image is warped to match the mean shape to identify a shape-free area of the training image. This shape-free area is normalised with a linear transform before the texture model is built by eigen-analysis [33]. A(x) = A0 (x) + m X λi Ai (x) ∀x ∈ s0 (2.3) i=1 In Equation 2.3 the coefficients λi are the appearance parameters, A0 is the base appearance, and Ai (x) are the appearance image eigenvectors of the covariance matrix. Our appearance A(x) is A0 plus a combination of images Ai (x). A0 is the mean image, and Ai are the m eigenimages with the m largest eigenvalues. It has been demonstrated that the combination of appearance and shape models significantly improves lip-reading performance [96, 33] and we use these in the work presented here unless explicitly stated otherwise. The combination of these model types requires a single parameter set to represent the relationship between shape and appearance. In independent shape and appearance AAMs [97], the shape parameters, p, and appearance parameters λ, are distinct. In a combined model, we use one set of parameters, C = (c1 , c2 , c3 , ..., cn )T . This is shown in Equation 2.4 and Equation 2.5. This usage of a common parameter set, ci , intrinsically ties the models together by warping the image over the shape model to represent both the appearance and shape variation in a face. For shape s = s0 + n X ci s i (2.4) i=1 and for appearance A(x) = A0 (x) + n X ci Ai (x) (2.5) i=1 A combined AAM requires a third application of PCA on the weighted shape, p and appearance, λ parameters. The correlation between the shape and texture (appearance) model is learned and integrated into the combined CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 11 model. To initialise the AAM we use the shape parameters p = (p1 , p2 , ..., pn )T in Equation 2.1 to generate the shape s, and the appearance parameters λ = (λ1 , λ2 , ..., λm )T to generate the appearance A(x) in s0 . This AAM instance is built by a piecewise affine warp of A from the base mesh s0 to the AAM shape s. Finally we fit the AAM using the Inverse Compositional algorithm [7] to all frames in the video sequence [97]. This algorithm uses the coordinate frame of the image I and the coordinate frame of the AAM. To initiate the fit with the best starting position, the first image frame in a video sequence receives a manually labelled shape, s. Iterating through each frame of the video in turn, a backwards warp W is used to warp each image I onto the base mesh s0 until the landmark positions converge into place to match corresponding pixels between frames. The more movement there is between frames, or the lower the frame rate, tracking is more difficult as these create greater variation between frame images. 2.3 Discrete cosine transforms The Discrete Cosine Transform (DCT) [1] is a technique for converting a signal into elementary frequency components, or in other words, it transforms an image from a spatial to frequency domain by separating an image into parts of unequal importance. There are many variants of DCT and in lip-reading and AVSR authors use 2D-DCT (Equation 2.6) as it is applied too each twodimensional frame image throughout a video. For example in [79, 28] and [104]. To create 2D-DCT features co-efficient vectors are extracted from the information from the region of interest in an image, for machine lip-reading, this is the lips. N −1 M −1 X X     vπ(2j + 1) uπ(2i + 1) cos qu,v = Wu Wv pi,j cos 2N 2M i=0 j=0  p  p 1/N if u = 0 1 p p /M if v = 0 Wu = W = v 2/N otherwise 2/M otherwise (2.6) In Equation 2.6 we show that 2D-DCT is pixel-based, features are extracted from a region of interest matrix of size M by N , where P is the mouth centre. pij is pixel intensity in row i and column j. This creates quv . 2.4 Comparison of available feature types Lan et al. present in [79] a comparison of different features first presented in [33]. Revisited in [97], AAM features are produced as either model-based (using shape information) or pixel-based (using appearance information). In CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 12 [79] Lan et al. observed that state of the art AAM features with appearance parameters outperform other feature types like sieve features, 2D DCT, and eigen-lip features, suggesting appearance is more informative than shape. Also pixel methods benefit from image normalisation to remove shape and affine variation from region of interest (in this example, the mouth and lips). The method in [79] classified words with the RMAV dataset but recommended in future creating classifiers with viseme labels for lipreading, and advises that most information is from the inner of the mouth. A comparison of two current key methods for fitting and extraction of facial features for computer lip-reading is summarised in Table 2.1. Table 2.1: A summary of shape and appearance models and linear predictors. Linear Predictors (LP) Data driven. Unsupervised. Feature independent. Use only intensity information ie. grey scale images. Prior training shape models or temporal models for dynamics are not required or used. Can cope with feature configurations not present in training data. Multiple LPs are grouped into flocks for robustness. Shape Appearance Model (SAM) Face knowledge required from training for modelling. Supervised. Feature dependence improves tracking. The fitted model can be either solely shape model, an appearance model (pixel information) or a combined model of shape and appearance where each pixel is related to a triangular section of the shape model. An active appearance model is built from training data to fit new images. Training needs to encapsulate all variance in the video to be tracked. Primary landmarks are used for the important positions in training data. For the work presented in this thesis, we chose to use AAMs. This is because whilst DCT features can outperform geometric features (as shown in [60]), a state of the art AAM can outperform DCT features. In [108] the results suggest that DCT features outperform AAMs because they complete most experiments with them after initial AAMs performed poorly, (65.9% w.e.r for AAMs compared to 61.80% w.e.r with DCT features). However, the authors also note that their AAMs were not good ones and the reasons for this could be attributed to either; modeling or tracking errors. This is because insufficient training data can have two effects. First, that the AAM is not generalised enough from the training data to classify the test data, and secondly, an undertrained AAM will not fit well when tracking a face. It should be noted that in comparing DCT and AAM features, Neti et al. use different regions of interest for the feature types. For the DCT features, the ROI is the CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 13 mouth, compared to the whole face for the AAMs [108]. In the work presented in Chapters 5 to 9, particularly for continuous speech experiments with newer datasets, we have confidence that our AAMs are state of the art, have tracked well between all frames (this is confirmed by producing a jpg image of each frame with the AAM landmarks plotted on and the fit is manually checked) and is achieved by using a higher number of landmarks, we use 104 [14] rather than the 68 in [108]). 2.5 Hidden Markov models Hidden Markov Models (HMMs) have been used in speech classification for some time for acoustic, audio-visual and visual-only classification. Both channels of speech can be considered as a time series, i.e. they will produce data points in a causal manner. Other domains which have applied HMMs are sets of temporal data such as handwriting, DNA sequences and energy consumption. A HMM has two stochastic processes: the first process is based around state transition probabilities, and the second, is based upon state emission probabilities. A Markov model (also known as a Markov chain), is made of a number of states connected to all other states. Each connection has transition probabilities for moving between the states it is connected to. In a nth -order Markov chain, an inherent assumption is that state transitions are dependent upon the n previous states. In a Markov chain the stochastic process output is the sequence of states. Practically, in speech classification, a first order model is normally used. In a first order HMM the state transitions are dependent only on the current state. The probabilities of all possible actions (transitions) at time, t, are dependent upon the state the HMM is in at time t, not the value of t. The second stochastic process is concerned with emission probabilities. Each HMM state has an associated Probability Density Function (PDF). A PDF used on feature vectors determines the emission probabilities of any particular feature vector being output (emitted) by the state, when the HMM is in that state. Whereas in a Markov chain the output is the sequence of states, in an HMM the PDF means the output is a feature vector. Because the emission probabilities are a function of the state, the knowledge of the state is hidden from the observer [64]. In a network of HMMs, each HMM is labelled by its representative unit. In visual speech, these units are referred to as visemes, in acoustic speech phoneme labels are used. In some simple speech classification tasks, or with limited datasets, words may be used as the HMM unit label. Additional HMMs can also be built to model the silence at the start and end of utterances and the shorter silence pauses between words. In the work presented in this thesis, all HMMs are monophones. CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 2.5.1 14 HTK: an HMM toolkit HTK provides a set of tools which enable users to build speech processing tools, including recognisers and estimators. The main algorithm used in HMM estimation is the Baum-Welch algorithm [10], and the algorithm used in classification is the Viterbi algorithm [142]. The HTK book [150] details the background of HTK in full, up to its current version for full information of its implementation and use. The use of HTK is commonplace in acoustic speech classification [2, 120, 67, 98] and current lip-reading literature [78, 77, 68, 79, 63]. So using HTK for machine lip-reading allows very easy replication of our results. HTK has achieved ubiquity due to its generally high performance, so we can be confident that our results will be close to the best achievable performance when we adopt similar strategies as described in previous works. In HTK recognition. performance of the HMMs can be measured by both correctness, C, and accuracy, A, C= N −D−S , N (2.7) N −D−S−I (2.8) N where S is the number of substitution errors, D is the number of deletion errors, I is the number of insertion errors and N the total number of labels in the reference transcriptions [152]. A= We can explain these types of errors with an example. Suppose we have a ground truth utterance, “John wanted to visit the shop to buy groceries”. Our classifiers can produce different outputs. Possible output 1: “ John wanted visit the to groceries” has three words missing. ‘to’, ‘shop’, and ‘buy’. In this instance, these are deletion errors. In another possible output: “John wanted to visit visit the shop to buy groceries”, the word ‘visit’ is included twice. This is an insertion error. Finally, if we achieved a classifier output of “John wanted to shop the shop to buy groceries”. The word ‘shop’ has been identified where the word ‘visit’ should be. This is a substitution error. Common tools used for a classification task in HTK are: HCompV, HERest, HHed, HVite and HResults. HCompV - used to flat start each HMM subject to a prototype file determining number of states and mixtures. It does this based upon the data within the whole dataset so all states are equal. It uses a prototype HMM definition, some training data and initialises each new HMM where every local HMM mean is the same as the global mean across the whole set. Only the covariances are updated. HERest - is the Balm-Welsh re-estimation of each HMM using the training fold samples and a transcription using the HMM labels. HERest uses embedded training to simultaneously updated all HMMs within a systems using all training data available within a fold. This is particularly important for sys- CHAPTER 2. FEATURES AND CLASSIFICATION METHODS 15 tems where the HMM labels are sub word models as HERest ignores boundary information in transcripts of training samples. HHEd - permits the tying together of states within an HMM model to allow fast transitions between states and shorter Markov chains. This is particularly useful for similar or short models such as silence (at the start and end of utterances) and short pauses between words. HVite - is commonly used for both forced alignment of HMMs using the ground truth transcription, and also for the crucial classification task. Using the trained HMMs, HVite attempts to recognise test samples and produces a classification output. HResults - compares the classification output to the ground truth, HResults provides statistics about how accurate the HMM recognisers have been, primarily correctness (Equation 2.7) at both the unit and network level, and also includes model-level accuracy (Equation 2.8). Chapter 3 Datasets This chapter summarises the datasets used in the work presented throughout this thesis. Note that while this thesis is about machine lip-reading (visual speech recognition), audio-visual datasets are commonplace since researchers often wish to compare visual-only performance to audio and audio-visual performance for the purposes of audio-visual integration such as in [108]. A summary of the most common AVSR databases is presented in Table 3.1. The result values listed are those from the original presented papers referenced in column 1. The results vary based upon the specific experiments, content, classification units (e.g. words, visemes, or phonemes), and original intent of each dataset. Other databases are available, such as those in [85, 4, 129] but these are non-English (Mandarin, Arabic and French respectively) and therefore not considered here. Table 3.1: Common databases available for machine lip-reading research. Name AVLetters [96] AVLetters2 [35] AV-TIMIT [58] CUAVE [117] GRID [32] IBM LVCSR (ViaVoice) [99] OuluVS [154] RMAV (LILIR) [79] Rosetta Raven [14] TCD-TIMIT [56] Speakers 10 5 223 36 36 290 20 20 2 62 Content Alphabet letters High definition alphabet letters TIMIT sentences Digits Command sentences Continuous speech 10 everyday phrases Context dependent sentences E. A. Poe’s The Raven 98 sentences Results < 27% 80% >< 90% 35% p.e.r 87% Acc < 1.85% w.e.r 58% w.e.r 70% Acc 20% >< 60% 20% >< 60% > 55% Acc For the work presented in this thesis, the Rosetta Raven database was selected for the resolution robustness experiment in Chapter 5 because it is both continuous and structured speech. This means that there is a good quantity of data but also that the speech itself is constrained meaning that the task is simpler than that of say AV-TIMIT, this is better for a controlled experiment to measure the affects of a single parameter. Note that AusTalk, AV-TIMIT and IBM LVCSR are proprietary and thus not freely available. We have confidence that the larger (in regards to number of speakers) con16 CHAPTER 3. DATASETS 17 tinuous speech datasets have a good phoneme coverage and so, subject to the viseme mapping selected, will also have good viseme coverage, however the smaller datasets, including those with limited vocabularies, the quantity of visemes (and the consequential volume of training samples per viseme class) will be at risk of inter-class skew. Therefore preliminary experiments in later chapters were undertaken first with AVLetters2 for proof of concept and confirmation that hypotheses were sound, before repeating experiments with RMAV. RMAV has sentences selected from the resource management data [49] which ensures a good phoneme coverage in its content. RMAV was selected as extracted features were available which enabled focusing on the classification task rather than that of tracking and extracting features. 3.1 Pronunciation dictionaries To accommodate the breadth of possible pronunciations, a number of dictionaries are available for use in machine lip-reading. These dictionaries map words to phoneme sequences subject to the pronunciation habits of the speaker. Two are described here: firstly, CMU [29], has been used in conjunction with the Rosetta Raven data, and secondly, BEEP [130], is used in later chapters with AVLetters2 and RMAV. The Carnegie Mellon University North American Pronunciation Dictionary [29], known as CMU, uses 39 phonemes and also encodes whether vowels carry levels of lexical stress [62] of either 0-None, 1-Primary or 2-Secondary. Lexical stress is the relative emphasis placed upon certain syllables within a word. Including lexical stress representations, this dictionary has 57 phonemes. Containing over 125,000 words, it is based on the ARPAbet symbol set (which relates to the standard IPA symbol set) developed for speech recognition uses. This dictionary is used for American speakers speaking English i.e. American English. The Cambridge University British English Pronunciation dictionary, known as BEEP, [130] has 49 phonemes mapped to over 250,000 words allowing for duplicate pronunciations of the same word. For example, the word ‘read’ phonetically can be, ‘/r/ /eh/ /d/’ as in ‘I read my book last night’ or, ‘/r/ /I/ /d/’ as in ‘I like to read’. This dictionary is used for British speakers of English. 3.2 AVLetters2 - an isolated word dataset AVLetters 2 (AVL2) [35] is an HD version of the AVLetters dataset [98]. It is a single word dataset of four British English speakers (all male) each reciting the 26 letters of the alphabet seven times. We can not present the quantity of visemes in the data set at this stage as it is dependent upon the viseme set being used (see Section 7). The speakers in this dataset can be seen in Figure 3.1. AVL2 has 28 videos of between 1, 169 and 1, 499 frames between CHAPTER 3. DATASETS 18 47s and 58s in duration. As the dataset provides isolated words of single letters, it lends itself to controlled experiments without needing to address matters such as co-articulation. (a) Speaker 1 (b) Speaker 2 (c) Speaker 3 (d) Speaker 4 Figure 3.1: Example faces from the AVLetters2 videos (four speakers). There are 30 unique British English phonemes in AVL2, the occurrence frequency of these is shown in Figure 3.2. Therefore, the data set is missing 19 phonemes found in spoken British English. Count of Phoneme 80 60 40 20 0 ah ax ey b iy s d ea eh f jh ch ay k l m n ow oh ao p y uw aa r AVL2 Phonemes t v w z Figure 3.2: Occurrence frequency of phonemes in the AVLetters2 dataset. Table 3.2 describes the features extracted from the AVL2 videos. These features have been derived after tracking a full-face Active Appearance Model throughout the video before extracting features containing only the lip area. Therefore, they contain information representing only the speaker’s lips and none of the rest of the face. Speakers 2, 3 and 4 are similar in number of parameters contained in the features. The combined features are the concatenation of the shape and appearance features [97]. All features retain 95% variance of facial shape and appearance information. This dataset is used for comparing visemes, testing new speaker-dependent visemes (Chapter 7) and for evaluating the robustness of speaker-dependent phoneme-to-viseme maps in Chapter 8. CHAPTER 3. DATASETS 19 Table 3.2: The number of parameters in shape, appearance and combined shape & appearance AAM features for each speaker in the AVLetters2 dataset for each speaker. Features retain 95% variance of facial information. Speaker S1 S2 S3 S4 3.3 Shape 11 9 9 9 Appearance 27 19 17 17 Combined 38 28 25 25 Rosetta Raven - a stylised continuous speech dataset This dataset was recorded at UCLA in January 2012 by Dr Eamon Keogh and was formulated as an attempt to provide a standardised audio-visual machine learning problem [14]. It comprises four videos which consist of two North American untrained speakers (one male, one female, seen in Figure 3.3) each reciting E.A.Poe’s ‘The Raven’. The poem was published in 1845 and the linguistic content of the Raven make this an interesting dataset as the narrative uses a stylised language including internal rhyme and alliteration. The poem is described as being generally trochaic octameter [121]. Trochaic octameter is a rarely used meter in poetry. Within each line of a trochaic octametric poem, there are eight trochaic metrical feet. Each of these eight feet consist of two syllables, the first of the two is stressed, the latter unstressed giving rise to an ‘up and down’ effect to a professional recitation. This pairing of a stressed and an unstressed syllable (or poetic foot) is trochaic [18]. However, this does not appear to have been followed by the speakers in this dataset. (a) Speaker 1 (b) Speaker 2 Figure 3.3: Example faces from the Rosetta Raven videos (two speakers). CHAPTER 3. DATASETS 20 Table 3.3: Summary of video content in the Rosetta Raven dataset. Video Speaker1 Speaker1 Speaker2 Speaker2 v1 v2 v1 v2 AAM train frames 11 11 10 10 AAM fit frames 31,858 33,328 21,648 21,703 Duration 00:08:52 00:09:17 00:06:01 00:06:02 In linguistic terms the the videos have 56 phonemes present with minor variation on their occurrences in each video (Figure 3.4). It is noted some phonemes namely /O0/, /uw0/, /AU2/, /U2/, /ae0/, /eh0/, /ey2/, /A2/, /22/, /A0/ and /@U2/ have less than ten instances within the whole data set. These phonemes all have lexical stress shown by the numbers in their naming convention, this comes from the American English set of phonemes used in the CMU pronunciation dictionary. Again, we can not quantify the viseme counts in this dataset as it varies with the viseme set used in any particular experiment. For these data to be used in a machine lip-reading system, we need to extract features. The training images from each speaker video (Table 3.3) were used together to make a single AAM model for tracking the rest of the video. A full face AAM was used to track the face for a robust fitting, whereas a lip-only AAM was used to extract lip-only feature. These features retained 95% of the speakers face shape and appearance variance throughout the video and are used in the resolution work described in Chapter 5 and for assessing the contribution of individual visemes within a set in Chapter 6. Table 3.4: The number of parameters in shape, appearance, and combined shape and appearance AAM features for the Rosetta Raven dataset speakers. Features retain 95% variance of facial information. Speaker S1 S2 3.4 Shape 6 7 Appearance 14 14 Combined 20 21 RMAV - a context-independent continuous speech dataset Formerly known as LiLIR, the RMAV dataset consists of 20 British English speakers (we use 12, seven male and five female), 200 utterances per speaker of the Resource Management (RM) context independent sentences from [49] which totals around 1000 words each. It should be noted the sentences selected for the RMAV speakers are a significantly cut down version of the full RM dataset transcripts. They were selected by a phonetician to maintain as much coverage of all phonemes as possible. The original videos were recorded in high definition and in a full-frontal position. Individual speakers are tracked using CHAPTER 3. DATASETS 21 600 500 Phoneme count 400 300 275 220 200 183 158 153 148 119 109 100 100 75 59 53 44 26 24 8 2 2 40 24 2 2 8 4 3 1 /ch/ /ao0/ /uw1/ /uw0/ /aw2/ /aw1/ /uh2/ /ao2/ /ao1/ /uh1/ /ng/ /hh/ /ae1/ /ae0/ /eh0/ /er0/ /er1/ /ey2/ /iy1/ /iy0/ /th/ /aa2/ /aa1/ /dh/ /ih0/ /ih1/ /sh/ /ah2/ 0 230 201 Phonemes 594 600 539 525 500 438 404 400 383 327 300 238 193 195 185 200 178 133 120 146 Phoneme count 365 158 135 127 123 100 58 6 19 26 6 10 10 /ah2/ /ah0/ /ah1/ /jh/ /aa0/ /ow1/ /ow0/ /ow2/ /b/ /d/ /g/ /eh1/ /h/ /k/ /f/ /m/ /l/ /n/ /ey1/ /p/ /s/ /r/ /t/ /w/ /v/ /y/ /z/ /ay1/ 20 0 Phonemes Figure 3.4: Occurrence frequency of phonemes in the Rosetta Raven dataset. Active Appearance Models [97] and AAM features of concatenated shape and appearance information have been extracted. CHAPTER 3. DATASETS 22 7000 6906 6337 6000 Phoneme count 5000 4000 3000 3003 2876 2484 2420 2052 2000 1871 1590 668 489 487 342 /th/ /sh/ /ng/ /az/ /er/ /ax/ /ay/ /aw/ /ey/ /ih/ /ao/ /ea/ /ah/ /eh/ /ae/ /ch/ /ia/ /aa/ 19 100 46 /dh/ 450 /oy/ 495 /zh/ 649 /iy/ 0 1209 1158 1065 1000 Phonemes 7296 6930 7000 6000 5784 4265 3993 3960 4000 3435 2637 3000 2467 2325 2143 1846 2000 1756 1412 1384 1257 1195 967 928 641 1000 638 /uw/ /ua/ /z/ 139 /ow/ /uh/ /w/ /t/ /r/ /s/ /p/ /n/ /l/ /m/ /k/ /oh/ /g/ /d/ /f/ /jh/ /b/ /hh/ /y/ /v/ 267 0 Phonemes Figure 3.5: Occurrence frequency of phonemes in the RMAV dataset. Phoneme count 5000 CHAPTER 3. DATASETS 23 (a) Speaker 1 (b) Speaker 2 (c) Speaker 3 (c) Speaker 4 (d) Speaker 5 Speaker 6 (c) Speaker 7 (d) Speaker 8 Speaker 9 (c) Speaker 10 (d) Speaker 11 Speaker 12 Figure 3.6: Example faces from the RMAV videos (12 speakers). CHAPTER 3. DATASETS 24 Table 3.5: The number of parameters of shape, appearance, and combined shape and appearance AAM features for the RMAV dataset speakers. Features retain 95% variance of facial information. Speaker S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 Shape 13 13 13 13 13 13 13 13 13 13 14 13 Appearance 46 47 43 47 45 47 37 46 45 45 72 45 Combined 59 60 56 60 58 60 50 59 58 58 86 58 Chapter 4 Current difficulties in machine lip-reading In Chapter 1, we identified a number of factors, or affects, in machine lipreading which are often difficult to control such as lighting, pose, identity, motion, emotion, linguistic content and expression. We now address these challenges in turn. 4.1 Motion The ability to recognise lip gestures throughout a video is addressed in the tracking part of the lip-reading task. There are two systems most commonly used for tracking faces in videos for machine lip-reading. These systems are Active Appearance Models (which can be shape, appearance or shape and appearance models) [33] and Linear Predictors [112]. Both of these systems are effective, even on low quality videos, for tracking the motion of a face during speech. Chapter 2 has described these two systems in full. Both methods make some assumptions about motion within videos, LPs are locally affine whereas AAMs are globally affine. Therefore the only minor issue that remains is for non-affine transformations. 4.2 Pose There is literature about the effects of pose on computer lip-reading. Some look at expression recognition for Human Computer Interactions (HCI) [106] and present an improvement in expression recognition by computers and humans when the pose is rotated to 45◦ . Others by Kumar et al. and Kaucic et al. [74, 71], look at visual speech classification and suggest that the profile view gives a better classification. However, they also processed the visual features over a longer time period than the duration marked by the endpoints of each speech utterance to consider co-articulation within their tests and so can not isolate which of the longer time window or the pose improved classification. 25 CHAPTER 4. CURRENT DIFFICULTIES IN MACHINE LIP-READING26 When considering lip-reading, the study in [11] examines the effects of human sentence perception across three viewing angles in relation to the camera position: full-frontal view (0◦ ), angled view (45◦ ), and side view (90◦ ). The performance of a female adult with post-lingual hearing loss was measured for accuracy at each angle. This study used a single-subject, with alternating treatment design where three treatment angles were randomly presented in every session. The accuracy for each session was compared to determine the most effective viewing angle of the speaker. The results indicated that the side-view angle was most effective, as the percentage gain of improvement was greatest in combination with the consistent upward trend of the data points across treatment sessions. The performance of frontal-view and angled-view angles were also successful but not significantly more so than full-frontal. The results of this preliminary effort indicate the value of treatment for visual sentence perception at all three angles, including the non-traditionally targeted side view for human lip-reading. Preliminary studies into non-frontal pose affects in lip-reading can be found in [87] & [75]. In both a small vocabulary is used in order to simplify the recognition task for measuring the effects of features extracted from non-frontal camera positions. In [87] the classifiers were trained on frontal features and tested on non-frontal features and the results showed that the greater the offfrontal angle became, then the word error rate increased. However, the frontal view features provided inferior recognition to off-angle features in [75]. The key distinction between these studies is the visual noise of image backgrounds in the original videos. Most AVSR databases are recorded face frontal, an alternative idea of lipreading non-frontal camera angles with frontal-trained classifiers using a mapping from the recorded angle to the estimated actual angle of the speaker to the camera is presented in [116]. In this work, we see a new dataset recorded for the specifically for the mapping technique and the results support the observations in [87] & [75] but add the observation that with the larger off-camera angles, then a smaller feature vector of only the higher order features is preferable. These studies into the affect of pose on machine lip-reading are taken further by Lucey et al. [88] with a proprietary dataset. Here the authors undertake three activities with a small vocabulary (connected digit strings) on 38 speakers; comparing the frontal and profile view lip-reading performance (akin to the experiments in [87] & [75]), but they also take the challenge further by experimenting with concatenating both the frontal and profile view features into multi-view features, and attempting to lip-read using a single pose-invariant normalisation method. The results for task one support those seen in [87] whereby the frontal features outperformed the profile features. This is considered due to both datasets being recorded in controlled conditions with minimal noise. The results for the multi-view features in [88], marginally better than frontal, and significantly better than profile features. The w.e.r reduces from 38.88% for profile features, for 27.66% for frontal features and the best multi-view features achieved a 25.36% w.e.r. This was achieved by simply concatenating the CHAPTER 4. CURRENT DIFFICULTIES IN MACHINE LIP-READING27 two sets of features. This observation is important that it is important to not simply pick a pose for lip-reading, but rather, there are useful visual cues from all angles. Finally, in the third test, Lucey et al. develop a single pose-invariant model for lip-reading, regardless of the pose of the test data. They compare different pairings of features over the training/testing split. For example, using frontal features F , for training and testing with frontal features. Then using the same features F , to test profile features P and vice versa. A third training model using a 50/50 split of F and P is included in the experiment setup. Also adopted is the projection of each set of features, F and P into the alternative feature space for new features F 0 and P 0 for alternative testing data for the three training options, F , P , and [F50 , P50 ]. These tests showed best recognition where the training and test features matched. Where these didn’t match the w.e.r dramatically increased, for example for an (F ,F ) train/test pairing the w.e.r was 29.18%. The train/test pair of (F ,P ) achieves a w.e.r of 87.07%. However, the authors also show that this can be mitigated by the projection of the test profile data back into the frontal feature space where the train/test split (F ,P 0 ) recovers the w.e.r back down to 54.85%. This transformation principle is also used in [78] by Lan et al. who presented an view-independent lip-reading system. This investigation uses a continuous speech corpus compared to the small vocabulary dataset in [88]. This later study acknowledges a human lip-readers preference for a non-frontal view and suggests it could be attributed to lip protrusion. A different approach for the feature transform is presented, (a linear mapping between poses) but the development of a such system shows computer lip-reading can be independent of speaker pose. 4.3 Multiple people The challenge of machine lip-reading a video with more than one person, meaning to track their faces, has a number of solutions. [68] demonstrates multiple person tracking (albeit not lip-reading) and has also implemented this into a simple HCI system. Also, in [81] we see how a person can be re-identified between videos, either a second view of the same space at an alternate perspective or, as a person moves through a location. An example of a speaker identification method is detailed in [89], and [70, 84] detail lip-reading of multiple people, [70] recognises consonants, and [84] visual vowels. Whilst none of these papers have directly tested concurrent speech, it would be interesting to know what effect, if any, speakers talking in unison would cause upon current lip-reading systems. [37] presents an audio-visual system for HCI which automatically detects a talking person (both spatially and temporally) using video and audio data from a single microphone. Until visual-only classifiers have improved, a robust visual-only system for machine lip-reading still needs to be developed and the classifiers are a essential part of the system. CHAPTER 4. CURRENT DIFFICULTIES IN MACHINE LIP-READING28 4.4 Video conditions Studies such as [22] on the effect of low video frame-rate on human speech intelligibility during video communications, suggest that lower frame rates encourage humans to over-articulate to compensate for the reduced visual information available, akin to a visual Lombard effect. (N.B. this is only when the speakers are aware of the low quality parameters e.g. during a video conference.) Therefore, it should be asked: does a computer need more information (higher frame rate/resolution) to lip-read a speaker in a recorded video sequence? The study in [22] observes in face-to-face human interactions, articulation is relaxed. So one could ask, in the instance where a computer needs extra visual information throughout the recording, (think of the example where a face-to-face conversation is being recorded incognito), how much does this lack of visual information impact on the classification performance? That is, how far does the lack of video recording quality affect classification? Another study into frame rate in computer lip-reading, [124], tells us the greatest classification is achieved when the same frame rate is used for both training and testing data. This is perhaps unsurprising as it is shown that when both training and test data sets are at low frame rates, classification drops when the frame rate of the training data is lower than the test data. They show longer words are easier to classify. It would be interesting to see if this is the same for visemes. [124] also shows a dependency between frame rates and classification accuracy by speaker. When training and test data do not have the same, or very similar frame rates, it is recommended training data has a higher frame rate (for feature extraction) than the test (fit) data. It observes word classification rates vary in a non-linear fashion as the frame rate is reduced which is caused by the particular words being recognised. The duration of an utterance does not have an effect on the classification rate in this paper. 4.5 Speech methods and rates People have different speaking styles, accents and rates of speech. Some people talk fast, some slow, some talk out of the side of their mouth, others naturally over-articulate and others have facial hair which occludes the visibility of lip movement during speech. The rate of speech alters both an utterance duration and articulator positions. Therefore, both the sounds produced, but particularly, visible appearance are altered. In [134], the authors present an experiment which measures the effect of speech rate and shows the effect is significantly higher on visual speech than in acoustic. Because of this variable, some people undertake elocution classes for a myriad of reasons. Examples include call centre employees undertaking ‘accent neutralisation’ courses to make them more approachable for their target customers [34]. This is supported in [55] where they state “Speakers of nonprestige dialects in some countries take elocution courses, or respond to news- CHAPTER 4. CURRENT DIFFICULTIES IN MACHINE LIP-READING29 paper adverts which promise to ‘eliminate’ their ‘embarrassing’ accents, and second language learners fret that they’ll never sound like a native.”. 4.6 Resolution In this chapter we have reviewed the environmental affects of lip-reading classification. Whilst many can be controlled, and we have seen in the literature how some of the effects can be managed, we also note previously considered challenges such as, outdoor video, poor lighting, and agile motion can all be overcome [24]. In regards to studies about the affects of resolution, there is limited literature found at the time of writing which examines this. Some experiments touch on this area of interest with investigations into recognition from noisy images. An investigation into the effects of compression artefacts, visual noise (simulated with white noise), localisation errors in training is presented in [59], and in [143] the authors undertake two experiments, of which the first includes some attention to spatial resolution (the number of pixels). This inclusion of features from three different resolutions is interesting but the resolutions selected have differing aspect ratios and as such it is not a controlled method of resolution variation. Also, the effect of this spatial resolution is not measured or presented, rather it is included as a property of tests on frame rate and contrast. Neither of these papers consider the simple removal of information from a smaller image compared to a larger one. Therefore testing of this is necessary (see Chapter 5). Given that, up to this point, with a known speaker and reduced linguistic context, classification rates can be high, it is a fair bet the most sensitivity is to be found on the parameters associated with the left hand side of Figure 1.2 (identity, expression etc). Nevertheless, there has been surprisingly little attention paid to a systematic review of the cameras parameters. Therefore, in our first practical experiment we ask ‘what is the lowest resolution at which a machine can lip-read?’. Chapter 5 Resolution limits in lip-reading We have discussed how machine lip-reading depends on factors which can be difficult to control, such as: lighting [131], identity [35], motion [77] and pose [71, 78, 74, 11], rate of speech [134], and expression [106]. But some factors, such as video resolution, are controllable. So it is surprising there is not yet a specific, systematic and complete study of the effect of resolution on lipreading in non-noisy conditions. There is a tendency, without evidence, to assume a high resolution video will produce better classification results and so a study to measure the effect of resolution on classification is needed and this is undertaken in this chapter. 5.1 Image pre-processing for feature modification For this work we use the Rosetta Raven dataset as already described in Section 3.3. Before feature extraction however, we undertake some image preprocessing. All four videos in the dataset were converted into a set of images (one per frame in PNG format) with ffmpeg [140] using image2 encoding at full high-definition resolution (1440 × 1080). To build an initial Active Appearance Model for tracking each video, we select the first frame and nine or ten others randomly. These key frames are hand-labelled with a model of a face including: facial outline (jaw and hairline, in front of ears), eyebrows, eyes, nose and lips. To track the face, this preliminary AAM is then fitted, via Inverse Composition fitting [7, 97] to the unlabelled frames (Table 3.3 in Chapter 3 gives the numbers of frames for each video). In Figure 5.1 we show, for Speaker 1, the tracked full-face AAM mesh (one frame per phoneme), for the first sentence of The Raven “Once upon a midnight dreary” used in tracking the speaker face. At this stage full-face speaker dependent AAMs are tracked and fitted on all full resolution lossless PNG frame images as in Figure 5.2 (a) and (b) for both speakers in the Rosetta Raven dataset. The AAMs used for tracking are now decomposed into sub-models for the 30 CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 31 once /w/ /21/ /n/ /s/ /20/ /p/ /O0/ /n/ /m/ /I1/ /d/ /r/ /iy0/ upon a mid/20/ night /n/ /ay2/ /t/ /d/ /r/ /I1/ dreary Figure 5.1: Tracking a Rosetta Raven speaker saying ‘Once upon a midnight dreary’ with a full-face Active Appearance Model. CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 32 (a) S1 face AAM points (b) S2 face AAM points (c) S1 lips AAM points (d) S2 lips AAM points Figure 5.2: Active Appearance Model shape landmarks for two Rosetta Raven speakers. eyes, eyebrows, nose, face outline and lips. The purpose of this is to allow us to obtain a robust fit from the full face model but extract features of only the lip information for use during classification. Both speaker lips sub-model can be seen in Figure 5.2 (c) and (d). There are 24 landmarks in the outer lip contour and 20 in the inner lip contour. Next, the video frames used in the high-resolution tracking were down-sampled to each of the required resolutions (listed below) by nearest neighbour sampling (Figure 5.3(b)) and then upsampled via bilinear sampling (Figure 5.3(c)) to provide us with 18 sets of frames per original video. We use a different sampling method to upsample as this provided a more consistent visual degradation of information in the resulting images to show the reduction in resolution with minimum consistent processing artefacts compared to other sampling methods. These new frames are the same physical size as the original (1440 × 1080) recordings but contain less information due to the downsampling i.e. only the information available at a lower resolution version of the original. 1. 1440 × 1080 7. 144 × 108 13. 69 × 45 2. 960 × 720 8. 120 × 90 14. 55 × 42 3. 720 × 540 9. 90 × 67 15. 51 × 39 4. 360 × 270 10. 80 × 60 16. 48 × 36 5. 240 × 180 11. 72 × 54 17. 45 × 34 6. 180 × 135 12. 65 × 49 18. 42 × 32 We remind the reader that our point of interest in this study, is the affect low resolution has on the loss of lip-reading information, rather than the affect it would also have on the AAM tracking process. Some AAM trackers lose track quite easily at low resolutions or on lossy images and we do not wish to be overwhelmed with catastrophic errors caused by tracking issues or artefacts which can often be solved in other ways [113]. Accordingly, this is why we have fitted at the original full resolution before the refitting of the lips sub model for feature extraction. Consequently the shape features in this experiment CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 33 are unaffected by the downsampling process, whereas the appearance features vary. This will turn out to be a useful benchmark. (a) 1440 × 1080, Original resolution image for S1 & S2 (b) 60 × 45, S1 & S2 downsampled (c) 1440 × 1080, S1 & S2 restored Figure 5.3: Downsampling of frame images in PNG format: (a) Original captured images, (b) nearest neighbour down-sampled images and (c) and their bilinear sampled restored pictures without original high definition information. Our image processing method is specific to our research question, what are the limitations (if any) of resolution in achieving machine lip reading? We have minimised the effects of compression artefacts by using the most successful pair of algorithms for downsampling and upsampling respectively. By using a dataset recorded in laboratory controlled conditions we have no white noise or occlusions. There are of course other methods available to us, such as simply CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 34 filling the feature vectors with zeros to represent the loss of data, or not resizing the smaller images back to the original size. But the major advantage of our method is that it encourages good tracking with the AAM and with this good tracking, we can complete a direct A to B comparison of classification outputs from features derived from videos with varying resolution information. For Speaker 1 (S1), six shape and 14 appearance parameters and for Speaker 2 (S2), seven shape and 14 appearance parameters are retained. This number of parameters was chosen to retain 95% variance in facial information in the usual way [33], see Table 3.4 presented in Chapter 3. 5.2 Classification method Table 5.1: A phoneme-to-viseme mapping from combining Walden’s consonant visemes with Montgomery’s vowel visemes. vID v01 v02 v03 v04 v05 v06 v07 v08 v09 Phonemes /p/ /b/ /m/ /f/ /v/ /T/ /D/ /t/ /d/ /n/ /k/ /g/ /h/ /j/ /N/ /y/ /s/ /z/ /l/ /r/ /S/ /Z/ /tS/ /dZ/ /w/ vID v10 v11 v12 v13 Phonemes /i/ /I/ /eh/ /ae/ /ey/ /ay/ /A/ /O/ /2/ /U/ /3/ /ax/ v14 v15 v16 v17 v18 /u/ /uw/ /OI/ /iy/ /hh/ /AU/ /@U/ /sil/ /sp/ We listened to each recitation of the poem and produced a ground truth text (some recitations of the poem are not word-perfect to the original writing (see Appendix ??)). This word transcript is converted to an American English phoneme-level transcript using the CMU pronunciation dictionary [29] introduced in Chapter 3. Then, using the viseme mapping based upon Walden’s consonants [144] and Montgomery et al.’s [94] vowel phoneme-to-viseme mapping (as in Table 5.1), a viseme transcript was created. Thus we have translated each recitation from words, to phonemes, and finally, to visemes. Viseme classification is selected over phonemes as, on a small data set, it has the benefits of reducing the number of classifiers needed and increasing the training data available for each viseme classifier. Note not all visemes are equally represented in the data as is shown by the viseme histogram in Figure 5.4, Chapter 3. Whist the volumes in this Figure are lower than an equivalent histogram for a continuous speech dataset, the distributions are similar. For each speaker, a test fold is randomly selected as 42 of the 108 lines (20% of data) in the poem. The remaining lines (80% of data) are used as the training fold. Repeating this five times gives five-fold cross-validation. Note visemes cannot be equally represented in all folds. CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 35 2000 Spe ake r 1 Spe ake r 2 1800 1600 Count of vis e me 1400 1200 1000 800 600 400 200 0 v04 v12 v11 v01 v05 v10 v07 v18 v06 v16 v03 v02 v13 v17 v09 v08 v14 v15 Vis e me Figure 5.4: Occurrence frequency of visemes per speaker based upon ground truth transcripts of the Rosetta Raven dataset speakers using Walden’s and Montgomery’s visemes. For classification Hidden Markov Models (HMMs) are built with the Hidden Markov Toolkit (HTK) [151] already introduced in Section 2.5.1. An HMM is initialised using the ‘flat start’ method (using HCompV), with a prototype of five states and five mixture components, and the information in the training samples. Five states and five mixtures are selected based upon the work in [96]. An HMM is defined for each viseme plus silence and short-pause labels (Table 5.1) and we re-estimate the HMM parameters four times with no pruning. The HTK tool HHEd ties together the short-pause and silence models between states two and three before re-estimating the HMMs a further two times. Then HVite is used with the -m flag to force-align the data using the word transcript. We create a viseme version of the CMU dictionary for word-to-viseme mapping (whereby the phonemes are replaced with their respective viseme characters from the phoneme-to-viseme map in Table 5.1) and use this viseme CMU dictionary to produce a time-aligned viseme transcription which includes natural breakpoints between words. The HMMs are now re-estimated twice more. However, now the forcealigned viseme transcript replaces the original viseme transcript used in the previous HMM re-estimations. A word network is needed to complete the classification. HLStats and HBuild used together twice make both a Unigram Word-level Network (UWN) and a Bigram Word-level Network (BWN). Finally, HVite is used with the different network support for the classification task and HResults gives us the correctness and accuracy values. All HTK CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 36 tools named here are described in Chapter 2.5.1. 5.3 Analysis of resolution affects on classification Accuracy, A, (Equation 2.8), is selected as a measure rather than correctness, C, (Equation 2.7) since it accounts for all errors. Including insertion errors is important as they are notoriously common in lip-reading. An insertion error occurs when the recogniser output has extra words/visemes not present in the original transcript [151]. As an example one could say, “Once upon a midnight dreary”, but the recogniser outputs: “Once upon upon midnight dreary dreary”. Here the recogniser has inserted two words which were never present, “Once upon upon midnight dreary dreary” and it has deleted one (‘a’). The missing ‘a’ is a deletion error. “Once upon ... midnight dreary”. In Figures 5.5 and 5.7 we have plotted, for our 18 different resolutions along the x-axis, the mean viseme correctness on the y-axis for each speaker. Supported by a unigram language network and bigram language network respectively. Speaker 1 shape classification is shown in blue and appearance classification in black. Speaker 2 shape and appearance classification is plotted in red and green respectively. The corresponding graphs of mean accuracy classification are shown in Figures 5.6 and 5.8. All four figures include one standard error over the five folds. Figure 5.6 plots viseme accuracy with a unigram network on the y-axis and all points are negative values. This is worse than chance and demonstrates the debilitating effect of insertion errors where the language network is not strong enough to sieve them out of the classification output. Viseme correctness supported by a unigram word network is shown in Figure 5.5, where we see a slow but significant decrease in classification as the resolutions decrease in size along the x-axis. At no point do the appearance features drop below the shape features. This trend is matched in our BWN experiments in Figures 5.7 and 5.8. These Figures, however, are not normalised to account for the actual differences in information between resolutions. As we can see in our list of resolutions in Section 5.1, there is not an equal interval between each size. Therefore we replot these results by measuring the resting lip-pixels which cover the lip-shape. The resting lip pixel distance is shown in Figure 5.9 for our two speakers in the first 1080 × 1440 resolution image frame. This means, as there are less pixels per lip we can appropriately plot along our x-axis as we have done in Figures 5.10, 5.11, 5.12 and 5.13. CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 100 40 50 45 90 Me an vis e me c or r e c t ne s s , C % 37 S2 S2 S1 S1 80 70 Shape Appe ar anc e Shape Appe ar anc e 30 40 35 20 30 2 1 2 0 1 0 60 50 40 30 20 42x32 45x34 48x36 51x39 55x42 60x45 65x49 72x54 80x60 90x67 120x90 144x108 180x135 240x180 360x270 720x540 1440x1080 0 960x720 10 Re s olut ion Figure 5.5: Viseme classification in Correctness, C ±1 √σ5 , with a unigram word network (on the y-axis) at 18 degraded measured in pixels (x-axis). 20 S2 S2 S1 S1 Me an vis e me ac c ur ac y, A% 0 Shape Appe ar anc e Shape Appe ar anc e −20 −40 −60 42x32 45x34 48x36 51x39 55x42 60x45 65x49 72x54 80x60 90x67 120x90 144x108 180x135 240x180 360x270 720x540 960x720 −100 1440x1080 −80 Re s olut ion Figure 5.6: Viseme classification in Accuracy, A ± 1 √σ5 , with a unigram word network (on the y-axis) at 18 degraded resolutions in pixels (x-axis). CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 38 100 Me an vis e me c or r e c t ne s s , C % 90 S2 S2 S1 S1 80 70 Shape Appe ar anc e Shape Appe ar anc e 40 60 30 50 20 40 2 1 0 2 1 0 60 50 40 30 20 42x32 45x34 48x36 51x39 55x42 60x45 65x49 72x54 80x60 90x67 120x90 144x108 180x135 240x180 360x270 720x540 960x720 0 1440x1080 10 Re s olut ion Figure 5.7: Viseme classification in Correctness, C ± 1 √σ5 , with a bigram word network (on the y-axis) at 18 degraded resolutions in pixels (x-axis). 100 S2 S2 S1 S1 Me an vis e me ac c ur ac y, A% 90 Shape Appe ar anc e Shape Appe ar anc e 80 70 60 50 40 30 20 42x32 45x34 48x36 51x39 55x42 60x45 65x49 72x54 80x60 90x67 120x90 144x108 180x135 240x180 360x270 720x540 960x720 0 1440x1080 10 Re s olut ion Figure 5.8: Viseme classification in Accuracy, A ± 1 √σ5 , with a bigram word network (on the y-axis) at 18 degraded resolutions in pixels (x-axis). CHAPTER 5. RESOLUTION LIMITS IN LIP-READING (a) S1 39 (b) S2 Figure 5.9: Showing the resting lip-pixel distance measures for two Rosetta Raven speakers. 100 30 40 20 30 90 Me an vis e me c or r e c t ne s s , C % 80 10 4 3 2 1 0 20 4 3 2 1 0 70 60 50 S2 S2 S1 S1 Shape Appe ar anc e Shape Appe ar anc e 8 7 40 30 20 10 0 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 Re s t ing lip pixe ls 6 5 4 3 2 1 Figure 5.10: Viseme classification in Correctness, C ± 1 √σ5 , with a unigram word network (on the y-axis) by vertical resting lip height in pixels (x-axis). Figure 5.11 shows the accuracy, A, (on the y-axis) versus resolution (on the x-axis) for an UWN. The x-axis is calibrated by the vertical height of the lips of each speaker in their rest position (Figure 5.9). For example, at the maximum resolution of 1440×1080 speaker S1 has a lip-height of approximately 26 pixels in the rest position whereas S2 has a lip-height of approximately 17 pixels. The worst performance is from speaker S2 using shape-only features. The shape features do not vary with resolution so any variation in this curve is due to the cross-fold validation error (all folds do not contain all visemes CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 20 40 S2 S2 S1 S1 Shape Appe ar anc e Shape Appe ar anc e 5 4 Me an vis e me ac c ur ac y A% 0 −20 −40 −60 −80 −100 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 Re s t ing lip pixe ls 8 7 6 3 2 1 Figure 5.11: Viseme classification in Accuracy, A ± 1 √σ5 , with a unigram word network (on the y-axis) by vertical resting lip height in pixels (x-axis). equally). Nevertheless, the variation is within one standard error, and so not signifiant. This is not a surprise as AAM shape features are scale invariant. The poor performance is, as usual with lip-reading, dominated by insertion errors (hence the negative A values in Figure 5.11). The usual explanation for this effect is shape data contain a few characteristic shapes (which are easily recognised) in a sea of indistinct shapes - it is easier for a classifier to insert garbage symbols than it is to learn the duration of a symbol which has an indistinct start and end shape due to co-articulation. We suggest that speaker S1 has more distinctive shapes so scores better on the shape feature as more distinctive shapes between classification models differentiate more definitively. However, it is the appearance features which are of more interest since this varies as we downsample. At resolutions lower than four pixels it is difficult to be confident the shape information is effective. However, the basic problem is a very high error rate (shown in Figures 5.10 and 5.11) therefore a more supportive word model is required [67]. Figures 5.12 and 5.13 shows the classification accuracy versus resolution (represented by the same x-axis calibration in Figures 5.10 and 5.11) for a BWN. It also includes two sub-plots which magnify the right-most part of the graph. Again, the shape models perform worse than the appearance models, but looking at the magnified plots, appearance never becomes as poor as shape performance even at very low resolutions. As with the UWN accuracies, there is a clear inflection point at around four pixels (at two pixels per lip), and by two pixels the performance has declined significantly. In Table 5.2 we have listed the different error types (insertion, deletions and CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 41 100 60 40 90 50 30 40 Me an vis e me c or r e c t ne s s C % 80 30 20 4 3 2 1 0 4 3 2 1 0 70 60 50 40 30 20 10 0 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 Re s t ing lip pixe ls S2 S2 S1 S1 Shape Appe ar anc e Shape Appe ar anc e 8 7 6 5 4 3 2 1 Figure 5.12: Viseme classification in Correctness, C ±1 √σ5 , with a bigram word network (on the y-axis) by vertical resting lip height in pixels (x-axis). Table 5.2: Insertion, deletion and substitution error counts in classification transcripts at the smallest resolution above (before), and the largest resolution below (after), the minimum required lip pixel height of two pixels per lip. The values are the total sum over all five folds of cross validation. Speaker 1: Before After % change Speaker 2: Before After % change Insertion Deletion Substitution 348 305 −12% 3,385 3,646 +8% 1,298 1,355 +4% 571 531 −7% 2,339 2,322 −1% 1,423 1,500 +5% substitutions) which can occur during classification for resolutions just before our identified minimum lip pixel threshold as well as just after. The values are the total errors over all five folds of cross validation. For Speaker 1, both deletion and substitution errors increase when there is no longer have enough pixels to differentiate between the two lips. For Speaker 2, we see only the substitution errors increase but the deletion errors only decrease insignificantly at −1%. It is interesting to see there are fewer insertion errors after our minimum lippixel threshold. In Chapter 2 we saw the difference between Accuracy (Equation 2.8) and Correctness (Equation 2.7) were the Insertion errors. Therefore, CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 100 40 42 60 50 90 30 40 Me an vis e me ac c ur ac y, A% 80 20 4 3 2 1 0 30 4 3 2 1 0 70 60 50 40 30 20 10 0 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 Re s t ing lip pixe ls S2 S2 S1 S1 Shape Appe ar anc e Shape Appe ar anc e 8 7 6 5 4 3 2 1 Figure 5.13: Viseme classification in Accuracy, A ± 1 √σ5 , with a bigram word network (on the y-axis) by vertical resting lip height in pixels (x-axis). we can say we may need more visemes within a set to keep insertion errors down as these ensure more minor differences between classifiers are encapsulated within training. 5.4 The effect of resolution on lip-reading classifiers In Chapter 4 we discussed the limitations in machine lip-reading. In this chapter we have added to this knowledge with our experiment into resolution. Using the new Rosetta Raven data we have shown lip-reading HMM classifiers to have a threshold effect with resolution. We have trained and tested viseme classifiers and measured the effect on classification accuracy as we systematically reduced the resolution information in a video. The best recognition achieved was 59.55% accuracy with Speaker 2’s appearance data with a bigram word level language model, as this is the first time this dataset has been used this is the baseline for future uses. Contrary to common assumption and practice, the unexpected observation here is the remarkable resilience to resolution in machine lip-reading. Given modern experiments in lip-reading usually take place with high-resolution video ([24] for example) the disparity between measured performance (shown here) and assumed performance is very remarkable. Our results show for successful lip-reading one needs a minimum of four pixels (two pixels per lip) CHAPTER 5. RESOLUTION LIMITS IN LIP-READING 43 across the closed lips. The realisation of a minimum number of pixels per lip is a new piece of information in the area of machine lip-reading. Previous research in this area [143, 59] has focused on noisy images and the effect of noise on word error rates in audio-visual speech recognition system. In these experiments, we see corroborating results to support the premise that with less information then lip-reading is negatively affected, but also that there is an lower bound resolution which is essential for good lip-reading. It must not be forgotten a higher resolution video is beneficial for the tracking task but, as previous work demonstrates, other factors considered to negatively effect lip-reading classification such as off-axis views [78], actually have the ability to improve performance and here we see that a lower resolution video is not as detrimental as first assumed. We therefore conclude that, for real situations, the limitations on lip-reading are not likely to come from factors to do with the environment. Rather, the poor performance of lip-reading is almost certainly to do with limitations in the signal - the lip-signal is very challenging to decode and what is needed is a better understanding of the visual signal, its components, and how they can be learnt. For this reason, we now turn to the problem of understanding visemes. Chapter 6 A performance evaluation of visemes This chapter is our first investigation into understanding visemes. Before we undertake complicated experiments and attempt to re-design or augment visemes, it is useful to understand what we can with what we have already tested. Currently we always use a whole set of visemes to include a large number of phonemes. But it would be nice to know: • if all visemes contribute equally to the classification? If no, which of the visemes within the set are most useful? • Are there any visemes which are not helpful, or in fact, detrimental? And, • can we evaluate the performance of each viseme in isolation to understand more about the set of classes as a whole? Therefore, this chapter describes an investigation into the difference in the contribution to accuracy of each viseme within a set. An analysis of the confusion matrices produced during viseme classification, obtained by comparing the classification output with the ground truth transcript, both of which are time-aligned, provides us with measurements of viseme contributions to classification. This enables us to compare each viseme within a set to all others and determine which contributes the most for accurate machine lip-reading. Additionally the balance between shape and appearance viseme probabilities are reviewed to see which type of feature (shape or appearance) contributes most to classification. We can also compare visual classification to audio using the same viseme classifier labels on audio features (we use MFCCs). This demonstrates a relationship between viseme classification accuracy and the spread of individual viseme contribution to classification. 44 CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 6.1 45 Measuring the contribution of individual visemes The point of interest in this chapter is in the contribution of each viseme to the classification performance. This work searches for any particular viseme (or subgroup of phonemes) which contributes more to the classification accuracy. This study continues with the Rosetta Raven features extracted in Section 5.1. Short datasets, such as these, may not provide adequate training examples of all visemes. So we group the untrainable visemes into a single garbage viseme. In this case we estimate 150 samples as the minimum threshold (the mean training samples per viseme minus 1.5 standard error) to mitigate the bias caused by variation in training samples per classifier. Thus, visemes /v08/, /v09/, /v14/ and /v15/ are grouped giving Table 6.1. We have already reviewed the original dataset in Chapter 3, and Figure 5.4 shows the occurrence of visemes listed in the original phoneme-to-viseme map (see Table 5.1). Table 6.1: Modified phoneme-to-viseme mapping due to lack of training data per viseme available in the Rosetta Raven dataset. vID v01 v02 v03 v04 v05 v06 v07 v10 Phonemes /p/ /b/ /m/ /f/ /v/ /T/ /D/ /t/ /d/ /n/ /k/ /g/ /h/ /j/ /N/ /y/ /s/ /z/ /l/ /r/ /i/ /I/ vID v11 v12 v13 v16 v17 v18 gar Phonemes /eh/ /ae/ /ey/ /ay/ /A/ /O/ /2/ /U/ /3/ /ax/ /iy/ /hh/ /AU/ /@U/ silence /u/ /uw/ /OI/ /w/ /S/ /Z/ /tS/ /dZ/ The classification method used is identical to the method in Chapter 5, the methodology varies in the analysis of the classification outputs. Values from the HResults confusion matrices are extracted for analysis. For each viseme we have calculated the probability of its classification Pr{v|v̂}. 6.2 Analysis of viseme contribution Figure 6.1 shows the mean Pr{p|p̂} for the top 10 visemes over all five folds ±1 √σ5 . The x-axis is the probability of correct classification when the viseme is trained on an appearance only model, the y-axis is the probability of correct classification when the viseme is trained on a shape only model. Red are the results for Speaker 1, and the blue are Speaker 2. As the visemes are plotted by their rank, they do not always match for each speaker. For example, the CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 46 1 100 2 Shape Mode l P r {v | v̂} 90 4 2 3 80 3 10 9 70 8 5 7 6 5 4 76 8 Spe ake r 1 Spe ake r 2 9 60 10 50 50 60 70 80 Appe ar anc e Mode l P r {v | v̂} 90 100 Figure 6.1: Relationship between shape and appearance model features for Speaker 1 and Speaker 2. second position for Speaker 1 is /v12/ whereas for Speaker 2 is /v04/. All ranked visemes are listed in Table 6.2. The fifth most useful viseme gives superior classification for both speakers. The conventional wisdom is appearance features give the best results but only in studio-type conditions with good tracking, whereas here shape features are more robust than appearance. Table 6.2: Ranked visemes for separate shape and appearance features for each Rosetta Raven speaker. Rank 1 2 3 4 5 6 7 8 9 10 Shape Speaker 1 Speaker 2 /v18/ /v18/ /v12/ /v04/ /v04/ /v12/ /v11/ /v11/ /v07/ /v01/ /v01/ /v05/ /v06/ /v07/ /v05/ /gar/ /v02/ /v02/ /gar/ /v10/ Appearance Speaker 1 Speaker 2 /v18/ /v18/ /v04/ /v04/ /v12/ /v12/ /v01/ /v01/ /v11/ /v02/ /v07/ /v11/ /v02/ /gar/ /v05/ /v05/ /gar/ /v10/ /v10/ /v06/ Note the top right-hand point is the visual silence viseme, /v18/, for both Speaker 1 and Speaker 2. In general, visual silence can be quite variable compared to audio silence because speakers breathe and show emotion. However, CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 47 because the source text is a poem, which has structure and natural pauses within its style, there are well-defined visual silence periods at the start of each line. 100 Re c ognit ion P r {v | v̂} 90 80 70 60 50 Spe ake r : Fe at ur e S1:Audio S1:Vis ual S2:Audio S2:Vis ual 40 30 20 S1 S1 S2 S2 : : : : Au d V is Au d V is /v 18/ /v 18/ /v 18/ /v 18/ /v 04/ /v 12/ /v 05/ /v 04/ /v 12/ /v 05/ /v 06/ /v 07/ /v 11/ /g ar b/ /v 04/ /v 11/ /v 07/ /v 01/ /v 06/ /v 05/ /v 13/ /v 12/ /g ar b/ /v 04/ /v 02/ /v 06/ /v 12/ /v 11/ /v 01/ /v 05/ /v 07/ /g ar b/ Top t e n r e c ognis e d vis e me s : Shape mode l /v 01/ /v 02/ /v 10/ /v 02/ /v 16/ /g ar b/ /v 17/ /v 10/ Figure 6.2: Classification probability Pr{p|p̂} with a shape model for the top ten visemes in descending order. A threshold is plotted in a black vertical line to show the point at which the usefulness of each viseme significantly decreases (after five visemes) in the visual channel. Table 6.3: Ranked mean viseme Pr{p|p̂} for shape, appearance, Speaker 1, Speaker 2 and over all variables. Shape /v18/ {/v04/ /v12} /v11/ /v01/ /v07/ /v05/ {/v02/ /v06/ /gar/} /v10/ {/v03/ /v13/} /v16/ /v17/ Appearance /v18/ /v04/ /v12/ /v11/ /v01/ /v07/ {/v02/ /v05/} Speaker 1 /v18/ {/v04/ /v12/} /v11/ /v01/ /v07/ {/v02/ /v05/} /v06/ Speaker 2 /v18/ {/v04/ /v12/} /v11/ /v01/ /v07/ {/v02/ /v05/} {/v06/ /gar/} Overall /v18/ /v04/ /v12/ /v01/ /v11/ /v07/ {/v02/ /v05/} /v06/ /gar/ /v10/ /v03/ {/v13/ /v16/} /v17/ {v10/ /gar/} /v03/ /v13/ /v16/ /v17/ /v10/ /v03/ /v13/ /v16/ /v17/ /v19/ /v06/ /v10/ /v13/ /v03/ /v16/ /v17/ CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 48 100 Re c ognit ion P r {v | v̂} 90 80 70 60 50 Spe ake r : Fe at ur e S1:Audio S1:Vis ual S2:Audio S2:Vis ual 40 30 20 S1 S1 S2 S2 : : : : Au d V is Au d V is /v 18/ /v 18/ /v 18/ /v 18/ /v 04/ /v 04/ /v 05/ /v 04/ /v 12/ /v 05/ /v 06/ /v 07/ /v 12/ /v 01/ /v 11/ /v 07/ /v 13/ /v 12/ /g ar b/ /v 04/ /v 12/ /v 01/ /v 02/ /v 11/ Top t e n r e c ognis e d vis e me s : /v 11/ /g ar b/ /v 01/ /v 02/ /v 05/ /g ar b/ /v 02/ /v 06/ /v 10/ /g ar b/ /v 05/ /v 10/ Appe ar anc e mode l /v 16/ /v 10/ /v 17/ /v 06/ Figure 6.3: Classification probability Pr{p|p̂} with an appearance model for the top ten visemes in descending order. A threshold is plotted in a black vertical line to show the point at which the usefulness of each viseme significantly decreases (after seven visemes) in the visual channel. Figures 6.2 and 6.3 show, for the Speaker 1 and Speaker 2 shape and appearance models, the probability of correctly recognising the top ten visemes, Pr{v|v̂}. They also show the audio (MFCC) performance measured on visemes. The x-axis varies by performance, the best performing viseme is on the left hand side which for visual shape and appearance features is silence for all features. The next best viseme varies but is either /v4/, /v5/ or /v12/. /v4/ is a phonetically indistinct viseme (it is the biggest cluster of phonemes) so appears as a “filler” viseme. It has been observed in human lip-reading that there are few reliable visual cues and humans use these combined with rich contextual information to interpret or ‘fill in the gaps’ of what a speaker is saying [44, 132]. Therefore, the hypothesis is that robust audio classification is based upon a large spread of recognised phonemes and the resilience in classification is due to the number of phonemes contributing to the accuracy. Visually, as with human lip-readers, it is anticipated fewer visemes would perform the equivalent classification and, as such, the graph would demonstrate a steeper decline in Pr{v|v̂} over the top performing visemes (from left to right along the x-axis). In Figure 6.2 there is a greater decline from left to right over the top ten visemes for visual features than for audio for both speakers. Additionally, the error bars after the 5th position viseme increase for Speaker 2 (marginally so for Speaker 1), which provides evidence to support the hypothesis of audio classification is spread over more visemes to be correct. The top visemes (after CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 49 silence /v18/) are /v04/, /v12/, /v11/ and /v01/. These are vowels (/v12/, /v11/) and front-of-mouth consonant visemes (/v04/, /v01/). Figure 6.3, with appearance features, demonstrates a shallower decline from left to right than the shape graph in Figure 6.2 but still there is a greater decline for visual features than for audio. The error bars here increase after the 7th position viseme. Note the order of the audio viseme ordering is identical in both Figures 6.2 and 6.3 as this is the same experiment. The shape of the graph in Figure 6.3 is similar between audio and video which implies appearance-based classification is similar to noisy acoustic classification for both speakers and hence is less fragile. The top visemes in Figure 6.3 (not including silence /v18/) are: /v04/, /v12/, /v11/, /v01/, and /v7/ i.e. identical for shape-only in the first six positions. Where the error bars increase, this may be due to the few data available, which makes classification more unreliable due to less well trained HMM classifiers. This means our estimated threshold for minimum training samples per classifier was not high enough. The impact of this is reduced with the /gar/ viseme, but note with Figure 5.4 there are similarities between our top performing visemes and those with the most training samples. Table 6.3 lists the mean ranking of visemes of both speakers shape models for all visemes in the tested mapping and both speaker’s appearance models. Table 6.3 also gives mean viseme ranks for each speaker and over all speakers and models. The rankings are similar between all pairings. Table 6.4: Comparing Speaker 1 and Speaker 2 viseme ordering with Spearman correlation. Speaker 1 Audio Shape Appearance Speaker 2 Audio Shape Appearance r 0.43 0.92 0.93 p −2 1.63 × 10 0.00 0.00 Table 6.5: Speaker 1 Spearman correlations of viseme performance ordering with different features: acoustic, shape, and appearance. Speaker 1 Shape Audio Audio Speaker 1 Appearance Shape Appearance r 0.90 0.85 0.74 p 0.00 2.39 × 10−5 9.2 × 10−3 Tables 6.4, 6.5 and 6.6 summarise the similarities between feature types and speakers by using Spearman rank correlation, r, [153] between the ranked viseme outputs. Those which are significant at the 5% threshold are underlined. This confirms a strong relation between shape-only and appearance-only classification. In lab conditions, appearance features outperform shape [14] but in real world conditions the shape information is more robust in the absence CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 50 Table 6.6: Speaker 2 Spearman correlations of viseme performance ordering with different features: acoustic, shape, and appearance. Speaker 2 Shape Audio Audio Speaker 2 Appearance Shape Appearance r 0.92 0.42 0.48 p 0.00 0.12 0.07 of non-noisy appearance data [79]. This strong coupling, and previous work, [77], shows the two modes of information are complimentary and we recommend the use of both, without forgetting that in the real world, artefacts such as motion blur significantly deteriorate appearance information. We also note for Speaker 1 (in Figure 6.4) the audio ranking is similar to the video ranking although as we have previously noticed there is a more rapid drop-off for video. 6.3 Viseme contribution observations To summarise this chapter, we have shown that, with the assumption classifiers are trained with sufficient data, the order of single viseme performances are fairly consistent across the feature modes of audio, shape and appearance. It is also noted the visual classifiers depend more highly on a select few visemes performing well (between five for shape modes and seven for appearance mode out of a possible 15) than the audio classifiers. The observation of how fragile machine lip-reading is, is re-enforced by this work. If these critical five or seven visemes cannot be built as sufficiently trained classifiers then lip-reading is impossible. When a human is trained in how to lip-read, many follow the method of recognising a small number of key gestures which we then process using our own sophisticated knowledge of language and context to create a classification output or transcript [63]. In audio it is surprisingly rare to see this effect measured, even though a good acoustic unit will have accuracies which are at least 10% higher than an average unit (the mean audio viseme performance on Speaker 2 is 76% for the all visemes). We acknowledge most work in this field focuses on improving mean accuracies over the set of all visemes which can conceal the real source of overall performance. A system which achieves a mean viseme accuracy of, say, 53%, may be one which contains a few supremely accurate viseme classifiers or it maybe a system with a set of a large number of classifiers which all achieve a more modest performance. In our work we have seen a correlation between the spread of viseme contributions to classification and viseme classification performance, so we can now say higher classification is achieved with a set of equally useful visemes rather than a set of visemes where their usefulness ranges from poor to excellent. CHAPTER 6. A PERFORMANCE EVALUATION OF VISEMES 51 This chapter, therefore, suggests two different strategies for improving future lip-reading systems; option one: one makes the select few best viseme classifiers better or, option two: one focuses upon improving the worst, which at this stage do not contribute at all. We can not comment at this time which approach is likely to be more successful but our observations will allow future work to focus attention where it is likely to do the most good. This work suggests five of the visemes are largely responsible for accurate classification, whereas for appearance there are seven visemes and for audio there are at least ten. This means there appears to be fewer recognizable shapes than there are distinguishable appearances, and in turn, sounds. This relates to the overall viseme classification of the set where audio results are better than appearance, which in turn are better than shape. We suggest that a good threshold of viseme training samples, is not more or less than 1 standard error away from the mean number of training samples for all visemes in a set. This is stricter than the threshold we used and will ensure there is no bias towards any one particular viseme class which could then dominate the classification accuracy of the set. Now we have a deeper understanding of visemes and their individual capabilities, we move onto investigating how they relate to phonemes, the acoustic units of speech. We are reminded of our viseme working definition, “a viseme is the visual equivalent of a phoneme” so we move on to a review of a number of the phoneme-to-viseme (P2V) mappings which have been presented in literature in order to assess which is optimal for machine lip-reading. Chapter 7 Bear speaker-dependent visemes In computer lip-reading literature there is debate over the mapping of phonemes to visemes. In this chapter the AVLetters2 dataset (Section 3.2) is used to train and test classifiers using 120 phoneme-to-viseme (P2V) mappings and the effect on word classification accuracy is measured. This chapter also presents and tests a new data-driven method for devising speaker-dependent phoneme to viseme maps using phoneme confusions. Our method is not influenced by perception bias since our confusions are based on machine observations, and not human perception. We compare word classification achieved with these new maps against the best performing previously published phonemeto-viseme mapping. We demonstrate that whilst there are differences between each viseme map previously suggested, the best mapping over all speakers is from Lee [82]. This mapping is used as a benchmark to compare the performance of new data-derived speaker-dependent visemes. A summary of published P2V maps is provided in [138] Tables 2.3 and 2.4. This list is not exhaustive and these mappings vary by: a focus on just consonants [21, 48, 50, 144], are speaker-dependent [73], or have an ordering [114]. These are useful starting points, but for the purpose of this study we would like the phoneme-to-viseme mappings to include all phonemes in the transcript of the dataset to accurately reflect the range of phonemes used in a full vocabulary. Therefore, some mappings used here are a pairing of two mappings suggested in literature, e.g. one map for the vowels and one map for the consonants. A full list of the mappings used is in Tables 7.4 and 7.5. In total, 15 consonant maps and eight vowel maps are identified here and all of these are paired with each other to provide 120 P2V maps to test. The questions we ask are; does conventional a machine lip-reading system use the correct viseme mappings for machine lip-reading? And, is it possible to find a method for selecting better phoneme-to-viseme mappings? 7.1 Current viseme studies There are many viseme classifications present in literature, the most common viseme classifications are: ‘the Disney 12’ [80], the ‘lip-reading 18’ by Nichie 52 CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 53 [110], and Fisher’s [48]. Full phoneme to viseme mappings of these classes can be found in Tables 7.1, 7.2 and 7.3. The differences in these classifications are based around different groupings of phonemes, and in the literature we know of a number of recent attempts to compare these, such as [28] and as part of [138]. In [138] the following list of reasons are given for discrepancies between classifier sets. • Variation between speakers - i.e. speaker identity. • Variation between viewers - indicating lip-reading ability varies by individuals, those with more practise are better able to identify visemes. • The context of the speech presented - context has an influence on how consonants appear on the lips. In real tasks the context will enable easier distinction between indistinguishable phonemes in syllable only tests. • Clustering criteria - the grouping methods vary between authors. For example, ‘phonemes are said to belong to a viseme if, when clustered, the percent correct identification for the viseme is above some threshold, which is typically between 70 - 75% correct. A stricter grouping criterion has a higher threshold, so more visemes are identified.’. Table 7.1: The “Disney twelve” phoneme-to-viseme map. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ Phonemes /p/ /b/ /m/ /w/ /f/ /v/ /T/ /l/ /d/ /t/ /z/ /s/ /r/ /n/ /s/ /S/ /tS/ /j/ /y/ /g/ /k/ /N/ /U/ /H/ /E@/ /I/ /ai/ /e/ /2/ /u/ /U@/ /O/ /O@/ Table 7.2: Fisher’s phoneme-to-viseme map. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ Phonemes /k/ /g/ /N/ /m/ /p/ /b/ /f/ /v/ /S/ /Z/ /tS/ /dZ/ /t/ /d/ /n/ /th/ /dh/ /z/ /s/ /r/ /l/ CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 54 Table 7.3: Nichie’s “Lip-reading 18” phoneme-to-viseme map. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ /v13/ /v14/ /v15/ /v16/ /v17/ /v18/ /v19/ /v20/ /v21/ 7.2 Phonemes /p/ /b/ /m/ /f/ /v/ /W/ /w/ /r/ /s/ /z/ /S/ /Z/ /tS/ /dZ/ /D/ /l/ /t/ /d/ /n/ /y/ /k/ /g/ /N/ /H/ /uw/ /U/ /@U/ /AU/ /i/ /ay/ /I/ /u/ /2/ /iy/ /E/ /e/ /I@/ /@/ /ei/ Data preparation The AVLetters2 (AVL2) dataset [35] is used to train and test HMM classifiers based upon our 120 P2V mappings. AAM features are used as they are known to outperform other feature methods in machine lip-reading [28]. Tables 7.4 and 7.5 show all phonemes in each original P2V map. As each utterance is very short in our data set (each is a one word sentence of a single letter) there is no need to implement ∆s within our features to address co-articulation. In Table 7.6 we have described the sources and derivation methods for all of the phoneme-to-viseme maps used in our comparison study. We see the majority are constructed using human perception testing with few test subjects, e.g. Finn [47] only used 1 and Kricos [73] 12. Data-driven methods are most recent, e.g. Lee’s [82] visemes were presented in 2002 and Hazen’s [58] in 2006. The remaining visemes are based around linguistic/phonemic rules. As an example, the clustering method of Hazen [58] involved bottom-up clustering using maximum Bhattacharyya distances to measure similarity between the phoneme-labelled models. The models were represented by Gaussian distributions. Before clustering, some phonemes were manually merged, /em/ with /m/, /en/ with /n/, and /Z/ with /S/. Figure 3.5 (Chapter 3) shows the occurrence frequency of the 29 phonemes CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 55 Table 7.4: Vowel phoneme-to-viseme maps previously presented in literature. Classification Bozkurt [25] Disney [80] Hazen [58] Jeffers [69] Lee [82] Montgomery [105] Neti [108] Nichie [110] Viseme phoneme sets {/ei/ /2/} {/ei/ /e/ /æ/} {/3/} {/i/ /I/ /@/ /y/} {/AU/} {/O/ /A/ /OI/ /@U/} {/u/ /U/ /w/} {/U/ /h/} {/E@/ /i/ /ai/ /e/ /2/} {/u/} {/U@/ /O/ /O@/} {/AU/ /U/ /u/ /@U/ /O/ /w/ /OI/} {/2/ /A/} {/æ/ /e/ /ai/ /ei/} {/@/ /I/ /i/} {/A/ /æ/ /2/ /ai/ /e/ /ei/ /I/ /i/ /O/ /@/ /I/} {/OI/ /O/} {/AU/} {/3/ /@U/ /U/ /u/} {/i/ /I/} {/e/ /ei/ /æ/} {/A/ /AU/ /ai/ /2/} {/O/ /OI/ /@U/} {/U/ /u/} {/i/ /I/} {/e/ /æ/ /ei/ /ai/} {/A/ /O/ /2/} {/U/ /3/ /@/}{/OI/} {/i/ /hh/} {/AU/ /@U/} {/u/ /u/} {/O/ /2/ /A/ /3/ /OI/ /AU/ /H/} {/u/ /U/ /@U/} {/æ/ /e/ /ei/ /ai/} {/I/ /i/ /@/} {/uw/} {/U/ /@U/} {/AU/} {/i/ /2/ /ay/} {/2/} {/iy/ /æ/} {/e/ /I@/} {/u/} {/@/ /ei/} in AVL2 which details the volume of training samples available. Note, AVL2 does not include all phonemes in the British English phonetic alphabet [5]. It is a known problem in visual speech research that one limitation is the lack of sufficiently large datasets available [28]. This motivates the drive to find better P2V mappings to potentially avoid the need, and associated cost, in obtaining large audio-visual speech datasets. A P2V map introduces confusion in machine lip-reading. In an attempt to measure the level of this confusion, a simple ratio metric of the proportion of phonemes to visemes is shown in (Equation 7.1), where CFs is the compression factor for a set of visemes, s, #V is the number of visemes, and #P is the number of phonemes. The compression factors for the P2V maps are described in Table 7.7. The ideal ratio is a 1:1 phoneme to viseme mapping as this would mean we are identifying each phoneme uniquely. However, we still need to cluster the phonemes due to the lack of visual distinction between some phonemes. Thus the higher a Compression Factor (CF) (closer to one) the better it is as this means there is less dependency upon the language network for decoding of visemes back to phonemes. Silence and garbage visemes are not included in CFs. CFs = #V #P (7.1) Deliberate omission of the following phonemes from some mappings is required: /si/ (Disney [80]), /axr/ /en/ /el/ /em/ (Bozkirt [25]), /axr/ /em/ /epi/ /tcl/ /dcl/ /en/ /gcl/ kcl/(Hazen [58]), and /axr/ /em/ /el/ /nx/ /en/ /dx/ /eng/ /ux/ (Jeffers [69]), because these are American diacritics which are not appropriate to a British English phonetic dataset. Moreover, Kricos provides speaker-dependent visemes [73]. These have been generalised for our CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 56 Table 7.5: Consonant phoneme-to-viseme maps previously presented in literature. Classification Binnie [21] Bozkurt [25] Disney [80] Finn [47] Fisher [48] Franks [50] Hazen [58] Heider [61] Jeffers [69] Kricos [73] Lee [82] Neti [108] Nichie [110] Walden [144] Woodward [148] Viseme phoneme sets {/p/ /b/ /m/} {/f/ /v/} {/T/ /D/} {/S/ /Z/} {/k/ /g/} {/w/} {/r/} {/l/ /n/} {/t/ /d/ /s/ /z/} {/g/ /H/ /k/ /N/} {/l/ /d/ /n/ /t/} {/s/ /z/} {/tS/ /S/ /dZ/ /Z/} {/T/ /D/} {/r/} {/f/ /v/} {/p/ /b/ /m/} {/p/ /b/ /m/} {/w/} {/f/ /v/} {/T/} {/l/} {/d/ /t/ /z/ /s/ /r/ /n/} {/S/ /tS/ /j/} {/y/ /g/ /k/ /N/} {/p/ /b/ /m/} {/T/ /D/} {/w/ /s/} {/k/ /h/ /g/} {/S/ /Z/ /tS/ /j/} {/y/} {/z/} {/f/} {/v/} {/t/ /d/ /n/ /l/ /r/} {/k/ /g/ /N/ /m/} {/p/ /b/} {/f/ /v/} {/S/ /Z/ /dZ/ /tS/} {/t/ /d/ /n/ /T/ /D/ /z/ /s/ /r/ /l/} {/p/ /b/ /m/} {/f/} {/r/ /w/} {/S/ /dZ/ /tS/} {/l/} {/r/} {/y/} {/b/ /p/} {m} {/s/ /z/ /h/} {/tS/ /dZ/ /S/ /Z/} {/t/ /d/ /T/ /D/ /g/ /k/} {/N/} {/f/ /v/} {/p/ /b/ /m/} {/f/ /v/} {/k/ /g/} {/S/ /tS/ /dZ/} {/T/} {/n/ /t/ /d/} {/l/} {/r/} {/f/ /v/} {/r/ /q/ /w/} {/p/ /b/ /m/} {/T/ /D/} {/tS/ /dZ/ /S/ /Z/} {/s/ /z/} {/d/ /l/ /n/ /t/} {/g/ /k/ /N/} {/p/ /b/ /m/} {/f/ /v/} {/w/ /r/} {/t/ /d/ /s/ /z/} {/k/ /n/ /j/ /h/ /N/ /g/} {/l/} {/T/ /D/} {/S/ /Z/ /tS/ /dZ/} {/d/ /t/ /s/ /z/ /T/ /D/} {/g/ /k/ /n/ /N/ /l/ /y/ /H/} {/dZ/ /tS/ /S/ /Z/} {/p/ /b/ /m/} {/f/ /v/} {/r/ /w/} {/l/ /r/ /y/} {/s/ /z/} {/t/ /d/ /n/} {/S/ /Z/ /dZ/ /tS/} {/p/ /b/ /m/} {/T/ /D/} {/f/ /v/} {/N/ /k/ /g/ /w/} {/p/ /b/ /m/} {/f/ /v/} {/W/ /w/} {/r/} {/s/ /z/} {/S/ /Z/ /tS/ /j/} {/T/} {/l/} {/k/ /g/ /N/} {/H/} {/t/ /d/ /n/} {/y/} {/p/ /b/ /m/} {/f/ /v/} {/T /D/} {/S/ /Z/} {/w/} {/s/ /z/} {/r/} {/l/} {/t/ /d/ /n/ /k/ /g/ /j/} {/p/ /b/ /m/} {/f/ /v/} {/w /r/ /W/} {/t/ /d/ /n/ /l/ /T/ /D/ /s/ /z/ /tS/ /dZ/ /S/ /Z/ /j/ /k/ /g/ /h/} CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 57 Table 7.6: A comparison of literature phoneme-to-viseme maps. Author Binnie Bozkurt Disney Finn Year 1976 2007 — 1988 Inspiration Human testing Subjective linguistics Speech synthesis Human perception Fisher 1986 Human testing Franks 1972 Human perception Hazen Heider Jeffers 2006 1940 1971 Data-driven Human perception Linguistics Kricos Lee Neti Nichie 1982 2002 2000 1912 Human testing Data-driven Linguistics Human observations Walden Woodward 1977 1960 Human testing Linguistics Description Confusion patterns Common tri-phones Observations Montgomerys visemes and /H/ Multiple-choice intelligibility test Confusions among sounds produced in similar articulatory positions Bottom-up clustering Confusions post-training Sensory and cognitive correlates Hierarchical clustering Merging of Fisher visemes Decision tree clusters Human observation of lip movements Hierachical clustering Language rules and context Test subjects unknown 462 unknown 1 18 unknown 275 223 unknown unknown 12 unknown 26 unknown 31 unknown Table 7.7: Compression factors for viseme maps previously presented in literature. Consonant Map Woodward Disney Fisher Lee Franks Kricos Jeffers Neti Bozkurt Finn Walden Binnie Hazen Heider Nichie V:P 4:24 6:22 5:21 6:24 5:17 8:24 8:23 8:23 8:22 10:23 9:20 9:19 10:21 8:16 18:33 CF 0.16 0.18 0.23 0.25 0.29 0.33 0.35 0.35 0.36 0.43 0.45 0.47 0.48 0.50 0.54 Vowel Map Jeffers Neti Hazen Disney Lee Bozkurt Montgomery Nichie - V:P 3:19 4:20 4:18 4:11 5:14 7:19 8:19 9:15 - CF 0.16 0.20 0.22 0.36 0.36 0.37 0.42 0.60 - CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 58 tests using the most common mixtures of phonemes as the method is not reproducible. Where a viseme map does not include phonemes present in the ground truth transcript these are grouped into a garbage viseme (/gar/) to measure only the performance of the viseme sets previously prescribed in literature. Note that all phonemes in the each P2V map are in the dataset but no mapping includes all 29 phonemes in the AVL2 vocabulary. 7.3 Classification method The method for these speaker-dependent classification tests on our combined shape and appearance features uses HMM classifiers built with HTK [?]. The features selected are from the AVL2 dataset described in Chapter 3. The videos are tracked with a full-face AAM and the features extracted consist of only the lip information. The classifiers are based upon viseme labels within each P2V map. A ground truth for measuring correct classification is a viseme transcription produced using the BEEP British English pronunciation dictionary [26] and a word transcription. The classification output is a viseme level script mapped to sentence (word) level classification. Working in British English the phonetic transcript is converted to a viseme transcript assuming the visemes in the mapping being tested (Tables 7.4 and 7.5). We test using a leave-one-out seven-fold cross validation. Seven folds are selected as we have seven utterances of the alphabet per speaker in AVL2. The HMMs are initialised using ‘flat start’ training and re-estimated eight times and then force-aligned using HTK’s HVite. Training is completed by re-estimating the HMMs three more times with the force-aligned transcript. 7.4 Comparison of current phoneme to viseme maps In this section, classification performance of the HMMs is measured by correctness, C (Equation 2.7), as there are no insertion errors to consider [?]. It is acknowledged word classification is not as high performing as viseme classification. However, as each viseme set being tested has a different number of phonemes and visemes, a common comparator, here words, are used as they can compare different viseme sets. It is the difference between each set, rather than the individual performance, which is of interest in this investigation. Word level correctness rather than viseme level correctness normalises over all sets for a fair comparison. (Each viseme set has a different number of visemes in it and in turn a varying level of training samples per viseme). We compare our values of accuracy to those in the literature, namely [35] & [118]. In [35] we see that speaker-dependent results with AVL2 are significantly higher than the values we have achieved. However, in this paper the experiments are designed to measure the efficacy of multi-speaker classifiers and thus the authors have permitted different HMM parameters between CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 59 speakers. For example, the number of HMM states ranges between five and nine. In our work these values are constant to ensure any effects observed are the result of the viseme selection only. In [118] AVLetters2 data achieves 91.8% with an unsupervised random forest classification technique. This out performs both [35] and our results here. However, this unsupervised method inhibits the option of knowing the visual units used by the forest. As our priority in this comparison study is to measure the effects of viseme selection rather than optimising a classification method for each individual speaker, we bare the cost to overall classification for the learning gained from the observations by comparing viseme sets. A ll s p e ake r me an w or d c or r e c t ne s s , C % 50 45 Le e Mont gome r y B oz kur t Nichie Ne t i Haz e n J e ffe r s D is ne y 40 35 30 25 20 Fr anks Fis he r He ide r Woodwar d C ons onant v is e me s B oz kir t B innie D is ne y Walde n J e ffe r s Finn Kr ic os Ne t i Nichie Le e 10 Haz e n 15 Figure 7.1: Speaker-dependent all-speaker mean word classification, C ± 1 √σ7 , over all four speakers comparing consonant P2V maps. For a given consonant mapping (x−axis) the performance is measured after pairing with all vowel mappings. Figures 7.1 and 7.3 show the word correctness percentage aggregated over all speakers, ±1 √σ7 . Respective heat maps for all phoneme-to-viseme maps are in Figures 7.2 & 7.4. Figure 7.1 shows all consonant maps along the x-axis and, for each consonant map, a pairing with a vowel map has been plotted at the respective consonant map position on the x-axis. This shows the differences between each consonant map and the effect of the vowel maps on each consonant map. Figure 7.3 is vice versa. The black line is the mean word classification grouped by all paired maps. Both x−axies are ordered by the map’s mean rank over all speakers. This demonstrates the ‘best’ performing map for both consonants and vowels are from Lee (as this is left-most on the x−axis) for all speakers. Therefore, Lee’s visemes [82] become the benchmark in the next piece of work in this chapter. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 60 Lee Montgomery Bozkurt Nichie Neti Hazen Jeffers Figure 7.2: heatmap. Wo o d w ar d Fr an k s F i sh e r Heider B oz k i r t D i sn e y B innie Wal d e n J e ff e r s Finn K r i c os N e ti N ichie H az e n Lee Disney Speaker-dependent all-speaker mean word classification, C, A ll s p e ake r me an w or d c or r e c t ne s s , C % 50 45 C ons onant v is e me s : Le e H az e n N ichie Neti Kr ic os F inn J e ff e r s Walde n Binnie Dis ne y Boz k ir t H e ide r F is he r Fr ank s Woodwar d 40 35 30 25 20 D is ne y J e ffe r s Haz e n Ne t i Nichie Boz kur t Le e 10 Mont gome r y 15 Vowe l v is e me s Figure 7.3: Speaker-dependent all-speaker mean word classification, C ± 1 √σ7 , over all four speakers comparing vowel P2V maps. For a given vowel mapping (x−axis) the performance is measured after pairing with all consonant mappings. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 61 Lee Hazen Nichie Neti Kricos Finn Jeffers Walden Binnie Disney Bozkirt Heider Fisher Franks Figure 7.4: heatmap. D i sn e y J e ff e r s H az e n N e ti N ichie B oz k u r t M on t gom e r y Lee Woodward Speaker-dependent all-speaker mean word classification, C, Comparing the consonant P2V maps in Figure 7.1 shows the Disney vowels are significantly worse than all others when paired with all consonant maps. Over the other vowels there is overlap with the majority of error bars suggesting little significant difference over the whole group, although Lee [82] and Bozkurt [25] vowels are consistently above the mean and above the upper error bar for Disney [80], Jeffers [69] and Hazen [58] vowels. In comparing the vowel P2V maps in Figure 7.3 Lee [82] and Hazen [58] are the best consonants by a margin above the mean whereas Woodward [148] and Franks [50] are the bottom performers. Figures 7.1 and 7.3 show the performance of the viseme maps averaged across speakers, there is a significant difference between the ‘best’ visemes for individual speakers which arises from the unique way in which everyone articulates their speech. These observations are confirmed in heatmaps in Figures 7.2 & 7.4. Figures 7.5 and 7.6 are critical difference plots between the viseme class sets based upon their classification performance [39]. Critical difference is a measure of our confidence intervals between different machine learning algorithms. Two assumptions within critical difference are: all measured results are ‘reliable’, and all algorithms are evaluated using the same random samples [39]. As we use the HTK standard metrics [151], and use results with consistent random sampling across folds, these assumptions are not a concern. We have selected critical differences here as these evaluate the performance of multiple classifiers, and previous studies, such as [23, 19], do not consider the applicability of statistics when tested over more than one dataset [39]. As CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 62 CD 8 7 6 5 4 3 Nichie 7.1 Montgomery 6.1667 Hazen 5.8333 2 1 1 Bozkurt 2.4333 Neti 3.7667 Lee Disney 5.6667 4.0333 Jeffers Figure 7.5: Critical difference of all vowel phoneme-to-viseme maps independent of consonant phoneme-to-viseme map pair partner. CD 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Lee 13.75 Hazen 13.5 Nichie 12.125 Neti 11.0625 Walden 8.75 Jeffers 8.25 Kricos 8.125 3 Franks 3 Woodward 5 Disney 5.3125 Heider 6.125 Fisher 7 Bozkirt 7.4375 Finn 7.5625 Binnie Figure 7.6: Critical difference of all consonant phoneme-to-viseme maps independent of vowel phoneme-to-viseme pair partner. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 63 our HMM classifiers are speaker dependent, we can safely consider the data of each speaker as an isolated dataset within AVL2. Figure 7.5 is the comparison of the vowel labelled viseme sets. Starting on the left-hand side of the figure, it shows that Nichie, Montgomery, Hazen, and Disney vowels are not critically different from each other signified by the black horizontal bar crossing their respective lines on the left side of the figure. Likewise, Montgomery, Hazen, Disney, Jeffers, and Lee vowels are also not critically different from each other. These two bars alone demonstrate that Nichie’s vowels are critically different from Jeffers, Lee, Neti, and Bozkurt’s. On the right hand side of the graph we can see that Bozkurt’s vowels are critically different from all bar Neti’s vowels. This is interesting as in Figure 7.3 they do not appear to perform significantly differently to any other vowel visemes. In fact, whilst Bozkurt and Nichie vowels are the most critically different from each other, they are adjacent in classification performance. This gives us hope that an optimal set of visemes is possible as the effect of clusters of phonemes varies by the specific phonemes being clustered. Figures 7.5 and 7.6 demonstrate a significant difference between some subsets of viseme sets (the bars do not overlap all classifier maps). This is based upon insignificant variation within each sub-set. This suggests there could be dependency between some viseme sets as the groupings align with the derivation method of the P2V mappings. The mean word classification for all speakers and all folds for each map is plotted in Figures 7.7 and 7.8. Looking at our confusion factors for the best performing P2Vs of each speaker (Figure 7.7 and Figure 7.8), this suggests a good preparation of phonemes to visemes is ideally around 0.45 or approximately ∼2 phonemes per viseme. This also is the CF for Lee. Lee has the highest performing word classification map for both consonants and vowels displayed in Figure 7.9 and interestingly, not the highest number of visemes (the x-axis in Figure 7.9). 7.5 New phoneme to viseme maps In the second part of our phoneme-to-viseme mapping study, three approaches are used to find a better method of mapping phonemes to visemes. The first approach uses the most common pairs of phonemes from existing mappings. A comparison of previously presented P2V maps shows subgroups of phonemes which are regularly grouped together into visemes [28, 138]. The most popular of these phoneme-subgroups have a high occurrence across sets. Our first new approach uses the number of occurrences and the size of the subgroup as a weighting for grouping together phonemes, i.e. the highest weighted phonemesubgroup will be grouped into a viseme first, without duplicating phonemes into more than one viseme. The P2V maps used in this clustering process have been devised for different reasons (for example, based upon linguistic rules or upon human lip-reader observations, see Table 7.6). This set helps us to un- CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 64 35 A ll s p e ake r me an w or d c or r e c t ne s s , C % C ons onant v is e me s : Le e H az e n N ichie Neti Kr ic os F inn J e ff e r s Walde n Binnie Dis ne y Boz k ir t H e ide r F is he r Fr ank s Woodwar d 30 25 20 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 C ons onant v is e me s c ompr e s s ion f ac t or s Figure 7.7: Scatter plot showing the relationship between compression factors and word correctness, C, classification with consonant phoneme-to-viseme maps. 35 A ll s p e ake r me an w or d c or r e c t ne s s , C % Vowe l v is e me s : Le e Mont gome r y Boz k ur t N ichie Neti H az e n J e ff e r s Dis ne y 30 25 20 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Vowe l v is e me s c ompr e s s ion f ac t or s Figure 7.8: Scatter plot showing the relationship between compression factors and word correctness, C, classification with vowel phoneme-to-viseme maps. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES All-s pe ake r me an wor d c or r e c t ne s s , C % 100 65 D is ne y J e ff e r s Le e Ne t i Haz e n Nichie Gue s s ing 90 80 70 60 50 40 30 20 10 0 0 5 10 15 20 25 Quant ity of vis e me s in e ach s e t ( The r e ar e 29 in AVL2) 30 Figure 7.9: For previously presented phoneme-to-viseme maps which include both vowel and consonant phonemes, word correctness, C is plotted against the count of visemes in each phoneme-to-viseme map. derstand that if what we currently assume to be good groups really are the best groups of phonemes for optimal classification. The second and third approaches are both speaker-dependent and datadriven from phoneme classification. Two cases are considered: 1. a strictly coupled map, where a phoneme can be grouped into a viseme only if it has been confused with all the phonemes within the viseme, and 2. a relaxed coupled case, where phonemes can be grouped into a viseme if it has been confused with any phoneme within the viseme. With all new P2V mappings each phoneme can only be allocated to one viseme class. These new P2V maps are tested on the AVL2 dataset using the same classification method as described in Section 7.3. The results from the best performing P2V map from our comparison study (Lee [82]) is the benchmark to measure improvements. 7.5.1 Common phoneme-pair visemes The first approach for finding a new speaker-independent P2V map uses the most commonly coupled phonemes to build new visemes. In detail, all visemes in the previous maps are searched to make a full dictionary of unique pairs of phonemes. Associated with each dictionary entry is a count of how many times they appear in any defined P2V map from those in the comparison study in Section 7.4 with HTK. This phoneme pair list is sorted by descending occurrence count. On passing through this list the next phoneme pair is assigned CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 66 to a viseme class based upon matching phonemes (whilst not duplicating the presence of a phoneme within one viseme). A phoneme is not permitted to be added to more than one viseme. Priority is given to the pairings with a higher count. If a particular phoneme was never coupled with other phonemes, that phoneme forms a unique viseme of its own. Table 7.8: Visemes derived using most-common phoneme pairings in previously presented phoneme-to-viseme mappings. Common-pair Visemes (CF:0.28) 7.5.2 {/d/ /l/ /n/ /t/} {/b/ /m/ /p/} {/g/ /h/ /H/ /k/ /N/ /y/} {/f/ /v/} {/O/ /U@/ /O@/} {/E@/ /i/} {/tS/ /dZ/ /S/ /Z/} {/A/ /2/ /ao} {/s/ /z/} {/dh/ /T/} {/r/ /w/ /W/} {/æ/ /e/ /ei/ /I@/} {/a/ /ai/ /ai/ /e/ /i/ /I/} {/AU/ /@/ /3/ /@U/ /u/ /U/ /u/} Viseme classes with strictly confusable phonemes The second and third approaches for identifying visemes are speaker-dependent, data-driven and based on phoneme confusions within the classifier. The first undertaking in this work is to complete classification using phoneme labelled HHM classifiers. The classifiers are built in HTK with flat-started HMMs and force aligned training data for each speaker. The HMMs are re-estimated 11 times in total over seven folds of leave-one-out cross validation. This overall classification task does not perform well (see Table 7.9) particularly for an isolated word dataset. However, the HTK tool HResults is used to output a confusion matrix for each fold detailing which phoneme labels confuse with others and how often. For both data-driven speaker-dependent approaches, this first step of completing phoneme classification is essential to create the data to derive the P2V maps from. Table 7.9: Mean per speaker Correctness, C, of phoneme-labelled HMM classifiers. Phoneme C Speaker 1 24.72 Speaker 2 23.63 Speaker 3 57.69 Speaker 4 43.41 Now, let us use a smaller seven-unit confusion matrix example to explain our clustering method in full. Our demonstration confusion matrix is in Figure 7.10. For the ‘strictly-confused’ viseme set (remember there is one per speaker), the second step of deriving the P2V map is to check for single-phoneme visemes. Any phonemes which have only been correctly recognised as themselves and have no false positive/negative classifications are permitted to be single phoneme visemes. In Figure 7.10 we have highlighted the true positive classifications in red and both false positives and false negative classifications in blue which shows /p6/ is the only phoneme to fit our ‘single-phoneme viseme’ definition. /p6/ has a true positive value of +4 and zero false classifications. Therefore this is our first viseme. /v1/ = {/p6/}. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES /p1/ /p2/ /p3/ /p4/ /p5/ /p6/ /p7/ /p1/ 1 0 1 0 3 0 1 /p2/ 0 0 0 2 0 0 0 /p3/ 0 0 0 1 1 0 3 /p4/ 0 2 0 0 1 0 0 /p5/ 0 0 0 2 1 0 0 /p6/ 0 0 0 0 0 4 0 67 /p7/ 4 0 1 0 0 0 1 Figure 7.10: Demonstration (theoretical) confusion matrix showing confusions between phoneme-labelled classifiers to be used for clustering to create new speaker-dependent visemes. True positive classifications are shown in red, confusions of either false positives and false negatives are shown in blue. The estimated classes are listed horizontally and the real classes are vertical. This action is followed by defining all combinations of remaining phonemes which can be grouped into visemes and identifying the grouping that contains the largest number of confusions by ordering all the viseme possibilities by descending size (whole list shown in Figure 7.11). {/p1/, /p2/, /p3/, /p4/, /p5/, /p7/} {/p1/, /p2/, /p3/, /p4/, /p5/} {/p1/, /p2/, /p3/, /p4/, /p7/} {/p1/, /p2/, /p3/, /p5/, /p7/} {/p1/, /p2/, /p4/, /p5/, /p7/} {/p1/, /p3/, /p4/, /p5/, /p7/} {/p2/, /p3/, /p4/, /p5/, /p7/} {/p1/, /p2/, /p3/, /p4/} {/p1/, /p2/, /p3/, /p5/} {/p1/, /p2/, /p3/, /p7/} {/p2/, /p3/, /p4/, /p5/} {/p2/, /p3/, /p4/, /p7/} {/p3/, /p4/, /p5/, /p7/} {/p1/, /p3/, /p4/, /p5/} {/p1/, /p4/, /p5/, /p7/} {/p2/, /p4/, /p5/, /p7/} {/p1/, /p2/, /p3} {/p1/, /p2/, /p4/} {/p1/, /p2, /p5/} {/p1/, /p2, /p7/} {/p2/, /p3, /p4/} {/p2/, /p3, /p5/} {/p2/, /p3, /p7/} {/p3/, /p4/, /p5/} {/p3/, /p4/, /p7/} {/p1/, /p3/, /p4/} {/p4/, /p5/, /p7/} {/p1/, /p4/, /p5/} {/p2/, /p4/, /p5/} {/p1/, /p5/, /p7/} {/p2/, /p5/, /p7/} {/p3/, /p5/, /p7/} {/p1/, /p3/, /p5/} {/p1/, /p3/, /p7/} {/p1/, /p4/, /p7/} {/p2/, /p4/, /p7/} {/p1/, /p2/} {/p1/, /p3/} {/p1/, /p4/} {/p1/, /p5/} {/p1/, /p7/} {/p2/, /p3/} {/p2/, /p4/} {/p2/, /p5/} {/p2/, /p7/} {/p3/, /p4/} {/p3/, /p5/} {/p3/, /p7/} {/p4/, /p5/} {/p4/, /p7/} {/p5/, /p7/} Figure 7.11: List of all possible subgroups of phonemes with an example set of seven phonemes Our grouping rule states that phonemes can be grouped into a viseme class only if all of the phonemes within the candidate group are mutually confusable. This means each pair of phonemes within a viseme must have a total false CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 68 {/p2/, /p4/, /p5/} {/p2/, /p4/} {/p2/, /p5/} {/p4/, /p5/} Figure 7.12: List of all possible subgroups of phonemes with an example set of seven phonemes after the first viseme is formed. positive and false negative classification greater than zero. Once a phoneme has been assigned to a viseme class it can no longer be considered for grouping, and so any possible phoneme combinations that include this viseme are discarded. This ensures phonemes can belong to only a single viseme. By iterating though our list of all possibilities in order, we check if all the phonemes are mutually confused. This means all phonemes have a positive confusion value (a blue value in Figure 7.10) with all others. The first phoneme possibility in our list where this is true is {/p1/, /p3/, /p7/}. This is confirmed by the Figure 7.10 values: Pr{/p1/|/p3/}+Pr{/p3/|/p1/} = 0 + 1 = 1 which is > 0 also, Pr{/p1/|/p7/}+Pr{/p7/|/p1/} = 4 + 1 = 5 which is > 0 and Pr{/p3/|/p7/}+Pr{/p7/|/p3/} = 1 + 3 = 4 which is > 0. This becomes our second viseme and thus our current viseme list looks like Table 7.10. Table 7.10: Demonstration example 1: first-iteration of clustering, a phonemeto-viseme map for strictly-confused phonemes. Viseme /v1/ /v2/ Phonemes {/p6/} {/p1/, /p3/, /p7/} We now only have three remaining phonemes to cluster, p2, p4 and p5. This reduces our list of possible combinations substantially, see Figure 7.12. The next iteration of our clustering algorithm identifies the combination of remaining phonemes which correspond to the next largest number of confusions, and so on, until no phonemes can be merged. This leaves us with the final visemes in Table 7.11. Our original phoneme classification has produced confusion matrices which permit confusions between vowel and consonant phonemes. We can see in Section 7.2 (Tables 7.4 and 7.5), previously presented P2V maps that vowel and consonant phonemes are not commonly mixed within visemes. Therefore, we make two types of P2V maps: one which permits vowels and consonant phonemes to be mixed within the same viseme, and a second which restricts visemes to be vowel or consonant only by putting an extra condition in when checking for confusions greater than zero. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 69 Table 7.11: Demonstration example 2: final phoneme-to-viseme map for strictly-confused phonemes. Viseme /v1/ /v2/ /v3/ /v4/ Phonemes {/p6/} {/p1/, /p3/, /p7/} {/p2/, /p4/} {/p5/} It should be remembered that not all phonemes present in the ground truth transcripts will have been recognised and included in the phoneme confusion matrix. Any of the remaining phonemes which have not been assigned to a viseme are grouped into a single garbage /gar/ viseme. This approach ensures any phonemes which have been confused are grouped into a viseme and we do not lose any of the ‘rarer’, and less common visual phonemes. For example, /ea/, /oh/, /ao/, and /r/ are not in the original transcript and so can be placed into /gar/. But for Speaker 2, /gar/ also contains /ay/ and /p/, and for Speaker 4 /gar/ also contains /p/ and /z/, as these do not show up in the speaker’s phoneme classification outputs. This task has been undertaken for all four speakers in our dataset. The final P2V maps are shown in Table 7.12. Table 7.12: Strictly-confused phoneme speaker-dependent visemes. The score in brackets is the ratio of visemes to phonemes. Classification Speaker1 (CF:0.48) Speaker2 (CF: 0.44) Speaker3 (CF: 0.68) Speaker4 (CF: 0.64) Classification Speaker1 (CF:0.50) Speaker2 (CF: 0.58) Speaker3 (CF: 0.68) Speaker4 (CF: 0.65) P2V mapping - permitting mixing of vowels and consonants {/2/ /ai/ /i/ /n/ /@U/} {/b/ /e/ /ei/ /y/ } {/d/ /s/} {/tS/ /l/} {/@/ /v/} {/w/} {/f/} {/k/} {/@/ /v/} {/dZ/ /z/} {/A/ /u/} {/t/} {/@/ /ai/ /ei/ /i/ /s/} {/e/ /v/ /w/ /y/} {/l/ /m/ /n/} {/b/ /d/ /p/} {/z/} {tS/} {/t/} {/A/} {/dZ/ /k/} {/2/ /f/} {/@U/ /u/} {/ei/ /f/ /n/} {/d/ /t/ /p/} {/b/ /s/} {/l/ /m/} {/@/ /e/} {/i/} {/u/} {/A/} {/dZ/} {/@U/} {/z/} {/y/} {/tS}/ {/ai/} {/2/} {/A/} {/dZ/} {/@U/} {/k/ /w/} {/v/} {/z/} {/2/ /ai/ /i/ /ei/ } {/m/ /n/} {/@/ /e/ /p/} {/k/ /w/} {/d/ /s/} {/dZ/ /t/} {/f/} {/v/} {/A/} {/z/} {/tS/} {/b/} {/@U/} {/@U/} {/l/} {/u/} {/b/} P2V mapping - restricting mixing of vowels and consonants {/2/ /i/ /@U/ /u/} {/A/ /ei/} {/@/ /e/ /ei/} {/d/ /s/ /t/ } {/tS/ /l/ } {/k/} {/z/} {/w/} {/f/} {/m/ /n/} {/dZ/ /v/} {/b/ /y/} {/ai/ /ei/ /i/ /u/} {/@U/} {/@/} {/e/} {/2/} {/A/} {/v/ /w/} {/dZ/ /p/ /y/} {/d/ /b/} {/t/} {/k/} {/tS/} {/l/ /m/ /n/} {/f/ /s/} {/ei/ /i/} {/ai/} {/@/ /e/} {/2/} {/d/ /p/ /t/} {/l/ /m/} {/k/ /w/} {/v/} {/tS/} {/@U/} {/y/} {/u/} {/A/} {/z/} {/f/ /n/} {/b/ /s/} {/dZ/} {/2/ /ai/ /i/ /ei/} {/@/ /e/} {/m/ /n/} {/k/ /l/} {/dZ/ /t/} {/d/ /s/} {/tS/} {/@U/} {/y/} {/u/} {/A/} {/w/} {/f/} {/v/} {/b/} CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 7.5.3 70 Viseme classes with relaxed confusions between phonemes A disadvantage of the strictly confusable viseme set is that it contains some spurious single-phoneme visemes where the phoneme cannot be grouped because it is not confused with all other phonemes in the viseme. These types of phonemes are likely to be either: borderline cases at the extremes of a viseme cluster, i.e. they have subtle visual similarities to more than one phoneme cluster, or they do not occur frequently enough in the training data to be differentiated from other phonemes. To address this we complete a second pass-through of the strictly-confused visemes listed in Table 7.11. We begin with the visemes as they currently stand (in our demonstration example containing four classes) and relax the condition requiring confusion with all of the phonemes. Now any single phoneme viseme (in our demonstration, /v4/) can be allocated to a previously existing viseme if it has been confused with any phoneme in the viseme. In Figure 7.10 we see /p5/ was confused with /p1/, /p3/, and /p4/. Because /p4/ is not in the same viseme as /p1/ and /p3/ we use the value of confusion to decide which to allocate it to as follows. Pr{/p1/|/p5/}+Pr{/p5/|/p1/} = 0 + 3 = 3 Pr{/p3/|/p5/}+Pr{/p5/|/p3/} = 0 + 1 = 1 Pr{/p4/|/p5/}+Pr{/p5/|/p4/} = 2 + 1 = 3 Therefore; for p5 the total confusion with /v2/ is 3 + 1 = 4, whereas the total confusion with /v3/ is 3. We select the viseme with most confusion to incorporate the unallocated phoneme /p5/. This reduces the number of viseme classes by merging single-phoneme visemes from Table 7.11 to form a second set shown in Table 7.13. This has the added benefit that we have also increased the number of training samples for each classifier. Table 7.13: Demonstration example 3: final phoneme-to-viseme map for relaxed-confused phonemes. Viseme /v1/ /v2/ /v3/ Phonemes {/p6/} {/p1/, /p3/, /p5/, /p7/} {/p2/, /p4/} Remember, as we have two versions of Table 7.11 - one with mixed vowel and consonant phonemes and a second with divided vowels and consonant phonemes - the same still applies to our relaxed-confused visemes sets. This means we end up with four types of speaker-dependent phoneme-to-viseme maps, described in Table 7.14. For our strictly-confused P2V maps in Table 7.12, these become the relaxed P2V maps in Table 7.15. Now, and this is why these visemes are defined as relaxed, any remaining phonemes which have confusions, but are so far not assigned to a viseme, the phoneme-pair confusions are used to map the remaining phonemes to an appropriate viseme, even though it does not confuse with all phonemes already CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES Mixed vowels and consonants + Strict-confusion of phonemes Mixed vowels and consonants + Relaxed-confusion of phonemes 71 Split vowels and consonants + Strict-confusion of phonemes Split vowels and consonants + Relaxed-confusion of phonemes Table 7.14: The four variations on speaker-dependent phoneme-to-viseme maps derived from phoneme confusion in phoneme classification. Table 7.15: Relaxed-confused phoneme speaker-dependent visemes. The score in brackets is the ratio of visemes to phonemes. Classification Speaker1 (CF:0.28) Speaker2 (CF: 0.32) Speaker3 (CF: 0.40) Speaker4 (CF: 0.32) Classification Speaker1 (CF:0.47) Speaker2 (CF: 0.29) Speaker3 (CF: 0.56) Speaker4 (CF: 0.50) P2V mapping - permitting mixing of vowels and consonants {/b/ /e/ /ei/ /p/ /w/ /y/ /k/} {/2/ /ai/ /f/ /i/ /m/ /n/ /@U/} {/dZ/ /z/} {/A/ /u/} {/d/ /s/ /t/} {/tS/ /l/} {/@/ /v/}{/@/ /v/} {/A/ /@/ /ai/ /ei/ /i/ /s/ /tS/} {/e/ /t/ /v/ /w/ /y/} {/l/ /m/ /n/} {/2/ /f/} {/z/} {/b/ /d/ /p/} {/@U/ /u/} {/dZ/ /k/} {/2/ /ai/ /ei/ /f/ /i/ /n/} {/@/ /e/ /y/ /tS/} {/b/ /s/ /v/} {/l/ /m/ /u/} {/dZ/} {/@U/} {/z/} {/d/ /p/ /t/} {/k/ /w/} {/A/} {/2/ /ai/ /tS/ /i/ /ei/ } {/A/ /m/ /u/ /n/} {/@/ /e/ /p/ /v/ /y/} {/dZ/ /t/} {/k/ /l/ /w/} {/@U/} {/d/ /f/ /s/} {/b/} P2V mapping - restricting mixing of vowels and consonants {/2/ /i/ /@U/ /u/} {/A/ /ai/} {/@/ /e/ /ei/} {/b/ /w/ /y/} {/d/ /f/ /s/ /t/} {/k/} {/z/} {/m/} {/l/} {/tS/} {/dZ/ /k/ /v/ /z/} {/A/ /2/ /@/ /ai/ /ei/ /i/ /@U/ /u/} {/k/ /t/ /v/ /w/} {/tS/ /l/ /m/ /n/} {/f/ /s/} {/dZ/ /p/ /y/} {/b/ /d/} {/z/} {/2/ /ai/ /i/ /ei/} {/@/ /e/} {/b/ /s/ /v/} {/d/ /p/ /t/} {/l/ /m/} {/y/} {/dZ/} {/@U/} {/z/} {/u/} {/@/ /e/} {/k/ /w/} {/f/ /n/} {/A/} {/tS/} {/2/ /ai/ /i/ /ei/} {/tS/ /k/ /l/ /w/} {/d/ /f/ /s/ /v/} {/m/ /n/} {/f/} {/A/} {/dZ/ /t/} {/@U/} {/u/} {/y/} {/b/} in it. Any remaining phonemes which are not assigned to a viseme are grouped into a new garbage /gar/ viseme. This approach ensures any phonemes which have been confused with any other are grouped into a viseme. 7.6 Bear speaker-dependent visemes Figure 7.13 shows word correctness of the common phoneme-pair visemes against Lee’s benchmark. It is no surprise the common-pair visemes are all worse than Lee, as Lee gave the maximum performance of the original P2V mappings used to deduce the new map. However, the overlap in error bars shows that for two speakers this is not a significant reduction. Unfortunately, no particular viseme, or group of visemes, particularly contribute to the set correctness. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 72 70 HTK Wor d Cor r e c t ne s s C % 60 Vis e me s e t Le e Common pair 50 40 30 20 10 Speaker 1 Speaker 2 Speaker 3 Te s t Spe ake r Speaker 4 Figure 7.13: Word classification correctness C ± 1 √σ7 , using the common phoneme-pairs phoneme-to-viseme map. Lees benchmark is in black. 70 HTK Wor d Cor r e c t ne s s C % 60 50 Vis e me s e t Le e Be ar 1: Be ar 2: Be ar 3: Be ar 4: St r ic t -Mixe d St r ic t -Split Re laxe d-Mixe d Re laxe d-Split 40 30 20 10 0 Speaker 1 Speaker 2 Speaker 3 Te s t Spe ake r Speaker 4 Figure 7.14: Word classification correctness C ± 1 √σ7 , using all four new methods of deriving speaker dependent visemes. Lees benchmark is in black. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 73 70 HTK Wor d Cor r e c t ne s s C % 60 Vis e me s e t Me an mixe d Me an s plit 50 40 30 20 10 Speaker 1 Speaker 2 Speaker 3 Te s t Spe ake r Speaker 4 Figure 7.15: A comparison of the split vowel and consonant phoneme visemes and the mixed vowel and consonant phoneme visemes with AVLetters2 speakers. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 74 70 HTK Wor d Cor r e c t ne s s C % 60 Vis e me s e t Me an s t r ic t c onfus e d Me an r e laxe d c onfus e d 50 40 30 20 10 Speaker 1 Speaker 2 Speaker 3 Te s t Spe ake r Speaker 4 Figure 7.16: A comparison of the strict mutually confusable phoneme viseme classes and the relaxed confused phoneme visemes with AVLetters2 speakers. In Figure 7.14 all four speaker-dependent maps tested on each speaker are plotted on the x-axis to compare the difference in word classification (shown on the y-axis). The benchmark from the comparison study, Lee, is in black. For Speaker 1 and Speaker 3, no new viseme map significantly improves upon Lee’s performance although we do see improvements for both Speaker 2 and Speaker 4. The strictly-confused and split viseme map improves upon Lee’s previous best word classification. Figure 7.15 compares the mixed consonant and vowel maps against split consonant and vowel maps, also measured in word correctness, C, on the yaxis. The split P2V maps are always better than mixed for all speakers. Figure 7.16 shows the comparison of strictly-confused and loosely confused viseme classes. The strict confusions are better for two out of four speakers. These are speakers with the highest ratio of phonemes to visemes (Tables 7.15 and 7.12). In Figure 7.17, all four variants of our new P2V maps are plotted for each speaker and an all-speaker mean against the number of visemes in each set. Splitting vowel and consonant phonemes gives a greater number of classifiers, which reduces the number of training samples per class, but results in higher correctness for all speakers. This shows that having the right training samples is more important than having simply ‘more data’. Whilst showing a smaller effect, the two graphs on the left hand side of Figure 7.17 shows the relaxing of confusable phonemes has a negative influence, even though this reduces the number of visemes and increases training samples per class, they are not good training samples to include for the class. Relaxed confused Strictly confused 6 16 18 18 20 20 30 40 50 60 70 80 90 100 0 0 0 0 14 16 0 0 8 10 12 Quantity of visemes in each set 14 10 6 8 10 12 Quantity of visemes in each set 10 4 Speaker 1 Speaker 2 Speaker 3 Speaker 4 Random chance All−speaker mean 4 10 20 30 40 50 60 70 80 90 20 2 2 Speaker 1 Speaker 2 Speaker 3 Speaker 4 Random chance All−speaker mean 100 20 30 40 50 60 70 80 90 100 0 0 10 20 30 40 50 60 70 80 90 100 Mixed Vowels and Consonant phonemes HTK Wor d Cor r e c t ne s s % Wor d Cor r e c t ne s s C % Wor d Cor r e c t ne s s C % Wor d Cor r e c t ne s s C % 2 2 6 4 6 Speaker 1 Speaker 2 Speaker 3 Speaker 4 Random chance All−speaker mean 4 Speaker 1 Speaker 2 Speaker 3 Speaker 4 Random chance All−speaker mean 8 10 12 Quantity of visemes in each set 8 10 12 Quantity of visemes in each set 14 14 16 16 Split Vowels and Consonant Phonemes 18 18 20 20 Figure 7.17: How Correctness varies with quantity of visemes in each set. All four variants on a speaker-dependent data-driven approach to finding visemes plotted against the count of visemes within each set. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 75 CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 76 In Figures 7.18, 7.19, 7.20, and 7.21, the contribution of each viseme has been listed in descending order along the x−axis for each speaker in AVL2. The contribution of each viseme is measured as the inverse probability of each class, Pr{v|v̂}. These values have been calculated from the HResults confusion matrices. There is no significant step when a viseme contribution is no longer needed, that is in speaker-dependent visemes we need all class labels within a set. This analysis of visemes within a set is also used in [17], which proposes a threshold subject to the information in the features. Using combined shape and appearance features here removes the threshold as these figures show irrespective of which method of phoneme-clustering is used for devising visemes, the greater the number of visemes in a set, the higher the overall classification. More important to see is the overall classification C is higher when there is less range between individual viseme Pr{v|v̂} values within a set of visemes. The difference values between the highest and least contributing visemes for each method and speaker are listed in Table 7.16. Table 7.16: Viseme variation in Pr{v|v̂} showing the best and worst classifiers within each set of visemes for each derivation method per speaker. Method Relaxed: mixed Relaxed: split Strict: mixed Strict: split Speaker 1 76.97 100.00 56.35 65.54 Speaker 2 32.86 19.05 37.50 42.86 Speaker 3 14.29 7.14 14.26 8.57 Speaker 4 7.14 14.29 14.29 5.71 CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 77 100 Spe ake r s : 90 Spe ake r Spe ake r Spe ake r Spe ake r Re c ognit ion P r {v | v̂} 80 70 1 2 3 4 60 50 40 30 20 10 0 Sp1 Sp2 Sp3 Sp4 s il v06 v03 v04 v01 s il v04 v12 v03 v01 v08 gar v06 v02 v10 s il v12 v03 v12 v03 v09 v11 v05 v02 v04 v07 v05 v08 gar s il v01 v06 v05 v11 v02 v01 v06 v05 v02 Or de r e d vis e me c las s e s v07 v09 Figure 7.18: Individual viseme classification, Pr{v|v̂} with the relaxed, mixed vowels and consonant Bear visemes. 100 Spe ake r s : 90 Spe ake r Spe ake r Spe ake r Spe ake r Re c ognit ion P r {v | v̂} 80 70 1 2 3 4 60 50 40 30 20 10 0 Sp1 Sp2 Sp3 Sp4 v09 s il v04 v06 s il v01 v06 v09 v03 v04 v09 v10 v04 v03 v10 s il v01 v05 v11 v02 v05 v02 gar v02 v06 v12 v14 s il v01 v03 v02 v03 v04 v08 v01 v05 gar Or de r e d vis e me c las s e s v05 v07 Figure 7.19: Individual viseme classification, Pr{v|v̂} with the relaxed, split vowels and consonant Bear visemes. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 78 100 Spe ake r s : 90 Spe ake r Spe ake r Spe ake r Spe ake r Re c ognit ion P r {v | v̂} 80 70 1 2 3 4 60 50 40 30 20 10 0 Sp1 Sp2 Sp3 Sp4 v07 s il v04 v04 v02 v02 v08 v12 v01 v06 v10 s il v04 v10 v12 v03 v06 v01 s il v01 v03 v07 v08 v05 v03 v01 v03 v06 v05 v11 v02 v06 v05 v02 v17 Or de r e d vis e me c las s e s v07 v09 Figure 7.20: Individual viseme classification, Pr{v|v̂} with the strictly confused, mixed vowels and consonant Bear visemes. 100 Spe ake r s : 90 Spe ake r Spe ake r Spe ake r Spe ake r Re c ognit ion P r {v | v̂} 80 70 1 2 3 4 60 50 40 30 20 10 0 Sp1 Sp2 Sp3 Sp4 s il s il v01 v04 v05 v09 v04 v05 v01 v01 v05 v10 v03 v14 v07 v11 v04 v06 v11 v12 v02 v06 gar v07 v04 v02 v08 v11 v12 v13 v14 v15 s il v09 s il v01 v06 v13 v02 v03 Or de r e d vis e me c las s e s v03 v14 v02 v06 v08 Figure 7.21: Individual viseme classification, Pr{v|v̂} with the strictly confused, split vowels and consonant Bear visemes. CHAPTER 7. BEAR SPEAKER-DEPENDENT VISEMES 7.7 79 Improving lip-reading with speaker-dependent phoneme-to-viseme maps This chapter has described a comprehensive study of previously suggested P2V maps and shown Lee’s [82] is the best of the previously published P2V maps. The new data-driven approach respects speaker individuality in speech and uses this to demonstrate our second data-driven method tested, a strictlyconfused viseme derivation with split vowel and consonant phonemes, can improve word classification. We call these speaker-dependent visemes ‘Bear visemes’ after the author’s surname and show how these fit into the conventional lip-reading system in Figure 7.22, our new steps are highlighted with dash-edged boxes. Figure 7.22: First augmentation to the conventional lip-reading system to include speaker-dependent visemes. For phoneme confusion driven visemes, it is possible AVL2 contains insufficient samples to fairly identify confusion. So whilst improving performance, the classifiers still need more data for training. The reduction in word correctness by the data-driven confused mixed visemes is attributed to the mixing of vowels and consonants as this work shows when keeping these separate an improvement is possible. The ratio of phonemes to visemes is useful, but secondary to confusions between phonemes, and does not help to discriminate phonemes within visemes for improved word classification. To discriminate between words which are visually similar we still need to be able to reverse any P2V mapping. This work highlights bad training samples are worse than less training samples and the boundary between good and bad samples is blurred. We have designed and implemented a new method of producing speaker-dependent visemes, in doing so showing speaker identity is important for good machine lip-reading classification. As speaker dependence is prevalent in machine lipreading systems, we need to cast our eyes towards how difficult a task speakerindependent classification is. This is what our next chapter investigates. Chapter 8 Speaker-independence in phoneme-to-viseme maps More than in audio speech, in machine lip-reading speaker identity is important for accurate classification [35]. We know a major difficulty in visual speech is the labelling of classifier units so we need to address the questions; to what extent such maps are independent of the speaker? And if so, how might speaker independent P2V maps be examined? Alongside of this, it would be useful to understand the interactions between the model training data and the classes. Therefore in this chapter we will use both the the AVL2 dataset [35] and the RMAV dataset to train and test classifiers based upon a series of P2V mappings. 8.1 Speaker independence At the current time, good machine lip-reading performances are achieved with speaker dependent classification models, this means the test speaker must be included within the classifier training data. Speaker independent machine lipreading is less successful [35]. Only a few large scale investigations have shown speaker independence to be viable. Neti et al. in [108] state that they created multi-speaker classifiers as contingency should speaker independent models fail to generalise well to unseen speakers. After preliminary experiments these multi-speaker classifiers were considered not needed. However, this is achieved with state-of-the-art modelling, a permitted increase in word error rate and with a lot of speakers (IBM’s via voice has 290 speakers [145]) (a currently unavailable dataset) which implies that with enough data and speakers that the speaker independence obstacle is surmountable by achieving generalisation on a large scale. In the majority of papers referenced in this thesis for example, speaker-dependent experiments are still used for greater results as speaker independence is rare and difficult to achieve. On the continuous speech datasets, it is interesting to note that most still use speaker-dependent tests [76, 58, 147, 28]. We note that some are single speaker-dependent, others multi-speaker dependent, the crux of the point is 80 CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS81 that test speaker samples are included in the training data. In contrast only AVICAR [72] and IBM’s LVCSR [108] achieve speaker-independent success. The former is a specific AV dataset for in car speech, and the latter is not available [28] so we suffice with the best datasets we have available to us. Thus we understand speaker independence in visual speech to be the ability to classify a speaker who is not involved in the classifier training. This is a difficult, and as yet, unsolved problem. From this we are confident that, in visual speech, the identification of the person speaking is important. One could wonder if, with a large enough dataset with a significant number of speakers, then it could be sufficient to train classifiers which are generalised to cover a whole population including independent speakers. But we still struggle without a dataset of the size needed to test this theory, particularly as we do not know how much is ‘enough’ data or speakers. An example of a study into speaker independence in machine lip-reading is [35], here the authors use AVL2 and compare single speaker, multi-speaker and speaker independent classification using two types of classifiers (HMMs & Sieves [8]). However, this investigation uses word labels for classifiers and we are interested to know if the results could be improved using either phonemes or speaker-dependent visemes. 8.2 Method overview We use the phoneme clustering approach described in Chapter 7 (or [16]) to produce a series of speaker-dependent P2V maps. This series of maps is made up of the following: 1. a speaker-dependent P2V map for each speaker; 2. a multi-speaker P2V map using all speakers’ phoneme confusions; 3. a speaker-independent P2V map for each speaker using confusions of all other speakers in the data. So we have nine phoneme-to-viseme maps for AVL2 (four speaker maps for map types one and three, and one multi-speaker map) and 25 for RMAV (12 speaker maps for map types one and three, and one multi-speaker map). AVL2 P2V maps are constructed using separate training and test data over seven fold cross-validation [42]. RMAV maps from ten fold cross-validation. The variation in folds is due to the volume of data in each dataset. With the HTK toolkit [?] HMM classifiers are built with the viseme classes in each P2V map. HMMs are flat-started with HCompV, re-estimated 11 times over (HERest) with forced alignment between seventh and eighth re-estimates. The final steps are classification using HVite and output of results with HResults. The models are three state HMMs each having an associated Gaussian mixture of five components to keep our results comparable to previous work. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS82 To measure our performance of AVL2 speakers we note the classification network restricts the output to be one of the 26 letters of the alphabet. There#letterscorrect fore, our simplified measure of accuracy is; . #lettersclassif ied For RMAV a bigram word network is built with HBuild and HLStats, and classification is measured as Correctness (Equation 2.7). The BEEP pronunciation dictionary used throughout these experiments is in British English [26] for all speakers. 8.3 Experiment design The P2V maps formed in these experiments are designated as: Mn (p, q) (8.1) This means the P2V map is derived from speaker n, but trained using visual speech data from speaker p and tested using visual speech data from speaker q. For example, M1 (2, 3) would designate the result of testing a P2V map constructed from Speaker 1, using data from Speaker 2 to train the viseme models, and testing on Speaker 3’s data. 8.3.1 Baseline: Same Speaker-Dependent (SSD) maps For our experiments we need a baseline for comparison. We select our same speaker-dependent P2V maps as based on previous literature [16], these provide the best results. The baseline tests involved are: M1 (1, 1), M2 (2, 2), M3 (3, 3) and M4 (4, 4) (for the four speakers in AVL2), additional tests for RMAV are: M5 (5, 5), M6 (6, 6), M7 (7, 7) and M8 (8, 8), M9 (9, 9), M10 (10, 10), M11 (11, 11) and M12 (12, 12). Remember, we now have AVL2 speakers 1 to 4, and RMAV speakers 1 to 12. Speakers 1 to 4 are not the same in AVL2 and RMAV. These tests are Same Speaker-Dependent (SSD) because the same speaker is used to create the map, to train the models and for the testing data. Tables 8.1 & 8.2 depict how these tests are constructed. Table 8.1: Same Speaker-Dependent (SSD) experiments for AVLetters2 speakers. The results from these tests will be used as a baseline. Same speaker-dependent (SD) Mapping (Mn ) Training data (p) Test speaker (q) Sp1 Sp1 Sp1 Sp2 Sp2 Sp2 Sp3 Sp3 Sp3 Sp4 Sp4 Sp4 Mn (p, q) M1 (1, 1) M2 (2, 2) M3 (3, 3) M4 (4, 4) The resulting AVL2 four speakers SSD P2V maps are listed in Table 8.3, Tables ??, ??, ??, ??, ?? & ??. We also permit a garbage, /garb/, viseme CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS83 Table 8.2: Same Speaker-Dependent (SSD) experiments for RMAV speakers. The results from these tests will be used as a baseline. Mapping (Mn ) Sp1 Sp2 Sp3 Sp4 Sp5 Sp6 Sp7 Sp8 Sp9 Sp10 Sp11 Sp12 Same speaker-dependent (SD) Training data (p) Test speaker (q) Sp1 Sp1 Sp2 Sp2 Sp3 Sp3 Sp4 Sp4 Sp5 Sp5 Sp6 Sp6 Sp7 Sp7 Sp8 Sp8 Sp9 Sp9 Sp10 Sp10 Sp11 Sp11 Sp12 Sp12 Mn (p, q) M1 (1, 1) M2 (2, 2) M3 (3, 3) M4 (4, 4) M5 (5, 5) M6 (6, 6) M7 (7, 7) M8 (8, 8) M9 (9, 9) M10 (10, 10) M11 (11, 11) M12 (12, 12) which is a cluster of phonemes in the ground truth which did not appear at all in the output from the phoneme classifier. Every viseme is listed with its associated mutually-confused phonemes e.g. for AVL2 Speaker 1, M1 , we see /v01/ is made up of phonemes {/2/, /iy/, /@U/, /uw/}. We know from our clustering method in Chapter 7 this means in the phoneme classification, all four phonemes {/2/, /iy/, /@U/, /uw/} were confused with the other three in the viseme. We are using the ‘strictly-confused’ method from Chapter 7 with split vowel and consonant groupings as these achieved the most accurate classification. 8.3.2 Different Speaker-Dependent maps & Data (DSD&D) The second set of tests within this experiment start to look at using P2V maps with different test speakers. This means the HMM classifiers trained on each single speaker are used to recognise data from alternative speakers. Within AVL2 this is completed for all four speakers using the P2V maps of the other speakers, and the data from the other speakers. Hence for Speaker 1 we construct M2 (2, 1), M3 (3, 1) and M4 (4, 1) and so on for the other speakers, this is depicted in Table 8.4. For the RMAV speakers, we undertake this for all 12 speakers using the maps of the 11 others. We show the tests for a single speaker (Speaker 1) in Table 8.5 as an example. 8.3.3 Different Speaker-Dependent maps (DSD) Now we wish to isolate the effects of the HMM classifier from the effect of using different viseme P2V by training the classifiers on single speakers with CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS84 Table 8.3: Speaker-dependent phoneme-to-viseme mapping derived from phoneme classification confusions for each speaker in AVLetters2. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ /sil/ /garb/ Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ /v13/ /v14/ /v15/ /v16/ /v17/ /sil/ /garb/ Speaker 1 M1 Phonemes /2/ /iy/ /@U/ /uw/ /@/ /eh/ /ey/ /A/ /ay/ /d/ /s/ /t/ /tS/ /l/ /m/ /n/ /dZ/ /v/ /b/ /y/ /k/ /z/ /w/ /f/ /sil/ /E/ /6/ /O/ /r/ /p/ Speaker 3 M3 Phonemes /ey/ /iy/ /@/ /eh/ /ay/ /2/ /@/ /@U/ /uw/ /d/ /p/ /t/ /l/ /m/ /k/ /w/ /f/ /n/ /b/ /s/ /v/ /dZ/ /tS/ /y/ /z/ /sil/ /E/ /6/ /O/ /r/ Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ /v13/ /v14/ /v15/ Speaker 2 M2 Phonemes /ay/ /ey/ /iy/ /uw/ /@U/ /@/ /eh/ /2/ /@/ /dZ/ /p/ /y/ /l/ /m/ /n/ /v/ /w/ /d/ /b/ /f/ /s/ /t/ /k/ /tS/ /sil/ /E/ /6/ /O/ /r/ /z/ Speaker 4 M4 Phonemes /2/ /ay/ /ey/ /iy/ /@/ /eh/ /@/ /@U/ /uw/ /m/ /n/ /k/ /l/ /dZ/ /t/ /d/ /s/ /w/ /f/ /v/ /tS/ /b/ /y/ /sil/ /garb/ /sil/ /E/ /6/ /O/ /r/ /p/ /z/ Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ /v13/ /v14/ /sil/ /garb/ the labels of the alternative speaker P2V maps. E.g. for AVL2 Speaker 1, the tests are: M2 (1, 1), M3 (1, 1) and M4 (1, 1). (All tests are listed in Table 8.6). These are the same P2V maps as in Table 8.3 but trained and tested differ- CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS85 Table 8.4: Different Speaker-Dependent maps and Data (DSD&D) experiments with the four AVLetters2 speakers. Different Speaker-Dependent maps & Data (DSD&D) Mapping (Mn ) Training data (p) Test speaker (q) Mn (p, q) Sp2 Sp2 Sp1 M2 (2, 1) Sp3 Sp3 Sp1 M3 (3, 1) Sp4 Sp4 Sp1 M4 (4, 1) Sp1 Sp1 Sp2 M1 (1, 2) Sp3 Sp3 Sp2 M3 (3, 2) Sp4 Sp4 Sp2 M4 (4, 2) Sp1 Sp1 Sp3 M1 (1, 3) Sp2 Sp2 Sp3 M2 (2, 3) Sp4 Sp4 Sp3 M4 (4, 3) Sp1 Sp1 Sp4 M1 (1, 4) Sp2 Sp2 Sp4 M2 (2, 4) Sp3 Sp3 Sp4 M3 (3, 4) Table 8.5: Different Speaker-Dependent maps and Data (DSD&D) experiments for one of the 12 RMAV speakers (speaker one). Different Speaker-Dependent Mapping (Mn ) Training data (p) Sp2 Sp2 Sp3 Sp3 Sp4 Sp4 Sp5 Sp5 Sp6 Sp6 Sp7 Sp7 Sp8 Sp8 Sp9 Sp9 Sp10 Sp10 Sp11 Sp11 Sp12 Sp12 maps & Data (DSD&D) Test speaker (q) Mn (p, q) Sp1 M2 (2, 1) Sp1 M3 (3, 1) Sp1 M4 (4, 1) Sp1 M5 (5, 1) Sp1 M6 (6, 1) Sp1 M7 (7, 1) Sp1 M8 (8, 1) Sp1 M9 (9, 1) Sp1 M10 (10, 1) Sp1 M11 (11, 1) Sp1 M12 (12, 1) ently. In Table 8.7 we show the equivalent DSD tests for Speaker 1 of RMAV as an example. 8.3.4 Multi-Speaker maps (MS) A multi-speaker (MS) P2V map forms the viseme classifier labels in our third set of experiments. This map is constructed using phoneme confusions produced by all speakers in each data set and is shown in Table 8.8, for the four AVL2 speakers, and Table 8.9 for the 12 RMAV speakers. For our multi-speaker experiment notation, we substitute in the word ‘all’ in place of a list of all the speakers for ease of reading. Therefore, the AVL2 CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS86 Table 8.6: Different Speaker-Dependent maps (DSD) experiments for AVLetters2 speakers. Different Speaker-Dependent maps (DSD) Mapping (Mn ) Training data (p) Test speaker (q) Sp2 Sp1 Sp1 Sp3 Sp1 Sp1 Sp4 Sp1 Sp1 Sp1 Sp2 Sp2 Sp3 Sp2 Sp2 Sp4 Sp2 Sp2 Sp1 Sp3 Sp3 Sp2 Sp3 Sp3 Sp4 Sp3 Sp3 Sp1 Sp4 Sp4 Sp2 Sp4 Sp4 Sp3 Sp4 Sp4 Mn (p, q) M2 (1, 1) M3 (1, 1) M4 (1, 1) M1 (2, 2) M3 (2, 2) M4 (2, 2) M1 (3, 3) M2 (3, 3) M4 (3, 3) M1 (4, 4) M2 (4, 4) M3 (4, 4) Table 8.7: Different Speaker-Dependent maps (DSD) for one of the 12 RMAV speakers (Speaker one). Different Speaker-Dependent maps (DSD) Mapping (Mn ) Training data (p) Test speaker (q) Sp2 Sp1 Sp1 Sp3 Sp1 Sp1 Sp4 Sp1 Sp1 Sp5 Sp1 Sp1 Sp6 Sp1 Sp1 Sp7 Sp1 Sp1 Sp8 Sp1 Sp1 Sp9 Sp1 Sp1 Sp10 Sp1 Sp1 Sp11 Sp1 Sp1 Sp12 Sp1 Sp1 Mn (p, q) M2 (1, 1) M3 (1, 1) M4 (1, 1) M5 (1, 1) M6 (1, 1) M7 (1, 1) M8 (1, 1) M9 (1, 1) M10 (1, 1) M11 (1, 1) M12 (1, 1) MS map is tested as follows: M[all] (1, 1), M[all] (2, 2), M[all] (3, 3) and M[all] (4, 4): this is explained in Table 8.10 and the RMAV MS map is tested as: M[all] (1, 1), M[all] (2, 2), M[all] (3, 3), M[all] (4, 4), Mall] (5, 5), M[all] (6, 6), M[all] (7, 7), M[all] (8, 8), M[all] (9, 9), M[all] (10, 10), M[all] (11, 11), M[all] (12, 12), as shown in Table 8.11. 8.3.5 Speaker-Independent maps (SI) Finally, our last set of tests looks at speaker independence in P2V maps themselves. Here we use maps which are derived using all speakers confusions bar the test speaker. This time we substitute the symbol ‘!x’ in place of a list of speaker identifying numbers, meaning ‘not including speaker x’. The tests for CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS87 Table 8.8: Multi-Speaker (MS) phoneme-to-viseme mapping for AVLetters2 speakers. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /v12/ /sil/ /gar/ Phonemes /2/ /ay/ /ey/ /iy/ /@U/ /uw/ /@/ /eh/ /A/ /d/ /s/ /t/ /v/ /f/ /l/ /n/ /b/ /w/ /y/ /dZ/ /z/ /p/ /m/ /k/ /tS/ /sil/ /E/ /6/ /O/ /r/ Table 8.9: Multi-Speaker (MS) phoneme-to-viseme mapping for RMAV speakers. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /sil/ /sp/ /gar/ Phonemes /A/ /æ/ /2/ /O/ /@/ /ay/ /E/ /eh/ /3/ /ey/ /I@/ /I/ /iy/ /6/ /@U/ /O@/ /U/ /O@/ /AU/ /OI/ /@/ /b/ /tS/ /d/ /D/ /f/ /g/ /H/ /dZ/ /k/ /l/ /m/ /n/ /N/ /p/ /r/ /s/ /S/ /t/ /T/ /v/ /w/ /y/ /z/ /sil/ /sp/ /Z/ /c/ Table 8.10: Multi-Speaker (MS) experiments for AVLetters2 speakers. Multi-Speaker (MS) Mapping (Mn ) Training data (p) Test speaker (q) Mn (p, q) Sp[all] Sp1 Sp1 M[all] (1, 1) Sp[all] Sp2 Sp2 M[all] (2, 2) Sp[all] Sp3 Sp3 M[all] (3, 3) Sp[all] Sp4 Sp4 M[all] (4, 4) these maps are as follows M!1 (1, 1), M!2 (2, 2), M!3 (3, 3) and M!4 (4, 4) as shown in Tables 8.13 & 8.14 for AVL2 and RMAV speakers respectively. Speaker CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS88 Table 8.11: Multi-Speaker (MS) experiments for RMAV speakers. Multi-Speaker (MS) Mapping (Mn ) Training data (p) Test speaker (q) Mn (p, q) Sp[all] Sp1 Sp1 Mall (1, 1) Sp[all] Sp2 Sp2 Mall (2, 2) Sp[all] Sp3 Sp3 Mall (3, 3) Sp[all] Sp4 Sp4 Mall (4, 4) Sp[all] Sp5 Sp5 Mall (5, 5) Sp[all] Sp6 Sp6 Mall (6, 6) Sp[all] Sp7 Sp7 Mall (7, 7) Sp[all] Sp8 Sp8 Mall (8, 8) Sp[all] Sp9 Sp9 Mall (9, 9) Sp[all] Sp10 Sp10 Mall (10, 10) Sp[all] Sp11 Sp11 Mall (11, 11) Sp[all] Sp12 Sp12 Mall (12, 12) independent P2V maps for AVL2 speakers are shown in Table 8.12. 8.4 The homophone risk factor P2V maps are a many-to-one mapping. This creates the possibility of creating visual homophones when translating a phonetic transcript into a viseme transcript. For example, in the AVL2 data (isolated words are the letters of the alphabet) the phonetic realisation of the word ‘B’ is ‘/b//iy/’ and of ‘D’ is ‘/d//iy/’. Using M2 (2, 2) to translate these into visemes they are identical ‘/v08//v01/’ . Permitting variations in pronunciation, the total tokens (T ) for each map after each word has been translated to visemes are listed in Table 8.15. More homophones means a greater the chance of substitution errors and a reduced correct classification. 8.5 Measuring similarity between phoneme-toviseme maps In Table 8.16 and 8.17 we present a similarity score for comparing each pair of phoneme-to-viseme maps for AVL2 speakers and RMAV speakers respectively. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS89 Table 8.12: Phoneme-to-viseme mapping derived from phoneme classification confusions of the three other speakers in AVLetters2. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ /sil/ /garb/ Speaker 1 M234 Phonemes /2/ /@/ /ay/ /ey/ /iy/ /@U/ /uw/ /eh/ /A/ /d/ /s/ /t/ /v/ /l/ /m/ /n/ /dZ/ /p/ /y/ /k/ /w/ /f/ /tS/ /b/ /sil/ /E/ /6/ /O/ /r/ /z/ Speaker 3 M124 Viseme Phonemes /v01/ /2/ /ay/ /ey/ /iy/ /@U/ /uw/ /v02/ /A/ /v03/ /@/ /eh/ /v04/ /d/ /s/ /t/ /v/ /v05/ /l/ /m/ /n/ /v06/ /b/ /w/ /y/ /v07/ /dZ/ /v08/ /z/ /v09/ /p/ /v10/ /k/ /v11/ /f/ /v12/ /tS/ /sil/ /sil/ /garb/ /E/ /6/ /O/ /r/ /iy/ Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ /v11/ Speaker 2 M134 Phonemes /2/ /ay/ /ey/ /iy/ /A/ /@U/ /uw/ /@/ /eh/ /d/ /s/ /t/ /tS/ /l/ /b/ /dZ/ /v/ /y/ /k/ /w/ /p/ /z/ /m/ /sil/ /garb/ /sil/ /E/ /6/ /O/ /r/ /f/ /n/ Speaker 4 M123 Viseme Phonemes /v01/ /2/ /ay/ /ey/ /iy/ /@U/ /uw/ /v02/ /A/ /v03/ /@/ /eh/ /v04/ /dZ/ /s/ /t/ /v/ /v05/ /f/ /l/ /n/ /v06/ /b/ /d/ /p/ /v07/ /w/ /y/ /v08/ /z/ /v09/ /m/ /v10/ /k/ /v11/ /tS/ /sil/ /garb/ /sil/ ea/ /6/ /O/ /r/ CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS90 Table 8.13: Speaker-Independent (SI) experiments with AVLetters2 speakers. Mapping (Mn ) Sp[!1] Sp[!2] Sp[!3] Sp[!4] Speaker-Independent (SI) Training data (p) Test speaker (q) Sp1 Sp1 Sp2 Sp2 Sp3 Sp3 Sp4 Sp4 Mn (p, q) M!1 (1, 1) M!2 (2, 2) M!3 (3, 3) M!4 (4, 4) Table 8.14: Speaker-Independent (SI) experiments with RMAV speakers. Mapping (Mn ) Sp[!1] Sp[!2] Sp[!3] Sp[!4] Sp[!5] Sp[!6] Sp[!7] Sp[!8] Sp[!9] Sp[!10] Sp[!11] Sp[!12] Speaker-Independent (SI) Training data (p) Test speaker (q) Sp1 Sp1 Sp2 Sp2 Sp3 Sp3 Sp4 Sp4 Sp5 Sp5 Sp6 Sp6 Sp7 Sp7 Sp8 Sp8 Sp9 Sp9 Sp10 Sp10 Sp11 Sp11 Sp12 Sp12 Mn (p, q) M!1 (1, 1) M!2 (2, 2) M!3 (3, 3) M!4 (4, 4) M!5 (5, 5) M!6 (6, 6) M!7 (7, 7) M!8 (8, 8) M!9 (9, 9) M[10 (10, 10) M[11 (11, 11) M!12 (12, 12) Table 8.15: Count of visual homophones by each phoneme-to-viseme map, allowing for variation in pronunciation in AVLetters2 speakers. Map M1 M2 M3 M4 M[all] M!1 M!2 M!3 M!4 Tokens T 19 19 24 24 14 17 18 20 15 CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS91 Table 8.16: Similarity scores between all AVLetters2 phoneme-to-viseme maps. M1 M2 M3 M4 M[all] M!1 M!2 M!3 M!4 M1 0.000 0.327 0.322 0.247 0.199 0.244 0.048 0.112 0.222 M2 0.327 0.000 0.410 0.303 0.333 0.266 0.256 0.254 0.253 M3 0.322 0.410 0.000 0.157 0.465 0.400 0.394 0.398 0.396 M4 0.247 0.303 0.157 0.000 0.301 0.298 0.172 0.246 0.378 M[all] 0.199 0.333 0.465 0.301 0.000 0.311 0.220 0.098 0.136 M!1 0.244 0.266 0.400 0.298 0.311 0.000 0.086 0.160 0.218 M!2 0.048 0.256 0.394 0.172 0.220 0.086 0.000 0.155 0.160 M!3 0.112 0.254 0.398 0.246 0.098 0.160 0.155 0.000 0.222 M!4 0.222 0.253 0.396 0.378 0.136 0.218 0.160 0.222 0.000 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Mall M!1 M!2 M!3 M!4 M!5 M!6 M!7 M!8 M!9 M!10 M!11 M!12 M1 0.000 0.174 0.289 0.099 0.009 0.313 0.201 0.237 0.095 0.256 0.006 0.258 0.653 0.564 0.564 0.660 0.564 0.571 0.564 0.658 0.564 0.660 0.564 0.471 0.564 M2 0.174 0.000 0.196 0.031 0.159 0.235 0.194 0.175 0.194 0.192 0.026 0.304 0.544 0.449 0.449 0.550 0.449 0.456 0.449 0.550 0.449 0.550 0.449 0.347 0.449 M3 0.289 0.196 0.000 0.128 0.044 0.357 0.228 0.333 0.271 0.188 0.024 0.260 0.633 0.543 0.543 0.645 0.543 0.566 0.543 0.655 0.543 0.645 0.543 0.572 0.543 M4 0.099 0.031 0.128 0.000 0.072 0.133 0.126 0.264 0.151 0.185 0.172 0.108 0.598 0.505 0.505 0.605 0.505 0.512 0.505 0.605 0.505 0.605 0.505 0.417 0.505 M5 0.009 0.159 0.044 0.072 0.000 0.256 0.046 0.213 0.130 0.237 0.086 0.301 0.738 0.649 0.649 0.746 0.649 0.658 0.649 0.746 0.649 0.746 0.649 0.556 0.649 M6 0.313 0.235 0.357 0.133 0.256 0.000 0.213 0.279 0.340 0.357 0.291 0.220 0.715 0.621 0.621 0.751 0.621 0.679 0.621 0.714 0.621 0.751 0.621 0.572 0.621 M7 0.201 0.194 0.228 0.126 0.046 0.213 0.067 0.334 0.263 0.327 0.379 0.324 0.631 0.544 0.544 0.638 0.544 0.550 0.544 0.637 0.544 0.638 0.544 0.466 0.544 M8 0.237 0.175 0.333 0.264 0.213 0.279 0.334 0.000 0.229 0.340 0.230 0.310 0.667 0.569 0.569 0.635 0.569 0.575 0.569 0.671 0.569 0.635 0.569 0.475 0.569 M9 0.095 0.194 0.271 0.151 0.130 0.340 0.263 0.229 0.000 0.276 0.209 0.324 0.741 0.656 0.656 0.748 0.656 0.672 0.656 0.790 0.656 0.748 0.656 0.570 0.656 M10 0.256 0.192 0.188 0.185 0.237 0.357 0.327 0.340 0.276 0.000 0.181 0.272 0.694 0.598 0.598 0.626 0.598 0.544 0.598 0.636 0.598 0.626 0.598 0.463 0.598 M11 0.006 0.026 0.024 0.172 0.086 0.291 0.379 0.230 0.209 0.181 0.000 0.167 0.610 0.517 0.517 0.618 0.517 0.548 0.517 0.642 0.517 0.618 0.517 0.515 0.517 M12 0.258 0.304 0.260 0.108 0.301 0.220 0.324 0.310 0.324 0.272 0.167 0.008 0.664 0.561 0.561 0.589 0.561 0.528 0.561 0.561 0.561 0.589 0.561 0.496 0.561 Mall 0.653 0.544 0.633 0.598 0.738 0.715 0.631 0.667 0.741 0.694 0.610 0.664 0.000 0.000 0.000 0.005 0.000 0.035 0.000 0.076 0.000 0.005 0.000 0.070 0.000 M!1 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 M!2 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 M!3 0.660 0.550 0.645 0.605 0.746 0.751 0.638 0.635 0.748 0.626 0.618 0.589 0.005 0.057 0.057 0.000 0.057 0.070 0.057 0.030 0.057 0.000 0.057 0.018 0.057 M!4 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 M!5 0.571 0.456 0.566 0.512 0.658 0.679 0.550 0.575 0.672 0.544 0.548 0.528 0.035 0.033 0.033 0.070 0.033 0.000 0.033 0.099 0.033 0.070 0.033 0.100 0.033 M!6 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 M!7 0.658 0.550 0.655 0.605 0.746 0.714 0.637 0.671 0.790 0.636 0.642 0.561 0.076 0.020 0.020 0.030 0.020 0.099 0.020 0.000 0.020 0.030 0.020 0.018 0.020 Table 8.17: Similarity scores between all RMAV phoneme-to-viseme maps. M!8 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 M!9 0.660 0.550 0.645 0.605 0.746 0.751 0.638 0.635 0.748 0.626 0.618 0.589 0.005 0.057 0.057 0.000 0.057 0.070 0.057 0.030 0.057 0.000 0.057 0.018 0.057 M!10 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 M!11 0.471 0.347 0.572 0.417 0.556 0.572 0.466 0.475 0.570 0.463 0.515 0.496 0.070 0.067 0.067 0.018 0.067 0.100 0.067 0.018 0.067 0.018 0.067 0.000 0.067 M!12 0.564 0.449 0.543 0.505 0.649 0.621 0.544 0.569 0.656 0.598 0.517 0.561 0.000 0.000 0.000 0.057 0.000 0.033 0.000 0.020 0.000 0.057 0.000 0.067 0.000 CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS92 CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS93 The score addresses the phonemes within each viseme, the total number of phonemes clustered, the number of visemes within each set and ignores the ordering of the visemes within the set. As an example to explain our similarity algorithm, imagine we have the two phoneme-to-viseme maps shown in Figure 8.1. Map Map 1 Map 2 Viseme /v01/ /v02/ /v03/ /v04/ /v01/ /v02/ /v03/ /v04/ /v05/ Phonemes {/p1/ /p2/ /p3/} {/p4/ /p5/} {/p6/} {/p7/ /p8/} {/p1/ /p3/} {/p2/ /p4/} {/p5/} {/p6/} {/p7/ /p8/ /p9/} Figure 8.1: Similarity algorithm: example phoneme-to-viseme maps. Our first step is to attribute a weight to each phoneme within each viseme. 1 and is shown in Figure 8.2. This is; #phonemes Map 1 Map 2 Viseme /v01/ /v02/ /v03/ /v04/ /v01/ /v02/ /v03/ /v04/ /v05/ Phonemes {/p1/ /p2/ /p3/} {/p4/ /p5/} {/p6/} {/p7/ /p8/} {/p1/ /p3/} {/p2/ /p4/} {/p5/} {/p6/} {/p7/ /p8/ /p9/} Phoneme weight 0.3r 0.5 1.0 0.5 0.5 0.5 1.0 1.0 0.3r Figure 8.2: Phoneme-to-viseme map similarity algorithm step 1: Example phoneme-to-viseme maps with weighted phonemes. Now we use these values to compare all visemes of one map with another. Map 1 /v1/ /v2/ /v3/ /v4/ /v1/ /p1/, /p3/ - /v2/ /p2/ /p4/ - Map 2 /v3/ /v4/ /p5/ - /p6/ - /v5/ /p7/, /p8/ Figure 8.3: Phoneme-to-viseme map similarity algorithm step 2: phoneme in viseme matches. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS94 Where two visemes Vi and Vj contain the same phonemes (see Figure 8.3), the Vij score is the sum of the matched phoneme weights (Figure 8.4). The final values are in Figure 8.5. Map 2 /v1/ Map 1 /v2/ /v3/ /v4/ /v1/ /p1/ = 0.3r + 0.5 /p3/ = 0.3r + 0.5 0 0 0 - /v2/ /p2/ = 0.3r + 0.3r /p4/ = 0.5 + 0.5 0 0 - /v3/ 0 /p5/ = 0.5 + 1.0 0 0 - /v4/ 0 0 /p6/ = 1.0 + 1.0 0 0 /v5/ 0 0 0 /p7/ = 0.5 + 0.3r /p8/ = 0.5 + 0.3r Figure 8.4: Phoneme-to-viseme map similarity algorithm step 3: summing the phoneme weights. Map 1 /v1/ /v2/ /v3/ /v4/ /v1/ 1.6r 0 0 0 /v2/ 0.6r 1.0 0 0 Map 2 /v3/ /v4/ 0 0 1.5 0 0 2.0 0 0 /v5/ 0 0 0 1.6r Figure 8.5: Phoneme-to-viseme map similarity algorithm step 4: phoneme weights. total Finally we need to sum of all values in the upper triangle U ∀ij i > j, minus the sum of all values in the lower triangle L∀ij i < j, normalised by dividing by the total number of matched phonemes, Np , (in our example, eight) to give the value 0.730 (8.2). S is the similarity score. S =U −L (8.2) This similarity measure is calculated to compare all the P2V maps used in our experiments in pairs and the results are shown in Tables 8.16 and 8.17. The values closest to zero show the most similar maps, thus the closer to 1, the more different the maps are. We have not compared the maps between datasets due to biased effects caused by the disparity between word content and data size. Unsurprisingly, with the RMAV dataset, the MS and SI P2V maps are all very similar because of the volume of speakers and folds of phoneme classification, there is more chance of unique phonemes being confused. There is at most 3 phonemes different between them all. If we compare all the P2V maps in Tables 8.8 & 8.12, there are similarities. Mostly because there is only one speaker at a time removed from within SI P2V maps. However, if these are compared to the speaker-dependent maps in Table 8.3, a different picture can be seen. Speaker 4 is significantly affected by the introduction of /@U/ and /uw/ into viseme /v01/. Where Speaker 1 has these in M1 (1, 1), his SD word classification of 15.9% is less than half of Speaker 4’s 38.4% (Figure 8.11). CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS95 8.6 Analysis of speaker independence in phonemeto-viseme maps 50 45 Gue s s ing D SD &D e xpe r ime nt s SSD bas e line Wor d c or r e c t ne s s , C % 40 M3(3,3) 35 M4(4,4) 30 25 20 15 M2(2,2) M1(1,1) 10 5 M4(4,2) M2(2,1) 0 M3(3,1) Speaker1 M4(4,1) M1(1,2) Speaker2 M4(4,3) M1(1,3) M3(3,2) M1(1,4) M (2,3) 2 Speaker3 Te s t Spe ake r q M2(2,4) M3(3,4) Speaker4 Figure 8.6: Word classification correctness, C ± 1 √σ7 , of the DSD&D tests where HMM classifiers are tested on all three other speakers in AVLetters2. Baseline is the SSD maps. 20 Random gue s s ing D SD &D e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 10 8 6 M1(1,1) M2(2,1) M12(12,1) M5(5,1) M9(9,1) M10(10,1) M6(6,1) M (8,1) 8 M11(11,1) M1(1,2) M4(4,1) M3(3,1) M6(6,2) M5(5,2) M4(4,2) M3(3,2) M2(2,2) M10(10,2) M9(9,2) M12(12,2) M8(8,2) M7(7,2) M12(12,3) M3(3,3) N5(5,3) M11(11,2) M2(2,3) M1(1,3) M7(7,3) M11(11,3) M4(4,3) M6(6,3) M8(8,3) M (10,3) 10 M9(9,3) M7(7,1) 4 2 0 Speaker1 Speaker2 Te s t Spe ake r q Speaker3 Figure 8.7: Word classification correctness, C ± 1 √σ10 , of the DSD&D tests where HMM classifiers are tested on all eleven other speakers in RMAV. Baseline is SSD maps (red) - Speakers 1-3. Figure 8.6 shows the word correctness of AVL2 speaker-dependent viseme classes on the y-axis. In this figure, the baseline is n = p = q for all M . These are compared to the DSD&D tests: M2 (2, 1), M3 (3, 1), M4 (4, 1) for Speaker CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS96 Spe ake r -de pe nde nt maps for inde pe nde nt -s pe ake r 20 Random gue s s ing D SD &D e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 10 M12(12,5) 8 M6(6,4) M9(9,4) M12(12,4) M4(4,4) M (5,4) M10(10,5) M (8,5) M6(6,5) 8 M9(9,5) M3(3,5) 5 6 M2(2,4) M1(1,4) M3(3,4) M8(8,4) M7(7,4) M10(10,4) M12(12,6) M7(7,6) M11(11,6) M10(10,6) M4(4,6) M6(6,6) M3(3,6) M9(9,6) M11(11,5) M8(8,6) M1(1,6) M2(2,6) M5(5,5) M (7,5) 7 M2(2,5) M11(11,4) M1(1,5) N5(5,6) M4(4,5) 4 2 0 Speaker4 Speaker5 Te s t Spe ake r q Speaker6 Figure 8.8: Word classification correctness, C ± 1 √σ10 , of the DSD&D tests where HMM classifiers are tested on all eleven other speakers in RMAV. Baseline is SSD maps (red) - Speakers 4-6. 20 Random gue s s ing D SD &D e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 10 8 M1(1,7) M5(5,7) M8(8,7) M12(12,7) M6(6,7) M7(7,7) M4(4,7) M9(9,7) M11(11,7) M3(3,7) M10(10,7) M2(2,7) M1(1,8) M2(2,8) 6 M10(10,8) M9(9,8) M12(12,8) M3(3,8) M (8,8) 8 M11(11,8) M5(5,8) M4(4,8) M7(7,8) M6(6,8) 4 M12(12,9) M9(9,9) M (10,9) 10 M6(6,9) N5(5,9) M1(1,9) M3(3,9) M4(4,9) M7(7,9) M (8,9) 8 M11(11,9) M2(2,9) 2 0 Speaker7 Speaker8 Te s t Spe ake r q Speaker9 Figure 8.9: Word classification correctness, C ± 1 √σ10 , of the DSD&D tests where HMM classifiers are tested on all eleven other speakers in RMAV. Baseline is SSD maps (red) - Speakers 7-9. 1, M1 (1, 2), M3 (3, 2), M4 (4, 2) for Speaker 2, M1 (1, 3), M2 (2, 3), M4 (4, 3) for Speaker 3 and M1 (1, 4), M2 (2, 4), M3 (3, 4) for Speaker 4 as in Table 8.4. We also plot guessing (calculated as 1/N , where N is the total number of words in the dataset. For AVL2 this is 26, for RMAV speaker this ranges between 1362 and 1802). DSD HMM classifiers are significantly worse than SSD HMMs, as all results where p is not the same speaker as q are around the equivalent CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS97 20 Random gue s s ing D SD &D e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 M10(10,11) 10 8 6 M12(12,11) M2(2,11) M4(4,11) M1(1,11) M7(7,11) M5(5,11) M11(11,11) M12(12,12) N5(5,12) M9(9,11) M3(3,11) M6(6,11) M1(1,12) M4(4,12) M8(8,11) M10(10,10) M10(10,12) M (9,12) M5(5,10) 9 M3(3,12) M4(4,10) M3(3,10) M6(6,12) M7(7,10) M11(11,12) M2(2,10) M1(1,10) M12(12,10) M8(8,10) M2(2,12) M9(9,10)M11(11,10) M8(8,12) M7(7,12) M6(6,10) 4 2 0 Speaker10 Speaker11 Te s t Spe ake r q Speaker12 Figure 8.10: Word classification correctness, C ± 1 √σ10 , of the DSD&D tests where HMM classifiers are tested on all eleven other speakers in RMAV. Baseline is SSD maps (red) - Speakers 10-12. performance of guessing. This correlates with similar tests of independent HMM’s in [35]. This gap is attributed to two possible effects, either - the visual units are incorrect, or they are trained on the incorrect speaker. Figures 8.7, 8.8, 8.9, & 8.10 show the same tests but on the continuous speech data. It is reassuring to see some speakers significantly deteriorate the classification rates when the speaker used to train the classifier is not the same as the test speaker. As an example we look at Speaker 1 on the leftmost side of Figure 8.7. Here the test speaker is Speaker 1. The speaker-dependent maps for all 12 speakers have been used to build HMMs classifiers. But when tested on Speaker 1, only maps and models for speakers 3, 7 and 12 show a significant reduction in word correctness. All eight other speakers are within one standard error. Figure 8.8, for the RMAV speakers four to six, we see a similar trend with Speaker 4 showing the most variation of these three speakers. To lip-read Speaker 4 we actually see a significant improvement by using the map and model of Speaker 6 and less significant improvements by speakers 3, 5 and 11. In Figure 8.9 we see Speaker 11’s SD map and models majorly improve the classification of Speaker 8. However, whilst these are all signs of possibly making strides towards speaker independent classification, Speaker 12 in Figure 8.10 shows the most common trend is there is a lot of overlap between our continuous speech speakers and this natural variation is attributed to the speaker identity. Figure 8.11 shows our AVL2 DSD experiments from Table 8.6. Our results in word correctness, C, are plotted on the y-axis and we also plot the same benchmark as in Figure 8.6 (n = p = q). In our DSD tests, the HMM is allowed CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS98 50 45 Gue s s ing D SD e xpe r ime nt s SSD bas e line Wor d c or r e c t ne s s , C % 40 M3(3,3) M4(3,3) 35 M4(4,4) 30 M1(3,3) M2(3,3) M3(4,4) M1(4,4) 25 M2(4,4) M3(2,2) 20 15 M3(1,1) M1(1,1) M2(1,1) M4(1,1) M4(2,2) M1(2,2) M2(2,2) 10 5 0 Speaker1 Speaker2 Speaker3 Te s t Spe ake r q Speaker4 Figure 8.11: Word classification correctness, C ± 1 √σ7 , of the DSD tests where HMM classifiers are constructed with single-speaker dependent phoneme-toviseme maps for all four speakers in AVLetters2. Baseline is the SSD maps. to be trained on the relevant speaker, so the other tests are: M2 (1, 1), M3 (1, 1), M4 (1, 1) for Speaker 1, M1 (2, 2), M3 (2, 2), M4 (2, 2) for Speaker 2, M1 (3, 3), M2 (3, 3), M4 (3, 3) for Speaker 3 and finally M1 (4, 4), M2 (4, 4), M3 (4, 4) for Speaker 4. Now the word correctness has improved substantially which implies the previous poor performance in Figure 8.6 was not due to the choice of visemes but rather, the badly trained HMMs. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS99 20 Random gue s s ing D SD e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 10 8 6 M12(1,1) M5(1,1) M9(1,1) M10(1,1) M6(1,1) M (1,1) 8 M11(1,1) M1(2,2) M1(1,1) M2(1,1) M4(1,1) M3(1,1) M6(2,2) M5(2,2) M4(2,2) M3(2,2) M2(2,2) M10(2,2) M9(2,2) M12(2,2) M8(2,2) M7(2,2) M12(3,3) M3(3,3) M5(3,3) M11(2,2) M7(3,3) M11(3,3) M4(3,3) M6(3,3) M8(3,3) M (3,3) M2(3,3) 10 M1(3,3) M9(3,3) M7(1,1) 4 2 0 Speaker1 Speaker2 Te s t Spe ake r q Speaker3 Figure 8.12: Word classification correctness, C ± 1 √σ10 , of the DSD tests where HMM classifiers are constructed with single-speaker dependent phoneme-toviseme maps for all speakers in RMAV and tested on others. Baseline is SSD maps (red), results shown for HMMs trained on speakers 1-3. 20 Random gue s s ing D SD e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 10 M12(5,5) 8 M6(4,4) M9(4,4) M12(4,4) M4(4,4) M (4,4) M10(5,5) M (5,5) M6(5,5) 8 M9(5,5) M3(5,5) 5 6 M2(4,4) M1(4,4) M3(4,4) M8(4,4) M7(4,4) M10(4,4) M2(5,5) M11(4,4) M1(5,5) M5(5,5) M (5,5) 7 M5(6,6) M7(6,6) M12(6,6) M11(6,6) M10(6,6) M4(6,6) M6(6,6) M3(6,6) M9(6,6) M11(5,5) M8(6,6) M1(6,6) M2(6,6) M4(5,5) 4 2 0 Speaker4 Speaker5 Te s t Spe ake r q Speaker6 Figure 8.13: Word classification correctness, C ± 1 √σ10 , of the DSD tests where HMM classifiers are constructed with single-speaker dependent phoneme-toviseme maps for all speakers in RMAV and tested on others. Baseline is SSD maps (red), results shown for HMMs trained on speakers 4-6. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS100 20 Random gue s s ing D SD e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 10 8 M1(7,7) M5(7,7) M8(7,7) M12(7,7) M6(7,7) M7(7,7) M4(7,7) M9(7,7) M11(7,7) M3(7,7) M10(7,7) M2(7,7) M1(8,8) M2(8,8) 6 M10(8,8) M9(8,8) M12(8,8) M3(8,8) M8(8,8) M11(8,8) M5(8,8) M4(8,8) M7(8,8) M6(8,8) 4 M12(9,9) M9(9,9) M (9,9) 10 M6(9,9) M5(9,9) M1(9,9) M3(9,9) M4(9,9) M7(9,9) M (9,9) 8 M11(9,9) M2(9,9) 2 0 Speaker7 Speaker8 Te s t Spe ake r q Speaker9 Figure 8.14: Word classification correctness, C ± 1 √σ10 , of the DSD tests where HMM classifiers are constructed with single-speaker dependent phoneme-toviseme maps for all speakers in RMAV and tested on others. Baseline is SSD maps (red), results shown for HMMs trained on speakers 7-9. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS101 20 Random gue s s ing D SD e xpe r ime nt s SSD bas e line 18 Wor d c or r e c t ne s s , C % 16 14 12 M10(11,11) 10 M2(11,11) M4(11,11) M1(11,11) M (11,11) M (11,11) 7 M3(11,11) 8 6 M10(10,10) M5(10,10) M4(10,10) M3(10,10) M7(10,10) M2(10,10) M1(10,10) M12(10,10) M8(10,10) M11(10,10) M9(10,10) M6(10,10) 5 M6(11,11) M12(11,11) M11(11,11) M9(11,11) M1(12,12) M8(11,11) M2(12,12) M12(12,12) M5(12,12) M4(12,12) M3(12,12) M6(12,12) M10(12,12) M9(12,12) M8(12,12) M7(12,12) M11(12,12) 4 2 0 Speaker10 Speaker11 Te s t Spe ake r q Speaker12 Figure 8.15: Word classification correctness, C ± 1 √σ10 , of the DSD tests where HMM classifiers are constructed with single-speaker dependent phoneme-toviseme maps for all speakers in RMAV and tested on others. Baseline is SSD maps (red), results shown for HMMs trained on speakers 10-12. The equivalent graphs for the 12 RMAV speakers are in Figures 8.12, 8.13, 8.14 and 8.15. Now we can see the effects of the unit selection. Using Speaker 1 for example, in Figure 8.12 the three maps M3 , M7 and M12 all significantly reduce the correctness for Speaker 1. In contrast, for Speaker 2 there are no significantly reducing maps but maps 1, 4, 5, 6, 9 and 11 all significantly improve the classification of Speaker 2. This suggests its not just the speakers identity which is important for good classification but how it is used. Some individuals may simply be easier to lip read (for reasons as yet unknown) or there are similarities between certain speakers which when learned properly on one speaker are able to better classify the rarer visual distinctions between phonemes on similar other speakers. In Figure 8.14 we see Speaker 7 is particularly robust to visual unit selection for the classifier labels. Conversely Speakers 5 (Figure 8.13) and 12 (Figure 8.15) are really affected by the visemes (or phoneme clusters). Its interesting to note this is a variability not previously considered, some speakers may be dependent on good visual classifiers and the mapping back to acoustics utterances, but others not so much. Again, the number of visual classifiers really does vary subject to the speaker identity. Figure 8.16 shows the mean word correctness of the DSD classifiers per speaker in RMAV. The y-axis shows the % word correctness and the x-axis is a speaker per point. We have also plotted random guessing and one standard error over the ten folds. Speaker 11 is the best performing speaker irrespective of the P2V selected. All speakers have a similar standard error but a low mean within this bound. This suggests subject to speaker similarity, there is more possibility to improve classification correctness with another speakers visemes (if they include the original speakers visual cues) than to use weaker CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS102 20 All s pe ake r me an wor d c or r e c t ne s s , C % 18 Random gue s s ing Me an D SD &D 16 14 12 10 8 6 4 2 0 1 2 3 4 5 6 7 8 Te s t Spe ake r q 9 10 11 12 Figure 8.16: All-speaker mean word classification correctness, C, of the DSD classifiers constructed with single-speaker dependent phoneme-to-viseme maps for twelve speakers in RMAV and tested on others. Baseline is SSD maps (red) and error bars show ±1 √σ10 . self-clustered visemes. The performance of each viseme set is ranked by speaker by weighting the effect of the DSD tests. Each map scores as in Table 8.18. If a map increases on SSD performance within error bar range this scores +1 or outside error bar range scores +2. If a map decreases classification on SSD performance, these values are negative. Table 8.18: Weighted ranking scores from comparing the use of speakerdependent maps for other speaker lip-reading in isolated word speech (AVLetters2 speakers). Sp01 Sp02 Sp03 Sp04 Total M1 0 −1 −2 −1 −4 M2 +1 0 −2 +1 0 M3 +2 +2 0 −1 +3 M4 +2 +1 −1 0 +2 Therefore these values show M3 is the best of the four AVL2 SSD maps, followed by M4 , M2 and finally M1 is the most susceptible to speaker identity in AVL2. Note this order matches a decreasing order of quantity of visemes in the speaker-dependent viseme sets i.e. the more similar to phoneme classes visemes are, then the better the classification performance. This ties in with Table 8.15, where the larger P2V maps create less homophones. In Table 8.3, which lists our AVL2 speaker-dependent P2V maps, the phoneme CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS103 pairs {/@/, /eh/}, {/m/, /n/} and {/ey/, /iy/} are present for three speakers and {/2/, /iy/} and {/l/, /m/} are pairs for two speakers. Of the singlephoneme visemes, {/tS/} is present three times, {/f /}, {/k/}, {/w/} and {/z/} twice. The lesson from Figure 8.11, is the selection of incorrect units, whilst detrimental, is not as devastating as training classification classes on alternative speakers. Table 8.19: Weighted scores from comparing the use of speaker-dependent maps for other speaker lip-reading in continuous speech (RMAV speakers). Sp01 Sp02 Sp03 Sp04 Sp05 Sp06 Sp07 Sp08 Sp09 Sp10 Sp11 Sp12 Total M1 0 +2 −2 −2 −2 −1 +1 −1 −2 −2 −1 −1 −9 M2 −1 0 −2 −1 −1 −1 −1 −1 −2 −2 +1 −2 −11 M3 −2 +1 0 −1 +2 −1 −1 +1 −1 −1 −1 −2 −6 M4 −2 +1 −2 0 −2 +1 +1 −1 −2 −1 +1 −1 −7 M5 +1 +2 +1 +1 0 +2 +1 −1 −1 −1 +1 −1 +3 M6 −1 +2 −1 +1 +1 0 +1 −2 −1 −2 −1 −2 −5 M7 −1 +1 −1 −2 −1 +2 0 −2 −1 −2 +1 −2 −8 M8 −1 +1 −2 −2 +2 −1 +1 0 −2 −2 −1 −2 −9 M9 +1 +2 −2 +1 +1 −1 −1 +1 0 −2 −1 −2 −3 M10 +1 +2 −2 −1 +2 +1 −1 +2 −1 0 +2 −1 −4 M11 −1 +1 −2 −2 −1 +1 +1 +1 −2 −2 0 −2 −8 M12 +1 +2 +1 +1 +2 +2 +1 +1 +1 −2 +2 0 +12 The same measure has been listed in Table 8.19 for our 12 RMAV speakers. The key observation in this table is Speaker 12 on the far right column. The speaker dependent map of Speaker 12 is one of only two (M12 and M5 ) which make an overall improvement on other speakers classification (they have positive values in the total row at the bottom of Table 8.19), and crucially, M12 only has one speaker (Speaker 10) for whom the visemes in M12 does not make an improvement in classification. The one other speaker P2V map which improves over other speakers is M5 . All others show a negative effect, this reinforces our assertion visual speech is dependent upon the individual but we also now have evidence there are exceptions to the rule. In order the RMAV P2Vs are: 1. M12 6. M3 2. M5 7. M4 3. M9 8. M7 and M11 4. M10 9. M1 and M8 5. M6 10. M2 Figure 8.17 shows the correctness of both the MS viseme class set and the SI tests (Tables 8.10 and 8.13) against our SSD baseline for AVL2 speakers. Word correctness, C is plotted on the y-axis. For the multi-speaker classifiers, CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS104 50 45 Gue s s ing SSD Bas e line Mult i-s pe ake r Le ave -one -out Wor d c or r e c t ne s s , C % 40 M (3,3) 3 35 M124(3,3) M4(4,4) 30 25 M1234(3,3) M1234(4,4) M123(4,4) 20 15 M1(1,1) M234(1,1) M2(2,2) M1234(2,2) M134(2,2) 10 M1234(1,1) 5 0 Speaker1 Speaker2 Speaker3 Te s t Spe ake r q Speaker4 Figure 8.17: Word classification correctness, C ± 1 √σ7 , of the classifiers using MS and SI phoneme-to-viseme maps on AVLetters2 speakers. Baseline is SSD maps (red). these are all built on the same map Mall , and tested on the same speaker so, p = q. Therefore the tests are: Mall (1, 1), Mall (2, 2), Mall (3, 3), Mall (4, 4). To test the SI maps, we plot M!1 (1, 1), M!2 (2, 2), M!3 (3, 3) and M!4 (4, 4). Again the same baseline is repeated where n = p = q for reference. There is no significant difference on Speaker 2, and while Speaker 3 word classification is reduced, it is not eradicated. It is interesting for Speaker 3, for whom their speaker-dependent classification was the best of all speakers, the SI map (M!3 ) out performs the multi-speaker viseme classes (Mall ) significantly. This maybe due to Speaker 3 having a unique visual talking style which reduces similarities with Speakers 1, 2 & 4. But more likely, we see the /iy/, phoneme is not classified into a viseme in M3 , whereas it is in M1 , M2 & M4 and so re-appears in Mall . Phoneme /iy/ is the most common phoneme in the AVL2 data. This suggests it may be best to avoid high volume phonemes for speakerdependent visemes as we are trying to maximise on the speaker individuality to make better viseme classes. We have plotted the same MS & SI experiments on RMAV speakers in Figures 8.18 and 8.19 (six speakers in each figure). In continuous speech, all bar Speaker 2 are significantly negatively affected by using generalised multispeaker visemes, whether the visemes include the test speakers phoneme confusions or not. This reminds us of the dependency on speaker identity in machine lip-reading but we do see the scale of this effect depends on which two speakers are being compared. For our exception speaker (Speaker 2 in Figure 8.18) there is only a insignificant decrease in correctness when using MS and SI visemes. Therefore it could be possible with making multi-speaker visemes based upon groupings of visually similar speakers, even better visemes could be created. The challenge remains in knowing which speakers should be CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS105 20 18 Random gue s s ing SSD bas e line Mult i-s pe ake r Le ave -one -out Wor d c or r e c t ne s s , C % 16 14 12 10 8 M1(1,1) M3(3,3) M2(2,2) 6 M4(4,4) M5(5,5) M6(6,6) Mall(2,2) M!2(2,2) Mall(4,4) Mall(1,1) M!1(1,1) 4 Mall(3,3) M!4(4,4) Mall(6,6) M!6(6,6) Mall(5,5) M!5(5,5) M!3(3,3) 2 0 Speaker1 Speaker2 Speaker3 Speaker4 Te s t Spe ake r q Speaker5 Speaker6 Figure 8.18: Mean word correctness, C ± 1 √σ10 , of the classifiers using MS and SI phoneme-to-viseme maps on RMAV speakers. Baseline is SSD maps (red) - Speakers 1-6. 20 18 Random gue s s ing SSD bas e line Mult i-s pe ake r Le ave -one -out Wor d c or r e c t ne s s , C % 16 14 12 10 M!10(10,10) 8 M7(7,7) M!8(8,8) M7(7,7) 6 Mall(11,11) M!9(9,9) M10(10,10) M11(11,11) Mall(7,7) M!7(7,7) M!11(11,11) M12(12,12) M8(8,8) Mall(8,8) 4 M9(9,9) Mall(9,9) M10(10,10) Mall(10,10) 2 0 Speaker7 Speaker8 Speaker9 Speaker10 Te s t Spe ake r q Speaker11 Speaker12 Figure 8.19: Mean word correctness, C ± 1 √σ10 , of the classifiers using MS and SI phoneme-to-viseme maps on RMAV speakers. Baseline is SSD maps (red) - Speakers 7-12. grouped together before undertaking P2V map derivation. CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS106 8.7 Speaker independence between sets of visemes For isolated word classification our main conclusion of this chapter is shown by comparing Figures 8.11 & 8.17 with Figure 8.6. The reduction in performance in Figure 8.6 is when the system classification models are trained on a speaker who is not the test speaker. This raised the question if this degradation was due to the wrong choice of P2V map or speaker identity mismatch between the training and test data samples. We have concluded that, whilst the wrong unit labels are not conducive for good lip-reading, is it not the choice of phonemeto-viseme map which causes significant degradation to accurate classification, but rather the speaker identity. This regain of performance is irrespective of whether the map is chosen for a different speaker, multi-speaker or independently of the speaker. This observation is important as it tells us the repertoire of visual units across speakers does not vary significantly. This is comforting since the prospect of classification using a symbol alphabet which varies by speaker is daunting. This is further reinforced by Tables 8.3, 8.8 & 8.12. There are differences between speakers, but not significant ones. However, we have seen some exceptions within our continuous speech speakers whereby the effect of the P2V map selection is more prominent and where sharing HMMs trained on non-test speakers has not been completely detrimental. This gives some hope with similar visual speakers, and with more ‘good’ training data speaker independence, whether by classifier or viseme selection, might be possible. To provide an analogy; in acoustic speech we could ask if an accented Norfolk speaker requires a different set of phonemes to a standard British talker? The answer is no. They are represented by the same set of phonemes; but due to their individuality they use these phonemes in a different way. Comparing our multi-speaker and SI maps, there are 11-12 visemes per set whereas in our single-speaker-dependent maps we have a range of 12 to 17. It is M3 with 17 visemes, which out performs all other P2V maps. So we can conclude, there is a high risk of over-generalising a speaker-dependent P2V map when attempting multi-speaker or speaker-independent phonemeto-viseme mappings. This is something we have seen with our RMAV experiments. Therefore we must consider it is not just the speaker-dependency which varies but also the contribution of each viseme within the set which also contributes to the word classification performance, an idea first shown in [17]. Here we have highlighted some phonemes which are a good subset of potentially independent visemes {/@/, /eh/}, {/m/, /n/} and {/ey/, /iy/}, and what these results present, is a combination of certain phoneme groups combined with some speaker-dependent visemes, where the latter provide a lower contribution to the overall classification would improve speaker-independent maps with speaker-dependent visual classifiers. We compare our speaker independent results to the AAM results of Neti et al. [108] and we see our results are inferior overall. Neti et al. achieved a w.e.r CHAPTER 8. SPEAKER-INDEPENDENCE IN PHONEME-TO-VISEME MAPS107 of 64% compared to our accuracy of around 5% (with AVL2) and between 6-10% with RMAV. We attribute this to the training data volumes in each dataset. The IBM via voice dataset [99] used in [108] is not publicly available but as it has 290 speakers and 10,500 word vocabulary, compared to RMAV which has 12 speakers and 1000 words per speaker. It is often said in machine lip-reading there is high variability between speakers. This should now be clarified to state there is not a high variability of visual cues given a language, but there is high variability in trajectory between visual cues of an individual speakers with the same ground truth. In continuous speech we have seen how not just speaker identity affects the visemes (phoneme clusters) but also how the robustness of each speakers classification varies in response to changes in this. This implies a dependency upon the number of visemes within each set for individuals so this is what we investigate in the next chapter. Chapter 9 Finding phonemes Due to the many-to-one relationship in traditional mappings of phonemes to visemes, any resulting set of visemes will always be smaller than the set of phonemes. We know a benefit of this is more training samples per class which compensates for the limited data in currently available datasets but the disadvantage is generalisation between different articulated sounds. To find an optimal set of viseme classes, we need to minimise the generalisation to maintain good classification but also to maximise the training data available. In Chapter 7 we have shown how P2V maps can be derived automatically from phoneme confusions. A by-product of clustering phonemes from classification data is the option to control how many visemes a set contains within the phoneme clustering algorithm. This allows precision when answering questions about the optimal number of visemes. We ask how many visemes is the optimum number? And does this optimum vary by speaker in visual speech? For this work we use the RMAV dataset [79] and BEEP pronunciation dictionary [26]. Figure 9.1 shows a high level overview of the experiment. It begins by performing classification using phoneme-labelled classifiers. This provides a set of speaker-dependent confusion matrices which are used to cluster together single phonemes (monophones) into subgroups, or as we call them, visemes. This time around, we adopt a different phoneme clustering process (described in subsection 9.2). By this process, a new P2V mapping is derived for every time a pair of classes is re-classified in to a new class grouping. There are a maximum of 45 phonemes in the phonetic transcript of the RMAV speakers. This means we can create up to 45 P2V maps per speaker. The actual number of maps produced is subject to the number of phonemes matched during the phoneme classification (step 1 of Figure 9.1). This first step produces the phoneme confusion matrices from which we create new phoneme clusters into visemes. If a phoneme has not been classified, either incorrectly or correctly, then it is not included in the resulting confusion matrix from which our visemes are created. Thus, we now have up to 45 sets of viseme labels to use for labelling our HMMs when repeating the word classification task. We continue with analysing the word classification rather than visemes as we do not wish our results to be affected by the variance in training samples 108 CHAPTER 9. FINDING PHONEMES 109 Figure 9.1: Three-step high-level process for viseme classification where the visemes are derived from phoneme confusions. for each set of classifiers. It is not the performance itself which is relevant here, rather it is any improvement a variance in classes can provide. It is important the reader remember the presentation of this new method is not a suggestion this particular clustering algorithm will deliver the optimum visemes, but rather address the need in this case for a method to enable a controlled comparison of the phoneme to viseme distributions as the number of classes reduces. 9.1 Step One: phoneme classification Step 1 implements 10-fold cross-validation with replacement [42], of 200 sentences per speaker, 20 are randomly selected as test samples and are not included in the training folds. Using the HTK toolkit [?] to implement HMM classifiers, the HMMs are initialised by the flat-start method, and re-estimated 11 times with forced alignment between seventh and eighth estimates. The prototype HMM is based upon a Gaussian mixture of five components and three state HMMs. Included is a single-state tied short-pause, or ‘sp’ HMM for short silences between words in the sentence utterances. A bigram word network is used to support classification. 9.2 Step Two: phoneme clustering The phonemes are clustered into new viseme classes for each speaker as follows; step 1 produces ten confusion matrices for each speaker (one from each fold), these are summed together to form one confusion matrix representing all confusions for that speaker. Clustering begins with this phoneme confusion matrix: [Km ]ij = N (p̂j |pi ) (9.1) where the ij th element is the count of the number of times phoneme i is classified as phoneme j. This algorithm works with the column normalised version, [Pm ]ij = P r{pi |p̂j } (9.2) CHAPTER 9. FINDING PHONEMES 110 Table 9.1: An example phoneme-to-viseme map, this is the phoneme-to-viseme map for RMAV Speaker 1 with ten visemes. Viseme /v01/ /v02/ /v03/ /v04/ /v05/ /v06/ /v07/ /v08/ /v09/ /v10/ Phonemes /ax/ /v/ /OI/ /f/ /Z/ /w/ /k/ /b/ /d/ /T/ /p/ /l/ /dZ/ /g/ /m/ /z/ /y/ /tS/ /D/ /s/ /r/ /t/ /S/ /n/ /hh/ /N/ /E/ /ae/ /O/ /uw/ /6/ /I@/ /ey/ /ua/ /3/ /ay/ /A/ /2/ /AU/ /U/ /@U/ /I/ /iy/ /@/ /eh/ the probability that, given a classification of pj that the phoneme really was pi . The subscript m in Km and Pm indicates Km and Pm have m2 elements (m phonemes). Merging of phonemes is done by looking for the two most confused phonemes and hence create a new class with confusions Km−1 , Pm−1 . Specifically for each possible merged pair, P r, P s score is calculated by: q = [Pm ]rs + [Pm ]sr = P r{P̂ r|P s} + P r{P̂ s|P r} (9.3) Phonemes are assigned to one of two classes, V &C, vowels and consonants. Vowels and consonants can not be mixed. The pair with the highest q is merged. Equal scores are broken randomly. This process is repeated until m = 2. Each intermediate step, M = 45, 44, 43...2 forms a possible set of visual units. This is a more controlled approach than the method used in Chapter 7 and [16], and incorporates our conclusions vowel and consonant phonemes should not be clustered together when devising phoneme-to-viseme mappings. An example P2V mapping is shown in Table 9.1. 9.3 Step Three: viseme classification Similar to step 1, step 3 involves implementation of 10-fold cross-validation with replacement [42], of 200 sentences per speaker, 20 are randomly selected as test samples and these are not included in the training folds. Using the HTK toolkit [?] to use Hidden Markov Model (HMM) classes, viseme labelled HMMs are flat-started, re-estimated 11 times over with forced alignment between seventh and eighth estimates. The same HMM prototype is used and a bigram word network supports classification along with the application of a grammar scale factor of 1.0 (shown to be optimum in [67]) and a transition penalty of 0.5. CHAPTER 9. FINDING PHONEMES 111 The important difference this time around are the viseme classes being used as classification labels. By using these sets of classes which have been shown in step 1 to be confusing on the lips, we now perform classification for each class set. In total this is 45 sets, where the smallest set is of two classes (one with all the vowel phonemes and the other all the consonant phonemes), and the largest set is of 45 classes with one phoneme in each - thus the largest set for each speaker is a repeat of the phoneme classification task but using only phonemes which were originally recognised (either correctly or incorrectly) in step 1. 9.4 Searching for an optimum In Figures 9.2 - 9.13, we show the word correctness, plotted on the y-axis for all 12 speakers. Each of the viseme sets, identified by the number of visemes within the set, are plotted in increasing order along the x-axis. We have also plotted, in green, guessing weighted by the visual homophones in the transcripts. This has been calculated by: i=N X 1 T Ci )∗( ) (9.4) ( W N i=1 where T C is the total individual token count for that speaker (for each token), W is the total words for that speaker, and N is the number of tokens. i is for all each token where a token is a unique word. Viseme sets containing fewer visemes produce viseme strings which represent more than one word: homophones. The effect of homophones can be seen on the left side of the graphs in Figures 9.2 - 9.13 with viseme sets with fewer than 11 visemes. CHAPTER 9. FINDING PHONEMES 112 Wor d c las s ific at ion C % 10 9 Spe ake r 1: 8 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 7 6 34 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.2: Speaker 1: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. 10 9 21 Wor d c las s ific at ion C % 8 7 6 5 4 3 Spe ake r 2: 2 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.3: Speaker 2: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. CHAPTER 9. FINDING PHONEMES 113 Wor d c las s ific at ion C % 10 9 Spe ake r 3: 8 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 33 7 30 6 24 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.4: Speaker 3: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. 10 9 Spe ake r 4: Cor r e c t ne s s We ight e d gue s s ing Wor d c las s ific at ion C % 8 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.5: Speaker 4: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. CHAPTER 9. FINDING PHONEMES 114 Wor d c las s ific at ion C % 10 9 Spe ake r 5: 8 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 7 6 16 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.6: Speaker 5: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. Wor d c las s ific at ion C % 10 9 Spe ake r 6: 8 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 34 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.7: Speaker 6: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. CHAPTER 9. FINDING PHONEMES 115 10 9 Spe ake r 7: Cor r e c t ne s s We ight e d gue s s ing Wor d c las s ific at ion C % 8 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.8: Speaker 7: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-45. 10 9 Spe ake r 8: Cor r e c t ne s s We ight e d gue s s ing Wor d c las s ific at ion C % 8 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.9: Speaker 8: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-44. CHAPTER 9. FINDING PHONEMES 116 Wor d c las s ific at ion C % 10 9 Spe ake r 9: 8 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 7 6 11 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.10: Speaker 9: word classification correctness, C ± 1 √σ10 for phonemeto-viseme map sizes 2-44. 10 9 Spe ake r 10: Cor r e c t ne s s We ight e d gue s s ing Wor d c las s ific at ion C % 8 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.11: Speaker 10: word classification correctness, C ±1 √σ10 for phonemeto-viseme map sizes 2-44. CHAPTER 9. FINDING PHONEMES 117 10 9 Spe ake r 11: Cor r e c t ne s s We ight e d gue s s ing Wor d c las s ific at ion C % 8 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.12: Speaker 11: word classification correctness, C ±1 √σ10 for phonemeto-viseme map sizes 2-44. Wor d c las s ific at ion C % 10 9 Spe ake r 12: 8 Cor r e c t ne s s We ight e d gue s s ing Impr oving Se t 35 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.13: Speaker 12: word classification correctness, C ±1 √σ10 for phonemeto-viseme map sizes 2-44. CHAPTER 9. FINDING PHONEMES 118 All correctness scores are significantly above chance albeit still low. There is variation between speakers, which is expected but there is a very clear overall trend. Superior performances are to be found with larger numbers of visemes. An important point is some authors report word accuracy as viseme performance when using a word unit language network. This is unhelpful as it masks the effect of homophones by using the network level unit rather than the accuracy of the viseme models themselves. Had we reported this then the effect of needing larger numbers of visemes would not be visible. Also in Figures 9.2 - 9.13, we have highlighted the class sets in red where these show a significant improvement in classification over the adjacent set of units on its right side along the x-axis. This is where we can identify the pairs of classes which, when merged into one class, significantly improve classification. Table 9.2 lists these special viseme combinations. Referencing back to speaker demographics (such as gender or age), there is no apparent pattern through these viseme combinations. So we have further evidence to reinforce the knowledge that all speakers are visually unique and we are reminded of how difficult finding a set of cross-speaker visemes is when phonemes require alternative groupings for each individual. Table 9.2: Viseme class merges which improve word classification in correctness; Vn = Vi + Vj . Speaker Sp01 Sp02 Sp03 Sp03 Sp03 Sp05 Sp06 Sp09 Sp12 Set No 35 22 34 31 25 17 35 12 36 Vi /s/ /r/ /d/ /b/ /tS/ /Z/ /b/ /tS/ /p/ /r/ /ae/ /ae/ /2/ /b/ /w/ /v/ /2/ Vj /D/ /z/ /y/ /Z/ /z/ /N/ /eh/ /iy/ /dZ/ /hh/ /O/ Set No 34 21 33 30 24 16 34 11 34 Vn /s/ /r/ /D/ /d/ /z/ /y/ /b/ /tS/ /Z/ /Z/ /b/ /tS/ /z/ /p/ /r/ /N/ /ae/ /eh/ /ae/ /2/ /iy/ /b/ /w/ /v/ /dZ/ /hh/ /2/ /O/ The conventional wisdom, that visemes are needed for lip-reading, (in [57] for example), is countered in our experiments as our phoneme classification is not significantly different from viseme classification. It is however an over simplification to assert better lip-reading can be achieved with phonemes than visemes as this has not been shown here with any significance. Generally speaking, larger numbers of visemes out-perform smaller numbers. However, when classification is aggregated in Figure 9.14, which is the mean word correctness, C, classification over all speakers, there is, within an error bar, a monotonic trend. In Figure 9.14 we have also plotted the system error instead of guessing. System error is calculated by using the ground truth transcript of the test data in place of the classifiers output in HResults, in doing so we obtain any errors caused by the system rather than the classifiers. Fortunately, this is zero, demonstrating the robustness of an HMM lip-reading system. In the literature we have already reviewed a number of proposed phoneme- CHAPTER 9. FINDING PHONEMES 119 10 All s pe ake r me an wor d Cor r e c t ne s s 9 Me an c or r e c t ne s s Sys t e m e r r or 8 7 6 5 4 3 2 1 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 Quant ity of vis e me s in s e t Figure 9.14: All-speaker mean word classification correctness C ± 1 √σ10 . to-viseme maps, typically these generate between 10 and 20 visemes (see subsection 7.4 for a summary) - the Lee set has six consonant visemes and five vowel visemes [82]; Jeffers eight & three [69] respectively and so on. Figures 9.2-9.13 & 9.14 show a definite rapid drop-off in performance for sets which contain fewer than ten visemes but the region between 11 and 20 contains the optimum viseme set for three out of the 12 speakers which is more than chance. This mean, for each speaker we have shown an optimal number of visual units (shown by the best performing result in Figures 9.2-9.13) but the optimal number is not related to any of the conventional viseme definitions, neither is the number of phonemes. Table 9.3 shows the correctness of each speakers phoneme classification. Table 9.3: Phoneme correctness C for each speaker, these are plotted on the right hand side in Figures 9.2 to 9.13 as the largest set of visemes (either 44 or 45, subject to the speaker). Speaker Phoneme C Speaker Phoneme C 1 0.045 7 0.055 2 0.060 8 0.090 3 0.058 9 0.063 4 0.049 10 0.071 5 0.063 11 0.061 6 0.063 12 0.064 The implication is that, for a few speakers, it is possible to conclude a small number of visemes are optimal. However, when considering all speakers, it is much more likely phonemes provide a better set of classifier labels for classification. The two factors at play in these graphs are, the underlying accuracy with CHAPTER 9. FINDING PHONEMES 120 which the visual units represent the mouth shape and appearances versus the introduction of homophones. For large numbers of visemes these are close to phonetic classification, (with fewer homophones) but they run the risk of visual units which are not visually distinctive - several of the HMM models will “match” on a particular sub-sequence. This latter problem creates a decoding lattice in which there are several near equal probability paths which, in turn, implies state-of-the-art language models would improve results still further. 9.5 Hierarchical training for weak-learned visemes Some recent work presents evidence viseme labels may not be needed because with enough data, classifiers based upon phoneme labels can outperform viseme classification [67, 57]. Additionally, we have now seen there are challenges with using viseme/phoneme labelled classifiers including; the homophone effect, not enough training data per class, and the consequential lack of differentiation between classes when we get too many classes to distinguish between them. These can be seen in Figure 9.15 where we have replotted word correctness for 12 speakers from Section 9.4 onto one graph. Figure 9.15 shows our previous results [15], derived using the algorithm described in [16]. We were able to generate viseme sets of varying size. Here the x-axis runs from 2 to 45. The y-axis shows the word correctness of HMM classifiers trained on each viseme in the viseme set. There are 12 lines for the 12 RMAV speakers. 0.1 HTK wor d r e c ognit ion Cor r e c t ne s s 0.09 21 0.08 34 35 33 0.07 30 0.06 16 11 0.05 34 24 0.04 0.03 0.02 0.01 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 Quant ity of vis e me s in s e t Figure 9.15: Viseme correctness as the quantity of visemes decreases in a set of classifiers for 12 RMAV speakers. Results from [15]. Figure 9.15 also shows for each of our 12 speakers the significantly improving CHAPTER 9. FINDING PHONEMES 121 viseme sets listed in Table 9.2. So we know there are sometimes units between traditional visemes and phonemes which are better for classification of the visual speech signal. Our evidence is pointing towards a larger number of visual units than was previously thought sensible. In the extreme example, if we assume one visual unit per phoneme then there is the problem that identical lip gestures may appear in two separate visemes. To examine this, we propose the concept of adopting weak learning for hierarchical classifier training. Our intention is to test if this method can improve phoneme classification without the need for more training data as this approach shares training data across models. This premise avoids the negative effects of introducing more homophones but will assist the identification of the more subtle but important differences in visual gestures representing alternative phonemes. Crucially, this method means we are increasing our valid training data without needing to create or record it. We remember from Chapter 7 using the wrong clusters of phonemes is worse than using none. Weak learning [127] is an alternative approach to training classification models in lip-reading. Weak learning is traditionally applied in ensembles of classifiers where the sum of the classifiers produces a stronger classifier than that of the independently-weak-trained classifiers [41]. By acknowledging the poor performance of our viseme labelled classifiers we can assume that they are weakly trained. That is, that whilst they outperform guessing, they are not strongly trained classifiers (confirmed by our dependence on the language model to improve results). Thus, we if we can adopt a method which boosts these weakly trained viseme classifiers into strongly trained phoneme classifiers we hope to achieve significantly higher classification rates. This also encourages use of more training data for the weak-learning phase [43], and specialised training of specific phoneme samples for the phoneme classifier training phase. Therefore our last investigation in this thesis is an attempt to modify the lip-reading process in which we apply weak learning during classifier training, to test if the visual signal can be better translated from visemes to phonemes to better train classifiers with the same volume of visual data, whilst improving the classification. In doing so, our method addresses the challenges identified in this chapter thus far. An additional benefit of the the revised classification process is because weak learning in the model training phase is before phoneme classification, we no longer need to consider post-classification-processing such as weighted finite state transducers [66] to reverse the phoneme-to-viseme mapping in order to get the real phoneme recognised. In Figure 9.15 the performance of classifiers with small numbers of visemes (< 10) is poor due to the large number of homophones. Large numbers of visemes (> 35) do not appear to noticeably improve the correctness: many phonetic variations look similar on the lips. The set numbers printed in black are the significantly improving viseme sets identified by the number of visemes in the set. Therefore we focus on viseme sets in the range 11 to 35 with the same speakers for our experiments using weak learning. CHAPTER 9. FINDING PHONEMES 9.6 122 Classifier training adaptation The basis of the new training approach is to hierarchically train HMM classifiers. Figure 9.16 shows a stylised illustration in which we have five phonemes (in reality there are 45) and two visemes (in reality there will be between 11 and 35). Each phoneme has been assigned to a viseme as in [15] but here we are going to learn intermediate HMMs which are identical to those in [15]. These are the viseme HMMs. We now create models for the phonemes. In this example /p1/, /p2/ and /p4/ are associated with /v1/, so are initialised as replicas of HMM /v1/. Likewise /p3/ and /p5/ are initialised as replicas of /v2/. We now retrain the phoneme models using the same training data. Figure 9.16: Hierarchical training strategy for weak learning of visemes HHMs into phoneme labelled HMM classifiers. In full; we initialise viseme HMMs with HCompV, the HTK tool HCompV used for initialising HMMs defines all models equal [151]. Our prototype HMM is based upon a Gaussian mixture of five components and three states. These are trained 11 times over, including both short pause model state tying (between re-estimates 3 & 4), and forced alignment between re-estimates 7 & 8 (this is steps 1 & 2 in Figure 9.16). But before classification, these viseme HMM definitions are used as initialised definitions for phoneme labelled HMMs (Figure 9.16 step 3). The respective viseme HMM definition is used for all the phonemes in its relative phoneme-to-viseme map. These phoneme HMMs are retrained and used for classification. As part of the classification, we use a bigram network, apply a grammar scale factor of 1.0 and apply a transition penalty of 0.5 (based on [67]). This is implemented using 10-fold cross-validation with CHAPTER 9. FINDING PHONEMES 123 replacement [42]. The advantage of this approach is the phoneme classifiers have seen mostly positive cases therefore have good mode matching, the disadvantage is they are limited in their exposure to negative cases, less than the visemes. 9.6.1 Language network units As we are investigating the correct unit selection for our classifiers, we must not forget about the unit selection for the language network which is used to decode classification transcripts. This means we need to review any effect of the language network unit choice before our final experiment. Using the common process previously described for lip-reading, we perform classification using speaker-dependent visemes [16], phonemes and word HMMs with the optional unit networks as listed in Table 9.4. This means we can answer the question ‘is there any dependency between the unit choice for the classifier labels and the unit of supporting language network?’. Table 9.4: Unit selection pairs for HMMs and language network combinations. Classifier units Viseme Viseme Viseme Phoneme Phoneme Word 9.6.2 Network units Viseme Phoneme Word Phoneme Word Word C 0.0231 0.1914 0.0851 0.1980 0.1980 0.1874 Linguistic content The linguistic content of any dataset has an impact on a computer lip-reading classification performance. Stylised texts have more structure and restrictions on how a speech or utterance can be organised therefore classification becomes a simpler task. In our case, with the RMAV dataset we have the challenge of lip-reading continuous speech, this is much more difficult as the complexity of the task grows with the size of the variability in what is being said, in what order and how. As part of the classification task, we ask where does the error rate come from? Which phonemes/visemes are currently recognisable? By this we mean, are there some phonemes which help the classification task more than others, can a classifier place more weight on these phonemes to improve their classification performance? Within HTK classification, grammar networks built on probability statistics of the training data have a priori knowledge of linguistic content at a word or phoneme level to improve lip-reading classification. But when considering natural continuous speech, this makes a word or phoneme/viseme network exceptionally large in order to permit any order CHAPTER 9. FINDING PHONEMES 124 Table 9.5: All-speaker error counts for different combinations of units for HMM classifiers with bigram support networks. HMM units run vertically and network units run horizontally through the table. Viseme Phoneme Word Viseme 0.0005 - Phoneme 0.0043 0.0036 - Word 0.0063 0.0036 0.0 combination of utterances. Likewise, a higher-order N-gram language model may improve classification rates but the cost of this model is disproportionate to our intention to develop better classifiers. Dictionaries help to define the vocabulary to be recognised but in natural speech what happens when a word is uttered which is not previously known? A new slang term for example. A new entry is required to be made up of phonemes which already exist. 0.5 Ne twor k unit s : 0.45 Vis e me Phone me Wor d Me an Wor d c or r e c t ne s s , C % 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 Viseme Phoneme Clas s ifie r unit c las s labe l Word Figure 9.17: Effects of support network unit choice with varying HMM classifier units (along the x-axis) measured in all speaker mean correctness, C. Units supported by a viseme network are shown in blue, phoneme networks are in green and word networks in red. All {HMM,network} pairings are shown in Table 9.4. The effects of the network units are shown in Figure 9.17 which plots the HMM units on the x-axis against the classification in Correctness C (defined in [151]). Error bars show one standard error. Using a viseme network shows the worst classification. This can be attributed to the volume of homophones introduced by translating from words to phonemes to visemes. We no longer CHAPTER 9. FINDING PHONEMES 125 consider this option. More interesting are the word and phoneme networks. The phoneme network greatly improves classification for viseme HMMs, more so than a word network. When we use phoneme HMMs, there is no difference at all between an phoneme or word network and the standard error is identical. Thus we use both phoneme and word networks in our final method. 9.7 Effects of weak learning in viseme classifier training In analysing our results, it must be remembered whilst our HMM training is hierarchical, our testing is not. Figure 9.18 shows the mean Correctness, C, for all speakers ±1 √σ10 over 10 folds. There are four lines plotted subject to the pairings of our HMM unit labels and the language network unit. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing HTK Me an r e c ognit ion C 40 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.18: HTK Correctness C for viseme classifiers with either phoneme or word language models and weak learned phoneme classifiers with either phoneme or word language models averaged over all 12 speakers. The x-axis of Figure 9.18 is the size of the viseme sets from Figure 9.15 from 11 to 36. We remind the reader this is the range of optimal number of visemes where phoneme label classifiers do not improve classification. The baseline of viseme classification with a word network from [15] is shown in blue and is not significantly different from conventionally learned phoneme classifiers. Based on our unit selection for language network study in section 9.6.1, it is not a surprise to see just by using a phoneme network instead of a word network to support viseme classification we significantly improve our mean correctness score for all viseme set sizes for all speakers (shown in pink). Guessing is CHAPTER 9. FINDING PHONEMES 126 repeated as per our first previous experiments in this chapter. Table 9.6: Minimum and maximum all speaker mean correctness, C, showing the effect of weak learning on phoneme labelled HMM classification. Visemes + word net Phonemes + word net Effect of WLT Visemes + phoneme net Phonemes + phoneme net Effect of WLT Min 0.0274 0.0905 0.0631 0.2036 0.2253 0.0217 Max 0.0601 0.0995 0.0394 0.2214 0.2367 0.0153 Range 0.0327 0.0090 – 0.0179 0.0114 – More interesting to see is our new weakly-trained phoneme HMMs are significantly better than the viseme HMMs. In the original work of [15] phoneme HMMs gave an all-speaker mean C = 0.059 . Here, regardless of the size of the original viseme set, C is almost double. Weakly learnt phoneme classifiers with a word network gain 0.0313 to 0.0403 in mean C, and when these phoneme classifiers are supported with a phoneme network we see a correctness gain range from 0.1661 to 0.1775. These gains are supported by the all speaker mean minimum and maximums listed in Table 9.6. These gain scores are from over all the potential viseme-to-phoneme mappings and show there is little difference in which phoneme-to-viseme map is best for knowing which set of visemes to initialise our phoneme classifiers. All results, including the baseline, are significantly better than guessing (shown in green). CHAPTER 9. FINDING PHONEMES 127 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.19: Speaker 1 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.20: Speaker 2 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. CHAPTER 9. FINDING PHONEMES 128 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.21: Speaker 3 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.22: Speaker 4 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. CHAPTER 9. FINDING PHONEMES 129 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.23: Speaker 5 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.24: Speaker 6 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. CHAPTER 9. FINDING PHONEMES 130 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.25: Speaker 7 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.26: Speaker 8 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. CHAPTER 9. FINDING PHONEMES 131 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.27: Speaker 9 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.28: Speaker 10 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. CHAPTER 9. FINDING PHONEMES 132 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.29: Speaker 11 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. 50 Clas s ifie r and ne twor k unit s 45 Vis e me s + wor d ne t Vis e me s + phone me ne t WLT phone me s + wor d ne t WLT phone me s + phone me ne t We ight e d gue s s ing 40 HTK Re c ognit ion C 35 30 25 20 15 10 5 0 11 13 15 17 19 21 23 25 27 Quant ity of vis e me s in s e t 29 31 33 35 37 Figure 9.30: Speaker 12 correctness of viseme sets with a word language model (blue) and the weak learned phoneme classifiers with a phoneme or word network. CHAPTER 9. FINDING PHONEMES 133 In Figures 9.19 - 9.30, we have plotted for our 12 speakers non-aggregated results showing C ±1s.e. Whilst not monotonic, these graphs are much smoother than the speaker-dependent graphs shown in [15]. The significant differences between viseme set sizes shown in Figure 9.15 have now disappeared because the learning of differences between visemes, has been incorporated into the training of phoneme classifiers, which in turn are now better trained (plotted in red and orange which improve on blue and pink respectively). Our speaker-dependent results with hierarchical learning are intriguing as in [76], with RMAV and published at the start of this thesis, showed an average viseme accuracy of ∼46%. Here, we have presented a word accuracy (which we have previously shown to be weaker than viseme accuracy but more useful) of ∼10%. We can not present viseme accuracy as our hierarchical training method has transformed the viseme classifiers into phoneme labelled classifiers, but reporting phoneme accuracy provides us with ∼25% classification. This is beneficial as phoneme transcripts are both more comprehensible due to less homophones, and reduces our dependency on the language model for comprehension. An intriguing observation is comparing the use of a phoneme network for visemes and for weakly taught phonemes. For some speakers, the weakly learned phonemes are not always as important as having the right network unit. This is seen in Figures 9.19, 9.21, 9.22, 9.26, and 9.30 for Speaker’s 1, 3, 4, 8 and 12. By rewatching the original videos to estimate the age of our speakers, we categorise them as either an ‘older’ or ’younger’ speaker. The speakers with less significant difference in the effect of weak learning are younger. This implies to lip-read a younger person we need more support from the language model, than for an older speaker. Our own informal observation is young people have more co-articulation than older people, but this is something for further investigation. 9.8 Decoding visemes This chapter has described a viseme derivation method which allows us to construct any number of visual units. The reader is reminded this is not a proposal of a new method for the best visemes, the priority objective in this case was a method for enabling comparison of viseme sets in a controlled manner. The presence of an optimum number of visemes within a set of classes is the result of two competing effects. In the first, as the number of visemes shrinks the number of homophones rises and it becomes more difficult to recognise words (correctness drops). In the second, as the number of visemes rises sufficient training data is no longer available in order to learn the subtle differences in lip-shapes (if they exist), so again, correctness drops. Thus, in theory the optimum number of visual units lies beween 1 and 45. In practice we see this optimum is between the number of phonemes and twelve (the size of one of the smaller viseme sets). CHAPTER 9. FINDING PHONEMES 134 The choice of visual units in lip-reading has caused some debate. Some researchers use visemes as adduced by, for example Fisher [48] (in which visemes are a theoretical construct representing phonemes should look identical on the lips [57]). Others have noted lip-reading using phonemes can give superior performance to visemes [67]. Here, we supply further evidence to the more nuanced hypothesis there are intermediary units, which for convenience we call visemes, that can provide superior performances provided they are derived by an analysis of the data. Figure 9.31: Second augmentation to the conventional lip-reading system to include hierarchical training of phoneme-labelled classifiers with visemes. Furthermore, we have presented a novel learning algorithm which shows improved performance for these new data-driven visemes when used in hierarchical classifier training. The essence of our method is to re-train the viseme models in a fashion similar to weak learning in order they become better phoneme-labelled classifiers. This produces significantly better classification and is our second augmentation to the lip-reading system. This is shown in Figure 9.31, the extra steps are the dash-edged boxes on the right hand side. Chapter 10 Summary of research outputs In this final chapter we summarise all we have learned throughout this thesis about decoding visemes. 10.1 Conclusions of research Our original research question was how can we further understand visemes in order to augment or replace the current HMM classifiers in conventional automatic lip-reading systems? We have learnt through our experiments that: There is a lower limit to the resolution at which a machine can lip-read, which is at least two pixels per lip. As long as videos of speakers have at least this then we can achieve some lip-reading. This is important because a high resolution video where a person’s face is so far away the pixels per lip are less than two would be worse than a close up low resolution video [14]. There is also a limitation on how useful all speaker-independent (or multispeaker) visemes within a set are towards the overall recognition. A badly trained viseme is worse than no viseme to represent certain phonemes [17]. When training visemes it is not enough to say we need more data, having bad training data is more detrimental to classification than having less. In our comparison of many of the phoneme to viseme maps in literature we have seen there is little difference between each of them but Lee’s marginally outperforms all others [16]. The majority of previous presented P2V maps have been designed from the observations of human lip-readers which are biased towards the individual perception of the human participating. The higher performing maps are more recent presentations and are data driven and/or machine trained. When clustering phonemes into visemes we can say with confidence that vowel and consonant phonemes should be isolated. This was shown by our two methods for devising speaker-dependent visemes whereby one permitted mixing of all phonemes, and the second method restricted this clustering. The second method significantly outperformed the former. Speaker individuality is important in visual speech and should be recognised when devising viseme 135 CHAPTER 10. SUMMARY OF RESEARCH OUTPUTS 136 sets due to the variability with which different people use visual gestures whilst talking [16]. Viseme sets which are too small, (less than 11), are negatively affected by homophone confusions. The sets which are too large are not able to be trained sufficiently to achieve good classification. This means with the wrong speaker and training volume combination the size of the viseme set is fragile. We have shown a range of optimum sizes from 11 to 35 [12], and demonstrated how this varies by speaker and is higher than the phoneme-to-viseme maps previously presented in literature. We show for speaker dependent recognition there is a range of choices when selecting a set of visual units containing fewer members than the phoneme set, yet these sets outperform phoneme labelled classifiers. It is considered however, for speaker independent recognition, it is still most likely that phonemes are the desirable choice for classifier units as these are consistent across speakers. Thus, in speaker-dependent recognition, the right visemes can not just outperform phoneme-labelled classifiers, but also when used to help train phoneme classifiers, they classify visual speech significantly better [13]. To support good classifiers we have seen the effect of different unit labels in the supporting language network. Best results are achieved when the unit labels are the same for both classifiers and the network, but classification is not significantly affected if not. Therefore, for the purposes of decoding phonemes back to the words spoken, the preferred network unit is words [13]. In conclusion, and to answer our research question, we have improved machine lip-reading by adopting the current HMM classification system to use speaker-specific phoneme confusions within our new clustering algorithm to produce speaker-dependent viseme sets which, in turn, make good prototype HMM classifiers to train phoneme labelled classifiers. These, together with a word labelled language network, mean we can decode visemes to improve machine lip-reading classification. 10.2 Future work Machine lip-reading is a large and complicated problem. There are many sub-problems which need to be solved within this challenge to achieve high, consistent classification. Remaining problems can be grouped into three classes using the Van Trees categories of detection, classification and estimation [141]: • Some detection problems remaining are: automatically finding a face in an image and re-identifying same speakers between cameras, when is a person speaking/not speaking? Is the face occluded? • Classification problems which remain include: Classification rates still need further improvement to be considered robust and speaker independence between the classifier training and test data is yet to produce good results. CHAPTER 10. SUMMARY OF RESEARCH OUTPUTS 137 • Finally estimation problems such as: how fast is a person speaking? What shapes do the lips form? And what is the the velocity of the lip movement? still need to be addressed. Speech recognition is a maturing field of research, but if we refer to our introduction (Section 1) we remember our motivation to improve machine lipreading classification is for two major reasons. Firstly the use of such a system would be applicable in a range of areas from entertainment (e.g. sports events) to criminal detection (e.g. CCTV recordings). Secondly, and this is the main expectation of a lip-reading system, is the integration of such a system into AVSR. A robust lip-reading system could both improve the robustness and accuracy of an AVSR system by better use of the visual channel alone (channel independence) and as a fallback during times when the audio signal drops or is deteriorated by noise. This goal raises a number of significant questions which extend beyond the demands of achieving visual-only speech recognition. Audio-visual signal fusion, environmental noise, camera/microphone movement are three examples of further challenges in AVSR [155]. It is a difficult problem to classify acoustic utterances from a signal of sparse visual cues, so whilst acoustic recognition is achieving ubiquity with commercial applications (in 2015 Google’s Translate app added speech recognition as a novel feature to assist travellers to communicate abroad), machine lip-reading is yet to achieve the same level of robustness. Independence to speaker identity, camera view, occlusions and language all still need to be robustly accomplished before we see such technology as a reality. Bibliography [1] Nasir Ahmed, T Natarajan, and Kamisetty R Rao. Discrete cosine transfom. IEEE transactions on Computers, pages 90–93, 1974. [2] Ibrahim Almajai, Ben Milner, and Jonathan Darch. Analysis of correlation between audio and visual speech features for clean audio feature prediction in noise. In INTERSPEECH, pages 2470–2473. ISCA, 2006. [3] Anonymous. Zidane head butt story. http://www.football-bible. com/soccer-info/zidane-head-butt-story.html, 2006. Accessed: September 2015. [4] S. Antar, A. Sagheer, S. Aly, and M. F. Tolba. Avas: Speech database for multimodal recognition applications. In Hybrid Intelligent Systems (HIS), 2013 13th International Conference on, pages 123–128, Dec 2013. [5] International Phonetic Association. Handbook of the International Phonetic Association: A guide to the use of the International Phonetic Alphabet. Cambridge University Press, 1999. [6] Jan Baetens. The silent movie revisited. Online magazine of the visual narrative, 6, Feb 2003. [7] Simon Baker. Inverse compositional algorithm. In Katsushi Ikeuchi, editor, Computer Vision, pages 426–428. Springer US, 2014. [8] J Andrew Bangham, Richard Harvey, Paul D Ling, and Richard V Aldridge. Nonlinear scale-space from n-dimensional sieves. In Computer Vision, ECCV‘96, pages 187–198. Springer, 1996. [9] S. Battiato, G. Gallo, G. Puglisi, and S. Scellato. Sift features tracking for video stabilization. In 14th International Conference on Image Analysis and Processing (ICIAP), pages 825–830, Sept 2007. [10] Leonard E Baum, Ted Petrie, George Soules, and Norman Weiss. A maximization technique occurring in the statistical analysis of probabilistic functions of markov chains. The annals of mathematical statistics, pages 164–171, 1970. [11] Sara L. Bauman and Georgia Hambrecht. Analysis of view angle used in speechreading training of sentences. American Journal of Audiology, 4(3):67–70, 1995. 138 BIBLIOGRAPHY 139 [12] Helen L Bear, Stephen J Cox, and Richard Harvey. Speaker independent machine lip reading with speaker dependent viseme classifiers. In 1st Joint International Conference on Facial Analysis, Animation and Audio-Visual Speech Processing (FAAVSP), pages 115–120. ISCA, 2015. [13] Helen L Bear and Richard Harvey. Decoding visemes: improving machine lip-reading. In 41st International Conference Acoustics, Speech and Signal Processing (ICASSP), 2016. [14] Helen L Bear, Richard Harvey, Barry-John Theobald, and Yuxuan Lan. Resolution limits on visual speech recognition. In Image Processing (ICIP), IEEE International Conference on, pages 1371–1375. IEEE, 2014. [15] Helen L Bear, Richard Harvey, Barry-John Theobald, and Yuxuan Lan. Finding phonemes: improving machine lip-reading. In 1st Joint International Conference on Facial Analysis, Animation and Audio-Visual Speech Processing (FAAVSP), pages 190–195. ISCA, 2015. [16] Helen L Bear, Richard W Harvey, Barry-John Theobald, and Yuxuan Lan. Which phoneme-to-viseme maps best improve visual-only computer lip-reading? In Advances in Visual Computing, pages 230–239. Springer, 2014. [17] Helen L Bear, Gari Owen, Richard Harvey, and Barry-John Theobald. Some observations on computer lip-reading: moving from the dream to the reality. In SPIE Security+ Defence, pages 92530G–92530G. International Society for Optics and Photonics, 2014. [18] Joseph C Beaver. A Grammar of Prosody. College English, pages 310– 321, 1968. [19] Yoshua Bengio and Yves Grandvalet. No unbiased estimator of the variance of k-fold cross-validation. The Journal of Machine Learning Research, 5:1089–1105, 2004. [20] Christian Benoit, Thierry Guiard-Marigny, B Le Goff, and Ali Adjoudani. Which components of the face do humans and machines best speechread?, volume 150, pages 315–328. Berlin: NATO-ASI Series 150 Springer, 1996. [21] Carl A Binnie, Pamela L Jackson, and Allen A Montgomery. Visual intelligibility of consonants: A lipreading screening test with implications for aural rehabilitation. Journal of Speech and Hearing Disorders, 41(4):530–539, 1976. [22] Art Blokland and Anne H Anderson. Effect of low frame-rate video on intelligibility of speech. Speech Communication, 26(12):97–103, 1998. [23] Remco R Bouckaert and Eibe Frank. Evaluating the replicability of significance tests for comparing learning algorithms. In Advances in knowledge discovery and data mining, pages 3–12. Springer, 2004. BIBLIOGRAPHY 140 [24] Richard Bowden, Stephen Cox, Richard Harvey, Yuxuan Lan, Eng-Jon Ong, Gari Owen, and Barry-John Theobald. Recent developments in automated lip-reading. In Symposium of Photonics and Intelligent Engineering (SPIE) Security+ Defence, pages 89010J–89010J. International Society for Optics and Photonics, 2013. [25] Elif Bozkurt, CE Erdem, Engin Erzin, Tanju Erdem, and M Ozkan. Comparison of phoneme and viseme based acoustic units for speech driven realistic lip animation. Proceedings of Signal Processing and Communications Applications, pages 1–4, 2007. [26] Cambridge University, UK. The BEEP Pronunciation Dictionary - British English. ftp://svr-ftp.eng.cam.ac.uk/comp.speech/ dictionaries/, 1997. Accessed: January 2013. [27] L. Cappelletta and N. Harte. Viseme definitions comparison for visualonly speech recognition. In Signal Processing Conference, 2011 19th European, pages 2109–2113, Aug 2011. [28] Luca Cappelletta and Naomi Harte. Phoneme-to-viseme mapping for visual speech recognition. In International Conference on Pattern Recognition Applications and Methods (ICPRAM), pages 322–329, 2012. [29] Carnegie Mellon University. CMU pronounciation dictionary. http:// www.speech.cs.cmu.edu/cgi-bin/cmudict#lookup, 2008. Accessed: April 2012. [30] Tsuhan Chen and Ram R Rao. Audio-visual integration in multimodal communication. Proceedings of the IEEE, 86(5):837–852, 1998. [31] Reuben Conrad. Lip-reading by deaf and hearing children. British Journal of Educational Psychology, 47(1):60–65, 1977. [32] Martin Cooke, Jon Barker, Stuart Cunningham, and Xu Shao. An audiovisual corpus for speech perception and automatic speech recognition. The Journal of the Acoustical Society of America, 120(5):2421–2424, 2006. [33] T.F. Cootes, G.J. Edwards, and C.J. Taylor. Active appearance models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 23(6):681 –685, June 2001. [34] Claire Cowie. The accents of outsourcing: The meanings of neutral in the Indian call centre industry. World Englishes, 26(3):316–330, 2007. [35] Stephen Cox, Richard Harvey, Yuxuan Lan, Jacob Newman, and Barry Theobald. The challenge of multispeaker lip-reading. In Proceedings of the International Conference on Auditory-Visual Speech Processing (AVSP), pages 179–184, 2008. BIBLIOGRAPHY 141 [36] James L Crowley and Francois Berard. Multi-modal tracking of faces for video communications. In Computer Vision and Pattern Recognition, 1997. Proceedings., 1997 IEEE Computer Society Conference on, pages 640–645. IEEE, 1997. [37] R. Cutler and L. Davis. Look who’s talking: speaker detection using video and audio correlation. In IEEE International Conference on Multimedia and Expo (ICME), volume 3, pages 1589–1592, 2000. [38] KH Davis, R Biddulph, and Stephen Balashek. Automatic recognition of spoken digits. The Journal of the Acoustical Society of America, 24(6):637–642, 1952. [39] Janez Demar. Statistical comparisons of classifiers over multiple datasets. Journal of Machine Learning Research, 7:1–30, 2006. [40] Barbara Dodd, Geoff Plant, and Mark Gregory. Teaching lip-reading: The efficacy of lessons on video. British journal of audiology, 23(3):229– 238, 1989. [41] Harris Drucker, Corinna Cortes, Lawrence D Jackel, Yann LeCun, and Vladimir Vapnik. Boosting and other ensemble methods. Neural Computation, 6(6):1289–1301, 1994. [42] Bradley Efron and Gail Gong. A leisurely look at the bootstrap, the jackknife, and cross-validation. The American Statistician, 37:36–48, 1983. [43] Andrzej Ehrenfeucht, David Haussler, Michael Kearns, and Leslie Valiant. A general lower bound on the number of examples needed for learning. Information and Computation, 82(3):247 – 261, 1989. [44] Norman P Erber. Auditory-visual perception of speech. Journal of Speech and Hearing Disorders, 40(4):481, 1975. [45] Nicolas Eveno, Alice Caplier, and Pierre-Yves Coulon. Accurate and quasi-automatic lip tracking. Circuits and Systems for Video technology, IEEE Transactions on, 14(5):706–715, 2004. [46] Irene Rosetta Ewing. Lipreading and hearing aids. Manchester University Press, 1944. [47] Kathleen E Finn and Allen A Montgomery. Automatic optically-based recognition of speech. Pattern Recognition Letters, 8(3):159–164, 1988. [48] Cletus G Fisher. Confusions among visually perceived consonants. Journal of Speech, Language and Hearing Research, 11(4):796, 1968. [49] William M Fisher, George R Doddington, and Kathleen M GoudieMarshall. The DARPA speech recognition research database: specifications and status. In Proceedings of the DARPA Workshop on speech recognition, pages 93–99, 1986. BIBLIOGRAPHY 142 [50] J Richard Franks and Joan Kimble. The confusion of english consonant clusters in lipreading. Journal of Speech, Language and Hearing Research, 15(3):474, 1972. [51] Georgios Galatas, Gerasimos Potamianos, Alexandros Papangelis, and Fillia Makedon. Audio visual speech recognition in noisy visual environments. In Proceedings of the 4th International Conference on PErvasive Technologies Related to Assistive Environments, page 19. ACM, 2011. [52] Consuelo Gonzalez. Consuelo gonzalez, professional lip reader. http:// www.lipreadingtranslation.com/translator.html, 2016. Accessed: March 2016. [53] John N Gowdy, Amarnag Subramanya, Chris Bartels, and Jeff Bilmes. Dbn based multi-stream models for audio-visual speech recognition. In Acoustics, Speech, and Signal Processing, 2004. Proceedings.(ICASSP’04). IEEE International Conference on, volume 1, pages I–993. IEEE, 2004. [54] J.C. Gower. Generalized procrustes analysis. Psychometrika, 40(1):33– 51, 1975. [55] C.J. Hall. An introduction to language and linguistics: breaking the language spell. Open linguistics series. Continuum, 2005. [56] N. Harte and E. Gillen. Tcd-timit: An audio-visual corpus of continuous speech. IEEE Transactions on Multimedia, 17(5):603–615, May 2015. [57] Timothy J Hazen. Visual model structures and synchrony constraints for audio-visual speech recognition. IEEE Transactions on Audio, Speech, and Language Processing, 14(3):1082–1089, 2006. [58] Timothy J. Hazen, Kate Saenko, Chia-Hao La, and James R. Glass. A segment-based audio-visual speech recognizer: Data collection, development, and initial experiments. In Proceedings of the 6th International Conference on Multimodal Interfaces, ICMI ‘04, pages 235–242, New York, NY, USA, 2004. ACM. [59] Martin Heckmann, Frédéric Berthommier, Christophe Savariaux, and Kristian Kroschel. Effects of image distortions on audio-visual speech recognition. In AVSP 2003-International Conference on Audio-Visual Speech Processing, 2003. [60] Martin Heckmann, Kristian Kroschel, Christophe Savariaux, Frédéric Berthommier, et al. Dct-based video features for audio-visual speech recognition. In INTERSPEECH, 2002. [61] F Heider and Grace M Heider. An experimental investigation of lipreading. Psychological Monographs, 52(232):124–153, 1940. BIBLIOGRAPHY 143 [62] Jim L Hieronymus, D McKelvie, and FR McInnes. Use of acoustic sentence level and lexical stress in hsmm speech recognition. In IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), volume 1, pages 225–227. IEEE, 1992. [63] Sarah Hilder, Richard Harvey, and Barry-John Theobald. Comparison of human and machine lip-reading. Proceedings of the International Conference on Audio-Visual Speech Processing (AVSP), pages 86–89, 2009. [64] Wendy Holmes. Speech synthesis and recognition. CRC press, 2001. [65] Xiaopeng Hong, Hongxun Yao, Yuqi Wan, and Rong Chen. A pca based visual dct feature extraction method for lip-reading. In Intelligent Information Hiding and Multimedia Signal Processing, 2006. IIH-MSP’06. International Conference on, pages 321–326. IEEE, 2006. [66] Dominic Howell, Barry-John Theobald, and Stephen Cox. Confusion modelling for automated lip-reading using weighted finite-state transducers. In Auditory-Visual Speech Processing (AVSP), pages 197–202, 2013. [67] Dominic Liam Howell. Confusion Modelling for Lip-Reading. PhD thesis. University of East Anglia, 2014. [68] Fu Jie Huang and Tsuhan Chen. Tracking of multiple faces for humancomputer interfaces and virtual environments. In Proceedings of IEEE International Conference on Multimedia and Expo (ICME), volume 3, pages 1563–1566, 2000. [69] Janet Jeffers and Margaret Barley. Speechreading (lipreading). Thomas Springfield, IL:, 1971. [70] Jintao Jiang, Abeer Alwan, Lyme E. Bernstein, Edward T. Auer, and Patricia A. Keating. Similarity structure in perceptual and physical measures for visual consonants across talkers. In Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), volume 1, pages I–441 –I–444, May 2002. [71] Robert Kaucic and Andrew Blake. Accurate, real-time, unadorned lip tracking. In Sixth International Conference on Computer Vision., pages 370–375. IEEE, 1998. [72] Tristan Kleinschmidt, David Dean, Sridha Sridharan, and Michael Mason. A continuous speech recognition evaluation protocol for the avicar database. 2008. [73] Patricia B Kricos and Sharon A Lesner. Differences in visual intelligibility across talkers. The Volta Review, 84:219–225, 1982. [74] K. Kumar, Tsuhan Chen, and R.M. Stern. Profile view lip reading. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), volume 4, pages IV–429–IV–432, 2007. BIBLIOGRAPHY 144 [75] Kush Kumar, Tsuhan Chen, and Richard M Stern. Profile view lip reading. In Acoustics, Speech and Signal Processing, 2007. ICASSP 2007. IEEE International Conference on, volume 4, pages IV–429. IEEE, 2007. [76] Yuxuan Lan, Richard Harvey, and Theobald Barry-John. Insights into machine lip reading. In 38th International Conference Acoustics, Speech and Signal Processing (ICASSP), 2012. [77] Yuxuan Lan, Richard Harvey, B Theobald, Eng-Jon Ong, and Richard Bowden. Comparing visual features for lipreading. In Proceedings of the International Conference on Auditory-Visual Speech Processing (AVSP), pages 102–106, 2009. [78] Yuxuan Lan, B.-J. Theobald, and R. Harvey. View independent computer lip-reading. In IEEE International Conference on Multimedia and Expo (ICME), pages 432–437, 2012. [79] Yuxuan Lan, Barry-John Theobald, Richard Harvey, Eng-Jon Ong, and Richard Bowden. Improving visual features for lip-reading. Proceedings of the International Conference on Audio-Visual Speech Processing (AVSP), 7(3):42–48, 2010. [80] Jeff Lander. Read my lips: Facial animation techniques. http://www.gamasutra.com/view/feature/131587/read_my_lips_ facial_animation_.php. Accessed: 2014-01-28. [81] Ryan Layne, Tim Hospedales, and Shaogang Gong. Re-id: Hunting attributes in the wild. In Proceedings of the British Machine Vision Conference. BMVA Press, 2014. [82] Soonkyu Lee and DongSuk Yook. Audio-to-visual conversion using hidden markov models. In Proceedings of Pacific Rim International Conference on Artificial Intelligence (PRICAI), pages 563–570. Springer, 2002. [83] Charay Lerdsudwichai and Mohamed Abdel-Mottaleb. Algorithm for multiple faces tracking. In Multimedia and Expo, 2003. ICME’03. Proceedings. 2003 International Conference on, volume 2, pages II–777. IEEE, 2003. [84] S.A. Lesner and P.B Kricos. Visual vowel and diphthong perception across speakers. Journal of the Academy of Rehabilitative Audiology, 14:252–258, 1981. [85] Luhong Liangi, Yu Luo, Feiyue Huang, and A. V. Nefian. A multi-stream audio-video large-vocabulary mandarin chinese speech database. In Multimedia and Expo, 2004. ICME ’04. 2004 IEEE International Conference on, volume 3, pages 1787–1790 Vol.3, June 2004. [86] Bernice Eisman Lott and Joel Levy. The influence of certain communicator characteristics on lip reading efficiency. The Journal of Social Psychology, 51(2):419–425, 1960. BIBLIOGRAPHY 145 [87] P. Lucey and G. Potamianos. Lipreading using profile versus frontal views. In 2006 IEEE Workshop on Multimedia Signal Processing, pages 24–28, Oct 2006. [88] Patrick Lucey, Gerasimos Potamianos, and Sridha Sridharan. Visual speech recognition across multiple views. Visual Speech Reognition: Lip Segmentation and Mapping, 2009. [89] J. Luettin, N.A. Thacker, and S.W. Beet. Speaker identification by lipreading. In Proceedings of the Fourth International Conference on Spoken Language (ICSLP), volume 1, pages 62–65, 1996. [90] Juergen Luettin and Neil A Thacker. Speechreading using probabilistic models. Computer Vision and Image Understanding, 65(2):163–178, 1997. [91] Björn Lyxell. Beyond lips: Components of speechreading skill. PhD Thesis. Umeå universitet, 1989. [92] Alison MacLeod and Quentin Summerfield. Quantifying the contribution of vision to speech perception in noise. British journal of audiology, 21(2):131–141, 1987. [93] Kenji Mase and Alex Pentland. Automatic lipreading by optical-flow analysis. Systems and Computers in Japan, 22(6):67–76, 1991. [94] D. Massaro. Perceiving Talking Faces. The MIT Press, 1998. [95] Jiřı́ Matas, Karel Zimmermann, Tomáš Svoboda, and Adrian Hilton. Learning efficient linear predictors for motion estimation. In Computer Vision, Graphics and Image Processing, pages 445–456. Springer, 2006. [96] I. Matthews, T.F. Cootes, J.A. Bangham, S. Cox, and R. Harvey. Extraction of visual features for lipreading. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 24(2):198 –213, Feb 2002. [97] Iain Matthews and Simon Baker. Active appearance models revisited. International Journal of Computer Vision, 60(2):135–164, 2004. [98] Iain Matthews, J Bangham, Richard Harvey, and Stephen Cox. Nonlinear scale decomposition based features for visual speech recognition. Proceedings of the IX European Signal Processing Conference (EUSIPCO), pages 303–305, 1998. [99] Iain Matthews, Gerasimos Potamianos, Chalapathy Neti, and Juergen Luettin. A comparison of model and transform-based visual features for audio-visual lvcsr. In null, page 210. IEEE, 2001. [100] Matthew McGrath. An examination of cues for visual and audio-visual speech perception using natural and computer-generated faces. PhD thesis, University of Nottingham, 1985. BIBLIOGRAPHY 146 [101] Harry McGurk and John MacDonald. Hearing lips and seeing voices. Nature, 264:746–748, 1976. [102] Stephen McKenna and Shaogang Gong. Tracking faces. In Automatic Face and Gesture Recognition, 1996., Proceedings of the Second International Conference on, pages 271–276. IEEE, 1996. [103] Neil Midgley. New technology catches hitler off guard. http://www.telegraph.co.uk/news/uknews/1534830/ New-technology-catches-Hitler-off-guard.html, 2006. Accessed: September 2015. [104] Ben Milner and Danny Websdale. Analysing the importance of different visual feature coefficients. FAAVSP 2015, 2015. [105] Allen A Montgomery and Pamela L Jackson. Physical characteristics of the lips underlying vowel lipreading performance. The Journal of the Acoustical Society of America, 73:2134, 1983. [106] S. Moore and R. Bowden. Local binary patterns for multi-view facial expression recognition. Computer Vision and Image Understanding, 115(4):541 – 558, 2011. [107] Ara V Nefian, Luhong Liang, Xiaobo Pi, Xiaoxing Liu, and Kevin Murphy. Dynamic bayesian networks for audio-visual speech recognition. EURASIP Journal on Advances in Signal Processing, 2002(11):1–15, 2002. [108] Chalapathy Neti, Gerasimos Potamianos, Juergen Luettin, Iain Matthews, Herve Glotin, Dimitra Vergyri, June Sison, Azad Mashari, and Jie Zhou. Audio-visual speech recognition. In Final Workshop 2000 Report, volume 764, 2000. [109] EB Nichie. Lipreading principles and practice, 1912. [110] E B Nitchie. Lip-Reading, principles and practise: A handbook for teaching and self-practise. Frederick A Stokes Co, New York, 1912. [111] E.J. Ong and R. Bowden. Robust lip-tracking using rigid flocks of selected linear predictors. In 8th IEEE International Conference on Automatic Face and Gesture Recognition, 2008. [112] E.J. Ong and R. Bowden. Robust facial feature tracking using shapeconstrained multi-resolution selected linear predictors. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(9):1844–1859, 2011. [113] Eng-Jon Ong, Yuxuan Lan, Barry Theobald, R. Harvey, and R. Bowden. Robust facial feature tracking using selected multi-resolution linear predictors. In IEEE 12th International Conference on Computer Vision, pages 1483–1490, Sept 2009. BIBLIOGRAPHY 147 [114] Elmer Owens and Barbara Blazek. Visemes observed by hearingimpaired and normal-hearing adult viewers. Journal of Speech and Hearing Research, 28(3):381, 1985. [115] Alasdair Palmer. Lip reader saw fraser’s incriminating conversations. http://www.telegraph.co.uk/news/uknews/1420816/ Lip-reader-saw-{F}rasers-incriminating-conversations.html, 2003. Accessed: September 2015. [116] Adrian Pass, Jianguo Zhang, and Darryl Stewart. An investigation into features for multi-view lipreading. In Image Processing (ICIP), 2010 17th IEEE International Conference on, pages 2417–2420. IEEE, 2010. [117] Eric K Patterson, Sabri Gurbuz, Zekeriya Tufekci, and John N Gowdy. Cuave: A new audio-visual database for multimodal human-computer interface research. In Acoustics, Speech, and Signal Processing (ICASSP), 2002 IEEE International Conference on, volume 2, pages II–2017. IEEE, 2002. [118] Yuru Pei, Tae-Kyun Kim, and Hongbin Zha. Unsupervised random forest manifold alignment for lipreading. In Proceedings of the IEEE International Conference on Computer Vision, pages 129–136, 2013. [119] Gerasimos Potamianos, Hans Peter Graf, and Eric atto. An image transform approach for hmm based automatic lipreading. In Image Processing, 1998. ICIP 98. Proceedings. 1998 International Conference on, pages 173–177. IEEE, 1998. [120] Gerasimos Potamianos, Chalapathy Neti, Juergen Luettin, and Iain Matthews. Audio-visual automatic speech recognition: An overview. Issues in Visual and Audio-Visual Speech Processing, 22:23, 2004. [121] Patrick F Quinn. The critical mind of Edgar Poe: Claude Richard. Edgar Allan Poe: Journaliste et critique. Poe Studies-Old Series, 13(2):37–40, 1980. [122] Jessica Rees. Jessica rees, forensic and professional lip reader. http:// www.lipreadingtranslation.com/translator.html, 2016. Accessed: March 2016. [123] Jerker Rönnberg, Stefan Samuelsson, and Björn Lyxell. Conceptual constraints in sentence-based lipreading in the hearing-impaired. Hearing by eye: II. The psychology of speechreading and auditory–visual speech, pages 143–153, 1998. [124] Takeshi Saitoh and Ryosuke Konishi. A study of influence of word lip reading by change of frame rate. In Proceedings of the International Conference on Auditory-Visual Speech Processing (AVSP), 2010. [125] Stefan Samuelsson and Jerker Rönnberg. Script activation in lipreading. Scandinavian journal of psychology, 32(2):124–143, 1991. BIBLIOGRAPHY 148 [126] Stefan Samuelsson and Jerker Ronnberg. Implicit and explicit use of scripted constraints in lip-reading. European Journal of Cognitive Psychology, 5(2):201–233, 1993. [127] Robert E Schapire. The strength of weak learnability. Machine learning, 5(2):197–227, 1990. [128] Karl Schwerdt and James L Crowley. Robust face tracking using color. In Proceedings of the fourth IEEE International Conference on Automatic Face and Gesture Recognition., pages 90–95. IEEE, 2000. [129] AYAZ A. SHAIKH, DINESH K. KUMAR, and JAYAVARDHANA GUBBI. Visual speech recognition using optical flow and support vector machines. International Journal of Computational Intelligence and Applications, 10(02):167–187, 2011. [130] Cambridge University Speech. The BEEP Pronunciation Dictionary - British English. ftp://svr-ftp.eng.cam.ac.uk/comp.speech/ dictionaries/, 2007. Accessed: March 2013. [131] M. Stommel, M. Langer, O. Herzog, and K.-D. Kuhnert. A fast, robust and low bit-rate representation for sift and surf features. In IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR), pages 278–283, Nov 2011. [132] David G Stork and Marcus E Hennecke. Speechreading by humans and machines: models, systems, and applications, volume 150. Springer, 1996. [133] Quentin Summerfield. Lipreading and audio-visual speech perception. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 335(1273):71–78, 1992. [134] S. Taylor, B.-J. Theobald, and I. Matthews. The effect of speaking rate on audio and visual speech. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3037–3041, May 2014. [135] Sarah L Taylor, Moshe Mahler, Barry-John Theobald, and Iain Matthews. Dynamic units of visual speech. In Proceedings of the 11th ACM SIGGRAPH/Eurographics conference on Computer Animation, pages 275–284. Eurographics Association, 2012. [136] Herrie ten Cate. Battle of the somme. the true story., 2006. Video Documentary. [137] Barry J. Theobald, Richard Harvey, Stephen J. Cox, Colin Lewis, and Gari P. Owen. Lip-reading enhancement for law enforcement. In Optics and Photonics for Counterterrorism and Crime Fighting II, volume 6402, pages 640205–640214. SPIE, 2006. BIBLIOGRAPHY 149 [138] Barry-John Theobald. Visual Speech Synthesis Using Shape and Appearance Models. PhD thesis. University of East Anglia, 2003. [139] Tadafusa Tomitaka. Human face tracking system, 1995. US Patent 5,430,809. [140] unknown. ffmpeg, a complete, cross-platform solution to record, convert and stream audio and video. https://www.ffmpeg.org/, 2012-2015. Accessed: January 2012. [141] Harry L Van Trees. Detection, estimation, and modulation theory. Wiley. com, 2004. [142] Andrew J Viterbi. Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. Information Theory, IEEE Transactions on, 13(2):260–269, 1967. [143] Melanie Vitkovitch and Paul Barber. Visible speech as a function of image quality: Effects of display parameters on lipreading ability. Applied Cognitive Psychology, 10(2):121–140, 1996. [144] Brian E Walden, Robert A Prosek, Allen A Montgomery, Charlene K Scherr, and Carla J Jones. Effects of training on the visual recognition of consonants. Journal of Speech, Language and Hearing Research, 20(1):130, 1977. [145] Alan Wee-Chung Liew and Shilin Wang. Visual speech recognition: lip segmentation and mapping. Information Science Reference, 2009. [146] Xiaozhou Wei, Lijun Yin, Zhiwei Zhu, and Qiang Ji. Avatar-mediated face tracking and lip reading for human computer interaction. In Proceedings of the 12th Annual ACM International Conference on Multimedia, MULTIMEDIA ‘04, pages 500–503, New York, NY, USA, 2004. ACM. [147] Yee Wan Wong, Sue Inn Chng, Kah Phooi Seng, Li-Minn Ang, Siew Wen Chin, Wei Jen Chew, and King Hann Lim. A new multi-purpose audiovisual unmc-vier database with multiple variabilities. Pattern Recognition Letters, 32(13):1503 – 1510, 2011. [148] Mary F Woodward and Carroll G Barber. Phoneme perception in lipreading. Journal of Speech, Language and Hearing Research, 3(3):212, 1960. [149] Jie Yang and Alex Waibel. A real-time face tracker. In Applications of Computer Vision, 1996. WACV’96., Proceedings 3rd IEEE Workshop on, pages 142–147. IEEE, 1996. [150] S. J. Young, G. Evermann, D. Kershaw, G. Moore, J. Odell, D. Ollason, V. Valtchev, and P. C. Woodland. The HTK Book, version 3.2. Cambridge University Engineering Department, Cambridge, UK, 2002. BIBLIOGRAPHY 150 [151] Steve J Young, Gunnar Evermann, MJF Gales, D Kershaw, G Moore, JJ Odell, DG Ollason, D Povey, V Valtchev, and PC Woodland. The HTK book version 3.4, 2006. [152] Steve J Young, Gunnar Evermann, MJF Gales, D Kershaw, G Moore, JJ Odell, DG Ollason, D Povey, V Valtchev, and PC Woodland. The HTK book version 3.4, 2006. [153] Jerrold H Zar. Significance testing of the spearman rank correlation coefficient. Journal of the American Statistical Association, 67(339):578– 580, 1972. [154] G. Zhao, M. Barnard, and M. Pietikainen. Lipreading with local spatiotemporal descriptors. IEEE Transactions on Multimedia, 11(7):1254– 1265, Nov 2009. [155] Ziheng Zhou, Guoying Zhao, Xiaopeng Hong, and Matti Pietikäinen. A review of recent advances in visual speech decoding. Image and vision computing, 32(9):590–605, 2014. Chapter 11 Phonetic notation Table 11.1: For translating vowel phonemes from phonetic symbols to their respective alphabet character representations Phonetic Symbol /ai/ /2/ /æ/ /@/ /AU/ /O/ /A/ /ei/ /e/ /3/ /E/ /i/ /I/ /I@/ /I/ /OI/ /@U/ /U@/ /O/ /O@/ /6/ /u/ /U/ /O@/ Character Symbol /ay/ /ah/ /ae/ /ax/ /aw/ /ao/ /aa/ /ey/ /eh/ /er/ /ea/ /iy/ /ih/ /ia/ /ix/ /oy/ /ow/ /oo/ /oa/ /ou/ /oh/ /uw/ /uh/ /ua/ 151 Latexipa /ai/ textturnv ae textschwa textscripta textupsilon textopeno textscripta /ei/ /e/ textrevepsilon {E} /i/ textsci textsci textschwa textsci textopeno textsci textschwa textupsilon textupsilon textschwa textopeno textopeno textschwa textturnscripta /u/ textupsilon textopeno textschwa Example bouy hut pan albeit cloud sour card stay dwell curt chair creed kid lear ill coy code prude goat pour tot cue food core CHAPTER 11. PHONETIC NOTATION 152 Table 11.2: For translating consonant phonemes from phonetic symbols to their respective alphabet character representations Phonetic Symbol /T/ /D/ /S/ /Z/ /dZ/ /tS/ /H/ /N/ /W/ /b/ /d/ /f/ /g/ /h/ /k/ /l/ /m/ /n/ /p/ /r/ /s/ /t/ /v/ /w/ /y/ /z/ Character Symbol /th/ /dh/ /sh/ /zh/ /jh/ /ch/ /H/ (or /hh/) /ng/ /W/ /b/ /d/ /f/ /g/ /hh/ /k/ /l/ /m/ /n/ /p/ /r/ /s/ /t/ /v/ /w/ /y/ /z/ Latex textipa {T} {D} {S} {Z} d{Z} t{S} {H} {N} {W} /b/ /d/ /f/ /g/ /h/ /k/ /l/ /m/ /n/ /p/ /r/ /s/ /t/ /v/ /w/ /y/ /z/ Example thin there sheer visual judge chrunch hunt king whisky bar dart f ete great hunt cane lake mother none pot grate silk tack verge weed yaught zulu
1cs.CV
Generalized Online Transfer Learning for Climate Control in Residential BuildingsI,II Thomas Grubingera , Georgios C. Chasparisa,∗, Thomas Natschlägera arXiv:1610.04042v1 [cs.SY] 13 Oct 2016 a Department of Data Analysis Systems, Software Competence Center Hagenberg GmbH, Softwarepark 21, A-4232 Hagenberg, Austria Abstract This paper presents an online transfer learning framework for improving temperature predictions in residential buildings. In transfer learning, prediction models trained under a set of available data from a target domain (e.g., house with limited data) can be improved through the use of data generated from similar source domains (e.g., houses with rich data). Given also the need for prediction models that can be trained online (e.g., as part of a model-predictive-control implementation), this paper introduces the generalized online transfer learning algorithm (GOTL). It employs a weighted combination of the available predictors (i.e., the target and source predictors) and guarantees convergence to the best weighted predictor. Furthermore, the use of Transfer Component Analysis (TCA) allows for using more than a single source domains, since it may facilitate the fit of a single model on more than one source domains (houses). This allows GOTL to transfer knowledge from more than one source domains. We further validate our results through experiments in climate control for residential buildings and show that GOTL may lead to non-negligible energy savings for given comfort levels. Keywords: Climate control in buildings, Online transfer learning, Model predictive control I The research reported in this paper has been supported by the Austrian Ministry for Transport, Innovation and Technology, the Federal Ministry of Science, Research and Economy, and the Province of Upper Austria in the frame of the COMET center SCCH. II An earlier version of part of this paper appeared in [1]. ∗ Corresponding author Email addresses: [email protected] (Thomas Grubinger), [email protected] (Georgios C. Chasparis), [email protected] (Thomas Natschläger) Preprint submitted to Energy and Buildings October 14, 2016 1. Introduction Recent studies on climate control (heating/cooling) in residential buildings have demonstrated the importance of accurate system identification and prediction for energy savings [2, 3, 4, 5, 6]. In fact, there have been several efforts on exploiting the benefits of such prediction schemes through the development of model-predictive-control (MPC) approaches [2, 3, 4], where predictions of the temperature evolution, weather conditions and user behavior can be incorporated directly into the control design. The current trend on system identification and prediction in a residential building (target house) exploits measurements collected during normal operation of the heating/cooling system. Several identification schemes have been used to generate predictions, including the MIMO ARMAX model [7], ARX models [8] and the neural network approach [9]. Although linear transfer function models are the most commonly used models for system identification in residential buildings (due to the resulting simplified MPC design), changes in weather conditions and/or the heating patterns may give rise to nonlinear phenomena and consequently to variations in the prediction performance. This observation has been pointed out by several authors, leading to more detailed identification schemes, such as the multiple-time scale analysis presented in [4], the more detailed models of HVAC systems discussed in [10] and the nonlinear regression models developed in [5]. Variations in the weather conditions and/or heating patterns may always occur throughout the year. The reliability of the (target house’s) prediction model may be improved by incorporating the formulation of data/prediction models from other residential buildings (source houses). To this end, this paper addresses the following question: In what form such a “knowledge transfer” from a source house to a target house should be performed and under which conditions it could be beneficial in terms of the resulting prediction performance? Such knowledge transfer objective is usually encountered in machine learning and it may take alternative forms depending on the application itself. In particular, knowledge transfer can usually be performed within the context of Transfer Learning [11]. Generally, transfer learning aims at transferring knowledge from previous (source) tasks to a target task when the latter has limited training data. Transfer learning has received a lot of attention in recent years and has successfully been used in several applications, such as indoor localization [12], image processing [13], land-mine detection [14] and biological applications [15]. 2 Most transfer learning approaches can be referred to as offline approaches, since learning is performed offline. However, in the context of climate control in residential buildings, data are usually collected continuously and knowledge transfer needs to be implemented in an online fashion. Thus, it is necessary to develop an online transfer learning methodology that will be particularly appropriate for knowledge transfer between different houses. To the best of our knowledge, only the Online Transfer Learning (OTL) [16] method addresses an online learning case. It uses a weighted prediction of an offline classifier (learned on the source scenario data) and an incrementally updated online classifier on the target scenario data. Weighted predictors are also common in ensemble learning methods [17, 18, 19, 20, 21], however predictors are constructed from a single dataset (thus, they are not directly related to transfer learning). An online algorithm for the case of multitask learning [22] was introduced by Dekel et al. [23]. In contrast to transfer learning, multitask learning addresses the problem of learning different tasks in parallel. Furthermore, Dekel’s method is designed for classification tasks, while climate control requires regression tasks. Given the absence of online transfer learning methodologies that can be directly applied for knowledge transfer for climate control in residential buildings, this paper develops an online transfer learning algorithm that is particularly appropriate for climate control. In particular, we introduce generalized online transfer learning (GOTL) that is based on a weighted combination of: (1) an offline model (linear regression model learned on the source data (with data collected over an extended time horizon), and (2) an online regressor (recursive least squares, cf., [24]) learned on the target house – which is incrementally updated as new data arrives. The proposed algorithm is related to the OTL algorithm of [16]. However, in [16], the weighted predictor is only eligible for classification, while our framework is applicable for both classification and regression. Furthermore, our online transfer learning scheme guarantees convergence to the globally optimal weights for the predictors. The proposed GOTL algorithm is not limited to the use of a single source house. Clearly, standard machine learning methods cannot be applied directly on the combined data of different source houses, as the different datasets were not necessarily generated by the same process. However, (offline) domain generalization [15] methods can be used to jointly model data from different source domains. In this paper, we use the domain generalization method Transfer Component Analysis (TCA) [25, 14]. TCA and domain generalization methods in general, aim to transform data from different domains into a shared subspace, where the distributions of the domains are 3 similar. Once transformed, a (linear) regression model can be constructed on the joint source house data. Our contributions can be summarized as follows: (1) We propose an online transfer learning methodology (GOTL) that is appropriate for knowledge transfer between residential buildings. To the best of our knowledge, this is the first attempt to address knowledge transfer in this application domain. (2) The proposed algorithm builds upon the online transfer learning methodology of [16] and (a) guarantees convergence to the global optimum combination, (b) it addresses both classification and regression tasks. (3) We demonstrate through experiments that is at least as good as either one of the source house and target house predictor. (4) We show that the domain generalization technique TCA can be used to learn a joint model from several source houses, which proves to be even more beneficial for the target task. (5) We demonstrate that the improvement in predictive accuracy translates into non-negligible energy savings for given comfort levels. This paper extends previous work of the authors [1] by contributions (4) and (5) and provides a more detailed presentation of the already published work. In the remainder of the paper, Section 2 provides the framework and the main objective of this paper. Section 3 describes the proposed online transfer learning methodology (GOTL) from a single source domain. In Section 4, we extend our methodology to the case of multiple source domains through the use of TCA. Section 5 provides a description on the experimental framework and Section 6 demonstrates the experimental results. Finally, Section 7 presents concluding remarks and future work. 2. Framework & Objective In this paper, we are interested in the development of a prediction (inputoutput transfer) model of the heat-mass transfer dynamics in residential buildings, that also exploits data collected from other (not necessarily similar) houses. Such prediction models can be used within an MPC and provide predictions of the indoor temperature over an optimization horizon of interest (e.g., several hours ahead). A prediction (input-output transfer) model of the heat-mass transfer dynamics in buildings can be formulated in the following generic form: ŷt = f (yt−1 , ..., yt−` , ut−1 , ..., ut−` ), (1) where y ∈ R denotes the variable of interest, ŷ ∈ R denotes the estimate of y and u ∈ R1×m denotes the control inputs/disturbances. The predictor 4 f : R`+`m → R is a linear or nonlinear prediction model. Under the assumption that measurements are perturbed by a white measurement noise, predictors of the form (1) correspond to the maximum a posteriori predictor (as in the case of the Output-Error regression model [26, Chapter 4]). For example, in the context of climate control in buildings, y corresponds to the indoor temperature that needs to be regulated, while u may include all variables directly or indirectly affecting the indoor temperature, such as the flow of the thermal medium, the inlet/outlet temperatures of the thermal medium, the occupants presence, the outdoor temperature and the solar gain. Let us assume that measurements of the inputs and output are collected at regular time instances Ts , 2Ts , ..., briefly denoted by t = 1, 2, ..., where Ts corresponds to the sampling period. Assuming that an MPC is implemented . for temperature control, let Thor = M Ts denote our optimization horizon over which predictions are requested for some large M ∈ N. We denote the time instances at which predictions are requested by tk , k = 1, 2, ... such that tk = kM . Note that tk is a subsequence of the time index t, thus predictions are requested over M, 2M, ... time instances. We will often refer to these time instances as the evaluation/optimization instances. To minimize notation, we briefly denote  . xt = yt−1 · · · yt−` ut−1 · · · ut−` . (2) Since we will be concerned with providing predictions at time instances tk , k = 1, 2, ..., we will compactly denote the data available at those time instances by   x0   .  x1  Xk =  .  , (3)  ..  xtk for all k = 1, 2, ... which correspond to time instances tk . In the remainder of the paper, we will assume that data are available both from a target house, where we wish to minimize the prediction error, and one or more source house(s), denoted by the symbol S. We assume that the input-output variables measured in both the source house(s) and target house are the same. Let XS and Xk be the corresponding feature data available at tk . Since we are concerned with transfer learning, the data set XS is assumed a-priori fixed. However, the forthcoming analysis can be extended in a straightforward manner to the case that this data set also 5 varies with time. We introduce two prediction models: (1) fk (·) is a prediction model that is trained online at time instances tk , k = 1, 2, ... over the currently available data Xk from the target house. (2) fS (·) denotes a prediction model that is trained offline over the a-priori available data set XS . In case of a single source house the predictor is taking the form fS (·) = hS (·), where hS (·) is a supervised prediction function. In case of multiple source houses fS (·) = hS (θ(·)), where θ(·) is a domain generalization function, which maps the data from the different houses into a shared subspace. Note that in this case, the source data are XS = XS1 ∪ XS2 ∪ ... ∪ XSD , where D is the number of source houses. The definition of the domain generalization function and its role will be discussed in detail in the forthcoming Section 4.2. The goal of this paper is the computation of a new (combined) predictor for the target house, evaluated at time instances tk , k = 1, 2, ..., which admits the generic form Fk (·) = Fk (fk (·), fS (·)). We wish to address the following optimization problem: min {Fk } +M K tkX X k=1 t=tk +1 2 δ tk +M −t Fk (x̂t|k ) − yt , (4) on the target house, where K is the number of evaluation intervals considered and δ ∈ (0, 1] is a discount factor. As in an MPC implementation, the measurements y are only available at the beginning of each evaluation interval k, i.e., at time tk , while the performance of a prediction model Fk has to be evaluated over an optimization horizon of M steps ahead. Thus, an estimate x̂t|k of xt is used in the formulation of the predictions, which is defined as  . x̂t|k = ỹt−1|k · · · ỹt−`|k ũt−1|k · · · ũt−`|k , where ỹt|k ( . yt = ŷt|k if t ≤ tk if t > tk . Here, ŷt|k are generated as ŷt|k = Fk (x̂t|k ), where the prediction at time instance t are given by the prediction function fk (·), which has been trained using all data up to time instance tk . Regarding the estimates of the control inputs and the exogenous disturbances summarized in ũt|k , we consider perfect estimates, since we would like to investigate the prediction performance of Fk over y. Therefore, we set ũt−j|k = ut−j , j ∈ {1, ..., l}. 6 3. Online Transfer Learning from Single Source Domain 3.1. Generalized Online Transfer Learning (GOTL) Obviously, when addressing an optimization problem of the form (4), the optimal choice of a combined predictor may not be computed a-priori, i.e., k before receiving the measurements {yt }tt=t from the target house. Thus, 1 an online optimization scheme is required. Besides, the choice of an optimal predictor may change frequently with time, hence requiring frequent revisions of the combined predictor. In this paper, we propose a transfer learning algorithm that addresses the generic problem formulation of (4) in an online fashion under the structural constraint of the form: . Fk (xt ; αk ) = (1 − αk )fk (xt ) + αk fS (xt ), (5) . where αk ∈ A = {0, ∆, 2∆, ..., 1 − ∆, 1} , is a weight assigned to the source predictor. The constant ∆ ∈ (0, 1) is selected so that ∆ = 1/n for some large n ∈ N. In other words, we consider combined predictors that can be represented as a weighted sum of the two available predictors (the source predictor trained offline and the target predictor trained online). In this case, the optimization problem (4) can be translated to an optimization problem over {αk } and takes on the following form: min {αk } +M K tkX X k=1 t=tk +1 2 δ tk +M −t Fk (x̂t|k ; αk ) − yt . (6) The proposed algorithm Generalized Online Transfer Learning (GOTL) is motivated by the so-called adaptive learning [27] defined in games and it is based on the notion of better reply. It is described in detail in Table 1. In particular, at the end of every evaluation interval k = 1, 2, ..., the current combined predictor Fk , defined in (5) and employing weight αk , is evaluated over the updated history of measurements Xk+1 , i.e., the measurements collected at the end of the evaluation interval k. Its performance with respect to the prediction error is then compared with the corresponding performances when the weight αk is slightly perturbed. In particular, the performance of the weight αk is compared with the corresponding performances of the weights selected from the set A(αk ) 7 At the end of any evaluation interval k (i.e., at time instance tk+1 ), k = 1, 2, ..., K: 1. Update the history of feature data Xk+1 . 2. Evaluate the currently selected weight αk by computing its better reply . Bk (αk ) = {α0 ∈ A(αk ) : Rk (α0 ) < Rk (αk )}. 3. Select a new weight αk+1 according to ( Bk (αk ) if Bk (αk ) 6= ∅ αk+1 ∈ α else. 4. Train the online predictor for the target fk (·) by using the updated history Xk+1 , and get fk+1 (·). 5. Define the new combined predictor Fk+1 for creating predictions over t ∈ {tk , ..., tk+1 } as follows: . Fk+1 (·; αk+1 ) = (1 − αk+1 )fk+1 (·) + αk+1 fS (·). 6. Update the time k ← k + 1 and repeat. Table 1: Generalized Online Transfer Learning (GOTL) defined as follows:   {αk − ∆, αk , αk + ∆} if ∆ < αk < 1 − ∆ . A(αk ) = {αk , αk + ∆} if αk ≤ ∆   {αk − ∆, αk } if αk ≥ 1 − ∆. Comparison between the alternative weights in the set A is performed with respect to the discounted weighted average squared error, Rk , of the combined predictor, defined as k tj +M . X X tj +M −t 2 Rk (α) = δ Fj (x̂t|j ; α) − yt , (7) j=1 t=tj +1 for some δ ∈ (0, 1]. Note that the predictions Fj (x̂t|j ; α) (in the evaluation interval j) are generated using the target predictor fj (·) which has been 8 trained using data up to time tj , Xj . The predictions of Fj (x̂t|j ; α) are evaluated over the time interval t1 , ..., tj+1 . Lastly, note that the trained predictor fj (·) does not depend on α, which implies that it does not have to be refitted when α is updated. The proposed scheme is related to the online transfer learning (OTL) algorithm [16]. In reference [16] the weight update is only applicable for classification problems, while GOTL’s weight update mechanism is more general to accommodate both regression and classification problems. 3.2. Convergence behavior Let us define the set of locally-optimal weights . A∗k = {α ∈ {0, ∆, ..., 1 − ∆, 1} : Bk (α) = ∅} . We can show that GOTL converges to a weight in A∗k , as long as the set A∗k changes sufficiently slow with k as the following proposition shows. Proposition 3.1 (Convergence to Local Minima). For any weight update instance k ∗ , if A∗k = A∗ 6= ∅ for every k = k ∗ , k ∗ + 1, ..., k ∗ + n, then αk∗ +n ∈ A∗ . In other words, if the set of locally optimal weights does not change within the next n update steps, then the process will reach a weight within this set. Proof. The proof is a direct implication of the definition of the Bk (·), since at most n update steps are required for the process to approach a weight α∗ ∈ A∗ starting from any initial weight.  Proposition 3.2 (Unique Minimizer). For any update instance k,1 |A∗k | = 1. Furthermore, this is the unique globally optimal weight. . Proof. Let us denote the estimation error functions: ej (t) = fj (x̂t|j ) − yt , . and eS,j (t) = fS (x̂t|j ) − yt for the target and the source predictor, respectively, when evaluated over the evaluation interval j = 1, 2, .... Let also Ej {·} denote the discounted weighted average of the values of a random variable . Ptj +M tj +M −t evaluated over the evaluation interval j, i.e., Ej {ej } = t=t δ {ej (t)}. j +1 Then, the optimization problem minα∈A Rk (α) can equivalently be written 1 For any finite set A, |A| denotes its cardinality. 9 as: min α∈A k X j=1 n o Ej |(1 − α)ej + αeS,j |2 − |ej |2 , (8) since the estimation error of the target predictor, ej (t), is independent of α. Note further that: |(1 − α)ej + αeS,j |2 − |ej |2 = α2 e2S,j − α(2 − α)e2j + 2α(1 − α)eS,j ej . Thus, the optimization (8) can equivalently be written as: k k n X X  2  2 min α Ej eS,j − α(2 − α) Ej e2j + α∈A j=1 j=1 2α(1 − α) k X j=1 o Ej {ej eS,j } . Note that the latter objective function is quadratic with respect to α and its second gradient with respect to α is nonnegative. This implies that the optimization minα∈A Rk (α) admits a unique minimizer.  It is also straightforward to check that under the hypotheses of Proposition 3.1, the weight update approaches the unique minimizer after a finite number of steps. 3.3. Discussion Note that the unique minimizer may change with k, depending on the conditions under which the data have been collected. However, according to Proposition 3.1, it is straightforward to check that as long as A∗k changes sufficiently slowly with respect to k, the weight update will always approach the (current) minimizer of (7). The question that naturally emerges is under which conditions such a combined predictor will provide a better estimate compared to the target predictor. Let us use the definition of Ej {·} in the proof of Proposition 3.2. Note that the optimization problem minα∈A Rk (α) is equivalent to (8), which includes the following expectation: n o Ej |(1 − α)ej + αeS,j |2 − |ej |2 = α2 Ej {e2S,j } − α(2 − α)Ej {e2j } + 2α(1 − α)Ej {eS,j ej } 10 For the combined predictor to provide smaller prediction error compared to the target predictor, the above quantity has to be strictly negative. If the “product bias” is of the same sign, i.e., Ej {eS,j ej } ≥ 0, then α should be sufficiently close to one for the above quantity to be negative. On the other hand, if Ej {eS,j ej } < 0, then an 0 < α < 1 may improve the prediction error even when Ej {e2S,j } and Ej {e2j } are of similar size, i.e., even when the source and target predictor perform equally well on the target data. 4. Online Transfer Learning from Multiple Source Domains 4.1. Transfer Component Analysis (background) Domain generalization [28, 15, 14] addresses mismatches between different input distributions. Across-domain information is extracted from the source domain data (where training data is available) and can be used on the target domains (where no training data is available) without re-training. Transfer Component Analysis (TCA) [25, 14] is a popular domain generalization technique that aims to learn a shared subspace between different domains. In the shared subspace, the data distributions of different domains should be close to each other and task-relevant information of the original data should be preserved. In addition to the distribution matching, TCA preserves the properties of the data.2 Furthermore, any machine learning method for regression, classification or clustering can be used on the identified subspace. Although, in its original version by Pan et al., TCA was introduced for two domains [25], here we utilize an extension to multiple source domains introduced by Grubinger et al. [14]. Consider the setting where measurements are available from multiple source houses i ∈ 1, . . . , D, denoted by XSi and a target house XT . TCA is applicable if P (XSi ) 6= P (XSj ), 1 ≤ i < j ≤ D, where P (XSi ) is the probability distribution of XSi . The goal of TCA is to find a kernel-induce feature map Ψ such that P (Ψ(XSi )) ≈ P (Ψ(XSj )) and P (Ψ(XSi )) ≈ P (Ψ(XT )). Once transformed, the combined source and target data can be used in the subsequent machine learning task. Note though that no data from the target house XT is available for the construction of Ψ(·). The assumption of domain generalization is that the source and target domains are related such that common information can be learned from the source domains and applied to the target domain. 2 This is achieved by maximally preserving the data variance, similarly to Principal Component Analysis (PCA) and Kernel-PCA [29]. 11 The goal of matching the probability distributions of the available source domains can be translated into a mathematical program as the following derivation demonstrates. Let K be a combined Gram matrix [29] of the cross-domain data of the source domain datasets XS1 ∪ XS2 ∪ ... ∪ XSD . Each element Ki,j of K ∈ RN ×N is given by φ(xi )T φ(xj ), where N is the total number of instances of the source domain datasets and φ is a kernel function. Note that, with the employment of a linear kernel function in this works the construction of N ×N Ki,j simplifies to φ(xi )T φ(xj ) = xT i xj . Let the elements Li,j of L ∈ R be defined as ( S−1 if xi , xj ∈ XSd N 2 n2s Li,j = (9) 1 − N 2 ns nu if xi ∈ XSd , xj ∈ XSu and d 6= u where d, u ∈ {1, ..., D}. With parameter matrix W ∈ RN ×m , m  N and the tradeoff parameter µ ≥ 0 for the complexity term tr(WT W), the objective of TCA is defined as [25] min tr(WWT KLKW) + µ tr(WT W), s.t. WT KHKW = I. W (10) Here, the centering matrix H is defined as H = I − N1 11T , where 1 ∈ RN is a column vector with all ones and I ∈ RN ×N is the identity matrix. tr(WT KLKW) corresponds to the mismatch of distribution by the maximum mean discrepancy (MMD) [30] distance and WT KHKW is the variance of the projected samples. The embedding of the data in the latent space is given by WT K. As shown by Pan et al. [25], the solution of W is given by the m  N leading eigenvectors of (KLK + µI)−1 KHK. (11) Parameter m is commonly selected by cross validation [25, 14]. 4.2. GOTL under multiple source domains In general, GOTL can be applied to multiple source domains following the same outline as described in Section 3.1. The only difference is the use of fS (·). For the case of a single source house fS (·) = hS (·), where hS (·) is a supervised prediction function. In case of multiple source domains fS (·) = hS (θ(·)), where θ(·) = WT [φ(·)T φ(xj )]j∈N . 12 5. Experimental Setup In this section, we describe the experimental setup with which the proposed GOTL algorithm was tested for climate control in residential buildings. 5.1. Simulation platform We used a standard tool for modeling and simulating residential buildings, namely EnergyPlus (V7-2-0) developed by the U.S. Department of Energy [31]. The Building Controls Virtual Test Bed (BCVTB) simulation tool has also been used for allowing data collection and also climate control developed in MATLAB to be implemented during run-time. A three-storey residential building was modeled and simulated with the EnergyPlus environment to allow for collecting data from a realistic residential environment. 5.2. Data Generation The simulated house is equipped with a radiant heating system which operates under an intermittent operation (i.e., on/off) pattern. We are concerned with the prediction and control of the temperature of a single thermal zone of this house. When evaluating the prediction accuracy of the developed prediction models, the data were generated under a standard hysteresis controller with set temperature equal to 21o C and sampling period Ts = 1/2h (cf., [5, Section 5.2]), thus assuming normal operating conditions. When, instead, the developed (online) prediction model was also used to provide predictions under an MPC formulation, the training data were generated under the currently implemented MPC. The details of these experiments will be discussed in a forthcoming section (Section 6.3). Independently of the data generation process (offline or online), there also exists a natural ventilation system that operates autonomously and with a constant air flow, i.e., there is no heating control through the HVAC system. The following parameters can be measured: the temperature of all thermal zones; the outdoor temperature; the water flow and the inlet water temperature of the radiant heating system; and all exogenous heat sources, namely the solar gain and the occupants presence. Lastly, it is important to note that for the low-order linear models identified in this paper, the experiments (offline or online) will be informative (cf., [5, Section 5.5]). This is due to the intermittent pattern of both the input and disturbance signals, which result in a sufficient number of distinct frequencies in these signals. In particular, even though the experiments presented in this paper are closed-loop experiments (since the water flow of the radiant heating system depends on the zone temperature), the input signal 13 of the water flow is a nonlinear function of both the occupancy pattern as well as the zone temperature. Thus, as explained in detail in [5, Section 5.5], it is sufficient for the occupancy pattern signal to be persistently exciting in order for the experiments to be informative. This is indeed the case in the current experiments, due to the intermittent form of the occupancy pattern. 5.3. Parameter Setup For training of either the source predictor fS (·) or the target predictor fk (·) we employ a linear transfer model with an output-error model structure (cf., [26, Section 3]). In particular, the function f of the prediction model (1) is defined as a third-order linear transfer model of the output and input/disturbance variables (i.e., ` = 3). The output variable is the temperature of the thermal zone under investigation, while the input/disturbance variables include the water flow, the inlet water temperature, the neighboring zone temperatures (including the outdoor temperature) and the exogenous heat disturbances. Since we want to evaluate the performance of the combined predictor over the temperature of a thermal zone, perfect estimates are assumed for all inputs and exogenous disturbances. The evaluation interval Thor corresponds to a period of 6h, which is relevant for predictions requested within an MPC implementation. As already mentioned, the sampling period was set to Ts = 1/2h. In the computation of the performance function Rk (α) defined in (7), we employ a forgetting factor of δ = 0.995. The better reply function accepts increments of ∆ = 0.025 in the updates of the weight αk . For the source predictor, we utilize a linear regression model, while for the online training of the target predictor, we employ a recursive least squares algorithm (cf., [24]) with a forgetting factor of 0.999. Finally, for the case of multiple source houses, (Section 6.2), TCA is applied with a linear kernel. The best number of principal components is selected from n = {5, 10, 15, 20, 25, 30}, using 6-fold cross validation (in every fold 1/3 of one of the training scenarios is used for testing). 6. Experiments 6.1. Knowledge transfer with a single source house We demonstrate the performance of GOTL by setting up three experiments. With progressing experiment number, the target house is chosen increasingly different from the source house. Table 2 describes the similarities between the source house and the different target houses. Weather data was collected from Washington, DC, (source house) and Linz, Austria, (target house) from November to March 2009. In experiment 3 the target house 14 has also different presence patterns. Presence patterns differ in the definition of the number of people of certain age and gender, as well as their activities (for more details, see [6]). Exp 1 2 3 Weather source: Washington, DC target: Linz, Austria Size same target is 3x larger Presence same different Table 2: Differences between the Target and Source Houses. The results of the experiments of Table 2 are depicted in Figure 1 (Experiment 1), Figure 2 (Experiment 2) and Figure 3 (Experiment 3). Four predictors are evaluated: (i) Source house regressor (fS (·)), trained on XS ; (ii) Target house regressor (fk (·)), incrementally trained on Xk ; (iii) GOTL; and (iv) Ensemble Predictor : a weighted predictor (5) with a fixed α = 0.5, similarly to most ensemble methods. In all figures, we demonstrate an exponentially weighted moving average of the Root Mean Squared Error (RMSE). The lower plot in Figures 1-3 always depicts the weights for the source and target house regressor at each time step tk . Moving Average RMSE 2.0 GOTL Target house regressor Source house regressor Ensemble predictor (α = 0.5) 1.5 1.0 0.5 Regressor Weights 0.0 1.0 Source house weight Target house weight 0.8 0.6 0.4 0.2 0.0 Nov Dez Jan Feb Mar Month Figure 1: Results of Experiment 1 as described in Table 2. 15 Apr Moving Average RMSE 2.0 GOTL Target house regressor Source house regressor Ensemble predictor (α = 0.5) 1.5 1.0 0.5 Regressor Weights 0.0 1.0 0.8 0.6 0.4 Source house weight Target house weight 0.2 0.0 Nov Dez Jan Feb Mar Apr Month Figure 2: Results of Experiment 2 as described in Table 2. Moving Average RMSE 2.0 1.5 1.0 0.5 GOTL Target house regressor Source house regressor Ensemble predictor (α = 0.5) Regressor Weights 0.0 1.0 0.8 Source house weight Target house weight 0.6 0.4 0.2 0.0 Nov Dez Jan Feb Mar Month Figure 3: Results of Experiment 3 as described in Table 2. 16 Apr At the beginning of the evaluation there is not enough data for the target house regressor to make good predictions. Thus, we set the initial evaluation weight to 1 for the source house regressor and 0 for the target house regressor.3 The data for the target house regressor get richer over time. Consequently, the error of the target house regressor drops and the weight of the target house regressor increases. The observations from all three experiments can be summarized as follows: (i) In the first period – in which the train house regressor is better than the target house regressor – GOTL has a similar performance as the train house regressor (approx. 16 weeks in Figure 1, approx. 12 weeks in Figure 2 and only 1-2 weeks in Figure 3). The much shorter time horizon in Figure 1 is not unexpected as the target house is more different (the other houses use the same people presence) than the source house – compared to the other experiments. The only difference between the Experiment 1 and 2 is the size of the house, which explains the slightly longer time horizon where the train house is better than the source house. (ii) In the second period, the weighted combination is at least as good as the target house regressor alone, or better. Particularly in Experiment 2, GOTL is much better than either the train house regressor or the test house regressor alone. In all experiments, GOTL is also at least as accurate as the simple ensemble predictor. 6.2. Knowledge transfer with multiple source houses using TCA We demonstrate that data from multiple source houses can be combined by the domain generalization method TCA and predictive accuracy can be improved – compared to the use of only one source house. Moreover, the combined source house predictor can be combined with the target house regressor using GOTL. For our evaluation, we use 2 source houses. Weather data from both source houses originate from Washington, DC. Source house regressor 2 has three times the size of source house regressor 1. The used target house has two times the size of source house regressor 1 and uses weather data from Linz, Austria. All three houses facilitate a different presence pattern. The results are depicted in Figure 4. It can be observed that the combined source house regressor is much better than using either one of the source houses alone. One reason for the good source house performance is that the 3 Note that the coefficients for the source house regressor and the target house regressor correspond to α and (1 − α) in Section 3, respectively. 17 3.5 GOTL Target house regressor Combined Source house regressor Source house regressor 1 Source house regressor 2 Moving Average RMSE 3.0 2.5 2.0 1.5 1.0 Regressor Weights 0.5 0.0 1.0 0.8 0.6 0.4 0.2 0.0 Nov Source house weight Target house weight Dez Jan Month Feb Mar Apr Figure 4: Results of Experiment 4 as described in Section . source houses are selected, such that the target house size is just in between the sizes of two source houses. GOTL performance is comparable to the combined source house regressor in the first 5 weeks and better than all other regressors afterwards. 6.3. MPC experiments In the previous experiments, we evaluated the prediction performance of the GOTL algorithm when data were generated under a standard hysteresis controller. In those experiments, the prediction models derived were not used in the controller design process, since the objective was primarily the evaluation of the prediction accuracy. In this section, instead, we wish to evaluate the performance of the introduced online transfer learning methodology when employed within an MPC formulation for climate control, i.e., when the prediction models are directly used in the control design. Questions related to whether the derived prediction models may reduce the energy consumption naturally emerge. To this end, we designed a standard MPC for the radiant-heating system of the main living area of the residential building. The goal is to evaluate the performance of the GOTL algorithm with respect to the energy consumption 18 and compare it with the case that such online transfer models are not available. The structure of the MPC employed is rather simple and addresses the following optimization problem min κ N hor n X 2 o  p̂(t) T̂r (t) − Tset (t) /Nhor + t=0 NX hor −1 n var. t=0 + Tw (t) o   βTs Tw+ (t) − T̂w− (t) + γTs V̇w (t) ∈ {45o C}, (12a) (12b) V̇w (t) ∈ {0, V̇w,max }, (12c) t = 0, 1, 2, ..., Nhor − 1, where T̂r is the temperature prediction of the room provided by the available prediction model (e.g., the GOTL model), Tset is the desired/set temperature, Tw+ is the inlet water temperature of the radiant heating system, T̂w− is a prediction of the outlet water temperature, and V̇w is the water flow. Note that the first part of the objective function (12a) corresponds to a comfort measure scaled with a positive constant κ. It measures the average squared difference of the room temperature from the desired (or set) temperature entered by the user at time k. The set temperature was set equal to 21o C throughout the optimization horizon. The variable p̂ ∈ {0, 1} is a boolean variable that corresponds to our estimate on whether people are present in the room at time instance t. The second part of the objective function (12a) corresponds to the heating cost, while the third part corresponds to the pump-electricity cost. The nonnegative parameters β, γ were previously identified for the heating system of the simulated house and take values: β = 0.3333kW/o Ch, γ = 0.5278 · 103 kW sec/hm3 . The non-negative constant κ is introduced to allow for adjusting the importance of the comfort cost compared to the energy cost. The p̂(t), t = 1, 2, ..., Nhor , as well as the rest of the disturbances (such as the outdoor temperature and the solar gain) are assumed given (i.e., predicted with perfect accuracy). This assumption is essential in order to evaluate precisely the impact of our prediction model T̂r in the performance of the derived optimal controller. In fact, we should expect that an accurate prediction of the room temperature will also lead to an efficient controller with respect to the energy consumption. The sampling period was set to Ts = 1/2h, the optimization period was set to Topt = 1h, and the evaluation/optimization horizon was set to Thor = 6h. 19 This implies that Nhor = 6 · 2 = 12. Furthermore, the control variables are the inlet water temperature which assumes a single value (45o C) and the water flow which assumes only two values, the zero flow and the maximum one, V̇w,max = 0.0787kg/sec. In Figure 5, we have generated the comfort-heating cost curve for the available prediction models under varying κ (i.e., under different weights on the comfort cost of the objective function (12a)). The reason for generating such performance curves is the fact that the performance of any two controllers with respect to energy efficiency may only be compared under the same comfort-cost level. Of course, a controller that achieves lower heating costs under the same comfort cost will be more efficient. Experiments were conducted over a five-month period under Experiment 3 of Table 2. The prediction model of the target house was trained online with the data generated under the MPC implementation, using the recursive least squares of Section 5.3. The weights α of the GOTL predictor were also updated online according to the online algorithm of Table 1. As we observe in Figure 5, the heating costs under the GOTL predictor are lower than any other prediction model. Under high comfort costs, i.e., when comfort is not of high priority, the energy consumption is very close to the energy consumption of the train model. On the other hand, under low comfort costs, i.e., when comfort is a priority, the energy consumption of the GOTL predictor is about 100 kWh lower compared to the trained predictor (over the five-month period), which is a non-negligible amount of energy. It is also important to note that the performance of the test predictor with respect to the energy consumption is rather poor for these first five months. This verifies our claim over the utility of online transfer learning methodologies for climate control in residential buildings. 20 4500 GOTL Target house regressor Source house regressor Ensemble predictor (α = 0.5) Heating Cost [KWh] 4000 3500 3000 2500 2000 1500 1000 60000 80000 100000 120000 140000 Comfort Cost (Tset − Tr )2 160000 180000 200000 Figure 5: MPC experiments . 7. Conclusions & Future Work We presented the online transfer learning framework GOTL, which is applicable for classification and regression tasks and allows to optimally combine an (offline) source domain predictor with an online target domain predictor. The results demonstrated the utility of the combined predictor to significantly improve prediction accuracy in the first weeks and months of a new building – compared to either using the source house predictor or target house predictor alone. Further improvements in predictive accuracy can be achieved by facilitating multiple source houses and TCA. Improvements in predictive accuracy also translate into non-negligible energy savings for given comfort levels. It is also important to note the adaptive response of the proposed online transfer learning algorithm. Although the above experiments were evaluated over a period of five winter months, training of an online regressor over longer periods of time may be challenging. This is primarily due to changes either in the weather conditions or in the heating patterns. In such variations, degradations in the prediction error of a target predictor will be significantly reduced by considering the GOTL algorithm, as can easily be seen from the behavior of GOTL during the first few weeks in all the considered experiments. 21 8. Bibliography References [1] T. Grubinger, G. C. Chasparis, T. Natschläger, Online transfer learning for climate control in residential buildings, in: Proceedings of the 5th Annual European Control Conference (ECC 2016), 2016, pp. 1183–1188. [2] T. Nghiem, G. Pappas, Receding-horizon supervisory control of green buildings, in: Proc. of the 2011 American Control Conference, San Francisco, CA, USA, 2011, pp. 4416–4421. [3] F. Oldewurtel, A. Parisio, C. Jones, M. Morari, D. Gyalistras, M. Gwerder, V. Stauch, B. Lehmann, M. Morari, Use of model predictive control and weather forecasts for energy efficient building climate control, Energy and Buildings 45 (2012) 15–27. [4] C. Touretzky, M. Baldea, Model reduction and nonlinear MPC for energy management in buildings, in: Proc. of 2013 American Control Conference (ACC), Washington DC, USA, 2013, pp. 455–460. [5] G. Chasparis, T. Natschlaeger, Regression Models for Output Prediction of Thermal Dynamics in Buildings, ASME, Journal of Dynamic Systems, Measurement, and Control. URL http://dx.doi.org/10.1115/1.4034746 [6] J. Martinez-Gil, G. Chasparis, B. Freudenthaler, T. Natschlaeger, Realistic user behavior modeling for energy saving in residential buildings, in: 2014 25th International Workshop on Database and Expert Systems Applications (DEXA), 2014, pp. 121–125. doi:10.1109/DEXA.2014.38. [7] J.-M. Yiu, S. Wang, Multiple ARMAX modeling scheme for forecasting air conditioning system performance, Energy Conversion and Management 48 (2007) 2276–2285. [8] P. Malisani, F. Chaplais, N. Petit, D. Feldmann, Thermal building model identification using time-scaled identification models, in: Proc. of 49th IEEE Conference on Decision and Control, Atlanta, GA, USA, 2010, pp. 308–315. [9] G. Mustafaraj, G. Lowry, J. Chen, Prediction of room temperature and relative humidity by autoregressive linear and nonlinear neural network models for an open office, Energy and Buildings 43 (2011) 1452–1460. 22 [10] F. Scotton, L. Huang, S. Ahmadi, B. Wahlberg, Physics-based modeling and identification for HVAC systems, in: Proc. of 2013 European Control Conference (ECC), Zurich, Switzerland, 2013, pp. 1404–1409. [11] S. J. Pan, Q. Yang, A survey on transfer learning, IEEE Trans. on Knowledge and Data Engineering 22 (10) (2010) 1345–1359. [12] S. J. Pan, V. W. Zheng, Q. Yang, D. H. Hu, Transfer learning for wifi-based indoor localization, In Proc. of the Workshop on Transfer Learning for Complex Tasks, of the 23rd AAAI Conference on Artificial Intelligence (2008) 43–48. [13] G. E. Hinton, R. Salakhutdinov, Using deep belief nets to learn covariance kernels for gaussian processes, in: Neural Information Processing Systems (NIPS), 2007, pp. 1249–1256. [14] T. Grubinger, A. Birlutiu, H. Schöner, T. Natschläger, T. Heskes, Domain generalization based on transfer component analysis, in: Advances in Computational Intelligence: IWANN 2015, Palma de Mallorca, Spain, June 10-12, 2015. Proceedings, Part I, Springer, 2015, pp. 325–334. [15] K. Muandet, D. Balduzzi, B. Schölkopf, Domain generalization via invariant feature representation, in: International Conference on Machine Learning (ICML), 2013, pp. 10–18. [16] P. Zhao, S. C. Hoi, J. Wang, B. Li, Online transfer learning, Artificial Intelligence 216 (2014) 76–102. [17] T. G. Dietterich, Ensemble methods in machine learning, in: Multiple Classifier Systems, Springer, 2000, pp. 1–15. [18] A. Fern, R. Givan, Online ensemble learning: An empirical study, Machine Learning 53 (1-2) (2003) 71–109. [19] W. Fan, S. J. Stolfo, J. Zhang, The application of adaboost for distributed, scalable and on-line learning, in: Proc. of the 5th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ACM, 1999, pp. 362–366. [20] N. Littlestone, Learning quickly when irrelevant attributes abound: A new linear-threshold algorithm, Machine learning 2 (4) (1988) 285–318. [21] N. Littlestone, M. K. Warmuth, The weighted majority algorithm, Information and computation 108 (2) (1994) 212–261. 23 [22] A. A, T. Evgeniou, M. Pontil, Multi-task feature learning, Advances in Neural Information Processing Systems 19 (2007) 41. [23] O. Dekel, P. M. Long, Y. Singer, Online learning of multiple tasks with a shared loss., Journal of Machine Learning Research 8 (10). [24] A. Sayed, Fundamentals of Adaptive Filtering, John Wiley & Sons, Inc., New Jersey, 2003. [25] S. J. Pan, I. Tsang, J. Kwok, Q. Yang, Domain adaptation via transfer component analysis, IEEE Trans. on Neural Networks 22 (2) (2011) 199–210. [26] L. Ljung, System Identification: Theory for the User, 2nd Edition, Prentice Hall Ptr, Upper Saddle River, NJ, 1999. [27] H. Young, The evolution of conventions, Econometrica 61 (1) (1993) 57–84. [28] G. Blanchard, G. Lee, C. Scott, Generalizing from several related classification tasks to a new unlabeled sample, in: Neural Processing Letters (NIPS), 2011, pp. 2178–2186. [29] B. Schölkopf, A. Smola, K. Müller, Kernel principal component analysis (1999). [30] A. Gretton, K. Borgwardt, M. Rasch, B. Schölkopf, A. Smola, A kernel method for the two-sample-problem, in: Neural Information Processing Systems (NIPS), 2006, pp. 513–520. [31] EnergyPlus, EnergyPlus Energy Simulation software Version: 7-2-0. URL https://energyplus.net/ 24
3cs.SY
arXiv:1704.05325v1 Anomaly detection and motif discovery in symbolic representations of time series Fabio Guigou, Pierre Collet, Pierre Parrend TECHNICAL REPORT No 69427/2 Wednesday 19th April, 2017 ARK unitwin-cs.org/ark:/69427/02 4PFactory: E-Laboratory on the Factory of the Future Anomaly detection and motif discovery in symbolic representations of time series Fabio Guigou Pierre Collet Pierre Parrend Wednesday 19th April, 2017 Abstract The advent of the Big Data hype and the consistent recollection of event logs and real-time data from sensors, monitoring software and machine configuration has generated a huge amount of time-varying data in about every sector of the industry. Rule-based processing of such data has ceased to be relevant in many scenarios where anomaly detection and pattern mining have to be entirely accomplished by the machine. Since the early 2000s, the de-facto standard for representing time series has been the Symbolic Aggregate approXimation (SAX). In this document, we present a few algorithms using this representation for anomaly detection and motif discovery, also known as pattern mining, in such data. We propose a benchmark of anomaly detection algorithms using data from Cloud monitoring software. Keywords Time series, Symbolic representation, Anomaly detection, Pattern mining Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.1 Problem statement 9 1.2 Change and anomaly detection in time series 9 1.2.1 Symbolic representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.2.2 On raw data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3 Context and goals 2 The SAX representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 Anomaly detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.1 Hot SAX 13 3.2 Sequitur 15 3.3 Chaos game representation 17 4 Motif discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.1 Minimal Description Length 19 4.2 Grammar inference 19 4.3 MK algorithm 20 4.4 Motif Tracking algorithm 20 4.5 Mining approximate motifs 20 5 Experimental evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.1 Input data 25 5.2 Anomaly detection benchmark 25 5.2.1 Note on figure reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2.2 Performance figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.2.3 On SAX parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.2.4 Hot SAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.2.5 Sequitur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.2.6 Chaos Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6 Conclusion and perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7 Scientific validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 9 3 List of Figures 5.1 Anomaly in CPU load stuck at 100% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2 Transition in RAM usage (high and aperiodic to low and periodic) . . . . . . . . . . . . . . . . . . . . . . . 26 5.3 Small motif embedded in an apparently random RAM usage . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.4 Obviously periodic TCP session count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.5 Weekly pattern ignored, anomalies detected when average value runs too high (Sequitur) . . . . . . 28 5.6 Wrongly detected anomalies due to a weekly cycling pattern (Chaos Game) . . . . . . . . . . . . . . . 29 5 List of Tables 5.1 Runtime comparison of anomaly detection algorithms (mean time (s) / standard deviation) . . . . . . 27 7 1 Introduction 1.1 Problem statement We consider the problem of detecting anomalies and establishing baseline behaviour in time series captured by network monitoring software. Since the inception of such software, failure detection has mostly been performed by polling a number of metrics, storing them for expert analysis and applying simple decision rules based on the last few data points of each series independently, e.g. signaling a failure when all points within a short analysis window stay above a given threshold. While this approach has worked well enough to keep data-centers running, it still fails to capture many important events, such as deviations from a normal baseline or early signs of failure. While algorithms exist to perform such tasks, using them for monitoring would require significant hardware upgrades. We study alternative methods to fill the gap between crude expert systems and costly anomaly detection and pattern mining algorithms. 1.2 Change and anomaly detection in time series 1.2.1 Symbolic representations Anomaly detection in time series is a prominent task in data-mining. However, the size and number of such series makes it extremely demanding in terms of computational power. To overcome this issue, many alternative representations have been proposed for time series: Discrete Fourier Transform, Wavelet Transform [1], Singular Value Decomposition... SAX was proposed in 2003 [2] as a simple, compact, text-based representation that reduces dimensionality and allows the use of string processing algorithms to analyze time series [3]. It has seen applications in time series indexing [4], visualization [5] and various mining tasks [6, 7, 8]. Applications have even been tried on objects that are only remotely connected to time series, such as motion detection [9]. 1.2.2 On raw data Other statistical approaches have been used on raw time series data. Change point detection, i.e. detecting when a model stops fitting the data and a new one must be derived, has been implemented in many ways: using Bayesian models [10] or sequential testing [11, 12] to perform online detection. These methods have proven computationally efficient and able to reliably detect structural changes in data stream. However, they do not offer the wide range of applications that come with symbolic representation, and especially string representation. In this report, we focus on the opportunities offered by this paradigm. 1.3 Context and goals In the ever growing field of Cloud computing and Cloud networking, service providers face the challenge of operating a high number of devices, both physical and virtual, while maintaining a contractually defined service level, known as SLA (Service Level Agreement). This situation calls for a tight monitoring of all the infrastructure. Monitoring software typically polls devices using ICMP and SNMP, collects data such as response time, CPU load, memory usage, and compares these values to thresholds. In the event of a value crossing the alert threshold, some form of warning is sent to the administrators. 9 CHAPTER 1. INTRODUCTION 10 While such software “does the job”, it is often imprecise, yields lots of false positive or raises alerts too late, when the device has already failed or a customer has already opened a case for performance degradation. These shortcomings indicate the need for more advanced techniques, such as behavioral anomaly detection, that can either replace or improve the current methods. The point of this study is to determine the feasibility of real-time anomaly detection in computer network monitoring time series. The advantages of such approach are expected to be low computational costs and good accuracy. Since monitoring, even using only crude threshold methods, is already CPU-intensive, we turned to symbolic representations of time series to search for a method compatible with low-resource monitoring servers. 2 The SAX representation SAX is a time series representation designed to vastly reduce the data dimensionality and redundancy by subsampling and quantization. Typical settings use a subsampling factor n of 8 to 10 and only α = 3 or 4 bins for quantization. It is widely accepted that the impact of this parameter is small. The basic algorithm operates on the whole time series by applying a z-normalization (setting the mean to 0 and standard deviation to 1), replacing each non-overlapping window of n points by its average – a process known as Piecewise Aggregate Approximation (PAA) – and applying a Gaussian quantization of this PAA into α bins. It is worth noting that, while the conversion of a time series into a character string is not a familiar operation, the subsample-and-quantize process applied is the basis of any lossy compression algorithm: JPEG for image, MPEG for video, A-law and µ-law for audio... The vector quantization, i.e. the dispatching of values into bins, depends on the original assumptions on the underlying statistical distribution. SAX [2] assumes a normal distribution of the time series values at the scale of a SAX word, as shown in Algorithm 1. Algorithm 1 Basic SAX encoding algorithm procedure SAXE NCODE input: S = [s1 , s2 , ..., sN ] . real-valued time series α = int . cardinality (typical values: 3 or 4) n = int . symbol size (typical values: 8 to 10) output: s = string . SAX representation algo: . GQF is the Gaussian Quartile Function breakpoints = GQF(1/(α − 1), 2/(α − 1), ..., (α − 2)/(α − 1)) . (for α = 3, breakpoints = [−0.43, 0.43]; for α = 4, breakpoints = [−0.67, 0, 0.67]) S = (S − mean(S))/std(S) Saggr = [sum(s1 , s2 , ..., sn )/n, sum(sn+1 , sn+2 , ..., s2n )/n, ...] s = quantize(Saggr , breakpoints) However, though this approximation is able to capture the main characteristics of a time series, it is not always appropriate for algorithms designed to operate on fixed-size sliding windows. In order to analyze long running series of thousands of points, the SAX encoding can be applied to such sliding windows as shown in Algorithm 2. All following algorithms use this representation (list of words with full overlap) unless otherwise stated. The sliding window is often referred to as a “feature window” in the literature because the window size is tuned to the approximate size of the feature one wishes to extract from the series. This is particularly true for periodic time series, such as ECG datasets or sound analysis [13]. 11 CHAPTER 2. THE SAX REPRESENTATION 12 Algorithm 2 The most widely used SAX encoding, using a sliding window procedure SAX input: S = [s1 , s2 , ..., sN ] . long real-valued time series α = int . cardinality n = int . symbol size w = int . sliding window size (feature size, usually user-specified) output: s0 = [s01 , s02 , ..., s0N−w ] . list of SAX words algo: . sliding window extraction windows = [[s1 , s2 , ..., sw ], [s2 , s3 , ..., sw+1 ], ..., [sN−w , sN−w+1 , ..., sN ]] s0 = SAXEncode(windows, α, n) 3 Anomaly detection 3.1 Hot SAX Hot SAX [14] is not an anomaly detection algorithm per se. Instead, it is a heuristic based on the SAX representation of a time series to accelerate the brute-force algorithm. The “obvious” way to detect an anomaly is to search for the subsequence with the highest distance to any other subsequence, i.e. finding argmaxi (min j (dist(xi , x j )), |i − j| > n over the set x of all sliding windows of n points extracted from the time series t. This search involves a quadratic number of distance computations and therefore is not suitable for more than a few hundred points. Note that self-matches are excluded: the nearest neighbor of a subsequence is only searched among other subsequences having no point in common with it. The naive implementation is shown in Algorithm 3: Algorithm 3 Brute-force anomaly detection procedure B RUTE FORCE DISCOVERY input: T = [t1 ,t2 , ...,tN ] . time series n = int . window size output: dist = f loat . max Euclidean distance between any 2 subsequences loc = int . location of most anomalous subsequence algo: dist = 0 loc = null for p = 1 to N do[0] nndist = in f for q = 1 to N − n + 1 do if |p − q| ≤ n then next if dist([t p ,t p+1 , ...,t p+n−1 ], [tq ,tq+1 , ...,tq+n−1 ]) < nndist then nndist = dist([t p ,t p+1 , ...,t p+n−1 ], [tq ,tq+1 , ...,tq+n−1 ]) if nndist > dist then dist = nndist loc = p However, changing the order in which distances are computed, while not changing the end result, may speed up the search by multiple orders of magnitude (while retaining a complexity of O(N 2 )) by allowing early terminations of the loops, as shown in Algorithm 4. Using the SAX representation, the outer and inner heuristics index the time series by its symbolic approximation and use the simple assumptions that rare SAX words correspond to rarely occurring subsequences, and that two similar sequences will have a similar SAX representation. Therefore, the outer heuristic first searches the most anomalous subsequence among thoses represented by the rarest SAX word, and the inner 13 CHAPTER 3. ANOMALY DETECTION 14 Algorithm 4 Anomaly detection, with heuristics procedure H OT SAX input: T = [t1 ,t2 , ...,tN ] . time series n = int . window size output: dist = f loat . max Euclidean distance between any 2 subsequences loc = int . location of most anomalous subsequence algo: dist = 0 loc = null for p = 1 to N order by OuterHeuristic do nndist = in f for q = 1 to N − n + 1 order by InnerHeuristic do if |p − q| ≤ n then next if dist([t p ,t p+1 , ...,t p+n−1 ], [tq ,tq+1 , ...,tq+n−1 ]) < nndist then nndist = dist([t p ,t p+1 , ...,t p+n−1 ], [tq ,tq+1 , ...,tq+n−1 ]) if dist([t p ,t p+1 , ...,t p+n−1 ], [tq ,tq+1 , ...,tq+n−1 ]) < dist then break if nndist > dist then dist = nndist loc = p CHAPTER 3. ANOMALY DETECTION 15 heuristic searches any subsequence’s neighbors among other subsequences represented by the same word as shown in Algorithm 5. Algorithm 5 Heuristics used for anomaly detection procedure O UTER H EURISTIC input: T = [t1 ,t2 , ...,tN ] . time series n = int . window size output: P = [p1 , p2 , ..., pN ] . ordered indexes H = {word => [indexes]} . indexed SAX representation of T algo: words = SAX(T, n) H = hash{word => [indexes of each occurrence of this word]} min = min(hash.values) . (min = almost always 1) P = [indexes of words occurring only min time] + [other indexes, shuffled] procedure I NNER H EURISTIC input: T = [t1 ,t2 , ...,tN ] H = {word => [indexes]} p = int output: Q = [q1 , q2 , ..., qN ] algo: Q = H{words[p]} + [other indexes, shuffled] . time series . indexed SAX representation of T . index of current subsequence . ordered indexes 3.2 Sequitur The Sequitur [15] algorithm proposed by Nevill-Manning in 1997 [16] is a dictionary-based compression algorithm. It uses the concepts of symbol, rule and digram to build a compact representation of its input data. In Sequitur vocabulary, a symbol is either an input token (e.g. a single character, or byte) or a token representing a rule; a rule is a symbol standing for a digram; and a digram is a pair of symbols. Therefore, in a string “abc”, “a”, “b” and “c” are symbols and “ab” and “bc” are digrams. A rule will have the form “A = ab”, meaning that a string “Ac” can be read as “abc”. With such a rule, “A” and “c” are symbols and “Ac” is a digram that can be itself part of another rule. Since Sequitur builds a compact, context-free generative grammar for any sequence, it has been used for various analytical tasks, such as program trace analysis [17], query of compressed XML databases [18] or structure inference in DNA and musical pieces [19]. The algorithm has a complexity of O(N), which makes it suitable even for large series. Sequitur transforms any input sequence into a compact representation where two essentials constraints are met: no digram appears more than once in the output sequence (digram uniqueness), and no rule is used (either in the output sequence or in other rules) less than twice (rule utility). It is argued in [15] that the number of rules used to represent a given point in a Sequitur-compressed time series, being proportional to its CHAPTER 3. ANOMALY DETECTION 16 compressibility, is a good approximation of the series’ Kolmogorov complexity, or algorithmic complexity (i.e. the size of the smallest program capable of generating the series) at that point. The assumption is that an anomaly is very likely to correspond to a rising complexity, or a lowering compressibility. Sequitur builds a grammar tree in which the depth of a leaf is directly related to its frequency in the original string. Higher level, non-terminal nodes in the tree correspond to frequent patterns in the data. Conversely, shallow branches denote rare patterns, which is of interest in anomaly detection. With the analytic decompression routine that follows, the rule density, i.e. the depth in the grammar tree, can be associated to any point in the series from the Sequitur representation as shown in Algorithm 6. Algorithm 6 Analytic unwrapping procedure unwrap(token, depth, rules) = if token not in rules then (token, depth) else [unwrap(rules{token}[1], depth + 1, rules), unwrap(rules{token}[2], depth + 1, rules)] unwrap(blob, rules) = unwrap(token, 0, rules) for each token in blob The anomaly detection algorithm proposed uses as Sequitur symbols the SAX words representing subsequences (i.e. a basic symbol could be ’aabacd’) as shown in Algorithm 7. Algorithm 7 Anomaly detection using the Sequitur compression algorithm procedure S EQUITUR A NOMALY input: T = [t1 ,t2 , ...,tN ] . time series n = int . window size output: . Sequitur rule density @ each point of the series (inverse anomaly score) density = [d1 , d2 , ..., dN ] algo: words = SAX(T, n) . SAX words [e.g. ’abbcab’] are used as elementary alphabet for Sequitur tokens, rules = Sequitur(words) tokens = list of Sequitur symbols rules = hash {symbol → [symbol|letter, symbol|letter]} unwrapped = [] for all token in tokens do unwrapped << unwrap(token, 0, rules) . unwrapped is [(SAX word, depth)] for i = 1 to N do density = sum(unwrapped[max(i − n, 0), max(i − n + 1, 0), ..., i]) CHAPTER 3. ANOMALY DETECTION 17 3.3 Chaos game representation The Chaos Game representation [20, 21] is a way of generating a bitmap from a DNA fragment, i.e. a string generated by an alphabet of four symbols (A, C, T, G). It recursively splits the two-dimensional space into pixels representing the number of occurrences of specific strings, adding one character at each level (e.g. at level one, it generates a 4-pixel image with the total count of A, C, G, and T bases. At level 2, the image is 4-pixel wide, with pixel corresponding to length-2 strings such as AA, AC, AT, ..., TG, TT). The proposed algorithm uses the SAX representation of a time series, with an alphabet size of 4, to build such bitmaps [22], and then compare the bitmap of a detection window (after the currently analyzed point) and a lag window (before the point). Typically the lag window is 2 or 3 times longer than the detection window, therefore the bitmap must first be scaled. Besides the graphical aspect of the bitmap generation, this algorithm is a simple histogram comparison: the frequency distribution of all possible N symbols strings is computed to the left and right of each point in the time series and the two distributions are compared to yield an anomaly score. Since the number of bins in the histograms grows exponentially with the analysis level, the SAX sliding window will typically be short. The authors use a level 3 analysis, i.e. 64-bin histograms. The anomaly score at any given point ti of the time series is given by di = ∑Nj=1 (Hi−lead,i − Hi,i+lag )2 , where Hi, j is the histogram computed between points ti and t j , as shown in Algorithm 8. Results presented in [20] show that even subtle structural anomalies in periodic series can be detected. Algorithm 8 Anomaly detection using the Chaos Game sequence representation procedure C HAOS G AME A NOMALY input: T = [t1 ,t2 , ...,tN ] . time series n = int . symbol size w = int . window size D = int . detection window length (in number of SAX windows) L = int . lag window length (in number of SAX windows) output: score = [s1 , s2 , ..., sN ] . anomaly score algo: words = SAX(T, 4, n, w) for i = 1 + L to N − D do det_map = ChaosGame(words[i, i + n, ..., i + n ∗ (D − 1)])/D lag_map = ChaosGame(words[i − L ∗ n, i − (L − 1) ∗ n, ..., i − n])/L scorei = EuclidianDistance(det_map, lag_map) 4 Motif discovery 4.1 Minimal Description Length While not directly using the SAX representation, the Minimal Description Length algorithm [23] transforms the time series in a symbolic representation by means of a multiscale Gaussian blur called scale-space image; at each level, segments bounded by the zero-crossings of the first derivative of the smoothed time series are extracted. These segments are compactly described by two coordinates: their length and the difference between their first and last point. This description is then quantized via a k-means clustering step. The time series at each scale can be processed as a string. The Minimal Description Length (MDL) framework is an approach in which a motif is selected if it increases the compression ratio of the time series, i.e. it allows for a shorter description. Given the complexity of it exact computation (which would require the extraction and evaluation of all possible sets of motifs), a heuristic is used: only one motif is extracted at each scale. Typically, 8 scales are used. This algorithm, used on complex and noisy data sets such as vibration measured on a bridge, is able to isolate multiscale overlapping patterns, such as the passing of a single car on the aforementioned bridge as shown in Algorithm 9. Algorithm 9 Motif detection using the Minimal Description Length framework procedure MDLM OTIF input: T = [t1 ,t2 , ...,tN ] . time series n = int . decomposition level output: M = (m1 , m2 , ..., mN ) . set of motifs algo: M = () for i = 1 to n do detaili = T ? hi . hi gaussian kernel of size 2i derivi = detaili, j+1 − detaili, j , j ∈ {1, 2, ..., N − 1} 1st . derivative . Computation of zero-crossings of the derivative zC = { j|derivi, j = 0} segmentsi = ({zCk+1 − zCk , detaili,zCk+1 − detaili,zCk+1 }), k ∈ {1, 2, ..., |zC| − 1} moti f si = set of repeating strings in segmentsi best_moti fi = argminm∈moti f si L(m) + L(T |m) . best predictor for T at scale i M = M ∪ best_moti fi 4.2 Grammar inference As shown in the previous section, grammar inference [24] can be used not only to detect anomalies but, more naturally, to extract motifs. In this approach, the time series is SAX-encoded with a sliding window and converted into its Sequitur representation in the exact same way as for anomaly detection. The rules created 19 CHAPTER 4. MOTIF DISCOVERY 20 during the compression are then mapped back to time series segments. Contrary to anomaly detection, the points with the highest rule density, i.e. the longest branches in the Sequitur grammar tree, are selected. A post-processing step is required to refine the results by: eliminating self-matches (motif matching itself within a very small offset); selecting the longest patterns, which are more likely to convey useful information; removing “obvious” patterns, e.g. monotonically increasing or constant ones; and merging overlapping patterns if necessary 4.3 MK algorithm The MK (Mueen-Keogh) [25] algorithm is much related to HOTSAX, in that it uses a heuristic to prune an otherwise exact search for the most similar (instead of most different) pair of subsequences inside a time series. However, this algorithm is the only one in our collection operating on the raw time series data instead of a symbolic representation. We chose to include it in this report because of the similarity it bears to HOTSAX. Instead of a SAX pre-processing to lower the number of distance evaluations, the algorithm uses reference points: subsequences chosen at random in the time series, and orders the other subsequences by their distance to the reference. The heuristic is based on the assumption that subsequences that are close to each other will also be close in this projection as shown in Algorithm 10. Note that the algorithm can use multiple reference points, using only one to perform the subsequence reordering and all of them to compute best_dist. This further increases the convergence. As with HOTSAX, the overall complexity of the algorithm is not different from brute force search (O(N 2 )), but the efficient pruning of distance computations makes the actual runtime orders of magnitude faster. 4.4 Motif Tracking algorithm The Motif Tracking algorithm [26], shown in Algorithm 11, is an attempt to bring the Artificial Immune Systems (AIS) class of algorithms that operate almost only on strings into the field of time series processing. The SAX representation is used to produce the antibodies/antigens. It uses a subsequence length equal to the word size, therefore each subsequence is represented by a single symbol. Trackers are used as memory cells; they contain the string representation of a subsequence and a match count. Contrary to usual AIS algorithm, this one is deterministic. Since this algorithm detects exact motifs (without any mutation between any two occurrences) when they appear at least twice, it is logically equivalent to the grammar induction algorithm described earlier. 4.5 Mining approximate motifs The ‘Mining approximate motifs’ algorithm [27], given in Algorithm 12, proposes a number of innovations: it uses aggregative clustering to detect motifs and Pearson’s r instead of Euclidean distance to match potential motif occurrences. Matches are encoded as 2-clusters that are later merged and extended. Note that the original algorithm is proposed for a database of time series; we show an adapted version for a single long time series. The original algorithm proposes a way to extend the motif instances; however, our use of SAX sliding windows makes this step inconvenient and mostly useless: the motif length is an initial parameter. In this case, it is also possible to use SAX’s lower-bound distance or Hamming distance as a similarity measure. CHAPTER 4. MOTIF DISCOVERY 21 Algorithm 10 Mueen-Keogh algorithm procedure MKM OTIF input: T = [t1 ,t2 , ...,tN ] . time series n = int . motif length output: S1 , S2 . pair of subsequences with smallest distance algo: best_dist = ∞ re f = [Tr , Tr+1 , ..., Tr+n−1 ], r random for i = 1 to N − n do disti = EuclidianDistance(re f , [Ti , Ti+1 , ..., Ti+n−1 ]) if disti < best_dist then best_dist = disti S1 = re f S2 = [Ti , Ti+1 , ..., Ti+n−1 ] Order subsequences s1 , s2 , ..., sN−n by their corresponding distances with function I j mapping to their original positions offset = 0 abandon = 0 while not abandon do offset = offset + 1 abandon = 1 for j = 1 to N − n do if distI j − distI j+offset < best_dist then abandon = 0 if EuclidianDistance(sI j , sI j+offset ) < best_dist then best_dist = EuclidianDistance(sI j , sI j+offset ) S1 = sI j S2 = sI j+offset CHAPTER 4. MOTIF DISCOVERY 22 Algorithm 11 The motif tracking algorithm procedure M OTIF T RACKING input: T = [t1 ,t2 , ...,tN ] . first differential of time series α = int . alphabet size s=1 . subsequence length r) f loat . matching threshold (Euclidian distance) output: M = (m1 , m2 , ..., mN ) . set of motifs algo: . Trackers are SAX alphabet symbols with associated scores and indexes of occurrences trackers = ([a, 0, ], [b, 0, ], [c, 0, ], ...) symbols = [u1 , u2 , ..., uN−s ] = SAX(T, α, s, s) trackers_change = 0 l=1 . motif length repeat for i = 1toN − s − l do for all tracker, score, indexes ∈ trackers do if [ui , ui+1 , ..., ui+l ] = tracker then if ∀ j ∈ indexes, dist([ti ,ti+1 , ...,ti+s ], [t j ,t j+1 , ...,t j+s ])/s < r then score+ = 1 indexes = indexes ∪ i for all tracker, score ∈ trackers do if score < 2 then Remove tracker from trackers else for all symbol ∈ al phabet do Add [tracker + symbol, 0] to trackers s+ = 1 until trackers_change = 0 M = trackers CHAPTER 4. MOTIF DISCOVERY Algorithm 12 Mining approximate motifs with aggregative clustering procedure AGGREGATIVE C LUSTERING M OTIF input: T = [t1 ,t2 , ...,tN ] Rmin = f loat α, word, window output: M = (m1 , m2 , ..., mN ) algo: D = SAX(T, α, word, window) clusters = {} for i = 1 to N do for j = i + window to N − s do if |r(Di , D j )| ≥ Rmin then clusters = clusters ∪ < i, j > repeat updates = 0 for all X = [x1 , x2 , ..., x|X| ] ∈ clusters do for all Y = [y1 , y2 , ..., y|Y | ] ∈ clusters \ X do if ∀x ∈ X∀y ∈ Y |r(Dx , Dy )| ≥ Rmin then clusters = clusters \ X \Y ∪ < x1 , x2 , ..., y1 , y2 , ... > updates+ = 1 until updates = 0 23 . time series . similarity threshold . SAX parameters . set of motifs 5 Experimental evaluation 5.1 Input data To benchmark these algorithms, we use a collection of 14 time series spanning over two months, representing CPU load, memory usage, process count and active TCP sessions of 3 production servers and firewalls. The metrics are acquired with a temporal resolution of one point per minute. These series have been selected because they contain both identifiable motives and anomalies. In particular, they display various failure modes, some of which invalidate the basic assumptions of certain algorithms and therefore are not detected. Anomalies such as depicted in figure 5.1 are easy to detect even for conventional, commercial monitoring software. However, more subtle changes (figure 5.1) that can be symptomatic of a critical component crashing are harder to detect and generally overlooked; instead, the crash might be detected later when it causes other symptoms and impact on other parts of the system. Detecting such types of anomalies is key to faster correction, smaller impact and easier root cause analysis. In the context of IT network monitoring, awareness of motives can simplify analysis by two means: on the one hand, having an expert associate a label to a motif makes it possible to recognize a possibly complex and rare event in real time. On the other hand, periodicity makes traditional, threshold-crossing based methods unreliable because of the potentially large variation of the signal in its normal range. Being able to filter out large low-frequency components is a simple way to improve anomaly detection. 5.2 Anomaly detection benchmark Since the very concept of an anomaly is hard to quantify (i.e. classifying data into “normal” or “abnormal” in time series can be somehow arbitrary, outside of the obvious transitions), we will perform a qualitative evaluation of these algorithms, taking into account execution speed (i.e. CPU load), failure modes (i.e. types of anomalies that cannot be detected), detection delay (i.e. number of data points required to spot an anomaly) and sensitivity to periodic input (i.e. precision loss due to the signal being periodic). 5.2.1 Note on figure reading The blue graph is the raw time series, the green one the anomaly score and the red vertical lines indicate anomaly detection (anomaly score crossing a tunable threshold, here five standard deviations). The anomaly Figure 5.1: Anomaly in CPU load stuck at 100% 25 CHAPTER 5. EXPERIMENTAL EVALUATION Figure 5.2: Transition in RAM usage (high and aperiodic to low and periodic) Figure 5.3: Small motif embedded in an apparently random RAM usage Figure 5.4: Obviously periodic TCP session count 26 CHAPTER 5. EXPERIMENTAL EVALUATION 27 Table 5.1: Runtime comparison of anomaly detection algorithms (mean time (s) / standard deviation) Nb of points Chaos Game Sequitur Hot SAX 44k 6.66/0.24 6.62/3.03 651/? 88k 12.67/0.45 12.07/5.10 ?/? score does not necessarily begin at the same point as the series: it is delayed by buffering in the case of Chaos Game, which implies that the alarm is only raised after that buffering time. 5.2.2 Performance figures We first study the running time of the algorithms. Since we expect to monitor thousands of time series on each monitoring server, a low running time is of paramount importance. Results show that Sequitur and Chaos Game yield about the same running time, between 6 and 7 seconds per month of data. The running time, as predicted, is linear with the size of the series. Hot SAX, on the other hand, displays a much larger, and quadratic, running time; we only ran it once on one month of data, and therefore have no estimate as to the variability of our result of almost 11 minutes. On a time series of two months, the algorithm ran for more than an hour without producing any result. Given that it definitely eliminates it as a viable candidate for IT monitoring, we did not try to let it complete. 5.2.3 On SAX parameters As stated in almost all papers by Keogh et.al., the parameters used for SAX encoding (cardinality and word size) have little impact on the behaviour of any algorithm. At most, they can change the sensitivity and the running time, e.g. trade off accuracy for faster execution, or move along the precision-recall curve. Window size, however, must generally be adapted to the scale of any feature in the series, i.e. the size of the anomaly we try to detect, or the period of the signal. This is one of the major shortcomings we observed in all SAX-based algorithms: with mostly weekly periodic signals, the best settings would delay any analysis until after at least 7 days after a data point is acquired. This is due to the mismatch between the scale of the observed phenomena and the desired detection time. In most use cases, SAX is used to study phenomena of the scale of a second, with a few dozen points per occurrence. We study weekly patterns with thousands of points per occurrence; therefore, the periodic signal is mostly perceived as concept drift from the SAX perspective. However, even with this limitation, most anomalies can still be detected. 5.2.4 Hot SAX As described above, Hot SAX is the only algorithm that does not generate an “anomaly score”, or any kind of distance measure. It only returns the single most anomalous point in a series. While this point, in all our tests, always corresponded to the real anomaly (or one of the anomalies), the algorithm remains extremely slow and its result is of little use in any real-time settings. In fact, our tests had trouble even completing, taking over 10 minutes for one single month of data (while the other algorithms only needed half a dozen seconds). As Hot SAX, by its design, always outputs the mathematically defined worst anomaly, it has inherently no failure mode. In fact, it could be used in IT monitoring, with some restrictions: The data must be undersampled. The search window must be limited. CHAPTER 5. EXPERIMENTAL EVALUATION 28 Figure 5.5: Weekly pattern ignored, anomalies detected when average value runs too high (Sequitur) Hot SAX must only be applied to some critical metrics. If the time series in which the search is conducted can be maintained within a few thousands of points, and Hot SAX is not used on each and every series, it can be a very precise tool for advanced analytics. Its CPU cost is the main obstacle to its adoption as a standard algorithm for anomaly detection. 5.2.5 Sequitur While fast and capable of catching most anomalies, as well as immune to cyclic phenomena, Sequitur relies on the low compressibility of anomalies to spot them. Therefore, it completely fails to detect any anomaly that results in a simplified pattern, like the one in figure 5.1. An interesting feature is that the running time of the algorithm depends more on the complexity (i.e. the number of rules generated by Sequitur) than the number of data points. We found it to be, performance-wise and in terms of detection speed, the best algorithm, requiring little to no look-ahead (in contrast to Chaos Game) and insensitive to cyclic variations (compare correct detection in figure 5.2.5 with errors in figure 5.2.6). However, the failure mode we observed is not compatible with a real production environment, in which it can indicate a serious failure or an attack. Therefore, if Sequitur is to be used, it must be coupled with another algorithm able to detect such failures. It is worth noting that these stationary patterns are only dangerous when they happen at high values, e.g. 100% CPU. Thus a simple threshold-based failure detector would complement Sequitur in a satisfactory way. 5.2.6 Chaos Game The Chaos Game algorithm is the most precise anomaly detector with acceptable runtime performance. We found no failure mode in our dataset. The running time is strictly proportional to the length of the time series, and therefore predictable. We found, however, that the look-ahead required to correctly perform anomaly detection (at least twice the feature window) is unacceptably long, and a short feature window makes the algorithm very sensitive to cyclic patterns. See figure 5.2.6 for an example of false positive (correctly handled by Sequitur in figure 5.2.5). We could not find a correct tuning capable of ignoring these low-frequency variations without lengthening the window (and hence the time between an anomaly happening and it being detected) to at least a day. The only way to use the Chaos Game algorithm would be to couple it with a filter capable of rejecting the false positive after detection, or to remove the low-frequency components before analysis, which could potentially lead to a high false negative rate. CHAPTER 5. EXPERIMENTAL EVALUATION Figure 5.6: Wrongly detected anomalies due to a weekly cycling pattern (Chaos Game) 29 6 Conclusion and perspectives After implementing and comparing various anomaly detection algorithms based on the SAX representation, we found that none is a perfect fit for real-time detection. This is due partly to the representation itself, which needs time to take a new point into account (due to its heavy downsampling and sliding window analysis). However, tuning the parameters for a good detection led to the conclusion that the feature window is bound to be too large for a practical analysis: for typical weekly patterns found in network monitoring, a good feature window is about one day long. This in turn leads to huge SAX words, with a single symbol representing an hour of data. We conclude that, while extremely useful for fast, “post-mortem” analysis, algorithms based on SAX are mostly unsuitable for the kind of real-time analysis we want to perform. In light of these findings, we did not perform a benchmark of pattern mining algorithms, as the same limitations are bound to apply to them as well. However, given the low computational cost and acceptable results in our anomaly detection experiments, we suggest that hybrid algorithms, working on long time scales with symbolic representation and in real-time with the raw data, could be created to address the overly long detection delay. Conversely, hybrid representations containing both aggregate and raw (or quantized) data could improve detection times. 31 7 Scientific validation This work has been reviewed and accepted for publication as a technical paper of the Complex System-Digital Campus by: Ismaila Diouf, McF, Université Cheikh Antar Diop de Dakar (Sénégal) Dominique Pastor, Professeur des Universités, Télécom Bretagne (France) 33 Bibliography [1] Jessica Lin et al. “Iterative incremental clustering of time series”. In: Advances in Database Technology-EDBT 2004. Springer, 2004, pp. 106–122. [2] Jessica Lin et al. “A symbolic representation of time series, with implications for streaming algorithms”. In: Proceedings of the 8th ACM SIGMOD workshop on Research issues in data mining and knowledge discovery. ACM. 2003, pp. 2–11. [3] Jessica Lin et al. “Experiencing SAX: a novel symbolic representation of time series”. In: Data Mining and knowledge discovery 15.2 (2007), pp. 107–144. [4] Alessandro Camerra et al. “iSAX 2.0: Indexing and mining one billion time series”. In: Data Mining (ICDM), 2010 IEEE 10th International Conference on. IEEE. 2010, pp. 58–67. [5] Yi Gu and Chaoli Wang. “itree: Exploring time-varying data using indexable tree”. In: Visualization Symposium (PacificVis), 2013 IEEE Pacific. IEEE. 2013, pp. 137–144. [6] Nguyen Quoc Viet Hung and Duong Tuan Anh. “Combining SAX and piecewise linear approximation to improve similarity search on financial time series”. In: Information Technology Convergence, 2007. ISITC 2007. International Symposium on. IEEE. 2007, pp. 58– 62. [7] Thanawin Rakthanmanon and Eamonn Keogh. “Fast shapelets: A scalable algorithm for discovering time series shapelets”. In: Proceedings of the thirteenth SIAM conference on data mining (SDM). SIAM. 2013, pp. 668–676. [8] Pavel Senin and Sergey Malinchik. “Sax-vsm: Interpretable time series classification using sax and vector space model”. In: Data Mining (ICDM), 2013 IEEE 13th International Conference on. IEEE. 2013, pp. 1175–1180. [9] Imran N Junejo, Khurrum Nazir Junejo, and Zaher Al Aghbari. “Silhouette-based human action recognition using SAX-Shapes”. In: The Visual Computer 30.3 (2014), pp. 259–269. [10] Ryan Prescott Adams and David JC MacKay. “Bayesian online changepoint detection”. In: arXiv preprint arXiv:0710.3742 (2007). [11] Rudolf B Blazek et al. “A novel approach to detection of denial-of-service attacks via adaptive sequential and batch-sequential change-point detection methods”. In: Proceedings of IEEE systems, man and cybernetics information assurance workshop. Citeseer. 2001, pp. 220–226. [12] Alexander G Tartakovsky and Venugopal V Veeravalli. “Change-point detection in multichannel and distributed systems”. In: Applied Sequential Methodologies: Real-World Examples with Data Analysis 173 (2004), pp. 339–370. [13] Shashwati Kasetty et al. “Real-time classification of streaming sensor data”. In: Tools with Artificial Intelligence, 2008. ICTAI’08. 20th IEEE International Conference on. Vol. 1. IEEE. 2008, pp. 149–156. 35 BIBLIOGRAPHY 36 [14] Eamonn Keogh, Jessica Lin, and Ada Fu. “Hot sax: Efficiently finding the most unusual time series subsequence”. In: Data mining, fifth IEEE international conference on. IEEE. 2005, 8–pp. [15] Pavel Senin et al. “Time series anomaly discovery with grammar-based compression.” In: EDBT. 2015, pp. 481–492. [16] Craig G. Nevill-Manning and Ian H. Witten. “Identifying hierarchical strcture in sequences: A linear-time algorithm”. In: J. Artif. Intell. Res.(JAIR) 7 (1997), pp. 67–82. [17] Neil Walkinshaw, Sheeva Afshan, and Phil McMinn. “Using compression algorithms to support the comprehension of program traces”. In: Proceedings of the Eighth International Workshop on Dynamic Analysis. ACM. 2010, pp. 8–13. [18] Yongjing Lin et al. “Supporting efficient query processing on compressed XML files”. In: Proceedings of the 2005 ACM symposium on Applied computing. ACM. 2005, pp. 660–665. [19] Erin Earl and Richard E Ladner. “Enhanced sequitur for finding structure in data”. In: Data Compression Conference, 2003. Proceedings. DCC 2003. IEEE. 2003, p. 425. [20] Li Wei et al. “Assumption-Free Anomaly Detection in Time Series.” In: SSDBM. Vol. 5. 2005, pp. 237–242. [21] MF Barnsley. Fractals Everywhere, 1993. [22] Nitin Kumar et al. “Time-series Bitmaps: a Practical Visualization Tool for Working with Large Time Series Databases.” In: SDM. SIAM. 2005, pp. 531–535. [23] Ugo Vespier, Siegfried Nijssen, and Arno Knobbe. “Mining characteristic multi-scale motifs in sensor-based time series”. In: Proceedings of the 22nd ACM international conference on Conference on information & knowledge management. ACM. 2013, pp. 2393–2398. [24] Yuan Li and Jessica Lin. “Approximate variable-length time series motif discovery using grammar inference”. In: Proceedings of the Tenth International Workshop on Multimedia Data Mining. ACM. 2010, p. 10. [25] Abdullah Mueen et al. “Exact Discovery of Time Series Motifs.” In: SDM. Vol. 9. SIAM. 2009, pp. 473–484. [26] William Wilson, Phil Birkin, and Uwe Aickelin. “The motif tracking algorithm”. In: International Journal of Automation and Computing 5.1 (2008), pp. 32–44. [27] Pedro G Ferreira et al. “Mining approximate motifs in time series”. In: Discovery Science. Springer. 2006, pp. 89–101. Publisher Complex System Digital Campus UNITWIN UNESCO http://unitwin-cs.org ARK unitwin-cs.org/ark:/69427/02
2cs.AI
Incremental Voronoi diagrams Sarah R. Allen∗ Luis Barba† John Iacono‡ Stefan Langerman§ arXiv:1603.08485v1 [cs.CG] 28 Mar 2016 March 29, 2016 Abstract We study the amortized number of combinatorial changes (edge insertions and removals) needed to update the graph structure of the Voronoi diagram VD(S) (and several variants thereof) of a set S of n sites in the plane as sites are added to the set. To that effect, we define a general update operation for planar graphs that can be used to model the incremental construction of several variants of Voronoi diagrams as well as the incremental construction of an intersection of halfspaces in R3 . We show that the amortized number of edge insertions and removals needed to add a new site to the Voronoi diagram √ √ is O( n). A matching Ω( n) combinatorial lower bound is shown, even in the case where the graph representing the Voronoi diagram is a tree. This contrasts with the O(log n) upper bound of Aronov et al. (2006) for farthest-point Voronoi diagrams in the special case where the points are inserted in clockwise order along their convex hull. We then present a semi-dynamic data structure that maintains the Voronoi diagram of a set S of n sites in convex position. This data structure supports the insertion of a new site p (and hence the addition of its Voronoi cell) and finds the asymptotically minimal number K of edge insertions and removals needed to obtain the diagram of S ∪ {p} from the diagram of S, in time O(K polylog n) worst case, which √ is O( n polylog n) amortized by the aforementioned combinatorial result. The most distinctive feature of this data structure is that the graph of the Voronoi diagram is maintained explicitly at all times and can be retrieved and traversed in the natural way; this contrasts with other known data structures supporting nearest neighbor queries. Our data structure supports general search operations on the current Voronoi diagram, which can, for example, be used to perform point location queries in the cells of the current Voronoi diagram in O(log n) time, or to determine whether two given sites are neighbors in the Delaunay triangulation. 1 Introduction Let S be a set of n sites in the plane. The graph structures of the Voronoi diagram VD(S) and its dual the Delaunay triangulation DT(S) capture much of the proximity information of that set. They contain the nearest neighbor graph, the minimum spanning tree, and the Gabriel graph of S, and have countless applications in computational geometry, shape reconstruction, computational biology, and machine learning. One of the most popular algorithms for constructing a Voronoi diagram inserts sites in random order, incrementally updating the diagram [8]. In that case, backward analysis shows that the expected number of changed edges in VD(S) is constant, offering some hope that an efficient dynamic—or at least semi-dynamic— data structure for maintaining VD(S) could exist. These hopes, however, are rapidly squashed, as it is easy to construct examples where the complexity of each successively added face is Ω(n), and thus each insertion changes the position of a linear number of vertices and edges of VD(S). The goal of this paper is to show that despite this worst-case behavior, the amortized number of structural changes to the graph of ∗ Carnegie Mellon University. Supported by NSF grants CCF-0747250, CCF-1116594, and the Graduate Research Fellowship Program under Grant No. DGE-1252522. [email protected] † Départment d’Informatique, Université Libre de Bruxelles, Carleton University, [email protected]+ ‡ Tandon School of Engineering, New York University, [email protected] § Directeur de Recherches du F.R.S.-FNRS, [email protected] 1 the Voronoi diagram of S, that is, the minimum number of edge insertions and deletions needed to update VD(S) throughout any sequence of site insertions to S, is much smaller. This might come as a surprise in light of the fact that the number of combinatorial changes (usually modeled as flips) to the Delaunay triangulation of S upon the insertion of a point can be Ω(n) with each insertion, even when the sites are in convex position and are added in clockwise order. (Note that in that case the Voronoi diagram of S is a tree and the standard flip operation is a rotation in the tree.) To overcome this worst-case behavior, Aronov et al. [2] studied what happens in this specific case (points in convex position added in clockwise order) if the rotation operation is replaced by the more elementary link (add an edge) and cut (delete an edge) operations in the tree. They show that, in that model, it is possible to reconfigure the tree after each site insertion while performing O(log n) links and cuts, amortized; however their proof is existential and no algorithm is provided to find those links and cuts. Pettie [14] shows both an alternate proof of that fact using forbidden 0-1 matrices and a matching lower bound. One important application of Voronoi diagrams is to solve nearest-neighbor (or farthest-neighbor ) queries: given a point in the plane, find the site nearest (or farthest) to this point. In the static case, this is done by preprocessing the (nearest or farthest point) Voronoi diagram to answer point-location queries in O(log n) time. Without the need to maintain VD(S) explicitly, the problem of nearest neighbor queries is a decomposable search problem and can be made semi-dynamic using the standard dynamization techniques of Bentley and Saxe [4]. The best incremental data structure supporting nearest-neighbor queries performs queries and insertions in O(log2 n/ log log n) time [7, 13]. Recently, Chan [6] developed a randomized data structure supporting nearest-neighbor queries in O(log2 n) time, insertions in O(log3 n) expected amortized time, and deletions in O(log6 n) expected amortized time. Flarbs In the mid-1980’s it was observed that a number of variants of Voronoi diagrams and Delaunay triangulations using different metrics (Euclidean distance, Lp norms, convex distance functions) or different kinds of sites (points, segments, circles) could all be handled using similar techniques. To formalize this, several abstract frameworks were defined, such as the one of Edelsbrunner and Seidel [9] and the two variants of abstract Voronoi diagrams of Klein [10, 12]. In this paper we define a new abstract framework to deal with Voronoi diagrams constructed incrementally by inserting new sites. Let G be a 3-regular embedded plane graph with n vertices1 . We seek to bound the number of edge removals and insertions needed to implement the following operation, hereafter referred to as a flarb 2 : Given a simple closed curve C in the plane whose interior intersects G in a connected component, split both C and all the edges that it crosses at the point of intersection, remove every edge and vertex that lies in the interior of C, and add each curve in the subdivision of C as a new edge; see Figure 1. This operation can be used to represent the insertion of new cells in different types of Voronoi diagrams. It can also be used to represent the changes to the 1-skeleton of a polyhedron in R3 after it is intersected with a halfspace. Results We show that the amortized cost of a flarb operation, where the combinatorial cost is defined to be the √ minimum number of edge insertions and removals√needed to perform it, is O( n). We also show a matching lower bound: some sequences of flarbs require Ω( n) links and cuts per flarb, even when the graph is a tree (or more precisely a Halin graph—a tree with all leaves connected by a cycle to make it 3-regular). This contrasts with the O(log n) upper bound of Aronov et al. [2] for the Voronoi diagram of points in convex position (also a tree) when points are added in clockwise order. We complement these combinatorial bounds with an algorithmic result. We present an output-sensitive data structure that maintains the nearest- or farthest-point Voronoi diagram of a set S of n points in convex 1 While the introduction used n for the number of sites in S, the combinatorial part of this article uses n for the number of vertices in the Voronoi diagram. By Euler’s formula, those two values are asymptotically equivalent, up to a constant factor. 2 Although the last two authors are honored by the flattering renaming of the flarb operation in the literature [14], this paper uses original terminology. 2 G e1 w1 e6 w6 e3 e2 w2 w3 e5 w5 G(G, C) C w1 w4 w6 w2 w3 w5 C w4 e4 Figure 1: The flarb operation on a graph G induced by a flarbable curve C, produces a graph G(G, C) with 2 more vertices. Fleeq-edges crossed by C are shown in red. position as new points are added to S. Upon an insertion, the data structure finds the minimum (up to within a constant factor) number K of edge insertions and deletions necessary to update the Voronoi diagram of S. √ The running time of each insertion is O(K log7 n), and by our combinatorial bounds, K = O( n). This solves the open problem posed by Aronov et al. [2]. The distinguishing feature of this data structure is that it explicitly maintains the graph structure of the Voronoi diagram after every insertion, a property that is not provided by any nearest neighbor data structure that uses decomposable searching problem techniques. Further, the data structure also maintains the Voronoi diagram in a grappa tree [2], a variant of the link-cut tree of Sleator and Tarjan [15] which allows a powerful query operation called oracle-search. Roughly speaking, the oracle-search query has access to an oracle specifying a vertex to find. Given an edge of the tree, the oracle determines which of the two subtrees attached to its endpoints contains that vertex. Grappa trees use O(log n) time and oracle calls to find the sought vertex. A grappa tree is in some sense a dynamic version of the centroid decomposition for trees, which is used in many algorithms for searching in Voronoi diagrams. Using this structure, it is possible to solve a number of problems for the set S at any moment during the incremental construction, for example: • Given sites p and q, report whether they are connected by a Delaunay edge in O(log n) time. • Given a point q, find the Voronoi cell containing q in O(log n) time. This not only gives the nearest neighbor of q, but a pointer to the explicit description of its cell. • Find the smallest disk enclosing S, centered on a query segment [pq], in O(log n) time [5]. • Find the smallest disk enclosing S, centered on a query circle C, in O(log n) time [3]. • Given a convex polygon P (counterclockwise array of its m vertices), find the smallest disk enclosing S and excluding P in O(log n + log m) time [1]. The combinatorial bound for Voronoi diagrams also has direct algorithmic consequences, the most important being that it is possible to store all versions of the graph throughout a sequence of insertions using persistence in O(n3/2 ) space. Since the entire structure of the graph is stored for each version, this provides a foundation for many applications that, for instance would require searching the sequence of insertions for the moment during which a specific event occurred. Outline The main approach used to bound the combinatorial cost of a flarb is to examine how the complexity of the faces changes. Notice that faces whose size remains the same do not require edge insertions and deletions. The other faces either grow or shrink, and a careful counting argument reveals that the cost of a flarb is at most the number faces that shrink (or disappear) upon execution of the flarb (Section 2). By using a potential function that sums the sizes of all faces, the combinatorial cost of shrinking faces is paid for by the reduction of their potential. To avoid incurring a high increase in potential for a large new face, the potential 3 √ √ of each face is capped at n. Then at most O( n) large faces √ can shrink without changing potential and are accounted for separately (Section 3). The matching Ω( n) lower bound is presented in Section 4, and Section 5 presents the data structure for performing flarbs for the Voronoi diagrams of points in convex position. 2 The flarb operation In this section we formalize the flarb operation that models the insertion of new sites in Voronoi diagrams and present a preliminary analysis of the cost of a flarb. Let G = (V, E) be a planar 3-regular graph embedded in R2 (not-necessarily with a straight-line embedding). Let C be a simple closed Jordan curve in the plane. Define in(C) to be the set of vertices of G that lie in the interior of C and let ex(C) = V \ in(C). We say that C is flarbable for G if the following conditions hold: 1. the graph induced by in(C) is connected, 2. C intersects each edge of G either at a single point or not at all, 3. C passes through no vertex of G, and 4. the intersection of C with each face of G is path-connected. In the case where the graph G is clear from context, we simply say that C is flarbable. The fleeq of C is the circular sequence EC = e1 , . . . , ek of edges in E that are crossed by C; we call the edges in EC fleeq-edges. A face whose interior is crossed by C is called a C-face. We assume without loss of generality that C is oriented clockwise and that the edges in EC are ordered according to their intersection with C. Given a flarbable curve C on G, we present the following definition. Definition 2.1. For a planar graph G and a curve C that is flarbable for G, we define a flarb operation F(G, EC ) which produces a new 3-connected graph G(G, C) as follows (see Figure 1 for a depiction): 1. For each edge ei = (ui , vi ) in EC such that ui ∈ in(C) and vi ∈ ex(C), create a new vertex wi = C ∩ ei and connect it to vi along ei . 2. For each pair ei , ei+1 of successive edges in EC , create a new edge (wi , wi+1 ) between them along C. We call (wi , wi+1 ) a C-edge (all indices are taken modulo k). 3. Delete all vertices of in(C) along with their incident edges. Lemma 2.2. For each flarbable curve C on a 3-regular planar graph G, G(G, C) has at most 2 more vertices than G does. Proof. Let EC = e1 , . . . , ek be the fleeq of C and let f be the new face in G(G, C) that is bounded by C and created by the flarb operation F(G, EC ). Notice that the vertices of f are the points w1 , . . . , wk along edges e1 , . . . , ek , where wi = C ∩ ei . Since C is flarbable, the subgraph induced by the vertices of in(C) ∪ {w1 , . . . , wk } is also a connected graph T with w1 , . . . , wk as its leaves and every other vertex of degree 3; see Figure 1. Therefore T has at least k − 2 internal vertices. The flarb operation adds k vertices, namely w1 , . . . , wk , and the internal vertices of T are deleted. Therefore, the net increase in the number of vertices is at most 2. Since each newly created vertex has degree three and all remaining vertices are unaffected, the new graph is 3-regular. In other words, the flarb operation F(G, EC ) creates a cycle along C and removes the portion of the graph enclosed by C. Note that for any point set in general position (no four points lie on the same circle), its Voronoi diagram is a 3-regular planar graph, assuming we use the line at infinity to join the endpoints of its unbounded edges in clockwise order. Therefore, a flarb can be used to represent the changes to the Voronoi diagram upon insertion of a new site. 4 Observation 2.3. Given a set S of points in general position, let V(S) be the graph of the Voronoi diagram of S. For a new point q, there exists some curve CSq such that G(V(S), CSq ) = V(S ∪ {q}); namely, CSq is the boundary of the Voronoi cell of q in V(S ∪ {q}). More generally, convex polytopes defined by the intersection of halfspaces in R3 behave similarly: the intersection of a new halfspace with a convex polytope modifies the structure of its 1-skeleton by adding a new face. This structural change can be implemented by performing a flarb operation in which the flarbable curve consists of the boundary of the new face. Preserved faces and edges Definition 2.4. Given a C-face f of G, the modified face of f is the face f 0 of G(G, C) that coincides with f outside of C. In other words, f 0 is the face that remains from f after performing the flarb F(G, EC ). We say that a C-face f is preserved (by the flarb F(G, EC )) if |f | = |f 0 |. Moreover, we say that each edge in a preserved face is preserved (by F(G, EC )). Denote by P(G, C) the set of faces preserved by F(G, EC ) and let B(G, C) be the set of faces wholly contained in the interior of C. Since a preserved C-face bounded by two fleeq-edges ei and ei+1 has the same size before and after the flarb, there must be an edge e of G connecting ei with ei+1 which is replaced by a C-edge e∗ after the flarb. In this case, we say that the edge e reappears as e∗ . The following auxiliary lemma will help us bound the number of operations needed to produce the graph G(G, C), and follows directly from the Euler characteristic of connected planar graphs: Lemma 2.5. Let H be a connected planar graph with vertices of degree either 1, 2 or 3. For each i ∈ {1, 2, 3}, let δi be the number of vertices of H with degree i. Then, H has exactly 2δ1 + δ2 + 3FH − 3 edges, where FH is the number of bounded faces of H. 2.1 Combinatorial cost of a flarb Given a 3-regular graph G = (V, E) and a flarbable curve C we want to analyze the number of structural changes that G must undergo to perform F(G, EC ). To this end, we define the combinatorial cost of F(G, EC ), denoted by cost(G, C), to be the minimum number of links and cuts needed to transform G into G(G, C) (note that the algorithm may not implement the flarb operation according to the procedure described in Definition 2.1). We assume that any other operation has no cost and is therefore not included in the cost of the flarb. Consider the fleeq EC = e1 , . . . , ek and the C-edges created by F(G, EC ). Let e be an edge adjacent to some ei and ei+1 that reappears as the C-edge e∗ . Notice that we can obtain e∗ without any links or cuts to G: simply shrink ei and ei+1 so that their endpoints in in(C) now coincide with their intersections with C. Then modify e to coincide with the portion of C connecting the new endpoints of ei and ei+1 . Using this preserving operation, we obtain the C-edge e∗ with no cost to the flarb. Intuitively, preserved edges are cost-free in a flarb while non-preserved edges have a nonzero cost. This notion is formalized in the following lemma. Lemma 2.6. For a flarbable curve C, (|EC | + |B(G, C)| − |P(G, C)|)/2 ≤ cost(G, C) ≤ 4|EC | + 3|B(G, C)| − 4|P(G, C)|. Proof. For the upper bound, we describe a construction of G(G, C) from G using at most |EC | + 3|B(G, C)| − 4|P(G, C) links and cuts3 . Consider the subgraph GC induced by in(C)∪{v : v is an endpoint of some edge in EC }. Since C is flarbable, GC is a connected graph such that each vertex of in(C) has degree 3 while the endpoints of the fleeq-edges outside of C have degree 1. Note that if two preserved faces share a non-fleeq edge e, then there are four neighbors of the endpoints of e that lie outside of C. Since GC is connected, e and its four adjacent edges define the entire graph GC and the bound holds trivially. Therefore, we assume that no two 3 We caution the reader that while this construction is algorithmic in nature, it is used purely to provide an upper-bound and does not reflect the behavior of the algorithm presented in Section 5 that gives our desired runtime. 5 preserved faces share a non-fleeq-edge from this point forward. Note that the bounded faces of GC are exactly the bounded faces in B(G, C). Since GC has |EC | vertices of degree 1, no vertices of degree 2, and |B(G, C)| bounded faces, by Lemma 2.5, GC has at most 2|EC | + 3|B(G, C)| edges. Every edge of GC that is not preserved is removed with a cut operation (isolated vertices will be removed afterwards). Note that each preserved face contains at least three preserved edges: two fleeq-edges and a third edge of G. Based on the assumption that no two preserved faces share a non-fleeq-edge, the third edge is not double counted, while the fleeq-edges may be counted at most twice. Therefore, each preserved face contributes at least two preserved edges that are specific to that face, meaning that a total of at most 2|EC | + 3|B(G, C)| − 2|P(G, C)| cut operations are performed. Note that each non-preserved fleeq-edge has been cut and will need to be reintroduced later to obtain G(G, C). Recall that no edge bounding a preserved face has been cut. For each preserved face, perform a preserving operation on it which requires no link or cut operation. Since no two preserved faces share a non-fleeq edge, all the C-edges bounding the preserved faces are added without increasing cost(G, C). To complete the construction of G(G, C), create each fleeq-edge that is not preserved and then add the remaining C-edges bounding non-preserved C-faces. Because at least |P(G, C)| fleeq-edges were preserved, at most |EC |−|P(G, C)| fleeq-edges must be reintroduced. Moreover, since only |EC | − |P(G, C)| C-faces are not preserved, we need to create at most |EC | − |P(G, C)| C-edges. Therefore, this last step completes the flarb and construct G(G, C) using a total of at most 2|EC | − 2|P(G, C)| link operations. Consequently, the total number of link and cuts needed to obtain G(G, C) from G is at most 4|EC | + 3|B(G, C)| − 4|P(G, C)| as claimed. To show that cost(G, C) > (|EC | + |B(G, C)| − |P(G, C)|)/2, simply note that in every non-preserved C-face, the algorithm needs to perform at least one cut, either to augment the size or reduce the size of the face. Because G and C define exactly |EC | + |B(G, C)| faces, and since in all but |P(G, C)| of them at least one of its edges must be cut, at least |EC | + |B(G, C)| − |P(G, C)| edges must be cut. Since an edge belongs to at most two faces a cut can be over-counted at most twice and the claimed bound holds. 3 The combinatorial upper bound In this section, we define a potential function to bound the amortized cost of each operation in a sequence of flarb operations. For a 3-regular embedded planar graph G = (V, E), we define two potential functions: a local potential function µ to measure the potential of each face, and a global potential function Φ to measure the potential of the whole graph. Definition 3.1. Let F be p the set of faces of a 3-regular embedded planar graph G = (V, E). For each face f ∈ F , let µ(f ) = min{d |V |e, |f |}, where |f | is the number of edges on the boundary of f . The potential Φ(G) of G is defined as follows: X Φ(G) = λ µ(f ), f ∈F for some sufficiently large positive constant λ to be defined later. p Recall that the potential µ(f ) of a C-face f remains unchanged as long as |f |, |f 0 | ≥ |V |, where f 0 is the modified face of f after the flarb. Since there is no change in potential that we can use within large C-faces, we exclude them from our analysis and focus only on smaller C-faces. We formalize this notion in the following section. 3.1 Flarbable sub-curves Given a flarbable curve C, a (connected) curve γ ⊆ C is a flarbable sub-curves. Let γ = e1 , . . . , ek (or simply ) be the set of fleeq-edges intersected by γ given in order of intersection after orienting γ arbitrarily. We call  the subfleeq induced by γ. We say that a face is a γ-face if two of its fleeq-edges are crossed by γ (if γ has an endpoint in the interior of this face, it is not a γ-face). Consider the set of all edges of G intersected or enclosed by C that bound some γ-face. Since EC is 6 G G C Yγ γ ek vk C γ Πγ v1 e1 Figure 2: Left: A flarbable sub-curves γ is contained in a flarbable curve C. The graph Yγ is the union of all edges bounding a γ-face. Right: The path Πγ connects the endpoints of the first and last fleeq-edges crossed by γ by going along the boundary of the outer-face of Yγ . flarbable, these edges induce a connected subgraph Yγ of G with || = k leaves (vertices of degree 1), namely the endpoints outside of C of each fleeq-edge in ; see Figure 2. Notice that Yγ may consist of some bounded faces contained in the interior of C. Let Hγ be the set of bounded faces of Yγ and let δ2 be the number of vertices of degree 2 of Yγ . Since Yγ consists of k vertices of degree 1, Lemma 2.5 implies the following result. Corollary 3.2. The graph Yγ consists of exactly 2k + δ2 + 3|Hγ | − 3 edges. Recall that a C-face f is preserved if its corresponding modified face f 0 in G(G, C) has the same number of edges, i.e., |f 0 | = |f |. We say that f is augmented if |f 0 | = |f | + 1 and we call f shrinking if |f 0 | < |f |. Notice that these are all the possible cases as f gains at most one new edge during the flarb, namely the C-edge crossing this face. In the context of a particular flarbable sub-curve γ, let aγ , sγ and pγ be the number of augmented, shrinking and preserved γ-faces, respectively (or simply a, s and p if γ is clear from the context). We further differentiate among the s shrinking γ-faces. A shrinking γ-face is interior if it contains no vertex of degree 2 of Yγ and does not share an edge with an augmenting face. Let sa be the number of shrinking γ-faces that share an edge with an augmented face, let sb be the number of shrinking γ-faces not adjacent to an augmented face that have a vertex of degree 2 of Yγ , and let sc be the number of interior shrinking γ-faces. Therefore, s = sa + sb + sc is the total number of shrinking γ-faces. Since each augmented face has at most two edges and because there are a augmented faces, we know that sa ≤ 2a. Let v1 and vk be the endpoints of the edges e1 and ek that lie inside C. Let Πγ be the unique path connecting v1 and vk in Yγ that traverses the boundary of the outer face of Yγ and stays in the interior of C; see Figure 2. Notice that Πγ contains all the edges of γ-faces that may bound a γ 0 -face for some other flarbable sub-curve γ 0 disjoint from γ. In the end, we aim to have bounds on the number of edges that will be removed from the γ-faces during the flarb, but some of these edges may be double counted if they are shared with a γ 0 -face. Therefore, we aim to bound the length of Πγ and count precisely the number of edges that could possibly be double-counted. Lemma 3.3. The path Πγ has length at most k + 3|Hγ | + δ2 − a − sc . Proof. Notice that no fleeq-edge can be part of Πγ or this path would go outside of C, i.e., there are k fleeq-edges of Yγ that cannot be part of Πγ . We say that a vertex is augmented if it is incident to two fleeq-edges and a third edge that is not part of , which we call an augmented edge. Because each augmented γ-face has exactly one augmented vertex, there are exactly a augmented vertices in Yγ . Moreover, Πγ contains at most 2 augmented vertices (if v1 or vk is augmented). Thus, at most two augmented edges can be traversed by Πγ and hence, at least a − 2 augmented edges of Yγ do not belong to Πγ . Let f be an internal shrinking γ-face. Since f is not adjacent to an augmented γ-face, it has no augmented 7 edge on its boundary. We claim that f has at least one edge that is not traversed by Πγ . If this claim is true, then there are at least sc non-fleeq non-augmented edges that cannot be used by Πγ —one for each internal shrinking γ-face. Thus, since Yγ consists of 2k + 3|Hγ | + δ2 − 2 edges, the number of edges in Πγ is at most 2k + 3|Hγ | + δ2 − 2 − (k + a − 2 + sc ) = k + 3|Hγ | + δ2 − a − sc . It remains to show that each internal shrinking γ-face f has at least one non-fleeq edge that is not traversed by Πγ . If Πγ contains no edge on the boundary of f , then the claim holds trivially. If Πγ contains exactly one edge of f , then since f is shrinking, it has at least 4 edges and two of them are not fleeq-edges. Thus, in this case there is one edge of f that is not traversed by Πγ . We assume from now on that Πγ contains at least two edges of f . We claim that that Πγ visits a contiguous sequence of edges along the boundary of f . To see this, note that each face of Yγ lying between Πγ and the boundary of f cannot be crossed by C. Therefore, if we consider the first edge of Πγ that is not on the boundary of f after visiting f the first time, the this edge is incident to the outer face of Yγ and the only face of Yγ that it is incident with does not intersect C. This is a contradiction, since this edge should not be part of Yγ by definition. Therefore, Πγ visits a contiguous sequence of edges along f . If Πγ visits 2 consecutive edges of f , then the vertex in between them must have degree 2 in Yγ , as the two edges are incident to the outer face—a contradiction since f is an internal shrinking face with no vertex of degree 2. Consequently, if f is an internal shrinking face, it has always at least one non-fleeq edge that is not traversed by Πγ . 3.2 How much do faces shrink in a flarb? In order to analyze the effect of the flarb operations on flarbable sub-curves, we think of each edge as consisting of two half-edges, each adjacent to one of the two faces incident to this edge. For a given edge, the algorithm may delete its half-edges during two separate flarbs of differing flarbable sub-curves. We define the operation F(G, γ) to be the operation which executes steps 1 and 2 of the flarb on the flarbable sub-curve γ and then deletes each half-edge with both endpoints in in(C) adjacent to a γ-face. Since F(G, γ) removes and adds half-edges, we are interested in bounding the net balance of half-edges throughout the flarb. To do this, we measure the change in size of a face during the flarb. Recall that a, s and p are the number of augmented, shrinking and preserved γ-faces, respectively. The following result provides a bound on the total “shrinkage” of the faces crossed by a given flarbable sub-curve. Theorem 3.4. Given a flarbable curve C on G and a flarbable sub-curve γ crossing the fleeq-edges  = e1 , . . . , ek , let f1 , . . . , fk be the sequence of γ-faces and let f10 , . . . , fk0 be their corresponding modified faces after the flarb F(G, γ). Then, k X (|fi | − |fi0 |) ≥ s/2. (1) i=1 Proof. Recall that no successive pair of γ-faces can both be augmented unless PkEC consists of three edges incident to a single vertex. In this case, at most 3 γ-faces can be augmented, so i=1 (|fi | − |fi0 |) = 3 and the result holds trivially; hence, we assume from now on that no two successive faces are both augmented. Let ∆ be the number of half-edges removed during F(G, γ). Notice that to count how much a face fi shrinks when becoming fi0 after the flarb, we need to count the number of half-edges of fi that are deleted and the number that are added in fi0 . Since exactly one half-edge is added in each fi0 , we know that Pk Pk 0 0 i=1 (|fi | − |fi |) = ∆ − k. We claim that ∆ ≥ k + s/2. If this claim is true, then i=1 (|fi | − |fi |) ≥ s/2 as stated in the theorem. In the remainder of this proof, we show this bound on ∆. Let T = (VT , ET ) be the subgraph of Yγ obtained by removing its k fleeq-edges. It follows from 3.2 that |ET | = k + 3|Hγ | + δ2 − 3 . To obtain a precise counting of ∆, notice that for some edges of T , F(G, γ) removes only one of their half-edges and for others it will remove both of them. Since the fleeq-edges are present in each of the faces f1 , . . . , fk before and after the flarb, we get that ∆ = 2|ET | − ST , 8 (2) where ST denotes the number of edges in T with only one half-edge incident to a face of f1 , . . . , fk . Note that the edges of ST are exactly the edges on the path Πγ bounded in Lemma 3.3. Therefore, ST ≤ k + 3|Hγ | + δ2 − a − sc . By using this bound in (2), we get ∆ ≥ 2(k + 3|Hγ | + δ2 − 3) − (k + 3|Hγ | + δ2 − a − sc ) = k + 3|Hγ | + δ2 + a + sc − 6. Since each shrinking γ-face accounted for by sb has a vertex of degree 2 in Yγ , we know that δ2 ≥ sb . Moreover, sa ≤ 2a as each shrinking γ-face can be adjacent to at most two augmenting γ-faces. Therefore, since s = sa + sb + sc , we get that ∆ ≥ k + 3|Hγ | + sa /2 + sb + sc ≥ k + s/2, where s is the number of shrinking γ-faces proving the claimed bound on ∆. 3.3 Flarbable sequences Let G 0 = G. A sequence of curves C = C1 , . . . , Ck is flarbable if for each i ∈ [k], Ci is a flarbable on G i = G(G i−1 , Ci ). As a notational shorthand, let F i denote the flarb operation F(G i−1 , Ci ) when C is a flarbable sequence for G. Theorem 3.5. For a 3-regular planar graph G = (V, E) and some flarbable sequence C = C1 , . . . , CN of flarbable fleeqs, for all i ∈ [N ], p cost(G i−1 , Ci ) + Φ(G i ) − Φ(G i−1 ) ≤ O( |Vi |), where Vi is the set of vertices of G i . Proof. Partition Ci into smaller curves γ1 , . . . , γh such that for all p j ∈ [h], γj is a maximal curve contained in C that does not intersect the interior of a face with more than |Vi | edges. Since there can be at most i p p p |Vi | faces of size |Vi |, we know that h ≤ |Vi |. Let j be the subfleeq containing each fleeq-edge crossed by γj . Let aj , sj and pj be the number of augmented, shrinking and preserved γj -faces, respectively. Notice that |j | = aj + sj + pj + 1. Moreover, since each augmented face is adjacent to a shrinking face, we know that aj ≤ sj + 1. Therefore, |j | ≤ 2sj + pj +p2. Let Li be the set of Ci -faces with at least |Vi | edges and let ωi be the set of all faces of G i−1 completely enclosed in the interior of Ci . First, we upper bound cost(G i−1 , Ci ). By Lemma 2.6, we know that cost(G i−1 , Ci ) ≤ 4|ECi | + 3|B(G i−1 , Ci )| − 4|P(G i−1 , Ci )| =4 h X j=1 ≤4 |j | + 3|B(G i−1 , Ci )| − 4|P(G i−1 , Ci )| Since h ≤ p (4) h X (2sj + pj + 2) + 3|B(G i−1 , Ci )| − 4|P(G i−1 , Ci )| (5) j=1 because each preserved face is crossed by exactly one flarbable sub-curve, cost(G i−1 , Ci ) ≤ 4 (3) Ph j=1 pj = |P(G i−1 , Ci )|. Therefore, h h X X (2sj + 2) + 3|B(G i−1 , Ci )| = 8h + 8 sj + 3|B(G i−1 , Ci )| . j=1 j=1 |Vi |, we conclude that cost(G i−1 h X p , Ci ) ≤ 8 |Vi | + 8 sj + 3|B(G i−1 , Ci )| . j=1 9 (6) Next, we upper bound the change in potential Φ(G i ) − Φ(G i−1 ). Given a flarbable curve or sub-curve γ, let A(γ) denote the set of γ-faces. Recall that for a γ-face f ∈ A(γ), f 0 is the modified face of f . Also, let fn be the new face created by F i , i.e., the face of G i bounded by Ci . Recall that for each face f ∈ B(G i−1 , Ci ), f is removed and the potential decreases by µ(f ) ≥ 1. Using this, we can break up the summation to obtain the following: Φ(G i ) − Φ(G i−1 ) = µ(fn ) + λ ≤ µ(fn ) + λ X (µ(f 0 ) − µ(f )) − λ f ∈A(Ci ) X X µ(f ) (7) f ∈B(G i−1 ,Ci ) (µ(f 0 ) − µ(f )) − λ|B(G i−1 , Ci )| . (8) f ∈A(Ci ) We now break up the first summation by independently considering the large faces in Li and the remaining smaller faces which are crossed by some flarbable sub-curve. Then X f ∈Li   X (µ(f 0 ) − µ(f )) (9) (µ(f 0 ) − µ(f )) − λ|B(G i−1 , Ci )|. (10) Φ(G i ) − Φ(G i−1 ) ≤ µ(fn ) + λ +λ h X  j=1 f ∈A(γj ) 0 Since each face can p gain at most one edge, in particular we know that µ(f ) − µ(f ) ≤ 1 for each f ∈ Li . Moreover, µ(fn ) ≤ |Vi | by definition. Thus,   h X X p  (µ(f 0 ) − µ(f )) + λ|Li | − λ|B(G i−1 , Ci )|. Φ(G i ) − Φ(G i−1 ) ≤ |Vi | + λ j=1 f ∈A(γj ) Note that µ(f ) = |f | for each face f ∈ A(γj ), 1 ≤ j ≤ h. Thus, applying Theorem 3.4 to the first summation, we get h Φ(G i ) − Φ(G i−1 ) ≤ Since there can be at most p |Vi | − λX sj + λ|Li | − λ|B(G i−1 , Ci )|. 2 j=1 p p p |Vi | faces of size |Vi |, we know that |Li | ≤ |Vi |. Therefore, Φ(G i ) − Φ(G i−1 ) ≤ (λ + 1) h p λX |Vi | − sj − λ|B(G i−1 , Ci )| 2 j=1 (11) Putting (6) and (11) together, we get that cost(G i−1 , Ci ) + Φ(G i ) − Φ(G i−1 ) ≤ (λ + 9) p |Vi | + (8 − h λ X ) sj + (3 − λ)|B(G i−1 , Ci )| 2 j=1 By letting λ be a sufficiently large constant (namely λ = 16), we get that p cost(G i−1 , Ci ) + Φ(G i ) − Φ(G i−1 ) = O( |Vi |). Corollary 3.6. Let G be a 3-regular plane graph with ν vertices. For a sequence C = C1 , . . . , CN of flarbable fleeqs for graph G = (V, E) where ν = |V |, N X i=1 √ cost(G i−1 , Ci ) = O(ν + N ν + N ) 10 Proof. Using the result of Theorem 3.5, we can write N X i=1 cost(G i−1 , Ci ) + Φ(G N ) − Φ(G) = O(N p |Vi |). P Because Φ(G) = λ f ∈F µ(f ), we know that Φ(G) = O(ν). Analogously, since each flarb operation adds at most 2 vertices by Lemma 2.2, we know that the number of vertices in G N is O(ν + N ) which, in turn, implies that Φ(G N ) = O(ν + N ). Therefore, N X i=1 4 cost(G i−1 , Ci ) = O(N p √ |Vi | + Φ(G) − Φ(G N )) = O(ν + N ν + N ) The lower bound In Section 4, we present an example of a 3-regular Halin graph G with ν vertices—a tree √ with all leaves connected by a cycle to make it 3-regular—and a corresponding flarb operation with cost Ω( ν) that√yields a graph isomorphic to G. Because this sequence can be repeated, the amortized cost of a flarb is Θ( ν). Let ν = 2k(k + 1) − 2 for some positive integer k. The construction of the 3-regular graph with ν vertices is depicted in Figure 3. In this graph, we show the existence of a flarbable curve C (dashed in the figure) such that the flarb operation on G produces a graph G(G, C) isomorphic to G. Moreover, C crosses √ at least k augmented C-faces and k shrinking C-faces. Therefore, cost(G, C) ≥ k = Ω( ν) by Lemma 2.6. Since the resulting graph is isomorphic to the original graph, this operation can be repeated in succession an high number √ times. That is, there is a sequence of N flarbable curves C1 , . . . , CN such that PNarbitrarilyi−1 cost(G , C ) = Ω(N ν), i i=1 G C ··· k ··· 1 k−1 ··· 2 k−2 G(G, C) ··· k ··· ··· i ··· k−i k−1 1 k C ··· k ··· 1 ··· ··· ··· i−1 k−i+1 k−1 k−2 2 k−1 1 Figure 3: A 3-regular graph G with ν = 2k(k + 1) − 2 vertices. A flarbable curve C induces a flarb such that G(G, C) is isomorphic with G. 5 Computing the flarb In this section, we describe a data structure to maintain the Voronoi diagram of a set S of n sites in convex position as new sites are added to S. Our structure allows us to find the edges of each preserved face and ignore them, thereby focusing only on necessary modifications to the combinatorial structure. The time we spend in these operations is then proportional to the number of non-preserved edges. Since this number is 11 proportional to the cost of the flarb, our data structure supports site insertions in time that is almost optimal (up to a polylogarithmic factor). 5.1 Grappa trees Grappa trees [2] are a modification of link-cut trees, a data structure introduced by Sleator and Tarjan [15] to maintain the combinatorial structure of trees. They support the creation of new isolated vertices, the link operation which adds an edge between two vertices in disjoint trees, and the cut operation which removes an edge, splitting a tree into two trees. We use this structure to maintain the combinatorial structure of the incrementally constructed Voronoi diagram V(S) of a set S of sites in convex position throughout construction. Recall that each insertion defines a flarbable curve C, namely the boundary of the Voronoi cell of the inserted site. Our algorithm performs this flarb operation in time O(cost(V(S), C) log7 n), where n is the number of vertices inserted so far. That is, we obtain an algorithm whose running time depends on the minimum number of link and cut operations that the Voronoi diagram, which is a tree, must undergo after each insertion. Moreover, this Voronoi diagram answers nearest neighbor queries in O(log n) time. A grappa tree, as introduced by Aronov et al. [2], is a data structure is based on the worst-case version of the link-cut tree construction of Sleator and Tarjan [15]. This structure maintains a forest of fixed-topology trees subject to many operations, including Make-Tree, Link, and Cut, each in O(log n) worst-case time while using O(n) space. As in [2, 15], we decompose a rooted binary tree into a set of maximal vertex-disjoint downward paths, called heavy paths, connected by tree edges called light edges. Each heavy path is in turn represented by a biased binary tree whose leaf-nodes correspond to the vertices of the heavy path. Non-leaf nodes represent edges of this heavy path, ordered in the biased tree according to their depth along the path. Therefore, vertices that are higher (closer to the root) in the path correspond to leaves farther left in the biased tree. Each leaf node ` of a biased tree B represents an internal vertex v of the tree which has a unique light edge lv adjacent to it. We keep a pointer from ` to this light edge. Note that the other endpoint of lv is the root of another heavy path which in turn is represented by another biased tree, say B 0 . We merge these two biased trees by adding a pointer from ` to the root of B 0 . After merging all the biased trees in this way, we obtain the grappa tree of a tree T . A node of the grappa tree that is an internal vertex of its biased tree represents a heavy edge and has two children, whereas a node that is a leaf of its biased tree represents a vertex of the heavy path (and its unique adjacent light edge) and has only one child. By a suitable choice of paths and biasing, as described in [15], the grappa tree has height O(log n). In addition, grappa trees allow us to store left and right marks on each of its nodes, i.e., on each edge of T . To assign the mark of a node, grappa trees support the O(log n)-time operation Left-Mark(T, v, ml ) which sets the mark ml to every edge in the path from v to the super root of T (Right-Mark(T, v, ml ) is defined analogously). In our setting, we use the marks of an edge e to keep track of the faces adjacent to this edge in a geometric embedding of T . Since T is rooted, we can differentiate between the left and the right faces adjacent to e. The following definition formalizes the operations supported by a grappa tree. Definition 5.1. Grappa trees solve the following data-structural problem: maintain a forest of rooted binary trees with specified topology subject to: T = Make-Tree(v): Create a new tree T with a single internal vertex v (not previously in another tree). T = Link(v, w): Given a vertex v in one tree Tv and the root w of a different tree Tw , connect v and w and merge Tv with Tw into a new tree T . (T1 , T2 ) = Cut(e): Delete the existing edge e = (v, w) in tree T , splitting into T two trees T1 and T2 containing v and w, respectively. Evert(v): Make external node v the root of its tree, reversing the orientation (which endpoint is closer to the root) of every edge along the root-to-v path. 12 Left-Mark(T, v, m` ): Set the left mark of every edge on the root-to-v path in T to the new mark m` , overwriting the previous left marks of these edges. Right-Mark(T, v, mr ): Set the right mark of every edge on the root-to-v path in T to the new mark mr , overwriting the previous right marks of these edges. (e, m∗` , m∗r ) = Oracle-Search(T, Oe ): Search for the edge e in tree T . The data structure can find e only via oracle queries: given two incident edges f and f 0 in T , the provided oracle Oe (f, f 0 , m` , mr , m0` , m0r ) determines in constant time which “side” of f contains e, i.e., whether e is in the component of T − f that contains f 0 , or in the rest of the tree (which includes f itself). The data structure provides the oracle with the left mark m` and the right mark mr of edge f , as well as the left mark m0` and the right mark m0r of edge f 0 , and at the end, it returns the left mark m∗` and the right mark m∗r of the found edge e. Theorem 5.2. [Theorem 7 from [2]] A grappa tree maintains the combinatorial structure of a forest and supports each operation described above in O(log n) worst-case time per operation, where n is the total size of the trees affected by the operation. 5.2 The Voronoi diagram Let S be a set of n sites in convex position and let V(S) be the binary tree representing the Voronoi diagram of S. We store V(S) using a grappa tree. In addition, we assume that each edge of V(S) has two face-markers: its left and right markers which store the sites of S whose Voronoi regions are adjacent to this edge on the left and right side, respectively. While a grappa tree stores only the topological structure of V(S), with the aid of the face-markers we can retrieve the geometric representation of V(S). Namely, for each vertex v of V(S), we can look at its adjacent edges and their face-markers to retrieve the point in the plane representing the location of v in the Voronoi diagram of S in O(1) time. Therefore, we refer to v also as a point in the plane. Recall that each vertex v of V(S) is the center of a circle that passes through at least three sites of S, we call these sites the definers of v and we call this circle the definer circle of v. Observation 5.3. Given a new site q in the plane such that S 0 = S ∪ {q} is in convex position, the vertices of V(S) that are closer to q than to any other point of S 0 are exactly the vertices whose definer circle encloses q. Let q be a new site such that S 0 = S ∪ {q} is in convex position. Let cell(q, S 0 ) be the Voronoi region of q in the Voronoi diagram of S 0 and let ∂cell(q, S 0 ) denote its boundary. Recall that we can think of V(S) as a Halin graph by connecting all its leaves by a cycle to make it 3-regular. While we do not explicitly use this cycle, we need it to make our definitions consistent. In this Halin graph, the curve ∂cell(q, S 0 ) can be made into a closed curve by going around the leaf of V(S) contained in cell(q, S 0 ), namely the point at infinity of the bisector between the two neighbors of q along the convex hull of S 0 . In this way, ∂cell(q, S 0 ) becomes a flarbable curve. Therefore, we are interested in performing the flarb operation it induces which leads into a transformation of V(S) into V(S 0 ). 5.3 Heavy paths in Voronoi diagrams Recall that for the grappa tree of V(S), we computed a heavy path decomposition of V(S). In this section, we first identify the portion of each of these heavy paths that lies inside cell(q, S 0 ). Once this is done, we test if any edge adjacent to an endpoint of these paths is preserved. Then within each heavy path, we use the biased trees built on it to further find whether there are non-preserved edges on this heavy path. After identifying all the non-preserved edges, we remove them, which results in a split of V(S) into a forest where each edge in cell(q, S 0 ) is preserved. Finally, we show how to link the disjoint components back to the tree resulting from the flarb operation. We first find the heavy paths of V(S) whose roots lie in cell(q, S 0 ). Additionally, we find the portion of each of these heavy paths that lies inside cell(q, S 0 ). Recall that there is a leaf ρ of V(S) that lies in cell(q, S 0 ): the point at infinity of the bisector between 13 the two neighbors of q along the convex hull of S 0 . As a first step, we root V(S) at ρ by calling Evert(ρ). In this way, ρ becomes the root of V(S) and all the heavy paths have a root which is their endpoint closest to ρ. Let R be the set the of roots of all heavy paths of V(S), and let Rq = {r ∈ R : r ∈ cell(q, S 0 )}. We focus now on computing the set Rq . By Observation 5.3, each root in Rq has a definer circle that contains q. We use a dynamic data structure that stores the definer circles of the roots in R and returns those circles containing a given query point efficiently. Lemma 5.4. There is a fully dynamic O(n)-space data structure to store a set of circles (not necessarily with equal radii) that can answer queries of the form: Given a point q in the plane, return a circle containing q, where insertions take O(log3 n) amortized time, deletions take O(log6 n) amortized time, and queries take O(log2 n) worst-case time. Proof. Chan [6] presented a fully dynamic randomized data structure that can answer queries about the convex hull of a set of n points in three dimensions where insertions take O(log3 n) amortized time, deletions take O(log6 n) amortized time, and extreme-point queries take O(log2 n) worst-case time. We use this structure to solve our problem, but first, we must transform our input into an instance that can be handled by this data structure. Let C be the dynamic set of circles we want to store. Consider the paraboloid-lifting which maps every point (x, y) → (x, y, x2 + y 2 ). Using this lifting, we identify each circle C ∈ C with a plane πC in R3 whose intersection with the paraboloid projects down as C in the xy-plane. Moreover, a point q = (x, y) lies inside C if and only if point (x, y, x2 + y 2 ) lies below the plane πC . Let Π = {πC : C ∈ C } be the set of planes corresponding to the circles in C . In the above setting, our query can be translated as follows: Given a point q 0 = (x, y, x2 + y 2 ) on the paraboloid, find a plane πC ∈ Π that lies above q 0 . Using standard point-plane duality in R3 , we can map the set of planes Π to a point set Π∗ , and a query point q 0 to a plane q ∗ such that a query translates to a plane query: Given a query plane q ∗ , find a point of Π∗ that lies below it. Using the data structure introduced by Chan [6] to store Π∗ , we can answer plane queries as follows. Consider the direction orthogonal to q ∗ pointing in the direction below q ∗ . Then, find the extreme point of the convex hull of Π∗ in this direction in O(log2 n) time. If this extreme point lies below q ∗ , return the circle of C corresponding to it. Otherwise, we return that no point of Π∗ lies below q ∗ , which implies that no circle of C contains q. Insertions take O(log3 n) time while removals from the structure take O(log6 n) time. For our algorithm, we store each root in R into the data structure given by Lemma 5.4. Using this structure, we obtain the following result. Lemma 5.5. We can compute each root in Rq in total O(|Rq | log6 n) amortized time. Proof. After querying for a root whose definer circle contains q, we remove it from the data structure and query it again to find another root with the same property until no such root exists. Since queries and removals take O(log2 n) and O(log6 n) time, respectively, we can find all roots in Rq in O(|Rq | log6 n) time. Given a root r ∈ R, let hr be the heavy path whose root is r. Because the portion of V(S) that lies inside cell(q, S 0 ) is a connected subtree, we know that, for each r ∈ Rq , the portion of the path hr contained in cell(q, S 0 ) is also connected. In order to compute this connected subpath, we want to find the last vertex of hr that lies inside of cell(q, S 0 ), or equivalently, the unique edge of hr having exactly one endpoint in the interior of cell(q, S 0 ). We call such an edge the q-transition edge of hr (or simply transition edge). Lemma 5.6. For a root r ∈ Rq , we can compute the transition edge of hr in O(log n) time. Proof. Let er be the transition edge of hr . We make use of the oracle search proper of a grappa-tree to find the edge er . To this end, we must provide the data structure with an oracle such that: given two incident edges f and f 0 in V(S), the oracle determines in constant time which side of f contains the edge er , i.e., whether er is in the component of V(S) \ f that contains f 0 , or in the rest of the tree (which includes f itself). 14 ρ u hr v cell(q, S 0 ) Figure 4: Path hr contains two adjacent vertices u and v such that the light edge of u is a left edge while the light edge of v is a right edge. The edge uv cannot be preserved. The data structure provides the oracle with the left and the right marks of f and f 0 . Given such an oracle, a grappa tree allows us to find the edge er in O(log n) time by Theorem 5.2. Given two adjacent edges f and f 0 of V(S) that share a vertex v, we implement the oracle described above as follows. Recall that the left and right face-marks of f and f 0 correspond to the sites of S whose Voronoi region is incident to the edges f and f 0 . Thus, we can determine the definers of the vertex v, find their circumcircle, and test whether q lies inside it or not in constant time. Thus, by Observation 5.3, we can test in O(1) time whether v lies in Rq or not and hence, decide if er is in the component of V(S) \ f that contains f 0 , or in the rest of the tree. 5.4 Finding non-preserved edges. Observation 5.7. Given a 3-regular graph G and a flarbable curve C, if we can test whether a point is enclosed by C in O(1) time, then we can test whether an edge is preserved in O(1) time. Proof. First note that we can test in O(1) time whether an edge reappears by testing whether its two adjacent edges are fleeq-edges. Since a preserved edge is either an edge that reappears or a fleeq-edge adjacent to an edge that reappears, this takes only O(1) time. Let Vq (S) be the subtree induced by all the edges of V(S) that intersect cell(q, S 0 ). Now, we work towards showing how to identify each non-preserved edge of Vq (S) in the fleeq induced by ∂cell(q, S 0 ). For each root r ∈ Rq , we compute the transition edge er of hr using Lemma 5.6 in O(log n) time per edge. Assume that w is the vertex of er that is closer to r (or is equal to r). We consider each edge adjacent to w and test whether it is preserved. Since each vertex of Vq (S) has access to its definers via the face markers of its incident edges, we can test if this vertex lies in cell(q, S 0 ). Thus, by Observation 5.7, we can decide whether an edge of Vq (S) is preserved in O(1) time. We mark each non-preserved edge among them as shadow. Because we can test whether an edge is preserved in O(1) time, and since computing er takes O(log n) time by Lemma 5.6, this can be done in total amortized O(|Rq | log n) time. In addition, notice that if hr contains two adjacent vertices u and v such that the light edge of u is a left edge while the light edge of v is a right edge (or vice versa), then the edge uv cannot be preserved; see Figure 4. In this case, we say that uv is a bent edge. We want to mark all the bent edges in Vq (S) as shadow, but first we need to identify them efficiently. Note that it suffices to find all the bent edges of hr for a given root r ∈ Rq , and then repeat this process for each root in Rq . To find the bent edges in hr , we further extend the grappa tree in such a way that the biased tree representing hr allows us to search for bent edges in O(log n) time. This extension is described as follows. Recall that each leaf sv of a biased tree corresponds to a vertex v of the heavy path and has a pointer to the unique light edge adjacent to v. Since each light edge is either left or right, we can extend the biased tree to allow us to search in O(log n) time for the first two consecutive leaves where a change in direction occurs. From there, standard techniques allow us to find the next change in direction in additional O(log n) time. Therefore, we can find all the bent edges of a heavy path hr in O(log n) time per bent edge. After finding each bent edge in hr , we mark it is as a shadow edge. Lemma 5.8. An edge of Vq (S) is a preserved edge if and only if it was not marked as a shadow edge. 15 Proof. Since we only mark non-preserved edges as shadow, we know that if an edge is preserved, then it is not shadow. Assume that there is a non-preserved edge uv of Vq (S) that is not marked as shadow. If uv is a heavy edge, then it belongs to some heavy path hr for some r ∈ Rq . We know that uv cannot be the transition edge of hr since it would have been shadowed when we tested whether it was preserved. Thus, uv is completely contained in cell(q, S 0 ). We can also assume that uv is not a bent edge, otherwise uv would have been shadowed. Therefore, the light children of u and v are either both left or both right children, say left. Since uv is not preserved, either the light child of u or the light child of v must be inside cell(q, S 0 ). Otherwise if both edges cross the boundary of cell(q, S 0 ), then uv is preserved by definition. Assume that u has a light left child r0 that is inside cell(q, S 0 ). That is, r0 must be the root of some heavy path and hence belongs to Rq . However, in this case we would have checked all the edges adjacent to u while processing the root r0 ∈ Rq . Therefore, every edge that is non-shadow and intersects cell(q, S 0 ) is a preserved edge. Corollary 5.9. It holds that σ = Θ(cost(V(S), ∂cell(q, S 0 ))). Let σ be the number of shadow edges of V(S), which is equal to the number of non-preserved edges by Lemma 5.8. The following relates the size of Rq with the value of σ. Lemma 5.10. It holds that |Rq | = O(σ log n). Proof. Given a root r of Rq , let pr be the parent of r and notice that the edge rpr is a light edge that is completely contained in Rq . Note that pr belongs to another heavy path ht , for some t ∈ Rq . If pr is the endpoint of the transition edge of ht closest to the root, then we add a dependency pointer from r to t. This produces a dependency graph with vertex set Rq . Since there is only transition edge per heavy path, that the in-degree of each vertex in this dependency graph is one. Therefore, the dependency graph is a collection of (oriented)dependency paths. Since any path from a vertex to the root ρ of V(S) traverses O(log n) light edges, each dependency path has length O(log n). Let r ∈ Rq be the sink of a dependency path. Consider the light edge rpr and notice that it cannot be preserved, as pr is not incident to a transition edge. Therefore, we can charge this non-preserved edge to the dependency path with sink r. Since a non-preserved can be charged only once, we have that σ is at least the number of dependency paths. Finally, as each dependency path has length O(log n), there are at least Ω(|Rq |/ log n) of them. Therefore σ = Ω(|Rq | log n), or equivalently, |Rq | = O(σ log n) which yields our result. 5.5 The compressed tree Let F be the forest obtained from Vq (S) by removing all the shadow edges (this is just for analysis purposes, so far no cut has been performed). Note that each connected component of F consists only of preserved edges that intersect cell(q, S 0 ). Thus, each component inside cell(q, S 0 ) is a comb, with a path as a spine and each child of a spine vertex pointing to the same side; see Figure 5. Thus, we have right and left combs, depending on whether the children of the spine are left or right children. Our objective in the long term is to cut all the shadow edges and link the remaining components in the appropriate order to complete the flarb. To this end, we would like to perform an Eulerian tour on the subtree Vq (S) to find the order in which the subtrees of V(S) \ Vq (S) that hang from the leaves of Vq (S) appear along this tour. However, this may be too expensive as we want to perform this in time proportional to the number of shadow edges and the size of Vq (S) may be much larger. To make this process efficient, we compress Vq (S) by contracting each comb of F into a single super node. By performing an Eulerian tour around this compressed tree, we obtain the order in which each component needs to be attached. We construct the compressed flarb and then we decompress as follows. Note that each comb has exactly two shadow edges that connect it with the rest of the tree. Thus, we contract the entire component containing the comb into a single super node and add a left or right dummy child to it depending on whether this comb was left or right, respectively; see Figure 5. After the compression, 16 ρ ρ C C C0 C0 Figure 5: Two combs of F that are compressed into super nodes with their respective dummy leaves. An Eulerian tour around the compressed tree provides us with the order in which the trees hanging outside of cell(q, S 0 ) should be attached. the shadow edges together with the super nodes and the dummy vertices form a tree called the compressed tree that has O(σ) vertices and edges, where σ is the total number of shadow edges. Lemma 5.11. We can obtain the compressed tree in O(σ log σ) time. Proof. Notice that each shadow edge is adjacent to two faces—its left face and its right face. Recall that each face ibounds the Voronoi cell of some site in S and that each shadow edge has two markers pointing to the sites defining its adjacent faces. Using hashing, we can group the shadow edges that are adjacent to the same face in O(σ) time. Since preserved faces have no shadow edges on their boundary, we have at most O(σ) groups. Finally, we can sort the shadow edges adjacent to a given face along its boundary. To this end, we use the convex hull position of the sites defining the faces on the other side of each of these shadow edges. Computing this convex hull takes O(σ log σ) time. Once the shadow edges are sorted along a face, we can walk and check whether consecutive shadow edges are adjacent. If they are not, then the path between them consists only of preserved edges forming a comb; see Figure 5. Therefore, we can compress this comb and continue walking along the shadow edges. Since each preserved edge that reappears is adjacent to a face containing at least one shadow edge (namely the face that is not preserved), all the combs will be compressed during this procedure. The compressed tree is then a binary tree where each super node has degree three and each edge is a shadow edge. We now perform an Eulerian tour around this compressed tree and retrieve the order in which the leaves of this tree are visited. Some leaves are dummy leaves and some of them are original leaves of Vq (S); see Figure 5. 5.6 Completing the flarb We now proceed to remove each of the shadow edges which results in a (compressed) forest with O(σ) components. Note that each of the original leaves of Vq (S) was connected with its parent via a shadow edge and hence it lies now as a single component in the resulting forest. For each of these original leaves of Vq (S), we create a new anchor node and link it as the parent of this leaf. Moreover, there could be internal vertices that become isolated. In particular this will be the case of the root ρ. These vertices are deleted and ignored for the rest of the process. To complete the flarb, we create two new nodes ρ0 and ρ00 which will be the two new leaves of the Voronoi diagram, one of them replacing ρ. Then, we construct a path with endpoints ρ and ρ0 that connects the super nodes and the anchor nodes according to the traversal order of their leaves; see Figure 6. The resulting tree is a super comb Y , where each vertex on the spine is either a super node or an anchor node, and all the leaves are either dummy leaves or original leaves of Vq (S). Since we combined O(σ) components into a tree, we need O(σ) time. We proceed now to decompress Y . To decompress a super node of Y that corresponds to a comb, we 17 ρ0 Y C v5 v2 v2 C C 0 ρ00 C0 v5 v4 v4 Figure 6: Left: An anchor node is created for each isolated leaf of Vq (S) and attached as its parent. Other isolated nodes are ignored. Right: A super comb is created connecting two new leaves ρ0 and ρ00 through a path. This path connects anchor and super nodes in the order retrieved by the Eulerian tour around the compressed tree. consider the two neighbors of the super node in Y and attach each of them to the ends of the spine of the comb. For an anchor node, we simply note that there is a component of V(S) hanging from its leaf; see Figure 7. In this way, we obtain all the edges that need to be linked. After the decompression, we end with the tree V(S 0 ) resulting from the flarb. Thus, the flarb operation of inserting q can be implemented with O(σ) link and cuts. Y ρ0 C v2 ρ C 0 v4 v5 00 V(S 0 ) C ρ0 v2 ρ00 C0 v4 v5 Figure 7: The tree V(S 0 ) achieved after the decompression. Recall that any optimal algorithm needs to perform a cut for each edge that is not preserved. Since each non-preserved edge is shadow by Lemma 5.8, the optimal algorithm needs to perform at least Ω(σ) operations. Therefore, our algorithm is optimal and computes the flarb using Θ(σ) link and cuts. Moreover, by Lemmas 5.5 and 5.6 we can compute the flarb in O(|Rq | log6 n + σ log n) amortized time using Θ(σ) link and cuts. Since |Rq | = O(σ log n) by Lemma 5.10, we obtain the following. Theorem 5.12. The flarb operation of inserting q can be implemented with O(K) link and cuts, where K is the cost of the flarb. Moreover, it can be implemented in O(K log7 n) amortized time. References [1] G. Aloupis, L. Barba, and S. Langerman. Circle separability queries in logarithmic time. In Proceedings of the 24th Canadian Conference on Computational Geometry, CCCG’12, pages 121–125, August 2012. [2] B. Aronov, P. Bose, E. D. Demaine, J. Gudmundsson, J. Iacono, S. Langerman, and M. Smid. Data structures for halfplane proximity queries and incremental Voronoi diagrams. In LATIN 2006: Theoretical Informatics, pages 80–92. Springer, 2006. [3] L. Barba. Disk constrained 1-center queries. In Proceedings of the 24th Canadian Conference on Computational Geometry, CCCG’12, pages 15–19, August 2012. [4] J. L. Bentley and J. B. Saxe. Decomposable searching problems i. static-to-dynamic transformation. Journal of Algorithms, 1(4):301–358, 1980. [5] P. Bose, S. Langerman, and S. Roy. Smallest enclosing circle centered on a query line segment. In Proceedings of the 20th Canadian Conference on Computational Geometry (CCCG 2008), pages 167–170, 2008. 18 [6] T. M. Chan. A dynamic data structure for 3-d convex hulls and 2-d nearest neighbor queries. Journal of the ACM (JACM), 57(3):16, 2010. [7] Y.-J. Chiang and R. Tamassia. Dynamic algorithms in computational geometry. Proceedings of the IEEE, 80(9):1412–1434, 1992. [8] M. De Berg, M. Van Kreveld, M. Overmars, and O. C. Schwarzkopf. Computational geometry. Springer, 2000. [9] H. Edelsbrunner and R. Seidel. Voronoi diagrams and arrangements. Discrete & Computational Geometry, 1(1):25–44, 1986. ISSN 0179-5376. [10] R. Klein. Concrete and Abstract Voronoi Diagrams, volume 400 of Lecture Notes in Computer Science. Springer, 1989. ISBN 3-540-52055-4. [11] R. Klein, K. Mehlhorn, and S. Meiser. Randomized incremental construction of abstract voronoi diagrams. Computational Geometry, 3(3):157 – 184, 1993. ISSN 0925-7721. [12] R. Klein, E. Langetepe, and Z. Nilforoushan. Abstract voronoi diagrams revisited. Computational Geometry, 42(9):885 – 902, 2009. ISSN 0925-7721. [13] M. H. Overmars. The design of dynamic data structures, volume 156. Springer Science & Business Media, 1983. [14] S. Pettie. Applications of forbidden 01 matrices to search tree and path compression-based data structures. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1457–1467, 2010. [15] D. D. Sleator and R. E. Tarjan. A data structure for dynamic trees. Journal of Computer and System Sciences, 26(3):362–391, 1983. 19
8cs.DS
arXiv:1711.01083v1 [math.ST] 3 Nov 2017 Estimation of Zipf parameter by means of a sequence of counts of different words Mikhail Chebunin∗, Artyom Kovalevskii † Аннотация We study a probabilistic model of text in which probabilities of words decrease in accordance with a discrete power distribution. We construct a class of strongly consistent and asymptotically normal estimators based on a sequence of counts of different words. Then we construct a countsbridge, a process which converges to a centered Gaussian process and serves to test a hypothesis of correspondence between a text and this probabilistic model. The test is of omega-squared type. 1 Introduction Zipf’s law is a law of power decrease of frequencies of words with increasing rank. Let’s create a list of different word forms of some artificial text. This list is called a text dictionary. Let’s order the list in an order of deсrease of word frequencies. The word number in this ordered list is called rank. Words with coinciding frequencies are arranged in an arbitrary order. Zipf (1949) found that frequencies of words decrease in accordance with the power law with an exponent that is greater than 1. It will be convenient for us to denote this exponent 1/θ, where 0 < θ < 1: fi ≈ ci−1/θ . Here fi = ni /n, n is a number of words in the text, ni is the frequency of a word with rank i, c > 0 is a constant. Parameter θ depends on a language, genre, author etc. Note that frequencies at the beginning of the list may differ significantly from predicted by Zipf’s law due to peculiarities of use of concrete most frequent words. At the end of the list, for any natural text, there are many words that are encountered once. Mandelbrot (1965) proposed modifications and interpretations of Zipf’s law. He noticed that if one selects characters of an alphabet (including a blank) independently of each other with some fixed probabilities, then the resulting dictionary corresponds to Zipf’s law. We study another probabilistic model: words of a language are chosen independently of each other. There are infinitely many words, and probabilities of words decrease in accordance with the power law: pi ∼ ci−1/θ , ∗ E-mail: (1) [email protected], Novosibirsk State University, Novosibirsk, Russia [email protected], Novosibirsk State Technical University, Novosibirsk State University, Novosibirsk, Russia. The research was supported by RFBR grant 17-01-00683 † E-mail: 1 i ≥ 1, 0 < θ < 1. Since relative frequencies converge to probabilities, this model also corresponds to the Zipf law. This model was studied by Bahadur (1960) and Karlin (1967). Parameter θ is unknown. Therefore, it must be estimated. The standard way of doing that is to use linear regression (Petersen et al., 2012): 1/θ∗ is a slope of a regression line for simple regression of log ni on log i over all ni > 0. Since only the middle ranks are in good agreement with Zipf’s law, this method gives an inaccurate estimate. The use of the vector {ni , i ≤ i0 } of fixed length i0 gives a biased estimate, since the correspondence of probabilities to a power law is true only in the limit. Therefore, it is reasonable to base an estimator on statistics, the idea being the same as the Lebesgue integral. If we represent ni as columns, then the number of columns of height not less than 1 is the number of different words ∗ ∗ Rn = Rn,1 . The number of columns of height at least k is denoted by Rn,k . This ∗ ∗ is the number of words encountered at least k times. Then Rn,k = Rn,k+1 − Rn,k is the number of words encountered exactly k times. Karlin (1967) proved the asymptotic normality of these statistics. Barbour (2009) studied their approximation by a Poisson distribution. We study the strong consistency and asymptotic normality of the estimators of the parameter θ. We compare asymptotically normal estimators based on the variance of the limiting normal distribution. Chebunin (2014) proposed an estimator log Rn / log n. This estimator is strongly consistent under broad assumptions but is not asymptotically normal. Its bias decreases more slowly than its standard deviation. The use of one statistic Rn for asymptotically normal estimator of θ is possible only in the case when c is a known function of θ. Chebunin and Kovalevskii (2017) built a class of such estimators. The first estimator of this type (without proof of its asymptotic normality) was proposed by Zakrevskaya and Kovalevskii (2001). The use of a pair of statistics makes it possible to build strongly consistent (in a broad class) and asymptotically normal (in a narrower class) estimators. Ohannessian and Dahleh (2012) proposed estimator θ̃ = Rn,1 /Rn and proved its strong consistency. Chebunin and Kovalevsky (2017) proved its asymptotic normality and studied a class of such estimates. The estimator of Ohannessian and Dahleh is the best in this class, but is not so good as implicit estimators based on one statistic Rn in the case of the known c(θ) dependence. One can obtain additional information about the parameter by observing the process in dynamics, that is, using the sequence {Ri , 1 ≤ i ≤ n}. Estimators of this kind are studied in this paper. In addition, the study of the sequence allows us to test the hypothesis that the model corresponds to the text under study. The test is based on the use of the functional central limit theorem for these sequences, proved by Chebunin and Kovalevskii (2016): let p Zn (t) = (R[nt] − ER[nt] )/ ERn , t ∈ [0, 1]. Then Zn converges weakly in D(0, 1) with uniform metrics to a Gaussian process Zθ with zero mean and covariation function  K(s, t) = EZθ (s)Zθ (t) = (s + t)θ − max sθ , tθ . This process has continuous a.s. sample paths. We construct a countsbridge, a process that is an analogue of the empirical bridge that is introduced for regression models by Kovalevsky and Shatalin (2015). Deviations of the countsbridge from the model are analyzed by integrating 2 its square. The distribution of this integral is a modified omega squared distribution. We give formulas for its calculation on a base of Martynov (1978). The distribution depends on the estimator of parameter θ. The rest of the paper is organised as follows. We propose an estimator for θ in Section 2, a test for known θ in Section 3, a test for unknown θ (that is, the test for the Zipf-Mandelbrot model) in Section 4. Proofs are in Section 5. 2 Estimator Let random variables X1 , . . . , Xn be i.i.d. with distribution on natural numbers: P(X1 = i) = pi > 0, i ≥ 1. Let we know Rj , 1 ≤ j ≤ n, where Rj be a number of distinct values of j first random variables: Rj = ∞ X i=1 I(∃k ≤ j : Xk = i). If (1) holds then (Bahadur, 1960) ERj ∼ cθ Γ(1 − θ)j θ , j → ∞. Γ(·) is Euler gamma function. Let C1 = cθ Γ(1 − θ). Then ERj ∼ C1 j θ . Karlin (1967) proved SLLN: Rj /ERj → 1 (2) a.s. So log Rj ∼ θ log j a.s., j → ∞. We propose estimator Z 1 θb = ln+ R[nt] dA(t) 0 with function A(·) such that Z 1 ln t dA(t) = 1, A(0) = A(+0) = A(1) = 0 (3) 0 (ln+ x = max(ln x, 0)). We assume A(·) to be a sum of a step function and a piecewise continuosly differentiable function on [0, 1]. Theorem 2.1 If pi = i−1/θ l(i, θ), θ ∈ [0, 1], l(x, θ) is a slowly varying function as x → ∞, then estimator θb is strongly consistent. b We need some additional assumptions for asymptotic normality of θ. Theorem 2.2 Let A(t) = 0, t ∈ [0, δ] for some δ ∈ (0, 1), and pi = ci−1/θ (1 + o(i−1/2 )), θ ∈ (0, 1). Then Z p ERn (θb − θ) − 0 1 t−θ Zn (t) dA(t) →p 0. So θb converges to θ with rate (ERn )−1/2 , and limiting normal random R1 R1R1 variable 0 t−θ Zθ (t) dA(t) has variance 0 0 (st)−θ K(s, t) dA(s) dA(t). 3 3 A test for a known rate Let 0 < θ < 1 be known. We construct an empirical bridge Zn0 (Kovalevskii & Shatalin, 2015) as follows.  p Zn0 (k/n) = Rk − (k/n)θ Rn / Rn , 0 ≤ k ≤ n, R0 = 0. For 0 ≤ t ≤ 1/n    k + t = Zn0 (k/n) + nt Zn0 ((k + 1)/n) − Zn0 (k/n) , Zn0 n 0 ≤ k ≤ n − 1 (piecewise linear approximation). Theorem 3.1 Under assumptions of Theorem 2.2, sup |Zn0 (t) − (Zn (t) − tθ Zn (1))| → 0 0≤t≤1 a.s. From the FCLT of Chebunin & Kovalevskii (2016) we have Corollary 3.1 Under assumptions of Theorem 2.2, Zn0 converges weakly in C(0, 1) with uniform metrics to a Gaussian process Zθ0 that can be represented as Zθ0 (t) = Zθ (t) − tθ Zθ (1), 0 ≤ t ≤ 1. Its correlation function is K 0 (s, t) = EZθ0 (s)Zθ0 (t) = K(s, t) − sθ K(1, t) − tθ K(s, 1) + sθ tθ K(1, 1). Let Wn2 = R1 0 2 R1 0 2 Zn0 (t) dt. Then Wn2 converges weakly to Wθ2 = Zθ (t) dt. 0 Note that Wn2 can be calculated as Wn2       n−1 k k+1 1 X 0 k 0 0 Zn 2Zn + Zn . = 3n n n n k=1 2 So the test rejects the basic hypothesis if Wn2 ≥ C. P-value is 1 − Fθ (Wn,obs ). 2 2 Here Fθ is a cumulative distribution function of Wθ and Wn,obs is a concrete value of Wn2 for observations under consideration. So we need Fθ to calculate p-values. P∞ η 2 We use Smirnov’s formula (Smirnov, 1937): if Wθ2 = k=1 λkk , η1 , η2 , . . . are independent and have standard normal distribution, 0 < λ1 < λ2 < . . ., then Z λ2k ∞ 1X e−λx/2 dλ p , x > 0. (−1)k Fθ (x) = 1 + · π −D(λ) λ λ2k−1 k=1 Here  ∞  Y λ , D(λ) = 1− λk k=1 integrals under summation must go to zero. Let us define λk , k ≥ 1. We assume Zθ0 (−t) = −Zθ0 (t) by definition, 0 ≤ t ≤ 1. Then we have Fourrier series Zθ0 (t) = 2 ∞ X ξk sin πkt, k=1 R1 ξk = 0 Zθ0 (t) sin πkt dt are independent normal random variables with zero means, k ≥ 1. 4 Varξk = Z 1 0 Z 1 K 0 (s, t) sin πks sin πkt ds dt, (4) 0 1 2Varξk (see intergo-operator approach to calculations of omega-squared distributions in Martynov (1973)). Note that two-fold integral in (4) can be reformed into one-fold ones in our case. λk = 4 A test for an unknown rate bn : Let us introduce countsbridge Z  p  θ bn (k/n) = Rk − (k/n)b Z Rn / Rn , 0 ≤ k ≤ n. As for Zn0 , let for 0 ≤ t ≤ 1/n     k bn (k/n) + nt Z bn ((k + 1)/n) − Z bn (k/n) , +t =Z Zbn n 0 ≤ k ≤ n − 1. Theorem 4.1 Under assumptions of Theorem 2.2, Zbn ⇒ Zbθ , Z 1 bθ (t) = Zθ0 (t) − tθ ln t Z u−θ Zθ (u) dA(u). 0 cn2 Corollary 4.1 Let W 2 R1  bn (t) dt. Then W cn2 converges weakly to Z = 0 2 R1  c2 = Zbθ (t) dt under assumptions of Theorem 2.2. W θ 0 cn2 can be calculated as As Wn2 in Section 3, W       n−1 X c2 = 1 bn k + Z bn k + 1 bn k W 2 Z . Z n 3n n n n k=1 cn2 ≥ C. P-value is 1 − Fbθ (W c 2 ). This test rejects the basic hypothesis if W n,obs c 2 and W c2 Here Fbθ is a cumulative distribution function of W θ n,obs is a concrete c 2 for observations under consideration. value of W n bk instead b Fθ can be calculated by methods of Section 3 with substitution of λ of λk , 1 bk = λ , 2Varξbk Z 1Z 1 b b t) sin πks sin πkt ds dt, Varξk = K(s, 0 0 b t) = EZ bθ (s)Zbθ (t) K(s, = K(s, t) − tθ K(s, 1) − sθ K(t, 1) + (st)θ K(1, 1) Z 1 Z 1 θ −θ θ −t ln t u K(u, t) dA(u) − s ln s u−θ K(u, s) dA(u) 0 +(t2θ ln t+s2θ ln s) Z 0 1 u−θ K(u, 1) dA(u)+tθ sθ ln t ln s 0 Z 0 5 1 u−θ v −θ K(u, v) dA(u) dA(v). 5 Proofs Proof of Theorem 2.1 Let α(x) = max{j| pj ≥ 1/x}. 1/θ Since pi i is a slowly varying function as i → ∞ then α(x) = xθ L(x, θ), L(x, θ) is a slowly varying function as x → ∞ (Karlin, 1967). Let n−1 << δn << ln−1 n (for example, δn = ln−2 n), then for sufficiently large n Z δn ln R[nt] dA(t) ≤a.s. max |A′ (t)|δn ln n → 0. 0≤t≤δn 0 The rest of the integral is Z Z 1 ln R[nt] dA(t) = 1 ln δn δn R[nt] dA(t) + ER[nt] Z 1 ln ER[nt] dA(t). δn We prove convergence of the first integral in RHS to 0 a.s., and convergence of the second one to θ. From SLLN, ln(Rj /ERj ) → 0 a.s., j → ∞. That is, for any ε > 0 !   Rj lim P sup ln ≥ ε = 0. n→∞ ERj j≥nδn Therefore  Z P sup k≥n that is, R1 δn 1 ln δn R[kt] dA(t) ≥ ε ER[kt]  ≤P Z 1 sup ln δn k≥n Rk ε = P sup ln ≥ R1 ER k k≥nδn |dA(t)| δn ! R[kt] |dA(t)| ≥ ε ER[kt]  → 0 as n → ∞, R dA(t) → 0 a.s. ln ER[nt] [nt] We have ERj = j θ L(j), L(j) is a slowly varying function (Karlin, 1967). So uniformly on t ≥ δn > 0 ER[nt] → 1, (nt)θ L(nt) ln Therefore Z 1 ln δn ER[nt] → 0. (nt)θ L(nt) ER[nt] dA(t) → 0. (nt)θ L(nt) But L(nt) = (nt)o(1) for t ≥ δn , so from (3) we have Z Z 1 Z 1 ln((nt)θ+o(1) ) dA(t) = (θ + o(1)) ln((nt)θ L(nt)) dA(t) = δn δn = (θ + o(1)) Z 0 So 1 ln(nt) dA(t) − (θ + o(1)) Z Z ln(nt) dA(t) = θ + o(1). 0 ln ER[nt] dA(t) → θ, 6 ln(nt) dA(t) δn δn 1 δn 1 and θb → θ a.s. The proof is complete. Proof of Theorem 2.2 Since pi = ci−1/θ (1 + o(i−1/2 )) then θ ERn = C1 nθ + o(n 2 ) (5) (Chebinin and Kovalevskii, 2017, Lemma 1, 2). By definition, R[nt] − ER[nt] √ Zn (t) = . ERn Let Zn∗ (t) = Then Z p ERn Z p = ERn = Z p ERn 1 0 1 0  R[nt] − ER[nt] . ER[nt]  1 ln R[nt] dA(t) − θ − 0 Z 1 t−θ Zn (t) dA(t) 0 ER[nt] Zn (t) ln C1 (nt) + ln + ln(1 + Zn∗ (t)) − t−θ √ C1 (nt)θ ERn θ  dA(t) − θ   ER[nt] ∗ ∗ ∗ −θ Zn (t) √ dA(t). + ln(1 + Z (t)) − Z (t) + Z (t) − t ln n n n C1 (nt)θ ERn  For any t ∈ [δ, 1], Zn∗ (t) → 0 a.s. , so ln(1 + Zn∗ (t)) − Zn∗ (t) ∼ −(Zn∗ (t))2 /2 a.s. We have ERn = nθ L(n), so for any t ∈ [δ, 1] ! 3 3 (ERn ) 2 tθ ERn (nθ L(n)) 2 L(n) 1 , = = O p = = 1 + o(1). θ 2 θ 2 (ER[nt] ) ((nt) L(nt)) ER[nt] L(nt) n 2 L(n) Note that Z 1 Z p ∗ 2 ERn (Zn (t)) dA(t) = 0 0 = o(n−θ/4 ) Z 0 so Z p ERn 0 1 1 3 (ERn ) 2 (Zn (t))2 dA(t) (ER[nt] )2 1 (Zn (t))2 dA(t) →p 0,    Z 1 θ t ERn Zn (t) dA(t) = − 1 t−θ Zn (t) dA(t) Zn∗ (t) − t−θ √ ER[nt] ERn 0 Z 1 = o(1) t−θ Zn (t) dA(t) → 0. 0 θ 2 θ Since ERn = C1 n + o(n ), then Z 1 Z 1 Z 1 p p ER[nt] − θ2 dA(t) = ERn ER ln ln(1+o(n dA(t) → 0. )) dA(t) = o(1) n C1 (nt)θ 0 0 0 The proof is complete. Proof of Theorem 3.1 Due to inequality sup Zn0 (t) − 0≤t≤1 R[nt] − tθ Rn 1 √ ≤ n Rn 7 and convergence (2) it is enough to prove sup 0≤t≤1 R[nt] − tθ Rn √ − (Zn (t) − tθ Zn (t)) → 0. ERn This convergence follows from definition of Zn and (5). The proof is complete. Proof of Theorem 4.1 From definition,  p  θ bn (k/n) = Zn0 (k/n) − Rn (k/n)b − (k/n)θ , Z If k ≤ nt ≤ k + 1 then (see proof of Theorem 3.1) Rk − So θ k+1 b √n Rn Rn bn (t) ≤ ≤Z bn (t) − Z 0 (t) + sup Z n 0≤t≤1 ≤ a.s., a.s. As θb → θ a.s., θ k b Rn n Rn .  p b Rn tθ − tθ √ √ Rn Rn 1 +√ + →0 b θ nθ Rn n bn (t) − Zn0 (t) + sup Z 0≤t≤1 Rk+1 − √   p θ − tθ → 0 ERn tb θ tb − tθ ∼ (θb − θ)tθ ln t a.s., 0 < t ≤ 1. From Theorem 2.2 and Theorem 3.1 we have Z 1 bθ (t) = Z 0 (t) − tθ ln t Z u−θ Zθ (u) dA(u). θ 0 The proof is complete. Bahadur, R. R., 1960. On the number of distinct values in a large sample from an infinite discrete distribution. Proceedings of the National Institute of Sciences of India, 26A, Supp. II, 67–75. Barbour, A. D., 2009. Univariate approximations in the infinite occupancy scheme. Alea 6, 415–433. Chebunin, M. G., 2014. Estimation of parameters of probabilistic models which is based on the number of different elements in a sample. Sib. Zh. Ind. Mat., 17:3, 135–147 (in Russian). Chebunin, M., Kovalevskii, A., 2016. Functional central limit theorems for certain statistics in an infinite urn scheme. Statistics and Probability Letters, V. 119, 344–348. Chebunin, M., Kovalevskii, A., 2017. Asymptotically normal estimators for Zipf’s law. Preprint. Karlin, S., 1967. Central Limit Theorems for Certain Infinite Urn Schemes. Jounal of Mathematics and Mechanics, Vol. 17, No. 4, 373–401. Kovalevskii, A. P., Shatalin, E. V., 2015. Asymptotics of sums of residuals of oneparameter linear regression on order statistics, Theory of probability and its applications, Vol. 59, No. 3, 375–387. Mandelbrot, B., 1965. Information Theory and Psycholinguistics. In B.B. Wolman and E. Nagel. Scientific psychology. Basic Books. Martynov, G. V., 1978. The omega squared test. Nauka, Moscow (in Russian). Ohannessian, M. I., Dahleh, M. A., 2012. Rare probability estimation under regularly varying heavy tails, Proceedings of the 25th Annual Conference on Learning Theory, PMLR 23:21.1–21.24. 8 Petersen, A. M., Tenenbaum, J. N., Havlin, S., Stanley, H. E., Perc, M., 2012 . Languages cool as they expand: Allometric scaling and the decreasing need for new words. Scientific Reports 2, Article No. 943. Smirnov, N.V., 1937. On the omega-squared distribution, Mat. Sb. 2, 973–993 (in Russian). Zakrevskaya, N. S., Kovalevskii, A. P., 2001. One-parameter probabilistic models of text statistics. Sib. Zh. Ind. Mat., 4:2, 142–153 (in Russian). Zipf, G. K., 1949. Human Behavior and the Principle of Least Effort, Univ. Press, Cambridge. 9
10math.ST
Consideration on Example 2 of “An Algorithm of General Fuzzy InferenceWith The Reductive Property” Son-Il KWAK1 *, Oh-Chol GWON2, Chung-Jin KWAK3 1 School of Information Science, Kim Il Sung University, Pyongyang, D.P.R of Korea, [email protected] 2 Center of Natural Science Research, Kim Il Sung University, Pyongyang, D.P.R of Korea, [email protected] 3 School of Electricity and Automation, Kim Il Sung University, Pyongyang, D.P.R of Korea, [email protected] * Corresponding author ABSTRACT ------------------------------------------------------------------------------------------------------------------------------------------In this paper, we will show that (1) the results about the fuzzy reasoning algoritm obtained in the paper “Computer Sciences Vol. 34, No.4, pp.145-148, 2007” according to the paper “IEEE Transactions On systems, Man and cybernetics, 18, pp.1049-1056, 1988” are correct; (2) example 2 in the paper “An Algorithm of General Fuzzy Inference With The Reductive Property” presented by He Ying-Si, Quan Hai-Jin and Deng Hui-Wen according to the paper “An approximate analogical reasoning approach based on similarity measures” presented by Tursken I.B. and Zhong zhao is incorrect; (3) the mistakes in their paper are modified and then a calculation example of FMT is supplemented. Keywords; Fuzzy reasoning, CRI principle, Triple I method, Similarity fuzzy inference method, Reductive property ------------------------------------------------------------------------------------------------------------------------------------- 1. Introduction Zadeh proposed CRI principle1, Wang tripleI principle (TIP) with total inference rules of fuzzy reasoning method, and Yeung and Tsang 3 2 a similarity based fuzzy reasoning method, respectively. HE, QUAN and DENG proposed an algorithm of general fuzzy inference with the reductive property 4, and Chen proposed a fuzzy reasoning method of fuzzy system with many rules 5. Tursken and Zhong proposed an approximate analogical reasoning approach based on similarity measures 6. Yuan and Lee7 showed that results about the triple I method for fuzzy reasoning obtained in Liu 8 are correct and the Example 2.1 in ref. 8 is incorrect. In this paper, we show that example 2 in He et al. 4 is incorrect; and the mistakes in their paper are modified and then a calculation example of FMT is supplemented. Generally fuzzy reasoning is fuzzy modus ponens (FMP) in the fuzzy system with m inputs 1 output n rules. General form of the fuzzy modus ponens in the paper 6 is as follows. if x11  A11 and x12  A12 Premise 1; Premise 2: Conclusion: and   if xn1  An1 and xn 2  An 2  1 x1  A y=B  2 and x2  A and  1  x1m  A1m then y1=B1 (1) and   xnm  Anm  m xm  A then yn=Bn General form of Fuzzy Modus Tollens (FMT) in the paper 6 is as follows. Premise 1; if x11  A11 and x12  A12  if xn1  An1  and xn 2  An 2 Premise 2; y=B  Conclusion: x1  A1 * where Aij and A j ( and x2  A2 and  x1m  A1m then y1=B1 (2) and and   xnm  Anm then yn=Bn xm  Am j  1, 2, ... , m , i  1, 2, ..., n ) are fuzzy sets defined in the universe of discourse X, Bi ( i  1, 2, ... , n ) and B* are fuzzy sets defined in the universe of discourse Y. Definition14,6 Assume S: F(X)  F(X)  [0, 1] . If S1 : A  F ( X ) : S ( A, A)  1 , S 2 : A  P( X ) : S ( A, Ac )  0 S3 : A, B, C , D  F ( X ) and  A( x)  B( x) dx   C ( x)  D( x) dx , then x S ( A, B)  S (C , D) is satisfied. x Particularly for 3 fuzzy sets, if A  B  C , then S ( A, C )  min{S ( A, B ), S ( B, C )} and S is called s imilarity defined on fuzzy set F(X). In the fuzzy system with m inputs 1output n rules, definition for reductive property of fuzzy inference met hod is as follows; Definition 2 2 Reductive property of FMP problem in fuzzy system with m inputs 1output n rules.  For fuzzy inference form (1) that has several premises, given A j  Aij for i  1, 2, ... , n , if B   Bi (j , j  1, 2, ... , m) is satisfied, we call that this algorithm satisfies reductive property of FMP p roblem in the fuzzy system with m inputs 1output n rules. Definition 3 2 Reductive property of FMT problem in the fuzzy system with m inputs 1output n rules.  For fuzzy inference form (2) that has several premises, given B  Bi ( i  1, 2, ..., n ), if Aj  Aij (j , j  1, 2, ... , m) (3) is satisfied, then we call that this algorithm satisfies reductive property of FMT problem in the fuzzy system wit h m inputs 1output n rules. 2. Example 2 in the Paper4 is incorrect. In this section, we consider the fuzzy set in case that fuzzy set and input change on vertical axis not horizontal axis by using the example presented in the paper 4, 6. Assume that the considered fuzzy set, 2 inputs 1 output 2 rules, is given as follows 2, 4. R1 : if x1 is A11 ( x1 ) and x2 is A12 ( x2 ) then y is B1 ( y ) R2 : if x1 is A21 ( x1 ) and x2 is A22 ( x2 ) then y is B2 ( y ) where X i  Y  [0, 1], Aij ( xi ), A*j ( x j )  F ( X i ), Bi ( y ), B * ( y )  F (Y ) (4) i, j  1, 2 are the fuzzy set of antecedent of the rule, input, fuzzy set of consequent of the rule, and input respectively. For fuzzy rule 1 and 2 in formula 2 (1), fuzzy set of the antecedent, fuzzy set of consequent and new input fuzzy set are as formula (5). A11 ( x1 )  1 (3  x1 ), 3 A21 ( x1 )  1  x1 , A1 ( x1 )  1  x1 , 1 ( x 2  2 ), 3 1 A22 ( x 2 )  1  x 2 , 2 1 A2 ( x 2 )  1  x 2 , 2 A12 ( x 2 )  Consider the problem obtaining the reasoning result B  B1 ( y )  1  y 1 (1  y ) 2 1 B * ( y )  1  (1  y ) 2 B2 ( y)  (5) for example 2 in the paper [4]. We use similarity SM (A, B) 6 in the paper . b   1 SM ( A, B)  1  A(u )  B(u ) du    ba a  1 (6) In formula (6) u  U is continuous domain of definition and we calculate the sub-reasoning result in two types type 1 Bi* and type 2 Bi* . B  SM( Ai1, A1* )Bi  SM( Ai 2 , A2* )Bi (7)     Bi Bi Bi*  min 1,  min1, *  *   SM ( Ai1 , A1 )   SM ( Ai 2 , A2 )  (8) * type1 i type 2 Using formula (7) and (8) sub-reasoning results are as follows. 3  * * *  type 1 B1  SM ( A11 , A1 ) B1  SM ( A12 , A2 ) B1  4 (1  y )  1 * * *   type 1B2  SM ( A21 , A1 ) B2  SM ( A22 , A2 ) B2  2 (1  y )          1  1, y       B1 B1 13 *   min 1, type 2 B1  min 1, *  *   SM ( A11 , A1 )   SM ( A12 , A2 )  13 (1  y ), y  1 12 13 type 2 (9) (10)     1 B2 B2  ( y  1) B2*  min 1,  min 1, *  *   SM ( A21 , A1 )   SM ( A22 , A2 )  2 According to the paper 4, 6, the calculation results of formula (9) and (10) are correct. The fuzzy reasoning results of the paper 4, 6 are expressed as type 1 B * (11) and type 2 B * (12) respectively, but the formula (11) and (12) are incorrect respectively. 3  4 (1  y ), * * *   B B B  1 type 1 type 1 1 type 1 2  ( y  1), 2 3 1 5 1 y 5 y (11) 1  1, y  13  13 1 7  * * * (1  y ),  y type 2 B  type 2 B1  type 2 B 2   13 19 12 7 1  2 ( y  1), y  19  (12) The results of the formula (9) and (11) based on the paper 4, 6 are wrong. The recalculated result of formula (9) and (11) based on the paper 4, 6 is the formula (13) and (14) respectively in this paper. 3  * * *  type 1 B1 new  SM ( A11, A1 ) B1  SM ( A12 , A2 ) B1  4 (1  y)   type 1 B2*new  SM ( A21, A1* ) B2  SM ( A22 , A2* ) B2  60 (1  y)  73 type 1 *  type 1 B1* new  type 1 B2* new Bnew 3  (1  y ),  4 3  ( y  1), 8 (13) 1 3 1 y 3 y (14) The results of the formula (10) and (12) based on the paper [4, 6] are wrong. The recalculated fuzzy reasoning results of formula (10) and (12) based on the paper [4, 6] are the same as formula (15) and (16) respectively in this paper.  13  y 1,       1 B B 1  73  type 2 B1*new  min1,   min1, *  *    SM ( A12 , A2 )   73 (1  y), y  13  SM ( A11, A1 )  73   60  47  73  (1  y), y        B1 B2 120 73 *  type 2 B2 new  min1, SM ( A , A* )   min1, SM ( A , A* )    47 21 1  22 2    1,  y   73 type 2 * Bnew  type 2 B1*new  type 2 B2* new  1,   73  (1  y ),  60   73 ( y  1),  120  1,   y (15) 13 73 13 1  y 73 3 1 47  y 3 73 47 y 73 (16) From the above example, the fuzzy modus ponens (FMP) by similarity in the paper 4,6 also doesn’t satisfy the reductive property in m inputs 1 output n rules. It is the same in fuzzy modus tollens.In the next section we consider FMT of the paper 4. 3. Calculation of FMT based on similarity of the paper 4 Input of FMT according to formula (5) is as follows. B * ( y )  1  B2 ( y )  The subreasoning calculation result is as the formula (18). 4 1 (1  y ) 2 (17) 4  * *  type 1 A11new  SM ( B1, B ) A11  15 (3  x1 )  4 * *  ( x2  2) type 1 A12 new  SM ( B1 , B ) A12   15  2 * *  (1  x1 ) type 1 A21 new  SM ( B2 , B ) A21   3  1 * *  type 1 A22 (2  x2 ) new  SM ( B2 , B ) A22  3  (18) The FMT calculation result of type 1 is as the formula (19). 4 (3  x1 ) 15 2 1 (2  x 2 ), x2   * * * 3 9 type 1 A2 new  type 1 A12 new  type 1 A22 new   4 2  ( x2  2), y  9 15 * * Therefore, since type 1 A1new  A21 , type 1 A2 new  A22 , FMT of type 1 in the paper type 1 * A1*new  type 1 A11* new  type 1 A21 new  (19) 4, 6 doesn’t satisfied reductive property. The subreasoning calculation result of type 2 is as the formula (20).    type       type       type       type    1,   A11 * min 1 , A     2 11 new *   SM ( B1 , B )   5 (3  x ), 1 12 5 ( x  2),   12 2 A12 *  2 A12 new  min1, *   SM ( B1 , B )  1,  3 5 3 x1  5 2 x2  5 2 x2  5 1  1, x1     A  3 * 21  2 A21 new  min1, *   SM ( B2 , B )   3 (1  x ), x  1 1 1  2 3 2  x2  1,    A  3 * 21  2 A22 new  min1, *  2 3 ( , SM B B ) 2    (2  x ), x  2 2  4 3 x1  (20) The FMT calculation result of the type 2 is as the formula (21).  1,  * * * A  A  A   type 2 1new type 2 11 new type 2 21 new 5  (3  x1 ), 12 * * * type 2 A2 new  type 2 A12 new  type 2 A22 new  1 Therefore, since type 2 A1*new  A21 , type 2 3 5 3 x1  5 x1  A2*new  A22 , FMT of type 2 in the paper (21) 4, 6 does not satisfied r eductive property. From the above calculation, we can see that the fuzzy modus tollens (FMT) by similarity in t he paper 4, 6 also doesn’t satisfy the reductive property in m inputs 1 output n rules. 4. Conclusions In this paper, we have shown that 5 (1) The results about the Algorithm of General Fuzzy Inference with The Reductive Property obtained in pa per 4 are correct. (2) The Example 2 in paper 4 “An Algorithm of General Fuzzy Inference with The Reductive Property” is incorrect, also, the example in the paper 6 “An approximate analogical reasoning approach based on simi larity measures”. (3) The mistakes in the paper 4 are modified and then the calculation of FMT is supplemented. References 1. L.A. Zadeh, The concept of a linguistic variable and its applications to approximate reasoning I, Information Sciences 8 (1975) 199-249. 2. G.J.Wang, The triple I method with total inference rules of fuzzy reasoning, Science in China, E 29 (1999) 43-53. 3. Yeung D.S. and Tsang E.C.C., A comparative study on similarity based fuzzy reasoning methods. IEEE Trans. On systems, man, and cybernetics Part B: cybernetics, 27 (1997) 216-227. 4. HE Ying-Si, QUAN Hai-Jin and DENG Hui-Wen, An Algorithm of General Fuzzy Inference With The Reductiv e Property, Computer Science, 34 (2007) 145-148(in chinese). 5. Chen S.M., A new approach to handling fuzzy decision-making problems, IEEE Trans. On systems, Man and c ybernetics, 18 (1988) 1012-1016. 6. Tursken I.B. and Zhong zhao. An approximate analogical reasoning approach based on similarity measures. IE EE Trans. On systems, Man and cybernetics, 18 (1988) 1049-1056. 7. Xue-hai Yuan and E. Stanley Lee, Comments on “Notes on triple I method of fuzzy reasoning”, Computers a nd Mathematics with Applications 58 (2009) 1604-1607. 8. H.W. Liu, Notes on triple I method of fuzzy reasoning, Computers and Mathematics with Applications 58 (20 09) 1598-1603. 6
2cs.AI
A unified theory for exact stochastic modelling of univariate and multivariate processes with continuous, mixed type, or discrete marginal distributions and any correlation structure Simon Michael Papalexiou Department of Civil and Environmental Engineering, University of California, Irvine, CA, USA ([email protected]) Abstract Hydroclimatic processes are characterized by heterogeneous spatiotemporal correlation structures and marginal distributions that can be continuous, mixed-type, discrete or even binary. Simulating exactly such processes can greatly improve hydrological analysis and design. Yet this challenging task is accomplished often by ad hoc and approximate methodologies that are devised for specific variables and purposes. In this study, a single framework is proposed allowing the exact simulation of processes with any marginal and any correlation structure. We unify, extent, and improve of a general-purpose modelling strategy based on the assumption that any process can emerge by transforming a “parent” Gaussian process with a specific correlation structure. A novel mathematical representation of the parent-Gaussian scheme provides a consistent and fully general description that supersedes previous specific parameterizations, resulting in a simple, fast and efficient simulation procedure for every spatiotemporal process. In particular, introducing a simple but flexible procedure we obtain a parametric expression of the correlation transformation function, allowing to assess the correlation structure of the parent-Gaussian process that yields the prescribed correlation of the target process after marginal back transformation. The same framework is also applicable for cyclostationary and multivariate modelling. The simulation of a variety of hydroclimatic variables with very different correlation structures and marginals, such as precipitation, stream flow, wind speed, humidity, extreme events per year, etc., as well as a multivariate application, highlights the flexibility, advantages, and complete generality of the proposed methodology. Keywords: parent-Gaussian framework, transformations, exact stochastic spatio-temporal modeling, general-purpose simulation, precipitation, stream flow, temperature, wind speed, humidity 1. Introduction “Make things as simple as possible, but not simpler.” ~Albert Einstein The stochastic structure and the marginal probability laws of hydroclimatic processes like precipitation, river discharge, temperature, wind, or relevant processes with discrete or binary marginal distributions like the number of extremes per year, wet-dry sequences, etc., show complexities, which the current methodologies are unable to unify in a single modelling framework. These processes differ in their spatiotemporal correlation structures (CS) with more intense structures being observed for example in temperature than in precipitation [Wilks and Wilby, 1999]; moreover, they have different marginal distributions, e.g., temperature is normally distributed [Kilsby et al., 2007; Breinl et al., 2015] while the intermittent and highly skewed character of precipitation at fine spatiotemporal scales demands the use of mixed-type distributions [Stern and Coe, 1984; Wilks, 1998; Herr and Krzysztofowicz, 2005; Papalexiou and Koutsoyiannis, 2016]. Complexities of these processes are further enhanced by seasonality and diurnal variation, as well as a tendency to normality as we shift from fine to coarser scales due to the central limit theorem. These reasons led to a very large number of stochastic modelling schemes [e.g., Buishand, 1978; Waymire and Gupta, 1981; Bardossy and Plate, 1992; Onof and Wheater, 1993; Wilks, 1999a; Onof et al., 2000; Wheater et al., 2005; Grimaldi and Serinaldi, 2006; Salas et al., 2006; Cowpertwait et al., 2007; Sirangelo et al., 2007; Bárdossy and Pegram, 2009; Mehrotra and Sharma, 2009; Serinaldi, 2009; Aghakouchak et al., 2010; Lee and Salas, 2011; Kleiber et al., 2012; Lombardo et al., 2013; Serinaldi and Kilsby, 2014b; Villarini et al., 2014; Hering et al., 2015; Serinaldi and Kilsby, 2016; Youngman and Stephenson, 2016] to name just a few. Referring to the following sections for technical details, a general unified approach is however possible by assuming that an arbitrary (target) process {𝑋𝑋(𝑡𝑡)} with prescribed marginal distribution 𝐹𝐹𝑋𝑋 (𝑥𝑥) and autocorrelation structure (ACS) 𝜌𝜌𝑋𝑋 (𝜏𝜏) has a parent (or else an equivalent) Gaussian process (pGp) {𝑍𝑍(𝑡𝑡)} with standard Gaussian marginal Φ𝑍𝑍 (𝑧𝑧) and a suitable ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏). Therefore, modelling and simulating {𝑋𝑋(𝑡𝑡)} only require the definition of two functions 𝑔𝑔 and 𝒯𝒯 such that 𝑋𝑋(𝑡𝑡) = 𝑔𝑔�𝑍𝑍(𝑡𝑡)� and 𝜌𝜌𝑍𝑍 (𝜏𝜏) = 𝒯𝒯(𝜌𝜌𝑋𝑋 (𝜏𝜏)). While 𝑔𝑔 is easily identified as 𝑔𝑔(𝑍𝑍) ∶= 𝐹𝐹𝑋𝑋−1 �Φ𝑍𝑍 (𝑍𝑍)�, this transformation of the marginal distribution does not preserve the ACS but only rank correlation as 𝑔𝑔 is nonlinear and the ACS depends on the marginal distribution 𝐹𝐹𝑋𝑋 (𝑥𝑥) [Embrechts et al., 2002]. In particular, for bivariate normally distributed vectors �𝑍𝑍𝑖𝑖 , 𝑍𝑍𝑗𝑗 � and an arbitrary transformation 𝑔𝑔: R → R, one can show that 𝜌𝜌𝑋𝑋 = Cor�𝑔𝑔�𝑍𝑍𝑖𝑖 ), 𝑔𝑔(𝑍𝑍𝑗𝑗 �� ≤ Cor�𝑍𝑍𝑖𝑖 , 𝑍𝑍𝑗𝑗 � = 𝜌𝜌𝑍𝑍 [Kendall and Stuart, 1979, p.600]. This means that we need inflated 𝜌𝜌𝑍𝑍 values to obtain the target 𝜌𝜌𝑋𝑋 . Therefore, the modelling problem reduces to the definition of a correlation transformation function (CTF) 𝒯𝒯 to estimate the parentGaussian autocorrelation (pGACS) 𝜌𝜌𝑍𝑍 (𝜏𝜏) from a given 𝜌𝜌𝑋𝑋 (𝜏𝜏). This modeling framework was previously considered in several fields to solve specific problems, thus resulting in quite a sparse literature dealing with simulation of crosscorrelated but serially independent realizations from multivariate distributions with specified binary, discrete, and/or continuous marginal distributions [Emrich and Piedmonte, 1991; Macke et al., 2009; Demirtas, 2014, 2017], or independent time series with specified serial correlation binary, discrete, and/or continuous marginal distributions [Cario and Nelson, 1997, 1998; Kugiumtzis, 2002; Macke et al., 2009; Serinaldi and Lombardo, 2017b, 2017a]. Moreover, these studies focused on specific classes of marginal distributions and CS along with ad hoc solutions for the definition of the CTF 𝒯𝒯. In this study, we present a unified and fully general mathematical representation of the parent-Gaussian modeling framework. Going beyond specific cases, we highlight its generality and its ability to model and simulate processes with both cross- and autocorrelations such as spatio-temporal hydrological processes. We introduce a general and efficient procedure to define the function 𝒯𝒯 based on a simple and flexible parametric function, as well as a general-purpose technique to simulate the pGp with suitably inflated prescribed CS. Finally, we illustrate the performance of the generalized parent-Gaussian framework by using a variety of CS’s and marginal distributions of discrete, continuous and mixed type that provide a suitable representation for most of hydroclimatic processes. These heterogeneous examples emphasize how the generalized parent-Gaussian theory can overcome all ad hoc solutions previously proposed in the literature, thus resulting in a powerful but simple tool enabling substantial improvement of hydrological analyses. The paper is organized as follows: Section 2 describes the theoretical framework introducing a unified mathematical representation of the parent-Gaussian framework starting from the univariate case (i.e., serially correlated processes) and then discussing the multivariate extension. Section 3 starts with a review of marginal distributions and proposes a general framework on how to define and use auto- or cross-correlation structures suitable to describe a large variety of hydroclimatic processes covering most of the cases of practical interest in hydrological studies. Then we present a novel general-purpose CTF along with a general technique to simulate the parent Gaussian process, concluding with the synoptic of the simulation algorithm. Section 4 reports several case studies involving hydroclimatic processes with heterogeneous marginal distributions (discrete, continuous, and mixed) and different CS’s, e.g., precipitation, river discharge, wind speed, relative humidity, number of extreme events per year, etc., as well as, a multivariate case of rainfall, wind and relative humidity. Finally, conclusions are summarized in Section 5. 2. Theoretical framework 2.1 Univariate case Let {𝑋𝑋(𝑡𝑡) | 𝑡𝑡 ∈ 𝑇𝑇} be a stationary stochastic process over an indexed set T, having an arbitrary autocorrelation structure (ACS) 𝜌𝜌𝛸𝛸(𝑡𝑡) (𝜏𝜏) for lag 𝜏𝜏, and with the random variable (r.v.) 𝑋𝑋(𝑡𝑡) following an arbitrary marginal distribution function 𝐹𝐹𝑋𝑋(𝑡𝑡) (𝑥𝑥). Stationarity entails no change in the joint probability distribution of any order and for any shift in time, and thus, {𝑋𝑋(𝑡𝑡)} (for brevity 𝑡𝑡 ∈ 𝑇𝑇 is omitted hereafter) is defined by a single ACS 𝜌𝜌𝛸𝛸 (𝜏𝜏) and a single marginal distribution 𝐹𝐹𝑋𝑋 (𝑥𝑥), as 𝜌𝜌𝑋𝑋(𝑡𝑡) (𝜏𝜏) = 𝜌𝜌𝑋𝑋 (𝜏𝜏) and 𝐹𝐹𝑋𝑋(𝑡𝑡) (𝑥𝑥) = 𝐹𝐹𝑋𝑋 (𝑥𝑥) for any 𝑡𝑡 ∈ 𝑇𝑇. Let {𝑍𝑍(𝑡𝑡) | 𝑡𝑡 ∈ 𝑇𝑇} be a standard Gaussian process (Gp) with CS 𝜌𝜌𝑍𝑍 (𝜏𝜏), i.e., any linear combination of �𝑍𝑍(𝑡𝑡1 ), … , 𝑍𝑍(𝑡𝑡𝑘𝑘 )� has a joint standard Normal distribution [see e.g., Feller, 1971, p.87] and any 𝑍𝑍(𝑡𝑡) follows the standard Normal distribution 𝒩𝒩(0,1). Gaussian-processes have welldefined properties and their simulation is easy, therefore, the key concept is to identify a parent Gp that can be transformed to the process {𝑋𝑋(𝑡𝑡)}. In essence, if we target to a stochastic process 𝑋𝑋(𝑡𝑡) with a given ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏) and a given marginal 𝐹𝐹𝑋𝑋 (𝑥𝑥) we need to transform the pGp, which implies, since the marginal of the Gp r.v.’s is known, to assess the parent-Gaussian process ACS (pGACS) 𝜌𝜌𝑍𝑍 (𝜏𝜏). Let 𝑔𝑔 be a real function, 𝑋𝑋(𝑡𝑡) = 𝑔𝑔�𝑍𝑍(𝑡𝑡)� a one-to-one transformation transforming {𝑍𝑍(𝑡𝑡)} into {𝑋𝑋(𝑡𝑡)}, and 𝑍𝑍(𝑡𝑡) = 𝑔𝑔−1 �𝑋𝑋(𝑡𝑡)� its inverse, transforming {𝑋𝑋(𝑡𝑡)} into {𝑍𝑍(𝑡𝑡)}. If such a transformation 𝑔𝑔�𝑍𝑍(𝑡𝑡)� exists, when applied to {𝑍𝑍(𝑡𝑡)}, essentially transforms the Gaussian r.v.’s 𝑍𝑍(𝑡𝑡)~𝒩𝒩(0,1) into the r.v.’s 𝑋𝑋(𝑡𝑡)~𝐹𝐹𝑋𝑋 (𝑥𝑥), and the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) into the target process ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏); and vice versa, if 𝑔𝑔−1 �𝑋𝑋(𝑡𝑡)� is applied to {𝑋𝑋(𝑡𝑡)}. This creates a unique mapping between the two processes, i.e., 𝑋𝑋(𝑡𝑡)=𝑔𝑔(𝑍𝑍(𝑡𝑡)) �⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯� {𝑍𝑍(𝑡𝑡) | 𝑍𝑍(𝑡𝑡)~𝒩𝒩(0,1), 𝜌𝜌𝑍𝑍 (𝜏𝜏)} {𝑋𝑋(𝑡𝑡) | 𝑋𝑋(𝑡𝑡)~𝐹𝐹𝑋𝑋 (𝑥𝑥), 𝜌𝜌𝑋𝑋 (𝜏𝜏)} �⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯� −1 𝑍𝑍(𝑡𝑡)=𝑔𝑔 Now, let us define the transformations (𝑋𝑋(𝑡𝑡)) 𝑋𝑋 = 𝑔𝑔(𝑍𝑍) ≔ 𝑄𝑄𝑋𝑋 �Φ𝑍𝑍 (𝑍𝑍)� 𝑍𝑍 = 𝑔𝑔 −1 (𝑋𝑋) ≔ 𝑄𝑄𝑍𝑍 �𝐹𝐹𝑋𝑋 (𝑋𝑋)� (1) (2) (3) where Φ𝑍𝑍 (𝑧𝑧) = 1/2 erfc(−z/√2) and 𝑄𝑄𝑍𝑍 (𝑢𝑢) = −√2erfc −1 (2𝑢𝑢), with 0 ≤ 𝑢𝑢 ≤ 1, are, respectively, the distribution and quantile functions of the standard Gaussian variate Z, and 𝑄𝑄𝑋𝑋 (𝑢𝑢) the quantile function of X. It is well-known that 𝑄𝑄𝑋𝑋 �Φ𝑍𝑍 (𝑍𝑍)� maps Z to X, with 𝑄𝑄𝑍𝑍 �𝐹𝐹𝑋𝑋 (𝑋𝑋)� being its inverse transformation mapping X to Z. Thus, for the r.v.’s 𝑍𝑍(𝑡𝑡)~𝒩𝒩(0,1) and 𝑋𝑋(𝑡𝑡)~𝐹𝐹𝑋𝑋 (𝑥𝑥), where 𝐹𝐹𝑋𝑋 (𝑥𝑥) is any well-defined distribution function, a pair of transformation exists transforming one to the other and vice versa. Let 𝑋𝑋(𝑡𝑡) and 𝑋𝑋(𝜏𝜏) ≔ 𝑋𝑋(𝑡𝑡 − 𝜏𝜏) (this definition is used for notational simplicity) be a pair of {𝑋𝑋(𝑡𝑡)} r.v.’s at an arbitrary time point 𝑡𝑡, lagged by 𝜏𝜏, and having a correlation coefficient 𝜌𝜌𝑋𝑋 (𝜏𝜏) given by 𝐸𝐸 ��𝑋𝑋(𝑡𝑡) − 𝜇𝜇𝑋𝑋(𝑡𝑡) � �𝑋𝑋(𝜏𝜏) − 𝜇𝜇𝑋𝑋(𝜏𝜏) �� 𝐸𝐸�𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏)� − 𝜇𝜇𝑋𝑋2 = 𝜎𝜎𝑋𝑋2 (4) 𝐸𝐸�𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏)� = � � 𝑥𝑥(𝑡𝑡)𝑥𝑥(𝜏𝜏)𝑓𝑓𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏) �𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)� d𝑥𝑥(𝑡𝑡)d𝑥𝑥(𝜏𝜏) (5) 𝜌𝜌𝛸𝛸 (𝜏𝜏) = 𝜎𝜎𝑋𝑋(𝑡𝑡) 𝜎𝜎𝑋𝑋(𝜏𝜏) where 𝜇𝜇𝛸𝛸 and 𝜎𝜎𝑋𝑋2 are the mean and the variance of the r.v. X (given that it exists as there are r.v.’s with infinite mean and variance in which case the correlation cannot be defined), and ∞ ∞ −∞ −∞ where 𝑓𝑓𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏) �𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)� is the joint probability density function (pdf) of 𝑋𝑋(𝑡𝑡) and 𝑋𝑋(𝜏𝜏) which, in general, does not have a simple parametric form. Yet since 𝑍𝑍(𝑡𝑡) and 𝑍𝑍(𝜏𝜏) are jointly normally distributed with correlation 𝜌𝜌𝑍𝑍 (𝜏𝜏) and with bivariate pdf φ𝑍𝑍(𝑡𝑡)𝑍𝑍(𝜏𝜏) �𝑧𝑧(𝑡𝑡), 𝑧𝑧(𝜏𝜏)� = 1 2 π�1 − 𝜌𝜌𝑍𝑍 (𝜏𝜏)2 exp �− 𝑧𝑧(𝑡𝑡)2 − 2𝜌𝜌𝑍𝑍 (𝜏𝜏)𝑧𝑧(𝑡𝑡)𝑧𝑧(𝜏𝜏) + 𝑧𝑧(𝜏𝜏)2 � 2(1 − 𝜌𝜌𝑍𝑍 (𝜏𝜏)2 ) (6) we can use the theory of r.v.’s transformations [see e.g., Feller, 1971] and Eq. (3) to estimate directly the joint pdf of 𝑋𝑋(𝑡𝑡) and 𝑋𝑋(𝜏𝜏), i.e., 𝑓𝑓𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏) �𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)� = φ𝑍𝑍(𝑡𝑡)𝑍𝑍(𝜏𝜏) �𝑔𝑔−1 �𝑥𝑥(𝑡𝑡)�, 𝑔𝑔−1 �𝑥𝑥(𝜏𝜏)�; 𝜌𝜌𝑍𝑍 (𝜏𝜏)� 𝐉𝐉�𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)� (7) 𝜕𝜕𝑔𝑔−1 �(𝑥𝑥(𝑡𝑡)�/𝜕𝜕𝜕𝜕(𝑡𝑡) 0 � is the Jacobian of the where 𝐉𝐉�(𝑥𝑥(𝑡𝑡), (𝑥𝑥(𝜏𝜏)� = � 0 𝜕𝜕𝑔𝑔−1 �(𝑥𝑥(𝜏𝜏)�/𝜕𝜕𝜕𝜕(𝜏𝜏) transformation [see e.g., Papoulis and Pillai, 2002, p.244]. Inspection of (7) reveals that 𝑓𝑓𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏) �𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)� is a function of the 𝐹𝐹𝑋𝑋 (𝑥𝑥) parameters and of 𝜌𝜌𝑍𝑍 (𝜏𝜏). So, if we insert Eq. (7) into Eq. (5), with a known 𝜌𝜌𝑍𝑍 (𝜏𝜏) value, known 𝐹𝐹𝑋𝑋 (𝑥𝑥) parameters, and calculate numerically the integral, then we can estimate the corresponding 𝜌𝜌𝑋𝑋 (𝜏𝜏) from Eq. (4). This creates a one-to-one link between 𝜌𝜌𝑍𝑍 (𝜏𝜏) and 𝜌𝜌𝑋𝑋 (𝜏𝜏). The previous approach has not been proposed before in the literature, and although it results in complex expressions of 𝑓𝑓𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏) �𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)� affecting the numerical integration speed, in some cases (this was found by empirical trials), e.g., when Gamma type marginals are involved, seems to performs faster than the more standard approach described next. Also, we note that the computation of the Jacobian demands existence of partial derivatives and thus for discrete marginal cases this approach may not be applicable. Another approach to estimate the 𝜌𝜌𝑋𝑋 (𝜏𝜏) is by applying the fundamental probability theorem [Feller, 1971, p.5] stating that given an r.v. Y with known pdf 𝑓𝑓𝑌𝑌 (𝑦𝑦) and an r.v. 𝑋𝑋 = ℎ(𝑌𝑌), where ℎ is a real function, the expectation of X can be expressed in terms of 𝑓𝑓𝑌𝑌 (𝑦𝑦), i.e., 𝐸𝐸(𝑋𝑋) = 𝐸𝐸�ℎ(𝑌𝑌)� = ∞ ∞ ∫−∞ ℎ(𝑦𝑦)𝑓𝑓𝑌𝑌 (𝑦𝑦)d𝑦𝑦, avoiding thus, the definition formula 𝐸𝐸(𝑋𝑋) = ∫−∞ 𝑥𝑥𝑥𝑥𝑋𝑋 (𝑥𝑥)d𝑥𝑥 which requires knowledge of 𝑓𝑓𝑋𝑋 (𝑥𝑥). This theorem can be applied in its two-dimensional form in order to evaluate 𝐸𝐸�𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏)� in terms of the bivariate standard Gaussian pdf (Eq. (6)), and by using the transformation in Eq. (3). Thus, 𝒞𝒞�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� is given by the autocovariance transformation integral 𝒞𝒞�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� ≔ 𝐸𝐸�𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏)� = 𝐸𝐸 �𝑄𝑄𝑋𝑋 �Φ𝑍𝑍 �𝑍𝑍(𝑡𝑡)�� 𝑄𝑄𝑋𝑋 �Φ𝑍𝑍 (𝑍𝑍(𝜏𝜏)�� ∞ ∞ = � � 𝑄𝑄𝑋𝑋 �Φ𝑍𝑍 (𝑧𝑧(𝑡𝑡)� 𝑄𝑄𝑋𝑋 �Φ𝑍𝑍 (𝑧𝑧(𝜏𝜏)� φ𝑍𝑍(𝑡𝑡)𝑍𝑍(𝜏𝜏) �𝑧𝑧(𝑡𝑡), 𝑧𝑧(𝜏𝜏); 𝜌𝜌𝑍𝑍 (𝜏𝜏)� d𝑧𝑧(𝑡𝑡)d𝑧𝑧(𝜏𝜏) −∞ −∞ (8) where 𝜽𝜽𝑋𝑋 = (𝜃𝜃1 , … , 𝜃𝜃𝑛𝑛 ) is the parameter vector of the distribution 𝐹𝐹𝑋𝑋 (𝑥𝑥). In general, the double integral 𝒞𝒞�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� does not have an analytical solution, yet its numerical estimation is trivial. Now, if we introduce 𝒞𝒞�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� into Eq. (4), we get the autocorrelation transformation integral (ACTI) ℛ�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)�, i.e., 𝒞𝒞�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� − 𝜇𝜇𝑋𝑋2 𝜌𝜌𝑋𝑋 (𝜏𝜏) = ℛ�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� ≔ 𝜎𝜎𝑋𝑋2 (9) Clearly, ℛ�𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� is a function of 𝜽𝜽𝑋𝑋 and of 𝜌𝜌𝑍𝑍 (𝜏𝜏) as 𝜇𝜇𝑋𝑋 and 𝜎𝜎𝑋𝑋2 are functions of 𝜽𝜽𝑋𝑋 . Similarly to estimating 𝜌𝜌𝑋𝑋 (𝜏𝜏) by Eq. (4) using direct estimation of 𝑓𝑓𝑋𝑋(𝑡𝑡)𝑋𝑋(𝜏𝜏) �𝑥𝑥(𝑡𝑡), 𝑥𝑥(𝜏𝜏)�, this function creates a link between the 𝜌𝜌𝑋𝑋 (𝜏𝜏) and 𝜌𝜌𝑍𝑍 (𝜏𝜏), and thus, can be applied for any pair of �𝑍𝑍(𝑡𝑡), 𝑍𝑍(𝜏𝜏)�, or else for all lag values 𝜏𝜏 = 1, … , 𝜏𝜏max , transforming essentially the Gaussian ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) into the ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏). Note, this relationship transforms a known 𝜌𝜌𝑍𝑍 (𝜏𝜏) value into a 𝜌𝜌𝑋𝑋 (𝜏𝜏) value, while our goal is to transform an observed or a given 𝜌𝜌𝑋𝑋 (𝜏𝜏) value into the corresponding 𝜌𝜌𝑍𝑍 (𝜏𝜏) value; this is described in detail in Section 3.3. 2.2 Multivariate and cyclostationary case The equations presented previously were set for a single stationary stochastic process, yet Eq. (9) can be applied in a more general way. As natural processes vary in space and time, in many cases, we need a multivariate and cyclostationary model [Salas, 1980; Salas et al., 1982; Bartolini et al., 1988; Shao and Lund, 2004]. Let us assume 𝑛𝑛 different processes (e.g., a single process observed in 𝑛𝑛 different locations, 𝑛𝑛 different processes in the same location, etc.), and 𝑚𝑚 different seasons (e.g., 12 months, 365 days, etc.), and let us denote with {𝑋𝑋𝑖𝑖,𝑗𝑗 (𝑡𝑡)} the 𝑖𝑖-th process at 𝑗𝑗-th season, with 𝑖𝑖 = 1, … 𝑛𝑛, and 𝑗𝑗 = 1, … , 𝑚𝑚, thus, there are 𝑛𝑛 × 𝑚𝑚 different processes to consider. Accordingly, for each process we assume a marginal distribution function 𝐹𝐹𝑋𝑋 𝑖𝑖,𝑗𝑗 (𝑥𝑥), an ACS 𝜌𝜌𝑋𝑋𝑖𝑖,𝑗𝑗 (𝜏𝜏), and for every pair of processes with 𝑖𝑖 ≠ 𝑗𝑗 a cross- correlation structure (CCS) 𝜌𝜌𝑋𝑋𝑖𝑖,𝑗𝑗𝑋𝑋𝑘𝑘,𝑙𝑙 (𝜏𝜏), where 𝑘𝑘 = 1, … 𝑛𝑛, and 𝑙𝑙 = 1, … , 𝑚𝑚. In this case, Eq. (8) becomes ∞ ∞ 𝒞𝒞𝑋𝑋𝑖𝑖,𝑗𝑗𝑋𝑋𝑘𝑘,𝑙𝑙 �𝜽𝜽𝑋𝑋𝑖𝑖,𝑗𝑗 , 𝜽𝜽𝑋𝑋𝑘𝑘,𝑙𝑙 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)�:= � � 𝑄𝑄𝑋𝑋𝑖𝑖,𝑗𝑗 �Φ𝑍𝑍𝑖𝑖,𝑗𝑗 (𝑧𝑧(𝑡𝑡)� 𝑄𝑄𝑋𝑋𝑘𝑘,𝑙𝑙 �Φ𝑍𝑍𝑘𝑘,𝑙𝑙 (𝑧𝑧(𝜏𝜏)� φ𝑍𝑍𝑖𝑖,𝑗𝑗(𝑡𝑡)𝑍𝑍𝑘𝑘,𝑙𝑙(𝜏𝜏) �𝑧𝑧(𝑡𝑡), 𝑧𝑧(𝜏𝜏); 𝜌𝜌𝑍𝑍 (𝜏𝜏)� d𝑧𝑧(𝑡𝑡)d𝑧𝑧(𝜏𝜏) −∞ −∞ and thus, the cross-correlation transformation integral (CCTI) becomes 𝜌𝜌𝑋𝑋𝑖𝑖,𝑗𝑗𝑋𝑋𝑘𝑘,𝑙𝑙 (𝜏𝜏) = ℛ �𝜽𝜽𝑋𝑋𝑖𝑖,𝑗𝑗 , 𝜽𝜽𝑋𝑋𝑘𝑘,𝑙𝑙 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� ∶= 𝒞𝒞𝑋𝑋𝑖𝑖,𝑗𝑗𝑋𝑋𝑘𝑘,𝑙𝑙 �𝜽𝜽𝑋𝑋𝑖𝑖,𝑗𝑗 , 𝜽𝜽𝑋𝑋𝑘𝑘,𝑙𝑙 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� − 𝜇𝜇𝑋𝑋𝑖𝑖,𝑗𝑗 𝜇𝜇𝑋𝑋𝑘𝑘,𝑙𝑙 𝜎𝜎𝑋𝑋𝑖𝑖,𝑗𝑗 𝜎𝜎𝑋𝑋𝑘𝑘,𝑙𝑙 (10) (11) where 𝜽𝜽𝑋𝑋𝑖𝑖,𝑗𝑗 , 𝜽𝜽𝑋𝑋𝑘𝑘,𝑙𝑙 are parameter vectors of 𝐹𝐹𝑋𝑋 𝑖𝑖,𝑗𝑗 (𝑥𝑥) and 𝐹𝐹𝑋𝑋 𝑘𝑘,𝑙𝑙 (𝑥𝑥) distributions, respectively. Thus, ℛ �𝜽𝜽𝑋𝑋𝑖𝑖,𝑗𝑗 , 𝜽𝜽𝑋𝑋𝑘𝑘,𝑙𝑙 , 𝜌𝜌𝑍𝑍 (𝜏𝜏)� can be seen as a function transforming a given lag-𝜏𝜏 correlation 𝜌𝜌𝑍𝑍𝑖𝑖,𝑗𝑗𝑍𝑍𝑘𝑘,𝑙𝑙 (𝜏𝜏) in a pair of standard Gp’s, into the lag-𝜏𝜏 correlation 𝜌𝜌𝑋𝑋𝑖𝑖,𝑗𝑗𝑋𝑋𝑘𝑘,𝑙𝑙 (𝜏𝜏) between {𝑋𝑋𝑖𝑖,𝑗𝑗 (𝑡𝑡)} and {𝑋𝑋𝑘𝑘,𝑙𝑙 (𝜏𝜏)} processes. Thus, the difference, compared with the univariate stationary case, is that here we have a set of 𝑛𝑛 × 𝑚𝑚 processes {𝑋𝑋𝑖𝑖,𝑗𝑗 (𝑡𝑡)} and we want to assess a set of parent Gp’s {𝑍𝑍𝑖𝑖,𝑗𝑗 (𝑡𝑡)}, or else, their pGCCS’s 𝜌𝜌𝑍𝑍𝑖𝑖,𝑗𝑗𝑍𝑍𝑘𝑘,𝑙𝑙 (𝜏𝜏). Given this, a multivariate and cyclostationary Gp can be transformed to the set of {𝑋𝑋𝑖𝑖,𝑗𝑗 (𝑡𝑡)} processes using the corresponding transformations 𝑋𝑋𝑖𝑖,𝑗𝑗 (𝑡𝑡) = 𝑄𝑄𝑋𝑋𝑖𝑖,𝑗𝑗 �Φ𝑍𝑍𝑖𝑖,𝑗𝑗 (𝑧𝑧(𝑡𝑡)�. As a result, the problem of generating timeseries from a multivariate cyclostationary model comprising processes with different characteristics, simplifies in generating timeseries from a multivariate cyclostationary standard Gp. 3. From theory to practice 3.1 Marginal distributions of hydroclimatic processes 3.1.1 Continuous Basic hydroclimatic processes like temperature, wind, precipitation, river discharge, relative humidity, etc., have continuous, or, mixed-type (partly continuous and partly discrete) marginal probability distributions. The number of parametric distributions used in the literature to describe hydroclimatic r.v.’s is very large: air temperatures is commonly described by the Gaussian distribution [e.g., Klein Tank and Können, 2003]; the twoparameter Weibull has been the prevailing model for wind speeds [e.g., Justus et al., 1978; Seguro and Lambert, 2000], yet Gamma, Lognormal and Pearson type I distributions have also been used for wind [for a review see Carta et al., 2009]; nonzero daily precipitation has been modelled, by Gamma [e.g., Buishand, 1978; Bruhn et al., 1980; Geng et al., 1986], Weibull [e.g., Swift and Schreuder, 1981; Wilson and Toumi, 2005], Exponential and mixed Exponentials distributions [e.g., Smith and Schreiber, 1974; Todorovic and Woolhiser, 1975; Wilks, 1999b], or by heavier-tailed distributions like the Lognormal [e.g., Swift and Schreuder, 1981], Kappa [Mielke Jr, 1973; Mielke Jr and Johnson, 1973; Hosking, 1994; Park et al., 2009], and the generalized Beta distribution [Mielke Jr and Johnson, 1974] (for a detailed global investigation on the distribution of seasonal daily precipitation see Papalexiou and Koutsoyiannis [2016] where the Generalized Gamma and the Burr type XII have been used; for global analyses on precipitation extremes see [Papalexiou and Koutsoyiannis, 2013; Papalexiou et al., 2013; Serinaldi and Kilsby, 2014a] ); river flows have been described by the Lognormal and Pareto distributions [e.g., Bowers et al., 2012]; the Pearson Type III and the 3-parameter lognormal distributions were suggested for low stream flows [Kroll and Vogel, 2002]; the Beta distribution has been found to describe very well relative humidity values [e.g., Yao, 1974], and also, is a candidate model for percentage r.v.’s like probability dry, percentage of area affected by extreme temperature or precipitation, etc. A complete review on the probability models applied in geophysical and hydroclimatic processes would be a difficult task by itself and out of the scope this study. A common practice is to fit many distributions and select the best fitted, yet this approach makes the selection difficult and susceptible to sample variations. In an attempt to simplify this procedure, and based on entropy information measures, a general theoretical framework was proposed [Papalexiou and Koutsoyiannis, 2012] that led to consistent distributions for positive geophysical and hydroclimatic r.v.’s. Particularly, the Generalized Gamma (𝒢𝒢𝒢𝒢) [Stacy, 1962; Stacy and Mihram, 1965] and the Burr type XII distributions (ℬ𝓇𝓇XII) [Burr, 1942; Tadikamalla, 1980] were derived, yet the ℬ𝓇𝓇III is also proposed here as a general and flexible power-type model. Their probability distribution functions are given by 𝛾𝛾2 𝑥𝑥 𝛾𝛾1 −1 𝑥𝑥 𝛾𝛾2 (12) 𝑓𝑓𝒢𝒢𝒢𝒢 (𝑥𝑥; 𝛽𝛽, 𝛾𝛾1 , 𝛾𝛾2 ) = exp �− � � � � � 𝛽𝛽 Γ(𝛾𝛾1 /𝛾𝛾2 ) 𝛽𝛽 𝛽𝛽 1 𝑥𝑥 𝛾𝛾1 −𝛾𝛾1 𝛾𝛾2 𝐹𝐹ℬ𝓇𝓇XII (𝑥𝑥; 𝛽𝛽, 𝛾𝛾1 , 𝛾𝛾2 ) = 1 − �1 + 𝛾𝛾2 � � � 𝛽𝛽 1 1 𝑥𝑥 −𝛾𝛾2 𝐹𝐹ℬ𝓇𝓇III (𝑥𝑥; 𝛽𝛽, 𝛾𝛾1 , 𝛾𝛾2 ) = �1 + � � � 𝛾𝛾1 𝛽𝛽 −𝛾𝛾1 𝛾𝛾2 (13) (14) These distributions, defined for 𝑥𝑥 ≥ 0, have scale parameter 𝛽𝛽 > 0, and shape parameters 𝛾𝛾1 > 0 and 𝛾𝛾2 > 0 that control the left and right tails, respectively, providing great shape flexibility. For 𝛾𝛾1 < 1 and the pdf’s are J-shaped and for 𝛾𝛾1 > 1 bell-shaped, while the parameter 𝛾𝛾2 controls mainly the “heaviness” of the right tail, and thus, the behaviour of extreme events. Note that 𝒢𝒢𝒢𝒢 is of exponential form having all of its moments finite, while ℬ𝓇𝓇XII and ℬ𝓇𝓇III are power-type distributions, that can have very heavy tails and infinite moments. The 𝒢𝒢𝒢𝒢 can be considered as a generalization of the two-parameter Gamma and Weibull distributions, while the ℬ𝓇𝓇XII includes as special cases the Pareto type II for 𝛾𝛾1 = 1, or the Weibull distribution as limiting case for 𝛾𝛾2 → ∞. Clearly, the principle of parsimony, which requires to always seek for the simplest model, i.e., to use the smallest number of parameters possible [see e.g., Box et al., 2008, p.16], should always be applied. For example, if the Weibull distribution performs satisfactorily (under desired criteria) then it should be preferred over the three-parameter 𝒢𝒢𝒢𝒢; the same holds for the power-type distributions ℬ𝓇𝓇XII and ℬ𝓇𝓇III where the simpler Pareto type II should be the first choice under inadequate performance. 3.1.2 Mixed type, discrete and binary Several natural processes like precipitation at fine temporal scales (e.g., at daily or subdaily scales), discharge of small streams, or even wind when calm is measured, are intermittent processes. Thus, their marginal distribution comprises a probability mass concentrated at zero (e.g., probability dry in precipitation), and a continuous part for the positive values, expressed by a parametric distribution function. The framework to simulate intermittent processes is the same, (see section 2); the difference lies in the expressions of the distribution function 𝐹𝐹𝑋𝑋 (𝑥𝑥) and the quantile function 𝑄𝑄𝑋𝑋 (𝑢𝑢) that now are related to the conditional expressions for 𝑋𝑋|𝑋𝑋 > 0. Particularly, if 𝑃𝑃(𝑋𝑋 = 0) = 𝑝𝑝0 is probability zero, then the cdf, pdf and quantile function of 𝑋𝑋, are given, respectively, by 𝐹𝐹𝑋𝑋 (𝑥𝑥) = (1 − 𝑝𝑝0 )𝐹𝐹𝑋𝑋|𝑋𝑋>0 (𝑥𝑥) + 𝑝𝑝0 𝑥𝑥 ≥ 0 𝑝𝑝0 𝑓𝑓𝑋𝑋 (𝑥𝑥) = �(1 𝑥𝑥𝑢𝑢 = 𝑄𝑄𝑋𝑋 (𝑢𝑢) = � 0 − 𝑝𝑝0 )𝑓𝑓𝑋𝑋|𝑋𝑋>0 (𝑥𝑥) 𝑄𝑄𝑋𝑋|𝑋𝑋>0 𝑢𝑢 − 𝑝𝑝0 � � 1 − 𝑝𝑝0 𝑥𝑥 = 0 𝑥𝑥 > 0 0 ≤ 𝑢𝑢 ≤ 𝑝𝑝0 𝑝𝑝0 < 𝑢𝑢 ≤ 1 (15) (16) (17) (the Dirac delta notation can also be used to define the pdf). Additionally, the expressions of the mean and variance of 𝑋𝑋, needed to estimate the CTF’s in Eq. (9) or Eq. (11) become 𝜇𝜇𝑋𝑋 = (1 − 𝑝𝑝0 )𝜇𝜇𝑋𝑋|𝑋𝑋>0 (18) 2 2 𝜎𝜎𝑋𝑋2 = (1 − 𝑝𝑝0 )𝜎𝜎𝑋𝑋|𝑋𝑋>0 + 𝑝𝑝0 (1 − 𝑝𝑝0 )𝜇𝜇𝑋𝑋|𝑋𝑋>0 (19) The probability zero, can be easily assessed from the empirical data as 𝑝𝑝0 = 𝑛𝑛0 \𝑛𝑛, with 𝑛𝑛0 and 𝑛𝑛 denoting, respectively, number of dry and total days, while for positive values any parametric continuous distribution 𝐹𝐹𝑋𝑋|𝑋𝑋>0 (𝑥𝑥) can been used, given that describes sufficiently the empirical data. Obviously, this framework, can be extended to include cases where values above a threshold are considered, i.e., the discrete part can express the Pr(𝑋𝑋 < 𝑥𝑥𝑝𝑝 ) for an arbitrary value 𝑥𝑥𝑝𝑝 , and the continuous part values for 𝑋𝑋|𝑋𝑋 > 𝑥𝑥𝑝𝑝 . Finally, more general mixed- type marginal distributions can be considered, e.g., the water storage in a reservoir varies theoretically from zero to a maximum level when capacity is reached, thus, as a variable it may have two discrete states, i.e., probability zero and probability for maximum capacity; all in between values can be described by a continuous bounded distribution. Important aspects of various geophysical process can be considered to have a discrete or a binary marginal distribution [see e.g., Chung and Salas, 2000; Molotch et al., 2005; Serinaldi and Lombardo, 2017b]. For example, the number of consecutive wet and dry spells (in days, hours, etc.), the number of days per year having a specific property, e.g., temperature, precipitation, or wind speed above a threshold (extremes), the number of wet days per year, binary sequences to describe wet and dry days, and many more. As in the mixed-type case the methodology remains the same, modified only by using expressions for the quantile, mean and variance that correspond to the discrete or the binary probability mass function chosen. 3.2 Autocorrelation (ACS) and cross-correlation structures (CCS) Sample autocorrelation (or cross-correlation) 𝜌𝜌�(𝜏𝜏), especially for small samples and for large lags 𝜏𝜏, is sensitive to sample variations and calculated up to a maximum lag (up to 1/3 of the sample size is usually suggested). A better approach may be to fit an ACS to 𝜌𝜌�(𝜏𝜏), expressed by a simple parametric function 𝜌𝜌(𝜏𝜏; 𝜽𝜽), where 𝜽𝜽 = (𝜃𝜃1 , … , 𝜃𝜃𝑘𝑘 ) is the parameter space, essentially interpolating the values of 𝜌𝜌�(𝜏𝜏) and providing a smoother result. Also, it could be desired to assign a prescribed ACS or CCS e.g., in sensitivity analysis scenarios or if regional information is transferred to a location of interest. As in Waldo Tobler’s First Law of Geography, stating that “near things are more related than distant things”, it is well-known that near in time “things” are more related than distance in time “things”. Thus, we can assume that any monotonically decreasing function of lag 𝜏𝜏 (or distance) having 𝜌𝜌(0; 𝜽𝜽) = 1 and lim 𝜌𝜌(𝜏𝜏; 𝜽𝜽) = 0 can serve as a proper ACS. A 𝜏𝜏→∞ general class of functions, proposed here, with these properties are the complementary cumulative distribution functions (ccdf), but now treated as functions and not as probability laws. Accordingly, the Weibull ACS is then given by 𝜏𝜏 𝑐𝑐 𝜌𝜌W (𝜏𝜏; 𝑏𝑏, 𝑐𝑐) = exp �− � � � 𝑏𝑏 (20) with 𝑏𝑏 > 0 and 𝑐𝑐 > 0, and forms a generalization of the celebrated Markovian ACS as it is identical for 𝑐𝑐 = 1, yet decays slower for 𝑐𝑐 < 1, and faster for 𝑐𝑐 > 1. Note that 𝜌𝜌W (𝜏𝜏) can be 𝑐𝑐 expressed also in terms of lag-1 correlation 𝜌𝜌1 , i.e., 𝜌𝜌W (𝜏𝜏) = 𝜌𝜌1𝜏𝜏 . A similar stretched exponential form was used for space correlation of rainfall [Ciach and Krajewski, 2006]. Likewise, a power-type ACS is formed by the Pareto II ccdf, i.e., 𝜏𝜏 −1⁄𝑐𝑐 𝜌𝜌PII (𝜏𝜏; 𝑏𝑏, 𝑐𝑐) = �1 + 𝑐𝑐 � 𝑏𝑏 (21) with 𝑏𝑏 > 0 and 𝑐𝑐 > 0. The PII ACS decays always slower than the Markovian, yet it becomes identical as 𝑐𝑐 → 0. A similar two-parameter power-type ACS, named Cauchy class, was also proposed by Gneiting and Schlather [2004] as generalization of the fractional Gaussian noise (fGn) ACS. The Weibull and PII ACS’s can be merged into one three-parameter expression, which coincides with the Burr type XII ccdf, i.e., 1 𝜏𝜏 𝑐𝑐1 −𝑐𝑐1𝑐𝑐2 𝜌𝜌BrXII (𝜏𝜏; 𝑏𝑏, 𝑐𝑐1 , 𝑐𝑐2 ) = �1 + 𝑐𝑐2 � � � 𝑏𝑏 (22) 1/𝑐𝑐1 with 𝑏𝑏 > 0, 𝑐𝑐1 > 0 and 𝑐𝑐2 > 0; for 𝑐𝑐2 → 0, 𝜌𝜌BrXII (𝜏𝜏; 𝑏𝑏, 𝑐𝑐1 , 𝑐𝑐2 ) = 𝜌𝜌W �𝜏𝜏; 𝑏𝑏𝑐𝑐1 , 𝑐𝑐1 �, and for 𝑐𝑐1 = 1 it equals the PII ACS. This general expression, with a different parametrization, was also used in Papalexiou et al. [2011], yet it was not suggested within the general framework proposed here and was not identified as the Burr type XII ccdf. Note that we can form ACS’s decaying even slower than power-type ACS’s, e.g., a general logarithmic expression (GL) proposed here, generalizing also the Markovian ACS, is 𝑥𝑥 −1/𝑐𝑐 𝜌𝜌GL (𝜏𝜏; 𝑏𝑏, 𝑐𝑐) = �1 + ln �1 + 𝑐𝑐 �� 𝑏𝑏 (23) with 𝑏𝑏 > 0 and 𝑐𝑐 > 0; for 𝑐𝑐 → 0 coincides with the Markovian ACS, i.e., lim 𝜌𝜌GL (𝜏𝜏; 𝑏𝑏, 𝑐𝑐) = 𝑐𝑐→0 exp(−𝑥𝑥/𝑏𝑏). This ASC for large values of 𝑐𝑐 can have extremely slow decay rates, and may be useful for processes at the second or millisecond timescales. Other noteworthy ACS are the celebrated fGn, or, Hurst ACS [e.g., Beran, 1994, p.52], linked to long-term persistence (LTP) and fGn processes [Hurst, 1951; Mandelbrot and Wallis, 1968, 1969], given by 1 𝜌𝜌fGn (𝜏𝜏; 𝐻𝐻) = (|𝜏𝜏 − 1|2𝐻𝐻 − 2|𝜏𝜏|2𝐻𝐻 + |𝜏𝜏 + 1|2𝐻𝐻 )~𝑡𝑡 2𝐻𝐻−1 2 (24) where 0 < 𝐻𝐻 < 1 is the Hurst coefficient. Also, FARIMA models [Granger and Joyeux, 1980; Hosking, 1981] have a similar ACS, asymptotically equivalent to the 𝜌𝜌fGn (𝜏𝜏), yet their ACS is more flexible as it allows to control short-term correlations; for applications in hydrology see e.g., [Hosking, 1984; Montanari et al., 1997]. Various other correlation function have been proposed, for example for wind and atmospheric data [e.g., Buell, 1972; Gneiting, 1999]. In the cross-correlation case between two process, e.g., of {𝑋𝑋𝑖𝑖 (𝑡𝑡)} and {𝑋𝑋𝑗𝑗 (𝑡𝑡)}, since 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (𝜏𝜏) ≠ 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (−𝜏𝜏) for 𝜏𝜏 ≠ 0, and 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (0) ≤ 1 we can still use parametric CCS’s similar to the ACS’s framework, if this is desired, by modifying them as 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (𝜏𝜏) = � 𝜌𝜌CS (𝜏𝜏 + 1; 𝜽𝜽) 𝜏𝜏 ≥ 0 𝜌𝜌CS (1 − 𝜏𝜏; 𝜽𝜽) 𝜏𝜏 ≤ 0 (25) where 𝜌𝜌CS (𝜏𝜏) can be any parametric CS like the Weibull, PII, etc. with different parameter values for 𝜏𝜏 ≥ 0 and 𝜏𝜏 ≤ 0 to fulfil the condition of 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (𝜏𝜏) ≠ 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (−𝜏𝜏). Of course an infinity number of ACS or CCS’s can be formed, with many more parameters, yet according to the parsimony principle we should choose the one with the less possible parameters [Box et al., 2008, p.16]. 3.3 Auto- and cross-correlation transformation function 3.3.1 Autocorrelation transformation function (ACTF) The ACTI in Eq. (9) transforms a specific autocorrelation value 𝜌𝜌𝑍𝑍 between a pair of 𝑍𝑍(𝑡𝑡) and 𝑍𝑍(𝜏𝜏) r.v.’s of the Gp lagged by 𝜏𝜏, into the autocorrelation 𝜌𝜌𝑋𝑋 between the 𝑋𝑋(𝑡𝑡) and 𝑋𝑋(𝜏𝜏) r.v.’s, of the target process, yet the inverse relationship is desired for all practical purposes. That is an ACTF 𝒯𝒯(𝜌𝜌𝑋𝑋 ) where we introduce any value of 𝜌𝜌𝑋𝑋 or any ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏) and get, respectively, the pGp 𝜌𝜌𝑍𝑍 value or the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏). We assume here positive correlations ranging in [0,1], yet the framework can be expanded easily for negative correlations too. Essentially, we evaluate the ACTI in a small set of 𝜌𝜌𝑍𝑍 values to create (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points and interpolate them by fitting a simple parametric function. Since 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≥ 𝜌𝜌𝑋𝑋 (𝜏𝜏) [Kendall and Stuart, 1979, p.600] the ACTF 𝒯𝒯 should have the potential to be concave and also pass from the (0,0) and (1,1) points, as for 𝜌𝜌𝑍𝑍 equal to 0 and 1, 𝜌𝜌𝑋𝑋 is also 0 and 1. A simple two-parameter function with these properties we propose here, heuristically evaluated and found to perform perfectly in all cases of continuous and mixed-type marginals studied, is 𝜌𝜌𝑍𝑍 = 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 𝑏𝑏, 𝑐𝑐) = (1 + 𝑏𝑏𝜌𝜌𝑋𝑋 )1−𝑐𝑐 − 1 (1 + 𝑏𝑏)1−𝑐𝑐 − 1 (26) which is concave for 𝑏𝑏 > 0 and 𝑐𝑐 ≥ 0, while for 𝑏𝑏 → 0 and 𝑐𝑐 = 1 we have 𝜌𝜌𝑍𝑍 = 𝜌𝜌𝑋𝑋 . Unless stated this will be the basic ACTF used in the examples of this study. The previous function performs also well for the discrete and binary case, yet the alternative 𝜌𝜌𝑍𝑍 = 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 𝑏𝑏, 𝑐𝑐) = 1 − �1 − 𝜌𝜌𝑋𝑋𝑏𝑏 � 𝑐𝑐 (27) seems to perform better for discrete cases and especially for the binary case. This function is concave for 0 < 𝑏𝑏 ≤ 1 and 𝑐𝑐 ≥ 1; for 𝑏𝑏 = 1 and 𝑐𝑐 = 1 we have 𝜌𝜌𝑍𝑍 = 𝜌𝜌𝑋𝑋 . Note that Eq. (27) coincides with Kumaraswamy cdf [Kumaraswamy, 1980], yet here is used as parametric function and not as a probability law. Thus, we can now form a one-to-one relationship that enables the calculation of the pGp 𝜌𝜌𝑍𝑍 either as a single value or as a parametric pGACS if a parametric ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏) is plugged into Eq. (26) or Eq. (27). Any of the ACTF’s 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 𝑏𝑏, 𝑐𝑐) functions can be easily fitted if we evaluate the ACTI (Eq. (9)) for 𝜌𝜌𝑍𝑍 = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95} and use the corresponding set of (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points. Let us assume we target to a process {𝑋𝑋(𝑡𝑡)} having a Weibull �𝒲𝒲(𝛽𝛽, 𝛾𝛾)� marginal distribution, 𝐹𝐹𝑋𝑋 (𝑥𝑥) = 𝐹𝐹𝒲𝒲 (𝑥𝑥) = 1 − exp(−(𝑥𝑥/𝛽𝛽)𝛾𝛾 ) and a Markovian ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌M (𝜏𝜏; 𝜌𝜌1 ) = 𝜌𝜌1𝜏𝜏 with 𝜌𝜌1 = 0.8. For illustration and comparison we assume three different 𝒲𝒲 distributions (Fig. 1a) with scale parameter 𝛽𝛽 = 1 and shape parameters 𝛾𝛾 = {2,0.5,0.25}, respectively. The estimated (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points (gray dots in Fig. 1b) and the fitted 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 𝑏𝑏, 𝑐𝑐) functions (Fig. 1b) show very different transformation profiles, i.e., for the bell-shaped 𝒲𝒲(1,2) which resembles the Gaussian distribution, essentially 𝜌𝜌𝑍𝑍 = 𝜌𝜌𝑋𝑋 and the pGACS coincides with 𝜌𝜌𝑋𝑋 (𝜏𝜏) (Fig. 1c). As we deviate from normality, e.g., the 𝒲𝒲(1,0.25) has a heavy tail and very high skewness, the ACTF becomes more concave resulting in very different pGACS’s (Fig. 1c). Note that a Markovian ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏) is not reproduced by a Markovian pGACS, e.g., for the 𝒲𝒲(1,0.25) case the 𝜌𝜌𝑋𝑋 (1) = 0.80 corresponds to 𝜌𝜌𝑍𝑍 (1) = 0.93 which does not imply that the Markovian ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) = 0.93𝜏𝜏 will reproduce the 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 0.80𝜏𝜏 , it will only preserve the 𝜌𝜌𝑋𝑋 (1). Another example, showing how the concavity of the ACTF function changes regards mixed-type marginal distributions suitable to model intermittent processes like precipitation (or wind and discharge in some cases). Let us target for an intermittent process {𝑋𝑋(𝑡𝑡)} having probability zero 𝑝𝑝0 , a Pareto II �𝒫𝒫II(𝛽𝛽, 𝛾𝛾)� marginal distribution 𝐹𝐹𝑋𝑋 (𝑥𝑥) = 𝐹𝐹𝒫𝒫II (𝑥𝑥) = 1 − (1 + 𝛾𝛾 𝑥𝑥/𝛽𝛽)−1/𝛾𝛾 for nonzero values with 𝛽𝛽 = 1 and 𝛾𝛾 = 0.3, and an fGn ACS (Eq. (24)) 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌fGn (𝜏𝜏; 𝐻𝐻) with 𝐻𝐻 = 0.75. For comparison we use 𝑝𝑝0 = {0,0.9,0.99}, with the unconditional 𝒫𝒫II pdf’s shown in Fig. 1d (note that it is common to observe 𝑝𝑝0 equal to high values as 0.90 and 0.99 for daily and hourly rainfall records, respectively). The (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points and the fitted 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 𝑏𝑏, 𝑐𝑐) functions (Fig. 1e) show how concavity increases as 𝑝𝑝0 increases resulting in very different pGACS (Fig. 1c), and thus, for large values of 𝑝𝑝0 a much stronger 𝜌𝜌𝑍𝑍 (𝜏𝜏) is necessary to preserve the 𝜌𝜌𝑋𝑋 (𝜏𝜏). As in the previous example the pGACS of the fGn ACS is not an fGN ACS with just a different 𝐻𝐻 value. Fig. 1. Demonstration of the autocorrelation transformation function (ACTF) and the resulting parent-Gaussian autocorrelation structures (pGACS): (a) different Weibull (𝒲𝒲) marginal pdf’s, (b) corresponding ACTF’s (indicated with the same colour) to the 𝒲𝒲 distributions, (c) corresponding pGACS assuming 𝜌𝜌𝑋𝑋 (𝜏𝜏) is a Markovian ACS with 𝜌𝜌1 = 0.8 for the three 𝒲𝒲 distributions (note that 𝜌𝜌𝑋𝑋 (𝜏𝜏) is overlapped by the pGACS of the 𝒲𝒲(1,2) case),(d) unconditional Pareto II (𝒫𝒫II) pdf’s for three 𝑝𝑝0 values, (e) corresponding ACTF’s of the mixed-type 𝒫𝒫II distributions, (f) corresponding pGACS assuming 𝜌𝜌𝑋𝑋 (𝜏𝜏) is an fGn ACS with Hurst coefficient 𝐻𝐻 = 0.75 for the mixed-type 𝒫𝒫II distributions. 3.3.2 Cross-correlation transformation function (CCTF) In the previous case, the ACTF was constrained to pass form the (1,1) point, yet for the crosscorrelation this is not valid. The cross-correlation 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 between two stationary processes {𝑋𝑋𝑖𝑖 (𝑡𝑡)} and �𝑋𝑋𝑗𝑗 (𝑡𝑡)� has boundaries depending on the marginal distributions 𝐹𝐹𝑋𝑋𝑖𝑖 (𝑥𝑥) and 𝐹𝐹𝑋𝑋𝑗𝑗 (𝑥𝑥), thus, there is a range of admissible 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 values according to the Frechet-Hoeffding theoretical limits, i.e., −1 ≤ 𝜌𝜌min ≤ 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 ≤ 𝜌𝜌max ≤ 1 [Fréchet, 1957; Hoeffding, 1994; Embrechts et al., 2002]. These boundary values can be checked for each specific application by using for example the procedure suggested by Demirtas and Hedeker [2011]. However, this check is not required in our approach as the interpolation procedure automatically determines the feasible range of 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 and thus 𝜌𝜌max . Here, we propose as CCTF a simple two-parameter function, that performed excellent in all cases studied, i.e., 𝑐𝑐 𝜌𝜌𝑍𝑍𝑖𝑖𝑍𝑍𝑗𝑗 = 𝒯𝒯 �𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 ; 𝑏𝑏, 𝑐𝑐� = �1 + 𝑏𝑏𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 � − 1 𝑐𝑐 𝑐𝑐2 (28) Note that if more flexibility is needed the three-parameter 𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 = �1 + 𝑏𝑏𝜌𝜌𝑋𝑋1𝑖𝑖 𝑋𝑋𝑗𝑗 � − 1 can be used. This function (Eq. (28)) is essentially the same as the ACTF in Eq. (26) but without the denominator part, which forced the function to pass from (1,1); it is valid for 𝑏𝑏 > 0 and concave for 𝑐𝑐 > 1, linear for 𝑐𝑐 = 1, and convex for 𝑐𝑐 < 1. As in the ACTF case, we can easily fit the CCTF by evaluating the CCTI in Eq. (11) for 𝜌𝜌𝑍𝑍𝑖𝑖𝑍𝑍𝑗𝑗 = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,0.99} and creating the corresponding (𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 , 𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 ) points. Once the CCTF parameters are estimated we can determine easily the 𝜌𝜌max by setting 𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 = 1 in Eq. (28) and solve for 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 , i.e., 𝜌𝜌max = 21/𝑐𝑐 − 1 𝑏𝑏 (29) Let us assume a process {𝑋𝑋1 (𝑡𝑡)} with a Weibull marginal 𝒲𝒲(1,0.5) and a process {𝑋𝑋2 (𝑡𝑡)} with a Beta marginal ℬ(𝛾𝛾1 , 𝛾𝛾2 ). For comparison we use three different Beta pdf’s having negative, zero, and positive skewness (Fig. 2a). We use the CCTI of Eq. (11) to estimate the (𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 , 𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 ) points (grey dots in Fig. 2b) and we fit the CCTF in Eq. (28). Noteworthy, for the negatively skewed Beta the CCTF is convex, almost a straight line for the symmetric, and concave for the positively skewed Beta, while the corresponding 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 limits, estimated from Eq. (29), are 0.53, 0.64 and 0.75, respectively. This indicates that the more the two marginals differ the more their maximum cross-correlation value 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 will be decreased. We also show the pGCCS of a Markovian CCS (Fig. 2c); clearly, due to the maximum limit not all CCS are feasible. Another interesting example, is to assume cross-correlated processes with mixed-type marginals that differ in probability zero. We assume a heavy-tailed continuous marginal 𝒫𝒫II(1,0.3) for the first process {𝑋𝑋1 (𝑡𝑡)}, while for the process {𝑋𝑋2 (𝑡𝑡)} we use three different mixed-type 𝒫𝒫II(1,0.3) marginals with 𝑝𝑝0 = {0.5,0.9,0.99} (Fig. 2d). Using the CCTI of Eq. (11) we calculate the (𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 , 𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 ) points (grey dots in Fig. 2e) and we fit the CCTF of Eq. (28). All CCTF’s are concave while the corresponding 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 limits, estimated from Eq. (29), are 0.98, 0.89 and 0.66, respectively, indicating a decrease in the maximum cross-correlation as 𝑝𝑝0 increases, or else, as the two marginal differ more. In Fig. 2f we show the pGCCS of the Markovian CCS used in the previous example; clearly, as 𝑝𝑝0 increases much stronger pGCCS are needed to reproduce the target CCS. Fig. 2. Demonstration of the cross-correlation transformation function (CCTF) and the resulting parent-Gaussian cross-correlation structures (pGCCS): (a) a Weibull (𝒲𝒲) marginal and three Beta (ℬ) pdf’s, (b) corresponding (indicated with the same colour) crosscorrelation transformation functions (CCTF) of the 𝒲𝒲 distributions with the three Beta, (c) corresponding pGCCS for a Markovian target CCS 𝜌𝜌0 = 0.5, (d) the Pareto II (𝒫𝒫II) continuous marginal and the three mixed-type marginal pdf’s for three 𝑝𝑝0 values, (e) corresponding CCTF’s, (f) corresponding pGCCS for the Markovian CCS as in the previous example. 3.4 Gaussian univariate and multivariate processes with arbitrary CS We can easily simulate a standard Gp, i.e., with 𝜇𝜇 = 0 and 𝜎𝜎 = 1, having an arbitrary parametric ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) by using an autoregressive process of order 𝑝𝑝 (AR(𝑝𝑝)) defined by 𝑝𝑝 (30) 𝑍𝑍(𝑡𝑡) = � 𝑎𝑎𝑖𝑖 𝑍𝑍(𝑡𝑡 − 𝑖𝑖) + 𝜀𝜀(𝑡𝑡) 𝑖𝑖−1 𝑝𝑝 where 𝜀𝜀(𝑡𝑡)~𝒩𝒩(0, 𝜎𝜎𝜀𝜀2 ) is Gaussian random noise with 𝜎𝜎𝜀𝜀2 = 1 − ∑𝑖𝑖=1 𝑎𝑎𝑖𝑖 𝜌𝜌𝑍𝑍 (𝜏𝜏), and 𝑎𝑎𝑖𝑖 are the model parameters. For a given parametric ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) the 𝑎𝑎1 , … , 𝑎𝑎𝑝𝑝 can be easily and analytically estimated using the Yule-Walker equations [e.g., Box et al., 2008, p.67], i.e., 𝒂𝒂 = 𝑷𝑷−1 𝝆𝝆, where 𝒂𝒂T = [𝑎𝑎1 , … , 𝑎𝑎𝑝𝑝 ] is the parameter vector, 𝝆𝝆T = [𝜌𝜌𝑍𝑍 (1), … , 𝜌𝜌𝑍𝑍 (𝑝𝑝)] is the correlation vector up to lag 𝑝𝑝, and 𝑷𝑷 = [𝜌𝜌𝑍𝑍 (|𝑖𝑖 − 𝑗𝑗|) ] is the 𝑝𝑝 × 𝑝𝑝 correlation matrix with 𝑖𝑖 and 𝑗𝑗 denoting, respectively, the 𝑖𝑖-th row and 𝑗𝑗-th column, e.g., the [𝑷𝑷]2,3 element is simply the value of 𝜌𝜌𝑍𝑍 (1) [for more on AR models see Box et al., 2008] Thus, an AR(𝑝𝑝) model preserves exactly a given ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) up to lag 𝑝𝑝 and then for 𝜏𝜏 ≥ 𝑝𝑝 𝑝𝑝 + 1 decays according to 𝜌𝜌AR(𝑝𝑝) (𝜏𝜏) = ∑𝑖𝑖=1 𝑎𝑎𝑖𝑖 𝜌𝜌𝑍𝑍 (𝜏𝜏 − 𝑖𝑖), a relation that can be easily applied recursively. For example, Fig. 3 shows the approximation up to various lags of two parametric ACS, i.e., of a Weibull with 𝑏𝑏 = 10 and 𝑐𝑐 = 0.5 (decaying thus slower than the Markovian ACS), and a very strong Pareto II ACS with 𝑏𝑏 = 5 and 𝑐𝑐 = 4. Clearly, the closer the ACS is to the Markovian the better will be approximated by the 𝜌𝜌AR(𝑝𝑝) (𝜏𝜏) for 𝜏𝜏 ≥ 𝑝𝑝 + 1; in any case, a parametric CS can be approximated up to any desired lags, e.g., even an AR(5000) can be easily fitted. We stress that an AR(𝑝𝑝) model of large or very large order, fitted to a parametric ACS, is a very parsimonious model, as all of its parameters are deterministically and analytically derived from the parametric ACS, e.g., an AR(1000) fitted using a twoparameter ACS is essentially a two-parameter model. Fig. 3. Approximation of two parametric ACS by AR(𝑝𝑝) models of large order. Another approach to generate timeseries from a standard Gp having an arbitrary ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) is based on approximating 𝜌𝜌𝑍𝑍 (𝜏𝜏) by a sum of independent AR(1) processes, an idea originally proposed and used by Mandelbrot [1971] to approximate the fGn ACS. Particularly, if we define 𝑛𝑛 𝑍𝑍(𝑡𝑡) = � 𝑌𝑌𝑖𝑖 (𝑡𝑡) 𝑖𝑖−1 (31) with 𝑌𝑌𝑖𝑖 (𝑡𝑡) = 𝜌𝜌𝑖𝑖 (1)𝑌𝑌𝑖𝑖 (𝑡𝑡 − 1) + 𝜀𝜀𝑖𝑖 (𝑡𝑡) being the 𝑖𝑖-th AR(1) process in the sum, having mean 𝜇𝜇𝑌𝑌𝑖𝑖 = 0, standard deviation 𝜎𝜎𝑌𝑌𝑖𝑖 , lag-1 correlation 𝜌𝜌𝑖𝑖 (1), and 𝜀𝜀𝑖𝑖 (𝑡𝑡)~𝒩𝒩(0, (1 − 𝜌𝜌𝑖𝑖 (1)2 )𝜎𝜎𝑌𝑌2𝑖𝑖 ), then, since the AR(1) processes are independent, the variance and the CS of the sum process are 𝜎𝜎𝑍𝑍2 = ∑𝑛𝑛𝑖𝑖=1 𝜎𝜎𝑌𝑌2𝑖𝑖 and 𝜌𝜌Σ (𝜏𝜏) = 1/𝜎𝜎𝑍𝑍2 ∑𝑛𝑛𝑖𝑖=1 𝜌𝜌𝑖𝑖 (1)𝜏𝜏 𝜎𝜎𝑌𝑌2𝑖𝑖 , respectively. Of course, if we demand {𝑍𝑍(𝑡𝑡)} to have 𝜎𝜎𝑍𝑍2 = 1, then ∑𝑛𝑛𝑖𝑖=1 𝜎𝜎𝑌𝑌2𝑖𝑖 is also constrained to equal 1. The AR(1) parameters can be estimated by numerically minimizing an error norm between 𝜌𝜌Σ (𝜏𝜏) and 𝜌𝜌𝑍𝑍 (𝜏𝜏) up to a desired lag 𝜏𝜏. For an application using five independent AR(1) approximating the ACS given Eq. (22) see Papalexiou et al. [2011] (for an approximation of the fGn ACS with three AR(1) see [Koutsoyiannis, 2002]). The corresponding multivariate autoregressive model MAR(𝑝𝑝) of 𝑛𝑛 processes is defined by 𝑝𝑝 𝒁𝒁(𝑡𝑡) = � 𝑨𝑨𝑖𝑖 𝒁𝒁(𝑡𝑡 − 𝑖𝑖) + 𝑩𝑩𝜺𝜺(𝑡𝑡) 𝑖𝑖−1 (32) where 𝒁𝒁(𝑡𝑡) = [𝑍𝑍1 (𝑡𝑡), … , 𝑍𝑍𝑛𝑛 (𝑡𝑡)]T , 𝑨𝑨𝑖𝑖 and 𝑩𝑩 are 𝑛𝑛 × 𝑛𝑛 parameter matrices, and 𝜺𝜺(𝑡𝑡) = [𝜀𝜀1 (𝑡𝑡), … , 𝜀𝜀𝑛𝑛 (𝑡𝑡)]T is an 𝑛𝑛-vector of independent standard Gaussian variables. For a general algorithm to fit MAR(𝑝𝑝) models of large order see [Neumaier and Schneider, 2001; Schneider and Neumaier, 2001; Schlögl, 2006]). Clearly, large order MAR models are complicated and often unnecessary, e.g., when Markovian ACS and CCS are observed a MAR(1) is sufficient. The parameters of the MAR(1) model 𝒁𝒁(𝑡𝑡) = 𝑨𝑨𝑨𝑨(𝑡𝑡 − 1) + 𝑩𝑩𝜺𝜺(𝑡𝑡) can be estimated by using T T the relations 𝑨𝑨 = 𝑲𝑲𝑍𝑍 (0)𝑲𝑲−1 𝑍𝑍 (1) and 𝑩𝑩𝑩𝑩 = 𝑲𝑲𝑍𝑍 (0)𝑨𝑨𝑲𝑲𝑍𝑍 (1) (thus, 𝑩𝑩 can be found using, e.g., Choleski decomposition), where 𝑲𝑲𝑍𝑍 (0) and 𝑲𝑲𝑍𝑍 (1) are the correlation matrices of the 𝑛𝑛 Gaussian processes (see also section 4.4 for an application). Of course cyclostationarity can be introduced by using different MAR processes for each season. 3.5 A stochastic modelling recipe step-by-step The proposed stochastic modelling framework is summarized in the following steps: 1. Assess suitable marginal distributions and correlation structures (auto- and crosscorrelations for the multivariate case) from the empirical timeseries. 2. Estimate the (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points for the proposed 𝜌𝜌𝑍𝑍 values (see section 3.3.1) using the ACTI in Eq. (9) and fit the parametric ACTF of Eq. (26) (or Eq. (27) for binary marginals) to the points; for the multivariate case estimate (𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 , 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 ) points using the CCTI in Eq. (11) and fit the CCTF in Eq. (28). 3. Insert the target ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏) into the fitted ACTF 𝒯𝒯(𝜌𝜌𝑋𝑋 (𝜏𝜏); 𝑏𝑏, 𝑐𝑐) to estimate the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏); for the multivariate case use the fitted CCTF 𝒯𝒯 �𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (𝜏𝜏)); 𝑏𝑏, 𝑐𝑐� to find the pGCCS 𝜌𝜌𝑍𝑍𝑖𝑖 𝑍𝑍𝑗𝑗 (𝜏𝜏). 4. Use the estimated pGACS and the pGCCS to fit an AR(𝑝𝑝) or MAR(𝑝𝑝) model and generate Gaussian univariate or multivariate timeseries. 5. Transform the Gaussian timeseries using the corresponding transformation 𝑋𝑋𝑖𝑖 (𝑡𝑡) = 𝑄𝑄𝑋𝑋𝑖𝑖 �Φ𝑍𝑍𝑖𝑖 (𝑧𝑧(𝑡𝑡)� based on the fitted distributions from step 1. 4. Real world examples 4.1 Storm events of fine temporal resolution The method is applied to simulate fine temporal (10 seconds resolution) rainfall events, a process that has very strong autocorrelation structure and highly skewed and heavy tailed continuous marginal distribution. The original data are seven storm events recorded at the Hydrometeorology Laboratory at the Iowa University [Georgakakos et al., 1994]. This dataset has been used in other studies, e.g., for a statistical and stochastic analysis see Papalexiou et al. [2011], for a multifractal analysis see Cârsteanu and Foufoula-Georgiou [1996], and for a wavelet analysis see Kumar and Foufoula-Georgiou [1997]. We assume that these events are the outcome of a single process [Papalexiou et al., 2011], and thus, the characteristics of the process are better determined if all events are merged into one set despite their large statistical differences (see Fig. 4a). In any case, the aim here in not a detailed analysis of the set, but rather to illustrate the applicability of the method in a highly non-Gaussian process with strong ACS. In addition, other issues like the bias in the estimation of the ACS are not considered [for these detail see Papalexiou et al., 2011]. Fig. 4. A graphical step by step demonstration of the method applied to 10 s rainfall events: (a) recorded events; (b) empirical distribution of 10 s rainfall and the fitted BrXII distribution; (c) observed ACS and the fitted parametric Weibull ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏); (d) the fitted autocorrelation transformation function (ACTF); (e) the parent-Gaussian autocorrelation structure 𝜌𝜌𝑍𝑍 (𝜏𝜏); (f) generated Gaussian events with ACS 𝜌𝜌𝑍𝑍 (𝜏𝜏); (g) synthetic events by transforming the Gaussian timeseries; (h) empirical distribution of the synthetic rainfall compared with the target BrXII fitted to the original data; (i) empirical autocorrelations of Gaussian and synthetic timeseries compared with 𝜌𝜌𝑍𝑍 (𝜏𝜏) and 𝜌𝜌𝑋𝑋 (𝜏𝜏). The method is graphically demonstrated in Fig. 4. First, a distribution is fitted to the empirical distribution (Fig. 4b); here the ℬ𝓇𝓇XII is used. The estimated parameters, using the method of L-moments [Hosking, 1990], are 𝛽𝛽 = 2.13, 𝛾𝛾1 = 0.74, and 𝛾𝛾2 = 0.22 (see Papalexiou and Koutsoyiannis [2016] for details in fitting the ℬ𝓇𝓇XII using L-moments). Second, the observed ACS 𝜌𝜌�𝑋𝑋 (𝜏𝜏) is approximated here by numerically fitting the parametric Weibull ACS 𝜌𝜌W (𝜏𝜏) given in Eq. (20), with estimated parameters 𝛽𝛽 = 80.6 and 𝛾𝛾 = 0.73 (Fig. 4c), i.e. it is assumed that 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌W (𝜏𝜏; 𝛽𝛽, 𝛾𝛾). Third, the ΑCTI ℛ(𝜽𝜽𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) in Eq. (9) is applied using the fitted ℬ𝓇𝓇XII distribution to estimate a few (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points (grey dots in Fig. 4d) which in sequence are “interpolated” by the ACTF in Eq. (26) with parameters 𝑐𝑐1 = 2.96 and 𝑐𝑐2 = 0.93. Fourth, the fitted ACTF is applied to the estimated 𝜌𝜌W (𝜏𝜏; 𝛽𝛽, 𝛾𝛾) to obtain the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) (Fig. 4e). Fifth, a large order AR model is used, i.e., AR(1000), to reproduce the fitted pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) and generate Gaussian TS (Fig. 4f). Sixth, synthetic TS emerge by simply transforming the Gaussian TS using Eq. (2) and the fitted ℬ𝓇𝓇XII (Fig. 4e). For verification the empirical distribution of the synthetic timeseries is compared with the target ℬ𝓇𝓇XII that was fitted the original data (Fig. 4h), while the empirical ACS of the Gaussian and synthetic timeseries are compared with the theoretical 𝜌𝜌𝑍𝑍 (𝜏𝜏) and 𝜌𝜌𝑋𝑋 (𝜏𝜏) (Fig. 4i). 4.2 Daily precipitation, river discharge and wind As an example of an intermittent process we use daily rainfall of October recorded at the National Observatory of Athens in Greece from 24/04/1927 to 20/02/1990 (Fig. 5a), assuming that daily rainfall of any month is a stationary process. The probability dry was found 𝑝𝑝0 = 0.78; the nonzero rainfall was described by an 𝐹𝐹𝒢𝒢𝒢𝒢 (𝑥𝑥; 16.5, 0.39,0.97) distribution (Eq. (12)) [Papalexiou and Koutsoyiannis, 2016], and a Weibull ACS (Eq.(20)) was fitted to the empirical ACS, i.e., 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌W (𝜏𝜏; 0.43,0.48) (dark red line in Fig. 5e). The ACTI in Eq. (9) was used to estimate (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points (grey dots in Fig. 5b) using the corresponding expressions for the mixed-type case, i.e., the quantile function, mean and variance, are given now by Eqs (17), (18), and (19), respectively. The correlation transformation function 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 13.88,0.75) fitted perfectly to the (𝜌𝜌𝑋𝑋 , 𝜌𝜌𝑍𝑍 ) points (Fig. 5b) and was used to estimate the pGACS, i.e., 𝜌𝜌𝑍𝑍 (𝜏𝜏) = 𝒯𝒯(𝜌𝜌W (𝜏𝜏; 0.43,0.48); 13.88,0.75) (orange line in Fig. 5e). The 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≈ 0 for 𝜏𝜏 > 20, thus, an AR(20) was fitted to 𝜌𝜌𝑍𝑍 (𝜏𝜏) for 𝜏𝜏 = 1, … ,20 and used to generate a Gaussian TS of 1000 months (31 × 1000 values). The Gaussian TS was transformed to synthetic rainfall (Fig. 5c shows sample size equal with the original TS) by applying the transformation in Eq. (2) with 𝑄𝑄𝑋𝑋 being the mixed-type quantile in Eq. (17) with the estimated 𝑝𝑝0 and the fitted 𝒢𝒢𝒢𝒢 quantile. For verification, the empirical distribution and the empirical ACS of the synthetic sample is compared with the expected 𝐹𝐹𝒢𝒢𝒢𝒢 (𝑥𝑥; 16.5, 0.39,0.97) distribution (Fig. 5d) and the expected 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌W (𝜏𝜏; 0.43,0.48) CS (dark red line in Fig. 5e). Fig. 5. Real-world simulations: (a) daily precipitation of October recorded at the National observatory of Athens, Greece, (b) the corresponding autocorrelation transformation function, (c) simulated timeseries, (d) probability plot verifying that the marginal of the synthetic TS is the same as the fitted 𝒢𝒢𝒢𝒢 to the real nonzero data, (e) the fitted daily precipitation ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏), the estimated pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏), and the empirical values from the generated Gaussian and synthetic TS, (f-j) similar to (a-e) for daily river discharge of April in the Middle Fork Snoqualmie river in U.S.A., (k-o) similar to (a-e) for daily wind speed of January recorded at Maastricht, Netherlands. Another important variable is daily river discharge; here we use daily values of April observed in the Middle Fork Snoqualmie river in U.S.A. from 01/02/1961 to 06/11/2016 (Fig. 5f), assuming again a stationary process for same-month days. Daily discharge was found to be well described by the heavy tailed 𝐹𝐹BrIII (𝑥𝑥; 40.5,12.6,0.37) distribution (Eq.(14)), while the empirical ACS fitted well to a relatively slowly decaying Weibull ACS (Eq.(20)), i.e., 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌W (𝜏𝜏; 3.5,0.79) (dark red line in Fig. 5j). The estimated correlation transformation function 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 0.74,2.77) (Fig. 5g) was applied to evaluate the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) (orange line in Fig. 5j), which gets 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≈ 0 for 𝜏𝜏 > 25; thus, a Gaussian TS of 1000 months (31 × 1000 values) was generated from a fitted AR(25) and was transformed to synthetic daily discharge (Fig. 5h) by applying the transformation in Eq. (2) with 𝑄𝑄𝑋𝑋 being the quantile of the fitted ℬ𝓇𝓇III . The synthetic TS have the expected 𝐹𝐹BrIII (𝑥𝑥; 40.5,12.6,0.37) marginal (Fig. 5i) and the expected 𝜌𝜌W (𝜏𝜏; 3.5,0.79) ACS (dark red line in Fig. 5j). As a final example of a variable defined in the positive axis the method is applied to daily wind speed of January recorded at Maastricht in the Netherlands from 01/01/1957 to 31/12/2016 (Fig. 5k). Daily wind speed is described here by the 𝐹𝐹𝒢𝒢𝒢𝒢 (𝑥𝑥; 4.4,2.66,1.76) distribution (Eq.(12)), as commonly used models like the two-parameter Weibull distribution or the two-parameter Gamma distribution, did not perform well; also zero values were not recorded and thus the marginal is assumed continuous. The PII ACS in Eq. (21) was fitted to the empirical ACS, i.e., 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌PII (𝜏𝜏; 1.7,0.68). The estimated correlation transformation function 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 0.31,0.18) (Fig. 5l) shows no concavity, and thus, the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) coincides with 𝜌𝜌𝑋𝑋 (𝜏𝜏) (lines overlap in Fig. 5o). The 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≈ 𝜌𝜌𝑋𝑋 (𝜏𝜏) ≈ 0 for 𝜏𝜏 > 25, and thus, an AR(25) was used to generate a Gaussian TS (31 × 1000 values) which was transformed to synthetic daily wind speed (Fig. 5m) by applying the transformation in Eq. (2) with 𝑄𝑄𝑋𝑋 being the quantile of the fitted 𝒢𝒢𝒢𝒢 . The synthetic TS have the expected marginal (Fig. 5n) and the expected ACS (Fig. 5o). 4.3 Relative humidity, discrete and binary cases Many variables in nature can be expressed in the [0,1] range, e.g., relative humidity, probability dry, percentage variables, etc. Here the method is applied on November daily values of relative humidity recorded at Maastricht in the Netherlands from 01/01/1957 to 31/12/2016 (Fig. 6a). A two-parameter Beta distribution was used, i.e., 𝐹𝐹ℬ (𝑥𝑥; 16.1,2.3) and a PII ACS (Eq. (21)) was fitted to the empirical ACS, i.e., 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌PII (𝜏𝜏; 0.80,1,16). The estimated ACTF 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 3.24,0.07) (Fig. 6b) is a straight line and the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) coincides with 𝜌𝜌𝑋𝑋 (𝜏𝜏) (lines overlap in Fig. 6e). The 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≈ 𝜌𝜌𝑋𝑋 (𝜏𝜏) ≈ 0 for 𝜏𝜏 > 30, and thus, an AR(30) was used to generate a Gaussian TS (31 × 1000 values) which was transformed to synthetic daily wind speed (Fig. 6c) by applying the transformation in Eq. (2) with 𝑄𝑄𝑋𝑋 being the quantile of the fitted Beta. The synthetic TS have the expected marginal (Fig. 6d) and the expected ACS (Fig. 6e). Fig. 6. Simulation of relative humidity, number of extremes per year and occurrences of drought years: (a) relative humidity of November recorded at Maastricht, Netherlands, (b) the ACTF, (c) simulated timeseries, (d) probability plot verifying that the marginal of the synthetic TS is the target Beta distribution, (e) the ACS 𝜌𝜌𝑋𝑋 (𝜏𝜏), the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏), and the empirical values form the generated Gaussian and synthetic TS, (f-j) similar to (a-e) for number of extremes per year in the station ASN00008067 from GHCN-daily database; the discrete Polya-Aeppli distribution is used, (k-o) similar to (a-e) for occurrences of drought years at the station ASN00008067. As an example of a process with discrete marginal distribution we use the number of extreme daily precipitation events per year, i.e., in an 𝑁𝑁-year record we identify the 𝑁𝑁 largest values and their dates and count the number in each year. Here, we used a long daily rainfall record, randomly selected from the GHCN-Daily database (ID: ASN00008067), to form the number of extremes per year TS (Fig. 6f). A two-parameter discrete distribution was used, i.e., the Polya-Aeppli distribution 𝐹𝐹𝒫𝒫𝒫𝒫 (𝑥𝑥; 0.85,0.15), to describe the probability to observe a given number of extremes in any year. The empirical autocorrelation is essentially 0, and thus, for demonstration purposes, a PII CS (Eq. (21)) was prescribed, i.e., 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌PII (𝜏𝜏; 1,1). Here we fit the Kumaraswamy ACTF in Eq. (27) , i.e., 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 1.0,1.22) (Fig. 6g) shows small concavity and the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≈ 0 for 𝜏𝜏 > 30( Fig. 6j), and thus, an AR(30) was used to generate a Gaussian TS (3000 years) which was transformed to synthetic number of extremes per year (Fig. 6h) by applying the transformation in Eq. (2) with 𝑄𝑄𝑋𝑋 being the quantile of the fitted Polya-Aeppli distribution. The synthetic TS have the expected marginal (Fig. 6i) and the expected ACS (Fig. 6j). In many cases we may desire to express a variable in two states, e.g., rain and no-rain. We use the same daily rainfall record (ASN00008067), aggregated to the annual timescale, to form a binary TS by assigning 0 to annual precipitation values that belong to the first quartile (drought years) and 1 to the rest (Fig. 6k). The Bernoulli distribution was used with Pr(𝑋𝑋 = 0) = 0.25 to describe the probability to observe a drought year, and a Weibull ACS was prescribed, i.e., 𝜌𝜌𝑋𝑋 (𝜏𝜏) = 𝜌𝜌W (𝜏𝜏; 2,0.5) to demonstrate the method as the empirical correlation is almost zero. The estimated Kumaraswamy ACTF 𝒯𝒯(𝜌𝜌𝑋𝑋 ; 1.03,1.97) (Fig. 6l) shows moderate to strong concavity with a perfect fit to the points, while the pGACS 𝜌𝜌𝑍𝑍 (𝜏𝜏) ≈ 0 for 𝜏𝜏 > 30 ( Fig. 6o). Gaussian TS (3000 years) were generated from an AR(30) and transformed to binary TS accordingly (Fig. 6m). The synthetic binary TS have the expected marginal (Fig. 6n) and the expected ACS (Fig. 6o). 4.4 A Multivariate simulation of precipitation, wind, and relative humidity As a final example we demonstrate the method in a multivariate simulation of three different processes at daily scale, i.e., of precipitation {𝑋𝑋1 (𝑡𝑡)}, wind speed {𝑋𝑋2 (𝑡𝑡)} and relative humidity {𝑋𝑋3 (𝑡𝑡)}. For precipitation, we assume probability dry 𝑝𝑝0 = 0.7 and for positive values a power-type ℬ𝓇𝓇XII(2,0.9,0.2) distribution; for wind speed probability calmness 𝑝𝑝0 = 0.1 and for positive values the two-parameter Weibull 𝒲𝒲(5,1.2) distribution; and for relative humidity a Kumaraswamy 𝒦𝒦𝒦𝒦(11,5) marginal distribution (Fig. 7a-c). Thus, we have two mixed-type marginal pdf’s, with different 𝑝𝑝0 and different continuous part, and a continuous marginal bounded in (0,1). Also we assume lag-0 and lag-1 correlation matrices 1 0.50 0.35 0.30 0.25 0.15 𝑲𝑲𝑋𝑋 (0) = �0.50 1 0.60� , 𝑲𝑲𝑋𝑋 (1) = �0.10 0.40 0.35� 0.35 0.60 1 0.12 0.30 0.50 (33) with the (𝑖𝑖, 𝑗𝑗) element expressing the cross-correlation coefficients 𝜌𝜌𝑋𝑋𝑖𝑖 𝑋𝑋𝑗𝑗 (𝜏𝜏) for lags 0 or 1 between the 𝑖𝑖-th and 𝑗𝑗-th process. Of course the diagonal in 𝑲𝑲𝑋𝑋 (1) refers to the lag-1 autocorrelation. Note that 𝑲𝑲𝑋𝑋 (0) is always symmetric while 𝑲𝑲𝑋𝑋 (1) is not. Fig. 7. An assumed multivariate case of daily precipitation with 𝑝𝑝0 = 0.7, wind speed with 𝑝𝑝0 = 0.1, and relative humidity: (a-c) the fitted or the target marginal pdf’s of the three variables, (d-f) the corresponding ACTF’s, (g-i) the CCTF’s, and (j-l) synthetic times series that preserve the 𝑝𝑝0 , the marginal distributions, the lag-1 autocorrelation, and the lag-0 and lag-1 cross-correlations among them. The ACTF’s (Fig. 7d-f) show a moderate concavity for the precipitation marginal, a slight one for wind, and essentially zero for relative humidity. The CCTF is concave for the rainfall-wind marginal distributions (Fig. 7g) with estimated upper limit 0.80; interestingly, it is clearly convex for the rainfall and humidity with limit 0.42 (Fig. 7h), and slightly convex for the wind-humidity case with limit 0.76 (Fig. 7i). These functions were used to estimate the pGp correlation matrices, i.e., 1 0.69 071 0.49 𝑲𝑲𝑍𝑍 (0) = �0.69 1 0.70� , 𝑲𝑲𝑍𝑍 (1) = �0.17 0.71 0.70 1 0.21 0.38 0.27 0.44 0.40� 0.34 0.51 (34) which accordingly were used to fit a multivariate AR(1) and generate a multivariate TS of 10000 values. Accordingly, as in the previous cases, each Gaussian TS was transformed to its target process timeseries using the corresponding transformations 𝑋𝑋𝑖𝑖 (𝑡𝑡) = 𝑄𝑄𝑋𝑋𝑖𝑖 �Φ𝑍𝑍𝑖𝑖 (𝑧𝑧(𝑡𝑡)�. The synthetic TS (Fig. 7j-l) preserve all desired properties, i.e., 𝑝𝑝0 , marginal distributions, lag-1 autocorrelation, and lag-0 and lag-1 cross correlations. Of course, it is straightforward to apply this framework for the multivariate cyclostationary case, and use higher order MAR models if this is desired. 5. Summary and Conclusions Natural processes have a “dynamic” randomness unveiled by structural dependencies in time and/or space and by probability laws governing the frequency of their values. There is no unique correlation structure or probability law to describe the pluralism and the polyphony observed in natural processes. And for this reason, and in order to avoid ad hoc solutions, we need a general stochastic framework capable of reproducing this “dynamic” randomness irrespective of the correlation structure or the marginal probability law. The framework presented here, unifies, introduces new elements, extends and simplifies previous attempts and proposes a single approach for stochastic modelling of any hydroclimatic process and beyond. The basic assumption is that an arbitrary process {𝑋𝑋(𝑡𝑡)}, with a prescribed marginal distribution 𝐹𝐹𝑋𝑋 (𝑥𝑥) and correlation structure 𝜌𝜌𝑋𝑋 (𝜏𝜏) has a parent-Gaussian process that can be easily assessed. For the multivariate case, this implies that a set of processes have a corresponding set of parent-Gaussian processes. In this direction, a complete framework is introduced based on simple analytical auto- and cross-correlation transformation functions that enable fast and easy estimation of the parent-Gaussian processes avoiding iterative and case specific methods proposed in the past. The method is applied in a large variety of hydroclimatic processes, ranging from intermittent variables like precipitation and wind speed, to processes with heavy-tail marginals like river discharge, and to processes with bounded marginals like relative humidity, or even to discrete and binary cases. The versatility of the method is also demonstrated in a multivariate case where processes with very different marginals and correlations are reproduced exactly. As a final remark, the framework proposed enables an easy estimation of the limit or the maximum feasible cross-correlation between two processes and reveals that when their marginals differ significantly in shape, they cannot be strongly correlated. The same remark holds also for single processes, and although there is no limit and the autocorrelation can reach up to 1, processes with very different marginals from the Gaussian, e.g., highly skewed and heavy-tailed, will be observed with weak autocorrelation structures, indicating, maybe, that nature likes to “hide” its internal structure. References Aghakouchak, A., E. Habib, and A. Bárdossy (2010), A comparison of three remotely sensed rainfall ensemble generators, Atmospheric Research, 98(2), 387–399. Bárdossy, A., and G. G. S. Pegram (2009), Copula based multisite model for daily precipitation simulation, Hydrology and Earth System Sciences, 13(12), 2299. Bardossy, A., and E. J. Plate (1992), Space-time model for daily rainfall using atmospheric circulation patterns, Water Resour. Res., 28(5), 1247–1259, doi:10.1029/91WR02589. Bartolini, P., J. D. Salas, and J. T. B. Obeysekera (1988), Multivariate periodic ARMA (1, 1) processes, Water Resources Research, 24(8), 1237–1246. Beran, J. (1994), Statistics for Long-Memory Processes, CRC Press. Bowers, M. C., W. W. Tung, and J. B. Gao (2012), On the distributions of seasonal river flows: Lognormal or power law?, Water Resour. Res., 48(5), W05536, doi:10.1029/2011WR011308. Box, G. E. P., G. M. Jenkins, and G. C. Reinsel (2008), Time Series Analysis: Forecasting and Control, 4 edition., Wiley, Hoboken, N.J. Breinl, K., T. Turkington, and M. Stowasser (2015), Simulating daily precipitation and temperature: a weather generation framework for assessing hydrometeorological hazards, Meteorological Applications, 22(3), 334–347. Bruhn, J. A., W. E. Fry, and G. W. Fick (1980), Simulation of Daily Weather Data Using Theoretical Probability Distributions, Journal of Applied Meteorology, 19(9), 1029– 1036, doi:10.1175/1520-0450(1980)019<1029:SODWDU>2.0.CO;2. Buell, C. E. (1972), Correlation Functions for Wind and Geopotential on Isobaric Surfaces, J. Appl. Meteor., 11(1), 51–59, doi:10.1175/15200450(1972)011<0051:CFFWAG>2.0.CO;2. Buishand, T. A. (1978), Some remarks on the use of daily rainfall models, Journal of Hydrology, 36(3–4), 295–308, doi:10.1016/0022-1694(78)90150-6. Burr, I. W. (1942), Cumulative Frequency Functions, The Annals of Mathematical Statistics, 13(2), 215–232. Cario, M. C., and B. L. Nelson (1997), Modeling and generating random vectors with arbitrary marginal distributions and correlation matrix, Technical Report, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, Illinois. Cario, M. C., and B. L. Nelson (1998), Numerical methods for fitting and simulating autoregressive-to-anything processes, INFORMS Journal on Computing, 10(1), 72– 81. Cârsteanu, A., and E. Foufoula-Georgiou (1996), Assessing dependence among weights in a multiplicative cascade model of temporal rainfall, J. Geophys. Res., 101(D21), 26363– 26370, doi:10.1029/96JD01657. Carta, J. A., P. Ramírez, and S. Velázquez (2009), A review of wind speed probability distributions used in wind energy analysis, Renewable and Sustainable Energy Reviews, 13(5), 933–955, doi:10.1016/j.rser.2008.05.005. Chung, C., and J. D. Salas (2000), Drought occurrence probabilities and risks of dependent hydrologic processes, Journal of Hydrologic Engineering, 5(3), 259–268. Ciach, G. J., and W. F. Krajewski (2006), Analysis and modeling of spatial correlation structure in small-scale rainfall in Central Oklahoma, Advances in Water Resources, 29(10), 1450–1463, doi:10.1016/j.advwatres.2005.11.003. Cowpertwait, P., V. Isham, and C. Onof (2007), Point process models of rainfall: developments for fine-scale structure, Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences, 463(2086), 2569–2587, doi:10.1098/rspa.2007.1889. Demirtas, H. (2014), Joint generation of binary and nonnormal continuous data, Journal of Biometrics & Biostatistics, (S12), 1. Demirtas, H. (2017), Concurrent generation of binary and nonnormal continuous data through fifth-order power polynomials, Communications in Statistics-Simulation and Computation, 46(1), 344–357. Demirtas, H., and D. Hedeker (2011), A practical way for computing approximate lower and upper correlation bounds, The American Statistician, 65(2), 104–109. Embrechts, P., A. McNeil, and D. Straumann (2002), Correlation and dependence in risk management: properties and pitfalls, Risk management: value at risk and beyond, 176223. Emrich, L. J., and M. R. Piedmonte (1991), A method for generating high-dimensional multivariate binary variates, The American Statistician, 45(4), 302–304. Feller, W. (1971), Introduction to the Theory of Probability and its Applications, Vol. 2, II (2. Ed.) New York: Wiley. Fréchet, M. (1957), Les tableaux de corrélation et les programmes linéaires, Revue de l’Institut international de statistique, 23–40. Geng, S., F. W. T. Penning de Vries, and I. Supit (1986), A simple method for generating daily rainfall data, Agricultural and Forest Meteorology, 36(4), 363–376, doi:10.1016/0168-1923(86)90014-6. Georgakakos, K. P., A. A. Carsteanu, P. L. Sturdevant, and J. A. Cramer (1994), Observation and analysis of Midwestern rain rates, Journal of applied meteorology, 33(12), 1433– 1444. Gneiting, T. (1999), Correlation functions for atmospheric data analysis, Q.J.R. Meteorol. Soc., 125(559), 2449–2464, doi:10.1002/qj.49712555906. Gneiting, T., and M. Schlather (2004), Stochastic Models That Separate Fractal Dimension and the Hurst Effect, SIAM Rev., 46(2), 269–282, doi:10.1137/S0036144501394387. Granger, C. W., and R. Joyeux (1980), An introduction to long-memory time series models and fractional differencing, Journal of time series analysis, 1(1), 15–29. Grimaldi, S., and F. Serinaldi (2006), Asymmetric copula in multivariate flood frequency analysis, Advances in Water Resources, 29(8), 1155–1167. Hering, A. S., K. Kazor, and W. Kleiber (2015), A Markov-switching vector autoregressive stochastic wind generator for multiple spatial and temporal scales, Resources, 4(1), 70–92. Herr, H. D., and R. Krzysztofowicz (2005), Generic probability distribution of rainfall in space: The bivariate model, Journal of Hydrology, 306(1), 234–263. Hoeffding, W. (1994), Scale—invariant correlation theory, in The collected works of Wassily Hoeffding, pp. 57–107, Springer. Hosking, J. R. (1984), Modeling persistence in hydrological time series using fractional differencing, Water resources research, 20(12), 1898–1908. Hosking, J. R. . (1981), Fractional differencing, Biometrika, 68(1), 165–176. Hosking, J. R. . (1990), L-moments: analysis and estimation of distributions using linear combinations of order statistics, Journal of the Royal Statistical Society. Series B (Methodological), 52(1), 105–124. Hosking, J. R. M. (1994), The four-parameter kappa distribution, IBM Journal of Research and Development, 38(3), 251–258. Hurst, H. E. (1951), Long-term storage capacity of reservoirs, Transactions of the American Society of Civil Engineers, 116, 770–808. Justus, C. G., W. R. Hargraves, A. Mikhail, and D. Graber (1978), Methods for Estimating Wind Speed Frequency Distributions, J. Appl. Meteor., 17(3), 350–353, doi:10.1175/15200450(1978)017<0350:MFEWSF>2.0.CO;2. Kendall, M., and A. Stuart (1979), Handbook of Statistics, Griffin & Company, London. Kilsby, C. G., P. D. Jones, A. Burton, A. C. Ford, H. J. Fowler, C. Harpham, P. James, A. Smith, and R. L. Wilby (2007), A daily weather generator for use in climate change studies, Environmental Modelling & Software, 22(12), 1705–1719. Kleiber, W., R. W. Katz, and B. Rajagopalan (2012), Daily spatiotemporal precipitation simulation using latent and transformed Gaussian processes, Water Resour. Res., 48(1), W01523, doi:10.1029/2011WR011105. Klein Tank, A. M. G., and G. P. Können (2003), Trends in Indices of Daily Temperature and Precipitation Extremes in Europe, 1946–99, J. Climate, 16(22), 3665–3680, doi:10.1175/1520-0442(2003)016<3665:TIIODT>2.0.CO;2. Koutsoyiannis, D. (2002), The Hurst phenomenon and fractional Gaussian noise made easy, Hydrological Sciences Journal, 47(4), 573–596. Kroll, C. N., and R. M. Vogel (2002), Probability distribution of low streamflow series in the United States, Journal of Hydrologic Engineering, 7(2), 137–146. Kugiumtzis, D. (2002), Statically transformed autoregressive process and surrogate data test for nonlinearity, Physical Review E, 66(2), 025201. Kumar, P., and E. Foufoula-Georgiou (1997), Wavelet analysis for geophysical applications, Rev. Geophys., 35(4), 385–412, doi:10.1029/97RG00427. Kumaraswamy, P. (1980), A generalized probability density function for double-bounded random processes, Journal of Hydrology, 46(1), 79–88, doi:10.1016/00221694(80)90036-0. Lee, T., and J. D. Salas (2011), Copula-based stochastic simulation of hydrological data applied to Nile River flows, Hydrology Research, 42(4), 318–330. Lombardo, F., E. Volpi, D. Koutsoyiannis, and S. M. Papalexiou (2013), Just two moments! A cautionary note against use of high-order moments in multifractal models in hydrology, Hydrology and Earth System Sciences Discussions, 10(4), 4627–4654, doi:10.5194/hessd-10-4627-2013. Macke, J. H., P. Berens, A. S. Ecker, A. S. Tolias, and M. Bethge (2009), Generating spike trains with specified correlation coefficients, Neural computation, 21(2), 397–423. Mandelbrot, B. B. (1971), A Fast Fractional Gaussian Noise Generator, Water Resour. Res., 7(3), 543–553. Mandelbrot, B. B., and J. R. Wallis (1968), Noah, Joseph, and Operational Hydrology, Water Resour. Res., 4(5), 909–918, doi:10.1029/WR004i005p00909. Mandelbrot, B. B., and J. R. Wallis (1969), Some long-run properties of geophysical records, Water Resour. Res., 5(2), 321–340, doi:10.1029/WR005i002p00321. Mehrotra, R., and A. Sharma (2009), Evaluating spatio-temporal representations in daily rainfall sequences from three stochastic multi-site weather generation approaches, Advances in Water Resources, 32(6), 948–962. Mielke Jr, P. W. (1973), Another Family of Distributions for Describing and Analyzing Precipitation Data, Journal of Applied Meteorology, 12(2), 275–280. Mielke Jr, P. W., and E. S. Johnson (1973), Three-Parameter Kappa Distribution Maximum Likelihood Estimates and Likelihood Ratio Tests, Monthly Weather Review, 101(9), 701–707. Mielke Jr, P. W., and E. S. Johnson (1974), Some generalized beta distributions of the second kind having desirable application features in hydrology and meteorology, Water Resources Research, 10(2), 223–226. Molotch, N. P., M. T. Colee, R. C. Bales, and J. Dozier (2005), Estimating the spatial distribution of snow water equivalent in an alpine basin using binary regression tree models: the impact of digital elevation data and independent variable selection, Hydrological Processes, 19(7), 1459–1479. Montanari, A., R. Rosso, and M. S. Taqqu (1997), Fractionally differenced ARIMA models applied to hydrologic time series: Identification, estimation, and simulation, Water resources research, 33(5), 1035–1044. Neumaier, A., and T. Schneider (2001), Estimation of parameters and eigenmodes of multivariate autoregressive models, ACM Transactions on Mathematical Software (TOMS), 27(1), 27–57. Onof, C., and H. S. Wheater (1993), Modelling of British rainfall using a random parameter Bartlett-Lewis rectangular pulse model, Journal of Hydrology, 149(1–4), 67–95. Onof, C., R. E. Chandler, A. Kakou, P. Northrop, H. S. Wheater, and V. Isham (2000), Rainfall modelling using Poisson-cluster processes: a review of developments, Stochastic Environmental Research and Risk Assessment, 14(6), 384–411. Papalexiou, S. M., and D. Koutsoyiannis (2012), Entropy based derivation of probability distributions: A case study to daily rainfall, Advances in Water Resources, 45, 51–57, doi:10.1016/j.advwatres.2011.11.007. Papalexiou, S. M., and D. Koutsoyiannis (2013), Battle of extreme value distributions: A global survey on extreme daily rainfall, Water Resour. Res., 49(1), 187–201, doi:10.1029/2012WR012557. Papalexiou, S. M., and D. Koutsoyiannis (2016), A global survey on the seasonal variation of the marginal distribution of daily precipitation, Advances in Water Resources, 94, 131–145, doi:10.1016/j.advwatres.2016.05.005. Papalexiou, S. M., D. Koutsoyiannis, and A. Montanari (2011), Can a simple stochastic model generate rich patterns of rainfall events?, Journal of Hydrology, 411(3–4), 279–289, doi:10.1016/j.jhydrol.2011.10.008. Papalexiou, S. M., D. Koutsoyiannis, and C. Makropoulos (2013), How extreme is extreme? An assessment of daily rainfall distribution tails, Hydrol. Earth Syst. Sci., 17(2), 851– 862, doi:10.5194/hess-17-851-2013. Papoulis, A., and S. U. Pillai (2002), Probability, random variables, and stochastic processes, Tata McGraw-Hill Education. Park, J.-S., S.-C. Seo, and T. Y. Kim (2009), A kappa distribution with a hydrological application, Stoch Environ Res Risk Assess, 23(5), 579–586, doi:10.1007/s00477008-0243-5. Salas, J. D. (1980), Applied modeling of hydrologic time series, Water Resources Publication. Salas, J. D., D. C. Boes, and R. A. Smith (1982), Estimation of ARMA Models with seasonal Water Resour. Res., 18(4), 1006–1010, parameters, doi:10.1029/WR018i004p01006. Salas, J. D., O. G. Sveinsson, W. L. Lane, and D. K. Frevert (2006), Stochastic streamflow simulation using SAMS-2003, Journal of irrigation and drainage engineering, 132(2), 112–122. Schlögl, A. (2006), A comparison of multivariate autoregressive estimators, Signal processing, 86(9), 2426–2429. Schneider, T., and A. Neumaier (2001), Algorithm 808: ARfit—A Matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models, ACM Transactions on Mathematical Software (TOMS), 27(1), 58–65. Seguro, J. V., and T. W. Lambert (2000), Modern estimation of the parameters of the Weibull wind speed distribution for wind energy analysis, Journal of Wind Engineering and Industrial Aerodynamics, 85(1), 75–84, doi:10.1016/S0167-6105(99)00122-1. Serinaldi, F. (2009), A multisite daily rainfall generator driven by bivariate copula-based mixed distributions, Journal of Geophysical Research: Atmospheres, 114(D10). Serinaldi, F., and C. G. Kilsby (2014a), Rainfall extremes: Toward reconciliation after the battle of distributions, Water Resour. Res., 50(1), 336–352, doi:10.1002/2013WR014211. Serinaldi, F., and C. G. Kilsby (2014b), Simulating daily rainfall fields over large areas for collective risk estimation, Journal of Hydrology, 512, 285–302. Serinaldi, F., and C. G. Kilsby (2016), A Blueprint for Full Collective Flood Risk Estimation: Demonstration for European River Flooding, Risk Analysis. Serinaldi, F., and F. Lombardo (2017a), BetaBit: A fast generator of autocorrelated binary processes for geophysical research, EPL, 118(3), 30007. Serinaldi, F., and F. Lombardo (2017b), General simulation algorithm for autocorrelated binary processes, Physical Review E, 95(2), 023312. Shao, Q., and R. Lund (2004), Computation and characterization of autocorrelations and partial autocorrelations in periodic ARMA models, Journal of Time Series Analysis, 25(3), 359–372. Sirangelo, B., P. Versace, and D. L. De Luca (2007), Rainfall nowcasting by at site stochastic model PRAISE, Hydrology and Earth System Sciences Discussions, 4(1), 151–177. Smith, R. L., and H. A. Schreiber (1974), Point Processes of Seasonal Thunderstorm Rainfal 2. Rainfall Depth Probabilities, Water Resources Research. Stacy, E. W. (1962), A Generalization of the Gamma Distribution, The Annals of Mathematical Statistics, 33(3), 1187–1192. Stacy, E. W., and G. A. Mihram (1965), Parameter Estimation for a Generalized Gamma Distribution, Technometrics, 7(3), 349–358. Stern, R. D., and R. Coe (1984), A Model Fitting Analysis of Daily Rainfall Data, Journal of the Royal Statistical Society. Series A (General), 147(1), 1, doi:10.2307/2981736. Swift, L. W., and H. T. Schreuder (1981), Fitting Daily Precipitation Amounts Using the SB Distribution, Monthly Weather Review, 109(12), 2535–2540, doi:10.1175/15200493(1981)109<2535:FDPAUT>2.0.CO;2. Tadikamalla, P. R. (1980), A Look at the Burr and Related Distributions, International Statistical Review / Revue Internationale de Statistique, 48(3), 337–344. Todorovic, P., and D. A. Woolhiser (1975), A stochastic model of n-day precipitation., Journal of Applied Meteorology, 14, 17–24. Villarini, G., B.-C. Seo, F. Serinaldi, and W. F. Krajewski (2014), Spatial and temporal modeling of radar rainfall uncertainties, Atmospheric research, 135, 91–101. Waymire, E., and V. K. Gupta (1981), The mathematical structure of rainfall representations: 1. A review of the stochastic rainfall models, Water Resources Research, 17(5), 1261– 1272, doi:10.1029/WR017i005p01261. Wheater, H. S., R. E. Chandler, C. J. Onof, V. S. Isham, E. Bellone, C. Yang, D. Lekkas, G. Lourmas, and M.-L. Segond (2005), Spatial-temporal rainfall modelling for flood risk estimation, Stoch Environ Res Ris Assess, 19(6), 403–416, doi:10.1007/s00477-0050011-8. Wilks, D. S. (1998), Multisite generalization of a daily stochastic precipitation generation model, Journal of Hydrology, 210(1–4), 178–191, doi:10.1016/S00221694(98)00186-3. Wilks, D. S. (1999a), Simultaneous stochastic simulation of daily precipitation, temperature and solar radiation at multiple sites in complex terrain, Agricultural and Forest meteorology, 96(1), 85–101. Wilks, D. S. (1999b), Simultaneous stochastic simulation of daily precipitation, temperature and solar radiation at multiple sites in complex terrain, Agricultural and Forest Meteorology, 96(1–3), 85–101, doi:10.1016/S0168-1923(99)00037-4. Wilks, D. S., and R. L. Wilby (1999), The weather generation game: a review of stochastic weather models, Progress in physical geography, 23(3), 329–357. Wilson, P. S., and R. Toumi (2005), A fundamental probability distribution for heavy rainfall, Geophysical Research Letters, 32(14), L14812. Yao, A. Y. M. (1974), A Statistical Model for the Surface Relative Humidity, J. Appl. Meteor., 13(1), 17–21, doi:10.1175/1520-0450(1974)013<0017:ASMFTS>2.0.CO;2. Youngman, B. D., and D. B. Stephenson (2016), A geostatistical extreme-value framework for fast simulation of natural hazard events, in Proc. R. Soc. A, vol. 472, p. 20150855, The Royal Society.
10math.ST
Face Sketch Matching via Coupled Deep Transform Learning arXiv:1710.02914v1 [cs.CV] 9 Oct 2017 Shruti Nagpal1 , Maneet Singh1 , Richa Singh1,2 , Mayank Vatsa1,2 , Afzel Noore2 , and Angshul Majumdar1 1 IIIT-Delhi, India, 2 West Virginia University {shrutin, maneets, rsingh, mayank, angshul}@iiitd.ac.in, [email protected] Abstract Face sketch to digital image matching is an important challenge of face recognition that involves matching across different domains. Current research efforts have primarily focused on extracting domain invariant representations or learning a mapping from one domain to the other. In this research, we propose a novel transform learning based approach termed as DeepTransformer, which learns a transformation and mapping function between the features of two domains. The proposed formulation is independent of the input information and can be applied with any existing learned or hand-crafted feature. Since the mapping function is directional in nature, we propose two variants of DeepTransformer: (i) semi-coupled and (ii) symmetricallycoupled deep transform learning. This research also uses a novel IIIT-D Composite Sketch with Age (CSA) variations database which contains sketch images of 150 subjects along with age-separated digital photos. The performance of the proposed models is evaluated on a novel application of sketch-to-sketch matching, along with sketch-to-digital photo matching. Experimental results demonstrate the robustness of the proposed models in comparison to existing state-of-the-art sketch matching algorithms and a commercial face recognition system. (a) Viewed sketches (b) Forensic sketches Figure 1: Illustrating the variations in the information content of digital images and different types of sketches. and a sketch image of the suspect is created. Such a sketch drawn by an artist is termed as a hand-drawn sketch. To eliminate the inter-artist variations and automate the process of sketch generation, law enforcement agencies have started using software generated composite sketches. In such cases, the eyewitness is interviewed by an officer and a sketch is created using the drag-and-drop features available in sketch generation tools such as FACES [2], evoFIT [1] and IdentiKit [3]. As shown in Figure 1(a), the information content in the two domains/modalities (sketch and digital image) vary significantly. The digital image is an informationrich representation whereas, the sketch image contains only the edge information and lacks texture details. Figure 1(b) shows real world examples of forensic hand-drawn sketch and corresponding photo pairs. Along with domain differences, variations caused by eyewitness description makes this problem further challenging. Traditionally, a sketch image is matched with digital mugshot images for identifying the suspect. The literature is spread across hand-drawn and composite sketch to digital photo matching [30], with algorithms being evaluated [17, 23] on viewed sketches [18, 45, 49]. Viewed sketches are drawn while looking at the digital photos. Such sketches do not reflect real scenario and fail to capture the challenging nature of the problem. Choi et al. [8] have established the limitations of viewed sketches and emphasized the need for new databases and algorithms imitating real scenarios. 1. Introduction Face recognition systems have been evolving over the past few decades, particularly with the availability of large scale databases and access to sophisticated hardware. Large scale face recognition challenges such as MegaFace [13] and Janus [16] further provide opportunities for bridging the gap between unconstrained and constrained face recognition. However, the availability of new devices and applications continuously open new challenges. One such challenging application is matching sketches with digital face photos. In criminal investigations, eyewitnesses provide a first hand account of the event, along with a description of the appearance of the suspect based on their memory. A sketch artist interviews the eyewitness of a particular case 1 Sketch Authors (Year) Bhatt et al. [5] (2012) Khan et al. [14] (2012) Mignon et al.[26] (2012) Hand-drawn Klare et al. [15] (2013) Cai et al. [47] (2013) Tsai et al. [42] (2014) Lin et al. [23] (2016) Chugh et al. [9] (2013) Han et al. [11] (2013) Composite Mittal et al. [28] (2015) Mittal et al. [27] (2017) Klum et al. [18] (2014) Both Ouyang et al.[32] (2016) Feature Extraction Classification Proposed MCWLD Memetically optimized chi-squared distance Facial Self Similarity descriptor Nearest neighbor classifier Proposed Cross modal metric learning (CMML) MLBP, SIFT + Heterogenous Prototype Cosine similarity Coupled least squares regression method with a local consistency constraint Domain adaptation based proposed DiCA Subject-specific SVM Affine transformations CNNs over Mahalanobis and Cosine scores Histogram of image moments and HoG Chi-squared distance MLBP of ASM features Similarity on normalized histogram intersection Deep Boltzmann Machines Neural Networks HoG + DAISY Chi-squared distance + Attribute feedback SketchID- automated system based on holistic [15] and component [11] based algorithms Learned a mapping to reverse the forgetting process of the eyewitness Table 1: A brief literature review of sketch-to-photo matching problem. Table 1 summarizes the literature of facial sketch recognition which shows that both handcrafted and learned representation have been explored. Sketch recognition has traditionally been viewed as a domain adaptation task due to the cross-domain data. Such techniques can be applied for viewed sketch recognition, where the variations across different types of images is primarily governed by the changes in the domain. However, in case of forensic sketch matching for face images, there are several factors apart from the difference in domain which make the problem further challenging, such as memory gap [32] and the bias observed due to the eye-witness [28]. In this work, we propose a novel transform learning based formulation, DeepTransformer, which learns meaningful coupled representations for sketch and digital images. Further, two important and challenging application scenarios are used for performance evaluation: (i) age separated digital to sketch matching (both composite and hand-drawn) and (ii) sketch to sketch matching. The effectiveness of the proposed formulation is evaluated on hand-drawn and forensic sketch databases, including a novel sketch database. The key contributions are: • This is the first work incorporating the concept of Deep Learning in Transform Learning framework. Specifically, novel deep coupled transform learning formulations, Semi-Coupled and Symmetrically-Coupled Deep Transform Learning, have been presented which imbibe qualities of deep learning with domain adaption. • This is the first work which presents sketch to sketch matching as an important, yet unattended application for law enforcement. As shown in Figure 1, composite and hand-drawn sketches have significant difference in their information content. Such matching can be useful for crime linking, where different methods may have been used to generate the sketches. • IIIT-D CSA dataset 1 contains age-separated images of an individual against a sketch image, for 150 subjects. The dataset also contains 3529 digital images. 1 Dataset will be available at www.iab-rubric.org/resources/csa.html 2. Preliminaries Dictionary Learning has been used in literature to learn filters and feature representations [22, 31]. For a given input X, a dictionary D is learned along with the coefficients Z: 2 min kX − DZkF , such that kZk0 ≤ τ D, Z (1) where, the lo -norm imposes a constraint of sparsity on the learned coefficients. It can be observed that dictionary learning is a synthesis formulation; i.e., the learned coefficients and dictionary are able to synthesize the given input X. Ravishankar and Bresler [36] proposed it’s analysis equivalent, termed as transform learning. It analyzes the data by learning a transform or basis to produce coefficients. Mathematically, for input data X, it can be expressed as: 2 min kTX − ZkF , such that kZk0 ≤ τ T, Z (2) where, T and Z are the transform and coefficients, respectively. Relating transform learning to the dictionary learning formulation in Equation 1, it can be seen that dictionary learning is an inverse problem while transform learning is a forward problem. In order to avoid the degenerate solutions of Equation 2, the following formulation is proposed [36]:  2 2 min kTX − ZkF + λ  kTkF − log det T s.t. kZk0 ≤ τ T, Z (3) The factor ‘log det T’ refers to the log-determinant regularizer [20], which imposes a full rank on the learned transform to prevent degenerate solutions. The additional penalty term 2 kTkF is to balance scale. In literature, an alternating minimization approach has been presented [37, 38] to solve the above transform learning problem, i.e.: 2 (4)  2 2 T ← min kTX − ZkF + λ  kTkF − log det T (5) Z ← min kTX − ZkF , such that kZk0 ≤ τ Z T The coefficients in Equation 4 are updated using Orthogonal Matching Pursuit (OMP) [34], and transform matrix T is updated using a closed form solution presented in [40]. The proof for convergence of the update algorithm can be found in [38]. There is a computational advantage of transform learning over dictionary learning. The latter is a synthesis formulation, and during the test stage, for a given xtest it needs to solve a problem of the form: 2 min kxtest − Dztest kF , such that kztest k0 ≤ τ (6) ztest This is an iterative optimization problem, and thus time consuming, whereas, transform learning is an analysis framework, and at testing time, only the given equation is solved: 2 min kTxtest − ztest kF , such that kztest k0 ≤ τ (7) ztest This can be solved using one step of hard thresholding [6], making test feature generation very fast and real time. 3. DeepTransformer: Proposed Coupled Deep Transform Learning Transform Learning has been used for several applications such as blind compressive sensing, online learning, along with image and video de-noising [35, 39, 40]. This research addresses the challenging task of sketch recognition by proposing two novel formulations: semi-coupled, and symmetrically-coupled transform learning. This is the first work which incorporates a mapping function in the transform learning framework in order to reduce betweendomain variations. Further, both the models have been extended to propose Semi-Coupled DeepTransformer and Symmetrically-Coupled DeepTransformer. As a result of varying information content of images belonging to different domains, there is a need to reduce the domain gap while performing recognition. This is often achieved by mapping the information content of one domain’s data onto the other. In real world scenarios of photo to sketch matching, generally a probe sketch image is matched with a gallery of mugshot digital images. This presents the requirement of transforming data from one domain (sketch) onto the other (digital image). For such instances, where the data from only one domain is required to be mapped to the other, Semi-Coupled Transform Learning is proposed. Let X1 be the data of first domain and X2 be the data of second domain. The proposed model learns two transform matrices, T1 and T2 (one for each domain) and their corresponding features Z1 and Z2 , such that the features from the first domain can be linearly mapped (M) onto the other. Mathematically this is expressed as: 2 min 2 2 kT1 X1 − Z1 kF + kT2 X2 − Z2 kF 2 2 2 min kT1 X1 − Z1 kF + λ( kT1 kF − log det T1 ) (9) T1 Sub-Problem 2: 2 2 min kT2 X2 − Z2 kF + λ( kT2 kF − log det T2 ) (10) T2 The solution for Equations 9, 10 is similar to the one for Equation 5. Sub-Problem 3: 2 2 min kT1 X1 − Z1 kF + µ kZ2 − MZ1 kF Z1     2 (11) I T1 X1 − √ Z1 ≡ min √ Z1 µZ2 µM F Sub-Problem 4: 2 2 min kT2 X2 − Z2 kF + µ kZ2 − MZ1 kF Z2     2 T2 X2 I ≡ min √ − √ Z2 Z2 µMZ1 µI F (12) The above two equations are least square problems with a closed form solution, and thus can be minimized for feature representations Z1 and Z2 . Sub-Problem 5: 2 min kZ2 − MZ1 kF M (13) Finally, a mapping M is learned between the representations Z1 and Z2 by solving the above least square equation. 3.1. Semi-Coupled Deep Transform Learning T1 , T2 , Z1 , Z2 , M Equation 8 is solved using alternating minimization approach. Specifically, this equation can be decomposed into five sub-problems, one for each variable, and then each is solved individually, as explained below. Sub-Problem 1: + λ  kT1 kF +  kT2 kF − log det T1 − log det T2  2 + µ kZ2 − MZ1 kF (8) Inspired by the success of deep learning [12, 19, 41] to model high level abstractions and learn large variations in data, this research introduces deep transform learning. For a k-layered architecture, Semi-Coupled DeepTransformer can be expressed as: k  hX min kTj1 Ij1 − Zj1 k2F + kTj2 Ij2 − Zj2 k2F + θ +λ j=1 kTj1 k2F + kTj2 k2F − log det Tj1 − log det Tj2 i kZk2 − MZk1 k2F  + (14) where, θ = {∀kj=1 (Tj1 , Tj2 , Zj1 , Zj2 ), M}. (Tj1 , Ij1 , and Zj1 ) and (Tj2 , Ij2 , and Zj2 ) refer to the transform matrix, input, and learned representations of the j th layer for the two domains respectively. M refers to the learned linear mapping between the final representations of the k th layer (Zk1 , Zk2 ). The input to the model, I11 and I12 are X1 and X2 , i.e. training data of the first and second domains, respectively. For subsequent layers, Ij1 and Ij2 correspond to the feature representations learned at the previous layers, i.e. Zj−1 and 1 Zj−1 respectively. As we go deeper and increase the value 2 of k, Equation 14 can be solved similar to Equation 8. The problem can be divided into (4k)+1 sub-problems via alternating minimization approach: separate sub-problems for solving the transform matrices (2k), and the learned representations (2k), and one for the final mapping M. However, solving (4k)+1 sub-problems can be computationally expensive as the number of parameters is large. As a cost effective alternative, the proposed model can be learned with greedy layer-wise optimization. Here we explain the layerwise optimization for a 2-layered semi-coupled deep transform learning model (similar greedy layer-wise optimization can be followed for k > 2). Layer One: Learn the first layer transform matrices (T11 , T12 ) for both domains, along with the representations of the input data (Z11 , Z12 ):  2 2 min T11 X1 − Z11 F + λ  T11 F − log det T11 1 1 T1 , Z1 min 1 T1 2 , Z2 T12 X2 − 2 Z12 F 2 T12 F + λ  (15a)  − log det T12 (15b) Layer Two: Using the representations learned in the first layer as input, semi-coupled transform learning is applied at the second layer to obtain the transform matrices for the second layer, for both domains (T21 , T22 ): min 2 2 2 T2 1 , T2 , Z1 , Z2 , M + λ  T21 2 F T21 Z11 − Z21 +  T22 2 F 2 F + 2 F − log det T21 − log det T22 2 F + µ Z22 − MZ21 3.2. T22 Z12 − Z22 Symmetrically-Coupled Learning Deep  (16) Transform In real world scenarios, a given sketch image may be matched with a dataset of different type of sketches for crime-linking. In such cases, learning a single mapping function using semi-coupled transform learning may not be useful. For such cases, symmetrically-coupled transform learning is proposed, where two linear maps are learned; one from the first domain to the second one, and the other from the second domain to the first one. This leads to the following formulation: 2 2 kT1 X1 − Z1 kF + kT2 X2 − Z2 kF  2 2 + λ  kT1 kF +  kT2 kF − log det T1 − log det T2 2 2  + µ kZ2 − M1 Z1 kF + kZ1 − M2 Z2 kF (17) where, M2 and M1 correspond to the mapping matrices to transform feature representations of domain two into those of domain one, and vice versa, respectively. As before, with alternating minimization, Equation 17 can be optimin mized with the help of the following sub-problems: Sub-Problem 1: 2 2 2 2 min kT1 X1 − Z1 kF + λ( kT1 kF − log det T1 ) (18) T1 Sub-Problem 2: min kT2 X2 − Z2 kF + λ( kT2 kF − log det T2 ) (19) T2 Updates for the transform matrices (T1 , T2 ) remain the same as shown in Equations 9 and 10. Sub-Problem 3: 2 2 min kT1 X1 − Z1 kF + µ kZ2 − M1 Z1 kF Z1 (20) 2  + kZ1 − M2 Z2 kF Sub-Problem 4: 2 2 min kT2 X2 − Z2 kF + µ kZ2 − M1 Z1 kF Z2 (21) 2  + kZ1 − M2 Z2 kF The above two equations for learning the representations (Z1 , Z2 ) of the two domains are least square minimizations, and thus have closed form solutions. Sub-Problem 5: min kZ2 − M1 Z1 kF 2 (22) 2 (23) M1 Sub-Problem 6: min kZ1 − M2 Z2 kF M2 Similar to Equation 13, mappings (M1 , M2 ) can be learned by solving the above using least square minimization. As discussed, the DeepTransfomer is solved using alternating minimization approach. Each of the subproblems of Equations 8 and 17 are solved with guaranteed convergence [36]. Specifically, learning Z has analytical solution and transform updates are done by conjugate gradients which can only decrease. Overall, the model has monotonically decreasing cost function and therefore, will converge. We extend Equation 17 and propose symmetrically-coupled deep transform learning where, θ = {∀kj=1 (Tj1 , Tj2 , Zj1 , Zj2 ), M1 , M2 }, and M2 and M1 correspond to the mapping matrices to transform feature representations of domain two into those of domain one, and vice versa, respectively. It is mathematically expressed as: k  hX min kTj1 Ij1 − Zj1 k2F + kTj2 Ij2 − Zj2 k2F + θ T1 , T2 , Z1 , Z2 , M1 , M2 +λ j=1 + kTj2 k2F − log det Tj1 − log det Tj2 i kZk2 − M1 Zk1 k2F + kZk1 − M2 Zk2 k2F kTj1 k2F  + (24) This formulation can be solved using alternating minimization approach with (4k+2) sub-problems where the last two sub-problems are related to learning mappings M1 and M2 . However, like Semi-Coupled DeepTransformer, we optimize symmetrically coupled deep transform algorithm in a greedy layer wise manner. The optimization for a 2layer Symmetrically-Coupled DeepTransformer is as follows: Layer One:  1 1 2 1 2 1 + λ  T − log det T min T X − Z 1 1 1 1 1 F F 1 1 T1 , Z1 min 1 T1 2 , Z2 T12 X2 − 2 Z12 F + λ  2 T12 F (25a)  − log det T12 (25b) Figure 2: Sample images from the IIIT-D CSA database showing a sketch and age-separated face images of two subjects. Layer Two: min 2 2 2 T2 1 , T2 , Z1 , Z2 , M + λ  T21 2 F T21 Z11 − Z21 +  T22 2 F + µ( Z22 − M1 Z21 2 F + T22 Z12 − Z22 2 F − log det T21 − log det T22 2 F + Z21 − M2 Z22  2 ) F (26) The first layer learns the low level representation of each domain independently, while the second layer learns the high level representations and mapping between the representations of the two domains/modalities. The proposed model thus encodes domain specific features, followed by features incorporating the between-domain variations. 3.3. DeepTransformer for Sketch Recognition The proposed two layer DeepTransformer is used for performing face sketch matching. For semi-coupled DeepTransformer, the following steps are performed: Training: Given a set of sketch and digital training pairs, Xs , Xd , transform matrices (T1s , T1d , T2s , T2d ) and coefficient vectors (Z1s , Z1d , Z2s , Z2d ) are learned using Equation 14, along with a mapping, M, between Z2s , Z2d . A two hidden layer neural network classifier is trained to make identification decisions. Testing: For a given probe sketch image, xsT est , the first and second layer feature representations are extracted using the learned transform spaces: 1 1 2 2 1 zsT est = Ts xsT est ; zsT est = Ts zsT est (27) The mapping M is used to transform the feature vector onto 2 2 the digital image space, i.e, zdT est = M1 zsT est . The feature representation of the sketch (probe) in the digital image feature space, zdT est is now used for performing recognition using the trained neural network. For sketch to sketch matching (i.e. cases where mappings to and from different modalities are required), similar steps can be followed for utilizing symmetrically-coupled deep transform learning. 4. Databases and Experimental Protocol Face sketch databases [18, 45] generally comprise of viewed sketches, either hand-drawn or composite. Viewed sketches are created by looking at a digital image and sketching it simultaneously. This fails to capture the uncertainty in the recall process that humans encounter or the variations in characteristics, like a hairstyle modification, that are generally present between a sketch and digital image acquired at different times. In this research, we utilize a novel IIIT- D Composite Sketch with Age variations (CSA) dataset [10], which is the first publicly available dataset containing multiple age-separated digital images for a given sketch image. Inspired by Bhatt et al. [5], the human forgetting process is incorporated by creating semi-forensic composite sketches. The user is shown the digital image of a subject for a few minutes, and is asked to create the composite sketch after a period of 30 minutes based on his/her memory. The database consists of 3529 sketches and digital face images pertaining to 150 individuals. Out of the 150 subjects, 52 are selected from the FG-NET Aging Database [21], 82 are selected from IIIT-D Aging Database [48], and the remaining subjects are collected from the Internet. The composite sketch images are created using FACES [2], a popular software to generate photo-like composite sketches. In IIIT-D CSA dataset, the digital images span over an age range of 1 to 65 years. For each subject, an image is chosen from the middle of his/her age range and a corresponding sketch image is generated. Following this, each subject’s digital images are divided into three categories: (i) Younger age group: This category models the scenario when the digital images (gallery) are younger than the probe sketch image. This set contains 1713 digital images. (ii) Same age group: This category represents the scenario when the age of an individual is similar in both digital image (gallery) and sketch image (probe). A total of 150 digital images exist in this set. (iii) Older age group: This category imitates the scenario when the digital images (gallery) of the individuals are at an age older than the sketch. It consists of 1516 digital images. Overall, IIIT-D CSA consists of 150 composite sketch images, one for each subject, and 3379 digital images belonging to different age categories. Figure 2 shows sample images from the dataset. Protocol Gallery Type Probe (Sketch) Databases for Feature Learning Test Database No. of Training Pairs Size of Size of Gallery Probe Matching sketch to age-separated digital images: Semi-Coupled DeepTransformer P1 P2 P3 P4 P5 P6 P7 Younger age images Composite CSA 2129 CUFS, CUFSF, Same age images Composite CSA 2129 e-PRIP, Older age images Composite CSA 2129 PRIP-VSGC, Composite CSA 2129 IIIT-D Viewed Large-scale image Forensic IIIT-D Forensic 2129 and Semi-viewed dataset Sketch to sketch matching: Symmetrically-Coupled DeepTransformer Composite Hand-drawn Hand-drawn Composite CUFS, e-PRIP CUFS, e-PRIP CUFS, e-PRIP CUFS, e-PRIP 50 50 875 90 1044 7165 7265 90 90 90 90 190 73 73 73 73 Table 2: Details of experimental protocols. For P6-P7, unseen training and testing partitions are used from the CUFS and e-PRIP datasets (both contain sketches pertaining to AR dataset). Apart from IIIT-D CSA, we have also used viewed hand-drawn sketch and digital image pairs from CUHK Face Sketch Dataset (CUFS) [45] (311 pairs of students and AR dataset [25]), CUHK Face Sketch FERET Dataset (CUFSF) [49] (1194 pairs), and IIIT-D Sketch dataset [5]. IIIT-D dataset contains viewed (238 pairs), semi-viewed (140 pairs), and forensic sketches (190 pairs). Composite sketches from PRIP Viewed Software-Generated Composite database (PRIP-VSGC) [18] and extended-PRIP Database (e-PRIP) [29] (Indian user set) are also used. Experimental Protocol: To evaluate the efficacy of the proposed formulations two challenging problems are considered: sketch matching against age-separated digital images (semi-coupled DeepTransformer) and sketch to sketch matching (symmetrically coupled DeepTransformer). Since this is the first research that focuses on sketch to sketch matching, as well as sketch to age-separated digital matching, we have created seven different experimental protocols to understand the performance with individual cases. These protocols are classified according to the two case studies and the details are summarized in Table 2. 1. Matching Sketch to Age-Separated Digital Images: CSA test set and IIITD Forensic hand-drawn database have been used to evaluate the performance of the proposed model. Inspired from real life scenarios, the test set is divided into a gallery and probe set. The gallery contains the digital images while the probe contains the sketch image. The first three protocols evaluate the effect of age difference on the recognition performance, and the next two protocols (P4 and P5) analyze the difference in performance on matching forensic and composite sketches with large scale digital image gallery. Since sketch to digital image matching experiment involves one way mapping, the results are demonstrated with Semi-Coupled DeepTransformer. 2. Sketch to Sketch Matching: In real world crime scene linking application, one might want to match a hand-drawn sketch against a database of composite sketches, or the other way around. Therefore, for this experiment, the proposed Symmetrically-Coupled DeepTransformer is used. CUFS dataset contains hand-drawn sketch images for the AR dataset (123 subjects), while e-PRIP contains composite sketches generated by a sketch artist for the same. The following two experiments with protocols P6 and P7 are performed: (i) composite to hand-drawn sketch, and (ii) handdrawn to composite sketch matching. 5. Results and Observations Effectiveness of DeepTransformer is evaluated with multiple input features, namely Dense Scale Invariant Feature Transform (DSIFT) [7], Dictionary Learning (DL) [22], Class Sparsity based Supervised Encoder (L-CSSE) [24], Light CNN [46], and VGG-Face [33]. To analyze the effect of depth in this formulation, the results are computed with single layer (low level features) and with two layers (high level features) of DeepTransformer. Two kinds of comparative experiments are performed. The first one compares the performance of one layer and two layers deep transform learning algorithms with two classifiers, i.e., Euclidean distance and neural network. The second comparison is performed with existing algorithms like SemiCoupled Dictionary Learning algorithm (SCDL) [44] and Multi-Modal Sharable and Specific feature learning algorithm (MMSS) [43]. Both the techniques have been used in literature for performing cross-domain recognition, wherein the former is a coupled dictionary learning based approach (synthesis technique), and the latter incorporated transform learning with convolutional neural networks for addressing cross-domain recognition. Comparison has also been drawn with state-of-the-art sketch recognition algorithms, namely MCWLD [5] and GSMFL [23], and a commercial-off-theshelf system (COTS), Verilook [4]. In all the experiments, for training the networks, data augmentation is performed on the gallery images to increase per-class samples by varying the illumination and flipping the images along the yaxis. The key observations from experimental results are: Performance with Different Features: Tables 4 and 3 present the rank-10 identification accuracies of DeepTrans- former with different features, for both applications of sketch matching: sketch to sketch matching and sketch to photo matching. Table 3 presents the accuracies for sketch to digital image matching, where the proposed SemiCoupled DeepTransformer has been used. The results show that DeepTransformer enhances the performance of existing feature extraction techniques by at least 10% as compared to Euclidean distance matching, and at most 22% when neural network (NNET) is used for classification. Upon comparing accuracies across features, it is observed that DeepTransformer achieves the best results with L-CSSE features for all protocols. Similar results can be seen from Table 4 where Symmetrically-Coupled DeepTransformer has been used for sketch to sketch matching. Experimentally, it can be observed that providing class-specific features to DeepTransformer results in greater improvement. L-CSSE is a supervised deep learning model built over an autoencoder. The model incorporates supervision by adding a l2,1 norm regularizer during the feature learning to facilitate classspecific feature learning. The model utilizes both global and local facial regions to compute feature vector and has been shown to achieve improved results for existing face recognition problems. Further, we also observe that L-CSSE encodes the high frequency features in both local and global regions which are pertinent to digital face to sketch matching. Moreover, improved performance is observed for handcrafted, as well as representation learning based features, thus promoting the use of DeepTransformer for different types of feature extraction techniques and input data. Comparison with Existing Approaches: Table 5 shows that the proposed, DeepTransformer with L-CSSE features outperforms existing algorithms for both the applications of sketch recognition. In case of sketch to digital image matching, with younger age protocol (P1), Semi-Coupled DeepTransformer attains a rank-10 accuracy of 42.6%, which is at least 15% better than existing algorithms, and around 24% better than COTS. Similar trends are observed for P2 and P3 protocols, where the proposed DeepTransformer outperforms existing techniques and the commercial-offthe-shelf system by a margin of at least 13% and 11% respectively. Additionally, the matching accuracy achieved by the proposed Symmetrically-Coupled DeepTransformer exceeds existing techniques for the task of sketch to sketch matching as well (P6, P7). An improvement of at least 14% and at most 20% is seen with the proposed DeepTransformer (L-CSSE as feature) for the given protocols. This accentuates the use of DeepTransformer for addressing the problem of real world sketch matching. Effect of Layer-by-Layer Training and Number of Layers: We compare the performance of the proposed DeepTransformer with and without layer-by-layer training (i.e. Equations 14 and 24 for direct solving for k = 2 and layerby-layer training as per Equations 15-16 and 25-26). On Euclidean Distance Features NNET DeepTransformer 1-Layer 2-Layer Gallery with Younger Age Digital Images (P1) DSIFT DL VGG Light CNN L-CSSE 8.9 2.2 1.1 8.9 14.4 15.6 14.4 11.1 12.2 19.7 26.7 17.8 12.2 30.0 34.1 27.8 17.8 12.2 27.8 42.6 Gallery with Same Age Digital Images (P2) DSIFT DL VGG Light CNN L-CSSE 7.8 1.1 2.2 11.1 16.3 26.7 13.3 12.2 25.6 30.2 25.6 15.6 14.4 32.2 37.7 27.8 17.8 14.4 34.4 44.2 Gallery with Older Age Digital Images (P3) DSIFT DL VGG Light CNN L-CSSE 5.6 2.2 2.2 7.8 9.9 21.1 13.3 11.1 20.0 20.0 23.3 17.8 12.2 24.4 28.9 24.4 18.9 12.2 28.9 36.0 Table 3: Rank-10 accuracies (%) for protocols P1 to P3 using proposed Semi-Coupled DeepTransformer. a 108-core server with 256GB RAM, for protocols P1 to P3, training Semi-Coupled DeepTransformer with layer-bylayer training requires 142 seconds which is 12 seconds faster than without layer-by-layer training. For both the cases, for k = 2, the rank-10 accuracies are same which shows that layer-by-layer training is cost effective. We also analyze the effect of number of layers and, as shown in Tables 4 and 3, 1-8% improvement in rank-10 accuracy is observed for different protocols upon going deeper. Performance on Large-Scale Dataset: The performance of the proposed DeepTransformer has also been evaluated for a large-scale real world dataset using protocols P4 and P5. Figure 3 presents the Cumulative Match Characteristic curves (CMCs) for IIIT-D CSA composite and IIIT-D Forensic hand-drawn sketch database respectively. The proposed Semi-Coupled DeepTransformer achieves a rank-50 accuracy of 33.7%, which is an improvement of at least 5% from other algorithms on IIIT-D CSA dataset. Similar results can be observed on the forensic sketches as well. The experimental results showcase the efficacy of the proposed DeepTransformer, in terms of the improvement in identification accuracies with different features, and in comparison with other existing models. The results suggest that the DeepTransformer is robust to the type of feature and has the ability to learn over varying input spaces. Moreover, efficient training of the symmetrically coupled DeepTransformer with as few as 50 digital-sketch pairs (P6 and P7) motivate the use of the proposed architecture for small sample size problems as well. The evaluation on different real world protocols further strengthens the usage of the pro- Gallery: Composite, Probe: Hand-drawn (P6) Features DSIFT DL VGG Light CNN L-CSSE Euclidean Distance 4.1 4.1 6.9 8.2 10.9 Gallery: Hand-drawn, Probe: Composite (P7) Euclidean Distance 2.7 6.9 6.9 8.2 10.9 DeepTransformer 1-Layer 2-Layer 24.7 28.8 17.8 19.2 24.7 27.4 26.0 30.1 28.4 31.5 NNET 16.4 15.1 12.3 15.1 17.8 DeepTransformer 1-Layer 2-Layer 23.3 30.1 19.2 20.6 19.2 20.6 20.6 28.8 31.5 33.6 NNET 13.7 16.4 15.1 16.4 20.9 Table 4: Rank-10 accuracies (%) for sketch to sketch matching (P6, P7) using Symmetrically-Coupled DeepTransformer. MCWLD [5] GSMFL [23] SCDL [44] MMSS [43] Verilook (COTS) [4] DeepTransformer (with L-CSSE) P1 P2 P3 P6 P7 26.8 25.2 23.3 22.2 17.8 42.6 30.7 29.3 25.6 27.8 16.6 44.2 24.4 23.3 18.9 21.1 12.2 36.0 16.5 16.5 15.1 13.3 10.9 31.5 19.2 19.2 13.7 15.1 13.7 33.6 Table 5: Rank-10 accuracies (%) comparing proposed DeepTransformer with existing algorithms and COTS. 40 MCWLD GSMFL Verilook DeepTransformer 35 30 Identification Accuracy (%) Algorithm 25 20 15 10 posed model for addressing cross domain matching tasks. 5 5 10 15 20 6. Conclusion 7. Acknowledgment This research is partially supported by MEITY (Government of India), India. M. Vatsa, R. Singh, and A. Majumdar are partially supported through Infosys Center for Artificial Intelligence. S. Nagpal is partially supported through TCS PhD Fellowship. The authors acknowledge T. Chugh for his help in database creation. R. Singh also thank NVIDIA Corp. for Tesla K40 GPU for research. 30 35 40 45 50 30 35 40 45 50 40 MCWLD GSMFL Verilook DeepTransformer 35 30 Identification Accuracy (%) This research focuses on the challenging problem of face sketch recognition and proposes a novel transform learning based formulation, called as DeepTransformer. Two models: Semi-Coupled and Symmetrically-Coupled DeepTransformer have been presented, both of which aim to reduce the variations between two domains. The highlight of the proposed formulation is that it provides the flexibility of using an existing feature extractor and classifier in the framework. The proposed DeepTransfomer is evaluated with real world scenarios of age-separated digital image to sketch matching and sketch to sketch matching. Results are also shown on the IIIT-D Composite Sketch with Age variations database of 150 subjects. Comparison with existing state-of-the-art algorithms and commercial-off-theshelf system further instantiates the efficacy of both the semi-coupled and symmetrically coupled variants of the purposed DeepTransformer. 25 Rank 25 20 15 10 5 5 10 15 20 25 Rank Figure 3: CMC curves for P4 and P5 experiments: (a) CSA, and (b) IIIT-D Forensic datasets. References [1] evofit. http://www.evofit.co.uk/. 1 [2] Faces. http://www.facesid.com/products.html. 1, 5 [3] Identi-kit. http://identikit.net/. 1 [4] Verilook. 6, 8 http://www.neurotechnology.com/verilook.html. [5] H. S. Bhatt, S. Bharadwaj, R. Singh, and M. Vatsa. Memetically optimized mcwld for matching sketches with digital face images. IEEE Transactions on Information Forensics and Security, 7(5):1522–1535, 2012. 2, 5, 6, 8 [6] T. Blumensath and M. E. Davies. Iterative thresholding for sparse approximations. Journal of Fourier Analysis and Applications, 14(5-6):629–654, 2008. 3 [7] A. Bosch, A. Zisserman, and X. Muñoz. Image classification using random forests and ferns. In IEEE International Conference on Computer Vision, pages 1–8, 2007. 6 [8] J. Choi, A. Sharma, D. W. Jacobs, and L. S. Davis. Data insufficiency in sketch versus photo face recognition. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, pages 1–8, 2012. 1 [9] T. Chugh, H. S. Bhatt, R. Singh, and M. Vatsa. Matching age separated composite sketches and digital face images. In IEEE International Conference on Biometrics: Theory, Applications and Systems, pages 1–6, 2013. 2 [10] T. Chugh, M. Singh, S. Nagpal, R. Singh, and M. Vatsa. Transfer learning based evolutionary algorithm for composite face sketch recognition. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2017. 5 [11] H. Han, B. F. Klare, K. Bonnen, and A. K. Jain. Matching composite sketches to face photos: A Component-Based Approach. IEEE Transactions on Information Forensics and Security, 8(1):191–204, 2013. 2 [12] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. 3 [13] I. Kemelmacher-Shlizerman, S. M. Seitz, D. Miller, and E. Brossard. The MegaFace benchmark: 1 million faces for recognition at scale. CoRR, abs/1512.00596, 2015. 1 [14] Z. Khan, Y. Hu, and A. Mian. Facial self similarity for sketch to photo matching. In International Conference on Digital Image Computing Techniques and Applications, pages 1–7, 2012. 2 [15] B. Klare and A. K. Jain. Heterogeneous face recognition using kernel prototype similarities. IEEE Transactions on Pattern Analysis Machine Intelligence, 35(6):1410–1422, 2013. 2 [16] B. F. Klare, B. Klein, E. Taborsky, A. Blanton, J. Cheney, K. Allen, P. Grother, A. Mah, M. J. Burge, and A. K. Jain. Pushing the frontiers of unconstrained face detection and recognition: IARPA Janus Benchmark A. In IEEE Conference on Computer Vision and Pattern Recognition, pages 1931–1939, 2015. 1 [17] B. F. Klare, Z. Li, and A. Jain. Matching forensic sketches to mug shot photos. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(3):639–646, 2011. 1 [18] S. J. Klum, H. Han, B. F. Klare, and A. K. Jain. The facesketchid system: Matching facial composites to mugshots. IEEE Transactions on Information Forensics and Security, 9(12):2248–2263, 2014. 1, 2, 5, 6 [19] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105. 2012. 3 [20] B. Kulis, M. Sustik, and I. Dhillon. Learning low-rank kernel matrices. In International Conference on Machine Learning, pages 505–512, 2006. 2 [21] A. Lanitis. Comparative evaluation of automatic ageprogression methodologies. EURASIP Journal on Advances in Signal Processing, pages 101:1–101:10, 2008. 5 [22] D. D. Lee and H. S. Seung. Learning the parts of objects by nonnegative matrix factorization. Nature, 401:788–791, 1999. 2, 6 [23] L. Lin, G. Wang, W. Zuo, X. Feng, and L. Zhang. Crossdomain visual matching via generalized similarity measure and feature learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1089–1102, 2017. 1, 2, 6, 8 [24] A. Majumdar, R. Singh, and M. Vatsa. Face verification via class sparsity based supervised encoding. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1273– 1280, 2017. 6 [25] A. Martı́nez and R. Benavente. The AR face database. Technical Report 24, Computer Vision Center, 1998. 6 [26] A. Mignon and F. Jurie. CMML: A New Metric Learning Approach for Cross Modal Matching. In Asian Conference on Computer Vision, page 14, 2012. 2 [27] P. Mittal, A. Jain, G. Goswami, M. Vatsa, and R. Singh. Composite sketch recognition using saliency and attribute feedback. Information Fusion, 33:86–99, 2017. 2 [28] P. Mittal, M. Vatsa, and R. Singh. Composite sketch recognition via deep network - a transfer learning approach. In International Conference on Biometrics, pages 251–256, 2015. 2 [29] P. Mittal, M. Vatsa, and R. Singh. Composite sketch recognition via deep network - a transfer learning approach. In International Conference on Biometrics, pages 251–256, 2015. 6 [30] S. Nagpal, M. Vatsa, and R. Singh. Sketch recognition: What lies ahead? Image and Vision Computing, 55, Part 1:9 – 13, 2016. 1 [31] B. A. Olshausen and D. J. Field. Sparse coding with an overcomplete basis set: A strategy employed by v1? Vision Research, 37(23):3311 – 3325, 1997. 2 [32] S. Ouyang, T. M. Hospedales, Y. Z. Song, and X. Li. Forgetmenot: Memory-aware forensic facial sketch matching. In IEEE Conference on Computer Vision and Pattern Recognition, pages 5571–5579, 2016. 2 [33] O. M. Parkhi, A. Vedaldi, and A. Zisserman. Deep face recognition. In British Machine Vision Conference, 2015. 6 [34] Y. C. Pati, R. Rezaiifar, and P. S. Krishnaprasad. Orthogonal matching pursuit: Recursive function approximation with applications to wavelet decomposition. In Conference on Signals, Systems and Computers, pages 1–3, 1993. 2 [35] L. Pfister and Y. Bresler. Automatic parameter tuning for image denoising with learned sparsifying transforms. In IEEE International Conference on Acoustics, Speech and Signal Processing, pages 6040–6044, 2017. 3 [36] S. Ravishankar and Y. Bresler. Learning sparsifying transforms. IEEE Transactions on Signal Processing, 61(5):1072–1086, 2013. 2, 4 [37] S. Ravishankar and Y. Bresler. Efficient blind compressed sensing using sparsifying transforms with convergence guarantees and application to magnetic resonance imaging. SIAM Journal on Imaging Sciences, 8(4):2519–2557, 2015. 2 [38] S. Ravishankar and Y. Bresler. Online sparsifying transform learning 2014; Part II: Convergence Analysis. IEEE Journal of Selected Topics in Signal Processing, 9(4):637–646, 2015. 2, 3 [39] S. Ravishankar and Y. Bresler. Data-driven learning of a union of sparsifying transforms model for blind compressed sensing. IEEE Transactions on Computational Imaging, 2(3):294–309, 2016. 3 [40] S. Ravishankar, B. Wen, and Y. Bresler. Online sparsifying transform learning 2014; part I: Algorithms. IEEE Journal of Selected Topics in Signal Processing, 9(4):625–636, 2015. 2, 3 [41] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. 3 [42] Y. H. Tsai, H. M. Hsu, C. A. Hou, and Y. C. F. Wang. Person-specific domain adaptation with applications to heterogeneous face recognition. In IEEE International Conference on Image Processing, pages 338–342, 2014. 2 [43] A. Wang, J. Cai, J. Lu, and T.-J. Cham. MMSS: Multi-modal sharable and specific feature learning for rgb-d object recognition. In The IEEE International Conference on Computer Vision, 2015. 6, 8 [44] S. Wang, L. Zhang, Y. Liang, and Q. Pan. Semi-coupled dictionary learning with applications to image super-resolution and photo-sketch synthesis. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2216–2223, 2012. 6, 8 [45] X. Wang and X. Tang. Face photo-sketch synthesis and recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(11):1955–1967, 2009. 1, 5, 6 [46] X. Wu, R. He, and Z. Sun. A lightened CNN for deep face representation. CoRR, abs/1511.02683, 2015. 6 [47] C. Xinyuan, W. Chunheng, X. Baihua, C. Xue, L. Zhijian, and S. Yanqin. Coupled latent least squares regression for heterogeneous face recognition. In IEEE International Conference on Image Processing, pages 2772–2776, 2013. 2 [48] D. Yadav, R. Singh, M. Vatsa, and A. Noore. Recognizing age-separated face images: Humans and machines. PLoS ONE, 9, 2014. 5 [49] W. Zhang, X. Wang, and X. Tang. Coupled informationtheoretic encoding for face photo-sketch recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pages 513–520, 2011. 1, 6
1cs.CV
This article has been first published in International Journal of Computer Vision, vol. 114, no. 2, pp. 168–194, 2015. The final publication is available at Springer via http://dx.doi.org/10.1007/s11263-015-0799-8. Efficient Dictionary Learning with Sparseness-Enforcing Projections arXiv:1604.04767v1 [cs.LG] 16 Apr 2016 Markus Thom · Matthias Rapp · Günther Palm Abstract Learning dictionaries suitable for sparse coding instead of using engineered bases has proven effective in a variety of image processing tasks. This paper studies the optimization of dictionaries on image data where the representation is enforced to be explicitly sparse with respect to a smooth, normalized sparseness measure. This involves the computation of Euclidean projections onto level sets of the sparseness measure. While previous algorithms for this optimization problem had at least quasi-linear time complexity, here the first algorithm with linear time complexity and constant space complexity is proposed. The key for this is the mathematically rigorous derivation of a characterization of the projection’s result based on a soft-shrinkage function. This theory is applied in an original algorithm called Easy Dictionary Learning (EZDL), which learns dictionaries with a simple and fast-to-compute Hebbian-like learning rule. The new algorithm is efficient, expressive and particularly simple to implement. It is demonstrated that despite its simplicity, the proposed learning algorithm is able to generate a rich variety of dictionaries, in particular a topographic organization of atoms or separable atoms. Further, the dictionaries are as expressive as those of benchmark learning algorithms in terms of the reproduction quality on entire images, and result in an equivalent denoising performance. EZDL learns approximately 30 % faster than the already very efficient Online Dictionary Learning algorithm, and is Communicated by Julien Mairal, Francis Bach, Michael Elad. M. Thom (B) driveU / Institute of Measurement, Control and Microtechnology Ulm University, 89081 Ulm, Germany e-mail: [email protected] M. Rapp driveU / Institute of Measurement, Control and Microtechnology Ulm University, 89081 Ulm, Germany e-mail: [email protected] G. Palm Institute of Neural Information Processing Ulm University, 89081 Ulm, Germany e-mail: [email protected] therefore eligible for rapid data set analysis and problems with vast quantities of learning samples. Keywords Sparse coding · Sparse representations · Dictionary learning · Explicit sparseness constraints · Sparseness-enforcing projections 1 Introduction In a great variety of classical machine learning problems, sparse solutions are attractive because they provide more efficient representations compared to non-sparse solutions. There is an overwhelming evidence that mammalian brains respect the sparseness principle (Laughlin and Sejnowski 2003), which holds true especially for the mammalian visual cortex (Hubel and Wiesel 1959; Olshausen and Field 1996, 1997). It suggests itself that sparseness be a fundamental prior to a variety of signal processing tasks. In particular, this includes low-level image processing since natural images can be represented succinctly using structural primitives (Olshausen and Field 1997; Mairal et al. 2009b). Interesting and biologically plausible sparse representations were discovered through computer simulations on natural images (Olshausen and Field 1996, 1997). Related representations can be obtained by analysis of temporal image sequences (van Hateren and Ruderman 1998; Olshausen 2003), stereo image pairs and images with chromatic information (Hoyer and Hyvärinen 2000), or by enforcing a topographic organization (Hyvärinen et al. 2001; Kavukcuoglu et al. 2009). Sparseness alleviates the effects of random noise in a natural way since it prevents arbitrary combinations of measured signals (Donoho 1995; Hyvärinen 1999; Elad 2006). In fact, methods based on sparse representations were shown to achieve state-of-the-art performance for image denoising (Mairal et al. 2009b). Further notable image processing applications that benefit from the efficiency gained through sparseness are as diverse as deblurring (Dong et al. 2011), super-resolution (Yang et al. 2010, 2012; Dong et al. 2011), compression (Skretting and Engan 2011; Horev et al. 2012), and depth estimation (Tošić et al. 2011). 2 Thom, Rapp, and Palm 1.0 0.8 0.5 0.6 0.0 0.4 -0.5 -1.0 -1.0 0.2 Sparseness σ(x1, x2) Second Coordinate x2 1.0 0.0 -0.5 0.0 0.5 First Coordinate x1 1.0 Fig. 1 Visualization of Hoyer’s sparseness measure σ . The abscissa and the ordinate specify the entries of a two-dimensional vector, the obtained sparseness degree is color coded. The dashed lines are contour levels at intervals of 0.25. 1.1 Dictionary Learning and Sparseness Measures Each of these tasks needs a model capable of reproducing the signals to be processed. In a linear generative model for sparse coding, a sample x ∈ Rd with d features should be expressed approximately as a linear combination of only a few atoms of a larger dictionary: x ≈ W h, where W ∈ R d×n 1.2 Explicit Sparseness Constraints and Projections n and h ∈ R is sparsely populated. Here, W is the dictionary which is fixed for all samples, and h is a sparse code word that depends on the concrete sample. The n columns of W represent the atoms, which are also called bases or filters. This sparse coding framework is well-suited for overcomplete representations where n  d. The dictionary can be generated by wavelets, for example, or adapted to a specific task by solving an optimization problem on measurement data. The latter is also called dictionary learning in this context. Sparseness acts as a regularizer. If h was not constrained to sparseness, then trivial choices of W would suffice for perfect reproduction capabilities. But when h is sparse, then x can be represented by additive superposition of only a small number of bases, thus preventing trivial solutions. A fundamental problem when working with sparse representations is how to decide on a function that formally assesses the sparseness of a vector. The L0 pseudo-norm k·k0 : Rn → {0, . . . , n}, Here, k·k1 and k·k2 denote the Manhattan norm and the Euclidean norm, respectively. The normalization has been designed such that σ attains values between zero and one. When x ∈ Rn satisfies σ (x) = 1, then all entries of x but one vanish. Conversely, when σ (x) = 0, then all the entries of x are equal. The function σ interpolates smoothly between these extremes, see Fig. 1. Moreover, it is scale-invariant so that the same sparseness degree is obtained when a vector is multiplied with a nonzero number. Hence if a quantity is given in other units, for example in millivolts instead of volts, no adjustments whatsoever have to be made. The sparseness degree with respect to σ does not change much if a small amount is added to all entries of a vector, whereas the L0 pseudo-norm would indicate that the new vector is completely non-sparse. These properties render Hoyer’s sparseness measure intuitive, especially for nonexperts. It has been employed successfully for dictionary learning (Hoyer 2004; Potluru et al. 2013), and its smoothness results in improved generalization capabilities in classification tasks compared to when the L0 pseudo-norm is used (Thom and Palm 2013). x 7→ |{ i ∈ {1, . . . , n} | xi 6= 0 }| , simply counts the nonzero entries of its argument. It is a poor choice since it is non-continuous, prone to random noise and fails to fulfill desirable properties of meaningful sparseness measures (Hurley and Rickard 2009). Throughout this paper, we will use the smooth, normalized sparseness measure σ proposed by Hoyer (2004): √ n − kxk1/kxk2 n √ σ : R \ { 0 } → [0, 1] , x 7→ . n−1 A common approach to dictionary learning is the minimization of the reproduction error between the original samples from a learning set and their approximations provided by a linear generative model under sparseness constraints (Olshausen and Field 1996, 1997; Kreutz-Delgado et al. 2003; Mairal et al. 2009a). It is beneficial for practitioners and endusers to enforce explicit sparseness constraints by demanding that all the code words h in a generative model possess a target sparseness degree of σH ∈ (0, 1). This leads to optimization problems of the form min kx −W hk22 so that σ (h) = σH . W, h Here, the objective function is the reproduction error implemented as Euclidean distance. Implicit sparseness constraints, on the other hand, augment the reproduction error with an additive penalty term, yielding optimization problems such as min kx −W hk22 + λ khk1 . W, h Here, λ > 0 is a trade-off constant and the Manhattan norm is used to penalize non-sparse code words as convex relaxation of the L0 pseudo-norm (Donoho 2006). Trading off the reproduction error against an additive sparseness penalty is non-trivial since the actual resulting code word sparseness cannot easily be predicted. Explicit constraints guarantee that the adjusted sparseness degree is met, making tuning of intransparent scale factors such as λ Efficient Dictionary Learning with Sparseness-Enforcing Projections in the example above obsolete. This way, one can concentrate on the actual application of the theory rather than having to develop an intuition of the meaning of each and every parameter. The mathematical tool to achieve explicit sparseness is a sparseness-enforcing projection operator. This is a vectorvalued function which maps any given point in Euclidean space to its nearest point that achieves a pre-set target sparseness degree. One use case of this theory is projected gradient methods (Bertsekas 1999), where a given objective function should be optimized subject to hard side conditions. Replacing the parameters with their best approximations lying in a certain set after each update step ensures that the constraints are satisfied during optimization progress. 3 the computation of the projection’s gradient during learning, which is feasible yet difficult to implement and has nonnegligible adverse effects on the execution time. The following approaches consider explicit L0 pseudonorm constraints: Aharon et al. (2006), Skretting and Engan (2010) and Coates and Ng (2011) infer sparse code words in each iteration compatible to the data and dictionary by employing basis pursuit or matching pursuit algorithms, which has a negative impact on the processing time. Zelnik-Manor et al. (2012) consider block-sparse representations, here the signals are assumed to reside in the union of few subspaces. Duarte-Carvajalino and Sapiro (2009) propose to simultaneously learn the dictionary and the sensing matrix from example image data, which results in improved reconstruction results in compressed sensing scenarios. 1.3 Contributions of this Paper and Related Work This paper studies dictionary learning under explicit sparseness constraints with respect to Hoyer’s sparseness measure σ . A major part of this work is devoted to the efficient algorithmic computation of the sparseness-enforcing projection operator, which is an integral part in efficient dictionary learning. Several algorithms were proposed in the past to solve the projection problem (Hoyer 2004; Theis et al. 2005; Potluru et al. 2013; Thom and Palm 2013). Only Thom and Palm (2013) provided a complete and mathematically satisfactory proof of correctness for their algorithm. Moreover, all known algorithms have at least quasi-linear time complexity in the dimensionality of the vector that should be projected. In this paper, we first derive a characterization of the sparseness projection and demonstrate that its computation is equivalent to finding the root of a real-valued auxiliary function, which constitutes a much simpler problem. This result is used in the proposition of an algorithm for the projection operator that is asymptotically optimal in the sense of complexity theory, that is the time complexity is linear and the space complexity is constant in the problem dimensionality. We show through experiments that when run on a real computing machine the newly proposed algorithm is far superior in its computational demands to previously proposed techniques, even for small problem dimensionalities. Existing approaches to dictionary learning that feature explicit sparseness constraints can be categorized into ones that use Hoyer’s σ and ones that employ the L0 pseudonorm. Hoyer (2004) and Potluru et al. (2013) considered matrix factorization frameworks subject to σ constraints, with space requirements linear in the number of learning samples which prevents processing large data sets. Thom and Palm (2013) designed sparse code words as the result of the sparseness-enforcing projection operator applied to the product of the dictionary with the samples. This requires In addition to the contributions on sparseness projection computation, this paper proposes the Easy Dictionary Learning (EZDL) algorithm. Our technique aims at dictionary learning under explicit sparseness constraints in terms of Hoyer’s sparseness measure σ using a simple, fast-tocompute and biologically plausible Hebbian-like learning rule. For each presented learning sample, the sparsenessenforcing projection operator has to be carried out. The ability to perform projections efficiently makes the proposed learning algorithm particularly efficient: 30 % less training time is required in comparison to the optimized Online Dictionary Learning method of Mairal et al. (2009a). Extensions of Easy Dictionary Learning facilitate alternative representations such as topographic atom organization or atom sparseness, which includes for example separable filters. We furthermore demonstrate the competitiveness of the dictionaries learned with our algorithm with those computed with alternative sophisticated dictionary learning algorithms in terms of reproduction and denoising quality of natural images. Since other tasks, such as deblurring or super-resolution, build upon the same optimization problem in the application phase as reproduction and denoising, it can be expected that EZDL dictionaries will exhibit no performance degradations in those tasks either. The remainder of this paper is structured as follows. Section 2 derives a linear time and constant space algorithm for the computation of sparseness-enforcing projections. In Sect. 3, the Easy Dictionary Learning algorithm for explicitly sparseness-constrained dictionary learning is proposed. Section 4 reports experimental results on the performance of the newly proposed sparseness projection algorithm and the Easy Dictionary Learning algorithm. Section 5 concludes the paper with a discussion, and the appendix contains technical details of the mathematical statements from Sect. 2. 4 2 Efficient Sparseness-Enforcing Projections This section proposes a linear time and constant space algorithm for computation of projections onto level sets of Hoyer’s σ . Formally, if σ ∗ ∈ (0, 1) denotes a target sparseness degree and x ∈ Rn is an arbitrary point, the point from the level set S := { s ∈ Rn | σ (s) = σ ∗ } that minimizes the Euclidean distance to x is sought. The function that computes arg mins∈S kx − sk2 is also called sparseness-enforcing projection operator since the situation where σ (x) < σ ∗ is of particular interest. Due to symmetries of σ , the above described optimization problem can be reduced to finding the projection of a vector x ∈ Rn≥0 with non-negative coordinates onto the set  T := s ∈ Rn≥0 ksk1 = λ1 and ksk2 = λ2 ⊆ S, where λ1 and λ2 are target norms that should be chosen such √ √ that σ ∗ = ( n − λ1/λ2 ) / ( n − 1) (Hoyer 2004; Thom and Palm 2013). With this choice, σ constantly attains the value of σ ∗ on the entire set T , hence T is a subset of S. Thom and Palm (2013) proved that T is the intersection of a scaled canonical simplex and a hypercircle. They further demonstrated that projections onto T can be computed with a finite number of alternating projections onto these two geometric structures. The proof of correctness of this method could not rely on the classical alternating projection method (see for example Deutsch 2001) due to the lacking convexity of T , rendering the proof arguments quite complicated. The remainder of this section proceeds as follows. First, a succinct characterization of the sparseness projection is given. It is then shown that computing sparseness projections is equivalent to finding the zero of a monotone realvalued function. We prove that this can be achieved with optimal asymptotic complexity by proposing a new algorithm that solves the projection problem. 2.1 Representation of the Projection The main theoretical result of this paper is a representation theorem that characterizes the projection onto T . This was gained through an analysis of the intermediate points that emerge from the alternating projections onto a simplex and a hypercircle. A closed-form expression can then be provided by showing that the intermediate points in the projection algorithm satisfy a loop-invariant, a certain property fulfilled after each step of alternating projections. Since a mathematical rigorous treatment of this result is very technical, it is deferred to the appendix. We assume here that the vector x to be projected is given so that its projection is unique. Since it is guaranteed that for all points except for a null set there is exactly one projection (Theis Thom, Rapp, and Palm et al. 2005, Theorem 2.6), we can exclude points with nonunique projections in our considerations, which is no restriction in practice. We may now state a characterization of the projection outcome: Representation Theorem Let x ∈ Rn≥0 and let p ∈ T denote the unique projection of x onto T . Then there is exactly one real number α ∗ with p= λ2 · q where q := max (x − α ∗ · e, 0) ∈ Rn . kqk2 Here, e ∈ { 1 }n is the n-dimensional vector where all entries are unity. If the indices of the positive coordinates of p are known, then α ∗ can be computed directly from x with an explicit expression. In words, the projection p is the point q rescaled to obtain an L2 norm of λ2 . The vector q is computed from the input vector x by subtracting the scalar α ∗ from all the entries, and afterwards setting negative values to zero. It is remarkable that the projection admits such a simple representation although the target set for the projection is non-convex and geometrically quite complicated. The function that maps a scalar ξ ∈ R to max(ξ − t, 0) for a constant offset t ∈ R is called the soft-shrinkage function. If t = 0, it is also called the rectifier function. Because the central element of the projection representation is a soft-shrinkage operation applied entry-wise to the input vector, carrying out projections onto level sets of Hoyer’s sparseness measure can be interpreted as denoising operation (Donoho 1995; Hyvärinen 1999; Elad 2006). 2.2 Auxiliary Function for the Sparseness Projection The projection problem can hence be reduced to determining the soft-shrinkage offset α ∗ , which is a one-dimensional problem on the real line. Further, it is reasonable that α ∗ must be smaller than the maximum entry of x since otherwise q would be the null vector, which is absurd. In the usual case where σ (x) < σ ∗ we can further conclude that α ∗ must be non-negative. Otherwise, the result of the projection using the representation theorem would be less sparse than the input, which is impossible. Therefore, the projection problem can be further reduced to finding a number from the bounded interval [0, xmax ) with xmax := maxi∈{1,...,n} xi . Next, a method for efficiently deciding whether the correct offset has been found is required. Similar to the projection onto a canonical simplex (Liu and Ye 2009), we can design a real-valued function that vanishes exactly at the wanted offset. The properties of Hoyer’s σ allow us to formulate this function in an intuitive way. We call Ψ : [0, xmax ) → R, α 7→ kmax (x − α · e, 0)k1 λ1 − , kmax (x − α · e, 0)k2 λ2 Efficient Dictionary Learning with Sparseness-Enforcing Projections 0.50 0.25 Yes σ (x) < σ ∗ 0.00 -0.25 No Increase sparseness? Receive input vector x and target sparseness σ ∗ Ψ Ψ' Auxiliary Function 5  Set α to middle of interval Determine interval for α ∗ by finding x2nd-max Determine neighbors x j and xk of α in x Evaluate Ψ (α ), Ψ (x j ) and Ψ (xk ) -0.50 xj -0.75 0.0 0.1 0.2 α* xk 0.3 0.4 0.5 0.6 0.7 0.8 Offset of Soft-Shrinkage α 0.9 1.0 Fig. 2 Plot of the auxiliary function Ψ and its derivative for a random vector x. The derivative Ψ 0 was scaled using a positive number for improved visibility. The steps in Ψ 0 are exactly the places where α coincides with an entry of x. It is enough to find an α with Ψ (x j ) ≥ 0 and Ψ (xk ) < 0 for the neighboring entries x j and xk in x, because then the exact solution α ∗ can be computed with a closed-form expression. the auxiliary function for the projection onto T . The rationale for the concrete definition of Ψ is as follows. Due to the representation theorem we know that the projection p onto T is merely a scaled version of the point q := max (x − α ∗ · e, 0). Moreover σ (p) = σ ∗ , and due to the scale-invariance of Hoyer’s σ follows σ (q) = σ ∗ . The essence of σ is the ratio of the L1 norm to the L2 norm of its argument. Hence here the scale constants that make σ normalized to the interval [0, 1] are omitted and the target norms are used instead. We therefore have that kqk1/kqk2 = λ1/λ2 , and thus Ψ (α ∗ ) = 0. As α ∗ is unique, we can conclude that no other offset of the soft-shrinkage operation leads to a correct solution. In fact, if α 6= α ∗ and when we write q̃ := max (x − α · e, 0), then we have that σ (q̃) 6= σ ∗ and therefore Ψ (α) 6= 0. An exemplary plot of Ψ is depicted in Fig. 2. Clearly, the auxiliary function is continuous, differentiable except for isolated points and strictly decreasing except for its final part where it is constant. Since the constant part is always negative and starts at the offset equal to the second-largest entry x2nd-max := max { xi | i ∈ {1, . . . , n} and xi 6= xmax } of x, the feasible interval can be reduced even more. The step discontinuities in Ψ 0 coincide exactly with the entries of the input vector x. These appealing analytical properties greatly simplify computation of the zero of Ψ , since standard rootfinding algorithms such as bisection or Newton’s method (see for example Traub 1964) can be employed to numerically find α ∗ . 2.3 Linear Time and Constant Space Projection Algorithm We can improve on merely a numerical solution by exploiting the special structure of Ψ to yield an analytical solution to the projection problem. This is due to the closed-form Update interval using sign of Ψ (α ) No Sign change?  Yes Ψ (x j ) ≥ 0 and Ψ (xk ) < 0 λ2 · q where Return kqk 2 q := max (x − α ∗ · e, 0) Determine α ∗ from closed-form expression Fig. 3 Flowchart of the proposed algorithm for computing sparsenessenforcing projections. The algorithm starts with the box at the upper left and terminates with the box at the lower left. expression for α ∗ which requires the indices of the coordinates in which the result of the projection is positive to be known. The other way around, when α ∗ is known, these indices are exactly the ones of the coordinates in which x is greater than α ∗ . When an offset sufficiently close to α ∗ can be determined numerically, the appropriate index set can be determined and thus the exact value of α ∗ . The decision if a candidate offset α is close enough to the true α ∗ can be made quite efficiently, since α ∗ is coupled via index sets to individual entries of the input vector x. Hence, it suffices to find the right-most left neighbor x j of α in the entries of x, and analogously the left-most right neighbor xk (see Fig. 2 for an example). Whenever Ψ (x j ) ≥ 0 and Ψ (xk ) < 0, the zero α ∗ of Ψ must be located between x j and xk for continuity reasons. But then all values in x greater than α ∗ are exactly the values greater than or equal to xk , which can be determined by simply scanning through the entries of x. Based upon these considerations, a flowchart of our proposed method for computing sparseness-enforcing projections is depicted in Fig. 3. The algorithm performs bisection and continuously checks for sign changes in the auxiliary function Ψ . As soon as this is fulfilled, α ∗ is computed and the result of the projection is determined in-place. A complete formal presentation and discussion of our proposed algorithm is given in the appendix. Each intermediate step of the algorithm (that is, determination of the second-largest entry of x, evaluation of the auxiliary function, projection result computation by appli- 6 cation of soft-shrinkage and scaling) can be carried out in a time complexity linear in the problem dimensionality n and a space complexity completely independent of n. Therefore, to show the overall algorithm possesses the same asymptotic complexity, it has to be proved that the number of bisection iterations required for finding α ∗ is independent of n. The length of the initial interval is upperbounded by x2nd-max as discussed earlier. Bisection is moreover guaranteed to stop at the latest once the interval length is smaller than the minimum pairwise distance between distinct entries of x,  δ := min xk − x j x j , xk ∈ X and x j < xk > 0 where X := { xi | i ∈ {1, . . . , n} }. This is due to the fact that it is enough to find a sufficiently small range to deduce an analytical solution. The required number of bisection iterations is then less than dlog2 (x2nd-max /δ )e, see Liu and Ye (2009). This number is bounded from above regardless of the dimensionality of the input vector since x2nd-max is upper-bounded and δ is lower-bounded due to finite machine precision (Goldberg 1991). Hence our sparseness-enforcing projection algorithm is asymptotically optimal in the sense of complexity theory. There may still be hidden constants in the asymptotic notation that render the proposed algorithm less efficient than previously known algorithms for a small input dimensionality. Experiments in Sect. 4 demonstrate that this is not the case. 3 Explicitly Sparseness-Constrained Dictionary Learning This section proposes the Easy Dictionary Learning (EZDL) algorithm for dictionary learning under explicit sparseness constraints. First, we introduce an ordinary formulation of the learning algorithm. Sparse code word inference with the sparseness projection algorithm proposed in Sect. 2 renders EZDL efficient and particularly simple to implement. We further discuss extensions that allow concentrating on different aspects of the data set under investigation, such as topographic organization of the atoms and atom sparseness. Only little implementation effort is required for these extensions and their computational demands are low. A description of the comprehensive EZDL learning algorithm is accompanied with several strategies that improve the optimization performance. Thom, Rapp, and Palm costly optimization procedure before updating the dictionary. EZDL learns a dictionary by first yielding sparse code words through simple inference models and then tuning the dictionary with a simple update step. An inference model is a function I : Rn → Rn which accepts filter responses in the form of the product of the dictionary W ∈ Rd×n with a learning sample x ∈ Rd , u := W T x ∈ Rn , and produces a representation h := I(u) with certain desirable properties. Here, the combination with the sparseness-enforcing projection operator is particularly interesting since it provides a natural method to fulfill explicit sparseness constraints. We call the choice I(u) := ΠσH (u) the ordinary inference model, where ΠσH denotes the Euclidean projection onto the set of all vectors that achieve a sparseness degree of σH ∈ (0, 1) with respect to Hoyer’s sparseness measure σ . This computation can also be interpreted as the trivial first iteration of a projected Landweber procedure for sparse code word inference (Bredies and Lorenz 2008). The dictionary W is adapted to new data by minimizing the deviation between a learning sample x and its approximation W h through the linear generative model. The goodness of the approximation is here assessed with a differentiable similarity measure ρ : Rd × Rd → R, so that the EZDL optimization problem becomes: min ρ(W h, x). W Note that h is not a variable of the optimization problem since it is defined as output of an inference model. For the same reason, h does not need to be constrained further as it inherently satisfies explicit sparseness constraints. Although a wide range of similarity measures is possible, we decided to use the (Pearson product-moment) correlation coefficient since it is invariant to affine-linear transformations (Rodgers and Nicewander 1988). In the context of visual data set analysis, this corresponds to invariance with respect to DC components and gain factors. Moreover, differentiability of this similarity measure facilitates gradientbased learning (Thom and Palm 2013). If ρ 0 : Rd × Rd → Rd is the transposed derivative of ρ with respect to its first argument and g := ρ 0 (W h, x) ∈ Rd denotes its value in W h, the gradient of EEZDL for the dictionary is given by   ∂ EEZDL T = ghT ∈ Rd×n . ∂W Therefore, when W is tuned with gradient descent a simple and biologically plausible Hebbian-like learning rule (Hyvärinen et al. 2009) results: 3.1 EZDL—Easy Dictionary Learning W new := W − η · ghT , where η > 0 denotes the step size. Conventional dictionary learning algorithms operate in an alternating fashion, where code words are inferred with a This update step can be implemented efficiently with simple rank-1 updates (Blackford et al. 2002). Efficient Dictionary Learning with Sparseness-Enforcing Projections We here assumed h = I(W T x) to be constant and neglected that it actually depends on W . Without this assumption, the gradient would have to be extended with an additive term which comprises the gradient of the inference model (Thom and Palm 2013, Proposition 39). This, in turn, requires the computation of the sparseness-enforcing projection operator’s gradient. This gradient can be computed with simple vector operations as we show in the appendix. However, this constitutes a significant computational burden compared to the simple and fast-to-compute EZDL update step. Section 4 demonstrates through experiments that this simplification is still perfectly capable of learning dictionaries. 3.2 Topographic Atom Organization and Atom Sparseness Topographic organization of the dictionary’s atoms similar to Self-organizing Maps (Kohonen 1990) or Topographic Independent Component Analysis (Hyvärinen et al. 2001) can be achieved in a straightforward way with EZDL using alternative inference models proposed in this section. For this, the dictionary atoms are interpreted to be arranged on a two-dimensional grid. A spatial pooling operator subject to circular boundary conditions can then be used to incorporate interactions between atoms located adjacent on the grid. This can, for example, be realized by averaging each entry of the filter responses in a 3 × 3 neighborhood on the grid. This convolution operation can be expressed as linear operator applied to the vector u ∈ Rn , represented by a sparsely populated matrix G ∈ Rn×n . With G containing all atom interactions, we call I(u) := ΠσH (Gu) the topographic inference model. An alternative realization of topographic organization is enforcing structure sparseness on the filter responses reshaped as matrix to account for the grid layout. Structure sparseness can be assessed by application of a sparseness measure to the vector with the singular values of a matrix. When the L0 pseudo-norm is used, then this is the rank of a matrix. The matrix rank can also be measured more robustly through the ratio of the Schatten 1-norm to the Schatten 2norm, which is essentially Hoyer’s sparseness measure σ applied to the singular values (Lopes 2013). Clearly, any matrix M ∈ Ra×b where a, b ∈ N can be reshaped to a vector m := vec(M) ∈ Rab with the vectorization operator that stacks all columns of M on top of another (Neudecker 1969). This linear operation can be inverted provided the shape of the original matrix is known, ∗ M = vec−1 a×b (m). In the following, let Πκ denote the projection onto the set of all matrices that possess a target rank κ ∗ ∈ {1, . . . , min { a, b }}. A classical result states that any matrix can be projected onto the set of low-rank matrices by computation of its Singular Value Decomposition, applying an L0 pseudo-norm projection to the vector of singular 7 values thus retaining only the largest ones, and finally computing the reconstruction using the modified singular values (Eckart and Young 1936). Based on these considerations, let r and c with n = rc be natural numbers describing the topographic grid layout dimensionalities. The rank-κH topographic inference model is then defined by the composition  I(u) := vec ◦ΠκH ◦ vec−1 r×c ◦ΠσH (u). In words, this inference model operates as follows. It first approximates the filter responses u with a sparsely populated vector that attains a sparseness of σH with respect to Hoyer’s σ . These sparsified filter responses are then laid out on a grid and replaced with those best approximating filter responses that meet a lower rank of κH ∈ {1, . . . , min { r, c }}. Finally, the grid layout is reshaped to a vector since this should be the output type of each inference model. If κH = 1, then there are two vectors y ∈ Rr and z ∈ Rc T such that vec−1 r×c (I(u)) = yz , that is the filter responses can be expressed as a dyadic product when reshaped to a grid. We will demonstrate with experiments that this results in an interesting topographic atom organization similar to Independent Subspace Analysis (Hyvärinen and Hoyer 2000). Analogous to Non-negative Matrix Factorization with Sparseness Constraints (Hoyer 2004), the atoms can be enforced to be sparse as well. To achieve this, it is sufficient to apply the sparseness projection to each column of the dictionary after each learning epoch: W new ei := ΠσW (Wei ) for all i ∈ {1, . . . , n}, where ei ∈ Rn is the i-th canonical basis vector that selects the i-th column from W , and σW ∈ (0, 1) is the target degree of atom sparseness. In the situation where the learning samples resemble image patches, the atoms can also be restricted to fulfill structure sparseness using a low-rank approximation. Suppose the image patches possess ph × pw pixels, then the following projection can be carried out after each learning epoch:  W new ei := vec ◦ΠκW ◦ vec−1 ph ×pw (Wei ) for all i ∈ {1, . . . , n}. Here, κW ∈ {1, . . . , min { ph , pw }} denotes the target rank of each atom when reshaped to ph × pw pixels. When the dictionary is used to process images through convolution, small values of κW are beneficial since computations can then be speeded up considerably. For example, if κW = 1 each atom can be expressed as outer product of vectors from R ph and R pw , respectively. The convolutional kernel is separable in this case, and two one-dimensional convolutions lead to the same result as one two-dimensional convolution, but require only a fraction of operations (Hoggar 2006). 8 3.3 Learning Algorithm In the previous sections, a simple Hebbian-like learning rule was derived which depends on abstract inference models. The core of the inference models is the sparseness-enforcing projection operator discussed in Sect. 2, which guarantees that the code words always attain a sparseness degree easily controllable by the user. On presentation of a learning sample x, an update step of the dictionary W hence consists of (a) determining the filter responses (u := W T x), (b) feeding the filter responses through the inference model involving a sparseness projection (h := I(u)), (c) computation of the approximation to the original learning sample (W h) using the linear generative model, (d) assessing the similarity between the input sample and its approximation (ρ(W h, x)) and the similarity measure’s gradient (g := ρ 0 (W h, x)), and eventually (e) adapting the current dictionary using a rank-1 update (W new := W − η · ghT ). All these intermediate steps can be carried out efficiently. The sparseness projection can be computed using few resources, and neither its gradient nor the gradient of the entire inference model is required. After each learning epoch it is possible to impose additional constraints on the atoms with atom-wise projections. In doing so, several aspects of the data set structure can be made more explicit since the atoms are then forced to become more simple feature detectors. An example of an individual learning epoch is given in Algorithm 1, where the topographic inference model and low-rank structure sparseness are used. In addition, the explicit expressions for the correlation coefficient and its gradient are given (Thom and Palm 2013, Proposition 40). The outcome of this parameterization applied to patches from natural images is depicted in Fig. 9b and will be discussed in Sect. 4.2.3. The efficiency of the learning algorithm can be improved with simple modifications described in the following. To reduce the learning time compared to when a randomly initialized dictionary was used, the dictionary should be initialized by samples randomly chosen from the learning set (Mairal et al. 2009a; Skretting and Engan 2010; Coates and Ng 2011; Thom and Palm 2013). When large learning sets with millions of samples are available, stochastic gradient descent has been proven to result in significantly faster optimization progress compared to when the degrees of freedom are updated only once for each learning epoch (Wilson and Martinez 2003; Bottou and LeCun 2004). The step size schedule η(ν) := η0/ν , where η0 > 0 denotes the initial step size and ν ∈ N \ { 0 } is the learning epoch counter, is beneficial when the true gradient is not available but rather an erroneous estimate (Bertsekas 1999). After each learning epoch, all the atoms of the dictionary are normalized to Thom, Rapp, and Palm Algorithm 1 One epoch of the Easy Dictionary Learning algorithm, illustrated for the case of a topographic inference model and low-rank structure sparseness. Input: The algorithm accepts the following parameters: – An existing dictionary W ∈ Rd×n with n atoms. – Random access to a learning set with samples from Rd through a function "pick_sample". – Step size for update steps η ∈ R>0 . – Number of samples to be presented Mepoch ∈ N. – For the topographic inference model: – Target degree of dictionary sparseness σH ∈ (0, 1). – Topography matrix G ∈ Rn×n describing the interaction between adjacent atoms. – To obtain low-rank structure sparseness: – Number of pixels ph × pw so that d = ph pw . – Target rank κW ∈ {1, . . . , min { ph , pw }}. Output: Updated dictionary W ∈ Rd×n . 1 2 3 4 5 // Present samples and adapt dictionary. repeat Mepoch times // Pick a random sample. x := pick_sample() ∈ Rd ; // (a) Compute filter responses. u := W T x ∈ Rn ; // (b) Evaluate topographic inference model. h := ΠσH (Gu) ∈ Rn ; // (c) Compute approximation to x. x̃ := W h ∈ Rd ; // (d) Compute correlation coefficient ρx̃, x := ρ(W h, x) and its gradient g. Here, e ∈ { 1 }d is the all-ones vector. 2 λ := kx̃k22 − 1/d · eT x̃ ∈ R; 2 µ := kxk22 − 1/d · eT x ∈ R;   p ρx̃, x := x̃T x − 1/d · eT x̃ eT x / λ µ ∈ R;   ρ g := √1 x − eT x/d · e − λx̃, x x̃ − eT x̃/d · e ∈ Rd ; 6 7 8 9 λµ // (e) Adapt dictionary with rank-1 update. W := W − η · ghT ∈ Rd×n ; 10 11 12 13 14 15 16 end // Atom-wise projection for low-rank filters. for i := 1 to n do // Extract i-th atom and normalize. w := Wei/kWei k2 ∈ Rd ; // Ensure atom has rank κW when reshaped to ph × pw pixels.  d w := vec ◦ΠκW ◦ vec−1 ph ×pw (w) ∈ R ; // Store modified atom back in dictionary. Wei := w; end unit scale. Since the learning rule is Hebbian-like, this prevents the atoms from growing arbitrarily large or becoming arbitrarily small (Hyvärinen et al. 2009). This normalization step is also common in a multitude of alternative dictionary learning algorithms (Kreutz-Delgado et al. 2003; Hoyer 2004; Mairal et al. 2009a; Skretting and Engan 2010). Since the dictionary is modified with a rank-1 update where one of the factors is the result of an inference model and hence sparse, only the atoms that induce significant fil- ter responses are updated. This may result in atoms that are never updated when the target sparseness degree σH is large. This behavior can be alleviated by adding random noise to the inference model’s output prior to updating the dictionary, which forces all the atoms to be updated. We used random numbers sampled from a zero-mean normal distribution, where the standard deviation was multiplicatively annealed after each learning epoch. As optimization proceeds, the atoms are well-distributed in sample space such that the lifetime sparseness is approximately equal to the population sparseness (Willmore and Tolhurst 2001), and randomness is not needed anymore. 4 Experimental Results This section reports experimental results on the techniques proposed in this paper. We first evaluate alternative solvers for the sparseness projection’s auxiliary function and show that our algorithm for the sparseness-enforcing projection operator is significantly faster than previously known methods. We then turn to the application of the projection in the Easy Dictionary Learning algorithm. First, the morphology of dictionaries learned on natural image patches is analyzed and put in context with previous methods. We further show that the resulting dictionaries are well-suited for the reproduction of entire images. They achieve a reproduction quality equivalent to dictionaries trained with alternative, significantly slower algorithms. Eventually, we analyze the performance of the dictionaries when employed for the image denoising task and find that, analogous to the reproduction experiments, no performance degradation can be observed. 4.1 Performance of Sparseness-Enforcing Projections Our proposed algorithm for sparseness projections was implemented as C++ program using the GNU Scientific Library (Galassi et al. 2009). We first analyzed whether solvers other than bisection for locating the zero of the auxiliary function would result in an improved performance. Since Ψ is differentiable except for isolated points and its derivatives can be computed quite efficiently, Newton’s method and Halley’s method are straightforward to apply. We further verified whether Newton’s method applied to a slightly transformed variant of the auxiliary function, Ψ̃ : [0, xmax ) → R, α 7→ kmax (x − α · e, 0)k21 kmax (x − α · e, 0)k22 − λ12 , λ22 where the minuend and the subtrahend were squared, would behave more efficiently. The methods based on derivatives were additionally safeguarded with bisection to guarantee new positions are always located within well-defined intervals (Press et al. 2007). This impairs the theoretical property 9 Number of Function Evaluations Efficient Dictionary Learning with Sparseness-Enforcing Projections 35 Bisection Newton on Ψ Halley on Ψ Newton on Ψ̃ 30 25 20 15 10 5 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 log2(Dimensionality) Fig. 4 Number of auxiliary function evaluations needed to find the final interval for the projection onto T using four different solvers. The error bars indicate ±1 standard deviation distance from the mean value. Since Newton’s method applied to Ψ̃ is consistently outperforming the other solvers, it is the method of choice for all practical applications. that only a constant number of steps is required to find a solution, but in practice a significantly smaller number of steps needs to be made compared to plain bisection. To evaluate which solver would provide maximum efficiency in practical scenarios, one thousand random vectors for each problem dimensionality n ∈ {22 , . . . , 230 } were sampled and the corresponding sparseness-enforcing projections for σ ∗ := 0.90 were computed using all four solvers. We have used the very same random vectors as input for all solvers, and counted the number of times the auxiliary function needed to be evaluated until the solution was found. The results of this experiment are depicted in Fig. 4. The number of function evaluations required by plain bisection grew about linearly in log(n). Because the expected minimum difference of two distinct entries from a random vector gets smaller when the dimensionality of the random vector is increased, the expected number of function evaluations bisection needs increases with problem dimensionality. In either case, the length of the interval that has to be found is always bounded from below by the machine precision such that the number of function evaluations with bisection is bounded from above regardless of n. The solvers based on the derivative of Ψ or Ψ̃ , respectively, always required less function evaluations than bisection. They exhibited a growth clearly sublinear in log(n). For n = 230 ≈ 109 , Newton’s method required 11 function evaluations in the mean, Halley’s method needed 9 iterations, and Newton’s method applied to Ψ̃ found the solution in only 4.5 iterations. Therefore, in practice always the latter solver should be employed. In another experiment, the time competing algorithms require for computing sparseness projections on a real computing machine was measured for a comparison. For this, the algorithms proposed by Hoyer (2004), Potluru et al. (2013), and Thom and Palm (2013) were implemented using the 10 Thom, Rapp, and Palm Speed-up over Hoyer (2004) 17 This Paper Potluru et al. (2013) Thom and Palm (2013) 15 13 11 9 7 5 3 1 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 log2(Dimensionality) Fig. 5 Speed-ups relative to the original algorithm of Hoyer (2004) obtained using alternative algorithms. The linear time algorithm proposed in this paper is far superior in terms of execution time. The time complexity of the competing methods is at least quasi-linear, which becomes noticeable especially for large problem dimensionalities. GNU Scientific Library (Galassi et al. 2009) by means of C++ programs. An Intel Core i7-4960X processor was used and all algorithms were run in a single-threaded environment. Random vectors were sampled for each problem dimensionality n ∈ {22 , . . . , 230 } and initially projected to attain a sparseness of 0.50 with respect to Hoyer’s σ . This initial projection better reflects the situation in practice where not completely random vectors have to be processed. Next, all four algorithms were used to compute projections with a target sparseness degree of σ ∗ := 0.90 and their run time was measured. The original algorithm of Hoyer (2004) was the slowest, so by taking the ratio of the run times of the other algorithms to the run time of that slowest algorithm the relative speed-up was obtained. Figure 5 visualizes the results of this experiment. For all tested problem dimensionalities, the here proposed linear time algorithm dominated all previously described methods. While the speed-up of the algorithms of Potluru et al. (2013) and Thom and Palm (2013) relative to the original algorithm of Hoyer (2004) were already significant, especially for small to medium dimensionalities, they got relatively slow for very large vectors. This is not surprising, because both methods start with sorting the input vector and have to store that permutation to be undone in the end. The algorithm proposed in this paper is based on rootfinding of a monotone function and requires no sorting. Only the left and right neighbors of a scalar in a vector have to be found. This can be achieved by scanning linearly through the input vector, which is particularly efficient when huge vectors have to be processed. For n = 230 , the proposed algorithm was more than 15 times faster than the methods of Hoyer (2004), Potluru et al. (2013) and Thom and Palm (2013). Because of this appealing asymptotic behavior, there is now no further obstacle to applying smooth sparseness methods to large-scale problems. 4.2 Data Set Analysis with EZDL We used the Easy Dictionary Learning algorithm as a data analysis tool to visualize the structure of patches from natural images under different aspects, which facilitates qualitative statements on the algorithm performance. For our experiments, we used the McGill calibrated color image database (Olmos and Kingdom 2004), where the images had either 768 × 576 pixels or 576 × 768 pixels. The images were desaturated (SMPTE RP 177-1993, Annex B.4) and quantized to 8-bit precision. We extracted 10 000 patches with 16 × 16 pixels from each of the 314 images of the "Foliage" collection. The patches were extracted at random positions. Patches with vanishing variance were omitted since they carry no information. In total, we obtained 3.1 million samples for learning. We learned dictionaries on the raw pixel values of this learning set and on whitened image patches. The learning samples were normalized to zero mean and unit variance as the only pre-processing for the raw pixel experiments. The whitened data was obtained using the canonical preprocessing from Section 5.4 of Hyvärinen et al. (2009) with 128 principal components. EZDL was applied using each proposed combination of inference model and atom constraints. We presented 30 000 randomly selected learning samples in each of one thousand epochs, which corresponds to about ten sweeps through the entire learning set. The initial step size was set to η0 := 1. A noisy version of the final dictionary could already be observed after the first epoch, demonstrating the effectiveness of EZDL for quick analysis. Since the optimization procedure is probabilistic in the initialization and selection of training samples, we repeated the training five times for each parameter set. We observed only minor variations between the five dictionaries for each parameter set. In the following, we present details of dictionaries optimized on raw pixel values and analyze their filter characteristics. Then, we consider dictionaries learned with whitened data and dictionaries with separable atoms trained on raw pixel values and discuss the underlying reasons for their special morphology. 4.2.1 Raw Pixel Values Using the ordinary inference model, we trained two-times overcomplete dictionaries with n := 256 atoms on the normalized pixel values, where the dictionary sparseness degree was varied between 0.700 and 0.999. This resulted in the familiar appearance of dictionaries with Gabor-like filters, which resemble the optimal stimulus of visual neurons (Olshausen and Field 1996, 1997). While for small values of σH the filters were mostly small and sharply bounded, high sparseness resulted in holistic and blurry filters. Efficient Dictionary Learning with Sparseness-Enforcing Projections 11 Spatial Frequency Envelope Width x' Envelope Width y' 2.5 2.0 1.5 1.0 0.5 0.0 0.70 σH = 0.75 30 Relative Frequency [%] Value of Gabor Parameter 3.0 25 25 20 20 15 15 10 10 5 5 0 0.75 0.80 0.85 0.90 Dictionary Sparseness σH 0.95 1.00 σH = 0.99 30 0 0 π/4 π/2 Spatial Phase [rad] 0 π/4 π/2 Spatial Phase [rad] Fig. 6 Mean values of three influential parameters of Gabor functions fitted to the atoms of the dictionaries learned with EZDL, in dependence on the target degree of dictionary sparseness σH . An increase in sparseness results in filters with a reduced spatial frequency, but with a significant increase in the width of the Gaussian envelope. Fig. 7 Histograms of the spatial phase of fitted Gabor functions for σH = 0.75 (left) and σH = 0.99 (right). Low sparseness yields dictionaries where odd-symmetric filters dominate, whereas high dictionary sparseness results in a significant amount of both even-symmetric and odd-symmetric filters. We used the methods developed by Jones and Palmer (1987) and Ringach (2002) for a more detailed analysis. In doing so, a two-dimensional Gabor function as defined in Equation (1) of Ringach (2002), that is a Gaussian envelope multiplied with a cosine carrier wave, was fit to each dictionary atom using the algorithm of Nelder and Mead (1965). We verified that these Gabor fits accurately described the atoms, which confirmed the Gabor-like nature of the filters. The differences in the dictionaries due to varying sparseness degrees became apparent through analysis of the parameters of the fitted Gabor functions. Figure 6 shows the mean values of three influential Gabor parameters in dependence on σH . All parameters change continuously and monotonically with increasing sparseness. The spatial frequency, a factor in the cosine wave of the Gabor function, constantly decreases for increasing dictionary sparseness. The width of the Gaussian envelope, here broken down into the standard deviation in both principal orientations x0 and y0 , is monotonically increasing. The envelope width in y0 direction increases earlier, but in the end the envelope width in x0 direction is larger. It can be concluded that more sparse code words result in filters with lower frequency but larger envelope. Since an increased sparseness reduces the model’s effective number of degrees of freedom, it prevents the constrained dictionaries from adapting precisely to the learning data. Similar to Principal Component Analysis, low-frequency atoms here minimize the reproduction error best when only very few effective atoms are allowed (Hyvärinen et al. 2009; Olshausen and Field 1996). Histograms of the spatial phase of the filters, an additive term in the cosine wave of the Gabor function, are depicted in Fig. 7. For σH = 0.75, there is a peak at π/2 which corresponds to odd-symmetric filters (Ringach 2002). The distribution is clearly bimodal for σH = 0.99, with peaks at 0 and π/2 corresponding to even-symmetric and odd-symmetric fil- ters, respectively. While the case of small σH matches the result of ordinary sparse coding, the higher dictionary sparseness results in filters with the same characteristics as the optimal stimulus of macaque visual neurons (Ringach 2002). This analysis proves that EZDL’s minimalistic learning rule is capable of generating biologically plausible dictionaries, which constitute a particularly efficient image coding scheme. To obtain dictionaries with diverse characteristics, it is enough to adjust the target degree of dictionary sparseness on a normalized scale. A major component in the learning algorithm is the sparseness projection, enforcing local competition among the atoms (Rozell et al. 2008) due to its absolute order-preservation property (Thom and Palm 2013, Lemma 12). 4.2.2 Whitened Image Patches Whitening as a pre-processing step helps to reduce sampling artifacts and decorrelates the input data (Hyvärinen et al. 2009). It also changes the intuition of the similarity measure in EZDL’s objective function, linear features rather than single pixels are considered where each feature captures a multitude of pixels in the raw patches. This results in differences in the filter structure, particularly in the emergence of more low-frequency filters. The dictionary depicted in Fig. 8a was learned using the topographic inference model with average-pooling of 3 × 3 neighborhoods. We set the dictionary sparseness degree to σH := 0.85 and the number of atoms to n := 256, arranged on a 16 × 16 grid. The dictionary closely resembles those gained through Topographic Independent Component Analysis (Hyvärinen et al. 2001, 2009) and Invariant Predictive Sparse Decomposition (Kavukcuoglu et al. 2009). It should be noted that here the representation is two times overcom- 12 Thom, Rapp, and Palm plete due to the whitening procedure. Overcomplete representations are not inherently possible with plain Independent Component Analysis (Bell and Sejnowski 1997; Hyvärinen et al. 2009) which limits its expressiveness, a restriction that does not hold for EZDL. The emergence of topographic organization can be explained by the special design of the topographic inference model. The pooling operator acts as spatial low-pass filter on the filter responses, so that each smoothed filter response carries information on the neighboring filter responses. Filter response locality is retained after the sparseness projection, hence adjacent atoms receive similar updates with the Hebbian-like learning rule. Hence, there are only small differences between filters within the same vicinity. The learning process is similar to that of Self-organizing Maps (Kohonen 1990), where only the atom with the maximum filter response and the atoms in its direct surrounding are updated. However, EZDL simultaneously updates multiple clusters since the sparse code words laid out on the grid are multimodal. (a) Topographic inference model. Further, it is notable that we achieved a topographic organization merely through a linear operator G by simple average-pooling. This stands in contrast to the discussion from Bauer and Memisevic (2013) where the necessity of a nonlinearity such as multiplicative interaction or pooling with respect to the Euclidean norm was assumed. Our result that a simple linear operator plugged into the ordinary inference model already produces smooth topographies proves that linear interactions between the atoms are sufficient despite their minimality. Figure 8b shows a dictionary obtained with the rank-1 topographic inference model, using a sparseness degree of σH := 0.85 and n := 256 filters on a 16 × 16 grid. Here, the sparse code words reshaped to a matrix are required to have unit rank which results in a specially organized filter layout. For example, rows three and four almost exclusively contain low-frequency filters, and the filters in the sixth column are all oriented vertically. The grouping of similar atoms into the same rows and columns is related to Independent Subspace Analysis, which yields groups of Gabor-like filters where all filters in a group have approximately the same frequency and orientation (Hyvärinen and Hoyer 2000). The rank-1 topographic inference model guarantees that code words can be expressed as the dyadic product of two vectors, where the factors themselves are sparsely populated because the code words are sparse. This causes the code words to possess a sparse rectangular structure when reshaped to account for the grid layout, that is non-vanishing activity is always concentrated in a few rows and columns. The Hebbian-like learning rule therefore induces similar updates to atoms located in common rows or columns, which explains the obtained group layout. (b) Rank-1 topographic inference model. Fig. 8 Two times overcomplete dictionaries trained with EZDL on whitened natural image patches. 4.2.3 Rank-1 Filters on Raw Pixel Values Enforcing the filters themselves to have rank one by setting κW := 1 resulted in bases similar to Discrete Cosine Transform (Watson 1994). This was also observed recently by Hawe et al. (2013) who considered a tensor decomposition of the dictionary, and by Rigamonti et al. (2013) who minimized the Schatten 1-norm of the atoms. Note that EZDL merely replaces the atoms after each learning epoch by their best rank-1 approximation. The computational complexity of this operation is negligible compared to an individual learning epoch using tens of thousands of samples and hence does not slow down the actual optimization. If no ordering between the filters was demanded, a multitude of checkerboard-like filters and vertical and horizontal contrast bars was obtained, see Fig. 9a for a dictionary with Efficient Dictionary Learning with Sparseness-Enforcing Projections (a) Ordinary inference model. 13 oms to be distant from each other. In the space of rank-1 filters, there can be either vertical or horizontal structures, or checkerboards combining both principal orientations. The lack of fine details can be explained by the restriction of topographic organization, which reduces the effective number of degrees of freedom. Analogously to the situation in Sect. 4.2.1 where the dictionary sparseness was increased, the reproduction error can be reduced by a large amount using few filters with low frequencies. For the same reason, there are few such checkerboard-like filters: Minimization of the reproduction error is first achieved with principal orientations before checkerboards can be used to encode details in the image patches. In conclusion, these results show that the variety of the dictionaries produced by EZDL can be vast simply by adapting easily interpretable parameters. The algorithm covers and reproduces well-known phenomena from the literature, and allows a precise visualization of a data set’s structure. A first impression of the final dictionaries can already be obtained after one learning epoch, which takes no more than one second on a modern computer. 4.3 Experiments on the Reproduction of Entire Images (b) Topographic inference model. Fig. 9 Dictionaries trained with EZDL on raw pixels, the atoms were replaced by their best rank-1 approximation after each epoch. n := 256 atoms and a sparseness degree of σH := 0.85. Atoms with diagonal structure cannot be present at all in such constrained dictionaries because diagonality requires a filter rank greater than one. Although all filters were paraxial due to the rank-1 constraint, they still resembled contrast fields because of their grating-like appearance. This is due to the representation’s sparseness, which is known to induce this appearance. A similar filter morphology was obtained with a topographic filter ordering using a 16 × 16 grid, though the filters were blurrier, as shown in Fig. 9b. Here, checkerboard-like filters are located in clusters, and filters with vertical and horizontal orientation are spatially adjacent. This is as expected, because with a sparse topography there are only a few local blobs of active entries in each code word, causing similar atoms to be grouped together and dissimilar at- It was demonstrated in Sect. 4.2 that the Easy Dictionary Learning algorithm produces dictionaries that correspond to efficient image coding schemes. We now analyze the suitability of EZDL dictionaries trained on raw pixel values for the reproduction of entire images. This is a prerequisite for several image processing tasks such as image enhancement and compression, since here essentially the same optimization problem should be solved as during reproduction with a given dictionary. Our analysis allows quantitative statements as the original images and their reproduction through sparse coding can be numerically compared on the signal level. Further, the EZDL dictionaries are compared with the results of the Online Dictionary Learning algorithm by Mairal et al. (2009a) and the Recursive Least Squares Dictionary Learning Algorithm by Skretting and Engan (2010) in terms of reproduction quality and learning speed. The evaluation methodology was as follows. First, dictionaries with different parameter sets were trained on 3.1 million 8 × 8 pixels natural image patches extracted from the "Foliage" collection of the McGill calibrated color image database (Olmos and Kingdom 2004). As in Sect. 4.2, 10 000 patches were picked from random positions from each of the desaturated and quantized images. All patches were normalized to zero mean and unit variance before training. The dictionaries were designed for a four times overcomplete representation, they had n := 256 atoms for samples with 64 pixels. After training, dictionary quality was Thom, Rapp, and Palm 1.00 Mean SSIM on Evaluation Images Mean SSIM on Evaluation Images 14 0.98 0.96 0.94 0.92 σH = 0.75, σI = 0.75 σH = 0.85, σI = 0.75 σH = 0.85, σI = 0.85 σH = 0.75, σI = 0.85 0.90 0.88 0.86 1 10 Number of Landweber Iterations 100 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.65 0.5 σH = 0.75 σH = 0.85 σH = 0.95 σH = 0.99 0.6 0.7 0.8 Inference Sparseness σI 0.9 1.0 (a) Reproduction quality in dependence on the number of Landweber (b) Achieved reproduction quality in dependence on the inference iterations carried out for inference. The four curves show different com- sparseness σI for four different dictionary sparseness degrees σH . Large binations of dictionary sparseness σH and inference sparseness σI . values of σH yield the best performance for large σI . Fig. 10 Results on the reproduction of entire images using Easy Dictionary Learning dictionaries. (a) While one Landweber iteration suffices for learning, better reproduction performance is yielded if the Landweber procedure is run until convergence. (b) The relation between the dictionary sparseness σH and the inference sparseness σI is influential. Hardly any information loss can be observed for σI < σH , while the case σI > σH shows dictionaries should be trained for very sparse code words when demanding such a sparseness for reproduction. measured using the 98 images of the "Flowers" collection from the same image database. This evaluation set was disjoint from the learning set. Each single image was subsequently divided into nonoverlapping blocks with 8 × 8 pixels. All blocks were normalized to zero mean and unit variance, and then the optimized dictionaries were used to infer a sparse code word for each block. The resulting code word was then fed through a linear generative model using the currently investigated dictionary, and the mean value and variance were restored to match that of the original block. Sparse code word inference was achieved with a projected Landweber procedure (Bredies and Lorenz 2008), essentially the same as projected gradient descent starting with the null vector. Using the sparseness-enforcing projection operator after each iteration, the code words were tuned to attain an inference sparseness σI , which need not necessarily be equal to the sparseness degree used for dictionary learning. The correlation coefficient was used as the similarity measure for inference to benefit from invariance to shifting and scaling. Automatic step size control was carried out with the bold driver heuristic (Bishop 1995). We note that due to the representation theorem on the sparseness projection this process can also be understood as Iterative SoftThresholding (Bredies and Lorenz 2008). A reproduced image is yielded by applying this procedure to all distinct blocks of the original image using a single dictionary. The deviation between this output image and the original image was assessed with the SSIM index (Wang and Bovik 2009), which yielded qualitatively similar results as the peak signal-to-noise ratio. The SSIM index is, however, normalized to values between zero and one, and it respects the local structure of images since it examines 11 × 11 pixels neighborhoods through convolution. Because it measures the visual similarity between images, it is more intuitive than measures based on the pixel-wise squared error (Wang and Bovik 2009). This evaluation method yielded one number from the interval [0, 1] for each image and dictionary. Each parameterization for dictionary learning was used to train five dictionaries to compensate probabilistic effects, and here the mean of the resulting 490 SSIMs is reported. 4.3.1 EZDL Results Figure 10 visualizes the results obtained for dictionaries produced by Easy Dictionary Learning using dictionary sparseness degrees σH ∈ { 0.75, 0.85, 0.95, 0.99 }. One thousand learning epochs were carried out, presenting 30 000 samples in each epoch, and using an initial step size of η0 := 1. During dictionary learning, only the first trivial iteration of a Landweber procedure is carried out for sparse code word inference by computing h := ΠσH (W T x) for the ordinary inference model. We first analyzed the impact of carrying out more Landweber iterations during the image reproduction phase, and the effect of varying the inference sparseness degree σI . A huge performance increase can be obtained by using more than one iteration for inference (Fig. 10a). Almost the optimal performance is achieved after ten iterations, and after one hundred iterations the method has converged. For σI = 0.75, the performance of dictionaries with σH = 0.75 and σH = 0.85 is about equal yielding the maximum SSIM of one. This value indicates that there is no visual difference between the reproduced images and the original images. 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.65 0.5 λ = 0.50 λ = 1.00 λ = 1.50 λ = 2.00 0.6 15 Mean SSIM on Evaluation Images Mean SSIM on Evaluation Images Efficient Dictionary Learning with Sparseness-Enforcing Projections 0.7 0.8 Inference Sparseness σI 0.9 1.0 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.65 0.5 ζ = 32 ζ = 16 ζ=8 ζ=4 0.6 0.7 0.8 Inference Sparseness σI 0.9 1.0 (a) Results of the Online Dictionary Learning (ODL) algorithm by (b) Results of the Recursive Least Squares Dictionary Learning AlgoMairal et al. (2009a), where λ trades off between sparseness and re- rithm (RLS-DLA) by Skretting and Engan (2010). Here, ζ denotes the production capabilities in a model with implicit sparseness constraints. target L0 pseudo-norm of the code words for inference. Fig. 11 Experimental results on image reproduction where alternative dictionary learning algorithms were used. The dictionaries behave similarly to Easy Dictionary Learning dictionaries if the dictionary sparseness parameter and the inference sparseness are varied. When the inference sparseness σI is increased to 0.85, a difference in the choice of the dictionary sparseness σH becomes noticeable. For σH = 0.85, performance already degrades, and the degradation is substantial if σH = 0.75. It is more intuitive when σH and σI are put in relation. Almost no information is lost in the reproduction by enforcing a lower inference sparseness than dictionary sparseness (σI < σH ). Performance is worse if σI > σH which is plausible because the dictionary was not adapted for a higher sparseness degree. In the natural case σI = σH the performance mainly depends on their concrete value, where higher sparseness results in worse reproduction capabilities. To further investigate this behavior, we set the number of Landweber iterations to 100 and varied σI smoothly in the interval [0.50, 1.0) for the four different dictionary sparseness degrees. The results of this experiment are depicted in Fig. 10b. For σI ≤ 0.80 there is hardly any difference in the reproduction quality irrespective of the value of σH . The difference when training dictionaries with different sparseness degrees first becomes visible for large values of σI . Performance is here better using dictionaries where very sparse code words were demanded during learning. Hence, tasks that require high code word sparseness should use dictionaries trained with high values of the dictionary sparseness. 4.3.2 Comparison with Alternative Dictionary Learning Algorithms For a comparison, we conducted experiments using the Online Dictionary Learning (ODL) algorithm of Mairal et al. (2009a) and the Recursive Least Squares Dictionary Learning Algorithm (RLS-DLA) by Skretting and Engan (2010). For inference of sparse code words, ODL minimizes the reproduction error under implicit sparseness constraints. RLS- DLA uses an external vector selection algorithm for inference, hence explicit constraints such as a target L0 pseudonorm can be demanded easily. Both algorithms update the dictionary after each sample presentation. ODL does not require any step sizes to be adjusted. The crucial parameter for dictionary sparseness here is a number λ ∈ R>0 , which controls the trade-off between reproduction capabilities and code word sparseness. We trained five dictionaries for each λ ∈ { 0.50, 1.00, 1.50, 2.00 } using n := 256 atoms and presenting 30 000 learning samples in each of one thousand epochs. Then, the same evaluation methodology as before with σI ∈ [0.50, 1.0) was used to assess the reproduction capabilities. The results are shown in Fig. 11a. The choice of λ is not as influential compared to σH in EZDL. There are only small performance differences for σI < 0.925, and for σI ≥ 0.925 hardly any difference can be observed. Similar to the EZDL experiments, large values of λ result in better performance for large σI and worse performance for small σI . RLS-DLA provides a forgetting factor parameter which behaves analogously to the step size in gradient descent. We used the default forgetting factor schedule which interpolates between 0.99 and 1 using a cubic function over one thousand learning epochs. For inference, we chose an optimized Orthogonal Matching Pursuit variant (GharaviAlkhansari and Huang 1998) where a parameter ζ ∈ N controls the number of non-vanishing coordinates in the code words. We trained five dictionaries with n := 256 atoms for each ζ ∈ { 4, 8, 16, 32 }. Thirty thousand randomly drawn learning samples were presented in each learning epoch. The resulting reproduction performance is shown in Fig. 11b. Again, for large values of σI the dictionaries with the most sparse code words during learning perform best, that is those trained with small values of ζ . Thom, Rapp, and Palm 1.00 Mean SSIM on Evaluation Images Mean SSIM on Evaluation Images 16 0.98 0.96 0.94 0.92 0.90 0.88 0.86 0.84 0.82 0.5 ODL by Mairal et al. (2009a) RLS-DLA by Skretting and Engan (2010) EZDL (this Paper) 0.6 0.7 0.8 Inference Sparseness σI 0.9 1.0 Fig. 12 Comparison of dictionary performance when the dependency on the dictionary sparseness degrees λ , ζ and σH was eliminated, for ODL, RLS-DLA and EZDL, respectively. All three algorithms produce dictionaries equally well-suited to the reproduction of entire images. To compare all three dictionary learning algorithms independent of the concrete dictionary sparseness, we took the mean SSIM value that belonged to the best performing dictionaries for each feasible value of σI . This can also be interpreted as using the convex hull of the results shown in Fig. 10b and Fig. 11. This yielded one curve for each dictionary learning algorithm, depicted in Fig. 12. There is only a minor difference between the curves over the entire range of σI . It can hence be concluded that the algorithms learn dictionaries which are equally well-suited for the reproduction of entire images. Although EZDL uses a very simple learning rule, this is sufficient enough to achieve a performance competitive with that of two state-of-the-art dictionary learning algorithms. 4.3.3 Comparison of Learning Speed We moreover compared the learning speed of the methods and investigated the influence of the initial step size on the EZDL dictionaries. In doing so, we carried out reproduction experiments on entire images using dictionaries provided by the learning algorithms after certain numbers of learning epochs. In each of one thousand overall epochs, 30 000 learning samples where input to all three algorithms. The dictionary sparseness parameters were set to σH := 0.99 for EZDL, to λ := 2.00 for Online Dictionary Learning, and to ζ := 4 for the Recursive Least Squares Dictionary Learning Algorithm. Timing measurements on an Intel Core i7-4960X processor have shown that one EZDL learning epoch takes approximately 30 % less time than a learning epoch of ODL. RLS-DLA was roughly 25 times slower than EZDL. Although the employed vector selection method was present as part of an optimized software library, only a fairly unoptimized implementation of the actual learning algorithm was 0.86 0.85 0.84 0.83 0.82 0.81 ODL RLS-DLA EZDL (η0 = 1) EZDL (η0 = 1/4) EZDL (η0 = 1/16) 0.80 1 10 100 1000 Number of Learning Epochs (Each 30 000 Samples) Fig. 13 Reproduction quality in dependence on the number of samples presented to Online Dictionary Learning, the Recursive Least Squares Dictionary Learning Algorithm, and Easy Dictionary Learning, where the initial step size η0 was varied for the latter. All approaches achieved the same performance after 1000 learning epochs. available. Therefore, a comparison of this algorithm with regard to execution speed would be inequitable. The inference sparseness was set to σI := 0.99 and one hundred Landweber iterations were carried out for sparse code word inference. The SSIM index was eventually used to assess the reproduction performance. Figure 13 visualizes the results of the learning speed analysis, averaged over all images from the evaluation set and five dictionaries trained for each parameterization to compensate probabilistic effects. Online Dictionary Learning is free of step sizes, dictionary performance increased instantly and constantly with each learning epoch. Only small performance gains could be observed after 100 learning epochs. The performance of dictionaries trained with RLS-DLA was initially better than that of the ODL dictionaries, but improved more slowly. After a hundred epochs, however, it was possible to observe a significant performance gain. Although tweaking the forgetting factor schedule may have led to better early reproduction capabilities, RLS-DLA achieved a performance equivalent to that of ODL after 1000 epochs. If EZDL’s initial step size was set to unity, performance first degraded, but started to improve after the fifth epoch. After 100 epochs, the performance was identical to ODL’s, and all three methods obtained equal reproduction capabilities after 1000 epochs. Reduction of the initial step size caused the dictionaries to perform better after few sample presentations. The quality of Online Dictionary Learning was achieved after 20 epochs for η0 = 1/4, and for η0 = 1/16 the EZDL dictionaries were always better in the mean until the 100th epoch. There is hardly any quality difference after 1000 epochs, a very small initial step size resulted however in a slightly worse performance. The choice of the initial step size for EZDL is hence not very influential. Although η0 = 1 caused small overfitting during the very first epochs, the dictionaries quickly recov- ered so that no significant difference in reproduction capabilities could be observed after 100 epochs. Since an EZDL epoch is 30 % faster than an Online Dictionary Learning epoch, our proposed method produces better results earlier on an absolute time scale. 4.4 Image Denoising Experiments We have demonstrated in Sect. 4.3 that dictionaries learned with Easy Dictionary Learning are as good as those obtained from the Online Dictionary Learning algorithm of Mairal et al. (2009a) and the Recursive Least Squares Dictionary Learning Algorithm by Skretting and Engan (2010) in terms of the reproduction quality of entire images. In a final experiment, we investigated the suitability of EZDL dictionaries for image denoising using the image enhancement procedure proposed by Mairal et al. (2009b). This method carries out semi-local block matching and finds sparse code words by imposing a group sparseness penalty on the Euclidean reproduction error. In doing so, a pre-learned dictionary is used which explains the appearance of uncorrupted images and further helps to resolve ambiguities if block matching fails to provide large enough groups. A linear generative model is finally used to find estimators of denoised image patches from the sparse code words. This procedure is quite robust if the input data is noisy, since sparseness provides a strong prior which well regularizes this ill-posed inverse problem (Kreutz-Delgado et al. 2003; Foucart and Rauhut 2013). The denoising approach of Mairal et al. (2009b) also provides the possibility of dictionary adaptation while denoising concrete input data. We did not use this option as it would hinder resilient statements on a dictionary’s eligibility if it would be modified with another dictionary learning algorithm during denoising. The methodology of the experiment was as follows. We used the four-times overcomplete dictionaries trained on the 8 × 8 pixels image patches from the "Foliage" collection of the McGill calibrated color image database (Olmos and Kingdom 2004) as models for uncorrupted images. The dictionary sparseness parameters were σH := 0.99 for EZDL, λ := 2.00 for ODL and ζ := 4 for RLS-DLA. For evaluation, we used the 81 images of the "Animals" collection from the McGill database, and converted them to 8-bit grayscales as in the previous experiments. The images were synthetically corrupted with additive white Gaussian noise. Five noisy images were generated for each original image and each standard deviation from { 2.5, 5.0, . . . , 47.5, 50.0 }. These images were then denoised using the candidate dictionaries, where the window size for block matching was set to 32 pixels. Then, the similarity between the reconstructions and the original images was measured with the 17 Mean PSNR [dB] on Evaluation Images Efficient Dictionary Learning with Sparseness-Enforcing Projections 42 ODL by Mairal et al. (2009a) RLS-DLA by Skretting and Engan (2010) EZDL (this Paper) 40 38 36 34 32 30 28 26 5 10 15 20 25 30 35 40 Standard Deviation of Gaussian Noise 45 50 Fig. 14 Denoising performance in terms of the peak signal-to-noise ratio (PSNR) using the denoising method proposed by Mairal et al. (2009b). There is only a small performance difference between dictionaries trained with ODL, RLS-DLA and EZDL. peak signal-to-noise ratio. We also evaluated the SSIM index, which led to qualitatively similar results. The results are depicted in Fig. 14. Denoising performance degrades if the noise strength is increased. There is hardly any difference between the dictionaries trained with the three algorithms. The RLS-DLA and EZDL dictionaries perform slightly better for small synthetic noise levels, but this improvement is visually imperceptible. This result is not surprising, since Sect. 4.3 demonstrated that all three learning algorithms produce dictionaries equally well-suited for the reproduction of entire images. The denoising procedure of Mairal et al. (2009b) aims at reproduction capabilities as well, with the modification of employing noisy samples as input. Image enhancement and compression applications such as those proposed by Yang et al. (2010, 2012), Dong et al. (2011), Skretting and Engan (2011) and Horev et al. (2012) which also use problem formulations based on the reproduction error can hence be expected to benefit from more efficiently learned dictionaries as well. 5 Conclusions This paper proposed the EZDL algorithm which features explicit sparseness constraints with respect to Hoyer’s smooth sparseness measure σ . Pre-defined sparseness degrees are ensured to always be attained using a sparseness-enforcing projection operator. Building upon a succinct representation of the projection, we proved that the projection problem can be formulated as a root-finding problem. We presented a linear time and constant space algorithm for the projection which is superior to previous approaches in terms of theoretical computational complexity and execution time on real computing machines. EZDL adapts dictionaries to measurement data through simple rank-1 updates. The sparseness projection serves as 18 foundation for sparse code word inference. Due to the projection efficiency and since no complicated gradients are required, our proposed learning algorithm is significantly faster than even the optimized ODL algorithm. Topographic atom organization and atom sparseness can be realized with very simple extensions, allowing for versatile sparse representations of data sets. Its simplicity and efficiency does not hinder EZDL from producing dictionaries competitive with those generated by ODL and RLS-DLA in terms of the reproduction and denoising performance on natural images. Alternative image processing methods based on sparse representations rely on dictionaries subject to the same criteria, and can thus be expected to benefit from EZDL’s advantages as well. Acknowledgements The authors are grateful to Heiko Neumann, Florian Schüle, and Michael Gabb for helpful discussions. We would like to thank Julien Mairal and Karl Skretting for making implementations of their algorithms available. Parts of this work were performed on the computational resource bwUniCluster funded by the Ministry of Science, Research and Arts and the Universities of the State of BadenWürttemberg, Germany, within the framework program bwHPC. This work was supported by Daimler AG, Germany. Thom, Rapp, and Palm Representation Theorem Before proving a theorem on the characterization of the projection onto T , we first fix some notation. As above, let ei ∈ Rn denote the i-th canonical basis vector and let furthermore e := ∑ni=1 ei ∈ Rn be the vector where all entries are one. We note that if a point x resides in the non-negative orthant, then kxk1 = eT x. Subscripts to vectors denote the corresponding coordinate, except for e and ei . For example, we have that xi = eTi x. We abbreviate ξ ∈ R≥0 with ξ ≥ 0 when it is clear that ξ is a real number. When I ⊆ {1, . . . , n} is an index set with d := |I| elements, say i1 < · · · < id , then the unique matrix VI ∈ { 0, 1 }d×n with T VI x = xi1 , . . . , xid ∈ Rd for all x ∈ Rn is called the slicing operator. A useful relation between the L0 pseudo-norm, the Manhattan norm √ 1/2 and the Euclidean norm is kxk2 ≤ kxk1 ≤ kxk0 kxk2 ≤ n kxk2 for all points x ∈ Rn . We are now in a position to formalize the representation theorem: Theorem 1 Let x ∈ Rn≥0 \ T and p := projT (x) be unique. Then there is exactly one number α ∗ ∈ R such that p = β ∗ · max (x − α ∗ · e, 0) , where β ∗ := λ2/kmax(x−α ∗ ·e, 0)k2 > 0 is a scaling constant. Moreover, if I := { i ∈ {1, . . . , n} | pi > 0 } = {i1 , . . . , id }, d := |I| and i1 < · · · < id , denotes the set of the d coordinates in which p does not vanish, then   s 2 2 kV kV 1 d xk − xk I I 2 1 α ∗ = kVI xk1 − λ1 . d dλ22 − λ12 Appendix: Technical Details and Proofs for Section 2 This appendix studies the algorithmic computation of Euclidean projections onto level sets of Hoyer’s σ in greater detail, and in particular proves the correctness of the algorithm proposed in Sect. 2. For a non-empty subset M ⊆ Rn of the Euclidean space and a point x ∈ Rn , we call projM (x) := { y ∈ M | ky − xk2 = infz∈M kz − xk2 } the set of Euclidean projections of x onto M (Deutsch 2001). Since we only consider situations in which projM (x) = { y } is a singleton, we may also write y = projM (x). Without loss of generality, we can compute projT (x) for a vector x ∈ Rn≥0 within the non-negative orthant instead of projS (x) for an arbitrary point x ∈ Rn to yield sparseness-enforcing projections, where T and S are as defined in Sect. 2. First, the actual scale is irrelevant as we can simply re-scale the result of the projection (Thom and Palm 2013, Remark 5). Second, the constraint that the projection lies in the non-negative orthant Rn≥0 can easily be handled by flipping the signs of certain coordinates (Thom and Palm 2013, Lemma 11). Finally, all entries of x can be assumed non-negative with Corollary 19 from Thom and Palm (2013). We note that T is non-convex because of the ksk2 = λ2 constraint. Moreover, T 6= 0/ for all target sparseness degrees σ ∗ ∈ (0, 1) which we show here by construction (see also Remark √ 18 in√Thom  and Palm (2013) for further details): Let ψ := λ1 − nλ22 −λ12/ n−1 /n > 0 and n−1 ω := λ1 − (n − 1)ψ > 0, then the point q := ∑i=1 ψei + ωen ∈ Rn lies n in T , where ei ∈ R denotes the i-th canonical basis vector. Since all coordinates of q are positive, T always contains points with an L0 pseudonorm of n. If we had used the L0 pseudo-norm to measure sparseness, then q would have the same sparseness degree as, for example, the vector with all entries equal to unity. If, however, σ ∗ is close to one, then there is only one large value ω in q and all the other entries equaling ψ are very small but positive. This simple example demonstrates that in situations where the presence of noise cannot be eliminated, Hoyer’s σ is a much more robust sparseness measure than the L0 pseudo-norm. Proof It is possible to prove this claim either constructively or implicitly, where both variants differ in whether the set I of all positive coordinates in the projection can be computed from x or must be assumed to be known. We first present a constructive proof based on a geometric analysis conducted in Thom and Palm (2013), which contributes to deepening our insight into the involved computations. As an alternative, we also provide a rigorous proof using the method of Lagrange multipliers which greatly enhances the unproven analysis of Potluru et al. (2013, Section 3.1). We first note that when there are α ∗ ∈ R and β ∗ > 0 so that we have p = β ∗ ·max (x − α ∗ · e, 0), then β ∗ is determined already through α ∗ because it holds that λ2 = kpk2 = β ∗ · kmax (x − α ∗ · e, 0)k2 . We now show that the claimed representation is unique, and then present the two different proofs for the existence of the representation. Uniqueness: It is d ≥ 2, since d = 0 would violate that kpk1 > 0 and d = 1 is impossible because σ ∗ 6= 1. We first show that there are two distinct indices i, j ∈ I with pi 6= p j . Assume this was not the case, then pi =: γ, say, for all i ∈ I. Let j := arg mini∈I xi be the index of the√smallest coordinate of x which has its index in I. Let  √ ψ := λ1 − dλ22 −λ12/ d−1 /d ∈ R and ω := λ1 − (d − 1)ψ ∈ R be numbers and define s := ∑i∈I\{ j } ψei + ωe j ∈ Rn . Then s ∈ T like in the argument where we have shown that T is non-empty. Because of kpk1 = ksk1 and kpk2 = ksk2 , it follows that kx − pk22 − kx − sk22 = 2xT (s − p) = 2 ∑i∈I\{ j } xi (ψ − γ) + 2x j (ω − γ) ≥ 2x j ((d − 1)ψ + ω − dγ) = 2x j (ksk1 − kpk1 ) = 0. Hence s is at least as good an approximation to x as p, violating the uniqueness of p. Therefore, it is impossible that the set { pi | i ∈ I } is a singleton. Now let i, j ∈ I with pi 6= p j and α1∗ , α2∗ , β1∗ , β2∗ ∈ R such that p = β1∗ · max (x − α1∗ · e, 0) = β2∗ · max (x − α2∗ · e, 0). Clearly β1∗ 6= 0 and β2∗ 6= 0 as d 6= 0. It is 0 6= pi − p j = β1∗ (xi − α1∗ ) − β1∗ (x j − α1∗ ) = β1∗ (xi − x j ), thus xi 6= x j holds. Moreover, 0 = pi − p j + p j − pi = (β1∗ − β2∗ )(xi − x j ), hence β1∗ = β2∗ . Finally, we have that 0 = pi − pi = β1∗ (xi − α1∗ ) − β2∗ (xi − α2∗ ) = β1∗ (α2∗ − α1∗ ), which yields α1∗ = α2∗ , and hence the representation is unique. Existence (constructive): Let H := { a ∈ Rn | eT a = λ1 } be the hyperplane on which all points in the non-negative orthant have an L1 Efficient Dictionary Learning with Sparseness-Enforcing Projections norm of λ1 and let C := Rn≥0 ∩ H be a scaled canonical simplex. Further, let L := { q ∈ H | kqk2 = λ2 } be a circle on H, and for an arbitrary index set I ⊆ {1, . . . , n} let LI := { a ∈ L | ai = 0 for all i 6∈ I } be a subset of L where all coordinates not indexed by I vanish. With Theorem 2 and Appendix D from Thom and Palm (2013) there exists a finite sequence of index sets I1 , . . . , Ih ⊆ {1, . . . , n} with I j ) I j+1 for j ∈ {1, . . . , h − 1} such that projT (x) is the result of the finite sequence r(0) := projH (x), s(0) := projL (r(0)), r(1) := projC (s(0)), s(1) := projLI (r(1)), . . . r( j) := projC (s( j − 1)), s( j) := projLI (r( j)), . . . r(h) := projC (s(h − 1)), s(h) := projLI (r(h)) = p. 1 j h All intermediate projections yield unique results because p was restricted to be unique. The index sets contain the indices of the entries that survive the projections onto C, I j := { i ∈ {1, . . . , n} | ri ( j) 6= 0 } for j ∈ {1, . . . , h}. In other words, p can be computed from x by alternating projections, where the sets L and LI j are non-convex for all j ∈ {1, . . . , h}. The expressions for the individual projections are given in Lemma 13, Lemma 17, Proposition 24, and Lemma 30, respectively, in Thom and Palm (2013). Let I0 := {1, . . . , n} for completeness, then we can define the following constants for j ∈ {0, . . . , h}. Let d j := I j be the number of relevant coordinates in each iteration, and let s  d j λ22 − λ12 1  β j := and α j := kVI j xk1 − λβ1j 2 2 dj d j kVI j xk2 − kVI j xk1 be real numbers. We have that d j λ22 −λ12 ≥ dh λ22 −λ12 ≥ 0 by construction which implies β j > 0 for all j ∈ {0, . . . , h}. We now claim that the following holds: (a) (b) (c) (d) si ( j) = β j · (xi − α j ) for all i ∈ I j for all j ∈ {0, . . . , h}. α0 ≤ · · · ≤ αh and β0 ≤ · · · ≤ βh . xi ≤ α j for all i 6∈ I j for all j ∈ {0, . . . , h}. p = βh · max (x − αh · e, 0). We start by showing (a) with induction. For j = 0, we have r(0) = x + 1/n · (λ1 − kxk1 ) e using Lemma 13 from Thom and Palm (2013). With Lemma 17 stated in Thom and Palm (2013), we   have s(0) = δ r(0) + (1 − δ )m with m = λ1/n · e and δ 2 = λ22 − λ12/n kr(0) − mk22 . We see that kr(0) − mk22 = kx − kxk1/n · ek22 = kxk22 − kxk21/n and therefore δ = β0 , and thus s(0) = β0 · (x − 1/n · (kxk1 − λ1/β0 ) e), so the claim holds for the base case. Suppose that (a) holds for j and we want to show it also holds for j + 1. It is r( j + 1) = projC (s( j)) by definition, and Proposition 31 in Thom and Palm (2013) implies r( j + 1) = max (s( j) − tˆ · e, 0) where  tˆ ∈ R can be expressed explicitly as tˆ = 1/d j+1 · ∑i∈I j+1 si ( j) − λ1 , which is the mean value of the entries that survive the simplex projection up to an additive constant. We note that tˆ is here always nonnegative, see Lemma 28(a) in Thom and Palm (2013), which we will need to show (b). Since I j+1 ( I j we yield si ( j) = β j · (xi − α j ) for all i ∈ I j+1 with the induction hypothesis,  and therefore we have that tˆ = 1/d j+1 · β j kVI j+1 xk1 −d j+1 β j α j −λ1 . We find that ri ( j +1) > 0 for i ∈ I j+1 by definition, and we can omit the rectifier so that ri ( j + 1) = si ( j) − tˆ. Using the induction hypothesis and the expression for tˆ we have ri ( j + 1) = β j xi − β j/d j+1 · kVI j+1 xk1 + λ1/d j+1 . For projecting onto LI j+1 , the distance between r( j + 1) and mI j+1 = λ1/d j+1 · ∑i∈I j+1 ei is  required for computation of δ 2 = λ22 − λ12/d j+1 kr( j + 1) − mI j+1 k22 , so that Lemma 30 from Thom and Palm (2013) can be applied. We have that kr( j + 1) − mI j+1 k22 = ∑i∈I j+1 β j xi − β j/d j+1 · kVI j+1 xk1 2 =  β j2 · kVI j+1 xk22 − kVI j+1 xk21/d j+1 , and further δ = β j+1/β j . Now let i ∈ I j+1 be an index, then we have si ( j + 1) = δ ri ( j + 1) + (1 − δ ) · λ1/d j+1 = β j+1 · xi − 1/d j+1 · kVI j+1 xk1 − λ1/β j+1 using Lemma 30 from Thom and Palm (2013). Therefore (a) holds for all j ∈ {0, . . . , h}. 19 Let us now turn to (b). From the last paragraph, we know that δ = β j+1/β j for all j ∈ {0, . . . , h − 1} for the projections onto LI j+1 . On the other hand, we have that kr( j +1)−mI j+1 k22 = kr( j +1)k22 − λ12/d j+1 from the proof of Lemma 30(a) from Thom and Palm (2013), and kr( j + 1)k22 ≤ λ22 holds from the proof of Lemma 28(f) in Thom and Palm (2013), so δ ≥ 1 which implies β0 ≤ · · · ≤ βh . As noted above, the separator for projecting onto C satisfies tˆ ≥ 0 for all j ∈ {0, . . . , h − 1}. By rearranging this inequalityand using β j ≤ β j+1 , we conclude that α j ≤ 1/d j+1 · kVI j+1 xk1 − λ1/β j ≤ α j+1 , hence α0 ≤ · · · ≤ αh . For (c) we want to show that the coordinates in the original vector x which will vanish in some iteration when projecting onto C are already small. The base case j = 0 of an induction for j is trivial since the complement of I0 is empty. In the induction step, we note that the complement of I j+1 can be partitioned into ICj+1 = ICj ∪ I j ∩ ICj+1 since I j+1 ( I j . For i ∈ ICj we already know that xi ≤ α j ≤ α j+1 by the induction hypothesis and (b). We have shown in (a) that si ( j) = β j · (xi − α j ) for all i ∈ I j , and if i ∈ I j \ I j+1 then si ( j) ≤ tˆ since 0 = ri ( j + 1) = max (si ( j) − tˆ, 0). By substituting the explicit expression  for tˆ and solving for xi we yield xi ≤ 1/d j+1 · kVI j+1 xk1 − λ1/β j ≤ α j+1 , and hence the claim holds for all i 6∈ I j+1 . If we can now show that (d) holds, then the claim of the theorem follows by setting α ∗ := αh and β ∗ := βh . We note that by construction p = s(h) and si (h) ≥ 0 for all coordinates i ∈ {1, . . . , n}. When i ∈ Ih , then si (h) = βh · (xi − αh ) with (a), which is positive by requirement, so when the rectifier is applied nothing changes. If i 6∈ Ih then xi − αh ≤ 0 by (c), and indeed βh · max (xi − αh , 0) = 0 = si (h). The expression therefore holds for all i ∈ {1, . . . , n}, which completes the constructive proof of existence. Existence (implicit): Existence of the projection is guaranteed by the Weierstraß extreme value theorem since T is compact. Now let f : Rn → R, s 7→ ks − xk22 , be the objective function, and let the constraints be represented by the functions h1 : Rn → R, s 7→ eT s − λ1 , h2 : Rn → R, s 7→ ksk22 − λ22 , and gi : Rn → R, s 7→ −si , for all indices i ∈ {1, . . . , n}. All these functions are continuously differentiable. If p = projT (x), then p is a local minimum of f subject to h1 (p) = 0, h2 (p) = 0 and g1 (p) ≤ 0, . . . , gn (p) ≤ 0. For application of the method of Lagrange multipliers we first have to show that p is regular, which means that the gradients of h1 , h2 and gi for i 6∈ I evaluated in p must be linearly independent (Bertsekas 1999, Section 3.3.1). Let J := IC = { j1 , . . . , jn−d }, say, then |J| ≤ n − 2 since d ≥ 2. Hence we have at most n vectors from Rn for which we have to show linear independence. Clearly h01 (s) = e, h02 (s) = 2s and g0i (s) = −ei for all i ∈ {1, . . . , n}. Now let u1 , u2 ∈ R and v ∈ Rn−d n with u1 e + 2u2 p − ∑n−d µ=1 vµ e jµ = 0 ∈ R . Then, let µ ∈ {1, . . . , n − d}, then p jµ = 0 by definition of I and hence by pre-multiplication of the equation above with eTjµ we yield u1 − vµ = 0 ∈ R. Therefore u1 = vµ for all µ ∈ {1, . . . , n − d}. On the other hand, if i ∈ I then pi > 0 and eTi e jµ = 0 for all µ ∈ {1, . . . , n − d}. Hence u1 + 2u2 pi = 0 ∈ R for all i ∈ I. In the first paragraph of the uniqueness proof we have shown there are two distinct indices i, j ∈ I with pi 6= p j . Since u1 + 2u2 pi = 0 = u1 + 2u2 p j and thus 0 = 2u2 (pi − p j ) we can conclude that u2 = 0, which implies u1 = 0. Then v1 = · · · = vn−d = 0 as well, which shows that p is regular. The Lagrangian is L : Rn × R × R × Rn → R, (s, α, β , γ) 7→ f (s) + αh1 (s) + β h2 (s) + ∑ni=1 γi gi (s), and its derivative with respect to its first argument s is given by L0 (s, α, β , γ) := ∂/∂ s L(s, α, β , γ) = 2(s−x)+α ·e+2β ·s−γ ∈ Rn . Now, Proposition 3.3.1 from Bertsekas (1999) guarantees the existence of Lagrange multipliers α̃, β̃ ∈ R and γ̃ ∈ Rn with L0 (p, α̃, β̃ , γ̃) = 0, γ̃i ≥ 0 for all i ∈ {1, . . . , n} and γ̃i = 0 for i ∈ I. Assume β̃ = −1, then 2x = α̃ · e − γ̃ since the derivative of L must vanish. Hence xi = α̃/2 for all i ∈ I, and therefore { pi | i ∈ I } is a singleton with Remark 10 from Thom and Palm (2013) as p was assumed unique and T is permutation-invariant. We have seen earlier that this is absurd, so β̃ 6= −1 must hold. 20 Thom, Rapp, and Palm Write α ∗ := α̃/2, β ∗ := 1/(β̃ +1) and γ ∗ := γ̃/2 for notational convenience. We then obtain p = β ∗ (x − α ∗ · e + γ ∗ ) because L0 vanishes. Then h1 (p) = 0 implies that λ1 = ∑i∈I pi = ∑i∈I β ∗ (xi − α ∗ ) = β ∗ (kVI xk1 − dα ∗ ), and with h2 (p) = 0 follows that λ22 = ∑i∈I p2i = (β ∗ )2 · (kVI xk22 − 2α ∗ kVI xk1 + d · (α ∗ )2 ). By taking the ratio λ12/λ22 and after elementary algebraic transformations we arrive at the quadratic  equation a · (α ∗ )2 + b · α ∗ + c = 0, where a := d · d − λ12/λ22 , b :=  2 2 2 2 2kVI xk1 · λ1 /λ22 − d and c := kVI xk1 −kVI xk2 · λ1 /λ22 are reals. The dis  criminant is ∆ := b2 −4ac = 4· λ12/λ22 · d − λ12/λ22 · dkVI xk22 −kVI xk21 . Since VI x ∈ Rd we have that dkVI xk22 −kVI xk21 ≥ 0. Moreover, the number d is not arbitrary. As p exists by the Weierstraß extreme value√ theorem with kpk0 = d, kpk1 = λ1 and kpk2 = λ2 , we find that λ1 ≤ dλ2 and hence ∆ ≥ 0, so there must be a real solution to the equation above. Solving the equation shows that s ( !) dkVI xk22 − kVI xk21 1 ∗ α ∈ kVI xk1 ± λ1 , d dλ22 − λ12 We call Ψ well-defined if all requirements from the definition are met. Note that the situation where σ (x) ≥ σ ∗ is trivial, because in this sparseness-decreasing setup we have that all coordinates of the projection must be positive. Hence I = {1, . . . , n} in Theorem 1, and α ∗ can be computed with the there provided formula. We need more notation to describe the properties of Ψ . Let x ∈ Rn be a point. We write X := { xi | i ∈ {1, . . . , n}} for the set that contains the entries of x. Let xmin := min X be short for the smallest entry of x, and xmax := max X and x2nd-max := max X \ { xmax } denote the two largest entries of x. Further, q : R → Rn , α 7→ max (x − α · e, 0), denotes the curve that evolves from application of the soft-shrinkage function to x. The Manhattan norm and Euclidean norm of points from q is given by `1 : R → R, α 7→ kq(α)k1 , and `2 : R → R, α 7→ kq(α)k2 , respectively. Therefore, Ψ = `1/`2 − λ1/λ2 and Ψ̃ from Sect. 4.1 can be written as `21/`22 − λ12/λ22 , such that its derivative can be expressed in terms of Ψ 0 using the chain rule. The next result provides statements on the auxiliary function’s analytical nature and links its zero with the projection onto T : hence from h1 (p) = 0 we obtain   q .q dkVI xk22 − kVI xk21 . β ∗ ∈ ∓ dλ22 − λ12 Lemma 3 Let x ∈ Rn≥0 \ T be given such that the auxiliary function Ψ is well-defined. Then the following holds: Suppose α ∗ is the number that arises from the "+" before the square root, then β ∗ is the number with the "−" sign, thus β ∗ < 0. We have seen earlier that there are two distinct indices i, j ∈ I with pi 6= p j . We can assume pi > p j , then 0 < pi − p j = β ∗ (xi − x j ) which implies that xi < x j . This is not possible as it violates the order-preservation property of projections onto permutation-invariant sets (Lemma 9(a) from Thom and Palm 2013). Thus our choice of α ∗ was not correct in the first place, and α ∗ must be as stated in the claim. It remains to be shown that p is the result of a soft-shrinkage function. If i ∈ I, then 0 < pi = β ∗ (xi − α ∗ ), and β ∗ > 0 shows xi > α ∗ such that pi = β ∗ · max (xi − α ∗ , 0). When i 6∈ I, we have 0 = pi = β ∗ (xi − α ∗ + γi∗ ) where γi∗ ≥ 0 and still β ∗ > 0, thus xi ≤ α ∗ and pi = β ∗ · max (xi − α ∗ , 0) holds. Therefore, the representation holds for all entries. t u Finding the set I containing the indices of the positive coordinates of the projection result is the key for algorithmic computation of the projection. Based on the constructive proof this could, for example, be achieved by carrying out alternating projections whose run-time complexity is between quasi-linear and quadratic in the problem dimensionality n and whose space complexity is linear. An alternative is the method proposed by Potluru et al. (2013), where the input vector is sorted and then each possible candidate for I is checked. Due to the sorting, I must be of the form I = {1, . . . , d}, where now only d is unknown (see also the proof of Theorem 3 from Thom and Palm 2013). Here, the run-time complexity is quasi-linear and the space complexity is linear in the problem dimensionality since also the sorting permutation has to be stored. When n gets large, algorithms with a smaller computational complexity are mandatory. Properties of the Auxiliary Function We have already informally introduced the auxiliary function in Sect. 2.2. Here is a satisfactory definition: Definition 2 Let x ∈ Rn≥0 \ T be a point such that projT (x) is unique and σ (x) < σ ∗ . Let xmax denote the maximum entry of x, then Ψ : [0, xmax ) → R, α 7→ kmax (x − α · e, 0)k1 λ1 − , kmax (x − α · e, 0)k2 λ2 is called auxiliary function for the projection onto T . (a) Ψ is continuous on [0, xmax ). (b) Ψ is differentiable on [0, xmax ) \ X . (c) Ψ is strictly decreasing on [0, x2nd-max ), and on [x2nd-max , xmax ) it is constant. (d) There is exactly one α ∗ ∈ (0, x2nd-max ) with Ψ (α ∗ ) = 0. It is then projT (x) = (λ2/`2 (α ∗ )) · q(α ∗ ). Proof In addition to the original claim, we also give explicit expressions for the derivative of Ψ and higher derivatives thereof in part (c). These are necessary to show that Ψ is strictly decreasing and constant, respectively, on the claimed intervals and for the explicit implementation of Algorithm 2. (a) The function q is continuous because so is the soft-shrinkage function. Hence `1 , `2 and Ψ are continuous as compositions of continuous functions. (b) The soft-shrinkage function is differentiable everywhere except at its offset. Therefore, Ψ is differentiable everywhere except for when its argument coincides with an entry of x, that is on [0, xmax )\X . (c) We start with deducing the first and second derivative of Ψ . Let x j , xk ∈ X ∪ { 0 }, x j < xk , such that there is no element from X between them. We here allow x j = 0 and xk = xmin when 0 6∈ X for completeness. Then the index set I := { i ∈ {1, . . . , n} | xi > α } of nonvanishing coordinates in q is constant for α ∈ (x j , xk ), and the derivative of Ψ can be computed using a closed-form expression. For this, let d := |I| denote the number of non-vanishing coordinates in q on that interval. With `1 (α) = ∑i∈I (xi − α) = ∑i∈I xi − dα we obtain `01 (α) = −d. Analogously, it is ∂/∂ α `2 (α)2 =p∂/∂ α ∑i∈I (xi − α)2 = −2`1 (α), and the chain rule yields `02 (α) = ∂∂α `2 (α)2 = −`1 (α)/`2 (α). Applica tion of the quotient rule gives Ψ 0 (α) = `1 (α)2/`2 (α)2 − d /`2 (α). The second derivative is of similar form. We find ∂/∂ α `1 (α)2 = −2d`1 (α), and hence ∂/∂ α `1 (α)2/`2 (α)2 = 2 (`1 (α)/`2 (α)2 ) · `1 (α)2/`2 (α)2 − d . We have ∂/∂ α (1/`2 (α)) = `1 (α)/`2 (α)3 and with the product rule we see that Ψ 00 (α) = 3 (`1 (α)/`2 (α)3 ) · `1 (α)2/`2 (α)2 − d = 3Ψ 0 (α) · `1 (α)/`2 (α)2 . First let α ∈ (x2nd-max , xmax ). It is then d = 1, that is q has exactly one non-vanishing coordinate. In this situation we find `1 (α) = `2 (α) and Ψ 0 ≡ 0 on (x2nd-max , xmax ), thus Ψ is constant on (x2nd-max , xmax ) as a consequence of the mean value theorem from real analysis. Because Ψ is continuous, it is constant even on [x2nd-max , xmax ). Next let α ∈ [0, x2nd-max ) \ X , and let x j , xk , I and d as in the first paragraph. We have d ≥ 2 since α < x2nd-max . It is furthermore √ `1 (α) ≤ d`2 (α) as d = kq(α)k0 . This inequality is in fact strict, because q(α) has at least two distinct nonzero entries. Hence Ψ 0 is negative on the interval (x j , xk ), and the mean value theorem guarantees that Ψ is strictly decreasing on this interval. This property holds for the entire interval [0, x2nd-max ) due to the continuity of Ψ . Efficient Dictionary Learning with Sparseness-Enforcing Projections (d) The requirement σ (x) < σ ∗ implies kxk1/kxk2 > λ1/λ2 and thus Ψ (0) > 0. Let α ∈ (x2nd-max , xmax ) be arbitrary, then `1 (α) = `2 (α) as in (c), and hence Ψ (α) < 0 since λ2 < λ1 must hold. The existence of α ∗ ∈ [0, x2nd-max ) with Ψ (α ∗ ) = 0 then follows from the intermediate value theorem and (c). Uniqueness of α ∗ is guaranteed because Ψ is strictly monotone on the relevant interval. Define p := projT (x), then with Theorem 1 there is an α̃ ∈ R so that p = (λ2/k max(x−α̃·e, 0)k2 ) · max (x − α̃ · e, 0) = (λ2/`2 (α̃)) · q(α̃). Since p ∈ T we obtain Ψ (α̃) = 0, and the uniqueness of the zero of Ψ implies that α ∗ = α̃. t u 21 Algorithm 2 Linear time and constant space evaluation of the auxiliary function Ψ . Input: Point to be projected x ∈ Rn≥0 , target norms λ1 , λ2 ∈ R, position α ∈ [0, xmax ) where Ψ should be evaluated. Output: Values Ψ (α), Ψ 0 (α), Ψ 00 (α), Ψ̃ (α), Ψ̃ 0 (α) ∈ R, finished ∈ { true, false } indicating whether the correct interval has been found, numbers `1 , `22 ∈ R and d ∈ N needed to exactly compute α ∗ with Ψ (α ∗ ) = 0. 1 As described in Sect. 2.3, the exact value of the zero α ∗ of Ψ can be found by inspecting the neighboring entries in x of a candidate offset α. Let x j , xk ∈ X be these neighbors with x j ≤ α < xk such that there is no element from X between x j and xk . When Ψ changes its sign from x j to xk , we know that its root must be located within this interval. Further, we then know that all coordinates with a value greater than x j must survive the sparseness projection, which yields the set I from Theorem 1 and thus the explicit representation of the projection. The next result gathers these ideas and shows that it is easy to verify whether a change of sign in Ψ is on hand. Rn≥0 Lemma 4 Let x ∈ \ T be given such that Ψ is well-defined and let α ∈ [0, xmax ) be arbitrary. If α < xmin , let x j := 0 and xk := xmin . Otherwise, let x j := max { xi | xi ∈ X and xi ≤ α } be the left neighbor and let xk := min { xi | xi ∈ X and xi > α } be the right neighbor of α. Both exist as the sets where the maximum and the minimum is taken are nonempty. Define I := { i ∈ {1, . . . , n} | xi > α } and d := |I|. Then: (a) When Ψ (x j ) ≥ 0 and Ψ (xk ) < 0 then there is exactly one number α ∗ ∈ [x j , xk ) with Ψ (α ∗ ) = 0. (b) It is `1 (ξ ) = kVI xk1 − dξ and `22 (ξ ) = kVI xk22 − 2ξ kVI xk1 + dξ 2 for ξ ∈ { x j , α, xk }. (c) If the inequalities λ2 `1 (x j ) ≥ λ1 `2 (x j ) and λ2 `1 (xk ) < λ1 `2 (xk ) are satisfied and p := projT (x) denotes the projection of x onto T , then I = { i ∈ {1, . . . , n} | pi > 0 } and hence p can be computed exactly with Theorem 1. Proof The claim in (a) is obvious with Lemma 3. (b) We find that `1 (α) = ∑i∈I (xi −α) = kVI xk1 −dα and `2 (α)2 = ∑i∈I (xi − α)2 = kVI xk22 − 2αkVI xk1 + dα 2 . We have K = I \ K̃ with K := { i ∈ {1, . . . , n} | xi > xk } and K̃ := { i ∈ {1, . . . , n} | xi = xk }. One yields that `1 (xk ) = ∑i∈K (xi − xk ) = ∑i∈I (xi − xk ) − ∑i∈K̃ (xi − xk ) = kVI xk1 − dxk . The claim for `2 (xk )2 follows analogously. Likewise I = J \ J˜ with J := { i ∈ {1, . . . , n} | xi > x j } and J˜ := { i ∈ {1, . . . , n} | xi = x j }, and hence follows `1 (x j ) = ∑i∈J (xi − x j ) = ∑i∈I (xi − x j ) + ∑i∈J˜(xi − x j ) = kVI xk1 − dx j . The value of `2 (x j )2 can be computed in the same manner. (c) The condition in the claim is equivalent to the case of Ψ (x j ) ≥ 0 and Ψ (xk ) < 0, hence with (a) there is a number α ∗ ∈ [x j , xk ) with Ψ (α ∗ ) = 0. Note that α 6= α ∗ in general. Write p := projT (x) and let J := { i ∈ {1, . . . , n} | pi > 0 }. With Theorem 1 follows that i ∈ J if and only if xi > α ∗ . But this is equivalent to xi > x j , which in turn is equivalent to xi > α, therefore I = J must hold. Thus we already had the correct set of non-vanishing coordinates of the projection in the first place, and α ∗ and β ∗ can be computed exactly using the formula from the claim of Theorem 1, which yields the projection p. t u Proof of Correctness of Projection Algorithm In Sect. 2.3, we informally described our proposed algorithm for carrying out sparseness-enforcing projections, and provided a simplified flowchart in Fig. 3. After the previous theoretical considerations, we now propose and prove the correctness of a formalized algorithm for 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // Initialize. `1 := 0; `22 := 0; d := 0; x j := 0; ∆ x j := −α; xk := ∞; ∆ xk := ∞; // Scan through x. for i := 1 to n do t := xi − α; if t > 0 then `1 := `1 + xi ; `22 := `22 + xi2 ; d := d + 1; if t < ∆ xk then xk := xi ; ∆ xk := t; else if t > ∆ x j then x j := xi ; ∆ x j := t; end end // Compute Ψ (α), Ψ 0 (α) and Ψ 00 (α). 2 2 2 `1 (α) := `1 − dα; √ `2 (α) := `2 − 2α`1 + dα ; Ψ (α) := `1 (α)/ `2 (α)2 − λ1/λ2 ;  p Ψ 0 (α) := `1 (α)2/`2 (α)2 − d / `2 (α)2 ; Ψ 00 (α) := 3Ψ 0 (α) · `1 (α)/`2 (α)2 ; // Compute Ψ̃ (α) and Ψ̃ 0 (α). Ψ̃ (α) := `1 (α)2/`2 (α)2 − λ12/λ22 ; √ Ψ̃ 0 (α) := 2`1 (α)/ `2 (α)2 ·Ψ 0 (α); 18 // Check for sign change from Ψ (x j ) to Ψ (xk ). q finished := λ2 (`1 − dx j ) ≥ λ1 `22 − 2x j `1 + dx2j and q λ2 (`1 − dxk ) < λ1 `22 − 2xk `1 + dxk2 ; 19  return Ψ (α),Ψ 0 (α),Ψ 00 (α), Ψ̃ (α), Ψ̃ 0 (α), finished, `1 , `22 , d ; the projection problem. Here, the overall method is split into an algorithm that evaluates the auxiliary function Ψ and, based on its derivative, returns additional information required for finding its zero (Algorithm 2). The other part, Algorithm 3, implements the root-finding procedure and carries out the necessary computations to yield the result of the projection. It furthermore returns information that will be required for computation of the projection’s gradient, which we will discuss below. Theorem 5 Let x ∈ Rn≥0 and p := projT (x) be unique. Then Algorithm 3 computes p in a number of operations linear in the problem dimensionality n and with only constant additional space. Proof We start by analyzing Algorithm 2, which evaluates Ψ at any given position α. The output includes the values of the auxiliary function, its first and second derivative, and the value of the transformed auxiliary function and its derivative. There is moreover a Boolean value which indicates whether the interval with the sign change of Ψ has been found, and three additional numbers required to compute the zero α ∗ of Ψ as soon as the correct interval has been found. Let I := { i ∈ {1, . . . , n} | xi > α } denote the indices of all entries in x larger than α. In the blocks from Line 1 to Line 11, the algorithm scans through all the coordinates of x. It identifies the elements of I, and computes numbers `1 , `22 , d, x j and xk on the fly. After Line 11, we clearly have that `1 = kVI xk1 , `22 = kVI xk22 and d = |I|. Additionally, x j 22 Thom, Rapp, and Palm Algorithm 3 Linear time and constant space algorithm for projections onto T . The auxiliary function Ψ is evaluated by calls to "auxiliary", which are carried out by Algorithm 2. This algorithm operates in-place, the input vector is overwritten by the output vector upon completion. Input: Point to be projected x ∈ Rn≥0 , target norms λ1 , λ2 ∈ R, solver ∈ { Bisection, Newton, NewtonSqr, Halley }. Output: Projection projT (x) ∈ T as first element replacing the input vector, numbers `1 , `22 ∈ R and d ∈ N needed to compute the projection’s gradient with Algorithm 4. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 // Skip root-finding if decreasing sparseness.  Ψ (α),Ψ 0 (α),Ψ 00 (α), Ψ̃ (α), Ψ̃ 0 (α), finished, `1 , `22 , d := auxiliary(x, λ1 , λ2 , 0); if Ψ (α) ≤ 0 then go to Line 19; // Sparseness should be increased. lo := 0; up := x2nd-max ; α := lo +1/2 · (up − lo);  Ψ (α),Ψ 0 (α),Ψ 00 (α), Ψ̃ (α), Ψ̃ 0 (α), finished, `1 , `22 , d := auxiliary(x, λ1 , λ2 , α); // Start root-finding procedure. while not finished do // Update bisection interval. if Ψ (a) > 0 then lo := α else up := α; // One iteration of root-finding. if solver = Bisection then α := lo +1/2 · (up − lo); else // Use solvers based on derivatives. if solver = Newton then α := α − Ψ (α)/Ψ 0 (α); else if solver = NewtonSqr then α := α − Ψ̃ (α)/Ψ̃ 0 (α); else if solver = Halley then h := 1 − (Ψ (α)Ψ 00 (α))/(2Ψ 0 (α)2 ); α := α −Ψ (α)/ (max(0.5, min(1.5, h)) ·Ψ 0 (α)); end // Use bisection if α out of bounds. if α < lo or α > up then α := lo +1/2 · (up − lo); end // Evaluate auxiliary function anew.  Ψ (α),Ψ 0 (α),Ψ 00 (α), Ψ̃ (α), Ψ̃ 0 (α), finished, `1 , `22 , d := auxiliary(x, λ1 , λ2 , α); end // Correct interval has been found, compute α ∗ . q .q  1 α ∗ := `1 − λ1 d`22 − `21 dλ22 − λ12 ; d // Compute result of the projection in-place. ρ := 0; for i := 1 to n do t := xi − α ∗ ; if t > 0 then xi := t; ρ := ρ + t 2 else xi := 0; end for i := 1 to n do xi := (λ2/√ρ ) · xi ;  return x, `1 , `22 , d ; and xk are the left and right neighbors, respectively, of α. Therefore, the requirements of Lemma 4 are satisfied. The next two blocks spanning from Line 12 to Line 17 compute scalar numbers according to Lemma 4(b), the definition of Ψ , the first two derivatives thereof given explicitly in the proof of Lemma 3(c), the definition of Ψ̃ and its derivative given by the chain rule. In Line 18, it is checked whether the conditions from Lemma 4(c) hold using the statements from Lemma 4(b). The result is stored in the Boolean variable "finished". Finally all computed numbers are passed back for further processing. Algorithm 2 clearly needs time linear in n and only constant additional space. Algorithm 3 performs the actual projection in-place, and outputs values needed for the gradient of the projection. It uses Algorithm 2 as sub-program by calls to the function "auxiliary". The algorithm first checks whether Ψ (0) ≤ 0, which is fulfilled when σ (x) ≥ σ ∗ . In this case, all coordinates survive the projection, computation of α ∗ is straightforward with Theorem 1 using I = {1, . . . , n}. Otherwise, Lemma 3(d) states that α ∗ ∈ (0, x2nd-max ). We can find α ∗ numerically with standard root-finding algorithms since Ψ is continuous and strictly decreasing on the interval (0, x2nd-max ). The concrete variant is chosen by the parameter "solver" of Algorithm 3, implementation details can be found in Traub (1964) and Press et al. (2007). Here, the root-finding loop starting at Line 5 is terminated once Algorithm 2 indicates that the correct interval for exact computation of the zero α ∗ has been identified. It is therefore not necessary to carry out root-finding until numerical convergence, it is enough to only come sufficiently close to α ∗ . Line 19 computes α ∗ based on the projection representation given in Theorem 1. This line is either reached directly from Line 2 if σ (x) ≥ σ ∗ , or when the statements from Lemma 4(c) hold. The block starting at Line 20 computes max (x − α ∗ · e, 0) and stores this point’s squared Euclidean norm in the variable ρ. Line 24 computes the number β ∗ from Theorem 1 and multiplies every entry of max (x − α ∗ · e, 0) with it, such that x finally contains the projection onto T . It would also be possible to create a new vector for the projection result and leave the input vector untouched, at the expense of additional memory requirements which are linear in the problem dimensionality. When solver = Bisection, the loop in Line 5 is repeated a constant number of times regardless of n (see Sect. 2.3), and since Algorithm 2 terminates in time linear in n, Algorithm 3 needs time only linear in n. Further, the amount of additional memory needed is independent of n, as for Algorithm 2, such that the overall space requirements are constant. Therefore, Algorithm 3 is asymptotically optimal in the sense of complexity theory. t u Gradient of the Projection Thom and Palm (2013) have shown that the projection onto T can be grasped as a function almost everywhere which is differentiable almost everywhere. An explicit expression for the projection’s gradient was derived, which depended on the number of alternating projections required for carrying out the projection. Based on the characterization we gained through Theorem 1, we can derive a much simpler expression for the gradient which is also more efficient to compute: Theorem 6 Let x ∈ Rn≥0 \ T such that p := projT (x) is unique. Let α ∗ , β ∗ ∈ R, I ⊆ {1, . . . , n} and d := |I| be given as in Theorem 1. When xi 6= α ∗ for all i ∈ {1, . . . , n}, then projT is differentiable in x with ∂/∂ x projT (x) = VIT GVI , where the matrix G ∈ Rd×d is given by q  G := ba Ed − √1ab λ22 ẽẽT + d p̃ p̃T − λ1 ẽ p̃T + p̃ẽT , with a := d kVI xk22 − kVI xk21 ∈ R≥0 and b := dλ22 − λ12 ∈ R≥0 . Here, Ed ∈ Rd×d is the identity matrix, ẽ := VI e ∈ { 1 }d is the point where all coordinates are unity, and p̃ := VI p ∈ Rd>0 . Proof When xi 6= α ∗ for all i ∈ {1, . . . , n}, then I and d are invariant to local changes in x. Therefore, α ∗ , β ∗ and projT are differentiable as composition of differentiable functions. In the following, we derive the claimed expression of the gradient of projT in x. p  Let x̃ := VI x ∈ Rd , then α ∗ = 1/d · kx̃k1 − λ1 a/b . Define q̃ := VI · max (x − α ∗ · e, 0), then q̃ = x̃ − α ∗ · ẽ ∈ Rd>0 because xi > α ∗ for all i ∈ I. Further p̃ = λ2 · q̃/kq̃k2 , and we have p = VIT VI p = VIT p̃ since pi = 0 for all i 6∈ I. Application of the chain rule yields   ∂p q̃ ∂ (x̃ − α ∗ · ẽ) ∂VI x ∂V T p̃ ∂ = I · λ2 · · · , ∂x ∂ p̃ ∂ q̃ kq̃k2 ∂ x̃ ∂x Efficient Dictionary Learning with Sparseness-Enforcing Projections Algorithm 4 Product of the gradient of the projection onto T with an arbitrary vector. Input: A point y ∈ Rn , target norms λ1 , λ2 ∈ R, and the results of Algorithm 3: Projection p = projT (x), numbers `1 , `22 ∈ R and d ∈ N. Output: z := (∂/∂ x projT (x)) · y ∈ Rn . 1 2 3 4 5 6 7 8 9 10 11 12 // Scan and slice input vectors. j := 0; p̃ ∈ { 0 }d ; ỹ ∈ { 0 }d ; sumỹ := 0; scp p̃, ỹ := 0; for i := 1 to n where pi > 0 do j := j + 1; p̃ j := pi ; ỹ j := yi ; sumỹ := sumỹ + ỹ j ; scp p̃, ỹ := scp p̃, ỹ + p̃ j · ỹ j ; end // Compute gradient product in sliced space. a := d`22 − `21 ; b := dλ22 − λ12 ; p ỹ := b/a · ỹ; p  ỹ := ỹ + 1/ab · λ1 · sumỹ − d · scp p̃, ỹ · p̃; p  ỹ := ỹ + 1/ab · λ1 · scp p̃, ỹ − λ22 · sumỹ · ẽ; // Un-slice to yield final result. j := 0; z ∈ { 0 }n ; for i := 1 to n where pi > 0 do j := j + 1; zi := ỹ j ; return z; and with H := λ2 · (∂/∂ q̃ (q̃/kq̃k2 )) · (∂/∂ x̃ (x̃ − α ∗ · ẽ)) ∈ Rd×d follows ∂ p/∂ x = V T HVI , thus it only remains to show G = H. I  One obtains ∂/∂ q̃ (q̃/kq̃k2 ) = Ed − q̃q̃T/kq̃k22 /kq̃k2 . Since all the entries of q̃ and x̃ are positive, their L1 norms p equal the dot product with ẽ. We have kq̃k1 = kVI xk1 − dα ∗ = λ1 a/b, and we obtain that p   kq̃k22 = kx̃k22 − α ∗ · kx̃k1 + λ1 a/b = kx̃k22 − 1/d · kx̃k21 − λ12 · a/b =  2 2 a/d · 1 + λ1 /b = λ · a/b. Now we can compute the gradient of α. 2 T 1×d . Clearly b is independent of x̃. It is ∂ a/∂ x̃ = 2d x̃T − 2kx̃kp 1 ẽ ∈ R ∗ a Since x̃ = q̃ + α · ẽ it follows that d x̃ − kx̃k1 ẽ = d q̃ − λ1 /b · ẽ, and p p T √ hence ∂ a/∂ x̃ = 1/a · d q̃ − λ1 a/b · ẽ . Therefore, we conclude that  √ ∂ α ∗/∂ x̃ = λ22/b · ẽT − (λ1/ ab) · q̃T ∈ R1×d . By substitution into H and multiplying out we see that q    λ2 1 H = ba Ed − λb2 a q̃q̃T Ed − b2 ẽẽT + √λab ẽq̃T 2 q  λ2 1 ẽq̃T = ba Ed − b2 ẽẽT + √λab  λ2 1 − λb2 a q̃q̃T + √λab q̃ẽT − λ 21a q̃q̃T , 2 2 p p  where q̃q̃T ẽẽT = q̃ q̃T ẽ ẽT = λ1 a/b · q̃ẽT and q̃q̃T ẽq̃T = λ1 a/b · q̃q̃T 2 havep been used. The claim then follows with b/λ22 a + λ1 /λ22 a = d/a and q̃ = a/b · p̃. t u The gradient has a particular simple form, as it is essentially a scaled identity matrix with additive combination of scaled dyadic products of simple vectors. In the situation where not the entire gradient but merely its product with an arbitrary vector is required (as for example in conjunction with the backpropagation algorithm), simple vector operations are already enough to compute the product: Corollary 7 Algorithm 4 computes the product of the gradient of the sparseness projection with an arbitrary vector in time and space linear in the problem dimensionality n. Proof Let y ∈ Rn be an arbitrary vector in the situation of Theorem 6, and define ỹ := VI y ∈ Rd . Then one obtains q  Gỹ = ba ỹ + √1ab λ1 · ẽT ỹ − d · p̃T ỹ · p̃  + √1ab λ1 · p̃T ỹ − λ22 · ẽT ỹ · ẽ ∈ Rd . 23 Algorithm 4 starts by computing the sliced vectors p̃ and ỹ, and computes "sumỹ " which equals ẽT ỹ and "scp p̃, ỹ " which equals p̃T ỹ after Line 5. It then computes a and b using the numbers output by Algorithm 3. From Line 7 to Line 9, the product Gỹ is computed in-place by scaling of ỹ, adding a scaled version of p̃, and adding a scalar to each coordinate. Since (∂/∂ x projT (x)) · y = VIT Gỹ, it just remains to invert the slicing. The complexity of the algorithm is clearly linear, both in time and space. t u It has not escaped our notice that Corollary 7 can also be used to determine the eigensystem of the projection’s gradient, which may prove useful for further analysis of gradient-based learning methods involving the sparseness-enforcing projection operator. References Michal Aharon, Michael Elad, and Alfred Bruckstein. K-SVD: An Algorithm for Designing Overcomplete Dictionaries for Sparse Representation. IEEE Transactions on Signal Processing, 54(11): 4311–4322, 2006. Felix Bauer and Roland Memisevic. Feature Grouping from Spatially Constrained Multiplicative Interaction. In Proceedings of the International Conference on Learning Representations. arXiv:1301.3391, 2013. Anthony J. Bell and Terrence J. Sejnowski. The "Independent Components" of Natural Scenes are Edge Filters. Vision Research, 37 (23):3327–3338, 1997. Dimitri P. Bertsekas. Nonlinear Programming. Athena Scientific, Belmont, 2nd edition, 1999. Christopher M. Bishop. Neural Networks for Pattern Recognition. Clarendon Press, Oxford, 1995. L. Susan Blackford, James Demmel, Jack Dongarra, Iain Duff, Sven Hammarling, Greg Henry, Michael Heroux, Linda Kaufman, Andrew Lumsdaine, Antoine Petitet, Roldan Pozo, Karin Remington, and R. Clint Whaley. An Updated Set of Basic Linear Algebra Subprograms (BLAS). ACM Transactions on Mathematical Software, 28(2):135–151, 2002. Léon Bottou and Yann LeCun. Large Scale Online Learning. In Advances in Neural Information Processing Systems, volume 16, pages 217–224, 2004. Kristian Bredies and Dirk A. Lorenz. Linear Convergence of Iterative Soft-Thresholding. Journal of Fourier Analysis and Applications, 14(5–6):813–837, 2008. Adam Coates and Andrew Y. Ng. The Importance of Encoding Versus Training with Sparse Coding and Vector Quantization. In Proceedings of the International Conference on Machine Learning, pages 921–928, 2011. Frank Deutsch. Best Approximation in Inner Product Spaces. Springer, New York, 2001. Weisheng Dong, Lei Zhang, Guangming Shi, and Xiaolin Wu. Image Deblurring and Super-Resolution by Adaptive Sparse Domain Selection and Adaptive Regularization. IEEE Transactions on Image Processing, 20(7):1838–1857, 2011. David L. Donoho. De-Noising by Soft-Thresholding. IEEE Transactions on Information Theory, 41(3):613–627, 1995. David L. Donoho. For Most Large Underdetermined Systems of Linear Equations the Minimal `1 -norm Solution Is Also the Sparsest Solution. Communications on Pure and Applied Mathematics, 59 (6):797–829, 2006. Julio Martin Duarte-Carvajalino and Guillermo Sapiro. Learning to Sense Sparse Signals: Simultaneous Sensing Matrix and Sparsifying Dictionary Optimization. IEEE Transactions on Image Processing, 18(7):1395–1408, 2009. Carl Eckart and Gale Young. The Approximation of One Matrix by Another of Lower Rank. Psychometrika, 1(3):211–218, 1936. 24 Michael Elad. Why Simple Shrinkage Is Still Relevant for Redundant Representations? IEEE Transactions on Information Theory, 52 (12):5559–5569, 2006. Simon Foucart and Holger Rauhut. A Mathematical Introduction to Compressive Sensing. Birkhäuser, New York, 2013. Mark Galassi, Jim Davies, James Theiler, Brian Gough, Gerard Jungman, Patrick Alken, Michael Booth, and Fabrice Rossi. GNU Scientific Library Reference Manual. Network Theory Ltd., Bristol, 3rd edition, 2009. Mohammad Gharavi-Alkhansari and Thomas S. Huang. A Fast Orthogonal Matching Pursuit Algorithm. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, volume III, pages 1389–1392, 1998. David Goldberg. What Every Computer Scientist Should Know About Floating-Point Arithmetic. ACM Computing Surveys, 23(1):5–48, 1991. Simon Hawe, Matthias Seibert, and Martin Kleinsteuber. Separable Dictionary Learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 438–445, 2013. Stuart G. Hoggar. Mathematics of Digital Images: Creation, Compression, Restoration, Recognition. Cambridge University Press, Cambridge, 2006. Inbal Horev, Ori Bryt, and Ron Rubinstein. Adaptive Image Compression using Sparse Dictionaries. In Proceedings of the International Conference on Systems, Signals and Image Processing, pages 592–595, 2012. Patrik O. Hoyer. Non-negative Matrix Factorization with Sparseness Constraints. Journal of Machine Learning Research, 5:1457– 1469, 2004. Patrik O. Hoyer and Aapo Hyvärinen. Independent Component Analysis Applied to Feature Extraction from Colour and Stereo Images. Network: Computation in Neural Systems, 11(3):191–210, 2000. David H. Hubel and Torsten N. Wiesel. Receptive Fields of Single Neurones in the Cat’s Striate Cortex. Journal of Physiology, 148 (3):574–591, 1959. Niall Hurley and Scott Rickard. Comparing Measures of Sparsity. IEEE Transactions on Information Theory, 55(10):4723–4741, 2009. Aapo Hyvärinen. Sparse Code Shrinkage: Denoising of Nongaussian Data by Maximum Likelihood Estimation. Neural Computation, 11(7):1739–1768, 1999. Aapo Hyvärinen and Patrik O. Hoyer. Emergence of Phase- and ShiftInvariant Features by Decomposition of Natural Images into Independent Feature Subspaces. Neural Computation, 12(7):1705– 1720, 2000. Aapo Hyvärinen, Patrik O. Hoyer, and Mika Inki. Topographic Independent Component Analysis. Neural Computation, 13(7):1527– 1558, 2001. Aapo Hyvärinen, Jarmo Hurri, and Patrik O. Hoyer. Natural Image Statistics – A Probabilistic Approach to Early Computational Vision. Springer, London, 2009. Judson P. Jones and Larry A. Palmer. An Evaluation of the TwoDimensional Gabor Filter Model of Simple Receptive Fields in Cat Striate Cortex. Journal of Neurophysiology, 58(6):1233–1258, 1987. Koray Kavukcuoglu, Marc’Aurelio Ranzato, Rob Fergus, and Yann LeCun. Learning Invariant Features through Topographic Filter Maps. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1605–1612, 2009. Teuvo Kohonen. The Self-Organizing Map. Proceedings of the IEEE, 78(9):1464–1480, 1990. Kenneth Kreutz-Delgado, Joseph F. Murray, Bhaskar D. Rao, Kjersti Engan, Te-Won Lee, and Terrence J. Sejnowski. Dictionary Learning Algorithms for Sparse Representation. Neural Computation, 15(2):349–396, 2003. Thom, Rapp, and Palm Simon B. Laughlin and Terrence J. Sejnowski. Communication in Neuronal Networks. Science, 301(5641):1870–1874, 2003. Jun Liu and Jieping Ye. Efficient Euclidean Projections in Linear Time. In Proceedings of the International Conference on Machine Learning, pages 657–664, 2009. Miles E. Lopes. Estimating Unknown Sparsity in Compressed Sensing. In Proceedings of the International Conference on Machine Learning, pages 217–225, 2013. Julien Mairal, Francis Bach, Jean Ponce, and Guillermo Sapiro. Online Dictionary Learning for Sparse Coding. In Proceedings of the International Conference on Machine Learning, pages 689–696, 2009a. Julien Mairal, Francis Bach, Jean Ponce, Guillermo Sapiro, and Andrew Zisserman. Non-local Sparse Models for Image Restoration. In Proceedings of the International Conference on Computer Vision, pages 2272–2279, 2009b. John Ashworth Nelder and Roger Mead. A Simplex Method for Function Minimization. The Computer Journal, 7(4):308–313, 1965. Heinz Neudecker. Some Theorems on Matrix Differentiation with Special Reference to Kronecker Matrix Products. Journal of the American Statistical Association, 64(327):953–963, 1969. Adriana Olmos and Frederick A. A. Kingdom. A Biologically Inspired Algorithm for the Recovery of Shading and Reflectance Images. Perception, 33(12):1463–1473, 2004. Bruno A. Olshausen. Learning Sparse, Overcomplete Representations of Time-Varying Natural Images. In Proceedings of the International Conference on Image Processing, volume I, pages 41–44, 2003. Bruno A. Olshausen and David J. Field. Emergence of Simple-Cell Receptive Field Properties by Learning a Sparse Code for Natural Images. Nature, 381(6583):607–609, 1996. Bruno A. Olshausen and David J. Field. Sparse Coding with an Overcomplete Basis Set: A Strategy Employed by V1? Vision Research, 37(23):3311–3325, 1997. Vamsi K. Potluru, Sergey M. Plis, Jonathan Le Roux, Barak A. Pearlmutter, Vince D. Calhoun, and Thomas P. Hayes. Block Coordinate Descent for Sparse NMF. In Proceedings of the International Conference on Learning Representations. arXiv:1301.3527, 2013. William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. Numerical Recipes: The Art of Scientific Computing. Cambridge University Press, Cambridge, 3rd edition, 2007. Roberto Rigamonti, Amos Sironi, Vincent Lepetit, and Pascal Fua. Learning Separable Filters. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2754– 2761, 2013. Dario L. Ringach. Spatial Structure and Symmetry of Simple-Cell Receptive Fields in Macaque Primary Visual Cortex. Journal of Neurophysiology, 88(1):455–463, 2002. Joseph Lee Rodgers and W. Alan Nicewander. Thirteen Ways to Look at the Correlation Coefficient. The American Statistician, 42(1): 59–66, 1988. Christopher J. Rozell, Don H. Johnson, Richard G. Baraniuk, and Bruno A. Olshausen. Sparse Coding via Thresholding and Local Competition in Neural Circuits. Neural Computation, 20(10): 2526–2563, 2008. Karl Skretting and Kjersti Engan. Recursive Least Squares Dictionary Learning Algorithm. IEEE Transactions on Signal Processing, 58 (4):2121–2130, 2010. Karl Skretting and Kjersti Engan. Image Compression Using Learned Dictionaries by RLS-DLA and Compared with K-SVD. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, pages 1517–1520, 2011. Society of Motion Picture and Television Engineers (SMPTE). Recommended Practice RP 177-193: Derivation of Basic Television Color Equations, 1993. Efficient Dictionary Learning with Sparseness-Enforcing Projections Fabian J. Theis, Kurt Stadlthanner, and Toshihisa Tanaka. First Results on Uniqueness of Sparse Non-Negative Matrix Factorization. In Proceedings of the European Signal Processing Conference, volume 3, pages 1672–1675, 2005. Markus Thom and Günther Palm. Sparse Activity and Sparse Connectivity in Supervised Learning. Journal of Machine Learning Research, 14:1091–1143, 2013. Ivana Tošić, Bruno A. Olshausen, and Benjamin J. Culpepper. Learning Sparse Representations of Depth. IEEE Journal of Selected Topics in Signal Processing, 5(5):941–952, 2011. Joe Fred Traub. Iterative Methods for the Solution of Equations. Prentice-Hall, Englewood Cliffs, 1964. J. Hans van Hateren and Daniel L. Ruderman. Independent Component Analysis of Natural Image Sequences Yields Spatio-Temporal Filters Similar to Simple Cells in Primary Visual Cortex. Proceedings of the Royal Society B, 265(1412):2315–2320, 1998. Zhou Wang and Alan C. Bovik. Mean Squared Error: Love It or Leave It? A New Look at Signal Fidelity Measures. IEEE Signal Processing Magazine, 26(1):98–117, 2009. Andrew B. Watson. Image Compression Using the Discrete Cosine Transform. The Mathematica Journal, 4(1):81–88, 1994. Ben Willmore and David J. Tolhurst. Characterizing the Sparseness of Neural Codes. Network: Computation in Neural Systems, 12(3): 255–270, 2001. D. Randall Wilson and Tony R. Martinez. The General Inefficiency of Batch Training for Gradient Descent Learning. Neural Networks, 16(10):1429–1451, 2003. Jianchao Yang, John Wright, Thomas S. Huang, and Yi Ma. Image Super-Resolution via Sparse Representation. IEEE Transactions on Image Processing, 19(11):2861–2873, 2010. Jianchao Yang, Zhaowen Wang, Zhe Lin, Scott Cohen, and Thomas Huang. Coupled Dictionary Training for Image Super-Resolution. IEEE Transactions on Image Processing, 21(8):3467–3478, 2012. Lihi Zelnik-Manor, Kevin Rosenblum, and Yonina C. Eldar. Dictionary Optimization for Block-Sparse Representations. IEEE Transactions on Signal Processing, 60(5):2386–2395, 2012. 25
9cs.NE
se eu um e * Easy to ed R nt alu at e d * Incremental Computation with Names We sis t * Complete * PS L A O O * C on * tifact C * AE ll Doc Ev t en * Ar Extended Version Matthew A. Hammer1,2 Joshua Dunfield3 Kyle Headley1,2 Nicholas Labich2 2 2 Jeffrey S. Foster Michael Hicks David Van Horn2 arXiv:1503.07792v5 [cs.PL] 9 Oct 2015 1 University of Colorado Boulder, USA 2 University of Maryland College Park, USA Abstract Over the past thirty years, there has been significant progress in developing general-purpose, language-based approaches to incremental computation, which aims to efficiently update the result of a computation when an input is changed. A key design challenge in such approaches is how to provide efficient incremental support for a broad range of programs. In this paper, we argue that first-class names are a critical linguistic feature for efficient incremental computation. Names identify computations to be reused across differing runs of a program, and making them first class gives programmers a high level of control over reuse. We demonstrate the benefits of names by presenting N OMI NAL A DAPTON , an ML-like language for incremental computation with names. We describe how to use N OMINAL A DAPTON to efficiently incrementalize several standard programming patterns—including maps, folds, and unfolds— and show how to build efficient, incremental probabilistic trees and tries. Since N OMINAL A DAPTON’s implementation is subtle, we formalize it as a core calculus and prove it is from-scratch consistent, meaning it always produces the same answer as simply re-running the computation. Finally, we demonstrate that N OMINAL A DAPTON can provide large speedups over both from-scratch computation and A DAPTON, a previous state-of-the-art incremental computation system. Categories and Subject Descriptors D.3.1 [Programming Languages]: Formal Definitions and Theory; D.3.3 [Programming Languages]: Language Constructs and Features; F.3.2 [Logics and Meanings of Programs]: Semantics of Programming Languages Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. OOPSLA ’15, October 25–30, 2015, Pittsburgh, PA, USA. Copyright is held by the owner/author(s). Publication rights licensed to ACM. ACM 978-1-4503-3689-5/15/10. . . $15.00. http://dx.doi.org/10.1145/2814270.2814305 3 University of British Columbia Vancouver, Canada Keywords laziness, thunks, call-by-push-value (CBPV), demanded computation graph (DCG), incremental computation, self-adjusting computation, memoization, nominal matching, structural matching 1. Introduction Memoization is a widely used technique to speed up running time by caching and reusing prior results (Michie 1968). The idea is simple—the first time we call a pure function f on immutable inputs ~x, we store the result r in a memo table mapping ~x to r. Then on subsequent calls f(~y), we can return r immediately if ~x and ~y match. Incremental computation (IC) (Pugh 1988) takes this idea a step further, aiming to reuse prior computations even if there is a small change in the input. Recent forms of IC as exemplified by self-adjusting computation (SAC) (Acar 2005) and A DAP TON (Hammer et al. 2014) support mutable inputs, meaning that two calls to f(~x) might produce different results because values reachable from the same arguments ~x have been mutated. As such, before reusing a memoized result r, any inconsistencies are repaired via a process called change propagation. An important goal of an IC system is to minimize the work performed in support of change propagation, and thus improve overall performance. Matching—the task of determining whether a call’s arguments are “the same” as those of a memoized call—turns out to play a key role, as we show in this paper. The most common mechanism is structural matching, which traverses an input’s structure to check whether each of its components match. To make it fast, implementations use variants of hash-consing (e.g., see Filliâtre and Conchon (2006)) which, in essence, associates with a pointer a hash of its contents and compares pointers by hash. Structural matching works well when memoizing pure computations over immutable data because such computations always produce the same result. But for IC involving mutable references, structural matching can be too specific and therefore too fragile. For example, suppose we map a function f over a mutable list input = [0, 1, 3] producing output = map f input = [f 0, f 1, f 3]. Next, suppose we mutate input by inserting 2, so input becomes [0, 1, 2, 3]. Finally, suppose we recompute map f input, now [f 0, f 1, f 2, f 3], at- tempting to reuse as much of the prior computation as possible. Structural matching will successfully identify and reuse the recursive sub-call map f [3], reusing the result [f 3]. More generally, it will reuse the mapped suffix after the inserted element, since the computation of this output is independent of the mutated prefix. However, structural matching will not match the sub-computations that map 0 to f 0 and 1 to f 1 because these sub-computations’ outputs transitively include the newly inserted value of f 2 (via their tail pointers). As a result, an IC system that uses structural matching will rerun those sub-computations from scratch, recomputing f 0 and f 1 and allocating new list cells to hold the results. (Section 2 covers this example in detail.) The key takeaway is that structural matching is too conservative—it was designed for immutable inputs, in which case a structural match produces a correct memoized result. But with IC using mutable inputs, a match need not return a correct result; rather, our aim should be to return a result that requires only a little work to repair. For our example, an ideal IC system would be able to memoize the prefix, repairing it by mutating the old output cell containing f 1 to insert f 2. In this paper, we propose to overcome the deficiencies of structural matching for IC by employing an alternative matching strategy that involves names. We implement our solution in N OMINAL A DAPTON, an extension to the A DAP TON IC framework. Our new nominal matching strategy permits the programmer to explicitly associate a name—a firstclass (but abstract) value—with a pointer such that pointers match when their names are equal. A program produces names by generating them from existing names or other seed values. Returning to our example, we can add names to list cells such that an output cell’s name is derived from the corresponding input cell’s name. With this change, insertion into a list does not affect output cells’ names, and hence we can successfully reuse the computation of map on the prefix before the inserted element. The particular naming strategy is explained in detail in Section 2, which also gives an overview of the N OMINAL A DAPTON programming model and shows how it improves performance on the map example compared to prior structural approaches. Nominal matching is strictly more powerful than structural matching: The programmer can choose names however they wish, including mimicking structural matching by using hashing. That said, there is a risk that names could be used ambiguously, associating the same name with distinct pointers. In N OMINAL A DAPTON, if the programmer makes a mistake and uses a name ambiguously, efficient runtime checks detect this misuse and raise an exception. The use-once restriction can be limiting, however, so in addition to supporting first-class names, N OMINAL A DAPTON provides first-class namespaces—the same name can be reused as long as each use is in a separate namespace. For example, we can safely map different functions over the same list by wrapping the computations in separate namespaces. Section 3 illustrates several use cases of the N OMINAL A DAP TON programming model, presenting naming design patterns for incremental lists and trees and common computation patterns over them. We also propose a fundamental data structure for probabilistically balanced trees that works in a variety of applications. We have formalized N OMINAL A DAPTON in a core calculus λNomA and proved its incremental recomputation is from-scratch consistent, meaning it produces the same answer as would a recomputation from scratch. As such, mistakes from the programmer will never produce incorrect results. Section 4 presents our formalism and theorem. We have implemented N OMINAL A DAPTON in OCaml as an extension to A DAPTON (Section 5). We evaluated our implementation by comparing it to A DAPTON on a set of subject programs commonly evaluated in the IC literature, including map, filter, reduce, reverse, median, mergesort, and quickhull. As a more involved example, we implemented an interpreter for an imperative programming language (IMP with arrays), showing that interpreted programs enjoy incrementality by virtue of using N OMINAL A DAPTON as the meta-language. Across our benchmarks, we find that A DAPTON is nearly always slower than N OMINAL A DAP TON (sometimes orders of magnitude slower), and is sometimes orders of magnitude slower than from-scratch computation. By contrast, N OMINAL A DAPTON uniformly enjoys speedups over from-scratch computation (up to 10900×) as well as classic A DAPTON (up to 21000×). (Section 6 describes our experiments.) The idea of names has come up in prior incremental computation systems, but only in an informal way. For example, Acar and Ley-Wild (2009) includes a paragraph describing the idea of named references (there called “keys”) in the DeltaML implementation of SAC. To our knowledge, our work is the first to formalize a notion of named computations in IC and prove their usage correct. We are also the first to empirically evaluate the costs and benefits of programmernamed references and thunks. Finally, the notion of firstclass namespaces, with the same determinization benefits as named thunks and references, is also new. (Section 7 discusses SAC and other related work in more detail.) 2. Overview In this section we present N OMINAL A DAPTON and its programming model, illustrating how names can be used to improve opportunities for reuse. We start by introducing A DAPTON’s approach to incremental computation, highlighting how N OMINAL A DAPTON extends its programming model with support for names. Next we use an example, mapping over a list, to show how names can be used to improve incremental performance. 2.1 A DAPTON and N OMINAL A DAPTON A DAPTON aims to reuse prior computations as much as possible after a change to the input. A DAPTON achieves this by memoizing a function call’s arguments and results, reusing memoized results when the arguments match (via structural matching). In this section, we write memo(e) to indicate that the programmer wishes e to be memoized.1 A DAPTON provides mutable references: ref e allocates a memory location p which it initializes to the result of evaluating e, and ! p retrieves the contents of that cell. Changes to inputs are expressed via reference cell mutations; A DAP TON propagates the effect of such changes to update previous results. Like many approaches to incremental computation, A DAPTON distinguishes two layers of computation. Computations in the inner layer are incremental, but can only read and allocate references, while computations in the outer layer can change reference values (necessitating change propagation for the affected inner-layer computations) but are not themselves incremental. This works by having the initial incremental run produce a demanded computation graph (DCG), which stores values of memoized computations and tracks dependencies between those computations and references. Changes to mutable state “dirty” this graph, and change propagation “cleans” it, making its results consistent. 2.2 a0 0 arg call map0 ret b0 d0 1 3 Nil map1 map3 map4 deref call ref f0 Nil f3 f1 b1 a1 d1 Structural, Post-Update (a) A DAPTON , after insertion update a0 0 arg call d0 c0 2 3 Nil map1 map2 map3 map4 deref map0 ret b0 1 call ref f0 f1 y1 f0 Nil f3 f2 x1 b1 d1 f1 a (b) A DAPTON, after change propagation Figure 1: Incremental computation of map in A DAPTON Incremental Computation in A DAPTON As a running example, consider incrementalizing a program that maps over a list’s elements. To support this, we define a list data structure that allows the tail to be imperatively modified by the outer context: type 'a list = Nil | Cons of 'a ∗ ('a list) ref let rec map f xs = memo( match xs with | Nil → Nil | Cons (x, xs) → Cons (f x, ref (map f !xs)) ) This is a standard map function, except for two twists: the function body is memoized via memo, and the input and output Cons tails are reference cells. The use of memo here records function calls to map, identifying prior calls using the function f and input list xs. In turn, xs is either Nil or is identified by a value of type ’a and a reference cell. Hence, reusing the identity of references is critical to reusing calls to map via memo. Now we can create a list (in the outer layer) and map over it (in the inner layer): let let let let c0 2 l3 = Cons(3, ref Nil) (∗ l3 = [3] ∗) l1 = Cons(1, ref l3) (∗ l1 = [1; 3] ∗) l0 = Cons(0, ref l1) (∗ l0 = [0; 1; 3] ∗) m0 = (∗ inner start ∗) map f l0 (∗ inner end ∗) (∗ m0 = [f 0; f 1; f 3] ∗) 1 Programmers actually have more flexibility thanks to A DAPTON’s support for laziness, but laziness is orthogonal to names, which we focus on in this section. We discuss laziness in Section 4. Suppose we change the input to map by inserting an element: (tl l1) := Cons(2, ref l3) (∗ l0 = [0; 1; 2; 3] ∗) Here, tl returns the tail of its list argument. After this change, m0 will be updated to [f 0; f 1; f 2; f 3]. In the best case, computing m0 should only require applying f 2 and inserting the result into the original output. However, A DAPTON performs much more work for the above code. Specifically, A DAPTON will recompute f 0 and f 1; if the change were in the middle of a longer list, it would recompute the entire prefix of the list before the change. In contrast, N OMINAL A DAPTON will only redo the minimal amount of work. To understand why, consider Figure 1a, which illustrates what happens after the list update. In this figure, the initial input and output lists are shown in black at the top and the bottom of the figure, respectively. The middle of the figure shows the demanded computation graph (DCG), which records each recursive call of map and its dynamic dependencies. Here, nodes map0 , map1 , map3 and map4 correspond to the four calls to map. For each call, the DCG records the arguments, the result, and the computation’s effects. Here, the effects are: dereferencing a pointer; making a recursive call; and allocating a ref cell in the output list. We label the arrows/lines of the first node only, to avoid clutter; the same pattern holds for map1 and map3 . In the input and output, the tail of each Cons cell (a rounded box) consists of a reference (a square box). The input list is labeled a0 , b0 , d0 , and the output list is labeled a1 , b1 , d1 . In A DAPTON, structural matching determines the labels chosen by the inner layer, and in particular, whenever the inner layer allocates a reference cell to hold a value that is already contained in an existing reference cell, it reuses this first cell and its label. After the list is updated, A DAPTON dirties all the computations that transitively depend on the changed reference cell, b0 . The dirtied elements are shaded in red. Dirtying is how A DAPTON knows that previously memoized results cannot be reused safely without further processing. A DAP TON processes dirty parts of the DCG into clean computations on demand, when they are demanded by the outer program. To do so, it either re-executes the dirty computations, or verifies that they are unaffected by the original set of changes. Figure 1b shows the result of recomputing the output following the insertion change, using this mechanism. When the outer program recomputes map f l0 (shown as map0 ), A DAPTON will clean (either recompute or reuse) the dirty nodes of the DCG. First, it re-executes computation map1 , because it is the first dirty computation to be affected by the changed reference cell. We indicate reexecuted computations with stars in their DCG nodes. Upon re-execution, map1 dereferences b0 and calls map on the inserted Cons cell holding 2. This new call map2 calls f 2 (not shown), dereferences c0 , calls map3 ’s computation map f (Cons(3,d0 )), allocates b1 to hold its result and returns Cons(f 3, d1 ). The recomputation of map2 exploits two instances of reuse. First, when it calls map f (Cons(3,d0 )), A DAPTON reuses this portion of the DCG and the result it computed in the first run. A DAPTON knows that the prior result of map f (Cons(3,d0 )) is unchanged because map3 is not dirty. Notice that even if the tail of the list were much longer, the prior computation of map3 could still be reused, since the insertion does not affect it. Second, when map2 allocates the reference cell to hold the result of map f (Cons(3,d0 ), i.e. Cons(f 3, d1 ), it reuses and shares the existing reference cell b1 that already holds this content. Notice that this maintains our labeling invariant, so we can continue to perform structural matching by comparing labels. As a side effect, it also improves performance by avoiding allocation of an (isomorphic) copy of the output.2 2 Note that the outer layer may cause two cells with the same contents to be labeled differently: If two cells are initially allocated with different contents, but then the outer layer mutates one cell to contain the contents of the other, the cells will still have different labels and hence will not match in A DAPTON. This is a practical implementation choice, since otherwise A DAPTON might need to do complicated heap operations to merge the identities of two cells. At worst, this choice causes A DAPTON to miss some minor opportunities for reuse. However, this choice is consistent with the standard implementation of hash-consing, which only aims to share immutable structures (Allen 1978; Filliâtre and Conchon 2006). So far, A DAPTON has successfully reused subcomputations, but consider what happens next. When the call map2 completes, map1 resumes control and allocates a reference cell to hold Cons(f 2, b1 ). Since no reference exists with this content, it allocates a fresh reference x1 . New references are shown in bold. The computation then returns Cons(f 1, x1 ), which does not match its prior return value Cons(f 1, b1 ). Since this return value has changed from the prior run, A DAPTON re-runs map1 ’s caller, map0 . This consists of rerunning f 0, reusing the (just recomputed, hence no longer dirty) computation map1 , and allocating a reference to hold its result Cons(f 1, x1 ). Again, no reference exists yet with this content (x1 is a fresh tail pointer), so A DAPTON allocates a fresh cell y1 . Finally, the call to map0 completes, returning a new list prefix with the same content (f 0 and f 1) as in the first run, but with new reference cell identities (y1 and x1 ). In this example, small changes cascade into larger changes because A DAPTON identifies reference cells structurally based on their contents. Thus, the entire prefix of the output list before the insertion is reallocated and recomputed, which is much more work than should be necessary. 2.3 The Nominal Approach We can solve the problems with structural matching by giving the programmer explicit names to control reuse. In this particular case, we aim to avoid re-computing map0 and any preceding computations. In particular, we wish to recompute only map1 (since it reads a changed pointer) and to compute map2 , the mapping for the inserted Cons cell. The first step is to augment mutable lists with names provided by N OMINAL A DAPTON: type list = Nil | Cons of int ∗ name ∗ (list ref) Globally fresh names are generated either non-deterministically via new, or from an existing name via fork. In particular, fork n returns a pair of distinct names based on the name n with the property that it always returns the same pair of names given the same name n. In this way, the inner layer can deterministically generate additional names from a given one to enable better reuse. Finally, when the programmer allocates a reference cell, she explicitly indicates which name to use, e.g. ref(n,1) instead of ref(1). Now, when the list is created, the outer layer calls new to generate fresh, globally distinct names for each Cons cell: let l3 = Cons(3, new, ref(new, Nil)) (∗ l3 = [3] ∗) let l1 = Cons(1, new, ref(new, l3 )) (∗ l1 = [1; 3] ∗) let l0 = Cons(0, new, ref(new, l1 )) (∗ l0 = [0; 1; 3] ∗) When the inner layer computes with the list, it uses the names in each Cons cell to indicate dependencies between the inputs and outputs of the computation. In particular, we rewrite map as follows: c0 2 ɣ0 a0 1 β0 0 α0 arg call d0 b0 Nil 3 δ0 deref call map0 map1 map3 map4 ref ret f 1 β1 f 0 α1 Nil f 3 δ1 b1 a1 d1 (a) N OMINAL A DAPTON, after insertion update nodecfor the calld0 a0 Mi is the bDCG 0 0 1 β0 0 α0 arg call map0 ret map f2 (Cons(i,p i)) 3 ɣ0 δ0 Nil map3 map4 deref call map2 map1 ref f 2 ɣ1 f 1 β1 f 0 α1 a1 b1 Nil f 3 δ1 c1 d1 (b) N OMINAL A DAPTON, after change propagation for the call FigureM2:i isICthe ofDCG map node with N OMINAL A DAPTON map f (Cons(i,pi)) let rec map f xs = memo( match xs with | Nil → r | Cons(x, nm, xs) → let nm1, nm2 = fork nm in Cons(f x, nm1, ref (nm2, map f (!xs))) ) Unlike the outer program, which chooses reference names using new, the inner program uses fork to relate the names and references in the output list to the names in the input list. Now consider applying this function and making the same change as above: let m0 = map f l0 in (tl l1) := Cons(2, new, ref l3) Figure 2 shows what happens. The initial picture in Figure 2a is similar to the structural case in Figure 1a, except the input and output lists additionally contain names α0 , β0 , γ0 and δ0 . The first part of the recomputation is the same: N OMINAL A DAPTON recomputes map1 , which reads the mutated reference b0 . In turn, it recomputes map2 , which reuses the call to map3 to compute Cons(f 2, γ1 , c1 ). The recomputation of map2 returns a different value than in the prior run, with the new head value f 2. At this point, the critical difference occurs. Even though the result of map2 is distinct from any list in the prior run, the call map1 allocates the same ref cell b0 as before, because the name it uses for this allocation, β1 , is the same as before. In the figure, fork β0 7→ (β1 ,β2 ), where β1 becomes the name in the output list and b1 = ref β2 identifies the reference cell in its tail. N OMINAL A DAPTON dirties the reference b1 , to ensure that any dependent computations will be cleaned before their results are reused. Due to this reuse, the result of the call map1 is identical to its prior result: The value of f 1 is unaffected, and the tail pointer b1 was reused exactly. Next, N OMINAL A DAPTON examines map0 and all prior calls. Because the return value of map1 did not change, N OMINAL A DAPTON simply marks the DCG node for its caller, map0 , as clean; no more re-evaluation occurs. This cleaning step breaks the cascade of changes that occurred under A DAPTON. Prior computations are now clean, because they only depend on clean nodes. As a result of this difference in behavior, N OMINAL A DAPTON is able to reuse all but two calls to function f for an insertion at any index i, while A DAPTON will generally re-execute all i − 1 calls to function f that precede the inserted cell. Moreover, A DAPTON allocates a new copy of the output prefix (from 0 to i), while N OMINAL A DAPTON reuses all prior allocations. Our experiments (Section 6) confirm that these differences make A DAPTON over 10× slower than N OMINAL A DAPTON, even for medium-sized lists (10k elements) and cheap instances of f (integer arithmetic). 2.4 Enforcing that Nominal Matching is Correct Putting the task of naming in the programmer’s hands can significantly improve performance, but opens the possibility of mistakes that lead to correctness problems. In particular, a programmer could use the same name for two different objects: let y = ref n 1 let z = ref n false Double use leads to problems since the variables y and z have distinct types, yet they actually reference the same nominal object, the number or boolean named n. Consequently, the dereferenced values of y and z are sensitive to the order of the allocations above, where the last allocation “wins.” This imperative behavior is undesirable because it is inconsistent with our desired from-scratch semantics, where allocation always constructs new objects. To forbid double use errors, our implementation uses an efficient dynamic check. As the DCG evolves during program execution, N OMINAL A DAPTON maintains a stack of DCG nodes, its force stack, which consists of those DCG nodes currently being forced (evaluated, re-evaluated, or reused). When nominal matching re-associates a name with a different value or computation than a prior usage, it overwrites information in the DCG, and it dirties the old use and its transitive dependencies in the DCG. To check that a nominal match is unambiguous, we exploit a key invariant: A name is used ambiguously by a nominal match if and only if one or more DCG nodes on the force stack are dirtied when said nominal match occurs. If no such node exists, then the name is unambiguous. N OMINAL A DAPTON implements this check by maintaining, for each DCG node, a bit that is set and unset when the node is pushed and popped from the force stack, respectively. This implementation is very efficient, with O(1) overhead. Returning to the example above, the allocation of z nominally matches the allocation on the prior line, for y. Since 1 and false are not equal, the nominal match dirties the DCG node that allocates 1, which is also the “current” DCG node, and thus is on the top of the force stack. Hence, N OMINAL A DAPTON raises an exception at the allocation of z, indicating that n is used ambiguously. Note that because this check is dynamic and based on the DCG, it works even when ambiguous name uses are separated across function or module boundaries. This is important since, in our experience, most name reuse errors are not nearly as localized as the example above. This dynamic check was essential for our own development process; without it, nominal mistakes were easy to make and nearly impossible to diagnose. 2.5 Namespaces Unfortunately, forbidding multiple uses of names altogether prevents many reasonable coding patterns. For example, suppose we want to map an input list twice: let ys = map f input list let zs = map g input list Recall that in the Cons case of map we use each name in the input list to create a corresponding name in the output list. As such, the two calls to map result in ys and zs having cells with the same names, which is forbidden by our dynamic check. We can address this problem by creating distinct namespaces for the distinct functions (f versus g), where the same names in two different namespaces are treated as distinct. A modified version of map using namespaces would be written thus: let map' n h xs = nest(ns(n), map h xs) The code nest(s,e) performs the nested computation e in namespace s, and the code ns(n) creates a namespace from a given name n. Just as with references, we must be careful about how namespaces correspond across different incremental runs, and thus we seed a namespace with a given name. Now, distinct callers can safely call map’ with distinct names: let n1, n2 = (new, new) in let xs = map' n1 f input list in let ys = map' n2 g input list in The result is that each name in the input list is used only once per namespace: Names in map f will be associated with the first namespace (named by n1), and names in map g will associate with the second namespace (named by n2). Section summary. The use of names allows the programmer to control (1) how mutable reference names are chosen the first time, and (2) how to selectively reuse and overwrite these references to account for incremental input changes from the outer layer. These names are transferred from input to output through the data structures that they help identify (the input and output lists here), by the programs that process them (such as map). Sometimes we want to use the same name more than once, in different program contexts (e.g., map f · versus map g ·); we distinguish these program contexts using namespaces. 3. Programming with Names While N OMINAL A DAPTON’s names are a powerful tool for improving incremental reuse, they create more work for the programmer. In our experience so far, effective name reuse follows easy-to-understand patterns. Section 3.1 shows how to augment standard data structures—lists and trees—and operations over them—maps, folds, and unfolds—to incorporate names in a way that supports effective reuse. Section 3.2 describes probabilistic tries, a nominal data structure we developed that efficiently implements incremental maps and sets. Finally, Section 3.3 describes our implementation of an incremental IMP interpreter that takes advantage of these data structures to support incremental evaluation of its imperative input programs. The benefits of these patterns and structures are measured precisely in Section 6. 3.1 General Programming Patterns Practical functional programs use a wide variety of programming patterns; three particularly popular ones are mapping, folding, and unfolding. We consider them here in the context of lists and trees. Mapping. Maps traverse a list (as in Section 2) or tree and produce an output structure that has a one-to-one correspondence with the input structure. We have already seen how to incrementalize mapping by associating a name with each element of the input list and using fork to derive a corresponding name for each element in the output list, thereby avoiding spurious recomputation of whole list prefixes on a change. Folding. Folds traverse a list or tree and reduce subcomputations to provide a final result. Examples are summing list elements or finding the minimum element in a tree. If we implement folding in a straightforward way in N OMINAL A DAPTON, the resulting program tends to perform poorly. The problem is that every step in a list-based reduction uses an accumulator or result that induces a global dependency on all prior steps—i.e., every step depends on the entire prefix or the entire suffix of the sequence, meaning that any change therein necessitates recomputing the step. The solution is to use an approach from parallel programming: Use trees to structure the input data, rather than lists, to permit expressing independence between sub-problems. Consider the following code, which defines a type tree for trees of integers: type tree = Leaf | Bin of name ∗ int ∗ (tree ref) ∗ (tree ref) Like lists, these trees use refs to permit their recursive structure to change incrementally, and each tree node includes a name. We can reduce over this tree in standard functional style: let tree min tree = memo(match tree with | Leaf → max int | Bin(n,x,l,r) → min3(x, tree min(!l), tree min(!r))) If we later update the tree and recompute, we can reuse subtree minimum computations, because the names are stable in the tree. Below, we show the original input tree alongside two illustrations (also depicted as trees) of which element of each subtree is the minimum element, before and after the replacement of element 1 with the new element 9: Original tree Minimums (pre-change) Minimums (post-change) 1 4 · 6 1 4 · 6 9 4 · 6 2 5 3 1 5 1 2 5 2 Notice that while the first element 1 changed to 9, this only affects the minimum result along one path in the tree: the path from the root to the changed element. In contrast, if we folded the sequence naively as a list, all the intermediate computations of the minimum could be affected by a change to the first element (or last element, depending on the fold direction). By contrast, the balanced tree structure (with expected logarithmic depth) overcomes this problem by better isolating independent subcomputations. Pleasingly, as first shown by Pugh and Teitelbaum (1989), we can efficiently build a tree probabilistically from an input list, and thus transfer the benefits of incremental tree reuse to list-style computations. Building such a tree is an example of unfolding, described next. Unfolding. Unfolds iteratively generate lists or trees using a “step function” with internal state. As just mentioned, one example is building a balanced tree from a list. Unfortunately, if we implement unfolding in a straightforward way, incremental computation suffers. In particular, we want similar lists (related by small edits) to lead to similar trees, with many common subtrees; meanwhile, textbook algorithms for building balanced trees, such as AVL trees and splay trees, are too sensitive to changes to individual list elements. The solution to this problem is to construct a probabilistically balanced tree, with expected O(log n) height for input list n. The height of each element in the resulting tree is determined by a function that counts the number of trailing zero bits in a hash of the given integer. For example, given input elements [a, b, c, d, e, f] with heights [0, 1, 0, 2, 1, 0], re- spectively, then our tree-construction function will produce the binary tree shown below: a c · f e b d Pugh and Teitelbaum (1989) showed that this procedure induces a probabilistically balanced tree, with similar lists inducing similar trees, as desired. Further, each distinct list of elements maps to exactly one tree structure. This property is useful in N OMINAL A DAPTON, since a canonical structure is more likely to be reused than one that can exhibit more structural variation. While past work has considered incremental computations over such balanced trees, in this work we find that the construction of the tree from a mutable, changing sequence can also be efficiently incrementalized (Pugh’s work focused only on a pure outer program). 3.2 Probabilistic Tries Inspired by probabilistic trees, we developed efficient, incremental probabilistic tries, which use a different naming pattern in which certain names are external to the data structure. We define tries as binary trees whose nodes hold a name and two children (in reference cells), and whose leaves store data. Here we use integers for simplicity, but in general nodes would hold arbitrary data (e.g., for maps, they would hold key-value pairs): type trie = Nil | Leaf of int | Bin of name ∗ (trie ref) ∗ (trie ref) The key idea of a probabilistic trie is to use a bit string to identify two things at once: the element stored in the structure (via its hash) and the path to retrieve that element, if it is present. To keep it simple, the code below assumes that all data elements have a unique hash, and that the input trie is complete, meaning that all paths are defined and either terminate in a Nil or a Leaf. Our actual implementation of tries makes neither assumption. The first operation of a trie is find, which returns either Some data element or None, depending on whether data with the given hash (a list of bools) is present in the trie. val find : trie → bool list → int option let rec find trie bits = match bits, trie with | [], Leaf(x) → Some x | [], Nil → None | true::bits, Bin( ,left,right) → find (!left) bits | false::bits, Bin( ,left,right) → find (!right) bits The other operation on tries is extend n t b d which, given an input trie t, a data element d and its hash b, produces a new trie with d added to it: val extend : name → trie → bool list → int → trie let rec extend nm trie bits data = memo ( match bits, trie with | [], (Leaf | Nil) → Leaf(x) | false::bits, Bin( ,left,right) → (∗ symmetric to below ∗) | true::bits, Bin( ,left,right) → let n1, n2, n3, n4 = fork4 nm in let right' = extend n1 (!right) bits data in Bin(n2, ref(n3, !left), ref(n4, right')) ) Critically, the first argument to extend is an externally provided nm that is used to derive names (using fork) for each ref in the new path. Thus, the identity of the trie returned by extend n t b d only depends directly on the name n and the inserted data, and not on the names or other content of the input trie t. Any incremental program that sequences multiple trie extensions makes critical use of this independence (e.g., the interpreter discussed below). To see how, consider two incremental runs of such a program with two similar sequences of extensions, [1, 2, 3, 4, 5, 6] versus [2, 3, 4, 5, 6], with the same sequence of five names for common elements [2, . . . , 6]. Using the name-based extension above, the tries in both runs will use exactly the same reference cells. By contrast, the structural approach will build entirely new tries in the second run, since the second sequence is missing the leading 1 (a different initial structure). Similarly, using the names in the trie to extend it will also fail here, since it will effectively identify each extension by a global count, which in this case shifts by one for every extension in the second run. Using external names for each extension overcomes both of these problematic behaviors, and gives maximal reuse. 3.3 Interpreter for IMP Finally, as a challenge problem, we used N OMINAL A DAP TON to build an interpreter for IMP (Winskel 1993), a simple imperative programming language. Since our interpreter is incremental, we can efficiently recompute an interpreted program’s output after a change to the program code itself. While Adapton requires incrementalized computations to be fully functional, implementing a purely functional interpreter for IMP allows the imperative object language to inherit the incrementality of the meta-language. The core of our interpreter is a simple, big-step eval function that recursively evaluates an IMP command in some store (that is, a heap) and environment, returning the final store and environment. Commands include while loops, sequences, conditionals, assignments (of arithmetic and boolean expressions) to variables, and array operations (allocation, reading, and writing). All program values are either booleans or integers. As in C, an integer also doubles as a “pointer” to the store. The interpreter uses finite maps to represent its environment of type env (a mapping from variables to ints) and its store of array content (a mapping from ints to ints). For incremental efficiency, the interpreter makes critical use of the programming patterns we have seen so far. We use probabilistic tries to represent the finite maps for stores and environments. Each variable assignment or array update in IMP is implemented as a call to extend for the appropriate trie. Names have two uses inside the interpreter. Each call to extend requires a name, as does each recursive call to eval. Classic A DAPTON would identify each with the full structural content of its input. For the IMP language, we require far less information to disambiguate one program state from another. Consider first the IMP language without while loops. Each subcommand is interpreted at most once; as such, each program state and each path created in the environment or store can be identified with the particular program position of the subcommand being interpreted. With the addition of while loops, we may interpret a single program position multiple times. To disambiguate these, we thread loop counts through the interpreter represented as a list of integers. The loop count [3, 4], for example, tells us we are inside two while loops: the third iteration through the inner loop, within the fourth iteration through the outer loop. We extend the N OMINAL A DAPTON API to allow creating names not just by forking, but also by adding in a count— here, names are created using the loop count paired with the name of the program position. As such, the names sufficiently distinguish recursive calls to the interpreter and paths inside the environment and store. val eval : nm ∗ int list ∗ store ∗ env ∗ cmd → store ∗ env In our experiments, we show that the combination of this naming strategy and probabalistically balanced tries yields an efficient incremental interpreter. Moreover, the interpreter’s design provides evidence that N OMINAL A DAP TON ’s programming patterns are compositional, allowing us to separately choose how to use names for different parts of the program. 4. Formal Development The interaction between memoization, names, and the demanded computation graph is subtle. For this reason, we have distilled N OMINAL A DAPTON to a core calculus called λNomA , which represents the essence of the N OMI NAL A DAPTON implementation and formalizes the key algorithms behind incremental computation with names. We prove the fundamental correctness property of incremental computation, dubbed from-scratch consistency, which states that incrementally evaluating a program produces the same answer as re-evaluating it from scratch. This theorem also establishes that (mis)use of names cannot interfere with the meaning of programs; while a poor use of names may have negative impact on performance, it will not cause a program to compute the wrong result. We present the full theory but only sketch the consistency result here; the details and proofs are in the extended version of this paper (Hammer et al. 2015). The formal semantics presented here differs considerably from that of the original A DAPTON system (Hammer et al. 2014). In particular, the original semantics modeled the DCG as an idealized cache of tree-shaped traces that remember all input–output relationships, forever. In contrast, the one developed here models the DCG as it is actually implemented in both A DAPTON and N OMINAL A DAPTON, as a changing graph whose nodes are memoized refs and memoized computations (thunks), and whose edges are their dependencies. Further, via names, this semantics permits more kinds of DCG mutation, since the computations and values of a node can be overwritten via nominal matching. In summary, compared to the prior semantics, our theory more accurately models the implementation, and our metatheory proves correctness in a more expressive setting. Pointers p, q ::= k@ω | root Names k ::= • | k·1 | k·2 Namespaces ω, µ ::= > | ω.k Values v ::= x | (v1 , v2 ) | inji v name | nm k pointer to value (reference cell) | ref p | thk p pointer to computation | ns ω namespace identifier Results t ::= λx.e | ret v Computations e ::= t | e v | f | fix f.e | let x ← e1 in e2 | case (v, x1 .e1 , x2 .e2 ) | split (v, x1 .x2 .e) create thunk e at name v | thunk(v, e) | force (v) force thunk that v points to | fork(v) fork name v into two halves v·1, v·2 allocate v2 at name v1 | ref(v1 , v2 ) | get (v) get value stored at pointer v | ns (v, x.e) bind x to a new namespace v | nest(v, e1 , x.e2 ) evaluate e in namespace v and bind x to the result Figure 3: Syntax 4.1 Syntax The syntax of λNomA is defined in the style of the call-bypush-value (CBPV) calculus (Levy 1999), a standard variant of the lambda calculus with an explicit thunk mechanism. Figure 3 gives the syntax of the language. The nonhighlighted features are standard, and the highlighted forms are new in λNomA . N OMINAL A DAPTON follows A DAPTON in supporting demand-driven incremental computation using a lazy programming model. In A DAPTON, programmers can write thunk(e) to create a suspended computation, or thunk. The Graphs G, H ::= ε | G, p:v | G, p:e | G, p:(e, t) | G, (p, a, b, q) Edge actions a ::= alloc v | alloc e | obs v | obs t empty graph p points to value v p points to thunk e (no cached result) p points to thunk e with cached result t p depends on q due to action a, with status b For edge (p, a, b, q), the computation at p. . . . . . created reference v at q . . . created thunk e at q . . . read q’s value, which was v . . . forced thunk q, which returned t Edge statuses b ::= clean value or computation at sink is out of date | dirty value or computation at sink is up to date Figure 4: Graphs thunk v’s value is computed only when it is forced, using syntax force(v). Thunks also serve as A DAPTON’s (and N OMINAL A DAPTON’s) unit of incremental reuse: if we want to reuse a computation, we must make a thunk out of it. The syntax memo(e) we used earlier is shorthand for force(thunk(e, e)), where we abuse notation and treat e as a name that identifies itself.3 This construction introduces a thunk that the program immediately forces, eliminating laziness, but supporting memoization. CBPV distinguishes values, results (or terminal computations), and computations. A computation e can be turned into a value by thunking it via thunk(v, e). The first argument, the name v, is particular to N OMINAL A DAPTON; ordinary CBPV does not explicitly name thunks. Conversely, a value v can play the role of a result t via ret v; results t are a subclass of computations e. Functions λx.e are terminal computations; e v evaluates e to a function λx.e 0 and substitutes v for e 0 . Note that the function argument in e v is a value, not a computation. Let-expressions let x ← e1 in e2 evaluate the computation e1 first. The usual λ-calculus application e1 e2 can be simulated by let x ← e2 in (e1 x). Fixed points fix f.e are computations, and so are fixed point variables f. Given an injection into a disjoint union, inji v, the case computation form eliminates the sum and computes the corresponding ei branch, with v substituted for xi . Given a pair (v1 , v2 ), the computation split (v, x1 .x2 .e) computes e, first substituting v1 for x1 , and v2 for x2 . For more on (non-nominal, non-incremental) formulations of CBPV, including discussion of value types and computation types, see Levy (1999, 2001). Graphs, Pointers, and Names. Graphs G are defined in Figure 4. They represent the mutable store (references), 3 Notice that N OMINAL A DAPTON thunks are also named, which provides greater control over reuse. memo tables (which cache thunk results), and the DCG. Element p:v says that pointer p’s current value is v. Element p:e says that pointer p is the name of thunk e. Element p:(e, t) says that p is the name of thunk e with a previously computed result t attached. Element (p, a, b, q) is a DCG edge indicating that the thunk pointed to by p depends on node q, where q could either name another thunk or a reference cell. Dependency edges also reflect the action a that produced the edge and the edge’s status b (whether it is clean or dirty). Pointers in λNomA are represented as pairs k@ω,4 where nm k was the name given as the first argument in a call to thunk or ref, and ω was the namespace in which the call to thunk or ref took place. This namespace ω is either > for the top-level, or some µ.k1 as set by a call to nest. For the latter case, the program would first construct a value ns µ.k1 by calling ns with first argument nm k1 while in namespace µ. Notice that pointers and namespaces have similar structure, and similar assurances of determinism when creating named thunks, references, and namespaces. Finally, names k consist of the root name •, while other names are created by “forking” existing names: invoking fork(nm k) produces names nm k·1 and nm k·2. 4.2 Semantics We define a big-step operational semantics (Figure 5) with judgments G1 `p ω e ⇓ G2 ; t, which states that under input graph G1 and within namespace ω, evaluating the computation e produces output graph G2 and result t, where e’s evaluation was triggered by a previous force of thunk p. Incremental and Reference Systems. In order to state and later prove our central meta-theoretic result, from-scratch consistency, we define two closely-related systems of evaluation rules: an incremental system and a non-incremental or reference system. The incremental system models N OM INAL A DAPTON programs that transform a graph whose nodes are store locations (values and thunks) and whose edges represent dependencies (an edge from p to q means that q depends on p); the reference system models call-bypush-value programs under a plain store (a graph with no edges). Since it has no IC mechanisms, everything the reference system does is, by definition, from-scratch consistent. Rules above the double horizontal line in Figure 5 do not manipulate the graph, and are common to the incremental and reference systems. The shaded rules, to the left of vertical double lines, are non-incremental rules that never create edges and do not cache results. The rules to their right create edges, store cached results, and recompute results that have become invalid. 4.2.1 Common Rules Several of the rules at the top of Figure 5 are derived from standard CBPV rules. 4 The pointer root is needed to represent the top-level “thunk” in the semantics, but will never be mapped to an actual value or expression. Rules for standard language features (pairs, sums, functions, fix, and let) straightforwardly adapt the standard rules, ignoring p and ω and “threading through” input and output graphs. For example, Eval-app evaluates a function e1 to get a terminal computation λx.e2 and substitutes the argument v for x, threading through the graph: evaluating e1 produces G2 , which is given as input to the second premise, resulting in output graph G3 . Rule Eval-case, applying case to a sum inji v, substitutes v for xi in the appropriate case arm. The last three shared rules are not standard: they deal with names and namespaces. • Eval-fork splits a name k into children k·1 and k·2. Once forked, the name k should not be used to allocate a new reference or thunk, nor should k be forked again. • Running in namespace ω, Eval-namespace makes a new namespace ω.k and substitutes it for x in the body e. • Running in namespace ω, Eval-nest runs e1 in a different namespace µ and then returns to ω to run e2 , with x replaced by the result of running e1 . 4.2.2 Non-Incremental Rules These rules cover allocation and use of references and thunks. Like the incremental rules (discussed below), they use names and namespaces; however, they do not cache the results of thunks. We discuss the non-incremental rules first, because they are simpler and provide a kind of skeleton for the incremental rules. • Eval-refPlain checks that the pointer described by q = / dom(G1 )), adds a node q with k@ω is fresh (q ∈ contents v to the graph (G1 {q7→v} = G2 ), and returns a reference ref q. • Eval-thunkPlain is similar to Eval-refPlain, but creates a node with a suspended computation e instead of a value. • Eval-getPlain returns the contents of the pointer q. • Eval-forcePlain extracts the computation stored in a thunk (G1 (q) = e) and evaluates it under the namespace of q; that is, if q = k@µ, it evaluates it under µ. (The rule uses namespace(k@µ) = µ). 4.2.3 Incremental Rules Each non-incremental rule corresponds to one or more incremental rules: the incremental semantics is influenced by the graph edges, which are not present in the non-incremental system. For example, Eval-refPlain is replaced by EvalrefDirty and Eval-refClean. These rules use some predicates and operations, such as dirty-paths-in, that we explain informally as we describe the rules; they are fully defined in Figure 6. Incremental computation arises by making G1 a modification of a previously produced graph G2 , and then rerunning e. A legal modification involves replacing references p:v with p:v 0 and dirtying all edges along paths to p in G1 ` p ω e ⇓ G2 ; t Under graph G1 , evaluating expression e as part of thunk p in namespace ω yields G2 and t. Rules common to the non-incremental and incremental systems: G `pω t ⇓ G; t G1 `pω e1 ⇓ G2 ; λx.e2 G2 `pω [v/x]e2 ⇓ G3 ; t Eval-app G1 `pω e1 v ⇓ G3 ; t Eval-term G1 `pω e1 ⇓ G2 ; ret v G2 `pω [v/x]e2 ⇓ G3 ; t Eval-bind G1 `pω let x ← e1 in e2 ⇓ G3 ; t G1 `pω [(fix f.e)/f]e ⇓ G2 ; t Eval-fix G1 `pω fix f.e ⇓ G2 ; t G1 `pω G1 `pω [v/xi ]ei ⇓ G2 ; t Eval-case case (inji v, x1 .e1 , x2 .e2 ) ⇓ G2 ; t G1 `pω [v1 /x1 ][v2 /x2 ]e ⇓ G2 ; t Eval-split G1 `pω split ((v1 , v2 ), x1 .x2 .e) ⇓ G2 ; t G `pω fork(nm k) ⇓ G; ret (nm k·1, nm k·2) G1 `pω [ns ω.k/x]e ⇓ G2 ; t G1 `pω ns (nm k, x.e) ⇓ G2 ; t Eval-fork G1 `pµ e1 ⇓ G2 ; ret v Eval-namespace G1 `pω G2 `pω [v/x]e2 ⇓ G3 ; t nest(ns µ, e1 , x.e2 ) ⇓ G3 ; t Eval-nest Rules specific to the (non-incremental || incremental) systems: G1 {q7→v} = G2 q = k@ω q = k@ω q∈ / dom(G1 ) G1 {q7→v} = G2 G1 `pω ref( nm k , v) ⇓ G2 ; ret ref q G1 `pω dirty-paths-in(G2 , q) = G3 ref( nm k , v) ⇓ G3 , (p, alloc v, clean, q); ret ref q Eval-refPlain q = k@ω G(q) = v G `pω ref( nm k , v) ⇓ G, (p, alloc v, clean, q); ret ref q q = k@ω q = k@ω q∈ / dom(G1 ) G1 `pω G1 {q7→e} = G2 thunk( nm k , e) ⇓ G2 ; ret (thk q) G1 `pω Eval-thunkPlain `pω Eval-refClean dirty-paths-in(G2 , q) = G3 thunk( nm k , e) ⇓ G3 , (p, alloc e, clean, q); ret (thk q) q = k@ω G G(q) = v Eval-getPlain G `pω get (ref q) ⇓ G; ret v G1 {q7→e} = G2 Eval-refDirty exp(G, q) = e thunk( nm k , e) ⇓ G, (p, alloc e, clean, q); ret (thk q) Eval-thunkDirty Eval-thunkClean G(q) = v Eval-getClean G `pω get (ref q) ⇓ G, (p, obs v, clean, q); ret v G(q) = (e, t) all-clean-out(G, q) Eval-forceClean G force (thk q) ⇓ G, (p, obs t, clean, q); t `pω G1 (q) = e G1 `qnamespace(q) e ⇓ G2 ; t G1 `pω force (thk q) ⇓ G2 ; t Eval-forcePlain all-clean-out((G1 , G2 ), q2 ) consistent-action((G1 , G2 ), a, q2 ) G1 , (q1 , a, clean, q2 ), G2 `pω force (thk p0 ) ⇓ G3 ; t Eval-scrubEdge G1 , (q1 , a, dirty, q2 ), G2 `pω force (thk p0 ) ⇓ G3 ; t exp(G1 , q) = e 0 del-edges-out(G1 {q7→e 0 }, q) = G10 G10 `qnamespace(q) e 0 ⇓ G2 ; t 0 G2 {q7→(e 0 , t 0 )} = G20 all-clean-out(G20 , q) G20 `pω force (thk p0 ) ⇓ G3 ; t G1 `pω force (thk p0 ) ⇓ G3 ; t Eval-computeDep Figure 5: Evaluation rules of λNomA ; vertical bars separate non-incremental rules (left, shaded) from incremental rules (right) exp(G, p) = e if G(p) = e or G(p) = (e, t) G{p7→v} = G 0 where, if p ∈ / dom(G), then G 0 = (G, p:v) otherwise, if G = (G1 , p:v 0 , G2 ) then G 0 = (G1 , p:v, G2 ) G{p7→e} = G 0 where, if p ∈ / dom(G), then G 0 = (G, p:e) otherwise, if G = (G1 , p:e 0 , G2 ) or G = (G1 , p:(e 0 , t 0 ), G2 ) then G 0 = (G1 , p:e, G2 ) G{p7→(e, t)} = G 0 where, if p ∈ / dom(G), then G 0 = (G, p:(e, t)) otherwise, if G = (G1 , p:e 0 , G2 ) or G = (G1 , p:(e 0 , t 0 ), G2 ) then G 0 = (G1 , p:(e, t), G2 ) all-clean-out(G, p) ≡ ∀(p, a, b, q) ∈ G. (b = clean)  del-edges-out(G1 , p) = G2 ≡ nodes(G1 ) = nodes(G2 )   and ∀q 6= p. (q, a, b, q 0 ) ∈ G1 ⇒ (q, a, b, q 0 ) ∈ G2 and @a, b, q. (p, a, b, q) ∈ G2  dirty-paths-in(G1 , p) = G2 ≡ nodes(G1 ) = nodes(G2 )   and ∀q1 , q2 . (q1 , a, b 0 , q2 ) ∈ G2 ⇒ (q1 , a, b, q2 ) ∈ G1 and ∀q1 , q2 . (q1 , a, b, q2 ) ∈ G1 ⇒ there exists (q1 , a, b 0 , q2 ) ∈ G2 such that if path(q2 , p, G1 ) then (b 0 = dirty) else (b 0 = b)  path(p, q, G) ≡ (p, a, b, q) ∈ G  or ∃p 0 . ((p, a, b, p 0 ) ∈ G) and path(p 0 , q, G) consistent-action(G, a, q): consistent-action(G, obs v, q) when G(q) = v consistent-action(G, obs t, q) when G(q) = (e, t) consistent-action(G, alloc v, q) when G(q) = v consistent-action(G, alloc e, q) when G(q) = e Figure 6: Graph predicates and transformations the DCG: dirty-paths-in(G1 , p) is the same as G1 but with edges on paths to p marked dirty. Creating Thunks. The DCG is constructed during evaluation. The main rule for creating a thunk is Eval-thunkDirty, which converts computation e into a thunk by generating a pointer q from the provided name k, which couples the name with the current namespace ω. The output graph is updated to map q to e. If q happens to be in the graph already, all paths to it will be dirtied. Finally, the rule adds edge (p, alloc e, clean, q) to the output graph, indicating that the currently evaluating thunk p depends on q and is currently clean. Forcing Thunks. Forcing a thunk that has not been previously computed, an operation that involves one rule in the non-incremental system (Eval-forcePlain), involves at least two rules in the incremental system: Eval-computeDep and Eval-forceClean. Rule Eval-forceClean performs memoization: Given q pointing to (e, t), where t is the cached result of the thunk e, if q’s outgoing edges are clean then t is consistent and can be reused. Thus Eval-forceClean returns t immediately without reevaluating e, but adds an edge denoting that p has observed the result of q to be t. Rule Eval-computeDep applies when e = force (thk p0 ). This rule serves two purposes: it forces thunks for the first time, and it selectively recomputes until a cached result can be reused. Its first premise exp(G1 , q) = e 0 nondeterministically chooses some thunk q whose suspended expression is e 0 (whether or not q also has a cached result). Its second premise del-edges-out(G1 {q7→e 0 }, q) = G10 updates G1 so that q points to e 0 (removing q’s cached result, if any), and deletes outward edges of q. We need to delete the outward edges before evaluating e 0 because they represent what a previous evaluation of e 0 depended on. The third premise recomputes q’s expression e 0 , with q as the current thunk and q’s namespace component as the current namespace. In the fourth premise, the recomputed result t 0 is cached, resulting in graph G20 . The final premise evaluates force (thk p0 ), the same expression as the conclusion, but under a graph G20 containing the result of evaluating e 0 . In deriving this premise we may again apply Eval-computeDep to “fix up” other nodes of the graph, but will eventually end up with the thunk q chosen in the first premise being p0 itself. In this case, the last premise of Eval-computeDep will be derived by EvalforceClean (with q instantiated to p0 ). We skipped the fifth premise all-clean-out(G20 , q), which demands that all outgoing edges from q in the updated graph are clean. This consistency check ensures that the program has not used the same name for two different thunks or references, e.g., by calling thunk( nm k , e1 ) and later thunk( nm k , e2 ) in the same namespace ω. If this happens, the graph will first map k@ω to e1 but will later map it to e2 . Without this check, a computation q that depends on both e1 and e2 could be incorrect, because (re-)computing one of them might use cached values that were due to the other. Fortunately, this potential inconsistency is detected by all-clean-out: When a recomputation of q results in k@ω being mapped to a different value, all existing paths into k@ω are dirtied (by the last premise of Eval-thunkDirty above). Since q is one of the dependents, it will detect that fact and can signal an error. This fifth premise formalizes the double-use checking algorithm first described in Section 2.4. In particular, each use of Eval-computeDep corresponds to the implementation pushing (and later popping) a node from its force stack. By inspecting the outgoing edges upon each pop, it effectively verifies that each node popped from the stack is clean. Note that in the case q = p0 —where the “dependency” being computed is p0 itself—the last premise could be derived by Eval-forceClean, which looks up the result just com0 0 puted by G10 `q namespace(q) e ⇓ G2 ; t . Replacing Dirty Edges with Clean Edges. Eval-scrubEdge replaces a dirty edge (q1 , a, dirty, q2 ) with a clean edge (q1 , a, clean, q2 ). First, it checks that all edges out from q2 are clean; this means that the contents of q2 are up-to- date. Next, it checks that the action a that represents q1 ’s dependency on q2 is consistent with the contents of q2 . For example, if q2 points to a thunk with a cached result (e2 , t2 ) and a = obs t, then the “consistent-action” premise checks that the currently cached result t2 matches the result t that was previously used by q1 . Creating Reference Nodes. Like Eval-refPlain, Eval-refDirty creates a node q with value v: G1 {q7→v} = G2 . Unlike Eval-refPlain, Eval-refDirty does not check that q is not in the graph: if we are recomputing, q may already exist. So G1 {q7→v} = G2 either creates q pointing to v, or updates q by replacing its value with v. It then marks the edges along all paths into q as dirty dirty-paths-in(G2 , q) = G3 ; these are the paths from nodes that depend on q. Re-creating Clean References. Eval-refClean can be applied only during recomputation, and only when G(q) = v. That is, we are evaluating ref( nm k , v) and allocating the same value as the previous run. Since the values are the same, we need not mark any dependency edges as dirty, but we do add an edge to remember that p depends on q. Creating Thunks. Eval-thunkDirty corresponds exactly to Eval-refDirty, but for thunks rather than values. Re-creating Thunks. Eval-thunkClean corresponds to EvalrefClean and does not change the contents of q. Note that the condition (exp(G, q)) = e applies whether or not q includes a cached result. If a cached result is present, that is, G(q) = (e, t), it remains in the output graph. Reading References. Eval-getClean is the same as EvalgetPlain, except that it adds an edge representing the dependency created by reading the contents of q. The Rules vs. the Implementation. Our rules are not intended to be an “instruction manual” for building an implementation; rather, they are intended to model our implementation. To keep the rules simple, we underspecify two aspects of the implementation. First, when recomputing an allocation in the case when the allocated value is equal to the previously allocated value (G(q) = v), either Eval-refDirty or Eval-refClean applies. However, in this situation the implementation always follows the behavior of Eval-refClean, since that is the choice that avoids unnecessarily marking edges as dirty and causing more recomputation. An analogous choice exists for EvalthunkClean versus Eval-thunkDirty. Second, similarly to the original A DAPTON system, the timing of dirtying and cleaning is left open: Eval-scrubEdge can be applied to dirty edges with no particular connection to the p0 mentioned in the subject expression force (thk p0 ), and the timing of recomputation via Eval-computeDep is left open as well. Our implementations of dirtying and reevaluation fix these open choices, and they are each analogous to the algorithms found in the original A DAPTON work. For details, we refer the interested reader to Algorithm 1 in Hammer et al. (2014). 4.3 From-Scratch Consistency We show that an incremental computation modeled by our evaluation rules has a corresponding non-incremental computation: given an incremental evaluation of e that produced t, a corresponding non-incremental evaluation also produces t. Moreover, the values and expressions in the incremental output graph match those in the graph produced by the nonincremental evaluation. Eliding some details and generalizations, the from-scratch consistency result is: Theorem. If incremental Di derives G1 `p ω e ⇓ G2 ; t, then a non-incremental Dni derives bG1 cP1 `p ω e ⇓ bG2 cP2 ; t where bG1 cP1 ⊆ bG2 cP2 and P2 = P1 ∪ dom(W). Here, W is the set of pointers that Di may allocate. The restriction function bGi cPi drops all edges from Gi and keeps only nodes in the set Pi . It also removes any cached results t. The set Pi corresponds to the nodes in Gi that are present at this point in the non-incremental derivation, which may differ from the incremental derivation since EvalcomputeDep need not compute dependencies in left-to-right order. The full statement, along with definitions of W, the restriction function, and lemmas, is in the extended version (Hammer et al. 2015) as Theorem B.13. 5. Implementation We implemented N OMINAL A DAPTON as an OCaml library. In this section, we describe its programming interface, data structures, and algorithms. Additional details about memory management appear in Appendix A. The code for N OMINAL A DAPTON is freely available: https://github.com/plum-umd/adapton.ocaml 5.1 Programming Interface Figure 7 shows the basic N OMINAL A DAPTON API. Two of the data types, name and aref, correspond exactly to names and references in Sections 2 and 4. The other data types, mfn and athunk, work a little differently, due to limitations of OCaml: In OCaml, we cannot type a general-purpose memo table (containing thunks with non-uniform types), nor can we examine a thunk’s “arguments” (that is, the values of the variables in a closure’s environment).5 To overcome these limitations, our implementation creates a tight coupling between namespaces and memoized functions. The function mk mfn k f takes a name k and a function f and returns a memoized function mfn. The function f must have type ('arg,'res) mbody, i.e., it takes an mfn 5 Recall from the start of the previous section that memoized calls are implemented as thunks in N OMINAL A DAPTON. type name val new : unit → name val fork : name → name ∗ name type ('arg,'res) mfn type ('arg,'res) mbody = ('arg,'res) mfn → 'arg → 'res val mk mfn : name → ('arg,'res) mbody → ('arg,'res) mfn val call : ('arg,'res) mfn → ('arg → 'res) type 'res athunk val thunk : ('arg,'res) mfn → name → 'arg → 'res athunk val force : 'res athunk → 'res type 'a aref val aref : name → 'a → 'a aref val get : 'a aref → 'a val set : 'a aref → 'a → unit Figure 7: Basic N OMINAL A DAPTON API and an 'arg as arguments, and produces a 'res. (The mfn is for recursive calls; see the example below.) Later on, we call thunk m k arg to create a thunk of type athunk from the memoized function m, with thunk name k (relative to m’s namespace) and argument arg. The code for the thunk will be whatever function m was created from. In other words, in our implementation, only function calls can be memoized (not arbitrary expressions), and each set of thunks that share the same function body also share the same namespace. Using this API, we can rewrite the map code from Section 2.3 as follows: let map f map f name = let mfn = mk mfn map f name (fun mfn list → match list with | Nil → Nil | Cons(hd, n, tl ref) → let n1, n2 = fork n in let tl = get tl ref in Cons(f hd, aref(n1, force(thunk mfn n2 tl))) ) in fun list → call mfn list The code above differs from the earlier version in that the programmer uses mk mfn with the name map f name to create a memo table in a fresh namespace. Moreover, memoization happens directly on the recursive call, by introducing a thunk (and immediately forcing it). 5.2 Implementing Reuse Much of the implementation of N OMINAL A DAPTON remains unchanged from classic A DAPTON. Specifically, both systems use DCGs to represent dependency information among nodes representing thunks and refs, and both systems traverse their DCGs to dirty dependencies and to later reuse (and repair) partially inconsistent graph components. These steps were described in Sections 2 and 4, and were detailed further by Hammer et al. (2014). The key differences between N OMINAL A DAPTON and Classic A DAPTON have to do with memo tables and thunks. Memo Tables and Thunks. N OMINAL A DAPTON memo tables are implemented as maps from names to DCG nodes, which contain the thunks they represent. When creating memo tables with mk mfn, the programmer supplies a name and an mbody. Using the name, the library checks for an existing table (i.e., a namespace). If none exists, it creates an empty table, registers it globally, and returns it as an mfn. If a table exists, then the library checks that the given mbody is (physically) equal to the mbody component of the existing mfn; it issues a run-time error if not. When the program invokes thunk, it provides an mfn, name, and argument. The library checks the mfn’s memo table for an existing node with the provided name. If none exists, it registers a fresh node with the given name in the memo table and adds an allocation edge to it from the current node (which is set whenever a thunk is forced). If a node with the same name already exists, the library checks whether the argument is equal to the current one. If equal, then the thunk previously associated with the name is the same as the new thunk, so the library reuses the node, returning it as an athunk and adding an allocation edge to the DCG. If not equal, then the name has been allocated for a different thunk either in a prior run, or in this run. The latter case is an error that we detect and signal. To distinguish these two cases, we use the check described in Section 2.4. Assuming no error, the library needs to reset the state associated with the name: It clears any prior cached result, dirties any incoming edges (transitively), mutates the argument stored in the node to be the new one, and adds an allocation edge. Later, when and if this thunk is forced, the system will run it. Further, because of the dirtying traversal, any nodes that (transitively or directly) forced this changed node are also candidates for reevaluation. Names. A name in N OMINAL A DAPTON is implemented as a kind of list, as follows: type name = Bullet | One of int ∗ name | Two of int ∗ name Ignoring the int part, this is a direct implementation of λNomA ’s notion of names. The int part is a hash of the next element in the list (but not beyond it), to speed up disequality checks—if two One or Two elements do not share the same hash field they cannot be equal; if they do, we must compare their tails (because of hash collisions). Thus, at worst, establishing equality is linear in the length of the name, but we can short circuit a full traversal in many cases. We note that in our applications, the size of names is either a constant, or it is proportional to the depth (not total size) of the DCG, which is usually sublinear (e.g., logarithmic) in the current input’s total size. 6. Experimental Results This section evaluates N OMINAL A DAPTON’s performance against A DAPTON and from-scratch recomputation.6 We find that N OMINAL A DAPTON is nearly always faster than A DAPTON, which is sometimes orders of magnitude slower than from-scratch computation. N OMINAL A DAPTON always enjoys speedups, and sometimes very dramatic ones (up to 10900×). 6.1 Experimental Setup Our experiments measure the time taken to recompute the output of a program after a change to the input, for a variety of different sorts of changes. We compare N OMINAL A DAPTON against classic A DAPTON and from-scratch computation on the changed input; the latter avoids all IC-related overhead and therefore represents the best from-scratch time possible. We evaluate two kinds of subject programs. The first set is drawn from the IC literature on SAC and Adapton (Hammer et al. 2011, 2009, 2014). These consist of standard list processing programs: (eager and lazy) filter, (eager and lazy) map, reduce(min), reduce(sum), reverse, median, and a listbased mergesort algorithm. Each program operates over randomly generated lists. These aim to represent key primitives that are likely to arise in standard functional programs, and use the patterns discussed in Section 3.1. We also consider an implementation of quickhull (Barber et al. 1996), a divideand-conquer method for computing the convex hull of a set of points in a plane. Convex hull has a number of applications including pattern recognition, abstract interpretation, computational geometry, and statistics. We also evaluate an incremental IMP interpreter, as discussed in Section 3.3, measuring its performance on a variety of different IMP programs. fact iteratively computes the factorial of an integer. intlog;fact evaluates the sequence of computing an integer logarithm followed by factorial. array max allocates, initializes, and destructively computes the maximum value in an array. matrix mult allocates, initializes, and multiplies two square matrices (implemented as arrays of arrays of integers). These IMP programs exhibit imperative behavior not otherwise incrementalizable, except as programs evaluated by a purely functional, big-step interpreter implemented in an incremental meta-language. All programs were compiled using OCaml 4.01.0 and run on an 8-core, 2.26 GHz Intel Mac Pro with 16 GB of RAM running Mac OS X 10.6.8. 6.2 List-Based Experiments Table 1 contains the results of our list experiments. For each program (leftmost column), we consider a randomly 6 Hammer et al. (2014) report that for interactive, lazy usage patterns, A DAPTON substantially outperforms another state-of-the-art incremental technique, self-adjusting computation (SAC), which sometimes can incur significant slowdowns. We do not compare directly against SAC here. Batch-mode comparison (“demand all”) n Edit FS (ms) A (×) 1e4 insert 21 0.178 delete 21 0.257 replace 21 0.108 eager map 1e4 insert 21.6 0.0803 delete 21.6 0.0920 replace 21.6 0.0841 min 1e5 insert 424 2790 delete 424 4450 replace 424 1850 sum 1e5 insert 421 785 delete 421 1140 replace 421 727 reverse 1e5 insert 197 0.0404 delete 197 0.764 replace 197 0.0404 median 1e4 insert 3010 0.747 delete 3010 192 replace 3010 0.755 mergesort 1e4 insert 267 0.212 delete 267 11.0 replace 267 0.205 quickhull 1e4 insert 853 0.0256* delete 853 0.0270* replace 853 0.0378* Program eager filter NA (×) 1.29 1.39 1.27 1.02 1.01 1.09 2980 4720 2310 833 1230 733 1.23 1.19 1.23 127 115 148 12.0 10.1 10.5 3.78 4.11 3.86 (a) Speedups of batch-mode experiments Demand-driven comparison (“demand one”) n Edit FS (ms) A (×) NA (×) 1e5 insert 0.016 3.79 3.55 delete 0.016 18.1 16.3 replace 0.016 3.55 3.20 lazy map 1e5 insert 0.016 4.08 3.79 delete 0.016 18.1 20.4 replace 0.016 3.71 3.62 reverse 1e5 insert 188 0.067 2130 delete 188 50.8 4540 replace 188 0.068 2360 mergesort 1e4 insert 63.4 96.3 369 delete 63.4 111 752 replace 63.4 86.2 336 quickhull 1e4 insert 509 0.0628* 5.30 delete 509 0.0571* 5.52 replace 509 0.0856* 5.23 Program lazy filter (b) Speedups of demand-driven experiments Table 1: List benchmarks generated input of size n and three kinds of edits to it: insert, delete, and replace. For the first, we insert an element in the list; for the second, we delete the inserted element; for the last, we delete an element and then re-insert an element with a new value. Rather than consider only one edit position, we consider ten positions in the input list, spaced evenly (1/10 through the list, 2/10 through the list, etc.), and perform the edit at those positions, computing the average time across all ten edits. We report the median of seven trials of this experiment. The table reports the time to perform recomputation from scratch, in milliseconds, in column FS, and then the speedup (or slow-down) factor compared to the from-scratch time for both A DAPTON, in column A, and N OMINAL A DAPTON, in column NA. Table 1a considers the case when all of the program’s output is demanded, whereas Table 1b considers the case when only one element of the output is demanded, thus measuring the benefits of both nominal and classic A DAPTON in a lazy setting. Note that in the lazy setting, FS sometimes also avoids complete recomputation, since thunks that are created but never forced are not executed. Results: Demand All. Table 1a focuses on benchmarks where all of the output is demanded, or when there is only a single output value (sum and minimum). In these cases, several patterns emerge in the results. First, for eager map (Section 2) and eager filter, N OM INAL A DAPTON gets modest speedup and breaks even, respectively, while A DAPTON gets slowdowns of one to two orders of magnitude. As Section 2 explains, A DAPTON recomputes and reallocates a linear number of output elements for each O(1) input change (insertion, deletion or replacement). By contrast, N OMINAL A DAPTON need not rebuild the prefix of the output lists. Next, the benchmarks minimum and sum use the probabilistically balanced trees from Section 3.1 to do an incremental fold where, in expectation, only a logarithmic number of intermediate computations are affected by a small change. Due to this construction, both A DAPTON and N OM INAL A DAPTON get large speedups over from-scratch computation (up to 4720×). N OMINAL A DAPTON tends to get slightly more speedup, since its use of names leads to less tree rebuilding. This is similar to, but not as asymptotically deep as, the eager map example (O(log n) here versus O(n) above). The next four benchmarks (reverse, mergesort, median, quickhull) show marked contrasts between the times for N OMINAL A DAPTON and A DAPTON: In all cases, N OMI NAL A DAPTON gets a speedup (from about 4× to 148×), whereas A DAPTON nearly always gets a slowdown. Two exceptions are the deletion changes that revert a prior insertion. In these cases, A DAPTON reuses the original cache information that it duplicates (at great expense) after the insertion. A DAPTON gets no speedup for quickhull, our most complex benchmark in this table. By contrast, N OMINAL A DAPTON performs updates orders of magnitude faster than A DAPTON and gets a speedup over from-scratch; the stars (∗) indicate that we ran quickhull at one tenth of the listed input size for A DAPTON, because otherwise it used too much memory due to having large memo tables but little reuse from them. Results: Demand One. Table 1b focuses on benchmarks where one (of many possible) outputs are demanded. In these cases, two patterns emerge. First, on simple lazy list benchmarks map and filter, A DAPTON and N OMINAL A DAPTON perform roughly the same, with A DAPTON getting slightly higher speedups than N OMINAL A DAPTON. These cases are good fits for A DAPTON’s model, and names only add overhead. Program fact intlog;fact array max matrix mult Batch-mode comparison (“demand all”) n Edit FS (ms) A (×) 5e3 repl 945 0.520 swap1 947 2410 swap2 955 4740 ext 847 0.464 230 , 5e3 swap 849 0.413 210 repl1 191 0.323 repl2 191 0.310 20x20 swap1 4500 0.617 swap2 4500 0.756 25x25 ext 6100 1.50 NA (×) 10900 4740 6590 0.926 3.18 6.52 7.62 1.31 1.17 1.55 Table 2: Speedups of IMP interpreter experiments Second, on more involved list benchmarks (reverse, mergesort and quickhull), N OMINAL A DAPTON delivers greater speedups (from 5× to 4540×) than A DAPTON, which often delivers slowdowns. Two exceptions are mergesort, where A DAPTON delivers speedups, but is still up to 6.7× slower than N OMINAL A DAPTON, and the deletion changes, which—as in the table above—are fast because of spurious duplication in the insertion change. In summary, N OMINAL A DAPTON consistently delivers speedups for small changes, while A DAPTON does so to a lesser extent, and much less reliably. 6.3 Interpreter Experiments We tested the incremental behavior of the IMP interpreter with three basic forms of edits to the input programs: replacing values (replace), swapping subexpressions (swap), and increasing the size of the input (ext). These experiments all take the following form: evaluate an expression, mutate the expression, and then reevaluate. • For fact, repl mutates the value of an unused variable; swap1 reverses the order of two assignments at the start of the program; swap2 reverses the order of two assignments at the end; and ext increases the size of the input. • For intlog;fact, swap swaps the two subprograms. • For array max, repl1 replaces a value at the start of the array, and repl2 moves a value from the start to the end of the array. • For matrix mult, swap1 reverses the order of the initial assignments of the outer arrays of the input matrices; swap2 reverses the order of the while loops that initialize the inner arrays of the input matrices; and ext extends the dimensions of the input arrays. Results. Table 2 summarizes the results, presented the same way as the list benchmarks. We can see that N OMINAL A DAPTON provides a speedup over from-scratch computation in all but one case, and can provide dramatic speedups. In addition, N OMINAL A DAPTON consistently outperforms classic A DAPTON, in some cases providing a speedup where A DAPTON incurs a (sizeable) slowdown. The fact program’s repl experiment shows significant performance improvement due to names. Classic A DAPTON dirties each intermediary environment and is forced to recompute. With the naming strategy outlined in Section 3.3, the environment is identified without regard to the particular values inserted. Future computations that depend on the environment, but not the changed value in particular, are reused. The fact swap experiments show significant speedup for both classic A DAPTON and N OMINAL A DAPTON, because the trie map representation remains unchanged regardless of order of the assignments. The remaining results fall into two categories. The edits made to intlog;fact, array max, and matrix mult’s swaps show speedups between 1.17× and 7.62× with N OMINAL A DAPTON, while classic A DAPTON exhibits a slowdown, due to spending much of its time creating and evaluating new nodes in the DCG. N OMINAL A DAPTON, on the other hand, spends its time walking the already-present nodes and reusing many (from 25% to as much as 99%) of them, with the added benefit of far better memory performance. The last category includes the ext tests for fact (increasing the input value) and matrix mult (extending the dimensions of the input matrices). Such changes have pervasive effects on the rest of the computation and are a challenge to incremental reuse. Extension for matrix multiplication shows a modest speedup over the from-scratch running time for both nominal and classic A DAPTON. N OMINAL A DAPTON is able to reuse a third of the nodes created during the original run, while classic A DAPTON is not able to reuse any. Increasing the value of the input to factorial causes similar behavior, though the single, short loop prevents the amount of reuse from overcoming the from-scratch time. 7. Related Work Here we survey past approaches to incremental computation, organizing our discussion into three categories: static approaches, dynamic approaches, and specialized approaches. Static Approaches to IC. These approaches transform programs to derive a second program that can process “deltas”; the derived program takes as input the last (full) output and the representation of an input change, and produces (the representation of) the next output change. This program derivation is performed a priori, before any dynamic changes are issued. As such, static approaches have the advantage of not incurring dynamic space or time overhead, but also carry disadvantages that stem from not being dynamic in nature: They cannot handle programs with general recursion, and cannot take advantage of cached intermediate results, since by design, there are none (Cai et al. 2014; Liu and Teitelbaum 1995). Other static approaches transform programs into ones that cache and reuse past results, given a predefined class of input changes (Liu et al. 1998). Future work should explore an empirical comparison between these approaches and comtemporary dynamic approaches, described below. Dynamic Approaches to IC. In contrast to static approaches, dynamic approaches attempt to trade space for time savings. A variety of dynamic approaches to IC have been proposed. Most early approaches fall into one of two camps: they either perform function caching of pure programs (Bellman 1957; McCarthy 1963; Michie 1968; Pugh 1988), or they support input mutation and employ some form of dynamic dependency graphs. However, the programming model advanced by earlier work on dependence graphs lacked features like general recursion and dynamic allocation, instead restricting programs to those expressible as attribute grammars (a language of declarative constraints over tree structures) (Demers et al. 1981; Reps 1982a,b; Vogt et al. 1991). Some recent general-purpose approaches to dynamic IC (SAC and A DAPTON) support general-purpose input structures and general recursion; internally, they use a notion of memoization to find and reuse portions of existing dependency graphs. As described in Hammer et al. (2014), SAC and A DAPTON differ greatly in the programming model they support (SAC is eager/batch-oriented whereas A DAPTON is demand-driven) and in how they represent dependency graphs. Consequently, they have different performance characteristics, with A DAPTON excelling at demand-driven and interactive settings, and SAC doing better in non-interactive, batch-oriented settings (Hammer et al. 2014). The presence of dynamic memory allocation in SAC poses a reuse problem due to “fresh” object identities, and thus benefits from a mechanism to deterministically match up identities from prior runs. Various past work on SAC addresses this problem in some form (Acar and Ley-Wild 2009; Acar et al. 2004, 2006; Hammer and Acar 2008) describing how to use “hints” or “keys.” The reuse problem in N OMINAL A DAPTON is more general in nature than in SAC, and thus requires a very different solution. For example, N OMINAL A DAPTON’s DCG and more general memo tables do not impose SAC’s total ordering of events, admitting more opportunities for reuse, but complicating the issue of assuring that names are not used more than once within a run. The use of thunks, which also need names, adds a further layer of complication. This paper addresses name reuse in this (more general) IC setting. Further, we address other naming issues, such as how to generate new names from existing ones (via fork) and how to determinize memo table creation (via named namespaces). Ongoing research in programming languages and systems continues to generalize memoization. Bhatotia et al. (2015) extend memoization to parallel C and C++ programs written against a traditional UNIX threading API. Bhatotia et al. (2011) extend memoization to distributed, cloudbased settings (MapReduce-style computations in particular). Chen et al. (2014) reduce the (often large) time and space overhead, which is pervasive in both SAC and in A DAPTON. In particular, they propose coarsening the granu- larity of dependence tracking, and report massive reductions (orders of magnitude) in space as a result. We believe that their approach (“probabilistic chunking”) should be immediately applicable to our setting, as well as to classic A DAP TON . Indeed, early results for mergesort indicate up to an order-of-magnitude reduction in overhead. structural matching) N OMINAL A DAPTON enjoys uniformly better performance, sometimes achieving many orders-ofmagnitude speedups over from-scratch computation when A DAPTON would suffer significant slowdowns. Specialized Approaches to IC. Some recent approaches to IC are not general-purpose, but exploit domain-specific structure to handle input changes efficiently. DITTO incrementally checks invariants in Java programs, but is limited to invariant checking (Shankar and Bodı́k 2007). i3QL incrementally repairs database views (queries) when the underlying data changes due to insertions and removals of table rows (Mitschke et al. 2014). Finally, reactive programming (especially functional reactive programming or FRP) shares some elements with incremental computation: both paradigms offer programming models for systems that strive to efficiently react to “outside changes”; internally, they use graph representations to model dependencies in a program that change over time (Cooper and Krishnamurthi 2006; Czaplicki and Chong 2013; Krishnaswami and Benton 2011). However, the chief aim of FRP is to provide a declarative means of specifying programs whose values are time-dependent (stored in signals), whereas the chief aim of IC is to provide time savings for small input changes (stored in special references). The different scope and programming model of FRP makes it hard to imagine using it to write an efficient incremental sorting algorithm, though it may be possible. On the other hand, IC would seem to be an appropriate mechanism for implementing an FRP engine, though the exact nature of this connection remains unclear. We thank James Parker, Khoo Yit Phang, Robert Harper, as well as the anonymous reviewers of the program committees (including the AEC) for their questions, insights and feedback. We also thank James Parker for his contributions to an earlier prototype of the proposed design. This research was supported in part by NSF CCF-1116740, NSF CCF-1319666, DARPA FA8750-12-2-0106, and a gift from Mozilla Research. 8. Conclusion This paper has presented nominal matching, a new strategy that general-purpose incremental computation can use to match a proposed computation against a prior, memoized one. With nominal matching, programmers may explicitly associate a name with a memoized computation, and matching is done by name equality. Nominal matching overcomes the conservativity of structural matching, the most commonly employed approach, which compares computations based on their structure and thus may fail to reuse prior results when it should (i.e., those that are not structurally identical but require little work to bring up-to-date). We have implemented nominal matching as part of N OMINAL A DAP TON , an extension to the A DAPTON general-purpose system for incremental computation, and endowed it with namespaces for more flexible management of names in practical programs. We have formalized N OMINAL A DAPTON’s (and A DAPTON’s) algorithms and proved them correct. We have implemented a variety of data structures and benchmark programs in N OMINAL A DAPTON. Performance experiments show that compared to A DAPTON (which employs Acknowledgments References U. A. Acar. Self-Adjusting Computation. PhD thesis, Department of Computer Science, Carnegie Mellon University, May 2005. U. A. Acar and R. Ley-Wild. Self-adjusting computation with Delta ML. In Advanced Functional Programming. 2009. U. A. Acar, G. E. Blelloch, and R. Harper. Adaptive memoization. Technical Report CMU-CS-03-208, Carnegie Mellon University, Nov. 2004. U. A. Acar, G. E. Blelloch, M. Blume, R. Harper, and K. Tangwongsan. A library for self-adjusting computation. ENTCS, 148 (2), 2006. J. Allen. Anatomy of LISP. McGraw-Hill, Inc., New York, NY, USA, 1978. ISBN 0-07-001115-X. C. B. Barber, D. P. Dobkin, and H. Huhdanpaa. The quickhull algorithm for convex hulls. ACM Trans. Math. Softw., 22(4), Dec. 1996. R. Bellman. Dynamic Programming. Princeton Univ. Press, 1957. P. Bhatotia, A. Wieder, R. Rodrigues, U. A. Acar, and R. Pasquin. Incoop: MapReduce for incremental computations. In SOCC, 2011. P. Bhatotia, P. Fonseca, U. A. Acar, B. B. Brandenburg, and R. Rodrigues. iThreads: A threading library for parallel incremental computation. In ASPLOS, 2015. Y. Cai, P. G. Giarrusso, T. Rendel, and K. Ostermann. A theory of changes for higher-order languages: Incrementalizing λ-calculi by static differentiation. In PLDI, 2014. Y. Chen, U. A. Acar, and K. Tangwongsan. Functional programming for dynamic and large data with self-adjusting computation. In ICFP, 2014. G. H. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. In ESOP, 2006. E. Czaplicki and S. Chong. Asynchronous functional reactive programming for GUIs. In PLDI, 2013. A. Demers, T. Reps, and T. Teitelbaum. Incremental evaluation of attribute grammars with application to syntax-directed editors. In POPL, 1981. J.-C. Filliâtre and S. Conchon. Type-safe modular hash-consing. In Proceedings of the 2006 Workshop on ML, pages 12–19. ACM, 2006. M. Hammer and U. A. Acar. Memory management for selfadjusting computation. In ISMM, 2008. M. Hammer, G. Neis, Y. Chen, and U. A. Acar. Self-adjusting stack machines. In ACM SIGPLAN Conference on ObjectOriented Programming, Systems, Languages, and Applications (OOPSLA), 2011. M. A. Hammer, U. A. Acar, and Y. Chen. CEAL: a C-based language for self-adjusting computation. In ACM SIGPLAN Conference on Programming Language Design and Implementation, 2009. M. A. Hammer, Y. P. Khoo, M. Hicks, and J. S. Foster. Adapton: Composable, demand-driven incremental computation. In PLDI, 2014. M. A. Hammer, J. Dunfield, K. Headley, N. Labich, J. S. Foster, M. Hicks, and D. Van Horn. Incremental computation with names (extended version). arXiv:1503.07792 [cs.PL], 2015. N. R. Krishnaswami and N. Benton. A semantic model for graphical user interfaces. In ICFP, 2011. P. B. Levy. Call-by-push-value: A subsuming paradigm. In TLCA, 1999. P. B. Levy. Call-By-Push-Value. PhD thesis, Queen Mary and Westfield College, University of London, 2001. Y. A. Liu and T. Teitelbaum. Systematic derivation of incremental programs. Sci. Comput. Program., 24(1):1–39, 1995. Y. A. Liu, S. Stoller, and T. Teitelbaum. Static caching for incremental computation. ACM Transactions on Programming Languages and Systems, 20(3):546–585, 1998. J. McCarthy. A basis for a mathematical theory of computation. In Computer Programming and Formal Systems, 1963. D. Michie. “Memo” functions and machine learning. Nature, 218: 19–22, 1968. R. Mitschke, S. Erdweg, M. Köhler, M. Mezini, and G. Salvaneschi. i3QL: Language-integrated live data views. In OOPSLA, 2014. W. Pugh. Incremental Computation via Function Caching. PhD thesis, Cornell University, 1988. W. Pugh and T. Teitelbaum. Incremental computation via function caching. In POPL, 1989. T. Reps. Generating Language-Based Environments. PhD thesis, Cornell University, Aug. 1982a. T. Reps. Optimal-time incremental semantic analysis for syntaxdirected editors. In POPL, 1982b. A. Shankar and R. Bodı́k. DITTO: Automatic incrementalization of data structure invariant checks (in Java). In PLDI, 2007. H. Vogt, D. Swierstra, and M. Kuiper. Efficient incremental evaluation of higher order attribute grammars. In PLILP, 1991. G. Winskel. The Formal Semantics of Programming Languages: An Introduction. MIT Press, 1993. Supplement to “Incremental Computation with Names” This supplementary material contains additional details about how N OMINAL A DAPTON manages space, in Appendix A. Our full from-scratch consistency result, along with the definitions and lemmas it uses, appears in Appendix B. A. Space management In a long-running program, memo tables could grow without bound. N OMINAL A DAPTON helps reduce table sizes, as we have already seen, but we still need a mechanism to clean out the tables when space becomes limited. A natural idea is to implement a memo table’s mapping from name to DCG node with a weak reference, so that if the table is the only reference to the node, the node can be garbage collected when the system is short on space. This is not quite enough, though, because to implement dirtying, DCG edges are bidirectional. To avoid space leaks, it is critical to also make these backedges weak. Unfortunately, using weak references for both memo tables and back edges (as implemented in the original A DAPTON) is generally unsound. A DAPTON supports an interactive pattern called swapping, wherein DCG components can be swapped in and out of the active DCG. Pathologically, during the time that a sub-computation is swapped out, the garbage collector could remove some of this DCG structure, but not all of it. In particular, it could null out some of its weak back edges, because these nodes are only reachable by weak references. But if this swapped out sub-computation is later swapped back into the DCG, these (weak) back edges will be gone, and we will potentially fail to dirty nodes that ought to be dirty, as future changes occur. To fix the GC problem, we still use weak references for back edges, but use strong references for memo table entries, so that from the GC’s point of view, all DCG nodes are always reachable. To implement safe space reclamation, we also implement reference counting of DCG nodes, where the counts reflect the number of strong edges reaching a node. When DCG edges are deleted, the reference counts of target nodes are decremented. Nodes that reach zero are not immediately collected; this allows thunks to be “resurrected” by the swapping pattern. Instead, we provide a flush operation for memo tables that deletes the strong mapping edge for all nodes with a count of zero, which means they are no longer reachable by the main program. Deletion is transitive: removing the node decrements the counts of nodes it points to, which may cause them to be deleted. An interesting question is how to decide when to invoke flush; this is the system’s eviction policy. One obvious choice is to flush when the system starts to run short of memory (based on a signal from the GC), which matches the intended effect of the unsound weak reference-based approach. But placing the eviction policy under the program’s control opens other possibilities, e.g., the programmer could invoke flush when it is semantically clear that thunks cannot be restored. We leave to future work a further exploration of sensible eviction policies. B. Metatheory of λNomA B.1 Overview Our main formal result in this paper, from-scratch consistency, states that given an evaluation derivation corresponding to an incremental computation, we can construct a derivation corresponding to a non-incremental computation that returns the same result and a corresponding graph. That is, the incremental computation is consistent with a computation in the simpler non-incremental system. To properly state the consistency result, we need to define what it means for a graph to be well-formed (Section B.2), relate the incremental computation’s DCG to the non-incremental computation’s store (Section B.3), describe the sets of nodes read and written by an evaluation derivation (Section B.4), and prove a store weakening lemma (Section B.6). The consistency result itself is stated and proved in Section B.7. B.2 Graph Well-Formedness The judgment G ` H wf is read “H is a well-formed subset of G”. It implies that H is a linearization of a subset of G: within H, information sources appear to the left of information sinks, dependency edges point to the left, and information flows to the right. Consequently, H is a dag. For brevity, we write G wf for G ` G wf, threading the entire graph G through the rules deriving G ` H wf. The wellformedness rules in Figure 8 decompose the right-hand graph, and work as follows: • For values (Grwf-val) and thunks with no cached result (Grwf-thunk), the rules only check the correspondence between G (the entire graph) and H (the subgraph). • For thunks with a cached result, Grwf-thunkCache examines the outgoing edges. If they are all clean, then it checks that evaluating e again would not change the graph at all: D :: G `p ω e ⇓ G; t. If one or more edges are dirty, it checks that all incoming edges are dirty. G ` H wf G ` ε wf Grwf-emp G ` H wf G ` H wf G(p) = v Grwf-val G ` H, p:v wf G ` H wf G(p) = e Grwf-thunk G ` H, p:e wf G(p) = (e, t) if all-clean-out(G, p) then (D :: G `p ω e ⇓ G; t) if not all-clean-out(G, p) then all-dirty-in(G, p) Grwf-thunkCache G ` H, p:(e, t) wf (p, a, dirty, q) ∈ G q ∈ dom(H) if (p0 , a0 , b0 , p) ∈ G then b0 = dirty Grwf-dirtyEdge G ` H, (p, a, dirty, q) wf G ` H wf (p, a, clean, q) ∈ G consistent-action(H, a, q) all-clean-out(G, q) G ` H wf Grwf-cleanEdge G ` H, (p, a, clean, q) wf Figure 8: Graph well-formedness rules • Grwf-dirtyEdge checks that all edges flowing into a dirty edge are dirty: given edges from p to q and from q to r, where the edge from q to r is dirty (meaning that q depends on r and r needs to be recomputed), the edge from p to q should also be dirty. Otherwise, we would think we could reuse the result in p, even though p (transitively) depends on r. Conversely, if an edge from p to q is clean (Grwf-cleanEdge), then all edges out from q must be clean (otherwise we would contradict the “transitive dirtiness” just described). Moreover, the action a stored in the edge from p to q must be consistent with the contents of q. B.3 From Graphs to Stores: the Restriction Function To relate the graph associated with an incremental evaluation to the store associated with a non-incremental evaluation, we define a function bGcP that restricts G to a set of pointers P, drops cached thunk results (*), and erases all edges (**): Definition B.1 (Restriction). bεcP = ε bG, p:vcP = bGcP , p:v bG, p:vcP = bGcP (*) bG, p:ecP bG, p:ecP bG, p:(e, t)cP bG, p:(e, t)cP = = = = bGcP , p:e bGcP bGcP , p:e bGcP if p ∈ P if p ∈ /P if p ∈ P if p ∈ /P if p ∈ P if p ∈ /P (**) bG, (p, a, b, q)cP = bGcP B.4 Read and Write Sets Join and Merge Operations. To specify the read and write sets, we use a separating join H1 ∗ H2 on graphs: H1 ∗ H2 = (H1 , H2 ) if dom(H1 ) ⊥ dom(H2 ), and undefined otherwise. We also define a merge H1 ∪ H2 that is defined for subgraphs with overlapping domains, provided H1 and H2 are consistent with each other. That is, if p ∈ dom(H1 ) and p ∈ dom(H2 ), then H1 (p) = H2 (p). Definition B.2 (Reads/writes). The effect of an evaluation derived by D, written D reads R writes W, is defined in Figure 9. D by Eval-term() reads ε writes ε D by Eval-app(D1 , D2 ) reads R1 ∪ (R2 − W1 ) writes W1 ∗ W2 if D1 reads R1 writes W1 and D2 reads R2 writes W2 D by Eval-bind(D1 , D2 ) reads R1 ∪ (R2 − W1 ) writes W1 ∗ W2 if D1 reads R1 writes W1 and D2 reads R2 writes W2 D by Eval-nest(D1 , D2 ) reads R1 ∪ (R2 − W1 ) writes W1 ∗ W2 if D1 reads R1 writes W1 and D2 reads R2 writes W2 D by Eval-computeDep(D1 , D2 ) reads R1 ∪ R2 writes W2 if D1 reads R1 writes W1 and D2 reads R2 writes W2 and dom(W1 ) ⊆ dom(W2 ) D by Eval-fix(D0 ) D by Eval-case(D0 ) D by Eval-split(D0 ) D by Eval-namespace(D0 ) reads reads reads reads R R R R writes writes writes writes W W W W if if if if D0 D0 D0 D0 reads reads reads reads R R R R writes writes writes writes W W W W D by Eval-fork() reads ε writes ε D by Eval-refDirty() reads ε writes q:v where e = ref( nm k , v) and q = k@ω D by Eval-refClean() reads ε writes q:v where e = ref( nm k , v) and q = k@ω D by Eval-thunkDirty() reads ε writes q:e0 where e = thunk( nm k , e0 ) D by Eval-thunkClean() reads ε writes q:G(q) where e = thunk( nm k , e0 ) D by Eval-getClean() reads q:v writes ε 0 D by Eval-forceClean() reads R , q:(e, t) writes W 0 D by Eval-scrubEdge(D0 ) reads R writes W where e = get (ref q) and q = k@ω and G(q) = v where e = force (thk q) and D 0 reads R 0 writes W 0 where D 0 is the derivation that computed t (see text) if D0 reads R writes W Figure 9: Read- and write-sets of a derivation ~ reads R writes W” to mean that rule R concludes D and has This is a function over derivations. We write “D by R(D) ~ subderivations D. For example, D by Eval-fix(D0 ) reads R writes W provided that D0 reads R writes W where D0 derives the only premise of Eval-fix. In the Eval-forceClean case, we refer back to the derivation that (most recently) computed the thunk being forced (that is, the first subderivation of Eval-computeDep). A completely formal definition would take as input a mapping from pointers q to sets R 0 and W 0 , return this mapping as output, and modify the mapping in the Eval-computeDep case. Agreement. We want to express a result (Lemma B.5 (Respect for write-set)) that evaluation only affects pointers in the write set W, leaving the contents of other pointers alone, so we define what it means to leave pointers alone: Definition B.3 (Agreement on a pointer). Graphs G1 and G2 agree on p iff either exp(G1 , p) = exp(G2 , p), or p:v ∈ G1 and p:v ∈ G2 . Definition B.4 (Agreement on a set of pointers). Graphs G1 and G2 agree on a set P of pointers iff G1 and G2 agree on each p ∈ P. Lemma B.5 (Respect for write-set). 0 If D :: G `p ω e ⇓ G ; t where D is incremental and D reads R writes W 0 then G agrees with G on dom(G) − dom(W). Proof. By a straightforward induction on D, referring to Definition B.2. In the Eval-forceClean case, use the fact that G 0 differs from G only in the addition of an edge, which does not affect agreement. B.5 Satisfactory derivations In our main result (Theorem B.13), we will assume that all input and output graphs appearing within a derivation are wellformed, and that the read- and write-sets are defined: Definition B.6 (Locally satisfactory). A derivation D :: G1 `p ω e ⇓ G2 ; t is locally satisfactory if and only if (1) G1 wf and G2 wf (2) D reads R writes W is defined Definition B.7 (Globally satisfactory). An evaluation derivation D :: H1 `p ω e ⇓ H2 ; t is globally satisfactory, written D satisfactory, if and only if D is locally satisfactory and all its subderivations are locally satisfactory. B.6 Weakening The main result needs to construct a non-incremental derivation in a different order from the given incremental derivation. In particular, the first evaluation D1 done in Eval-computeDep will be done “later” in the non-incremental derivation. Since it is done later, the graph may have new material G 0 , and we need a weakening lemma to move from a non-incremental evaluation of D1 (obtained through the induction hypothesis) to a non-incremental evaluation over the larger graph. Lemma B.8 (Weakening (non-incremental)). If D :: G1 `p ω e ⇓ G2 ; t and D is non-incremental and G 0 is disjoint from G1 and G2 0 0 then D 0 :: G1 , G 0 `p ω e ⇓ G2 , G ; t where D is non-incremental. Proof. By induction on D. • Cases Eval-term, Eval-app, Eval-fix, Eval-bind, Eval-case, Eval-split, Eval-fork, Eval-namespace, Eval-nest: These rules do not manipulate the graph, so just use the i.h. on each subderivation, then apply the same rule. Since G1 {q7→v} = G2 , we have q ∈ dom(G2 ). It is given that dom(G 0 ) ⊥ dom(G2 ). Therefore q ∈ / dom(G1 , G 0 ). 0 0 By definition, (G1 , G ){q7→v} = (G2 , G ). Apply Eval-refPlain. • Case Eval-thunkPlain: Similar to the Eval-refPlain case. • Case Eval-forcePlain: We have exp(G1 , q) = e0 . Therefore exp(G1 , G 0 , q) = e0 . Use the i.h. and apply Eval-forcePlain. • Case Eval-getPlain: Similar to the Eval-forcePlain case. • Case Eval-refPlain: B.7 Main result: From-scratch consistency At the highest level, the main result (Theorem B.13) says: First approximation If H1 `p ω e ⇓ H2 ; t by an incremental derivation, 0 0 0 then H10 `p ω e ⇓ H2 ; t, where H1 is a non-incremental version of H1 and H2 is a non-incremental version of H2 . Using the restriction function from Section B.3, we can refine this statement: Second approximation If H1 `p ω e ⇓ H2 ; t by an incremental derivation and P1 ⊆ dom(H1 ), then bH1 cP1 `p ω e ⇓ bH2 cP2 ; t by a non-incremental derivation, for some P2 such that P1 ⊆ P2 . Here, the pointer set P1 gives the scope of the non-incremental input graph bH1 cP1 , and we construct P2 describing the non-incremental output graph bH2 cP2 . We further refine this statement by involving the derivation’s read- and write-sets: the read set R must be contained in P1 , the write set W must be disjoint from P1 (written dom(W) ⊥ P1 ), and P2 must be exactly P1 plus W. In the non-incremental semantics, the store should grow monotonically, so we will also show bH1 cP1 ⊆ bH2 cP2 : Third approximation If H1 `p ω e ⇓ H2 ; t by an incremental derivation D with D reads R writes W, and P1 ⊆ dom(H1 ) such that dom(R) ⊆ P1 and dom(W) ⊥ P1 then bH1 cP1 `p ω e ⇓ bH2 cP2 ; t where bH1 cP1 ⊆ bH2 cP2 and P2 = P1 ∪ dom(W). Even this refinement is not quite enough, because the incremental system can perform computations in a different order than the non-incremental system. Specifically, the Eval-computeDep rule carries out a subcomputation first, then continues with a larger computation that depends on the subcomputation. The subcomputation does not fit into the non-incremental derivation at that point; non-incrementally, the subcomputation is performed when it is demanded by the larger computation. Thus, we can’t just apply the induction hypothesis on the subcomputation. However, the subcomputation is “saved” in its (incremental) output graph. So we incorporate an invariant that all thunks with cached results in the graph “are consistent”, that is, they satisfy a property similar to the overall consistency result. When this is the case, we say that the graph is from-scratch consistent. The main result, then, will assume that the input graph is fromscratch consistent, and show that the output graph remains from-scratch consistent. Since the graph can grow in the interval between the subcomputation of Eval-computeDep and the point where the subcomputation is demanded, we require that the output graph G2 of the saved derivation does not contradict the larger, newer graph H. This is part (4) in the next definition. (We number the parts from (i) to (ii) and then from (1) so that they mostly match similar parts in the main result.) Definition B.9 (From-scratch consistency of a derivation). A derivation Di :: G1 `p ω e ⇓ G2 ; t is from-scratch consistent for Pq ⊆ dom(G1 ) up to H if and only if (i) (ii) (1) (2) (3) (4) Di satisfactory where Di reads R writes W dom(R) ⊆ Pq and dom(W) ⊥ Pq there exists a non-incremental derivation Dni :: bG1 cPq `p ω e ⇓ bG2 cP2 ; t bG1 cPq ⊆ bG2 cP2 P2 = Pq ∪ dom(W) bG2 cP2 ⊆ bHcdom(H) Definition B.10 (From-scratch consistency of graphs). A graph H is from-scratch consistent if, for all q ∈ dom(H) such that H(q) = (e, t), there exists Dq :: G1 `p ω e ⇓ G2 ; t and Pq ⊆ dom(G1 ) such that Dq is from-scratch consistent (Definition B.9) for Pq up to H. The proof of the main result must maintain that the graph is from-scratch consistent as the graph becomes larger, for which Lemma B.12 (Consistent graph extension) is useful. Lemma B.11 (Consistent extension). If Dq is from-scratch consistent for Pq up to H and H ⊆ H 0 then Dq is from-scratch consistent for Pq up to H 0 . Proof. Only part (4) of Definition B.9 involves the “up to” part of from-scratch consistency, so we already have (i)–(iii) and (1)–(3). We have (4) bG2 cP2 ⊆ bHcdom(H) . Using our assumptions, bHcdom(H) ⊆ bH 0 cdom(H 0 ) . Therefore (4) bG2 cP2 ⊆ bH 0 cdom(H 0 ) . Lemma B.12 (Consistent graph extension). If H is from-scratch consistent and H ⊆ H 0 and, for all q ∈ dom(H 0 ) − dom(H) such that H 0 (q) = (e, t), there exists Dq :: G1 `p ω e ⇓ G2 ; t and Pq ⊆ dom(G1 ) such that Dq is from-scratch consistent (Definition B.9) for Pq up to H 0 , then H 0 is from-scratch consistent. Proof. Use Lemma B.11 (Consistent extension) on each “old” pointer with a cached result in H, then apply the definitions for each “new” pointer with a cached result in dom(H 0 ) − dom(H). At last, we can state and prove the main result, which corresponds to the “third approximation” above, plus the invariant that the graph is from-scratch consistent (parts (iii) and (4)). We present most of the proof in a line-by-line style, with the judgment or proposition being derived in the left column, and its justification in the right column. In each case, we need to show four different things (1)–(4), some of which are obtained midway through the case, so we highlight these with “(1) Z ”, and so on. Theorem B.13 (From-scratch consistency). Given an incremental Di :: H1 `p ω e ⇓ H2 ; t where (i) Di satisfactory where D reads R writes W (ii) a set of pointers P1 ⊆ dom(H1 ) is such that dom(R) ⊆ P1 and dom(W) ⊥ P1 (iii) H1 is from-scratch consistent (Definition B.10) then (1) (2) (3) (4) there exists a non-incremental Dni :: bH1 cP1 `p ω e ⇓ bH2 cP2 ; t bH1 cP1 ⊆ bH2 cP2 P2 = P1 ∪ dom(W) H2 is from-scratch consistent (Definition B.10). Proof. By induction on Di :: H1 `p ω e ⇓ H2 ; t. • Case Eval-term: (1) (2) (3) (4) By Definition B.2, W = ε, so let P2 = P1 . Apply Eval-term. We have H1 = H2 and P1 = P2 so bH1 cP1 = bH2 cP2 . It follows from dom(W) = ∅ and P2 = P1 that P2 = P1 ∪ dom(W). It is given (iii) that H1 is from-scratch consistent. We have H1 = H2 , so H2 is from-scratch consistent. • Case Eval-fork: • Case H1 `p ω (1) Z (2) Z (3) Z (4) Z Similar to the Eval-term case. H1 (q) = v Eval-getClean get (ref q) ⇓ H1 , (p, obs v, clean, q); ret v H2 = (H1 , (p, obs v, clean, q)) e = get (ref q) H1 (q) = v R = q:v dom(R) ⊆ P1 {q} ⊆ P1 bH1 cP1 (q) = v bH1 cP1 `p ω e ⇓ bH1 cP1 ; ret v Let P2 be P1 . bH1 cP1 = bH2 cP1 bH1 cP1 `p ω e ⇓ bH2 cP1 ; ret v By def. of restriction By above equality W=ε bH1 cP1 ⊆ bH2 cP1 P2 = P1 ∪ dom(ε) H1 from-scratch consistent H2 from-scratch consistent By Definition B.2 If = then ⊆ P2 = P1 Given (iii) H2 differs from H1 only in its edges • Case q = k@ω H1 `p ω H1 {q7→e0 } = G2 Given 00 Premise By Definition B.2 Given (iii) R = q:v By Definition B.1 By rule Eval-getPlain dirty-paths-in(G2 , q) = G3 thunk( nm k , e0 ) ⇓ G3 , (p, alloc e0 , clean, q); ret (thk q) Eval-thunkDirty H2 = (G3 , (p, alloc e0 , clean, q)) Given e = thunk( nm k , e0 ) Given q = k@ω Given R= ε By Definition B.2 00 W = q:e0 dom(W) ⊥ P1 Given q∈ / P1 q∈ / dom(bH1 cP1 ) From Definition B.1 p bH1 cP1 `ω thunk( nm k , e0 ) ⇓ bH1 cP1 {q7→e0 }; ret (thk q) By rule Eval-thunkPlain (3) Z Let P2 be P1 ∪ {q}. bH1 cP1 {q7→e0 } = bH1 {q7→e0 }cP1 q∈ / P1 = bdirty-paths-in(H1 {q7→e0 }, q)cP1 q∈ / P1 = bdirty-paths-in(H1 {q7→e0 }, q), (p, alloc e0 , clean, q)cP1 From Definition B.1 (1) Z bH1 cP1 `p By above equalities ω thunk( nm k , e0 ) ⇓ bH2 cP1 {q7→e0 }; ret (thk q) bH1 cP1 ⊆ bH1 {q7→e0 }cP2 Immediate bH1 cP1 ⊆ bG2 cP2 By Definition B.1 bH1 cP1 ⊆ bG3 cP2 Restriction ignores edges (2) Z bH1 cP1 ⊆ bH2 cP2 Restriction ignores edges H1 from-scratch consistent Given (iii) (4) Z H2 from-scratch consistent By Lemma B.12 (Consistent graph extension) q = k@ω • Case H1 `p ω exp(H1 , q) = e0 thunk( nm k , e0 ) ⇓ H1 , (p, alloc e0 , clean, q); ret (thk q) Eval-thunkClean H2 = (H1 , (p, alloc e0 , clean, q)) Given Given e = thunk( nm k , e0 ) q = k@ω Given W = q:e0 By Definition B.2 dom(W) ⊥ P1 Given q∈ / P1 q∈ / dom(bH1 cP1 ) From Definition B.1 nm k , e ) ⇓ bH c {q7 By rule Eval-thunkPlain bH1 cP1 `p thunk( ω 0 1 P1 →e0 }; ret (thk q) bH1 cP1 {q7→e0 } = bH1 , (p, alloc e0 , clean, q)cP1 From Definition B.1 and exp(H1 , q) = e0 By above equalities Z (1) bH1 cP1 `p ω thunk( nm k , e0 ) ⇓ bH2 cP1 {q7→e0 }; ret (thk q) Since H2 = H1 , (p, alloc e0 , clean, q), parts (2)–(4) are straightforward. • Case Eval-refDirty: Similar to the Eval-thunkDirty case. • Case Eval-refClean: Similar to the Eval-thunkClean case. p 0 • Case H1 `ω e1 ⇓ H ; ret v H1 `p ω H 0 `p ω [v/x]e2 ⇓ H2 ; t Eval-bind let x ← e1 in e2 ⇓ H2 ; t 0 D1 :: H1 `p Subderivation ω e1 ⇓ H ; ret v (i) D1 satisfactory By Definition B.7 R = (R1 ∪ (R2 − W1 )) By Definition B.2 00 W = W1 ∗ W2 dom(R1 ∪ (R2 − W1 )) ⊆ P1 dom(W1 ∗ W2 ) ⊥ P1 D1 reads R1 writes W1 D2 reads R2 writes W2 Given Given 00 00 (ii) dom(R1 ) ⊆ P1 (ii) dom(W2 ) ⊥ P1 0 bH1 cP1 `p ω e1 ⇓ bH cP 0 ; ret v bH1 cP1 ⊆ bH 0 cP 0 P 0 = P1 ∪ dom(W1 ) H 0 from-scratch consistent dom(R1 ∪ (R2 − W1 )) ⊆ P1 dom(W1 ∗ W2 ) ⊥ P1 By i.h. 00 00 00 D2 :: H 0 `p Subderivation ω [v/x]e2 ⇓ H2 ; t (i) D2 satisfactory By Definition B.7 dom(R1 ∪ (R2 − W1 )) ⊆ P1 Given dom(R2 − W1 ) ⊆ P1 dom(R2 ) ⊆ P1 ∪ dom(W1 ) (ii) dom(R2 ) ⊆ P 0 P 0 = P1 ∪ dom(W1 ) dom(W1 ∗ W2 ) ⊥ P1 Given dom(W1 ) ⊥ dom(W2 ) From def. of ∗ dom(W2 ) ⊥ P1 ∪ dom(W1 ) (ii) dom(W2 ) ⊥ P 0 P 0 = P1 ∪ dom(W1 ) p 0 bH cP 0 `ω [v/x]e2 ⇓ bH2 cP2 ; t By i.h. 00 bH 0 cP 0 ⊆ bH2 cP2 0 00 P2 = P ∪ dom(W2 ) 00 (4) Z H2 from-scratch consistent (2) Z bH1 cP1 ⊆ bH2 cP2 By transitivity of ⊆ P2 = P1 ∪ dom(W1 ) ∪ dom(W2 ) By P 0 = P1 ∪ dom(W1 ) (3) Z P2 = P1 ∪ dom(W) By W = W1 ∗ W2 (1) Z 0 bH1 cP1 `p ω e1 ⇓ bH cP 0 ; ret v p 0 bH cP 0 `ω [v/x]e2 ⇓ bH2 cP2 ; t Above Above bH1 cP1 `p ω let x ← e1 in e2 ⇓ bH2 cP2 ; t By rule Eval-bind • Case Eval-app: Similar to the Eval-bind case. • Case Eval-nest: Similar to the Eval-bind case. • Case Eval-fix: The input and output graphs of the subderivation match those of the conclusion, as do the read and write sets according to Definition B.2. Thus, we can just use the i.h. and apply Eval-fix. • Case Eval-case: Similar to the Eval-fix case. • Case Eval-split: Similar to the Eval-case case. • Case Eval-namespace: Similar to the Eval-fix case. 0 • Case exp(H1 , q) = e G2 {q7→(e 0 , t 0 )} = G20 all-clean-out(G20 , q) D2 :: G20 `p ω force (thk p0 ) ⇓ H2 ; t del-edges-out(H1 {q7→e }, q) = 0 D1 :: G10 `q namespace(q) e ⇓ G2 ; t 0 G10 0 H1 ` p ω force (thk p0 ) ⇓ H2 ; t e = force (thk p0 ) R = (R1 ∪ R2 ) W = W2 D1 reads R1 writes W1 D2 reads R2 writes W dom(W1 ) ⊆ dom(W2 ) Eval-computeDep Given By Definition B.2 00 00 00 00 We don’t immediately need to apply the i.h. to D1 , because that computation will be done later in the reference derivation. But we do need to apply the i.h. to D2 :: G20 `p ω e ⇓ H2 ; t. So we need to show part (iii) of the statement, which says that each cached computation in the input graph is consistent with respect to an earlier version of the graph. Since we’re adding such a computation e 0 in G20 , which is the input graph of D2 , we have to show that the computation of e 0 (by D1 ) is consistent, which means applying the i.h. to D1 . (iii) dom(R1 ) ⊆ P1 (iii)dom(W1 ) ⊥ P1 H1 from-scratch consistent G10 from-scratch consistent (1) (2) (3) (4) 0 0 D1 :: G10 `q namespace(q) e ⇓ G2 ; t q 0 0 bG1 cP1 `namespace(q) e ⇓ bG2 cP10 ; t 0 bG10 cP1 ⊆ bG2 cP10 P10 = P1 ∪ dom(W1 ) G2 from-scratch consistent bG2 cP10 ⊆ bG2 cP10 G20 from-scratch consistent dom(R) ⊆ P1 dom(W) ⊥ P1 Given (iii) G10 differs from H1 only in its edges (note that q points to e 0 but has no cached result) Subderivation By i.h. 00 00 00 If = then ⊆ By Lemma B.12 (Consistent graph extension) Having “stowed away” the consistency of e 0 , we can move on to D2 . (i) (ii) (iii) (1) (2) Z (3) Z (4) D2 :: G20 `p ω e ⇓ H2 ; t D2 satisfactory dom(R) ⊆ P1 and dom(W) ⊥ P1 dom(R2 ) ⊆ P1 and dom(W2 ) ⊥ P1 H1 from-scratch consistent bG20 cP1 `p ω e ⇓ bH2 cP2 ; t 0 bG2 cP1 ⊆ bH2 cP2 P2 = P1 ∪ dom(W) H2 from-scratch consistent Subderivation D2 is a subderivation of Di Given Using above equalities 00 By i.h. 00 00 00 bH1 cP1 = bH1 {q7→e 0 }cP1 = bdel-edges-out(H1 {q7→e 0 }, q)cP1 = bG10 cP1 Follows from exp(H1 , q) = e 0 Definition B.1 ignores edges By above equality We need to show bG10 cP1 = bG2 cP1 . That is, evaluating e 0 —which will be done inside the reference derivation’s version of D2 —doesn’t change anything in P1 . Fortunately, we know that dom(W) ⊥ P1 and dom(W1 ) ⊆ dom(W). Therefore dom(W1 ) ⊥ P1 . By Lemma B.5 (Respect for write-set), G2 agrees with G10 on dom(G10 ) − dom(W1 ). Since W1 is disjoint from P1 , we have that G2 agrees with G10 on P1 . Therefore bG10 cP1 = bG2 cP1 . Now we’ll show that bG2 cP1 = bG20 cP1 , that is, bG2 cP1 = bG2 {q7→(e 0 , t 0 )}cP1 . If q ∈ / P1 then this follows easily from Definition B.1. Otherwise, q ∈ P1 . We have exp(G10 , q) = e 0 and therefore exp(G2 , q) = e 0 , so updating G2 with q pointing to e 0 doesn’t change the restriction. Z Z • Case bH1 cP1 = bG20 cP1 (1) bH1 cP1 `p ω e ⇓ bH2 cP2 ; t (2) bH1 cP1 ⊆ bH2 cP2 Shown above By above equality 00 H1 (q) = (e, t) all-clean-out(H1 , q) Eval-forceClean H1 `p force (thk q) ⇓ H 1 , (p, obs t, clean, q); t ω H2 = (H1 , (p, obs t, clean, q)) Given H1 (q) = (e, t) H1 from-scratch consistent over P1 Dq satisfactory dom(Rq ) ⊆ Pq dom(Wq ) ⊥ Pq R = (Rq , q:(e, t)) W = Wq Premise Given (iii) Definition B.9 (i) 00 (ii) 00 (ii) By Definition B.2 for Eval-forceClean (D 0 = Dq ) 00 To show that Dq is consistent, we use assumption (iii) that H1 is from-scratch consistent. We have q:(e, t) in H1 . By p Definition B.10), Dq :: Gq `ωqq e ⇓ Gq0 ; t is from-scratch consistent for some Pq ⊆ dom(Gq ) up to H1 . Now we turn to Definition B.9. p bGq cPq `ωqq e ⇓ bGq0 cPq ∪ dom(Wq ) ; t By Definition B.9 (1) bGq cPq ⊆ bGq0 cPq ∪ dom(Wq ) By Definition B.9 (2) 0 bGq cPq ∪ dom(Wq ) ⊆ bH1 cP1 By Definition B.9 (4) p bH1 cP1 `ωqq e ⇓ bH1 cP1 ∪ dom(Wq ) ; t (1) Z (2) Z (3) Z (4) Z By Lemma B.8 (Weakening (non-incremental)) Let P2 be P1 ∪ dom(Wq ). bH1 cP1 `p By above equality ω e ⇓ bH1 cP2 ; t p bH1 cP1 `ω force (thk q) ⇓ bH1 cP2 ; t By rule Eval-forcePlain bH1 cP1 `p By Definition B.1 ω force (thk q) ⇓ bH1 , (p, obs t, clean, q)cP2 ; t bH1 cP1 `p q) ⇓ bH c force (thk ; t By above equality ω 2 P2 bH1 cP1 ⊆ bH1 cP2 By a property of Definition B.1 bH1 cP1 ⊆ bH2 cP2 By a property of Definition B.1 P2 = P1 ∪ dom(W) W = Wq H2 from-scratch consistent H2 differs from H1 only in its edges • Case all-clean-out((G1 , G2 ), q2 ) consistent-action((G1 , G2 ), a, q2 ) G1 , (q1 , a, clean, q2 ), G2 `p ω force (thk p0 ) ⇓ H2 ; t Eval-scrubEdge G1 , (q1 , a, dirty, q2 ), G2 `p ω force (thk p0 ) ⇓ H2 ; t (3) Z (4) Z (1) Z (2) Z e = force (thk p0 ) H1 = (G1 , (q1 , a, dirty, q2 ), G2 ) Let G 0 be G1 , (q1 , a, clean, q2 ), G2 . bG10 cP1 `p ω e ⇓ bH2 cP2 ; t bG10 cP1 ⊆ bH2 cP2 P2 = P1 ∪ dom(W) H2 from-scratch consistent bH1 cP1 = bG 0 cP1 bH1 cP1 `p ω e ⇓ bH2 cP2 ; t bH1 cP1 ⊆ bH2 cP2 Given Given By i.h. 00 00 00 Definition B.1 ignores edges By above equality By above equality
6cs.PL
arXiv:1803.06422v1 [cs.AI] 16 Mar 2018 A New Result on the Complexity of Heuristic Estimates for the A⋆ Algorithm∗ Othar Hansson and Andrew Mayer Marco Valtorta Computer Science Division Department of Computer Science University of California University of South Carolina Berkeley, CA 94720 Columbia, SC 29208 Abstract Relaxed models are abstract problem descriptions generated by ignoring constraints that are present in base-level problems. They play an important role in planning and search algorithms, as it has been shown that the length of an optimal solution to a relaxed model yields a monotone heuristic for an A⋆ search of a base-level problem. Optimal solutions to a relaxed model may be computed algorithmically or by search in a further relaxed model, leading to a search that explores a hierarchy of relaxed models. In this paper, we review the traditional definition of problem relaxation and show that searching in the abstraction hierarchy created by problem relaxation will not reduce the computational effort required to find optimal solutions to the baselevel problem, unless the relaxed problem found in the hierarchy can be transformed by some optimization (e.g., subproblem factoring). Specifically, we prove that any A⋆ search of the base-level using a heuristic h2 will largely dominate an A⋆ search ∗ This paper was published in Artificial Intelligence, 55, 1 (May 1992), 129-143. This research was made possible by support from Heuristicrats Research Inc. and the National Aeronautics and Space Administration. The first two authors may be reached at {othar, mayer}@heuristicrat.com. The third author may be reached at [email protected]. of the base-level using a heuristic h1 , if h1 must be computed by an A⋆ search of the relaxed model using h2 . 1 1 Introduction We extend a result by Valtorta [17] on the complexity of heuristic estimates for the A⋆ algorithm in a way that makes it applicable to some problems that have arisen in recent work in planning and search [6, 12]. We start by giving an informal description of the new result that contrasts it with the original one. Definitions and proofs will be given in the body of the paper. Both our paper and [17] present complexity results in the state-space model of problem-solving. Both use the number of node expansions performed by the algorithm as a measure of the cost of solving a (state-space) problem using a (heuristic or blind) search algorithm. (By a “blind” search algorithm we mean one that uses no cost estimates or uninformative cost estimates.) Both consider the cost of solving a problem as the total cost of computing the heuristic plus the cost of using A⋆ with that heuristic. In both cases, the heuristics are viewed as solutions of relaxed subproblems [13], also known as auxiliary problems [5]1 . Valtorta’s 1984 work was motivated by the attempt to spur research on automating the efficient computation of heuristics by showing that, with (certain classes of) inefficient heuristics, A⋆ was no better than brute-force search (Dijkstra’s algorithm). This paper is motivated by the need to determine how best to use (in a sense to be explained later) a set of available heuristics. Let P , P ′ , P ′′ be three problems such that P ′′ ⇐ P ′ ⇐ P , where the relation ⇐ is the auxiliarity relation. Informally, this notation indicates that P is the base problem, P ′ is a relaxed subproblem of P , and P ′′ is a relaxed subproblem of P ′ . A natural question is that of how to choose a relaxed subproblem (of which there are many) so that the cost of computing the heuristic (by solving the relaxed subproblem) plus the cost of solving the base problem (by A⋆ using the heuristic) 1 The relaxed subproblems of [13] and the auxiliary problems of [5] are special cases of the abstracted problems of [12, 14]. We do not claim that our results apply for the more general definition of [12, 14], except in the special cases where that definition coincides with the older ones. 2 is minimum. This is the question considered in [16] and [17], whose key result we summarize after the introduction of necessary notation. Let A  B denote the fact that algorithm A “largely dominates” algorithm B, i.e., in a certain technical sense (to be explained later), A is at least as efficient as B. Let A⋆ (P ← Alg(P ′ )) denote the A⋆ algorithm, applied to the problem P , informed by heuristics derived from the relaxed model P ′ , where instances of P ′ are solved by an algorithm. If instances of P ′ are solved by an A⋆ search, using P ′′ , we use the notation A⋆ (P ← A⋆ (P ′ ← Alg(P ′′ ))). The pattern of this notation allows us to abbreviate this as A⋆ (P ← P ′ ← P ′′ ), i.e., as a hierarchy of relaxed models, where the last relaxed model is solved algorithmically. (See Figure 1.) G P G I P I G P I G P G I P I Figure 1: Relaxation hierarchies used in Algorithms A⋆ (P ← P ′ ← P ′′ ) and A⋆ (P ← P ′′ ) Let P ∞ denote an element of the class of most-relaxed models, i.e., a statespace graph in which there is a path of zero cost between every pair of states. A⋆ (P ← P ∞ ) is said to be a blind or brute-force algorithm, as it uses a completely uninformative heuristic. Since Dijkstra’s algorithm is optimal in a large class of 3 blind search algorithms, as shown in [17], by A⋆ (P ← P ∞ ) we mean A⋆ with the tie-breaking rule (for node expansions) that makes it equivalent to Dijkstra’s algorithm. The original result [17] is: ∀P ′ ⇐ P A⋆ (P ← P ′ ← P ∞ )  A⋆ (P ← P ∞ ). (1) The new result (which summarizes both Theorems 1 and 2) is: ∀P ′′ ⇐ P ′ ⇐ P A⋆ (P ← P ′ ← P ′′ )  A⋆ (P ← P ′′ ), (2) and as a simple corollary, ∀P n ⇐ P n−1 ⇐ . . . ⇐ P ′ ⇐ P A⋆ (P ← P ′ ← . . . ← P n−1 ← P n )  A⋆ (P ← P n ). (3) In words, while Valtorta showed that there is no efficient way of solving a problem with A⋆ when the cost of computing the heuristic using a blind method is counted, we now show that the most efficient way of using a hierarchy of relaxed models, culminating in a heuristic that can be computed algorithmically, is to ignore the hierarchy and use that heuristic directly. Generating a relaxed model is useful only when an efficient algorithm accompanies it. The rest of the paper is organized as follows: In the second section we provide background material on state-space search, the A⋆ algorithm, and relaxed models. The aim of the third section is to motivate the need for our new result, by describing an instance from the recent literature to which it can be usefully applied. In the fourth section, we prove our main result (corresponding to (2) above). The fifth section, which concludes the paper, is devoted to an interpretation of the main result, including some remarks on the measure of cost (“largely dominates”) used to evaluate the comparative efficiency of state-space search algorithms. 4 2 2.1 Background State-Space Search The state-space approach to problem-solving considers a problem as a quadruple, (S, O ⊂ S × S, I ∈ S, G ⊂ S). S is the set of possible states of the problem. O is the set of operators, or transitions from state to state. I is the one initial state of a problem instance, and G is the set of goal states. Search problems can be represented as a state-space graph, where the states are nodes, and the operators are directed, weighted arcs between nodes (the weight associated with each operator, Oi , is the cost of applying it, C(Oi )). The problem consists of determining a sequence of operators, O1 , O2 , ..., On that, when applied to I, yields a state in G. Such a sequence is called a solution path (or solution), with length n and cost Pn i=1 C(Oi ). A solution with minimum cost is called optimal. 2.2 A⋆ Algorithm Solutions to a given problem may be found by brute force search over the statespace. However, as the sizes of the state-spaces of most problems are prohibitively large, the only hope of finding an optimal solution in reasonable time is to use an intelligent method of guiding a search through the state-space. Typically, such methods take the form of branch-and-bound, wherein partial solutions (equivalently, classes of solutions) are enumerated (“branch”), and perhaps eliminated from future consideration by an estimate of solution cost (“bound”). One such method, the celebrated A⋆ algorithm (originally in [7]; also [13]) orders the search by associating with each node n two values: g(n), the length of the shortest-path from the initial state to n, and h(n), an estimate of the length of the shortest-path from n to any goal state (the actual length is h∗ (n)). In brief, A⋆ is an ordered best-first search algorithm, that always examines the successors of the “most promising” node in the search tree, based on the evaluation function, f (n) = g(n) + h(n). Thus the number of nodes expanded is a function of the heuristic function used. 5 The following definitions will simplify the discussion: A heuristic function, h(n), is said to be admissible if ∀n[h(n) ≤ h∗ (n)]. A heuristic function, h(n), is said to be monotone if ∀n, n′ [f (n) ≤ f (n′ ) (where n′ is a successor of n)] (recall that f (n) is determined by h(n)). Monotonicity implies admissibility [13]. A⋆ terminates when it expands (examines) a goal state for the first time. If it uses an admissible heuristic, A⋆ will have found the optimal path to this goal state, i.e., f (n) = g(n)+h(n) = h∗ (I). As it orders the nodes by f (n) = g(n)+h(n), A⋆ with a monotone heuristic surely expands all nodes n that satisfy g(n) + h(n) < h∗ (I), and possibly expands some of the nodes that satisfy g(n) + h(n) = h∗ (I), but expands none of the nodes that satisfy g(n)+ h(n) > h∗ (I). The surely expanded nodes form a connected component in the state-space graph (containing the initial state), and those nodes, together with the possibly expanded nodes, form a larger connected component (containing both the initial and goal states). 2.3 Relaxed Models As the accuracy of the heuristic function determines the time complexity (measured in node expansions) of A⋆ , many researchers have attempted to automate the learning of heuristic functions. One proposed method of developing good heuristics is to “consult simplified models of the problem domain” [4, 5, 11, 13]. These simplified models are generated via constraint-deletion, i.e., ignoring selected constraints on the applicability of operators. Recently, there has been renewed interest in this and other uses of abstraction in problem-solving [9, 10, 12, 15], including a generalization of the notion of simplification [14] that will be described below. Pearl [13] discusses the use of constraint-deletion to generate three known heuristics for the familiar Eight Puzzle problem. He formalizes the problem in terms of domain predicates, and then describes the single operator in the state-space – moving a tile x from position y to position z – as follows: 6 M ove(x, y, z) preconditions : On(x, y) ∧ Clear(z) ∧ Adj(y, z) add list : On(x, z) ∧ Clear(y) delete list : On(x, y) ∧ Clear(z) Removing preconditions or constraints for this operator creates a relaxed model of the problem. Deleting different sets of constraints yields different relaxed models. Specifically, when constraints are removed from a problem, new edges and nodes are introduced into the state-space graph, yielding a “relaxed” state-space graph (a supergraph [4]). If the states and operators of the original problem, P , are denoted by the set S and the relation O ⊂ S × S, then the relaxed problem, P ′ , consists of S ′ ⊇ S and O ′ ⊇ O as well as I, and G. Note that relaxed models may permit certain “speedup transformations,” such as factoring into independent subproblems [12]: our main result underscores the importance of discovering such optimizations, as discussed in Section 5. An optimal (i.e., shortest) path between any two given states in P ′ cannot be longer than the shortest-path between the same two states in P , since all paths in P are also paths in P ′ . Thus the length of such a relaxed solution is a lower bound on the length of an optimal solution to the original problem, and this information can be used as an admissible heuristic to speed up a branch-and-bound search algorithm (e.g., A⋆ ). Note that, while our results apply to “traditional” [4, 5, 11, 13, 16, 17] relaxed problems obtained by constraint-deletion, other transformations, more general than constraint-deletion, may be used to produce admissible heuristics. Prieditis [14] gives conditions for transformations that guarantee the generation of problems whose solution can be used to compute an admissible heuristic. He calls these transformations abstracting and the resulting problems abstracted problems. Our results do not necessarily apply to abstracted problems. Of course, the length of a solution to a further relaxed model P ′′ provides a lower bound on the length of a solution to P ′ . Thus, if no efficient algorithm2 is known 2 To be precise, we describe as efficient algorithms any techniques that perform no search in a 7 for solving P ′ , we may use P ′′ to provide an admissible heuristic for an A⋆ search of P ′ . We may conceive of a search algorithm (Figure 2) that performs search at many levels of a relaxed model hierarchy, each level providing heuristic estimates for the level above. findpath(State I, State G, Problem P) { if Efficient_algorithm_for(P) then return(Efficient_algorithm_for(P, I, G)) else return(Astar(I, G, P)) } Astar(State I, State G, Problem P) { /* a standard A* algorithm, using, for each state s */ /* h(s) = heur(s,G,P) */ } heur(State s, State G, Problem P) { Problem P’ = relax(P); return(length(findpath(s,G,P’))); } Figure 2: Search in Relaxed Model Hierarchy relaxed model. 8 3 A Motivating Example The following example of the application of our result concerns a heuristic for the Eight Puzzle. Please refer to the previous section for a formalization of the puzzle in terms of domain predicates and operators. The example is adapted from [6]. In the Eight Puzzle, the tile positions form a bipartite graph of positions – each move shifts the blank from one side of the bipartite graph to the other. If one colors the puzzle like a checkerboard and connects adjacent squares by edges, the red squares will form one side of the bipartite graph and the black squares the other. In the Eight Puzzle problem, the blank is constrained to move to only a small subset of the other side of the graph (i.e., the adjacent positions). One may relax this constraint by allowing the blank to move to any of the positions in the other side of the bipartite graph. This Checkerboard Relaxed Adjacency (Check-RA) relaxed model may be thought of as being somewhere between the original problem and the Relaxed Adjacency (RA) model [4], because one has deleted only a part of the adjacency requirement (the RA model results from deleting the adjacency requirement in moving tiles into the blank position). In the Check-RA model, one can think of any given tile position as being “adjacent” to half of the other positions. To formalize this, we define two new STRIPS-like predicates (where ⊕ denotes exclusive-or): RED(y) : y is a red position DIF F COLOR(x, y) : RED(x) ⊕ RED(y) and change the preconditions for MOVE: M ove(x, y, z) preconditions : On(x, y) ∧ Clear(z) ∧ DIF F COLOR(y, z) add list : On(x, z) ∧ Clear(y) delete list : On(x, y) ∧ Clear(z) In short, if a black position is blank (i.e., clear), only tiles in red positions may move into it, and vice versa. There is no known algorithm to solve this relaxed 9 model, except for one that searches the corresponding state space. However, other relaxed problems for the Eight Puzzle are more relaxed than Check-RA, e.g., Relaxed Adjacency (RA), for which an efficient solution algorithm is known [4, 6]. We can therefore solve the Check-RA problem by using A⋆ with a heuristic computed by solving the RA problem. A natural question to ask is whether it is more efficient to use the heuristic from RA indirectly (to solve Check-RA as just described) rather than to use it directly to solve the Eight Puzzle. Clearly, the Check-RA heuristic is never smaller than the RA heuristic and can therefore prevent A⋆ from expanding some nodes that it would expand using the RA heuristic. On the other hand, a secondary search procedure (using A⋆ ) must be carried out to compute the Check-RA heuristic. Is it possible to predict which one of the two uses of the RA heuristic is the most efficient? We will answer this question in the affirmative. 4 The Limitations of Abstraction We prove a result that allows us to collapse arbitrary relaxed model hierarchies to two levels. Consider that some constraints of a base-level problem P have been deleted to yield a relaxed model P ′ , whose solutions provide a heuristic estimate h1 for the base-level problem. Unfortunately, there may be no efficient algorithmic solution to this relaxed model P ′ , and to compute h1 one may have to perform a search in P ′ using h2 . We will denote this algorithm by A⋆ (P ← P ′ ← P ′′ ). Consider also the algorithm A⋆ (P ← P ′′ ), that uses h2 directly as a heuristic for searching P . The two algorithms are depicted in Figure 1. Note that A⋆ (P ← P ′ ← P ′′ ) performs two distinct heuristic searches, one in P , and one in P ′ . A⋆ (P ← P ′′ ) performs only the search in P . We will prove that A⋆ (P ← P ′′ ) largely dominates A⋆ (P ← P ′ ← P ′′ ), i.e., all nodes surely expanded by A⋆ (P ← P ′′ ) are also surely expanded by A⋆ (P ← P ′ ← P ′′ ), and all nodes possibly expanded by A⋆ (P ← P ′′ ) are also possibly expanded by A⋆ (P ← P ′ ← P ′′ ). 10 Theorem 1 If a node n is surely expanded by algorithm A⋆ (P ← P ′′ ), then node n is surely expanded by algorithm A⋆ (P ← P ′ ← P ′′ ). Assume not. Consider a node n surely expanded by A⋆ (P ← P ′′ ), but not surely expanded by algorithm A⋆ (P ← P ′ ← P ′′ ). Consider an ancestor p of n that is the first node on a cheapest path from I to n that is not surely expanded by A⋆ (P ← P ′ ← P ′′ ): g(n) = g(p) + g(p, n) (4) g(p) + h1 (p) ≥ h∗ (i) (5) g(p, n) denotes the cost of the cheapest path from p to n. By assumption, computation of h1 (p) does not surely expand n: ′ gP (p, n) + h2 (n) ≥ h1 (p) (6) ′ gP (p, n) denotes the cost of the cheapest path from p to n in the relaxed model P ′ . Clearly, ′ g(p, n) ≥ g P (p, n) (7) Substituting inequality 6 into inequality 5: ′ g(p) + g P (p, n) + h2 (n) ≥ h∗ (i) and noting from equations 4 and 7 that: 11 (8) ′ g(n) ≥ g(p) + g P (p, n) (9) g(n) + h2 (n) ≥ h∗ (i) (10) we derive: But by assumption, n is surely expanded by A⋆ (P ← P ′′ ): g(n) + h2 (n) < h∗ (i) which contradicts inequality 10. (11) ✷ Theorem 2 If a node n is possibly expanded by algorithm A⋆ (P ← P ′′ ), then node n is possibly expanded by algorithm A⋆ (P ← P ′ ← P ′′ ). Assume not. Consider a node n possibly expanded by A⋆ (P ← P ′′ ), but not possibly expanded by algorithm A⋆ (P ← P ′ ← P ′′ ). Consider an ancestor p of n that is the first node on a cheapest path from I to n that is not possibly expanded by A⋆ (P ← P ′ ← P ′′ ): g(n) = g(p) + g(p, n) ′ (12) g(p, n) ≥ g P (p, n) (13) g(p) + h1 (p) > h∗ (i) (14) By assumption, computation of h1 (p) does not possibly expand n: 12 ′ gP (p, n) + h2 (n) > h1 (p) (15) Substituting inequality 15 into inequality 14: ′ g(p) + g P (p, n) + h2 (n) > h∗ (i) (16) and noting from equations 12 and 13 that: ′ g(n) ≥ g(p) + g P (p, n) (17) g(n) + h2 (n) > h∗ (i) (18) we derive: But by assumption, n is possibly expanded by A⋆ (P ← P ′′ ): g(n) + h2 (n) ≤ h∗ (i) which contradicts inequality 18. 5 (19) ✷ Interpretation of Results As anticipated at the beginning of the previous section, Theorems 1 and 2 imply that A⋆ (P ← P ′′ ) largely dominates A⋆ (P ← P ′ ← P ′′ ). This is precisely the sense in which A⋆ is said to be optimal [13, p. 85]: given a monotone heuristic h, 13 A⋆ largely dominates every admissible algorithm that uses h. The relation misses some important distinctions. For example, greedy algorithms, that may operate in polynomial time, can be viewed as heuristic searches with optimal tie-breaking rules to choose among the possibly expanded nodes. Large domination does not imply that all nodes expanded by A⋆ (P ← P ′′ ) will necessarily be expanded by A⋆ (P ← P ′ ← P ′′ ). In fact there are some tie-breaking rules (for ordering expansion of nodes with equal f values) for which A⋆ (P ← P ′ ← P ′′ ) will expand fewer nodes than A⋆ (P ← P ′′ ). Traditionally, however, large domination is equated with superior efficiency, as the number of nodes n for which g(n)+h(n) = h∗ (i) is assumed to be small: for example, if either g(n) or h(n) are continuous valued functions [13, p. 85] or h is non-pathological (as defined in [2, p. 522]), such ties are rare or non-existent. The theorems extend results of Valtorta [17], who proved that brute-force, uniform-cost search (Dijkstra’s algorithm) is never less efficient than a heuristic search that relies on uniform-cost search of relaxed models for the computation of heuristics. This follows from our results by considering the special case in which h2 is uniformly zero, yielding uniform-cost search. However, Valtorta’s original result is for a sharper notion of “more efficient than”: the number of node expansions, rather than large domination. The reason for this discrepancy lies in the fact that Dijkstra’s algorithm expands all and only the nodes for which g ∗ (n) < h∗ (i), while A⋆ with monotone heuristics may expand some nodes for which g∗ (n)+h(n) = h∗ (i): for Dijkstra’s algorithm, the set of possibly expanded nodes coincides with the set of surely expanded nodes. Analogously, while Dijkstra’s algorithm is optimal with respect to the measure “number of node expansions” within the class of blind forward unidirectional algorithms [17], A⋆ is optimal in that it largely dominates all informed algorithms that use consistent heuristics. “Large domination” is a weaker form of optimality than “fewer node expansions,” as is explained by Dechter and Pearl in [1], and especially in [3]. 14 We observe that A⋆ with monotone heuristics, just like Dijkstra’s algorithm, never expands the same node twice. Since all heuristics computed by solving a relaxed problem are monotone [13, 17], we can use “the number of expanded nodes” and “the number of node expansions” interchangeably. Therefore our results hold for the cost measure “number of node expansions,” as well as for the cost measure “number of expanded nodes.” While Valtorta [17] showed that there is no advantage to using A⋆ in certain situations, we show that, in certain situations, there is no advantage to using a relaxed-model hierarchy within an A⋆ algorithm. Theorems 1 and 2 indicate that in reducing the cost of finding optimal solutions, a heuristic is effective only when it is computable by an efficient algorithm – the cost of computing a heuristic function by a secondary search exceeds the savings offered by the heuristic. This possibility was recognized in the design of ABSOLVER [12], where “speedup transformations” are used, as well as in other recent work [8]. Our result shows (in a precise and general way) that speedup transformations are not only useful, but necessary. Some readers may object to our use of the word “search” in the preceding paragraph, since, after all, a search in a much reduced state space is sufficient to turn an inefficient procedure into a practical, efficient one. In the spirit of [5, 17] we use the word search to signify that a relaxed problem is solved by search in its state space (called underlying graph in [5] and skeleton in [17]) and view the construction of a reduced state space as an instance of a “speedup transformation.” A way of reducing the state space for a (relaxed) problem is to factor (or decompose) it into independent subproblems. Decomposability is possible when the goal state of a state-space search problem can be achieved by solving its subgoals independently. As discussed in [12, 13], the state-space for each independent subproblem can be so much smaller than the original state-space that computation of the heuristic by searching the factored problem is computationally advantageous over blind search. We illustrate these considerations with an example adapted from [12]. 15 Mostow and Prieditis describe a heuristic (called X-Y) that is never smaller than the well-known Manhattan Distance (MD) heuristic. It corresponds to a relaxed problem in which “a horizontal move is allowed only into a column containing the blank, and a vertical move is allowed only into the row containing the blank. XY is therefore more accurate than Manhattan Distance, which ignores the blank completely.” This relaxed problem can be obtained from a representation of the tiles in the Cartesian plane3 , by dropping all information about the position of the blank in the Y coordinate (YLOCB) from moves in the X coordinate (XMove) and all information about the position of the blank in the X coordinate (XLOCB) from moves in the Y coordinate (YMove). The X-Y relaxed problem can be decomposed into two subproblems (or factors), corresponding to each coordinate. The goal of the first subproblem is to place each tile in its correct column, while the goal of the second subproblem is to place each tile in its correct row. Since we dropped from the list of preconditions of the move operator in a coordinate all information about the position of the blank in the other coordinate, we obtain two independent subproblems, as described in Figure 3. No algorithm is known to solve either of the independent subproblems without searching the corresponding state-space. However, since MD is a relaxed problem of X-Y for which a very efficient solution algorithm is known, it is possible to solve X-Y by using A⋆ with a heuristic computed by solving MD. Now consider the cost of computing X-Y as just outlined. This computation involves search. However, the search is in the reduced state-spaces of two independent subproblems of the X-Y relaxed problem, and therefore the results described in this paper are not applicable. In other words, the theorems we have proved in this paper are not strong enough to predict when a heuristic derived from relaxation and factoring is 3 We use the traditional goal state with the blank in the middle and tiles arranged clockwise around the border, starting with tile 1 in the top left corner. Mandrioli et al. [11] used the Cartesian representation for the Eight Puzzle in the first published examples of relaxed problems, but they did not provide the X-Y heuristic as an example. 16 Problem: P Operators: XMove, YMove Goal: {XLOC(1,1), YLOC(1,1), XLOC(2,2), YLOC(2,1), ..., XLOC(8,1), YLOC(8,2)} Problem: PX Operator: XMove, ignore YLOCB Goal: {XLOC(1,1), ..., XLOC(8,1)} Problem: PY Operator: YMove, ignore XLOCB Goal: {YLOC(1,1), ...,YLOC(8,2)} Figure 3: Two independent subproblems to compute the X-Y heuristic cost effective, and it is not possible to conclude whether the computation of the X-Y heuristic is cost effective simply on the basis of our results. In fact, it has been determined empirically that computation of the X-Y heuristic as described is not cost effective. Mostow and Prieditis report that “unfortunately, even with such guidance [i.e., the heuristic computed by solving MD] the overall search time turns out to be about six times slower than using Manhattan distance alone.” In other words, direct use of MD is more efficient than indirect use of MD to compute X-Y. This shows that heuristics computed by searching factors of relaxed problems need not be cost effective. On the other hand, the Box Distance heuristic of the Rooms World problem, when computed by search of factors of a relaxed problem, is cost effective [14]. This shows that heuristics computed by searching factors of relaxed problems can be cost effective. Additional work is needed to find conditions under which heuristics computed by searching factors of relaxed problems are cost effective, and conditions under which they are not. 17 In conclusion, we have shown that relaxed model hierarchies (chains of successively more abstract problems) collapse to only two levels – the base-level, and the least-relaxed model for which algorithmic solutions are known. Exploiting the power of abstraction will require either the development of techniques for synthesizing efficient algorithms from relaxed-model problem-descriptions, or the development of new problem relaxation transformations that are not subject to the fundamental limitations of the theorems presented here [8, 12, 14]. The most promising example of these approaches is the ABSOLVER system [12, 14], which exploits subproblem factoring transformations to reduce the cost of search in relaxation hierarchies. 6 Acknowledgements We would like to thank two anonymous referees for their insightful and detailed comments on earlier drafts of this paper and Armand Prieditis for several interesting conversations. Marco Valtorta thanks Marco Somalvico and Giovanni Guida for introducing him to research on auxiliary problems and Jack Mostow for a conversation in which he shared some (at the time) unpublished details of the ABSOLVER system. References [1] R. Dechter and J. Pearl. The Optimality of A⋆ Revisited. In Proceedings of the Third National Conference on Artificial Intelligence, Washington, 1983, 95–99. [2] R. Dechter and J. Pearl. Generalized Best-First Search Strategies and the Optimality of A⋆ . Journal of the Association for Computing Machinery, 32, 3 (July 1985), 506–536. [3] R. Dechter and J. Pearl. The Optimality of A⋆ . In Search in Artificial Intelligence, eds. L. Kanal and V. Kumar, Springer-Verlag, New York, 1988, 166–199. 18 [4] J. Gaschnig. A Problem Similarity Approach to Devising Heuristics: First Results. In Proceedings of the Sixth International Joint Conference on Artificial Intelligence, Tokyo, 1979, 301–307. [5] G. Guida and M. Somalvico. A Method for Computing Heuristics in Problem Solving. Information Sciences, 19:251–259, 1979. [6] O. Hansson, A. Mayer, and M. Yung. Relaxed Models Yield Powerful Admissible Heuristics. Information Sciences, to appear. [7] P. Hart, N. Nilsson, and B. Raphael. A Formal Basis for the Heuristic Determination of Minimum Cost Paths. IEEE Transactions on Systems Science and Cybernetics, 2:100–107, 1968. [8] D. Kibler. Generation of Heuristics by Transforming the Problem Representation. Technical Report TR-85-20, Information and Computer Science Department, University of California at Irvine, July 1985. [9] C. A. Knoblock. Automatically Generating Abstractions for Planning. In Proceedings of the International Workshop on Change of Representation and Inductive Bias, Philips Laboratories, Briarcliff Manor, New York, 1988. [10] R. E. Korf. Planning as Search: a Quantitative Approach. Artificial Intelligence, 33:65–88, 1987. [11] D. Mandrioli, A. Sangiovanni-Vincentelli, and M. Somalvico. Toward a Theory of Problem Solving. In Topics in Artificial Intelligence, ed. A. Marzollo, Springer-Verlag, Vienna, 1976, 48–167. [12] J. Mostow and A. E. Prieditis. Discovering Admissible Heuristics by Abstracting and Optimizing: a Transformational Approach. In Proceedings of the Eleventh International Joint Conference on Artificial Intelligence, Detroit, 1989, 701–707. 19 [13] J. Pearl. Heuristics: Intelligent Search Strategies for Computer Problem Solving. Addison-Wesley, Reading, MA, 1984. [14] A. Prieditis. Machine Discovery of Effective Admissible Heuristics. In Proceedings of the Twelfth International Joint Conference on Artificial Intelligence, Sidney, 1991, 720–725. [15] J. Tenenberg. Abstraction in Planning. Ph.D. Thesis, University of Rochester, 1988. [16] M. Valtorta. Un Contributo alla Teoria della Risoluzione dei Problemi: Rappresentazione Semantica, Proprietà Algebriche ed Algoritmi di Ricerca (in Italian). Tesi di Laurea, Istituto di Ingegneria Elettrotecnica ed Elettronica, Politecnico di Milano, Milan, 1980. [17] M. Valtorta. A Result on the Computational Complexity of Heuristic Estimates for the A⋆ Algorithm. Information Sciences, 34:48–59, 1984. 20
2cs.AI
Linear-Time Algorithms for Maximum-Weight Induced Matchings and Minimum Chain Covers in Convex Bipartite Graphs Boris Klemz∗ Günter Rote∗ November 13, 2017 arXiv:1711.04496v1 [cs.DS] 13 Nov 2017 Abstract A bipartite graph G = (U, V, E) is convex if the vertices in V can be linearly ordered such that for each vertex u ∈ U , the neighbors of u are consecutive in the ordering of V . An induced matching H of G is a matching such that no edge of E connects endpoints of two different edges of H. We show that in a convex bipartite graph with n vertices and m weighted edges, an induced matching of maximum total weight can be computed in O(n + m) time. An unweighted convex bipartite graph has a representation of size O(n) that records for each vertex u ∈ U the first and last neighbor in the ordering of V . Given such a compact representation, we compute an induced matching of maximum cardinality in O(n) time. In convex bipartite graphs, maximum-cardinality induced matchings are dual to minimum chain covers. A chain cover is a covering of the edge set by chain subgraphs, that is, subgraphs that do not contain induced matchings of more than one edge. Given a compact representation, we compute a representation of a minimum chain cover in O(n) time. If no compact representation is given, the cover can be computed in O(n + m) time. All of our algorithms achieve optimal running time for the respective problem and model. Previous algorithms considered only the unweighted case, and the best algorithm for computing a maximum-cardinality induced matching or a minimum chain cover in a convex bipartite graph had a running time of O(n2 ). 1 Introduction Problem Statement. A bipartite graph G = (U, V, E) is convex if V can be numbered as {1, 2, . . . , nV } so that the neighbors of every vertex i ∈ U form an interval {Li , Li + 1, . . . , Ri }, see Figure 1(a). For such graphs, we consider the problem of computing an induced matching (a) of maximum cardinality or (b) of maximum total weight, for graphs with edge weights. An induced matching H ⊆ E is a matching that results as a subgraph induced by some subset of vertices. This amounts to requiring that no edge of E connects endpoints of two different edges of H, see Figure 1(a). In terms of the line graph, an induced matching is an independent set in the square of the line graph. The square of a graph connects every pair of nodes whose distance is one or two. Accordingly, we call two edges of E independent if they can appear together in an induced matching, or in other words, if their endpoints induce a 2K2 (a disjoint union of two edges) in G. Otherwise, they are called dependent. In convex bipartite graphs, maximum-cardinality induced matchings are dual to minimum chain covers. A chain graph Z is a bipartite graph that contains no induced matching of more than one edge, i. e., it contains no pair of independent edges. (Chain graphs are also called difference graphs [12] or non-separable bipartite graphs [7].) A chain cover of a graph G with edge set E is a set of chain subgraphs Z1 , Z2 , . . . , ZW of G such that the union of the edge sets of Z1 , Z2 , . . . , ZW is E, see Figure 1(b). A chain cover with W chain subgraphs provides an ∗ Institut für Informatik, Freie Universität Berlin, Germany 2 j i B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs = 1 = 2 1 3 4 2 5 6 3 (a) 7 8 4 9 10 11 5 V U j i = 1 = 2 1 3 4 2 5 6 3 (b) 7 8 4 9 10 11 5 V U i 1 2 3 4 5 Li Ri 1 4 3 4 2 11 6 8 7 10 (c) Fig. 1: (a) A convex bipartite graph G = (U, V, E) containing an induced matching H of size 3. Since we use successive natural numbers as elements of U and V , we will explicitly indicate whether we regard a number x as a vertex of U or of V . There is no induced matching with more than 3 edges: vertex 3 ∈ U is adjacent to all vertices of V except 1 ∈ V . Thus, if we match 3 ∈ U , this can only lead to induced matchings of size at most 2. Furthermore, we cannot simultaneously match 1 ∈ U and 2 ∈ U since every neighbor of 2 ∈ U is also adjacent to 1 ∈ U . (b) A minimum chain cover of G with 3 chain subgraphs Z1 , Z2 , Z3 (in different colors and dash styles), providing an independent proof that H is optimal. Here, Z1 , Z2 , Z3 have disjoint edge sets, which is not necessarily the case in general. (c) The compact representation of G. obvious certificate that the graph cannot contain an induced matching with more than W edges. We will elaborate on this aspect of a chain cover as a certificate of optimality in Section 5. A minimum chain cover of G is a chain cover with a smallest possible number of chain subgraphs. In a convex bipartite graph G, the maximum size of an induced matching is equal to the minimum number of chain subgraphs of a chain cover [24]. We denote the number of vertices by nU = |U |, nV = |V |, n = nU + nV , and the number of edges by m = |E|. If a convex graph is given as an ordinary bipartite graph without the proper numbering of V , it can be transformed into this form in linear time O(n + m) [2]. (In terms of the bipartite adjacency matrix, convexity is the well-known consecutive-ones property.) Unweighted convex bipartite graphs have a natural implicit representation [21] of size O(n), which is often called a compact representation [13, 20]: every interval {Li , Li + 1, . . . , Ri } is given by its endpoints Li and Ri , see Figure 1(c). Since the numbering of V can be computed in O(n + m) time, it is easy to obtain a compact representation in total time O(n + m) [20, 22]. The chain covers that we construct will consist of convex bipartite subgraphs with the same ordering of V as the original graph. Thus, we will be able to use the same representation for the chain graphs of a chain cover. Related Work and Motivation. The problem of finding an induced matching of maximum size was first considered by Stockmeyer and Vazirani [23] as the “risk-free marriage problem” with applications in interference-free network communication. The decision version of the problem is known to be NP-complete in many restricted graph classes [4, 16, 15], in particular bipartite graphs [4, 16] that are C4 -free [16] or have maximum degree 3 [16]. On the other hand, it can be solved in polynomial time in chordal graphs [4], weakly chordal graphs [5], trapezoid graphs, k-interval-dimension graphs and co-comparability graphs [11], amongst others. For a more exhaustive survey we refer to [8]. The class of convex bipartite graphs was introduced by Fred Glover [10], who motivates the computation of matchings in these graphs with industrial manufacturing applications. Items that can be matched when some quantity fits up to a certain tolerance naturally lead to convex bipartite graphs. The computation of matchings in convex bipartite graphs also corresponds to a scheduling problem of tasks of discrete length on a single disjunctive resource [14]. The problem of finding a (classic, not induced) matching of maximum cardinality in convex bipartite graphs has been studied extensively [10, 22, 9] culminating in an O(n) algorithm when a compact representation of the graph is given [22]. Several other combinatorial problems have been studied B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs 3 in convex bipartite graphs. While some problems have been shown to be NP-complete even if restricted to this graph class [1], many problems that are NP-hard in general can be solved efficiently in convex bipartite graphs. For example, a maximum independent set can be found in O(n) time (assuming a compact representation) [20] and the existence of Hamiltonian cycles can be decided in O(n2 ) time [18]. For a comprehensive summary we refer to [13]. One of the applications given by Stockmeyer and Vazirani [23] for the induced matching problem can be stated as follows. We want to test (or use) a maximum number of connections between receiver-sender pairs in a network. However, testing a particular connection produces noise so that no other node in reach may be tested simultaneously. We remark that this type of motivation extends very naturally to convex bipartite graphs when we consider wireless networks in which nodes broadcast or receive messages in specific frequency ranges. Further, weighted edges can model the importance of connections. Previous Work. Yu, Chen and Ma [24] describe an algorithm that finds both a maximumcardinality induced matching and a minimum chain cover in a convex bipartite graph in runtime O(m2 ). Their procedure is improved by Brandstädt, Eschen and Sritharan [3], resulting in a runtime of O(n2 ). Chang [6] computes maximum-cardinality induced matchings and minimum chain covers in O(n + m) time in bipartite permutation graphs, which form a proper subclass of convex bipartite graphs. Recently, Pandey, Panda, Dane and Kashyap [19] gave polynomial algorithms for finding a maximum-cardinality induced matching in circular-convex and triad-convex bipartite graphs. These graph classes generalize convex bipartite graphs. Our Contribution. We improve the previous best O(n2 ) algorithm [3] for maximum-cardinality induced matching and minimum chain covers in convex bipartite graphs in several ways. In Section 2 we give an algorithm for finding maximum-weight induced matchings in convex bipartite graphs with O(n + m) runtime. The weighted problem has not been considered before. In Section 3 we specialize our algorithm to find induced matchings of maximum cardinality in O(n) runtime, given a compact representation of the graph. In Section 4 we extend this approach to obtain in O(n) time a compact representation of a minimum chain cover. If no compact representation is given, our approach is easily adapted to produce a minimum chain cover in O(n + m) time. All of our algorithms achieve optimal running time for the respective problem and model. Our results for finding a maximum-cardinality induced matching also improve the running times of the algorithms of Pandey et al. [19] for the circular-convex and triad-convex case, as they use the convex case as a building block. 2 Maximum-Weight Induced Matchings In this section, we compute a maximum-weight induced matching of a given edge-weighted convex bipartite graph G = (U, V, E) in time O(n + m). We generally write indices i ∈ U as superscripts and indices j ∈ V as subscripts. We consider E as a subset of U ×V . We assume that V = {1, . . . , nU } is numbered as described in Section 1 and the interval {Li , Li +1, . . . , Ri } ⊆ V of each vertex i ∈ U is given by the pair (Li ,Ri ) of the left and right endpoint. Each edge (i, j) ∈ E has a weight Cji . Our dynamic-programming approach considers the following subproblems: For an edge (i, j) ∈ E, we define Wji as the cost of the maximum-weight induced matching that uses the edge (i, j) and contains only edges in U × {1, . . . , j}. The following dynamic-programming recursion computes Wji : 0 0 Wji = Cji + max{ Wji0 | Ri < j, j 0 < Li } ∪ {0} (1) The range over which the maximum is taken is illustrated in Figure 2. In this recursion, we build 4 B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs j Wji i Li Fig. 2: The table entries that go into the computation of Wji are shaded: They lie in rows that end to the left of Wji (marked by an arrow), and only the entries to the left of Li are considered. the induced matching H of weight Wji by adding the edge (i, j) to some induced matching H 0 0 of weight Wji0 . We want H to be an induced matching: By construction, the edge (i0 , j 0 ) is independent of (i, j), but we have to show that the other edges of H 0 are also independent of (i, j). In order to prove this (Lemma 2), we use a transitivity relation between independent edge pairs. / [Li , Ri ] and Observation 1. Two edges (i, j) and (i0 , j 0 ) are independent if and only if j 0 ∈ 0 0 i i j∈ / [L , R ]. Lemma 1. Let (i00 , j 00 ), (i0 , j 0 ), (i, j) ∈ E with j 00 < j 0 < j. Assume that (i00 , j 00 ) and (i0 , j 0 ) are independent, and (i0 , j 0 ) and (i, j) are independent. Then (i00 , j 00 ) and (i, j) are independent. 00 0 0 Proof. By Observation 1, we have j 00 ≤ Ri < j 0 ≤ Ri < j and j 00 < Li ≤ j 0 < Li ≤ j. Thus, 00 00 j∈ / [Li , Ri ] and j 00 ∈ / [Li , Ri ]. Lemma 2. The recursion (1) is correct. 0 Proof. By Observation 1, any edge (i0 , j 0 ) with j 0 < j that is independent of (i, j) satisfies Ri < j 0 and j 0 < Li . By Lemma 1, all other edges (i00 , j 00 ) used to obtain the matching value Wji0 are also independent of (i, j). We create a table in which we record the entries Wji . We assume that the intervals are sorted in nondecreasing order by Li , that is, Li ≤ Lh for i < h. The values WLi i , . . . , WRi i form the i-th row of the table. We fill the table row by row proceeding from i = 1 to i = nU . Each row i is processed from left to right. The only challenge in evaluating (1) is the maximum-expression, for which we introduce the notation Mji . 0 0 Mji = max{ Wji0 | Ri < j, j 0 < Li } ∪ {0} We discuss the computation of the leftmost entry WLi i later. When we proceed from Wji i i . Direct comparison of the respective to Wj+1 we want to go incrementally from Mji to Mj+1 defining sets leads to 0 0 i Mj+1 = max {Mji } ∪ { Wji0 | Ri = j, j 0 < Li } (2) B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs 5 j: . . . 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 . . .  37 40 25 23 36 35 45 42 37 36 48 47 59 61 62  i = 13  26 32 28 30 36 46 49 58 54 44 64 Ri = 26 i = 25   – – – – – – i = 38 37 40 40 40 40 40 45 45 45 46 49 58 59 61 64 P26 38 27 28 35 49 46 41 42 45 52 44 27 38 45 54 50 38 44 – – – – – – – P27 38 38 44 44 49 49 54 54 54 54 54 54 67 67 .. . i = 30 43 43 – – 44 49 – – 52 67 – –  67    59  i R = 27 –     – i = 19 i = 26 i = 34 i = 40 .. . 69 72 75 81 80 86 82 87 73 89 – L30 = 18 j – – – – j+1 Fig. 3: Example. We are in the process of filling row 30 from left to right. All rows with smaller index i have been processed and are filled with the entries Wji . Unprocessed entries are marked as “–”. The figure does not show the rows in the order in which they are processed, but intervals with the same right endpoint Ri = r are grouped together. The bold entries collect the provisional maxima Pr in each group. By way of example, the encircled entry P27 [20] = 54 is the maximum among the shaded entries of the intervals that end at Ri = 27, ignoring the yet unprocessed entries. As we proceed from j = 27 to j = 28 in row 30, the intervals with Ri = 27 become relevant. The maximum usable entry from these intervals is found in position 17 of this array, because 17 = L30 − 1. The entry P27 [17] = 44 is marked by an arrow. The next 30 will be computed as C 30 + max{P [17], P [17], . . . , P [17]}. (Some of these entries entry W28 27 26 17 28 might not exist.) We can observe that the minimum over which P27 [17] is defined involves no unprocessed entries (Lemma 3). When the next row i = 34 in the group with Ri = 27 is later filled, it will be necessary to update P27 . In order to evaluate the maximum of the second set in (2) efficiently, we group intervals i0 0 with a common right endpoint Ri = r together. Let Sr be the earliest startpoint of an interval with endpoint r. If there are no intervals with endpoint r, we set Sr := r. (It would be more logical to set Sr := r + 1 in this case, but this choice makes the algorithm simpler.) We maintain an array Pr [j] for Sr ≤ j ≤ r that is defined as follows: 0 0 Pr [j] := max{ Wji0 | Ri = r, row i0 has already been processed, j 0 ≤ j } ∪ {0} 0 0 In a sense, Pr [j] is a provisional version of the expression max{ Wji0 | Ri = r, j 0 < j }, which takes into account only the already processed rows. For (2), we need the entry Pj [Li − 1], and we will see that all relevant entries have already been computed whenever we access this entry. Thus, we rewrite (2): ( max{Mji , Pj [Li − 1]}, if Li − 1 ≥ Sj and, thus, Pj [Li − 1] is defined i Mj+1 = (3) Mji , otherwise The condition Li − 1 ≥ Sj ensures that the array index Li − 1 does not exceed the left boundary 6 B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs of the array Pj . Also, the index Li − 1 never exceeds the right boundary j of the array Pj , since Li < j + 1 ≤ Ri , and therefore Li − 1 ≤ j. Thus, Pj [Li − 1] is always defined when it is accessed. i i . Lemma 3. When entry Wj+1 is processed, (2) and (3) define the same quantity Mj+1 Proof. We distinguish three cases. Case 1: No interval ends at j, and accordingly, Sj = j. i In this case Mj+1 = Mji in (2) since its rightmost set is empty. Since Li < j + 1 ≤ Ri , we have Li − 1 < Sj = j and, thus, the right side of (3) evaluates also to Mji . Case 2: There exists an interval ending at j, and Li − 1 < Sj . The right side of (3) evaluates 0 0 to Mji . In (2), intervals i0 that end at Ri = j have Li ≥ Sj > Li − 1. Thus, an edge (i0 , j 0 ) 0 with j 0 < Li and Ri = j does not exist, and the second set in (2) is empty. Therefore, (2) i evaluates to Mj+1 = Mji . Case 3: There exists an interval ending at j, and Li − 1 ≥ Sj . In this case, Pj [Li − 1] is defined: 0 0 Pj [Li − 1] = max{ Wji0 | Ri = j, j 0 ≤ Li − 1, row i0 already processed } 0 (4) 0 For each entry Wji0 with j 0 < Li , we conclude that Li ≤ j 0 < Li and, thus, row i0 has already been processed. This means that the condition that row i0 was processed is redundant, and (4) coincides with the right side of (2). After processing row i with startpoint ` = Li and endpoint r = Ri , we have to update the values in Pr [j]. This is straightforward. Figure 3 illustrates the role of the arrays Pr [j] when processing a row. It remains to discuss the computation of the first value W`i of the row. An edge (i0 , j 0 ), j 0 < ` 0 and edge (i, `) are independent if and only if the interval i0 ends before `, that is Ri < `. Since we process the intervals in nondecreasing order by their startpoints, it suffices to maintain a value F 0 with the maximum Wji0 in all finished intervals: those intervals i0 that end before `. In other words F = max{P1 [1], P2 [2], . . . , P`−1 [` − 1]}. This value is easily maintained by updating F as ` increases. The full details are stated as Algorithm 1. The update of the array Pr [j] in the second loop can be integrated with the computation of Wji in the first loop. When this is done, the values Wji need not be stored at all because they are not used. As stated earlier, when no interval ends at a point r ∈ V , we set Sr = r. The array Pr consists of a single dummy entry Pr [r] = 0. This way we avoid having to treat this special cases during the algorithm. We have described the computation of the value of the optimal matching. It is straightforward to augment the program so that the optimal matching itself can be recovered by backtracking how the optimal value was obtained, but this would clutter the program. Theorem 1. A maximum-weight induced matching of an edge-weighted convex bipartite graph can be computed in O(n + m) time. 3 Maximum-Cardinality Induced Matchings For the unweighted version of the problem, we assume a compact representation of a convex bipartite graph G = (U, V, E), that is, for each i ∈ U we are given the startpoint Li and endpoint Ri of its interval {Li , Li + 1, . . . , Ri }. This makes it possible to obtain a linear runtime of O(n). The recursion (1) can be specialized to the unweighted case by setting Cji ≡ 1. 0 0 Wji = 1 + max { Wji0 | Ri < j, j 0 < Li } ∪ {0} (5) B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs 7 Algorithm 1: Weighted Maximum Matching . Preprocessing: for r := 1 to nV do Find startpoint Sr of the longest interval [Sr , r] with endpoint r Create an array Pr [Sr . . r] and initialize it to 0. (If there is no such interval with endpoint r, set Sr := r and create an array with a single dummy entry Pr [r] that will remain at 0.) . Main program: F := 0 . maximum entry in finished intervals for ` := 1 to nU do . F = max{P1 [1], P2 [2], . . . , P`−1 [` − 1]} for all rows i ∈ U with Li = ` do . Process each interval i that starts at ` r := Ri . Process the i-th interval [Li , Ri ] = [`, r] and fill row i of the table: M := M`i := F . M will be the current value of Mji W`i := C`i + M . leftmost entry for j := ` + 1 to r do . compute successive entries if Sj ≤ ` − 1 then i ,P M := max{M, Pj−1 [` − 1]} . Mji := max{Mj−1 j−1 [` − 1]} i i Wj := Cj + M . Go through the computed entries again to update the array Pr : q := 0 . the row maximum so far for j := ` to r do i , . . . , W i} q := max{q, Wji } . q = max{0, W`i , W`+1 j Pr [j] := max{Pr [j], q} F := max{F, P` [`]} . update F as ` is incremented return F . the maximum weight of an induced matching This recursion has already been stated in [24] and [3] in a slightly different formulation. Yu, Chen and Ma [24] describe it as a greedy-like procedure that “colors” the edges of a bipartite graph with the values Wji . From this coloring, they obtain both a maximum-cardinality induced matching and a minimum chain cover. The original implementation given in [24] runs in time O(m2 ). Brandstädt, Eschen and Sritharan [3] give an improved implementation of the coloring procedure with runtime O(n2 ). Our Algorithm 1 from Section 2 obtains the values Wji in total time O(n + m). Given a compact representation, we can exploit some structural properties of the filled dynamic-programming table to further improve the runtime to O(n). The following observations were first given in [24] and [3]. Lemma 4 ([24, Lemma 5]). The values Wji are nondecreasing in each row. Proof. This is obvious from (5), since the set over which the maximum is taken increases with j. Lemma 5 ([3, Lemma 3.3, Lemma 3.4]). Each row contains at most two consecutive values. Proof. Let Wji be the largest value in some row i. Then, if we take a corresponding matching of size Wji , it is easy to see that we can remove the last two edges and replace them by an arbitrary edge (i, k). This proves that Wki ≥ Wji − 1. More formally, we can argue by the recursion (5): Assume there are values Wki ≤ Wji − 2 in 0 00 00 row i. By Lemma 4 we can assume k < j. By (5), Wji = 1 + Wji0 = 2 + Wji00 with Ri < j 0 < Li 8 B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs Algorithm 2: Unweighted Maximum Matching, initial version Set Q1 := Q2 := · · · := QnU := 0 F := 0 for ` := 1 to nV do for all rows i ∈ U with Li = ` do . Process each interval i that starts at ` w := F + 1 . leftmost entry 0 0 tw := leftmost endpoint Ri of a row i0 that contains an entry Wji = w with j < Li ≡ ` if tw < Ri then . There are two values w and w + 1 in this row: . Wji = w for j = Li , . . . , tw . Wji = w + 1 for j = tw + 1, . . . , Ri QRi := max{QRi , w + 1} . The largest entry is w + 1. else . The same entry w is used for the whole row. QRi := max{QRi , w} . The largest entry is w. F := max{F, Q` } . update F as ` advances return F 00 for some i00 < i0 < i. Thus, j 00 ≤ Ri < j 0 < Li ≤ k and by definition of Wki according to (5) we 00 have Wji − 2 = Wji00 < Wki ≤ Wji − 2, which is a contradiction. Specializing Algorithm 1 to the unweighted case leads to a solution with O(m) running time. Our O(n)-time algorithm will follow the general scheme of Algorithm 1, with the following modifications. • In view of Lemmas 4 and 5, we will not fill each row individually, but we will just determine the leftmost value w and the position where the entries switch from w to w + 1 (if any). • The computation of the leftmost entry is exactly as in Algorithm 1. • The position where the entries of row i switch from w to w + 1 can be determined from (5): If there is a row i0 containing an entry w left of Li , then Wji must be w + 1 as soon as 0 j > Ri . The algorithm determines the threshold position tw as the smallest right endpoint 0 Ri under these constraints. Then the entries w + 1 in row i start at j = tw + 1 if these entries are still part of the row. • We do not maintain the whole array Pr for each r, but only its last entry Pr [r]; this is sufficient for updating F and thus for computing the leftmost entries in the rows. We call this value Qr . This leads to Algorithm 2. We will improve Algorithm 2 by maintaining the values tw instead of computing them from scratch. We use the fact that the smallest value w in the row is known, and hence we can associate tw with the value w instead of the row index i, as is already apparent from our chosen notation. We update tw whenever ` increases. The details are shown in Algorithm 3. The differences to Algorithm 2 are marked by 4. This still does not achieve O(n) running time. The final improvement comes from realizing 0 that it is sufficient to update tw when Wli is the leftmost entry w in row i0 . The time when such an update occurs can be predicted when a row is generated. To this end, we maintain a list Tj for j = 1, . . . , nV that records the updates that are due when ` becomes j. This final version is Algorithm 4. The runtime of Algorithm 4 is O(nU + nV ): Processing each interval i takes constant time and adds at most two pairs to the lists T . Thus, processing the lists T for updating the tw array takes also only O(nU ) time. B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs 9 Algorithm 3: Unweighted Maximum Matching, second version 4 4 4 4 4 Set t1 := t2 := · · · := tnU := nV + 1 . The value nV + 1 acts like ∞. Set Q1 := Q2 := · · · := QnU := 0 F := 0 for ` := 1 to nV do for all rows i ∈ U with Li = ` do . Process each interval i that starts at ` w := F + 1 . leftmost entry . tw is no longer computed from scratch if tw < Ri then . There are two values w and w + 1 in this row: . Wji = w for j = Li , . . . , tw , . Wji = w + 1 for j = tw + 1, . . . , Ri . QRi := max{QRi , w + 1} . The largest entry is w + 1. else . The same entry w is used for the whole row. QRi := max{QRi , w} . The largest entry is w. F := max{F, Q` } . update F as ` is incremented 0 for all entries W`i in column ` do 0 w := W`i 0 tw := min{tw , Ri }; return F Some simplifications are possible: The addition of (w, Ri ) to the list T` in the case of two values can actually be omitted, as it leads to no decrease in tw : tw is already < Ri . The algorithm could be further streamlined by observing that at most two consecutive values of tw need to be remembered at any time. Again, it is easy to modify the algorithm to return a maximum induced matching in addition to its size. Theorem 2. Given a compact representation, a maximum-cardinality induced matching of a convex bipartite graph can be computed in O(n) time. 4 Minimum Chain Covers In convex bipartite graphs, the size of a maximum-cardinality induced matching equals the number of chain subgraphs of a minimum chain cover [24]. In this section we use this duality and extend our Algorithm 4 to obtain a minimum chain cover of a convex bipartite graph G = (U, V, E). Let W ∗ be the cardinality of a maximum induced matching of G. Accordingly, the values Wji cover the range {1, . . . , W ∗ }. We create W ∗ chain subgraphs Z1 , . . . , ZW ∗ of G. The edges (i, j) with Wji = w will be part of the chain subgraph Zw . As already observed in [24], the edges with a fixed value of Wji may contain independent edges and, thus, do not necessarily constitute a chain graph. Accordingly, Yu, Chen, and Ma [24] describe a strategy to extend the edge set for each value of Wji = w to a chain graph Zw . Their original implementation runs in time O(m2 ). Brandstädt, Eschen, and Sritharan [3] give an improved implementation with runtime O(n2 ). We implement their strategy in O(n) time, given a compact representation. The correctness was already shown in [24]. We give a new independent proof. The following characterization is often used as an alternative definition of chain graphs: Lemma 6. A bipartite graph (Ū , V̄ , Ē) is a chain graph if and only if the sets of neighbors V̄ (i) := { j ∈ V̄ | (i, j) ∈ Ē } of the vertices i ∈ Ū form a chain in the inclusion order. (Equal sets are allowed.) In other words, among any two sets V̄ (i) and V̄ (i0 ), one must be contained in the other. 10 B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs Algorithm 4: Unweighted Maximum Matching, final version 4 4 4 4 4 Initialize lists T1 , . . . , TnV to empty lists Set t1 := t2 := · · · := tnU := nV + 1 Set Q1 := Q2 := · · · := QnU := 0 F := 0 for ` := 1 to nV do for all rows i ∈ U with Li = ` do . Process each interval i that starts at ` w := F + 1 . leftmost entry if tw < Ri then . There are two values w and w + 1 in this row: . Wji = w for j = Li , . . . , tw , . Wji = w + 1 for j = tw + 1, . . . , Ri . add (w +1, Ri ) to the list Ttw +1 . don’t forget to update tw+1 when ` reaches tw + 1 add (w, Ri ) to the list T` . don’t forget to update tw when ` advances QRi := max{QRi , w + 1} else . The same entry w is used for the whole row. add (w, Ri ) to the list T` QRi := max{QRi , w} F := max{F, Q` } . update F as ` advances for all (w, r) ∈ T` do tw := min{tw , r} . perform the necessary updates return F Proof. This is a direct consequence of the fact that edges (i, j) and (i0 , j 0 ) are independent if and only if j 0 ∈ / V̄ (i) and j ∈ / V̄ (i0 ). The condition that the neighborhoods must form a chain is apparently the reason for calling these graphs chain graphs, however, we did not find a reference for this. We use Uw to denote the set of rows that contain entries Wji = w. For every row i ∈ Uw , we i , E i with this color, that is, W i = w ⇐⇒ B i ≤ determine the beginning and ending points Bw w w j i , E i ] to the left by choosing a new starting point B̂ i j ≤ Ewi . We extend every such interval [Bw w w according to the formula 0 0 i i i B̂w := min{Bw } ∪ { Bw | i0 ∈ Uw , Ewi < Ewi } = i min{Bw } ∪ i0 { B̂w 0 | i ∈ Uw , 0 Ewi < Ewi (6) } (7) The second expression uses the new values B̂ on the right-hand side. It is easy to see that the i0 , the expression (7) becomes two expressions are equivalent: Using (6) for the definition of B̂w 0 0 00 00 0 i i i | i00 ∈ Uw , Ewi < Ewi < Ewi , i0 ∈ Uw }. min{Bw } ∪ { Bw | i0 ∈ Uw , Ewi < Ewi } ∪ {Bw (8) i according to (6). The third set is contained in the second set, and thus, (8) is equal to B̂w i , E i ]. Figure 4 We construct the chain graph Zw as the graph with the extended intervals [B̂w w shows an example. It is obvious by construction that these intervals satisfy the conditions of a i , E i ], [B̂ i0 , E i0 ] chain graph: By Lemma 6, we have to show that there are no two intervals [B̂w w w w 0 0 i < B̂ i and E i < E i . But if the last condition holds, (7) ensures that B̂ i ≤ B̂ i0 . with B̂w w w w w w i becomes too small so that the chain graph is The only thing that could go wrong is that B̂w not a subgraph of G. The following lemma shows that this is not the case. i ≥ Li for every i ∈ U . Lemma 7. B̂w w i < Li . By (6), there is a row i0 ∈ U such Proof. For the sake of contradiction, assume B̂w w 0 0 i i i i i i0 in the recursion (5), we conclude that that Bw < L and Ew < Ew . Setting j = Ew and j 0 = Bw B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 6 7 7 7 7 i t6 6 6 6 6 6 7 7 7 6 6 6 6 6 6 7 7 6 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 11 j t7 7 7 7 7 7 7 7 7 8 8 8 8 7 7 7 8 8 8 8 8 8 7 8 8 7 8 8 8 8 8 8 8 8 8 8 8 8 9 .. . Fig. 4: An example showing a section of the computation of Wji by Algorithm 4. The threshold values t6 and t7 are shown as they change with the rows that are successively considered. The shaded entries form the chain subgraph Z7 that is used for the chain cover. 0 0 Ewi ≤ Ri , because otherwise, (5) would imply w = WEi i ≥ 1 + WBi i0 = 1 + w. Thus, (i0 , Ewi ) 0 w w 00 is an edge of G. By Lemma 5, WEi i = w + 1. By (5), there is an edge (i00 , j 00 ) with Wji00 = w, 00 0 w Ri < Ewi and j 00 < Li < Li . Again by (5), such an edge (i00 , j 00 ) would imply that WEi i ≥ w + 1, w a contradiction. i , E i , w) in Algorithm 5 carries out the computation of (6). It processes the triplets (Bw w i increasing order of the endpoints Ew = r. This can be done in linear time, by first sorting the i , E i , w) into n buckets according to the value of E i . Thus, Algorithm 5 O(nU ) triples (Bw V w w takes linear time O(n). By Lemma 6, the result is a chain cover, which by duality is minimum. Each row belongs to at most two chain subgraphs, and thus the chain cover consists of at most 2nU such row intervals in total. It is straightforward to extend Algorithm 4 to compute the i , E i , and thus the cover can be constructed in O(n) time in sets Uw and the quantities Bw w compressed form. Theorem 3. Given a compact representation of a convex bipartite graph, a compact representation of a minimum chain cover can be computed in O(n) time. Given a compact representation of a minimum chain cover, we can list all the edges of its chain subgraphs in O(n + m) time since every edge is contained in at most two chain subgraphs. As mentioned in the introduction, a compact representation of a convex bipartite graph can be computed in O(n + m) time [20, 22, 2]. Thus, Algorithm 4 and Algorithm 5 can also be used to obtain: Theorem 4. A minimum chain cover of a convex bipartite graph can be computed in O(n + m) time. 5 Certification of Optimality An induced matching H together with a chain cover of the same cardinality provides a certificate of optimality, of size O(n). As we will establish in the following discussion, it is easy to check this certificate for validity in linear time. This is easier than constructing the largest induced matching with our algorithm. Thus, it is possible to establish correctness of the result beyond 12 B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs i ≤ j ≤ E i }, 1 ≤ w ≤ W ∗ Algorithm 5: Constructing a chain graph { (i, j) | i ∈ Uw , B̂w w . Uw := { i ∈ U | row i contains an entry w } i and E i such that in row i, the entries with W i = w are those with . Let Bw w j i ≤ j ≤ Ei Bw w Set G1 := G2 := · · · := GW ∗ := nV + 1 . The value nV + 1 acts like ∞ for r := 1 to nv do i | E i < r} for w = 1, . . . , W ∗ . . We maintain the quantities Gw ≡ min{Bw w i i i for all (Bw , Ew , w) with Ew = r do i := min{B i , G } B̂w w w i , E i , w) with E i = r do . update G for the increment of r for all (Bw w w w i ,G } Gw := min{Bw w doubt, for each particular instance of the problem, without having to trust the correctness of our algorithms and their implementations, see [17] for a survey about this concept. It is trivial to check whether the matching H is contained in the graph. To test whether it forms an induced matching, we sort the edges (i, j) by j. This takes O(n) time with bucket-sort. Then, by Lemma 1, it is sufficient to test consecutive edges for independence, and each such test takes only constant time according to Observation 1. To establish the validity of a chain cover {Z1 , . . . , ZW ∗ }, we need to check that the edges of G i ≤ are covered and each Zw is a chain subgraph. The chain subgraphs Zw = { (i, j) | i ∈ Uw , B̂w i ∗ j ≤ Ew }, for 1 ≤ w ≤ W are compactly represented by a set of at most 2nU quadruples i , E i ). The following checking procedure works in linear time for any chain cover as long (w, i, B̂w w as it consists of convex bipartite subgraphs. It does not use any special properties of the cover produced by our algorithm. i , −E i , i) lexicographically. Then it is easy to check the chain We sort the quadruples (w, B̂w w i , E i ] that belong to a graph property using the characterization of Lemma 6: The intervals [B̂w w fixed chain graph Zw (these are consecutive in the list) ought to be nested. Since the starting i are weakly increasing, this amounts to checking that the endpoints E i decrease points B̂w w weakly. To check that the chain graphs are contained in G and they collectively cover G, we sort i , E i , w). The union of the intervals [B̂ i , E i ] that are the neighbors of the quadruples (i, B̂w w w w a fixed vertex i ∈ U (these are consecutive in the list) can be incrementally formed, and the resulting interval is compared against [Li , Ri ]. As soon as a gap would form in this union, we can abort the test, since the intervals are sorted by left endpoint and it is then impossible to form a connected interval [Li , Ri ]. The required lexicographic sorting operations can be carried out in O(n) time by bucket-sort. 6 Outlook: Duality The existence of a pair of maximum induced matchings and smallest chain covers with the same size is a manifestation of strong duality between independents sets and clique covers in perfect graphs. We mentioned in the introduction that our maximum induced matching problem is an instance of a maximum independent set problem in the square of a line graph, and the chain cover is a covering by cliques. Yu, Chen and Ma [24] established that the square of the line graph of a convex bipartite graph is a co-comparability graph. Therefore, it is also a perfect graph. It follows that the linear program for maximizing the size of an induced matching is totally dual integral. As a corollary of this fact, we recover our strong duality result: the existence of a primal optimal solution (maximum induced matching) and a dual optimal solution (smallest chain cover) with matching objective function values. B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs 13 This duality relation for perfect graphs extends to the weighted version. Thus, there should also be a weighted chain cover with the same weight as the maximum weight of an induced matching. It would be interesting to extend our primal Algorithm 1 in weighted graphs to a fast combinatorial algorithm for finding minimum-weight chain covers, as Algorithm 5 does for the unweighted version. References [1] K. Asdre, S. D. Nikolopoulos: NP-completeness results for some problems on subclasses of bipartite and chordal graphs. Theoretical Computer Science 381(1), 248–259 (2007), DOI:10.1016/j.tcs. 2007.05.012 [2] K. S. Booth, G. S. Lueker: Testing for the consecutive ones property, interval graphs, and graph planarity using PQ-tree algorithms. J. Comput. Syst. Sci. 13(3), 335–379 (1976), DOI:10.1016/ S0022-0000(76)80045-1 [3] A. Brandstädt, E. M. Eschen, R. Sritharan: The induced matching and chain subgraph cover problems for convex bipartite graphs. Theor. Comput. Sci. 381(1–3), 260–265 (2007), DOI:10.1016/ j.tcs.2007.04.006 [4] K. Cameron: Induced matchings. Discrete Applied Mathematics 24(1–3), 97–102 (1989), DOI:10. 1016/0166-218X(92)90275-F [5] K. Cameron, R. Sritharan, Y. Tang: Finding a maximum induced matching in weakly chordal graphs. Discrete Mathematics 266(1-3), 133–142 (2003), DOI:10.1016/S0012-365X(02)00803-8 [6] J.-M. Chang: Induced matchings in asteroidal triple-free graphs. Discrete Applied Mathematics 132(1–3), 67–78 (2003), DOI:10.1016/S0166-218X(03)00390-1 [7] G. Ding: Covering the edges with consecutive sets. Journal of Graph Theory 15(5), 559–562 (1991), DOI:10.1002/jgt.3190150508 [8] W. Duckworth, D. Manlove, M. Zito: On the approximability of the maximum induced matching problem. J. Discrete Algorithms 3(1), 79–91 (2005), DOI:10.1016/j.jda.2004.05.001 [9] G. Gallo: An O(n log n) algorithm for the convex bipartite matching problem. Operations Research Letters 3(1), 31–34 (1984), DOI:10.1016/0167-6377(84)90068-3 [10] F. Glover: Maximum matching in a convex bipartite graph. Naval Research Logistics Quarterly 14(3), 313–316 (1967), DOI:10.1002/nav.3800140304 [11] M. C. Golumbic, M. Lewenstein: New results on induced matchings. Discrete Applied Mathematics 101(1-3), 157–165 (2000), DOI:10.1016/S0166-218X(99)00194-8 [12] P. L. Hammer, U. N. Peled, X. Sun: Difference graphs. Discrete Applied Mathematics 28(1), 35–44 (1990), DOI:10.1016/0166-218X(90)90092-Q [13] R. Hung: Linear-time algorithm for the paired-domination problem in convex bipartite graphs. Theory Comput. Syst. 50(4), 721–738 (2012), DOI:10.1007/s00224-011-9378-8 [14] I. Katriel: Matchings in node-weighted convex bipartite graphs. INFORMS Journal on Computing 20(2), 205–211 (2008), DOI:10.1287/ijoc.1070.0232 [15] D. Kobler, U. Rotics: Finding maximum induced matchings in subclasses of claw-free and P5 -free graphs, and in graphs with matching and induced matching of equal maximum size. Algorithmica 37(4), 327–346 (2003), DOI:10.1007/s00453-003-1035-4 [16] V. V. Lozin: On maximum induced matchings in bipartite graphs. Inf. Process. Lett. 81(1), 7–11 (2002), DOI:10.1016/S0020-0190(01)00185-5 [17] R. M. McConnell, K. Mehlhorn, S. Näher, P. Schweitzer: Certifying algorithms. Computer Science Review 5(2), 119–161 (May 2011), DOI:10.1016/j.cosrev.2010.09.009 [18] H. Müller: Hamiltonian circuits in chordal bipartite graphs. Discrete Mathematics 156(1–3), 291–298 (1996), DOI:10.1016/0012-365X(95)00057-4 14 B. Klemz, G. Rote: Maximum-Weight Induced Matchings in Convex Bipartite Graphs [19] A. Pandey, B. S. Panda, P. Dane, M. Kashyap: Induced matching in some subclasses of bipartite graphs. In: D. R. Gaur, N. S. Narayanaswamy (eds.) Algorithms and Discrete Applied Mathematics – Third International Conference, CALDAM 2017, Sancoale, Goa, India, February 16–18, 2017, Proceedings. Lecture Notes in Computer Science, vol. 10156, pp. 308–319. Springer (2017), DOI:10. 1007/978-3-319-53007-9_27 [20] J. Soares, M. A. Stefanes: Algorithms for maximum independent set in convex bipartite graphs. Algorithmica 53(1), 35–49 (2009), DOI:10.1007/s00453-007-9006-9 [21] J. P. Spinrad: Efficient Graph Representations. American Mathematical Society (2003) [22] G. Steiner, J. Yeomans: A linear time algorithm for maximum matchings in convex, bipartite graphs. Computers & Mathematics with Applications 31(12), 91–96 (1996), DOI:10.1016/0898-1221(96) 00079-X [23] L. J. Stockmeyer, V. V. Vazirani: NP-completeness of some generalizations of the maximum matching problem. Inf. Process. Lett. 15(1), 14–19 (1982), DOI:10.1016/0020-0190(82)90077-1 [24] C.-W. Yu, G.-H. Chen, T.-H. Ma: On the complexity of the k-chain subgraph cover problem. Theor. Comput. Sci. 205(1–2), 85–98 (1998), DOI:10.1016/S0304-3975(97)00036-4
8cs.DS
IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS 1 Consensus in the Presence of Multiple Opinion Leaders: Effect of Bounded Confidence Ranga Dabarera, Student Member, IEEE, Kamal Premaratne, Senior Member, IEEE, Manohar N. Murthi, Member, IEEE, and Dilip Sarkar, Senior Member, IEEE arXiv:1605.07861v1 [cs.SI] 25 May 2016 c 2016 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works. Abstract—The problem of analyzing the performance of networked agents exchanging evidence in a dynamic network has recently grown in importance. This problem has relevance in signal and data fusion network applications and in studying opinion and consensus dynamics in social networks. Due to its capability of handling a wider variety of uncertainties and ambiguities associated with evidence, we use the framework of Dempster-Shafer (DS) theory to capture the opinion of an agent. We then examine the consensus among agents in dynamic networks in which an agent can utilize either a cautious or receptive updating strategy. In particular, we examine the case of bounded confidence updating where an agent exchanges its opinion only with neighboring nodes possessing ‘similar’ evidence. In a fusion network, this captures the case in which nodes only update their state based on evidence consistent with the node’s own evidence. In opinion dynamics, this captures the notions of Social Judgment Theory (SJT) in which agents update their opinions only with other agents possessing opinions closer to their own. Focusing on the two special DS theoretic cases where an agent state is modeled as a Dirichlet body of evidence and a probability mass function (p.m.f.), we utilize results from matrix theory, graph theory, and networks to prove the existence of consensus agent states in several time-varying network cases of interest. For example, we show the existence of a consensus in which a subset of network nodes achieves a consensus that is adopted by follower network nodes. Of particular interest is the case of multiple opinion leaders, where we show that the agents do not reach a consensus in general, but rather converge to ‘opinion clusters’. Simulation results are provided to illustrate the main results. Index Terms—Consensus, opinion leaders, bounded confidence, social judgement theory. I. I NTRODUCTION Motivation. In multi-agent systems like social networks or a group of mobile robots completing a task, agent behavior is determined by local interactions between neighboring agents. In distributed control problems, reaching a consensus state is often necessary for the agents to achieve a control objective Manuscript submitted in September 2015. This work is based on research supported by the U.S. Office of Naval Research (ONR) via grant #N00014-101-0140, and the U.S. National Science Foundation (NSF) via grant #1343430. RD, KP, and MNM are with the Department of Electrical and Computer Engineering of the University of Miami, Coral Gables, Florida (email: {ranga, kamal, mmurthi}@miami.edu); DS is with the Department of Computer Scienceof the University of Miami, Coral Gables, Florida (e-mail: [email protected]). [1], [2]. Within the context of distributed sensor fusion, the agents exchange evidence to eventually have a good estimate of unknown parameters [3]. Agents in a social network typically exchange opinions in some manner with their neighbors, and update their own opinions, possibly resulting in consensus. The work in [4] discusses models of opinion diffusion among rational agents and social learning, explaining how opinions emerge or fail to emerge in contexts of economics and social sciences. Understanding the conditions under which a group of agents will reach a possible consensus in a network with time-varying links is a challenging problem that has recently garnered much interest. Previous Work. Previous work within signal processing, control, and data fusion geared towards analyzing agent consensus formation has mostly modeled an agent state as a realvalued vector [1]–[3], [5], [6] (see also [7] and references therein). While such an assumption is useful in the context of agents achieving consensus on a control vector, or sensing network agents achieving a consensus signal estimate, the assumption of a real-valued vector may not necessarily be always suitable within higher-level fusion, or the analysis of opinion dynamics in social networks. In higher-level fusion, agents could reach a consensus assessment regarding a situation, while in opinion dynamics, agents gravitate to reach a possible consensus opinion. The inherent uncertainty within such applications may necessitate a more structured agent state vector such as a probability mass function (p.m.f.) or an imprecise probabilisitic formalism, such as Dempster-Shafer (DS) theory [8]. Agent states/opinions in complex fusion environments and social networks involve more qualitative and nuanced information and hence are associated with higher and a wider variety of uncertainties. Uncertainty modeling formalisms based on imprecise probability, such as DS theory, provide a convenient framework for such scenarios. The DS theoretic (DST) framework stands apart from alternate uncertainty handling frameworks (such as, fuzzy sets, rough sets, etc.) in that it bears a close relationship to the probabilistic framework [9]. DST models converge to and/or can be converted to p.m.f. models in limiting cases, thus allowing for a swift generalization of legacy techniques. Moreover, DST models provide a more intuitive and convenient approach for handling the 0000–0000/00$00.00 c 2016 IEEE 2 IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS types of uncertainties and the nuances that are characteristic of agent states and opinions in complex fusion environments and social networks [7], [10]. For example. complete ignorance can be captured via the ‘vacuous’ model and lack of evidence can be captured by allowing evidential support for nonsingleton propositions (see Section II). For the variety of data imperfection types that DST models can conveniently capture, see Table 1 in [11]. However, much of the work on opinion dynamics in social networks has focused on modeling the agent states as either scalar real numbers, or a vector of real numbers [12], e.g., see the Hegselmann-Krause (HK) model [13], [14] and the Deffuant-Weisbuch (DW) model [15], [16]. In our recent work [7], [17], we utilized the DST framework to address consensus formation in asynchronous dynamic/adhoc networks with applications to high-level fusion networks, and opinion dynamics in social networks. By utilizing DS theory, the methods by which an agent models an opinion and updates its opinion are now equipped with a powerful mechanism for grappling with the uncertainty inherent in the problem, whether in the form of vague agent opinions, or imprecise data in a fusion network (e.g., vague witness statements). In [7], we presented the foundations of analyzing opinion dynamics and revision of agent state beliefs in asynchronous dynamic/ad-hoc, demonstrating conditions under which consensus is achieved. Our more recent work in [17] utilized ideas from psychology, namely Social Judgment Theory (SJT) [18], which examines the basic psychological processes underlying the expression of attitudes and their modifiability through communication. In particular, in [17], we specifically used the notion of bounded confidence which stems from the concept of latitude of acceptance in SJT. In a social network, agents may only communicate and exchange opinions with their neighbors who have similar opinions on a particular topic. In other words, an agent may be willing to update its opinion with the neighboring agent’s opinion only if the ‘distance’ to that opinion is within a certain bound of confidence. The opinion exchange models in the HK and DW models account for these bounded confidence notions. The work in [19] addresses statistical estimation of the bound of confidence. In [20] agents are treated as Bayesian decision-makers and Bayes’ risk error has been used to estimate the bounds. The bounded confidence assumption is also useful within high-level fusion networks to capture situations where agents may only exchange evidence with agents that have states similar to their own and perhaps avoiding the use of faulty outlier sensors/agents. Contributions. As in [7], [17], this present work of ours on agent consensus formation in dynamic networks is formulated within the DST framework. This allows us to embrace a wider variety of uncertainties and nuances that are more representative of agent states/opinions in complex fusion networks and social networks. Taking this DST setting as a springboard, for the main contributions of this work, we focus on two special cases of DST agent opinion models, viz., opinions modeled as a p.m.f. and a Dirichlet body of evidence (which allows one to retain DS theory’s ability to capture complete ignorance with only a slight increase in computational complexity) [21]. Utilizing results from matrix theory, graph theory, and networks, we provide a thorough theoretical analysis of the conditions for consensus formation among a group of agents residing within a dynamic network (i.e., the network connectivity graph is dynamic, so that links can appear, or disappear, meaning that the agents may not have the same neighbors at each time instant). Of particular value are the following: (1) Each agent may employ either cautious or receptive opinion update strategies, which essentially determines whether the agent acts as an opinion ‘leader’ or an opinion ‘follower.’ (2) The agents employ bounded confidence notions so that an agent exchanges and updates its state/opinion with only those neighbors whose opinions are similar (as measured by a suitable norm) to its own opinion. (3) The notion of opinion dynamic chains and corresponding results being presented in this work capture network topologies, and conditions under which, where one or two groups of agents interact with another group of agents to drive them toward a consensus opinion or opinion clusters. (4) Focusing on the two cases of p.m.f. and DST Dirichlet agent opinion models, the behavior of the network in the presence of multiple opinion leaders is explored. The analytical results require significantly less restrictive assumptions than those in [17], which, to the authors’ knowledge, is the only other work that deals with multiple opinion leaders. (5) These general analytical results are then used to study how opinion leaders interact with opinion followers. In particular, it is shown that the arrival at a consensus opinion or opinion clusters is dependent on the the number of opinion leaders present and the agents’ bounds of confidence. (6) Several cases of interest in both opinion dynamics and fusion domains are studied. This includes the the leaderfollower problem [22] where a subset of the networked agents achieve an opinion cluster which is then followed and adopted by the remaining agents. (7) Finally, experimental evaluations are carried out to explore whether these results on p.m.f. and Dirichlet agent opinions apply to and are valid for agent opinions represented via general DST models. As elaborated upon earlier, DST framework offers a more intuitive and convenient avenue to capture the types of uncertainties and the nuances associated with agent opinions. This current work and the results regarding p.m.f. and Dirichlet agent opinions constitute an important step toward understanding how agents whose states/opinions are captured via more general DST models behave in terms consensus and opinion cluster formation. Organization of Paper. The paper is organized as follows: Section II covers basic background material. Section III presents our opinion update model with the conditional update equation (CUE) as the governing equation. Our main theoretical contribution on opinion dynamic chains driven by one group (1-ODC) and opinion dynamic chains driven by two groups (2-ODC) are in Section IV where we focus on two special cases of the DST agent opinion model: Section IV-A deals with agent opinions captured via p.m.f.s which would appeal to readers with background knowledge in probabilistic DABARERA, et al.: CONSENSUS IN THE PRESENCE OF MULTIPLE OPINION LEADERS ... opinion representation; Section IV-B deals with DST Dirichlet agent opinions. Section V provides experimental validation of our results, including their applicability in scenarios where agent opinions are captured via more general DST models. II. P RELIMINARIES We use N and R to denote the integers and reals, respectively. Subscript ()≥0 attached to these are their nonnegative counterparts; R[0,1] denotes the reals taking values in [0, 1]. The superscripts ()N and ()M ×N denote N sized vector and (M × N )-sized matrix counterparts. For X = {Xij } ∈ RM ×N , kXk denotes its ∞-norm, i.e., PN kXk = maxi∈1,M j=1 |Xij |. We use X > 0 and X ≥ 0 to denote a matrix/vector with positive and non-negative entries, respectively. A matrix whose entries are all 0 s (and is of compatible size) is denoted by 0; an N -element vector whose elements are all 1 s is denoted by 1N . We use |Θ| to denote the cardinality of set Θ. Relevant Notions from DS Theory. In DS theory, the frame of discernment (FoD) refers to the set Θ = {θ1 , · · · , θM } consisting of the mutually exclusive and exhaustive ‘singleton’ propositions θi [8]. A singleton proposition θi ∈ Θ represents the lowest level of discernible information; |Θ| = M is the number of independent singleton propositions in the FoD Θ. The power set of the FoD, 2Θ = {A : A ⊆ Θ}, denotes all the possible subsets of Θ. For A ⊆ Θ, A denotes all singletons in Θ that are not in A. Basic Belief Assignment (BBA). A basic belief assignment Θ (BBA) or mass P assignment is a mapping m(·) : 2 7→ [0, 1] such that A⊆Θ m(A) = 1 and m(∅) = 0. The BBA measures the “support” assigned to proposition A ⊆ Θ. Propositions that receive non-zero mass are referred to as focal elements. The set of focal elements is the core F. The triplet E = {Θ, F, m} is referred to as the body of evidence (BoE). The mass vector corresponding to the BoE E is m = [m(∅), m(θ1 ), . . . , m(θM ), m(θ1 θ2 ), . . . , m(θ1 θM ), M m(θ1 θ2 θ3 ), . . . , m(θ1 θ2 θM ), . . . , m(Θ)] ∈ R2[0,1] . (1) Note that, masses are assigned to all propositions in 2Θ . DS theory captures the notion of ignorance by allowing composite (i.e., non-singleton) propositions to be focal elements, e.g., the mass assignment m(θi θj ) > 0 represents ignorance or lack of evidence to differentiate between the singletons θi and θj . The vacuous BBA which Θ as its only focal element (so that m(Θ) = 1) captures complete ignorance. Belief and Plausibility. Given a BoE, E ≡ {Θ, P F, m}, the belief Bl : 2Θ 7→ [0, 1], defined as Bl(A) = B⊆A m(B), represents the total support committed to A without also being committed to its complement A. The plausibility Pl : 2Θ 7→ [0, 1], defined as Pl(A) = 1 − Bl(A), corresponds to the total belief that does not contradict A. The uncertainty of A is Un(A) = [Bl(A), Pl(A)]. We also use the notation Fb = {A ⊆ Θ : Bl(A) > 0}. A BoE is called Bayesian if each focal element is a singleton. For a Bayesian BoE, the BBA, belief, and plausibility, all reduce to the same probability (i.e., p.m.f.) assignment. The expressive power that the DST framework wields a high cost: 3 For a given FoD Θ, where |Θ| = M , a DST model allocates 2M −2 mass assignments; only M −1 probability assignments are required for a p.m.f. Much advances have been made for the purpose of mitigating the associated computational burden [23]–[25]. A special DST model which retains the ability to capture complete ignorance with only a slight increase in computational complexity is the Dirichlet BoE (so named because of its close relationship with Dirichlet probability distributions [21]). The singletons {θi } and Θ constitute the only focal elements of a Dirichlet BoE, thus requiring only M mass assignments. DST Conditionals. Of the various notions of DST conditionals that abound in the literature, the Fagin-Halpern (FH) conditional offers a unique probabilistic interpretation and constitutes a natural transition to the Bayesian conditional notion [9], [25]. The extensive study in [26] identifies several attractive properties of the FH conditionals including its equivalence to other popular notions of DST conditionals. Definition 1 (FH Conditionals). For the BoE E = {Θ, F, m} b the conditional belief Bl(B|A) : 2Θ 7→ and A ⊆ Θ s.t. A ∈ F, [0, 1] and the conditional plausibility Pl(B|A) : 2Θ 7→ [0, 1] of B given A are, respectively, Bl(B|A) = Bl(A ∩ B)/[Bl(A ∩ B) + Pl(A ∩ B)]; Pl(B|A) = Pl(A ∩ B)/[Pl(A ∩ B) + Bl(A ∩ B)]. The conditional core theorem [25] can be utilized to directly identify the conditional focal elements to improve computational performance when applying FH conditionals. DST Distance Measure. In our work, we need a distance measure which captures the closeness between DST BoEs. Among possible alternatives that have appeared in the literature, we use the DST distance measure in [27], [28]. Definition 2 (Distance Between BoEs). [27] The distance between the two agent BoEs Ei = {Θ, Fi , mi } and Ej = {Θ, Fj , mj } is h i1/2 T kEi − Ej kJ = 0.5 (mi − mj ) D (mi − mj ) ∈ R[0,1] , M where mi , mj ∈ R2≥0 are the mass vectors associated with the M M BoEs Ei and Ej , respectively; D = {dmn } ∈ R2≥0 ×2 , with dmn = |Am ∩ An |/|Am ∪ An |, Am , An ⊆ Θ, with |∅ ∩ ∅|/|∅ ∪ ∅| ≡ 0. Relevant Notions from Graph Theory. [29] We use Gk = (V, Ek ) to denote a directed graph at discrete-time (DT) instant k ∈ N≥0 . Here, eij ∈ Ek represents a unidirectional edge from node Vj ∈ V to node Vi ∈ V . We use Ak to identify the (N × N ) adjacency matrix associated with Ek . Consider the directed graph Gk = (V, Ek ). The outcomponent of vertex Vi ∈ V is the set of vertices (including vertex Vi itself) reachable via directed paths from vertex Vi . The in-component of vertex Vi ∈ V is the set of vertices (including vertex Vi itself) from which vertex Vi is reachable via directed paths. Relevant Notions from Stochastic PNMatrix Theory. We say ×N that X ∈ RN j=1 Xij = 1, ∀i ∈ 1, N [0,1] is stochastic if ×N and kXk = 1; we say that X ∈ RN [0,1] is sub-stochastic if 4 IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS PN PN Xij ≤ 1, ∀i ∈ 1, N , and ∃ i ∈ 1, N s.t. j=1 Xij < 1. Stochastic/sub-stochastic matrices and the limiting behavior of their products play a critical role in our work. j=1 III. DST M ODELING OF O PINION DYNAMICS In the work that follows, we consider N agents embedded in the directed graph Gk = (V, Ek ). Here, for i ∈ 1, N , the node Vi ∈ V in Gk represents the i-th agent and the directed edge eij ∈ Ek represents an unidirectional information exchange link from the j-th agent to the i-th agent (i.e., the i-th agent can receive information from the j-th agent). Unless otherwise mentioned, the opinion of the i-th agent at time instant k ∈ N≥0 is taken to be captured via the BoE Ei,k = {Θ, Fi,k , mi (·)k }, i ∈ 1, N . We assume that the agent opinion BoEs are associated with the identical FoD Θ. Definition 3 (Opinion Profile). Consider the agent BoEs Ei,k = {Θ, Fi,k , mi (·)k }, i ∈ 1, N , k ∈ N≥0 . The opinion profile of B ⊆ Θ at k ∈ R≥0 is π (B)k = [m1 (B)k , . . . , mN (B)]T ∈ RN [0,1] , with π (B)0 ∈ RN [0,1] denoting its initial state. repeatedly updates its state by iterative opinion exchange. Let S ⊆ {1, 2, . . . , N } identify a subset of the agents in V . (i) Suppose limk→∞ kEi,k − Ej,k kJ = 0, ∀i, j ∈ S (or equivalently, limk→∞ Ei,k ≡ E∗ , ∀i ∈ S) and suppose limk→∞ Ei,k 6= E∗ , ∀i ∈ 1, N \ S. Then, the agents in S are said to form an opinion cluster. (ii) The agents are said to reach a consensus if S = V , i.e., all the agents in V form a single opinion cluster. Henceforth, our results will only be stated with the formation of a consensus in mind (e.g., see Lemma 1). Due to (ii) above, these results can easily be reformulated so that they pertain to the formation of opinion clusters. In our work, we assume that each agent updates its opinion in accordance with the conditional update equation (CUE): Definition 5 (Conditional Update Equation (CUE)). [7], [30], [31] Suppose the i-th agent updates its opinion Ei by taking into account its neighboring agents j ∈ Ni,k (εi ), where εi > 0 is the i-th agent’s bound of confidence. The CUEbased updated opinion of the i-th agent is X X Bli (B)k+1 = αi,k Bli (B)k + βij (A)k Blj (B|A)k . j∈Ii,k \i A∈F̂j,k A. Bounded Confidence For each agent, define the following sets of neighborhood agents at time instant k:  Ni,k = Vj ∈ V : j ∈ 1, N , and eij ∈ Ek ; Ni,k (εi ) = {Vj ∈ Ni,k : kEi,k − Ej,k kJ ≤ εi } , (2) where k · kJ refers to the distance measure in Definition 2 (while any valid norm applicable for DST BoEs could be used); εi ≥ 0 is the latitude of acceptance or bound of confidence associated with the i-th agent. So, Ni,k (εi ) denotes the neighbors of the i-th agent at time k left after ‘pruning’ the links subjected to the bound of confidence requirement. With ε = [ε1 , . . . , εN ]T , let Gk† (εε) = (V, Ek† (εε)), (3) Ek† (εε) where = {eij ∈ Ek : kEi,k − Ej,k kJ ≤ εi }. The bounded confidence process of updating an agent’s opinion is as follows [5], [12]: the i-th agent updates its BoE Ei in response to the opinion BoE Ej of its neighbor, the j-th agent, only if j ∈ Ni (εi ). In [15], the threshold εi is referred to as an openness character. Another interpretation views εi as an uncertainty, i.e., if the i-th agent possesses an opinion with some degree of uncertainty εi , then it ignores the views of those neighbor agents who fall outside its uncertainty range. B. Opinion Updating and Consensus Formation Opinion Updating. In what follows, we will use S to identify the indices corresponding to a subset of the agents in V , i.e., S ⊆ {1, 2, . . . , N } s.t. Vi , ∀i ∈ S, identifies a subset of agents in V . To proceed, we adopt the following Definition 4 (Opinion Clusters, Consensus). Let Ei,k , i ∈ 1, N , k ∈ N≥0 , denote the opinions of N agents embedded within the network Gk = (V, Ek ), where each agent Here, the index set Ii,k identifies the agents in Ni,k (εi ); the CUE parameters αi,k , βij (·)k ∈ R[0,1] satisfy X X αi,k + βij (A)k = 1. j∈Ii,k \i A∈F̂j,k The above CUE can also be expressed directly in terms of DST mass values. Alternately, the updated mass values can be computed from the updated belief values. Note that, with agents utilizing CUE-based opinion updating, the edge ‘weights’ along both directions of an edge are not equal in general because the CUE weights βij (·) and βji (·) are not necessarily the same. It is for this reason that we treat the underlying graph Gk as directed. The work in [7], [30], [31] also provides various strategies for selecting the CUE parameters. Of particular importance are two particular strategies: Definition 6 (Receptive and Cautious Update Strategies). Consider the i-th agent updating its opinion Ei according to the CUE-based update in Definition 5. (i) The i-th agent is said to employ receptive updating if βi,j (A)k ∝ mj (A)k , and receptively updating agents are referred to as opinion leaders. (ii) The i-th agent is said to employ cautious updating if βij (A)k ∝ mi (A)k , and cautiously updating agents are referred to as opinion followers. Receptive updating ‘weighs’ the incoming evidence according to the support each focal element receives from the incoming BoEs. This has an interesting Bayesian interpretation: it reduces to a weighted average of the p.m.f.s of the BoEs. Cautious updating ‘weighs’ the incoming evidence according to the support each focal elements receives from the BoE being updated. We consider three cases: DABARERA, et al.: CONSENSUS IN THE PRESENCE OF MULTIPLE OPINION LEADERS ... (1) No Opinion Leaders: This is the most common scenario that appears in the literature [12], [14], [15]. Here, all agents are receptively updating and no opinion leaders are present. (2) Single Opinion Leader: Here, all agents employ receptive updating except one opinion leader. This is the scenario considered in typical leader-follower models [6], and the recent work in [7]). (3) Multiple Opinion Leaders: Here, there are multiple cautiously updating opinion leaders, generally with different initial opinions. To our knowledge, this case has not been addressed prior to the work in [17] which was based on the work in [13], [32]. It provides sufficient conditions for consensus/cluster formation under certain strong assumptions (e.g., the agent opinions can be ordered in what is referred to as an ε-chain). We will relax such assumptions by utilizing properties of products of stochastic/sub-stochastic matrices. IV. O PINION DYNAMIC C HAINS WITH O PINION L EADERS While the DST framework provides a powerful tool for grappling with the types of uncertainties and nuanced information prevalent in complex fusion and social networks, the expressive power inherent in DST models levy a high computational burden. A Dirichlet BoE [21] is a special type of DST BoE which retains DS theory’s ability to capture complete ignorance with only a slight increase in computational effort. With our DST opinion model in place, we now focus on probabilistic (i.e., p.m.f.) and DST Dirichlet agent opinions. A. Probabilisitic Agent Opinions With the DST BoEs Ei,k , i ∈ 1, N , k ∈ N≥0 , possessing only singleton focal elements, we have probabilistic agent opinions. In this case, the CUE-based opinion update in Definition 5 reduces to the DT dynamic system π (θp )k+1 = Wk π (θp )k , p ∈ 1, M , RN [0,1] , (4) ×N RN [0,1] where π ()k ∈ Wk = {wij,k } ∈ is rowstochastic [33]. When all agents employ receptive updating,   for i = j; αi,k , wij,k = (1 − αi,k )/|Ni,k (εi )|, for j ∈ Ni,k (εi ); (5)   0, otherwise. As in [34], we refer to Wk as the confidence matrix because wij,k represents the weight the i-th agent attaches to the opinion of the j-th agent at time step k. Note that, Wk constitutes the weighted adjacency matrix of Gk† (εε) in (3). We proceed with Proposition 1. In an environment where agents possess probabilistic agent opinions, the opinion of a cautiously updating agent is invariant. Proof. Suppose the i-th agent employs a cautiously updating strategy. Its CUE parameters satisfy (see Definition 6) X X βij (B)k = µij,k mi (A)k ; αi,k + µij,k = 1, j6=i A∈F̂j,k for singletons A, B ∈ Θ. But, for singleton propositions A, B ∈ Θ, Bl(B|A) = 1 only if B = A, and Bl(B|A) = 0 5 otherwise [25]. Using this and the fact that for singletons propositions belief and masses are equal, the CUE-based update in Definition 5 for the i-th agent reduces to mi (B)k+1 = mi (B)k , ∀k ∈ N≥0 . Definition 7 (Left (or Backward) Products). [35] (i) Left Product: The left product of the sequence of matrices {Wk }, Wk ∈ RN ×N , is   for k < `; I, Wk:` = W` , for k = `;   Wk Wk−1 · · · W` , for k > `. (ii) Left-Converging Product: The left product Wk:0 is said to be left-converging if limk→∞ Wk:0 exists, in which case we write W∞ = limk→∞ Wk:0 . Note that the dynamic system in (4) can be expressed as π (θp )k+1 = Wk:0 π (θp )0 . Thus, whenever W∞ exists, lim π (θp )k+1 = W∞ π (θp )0 . k→∞ (6) Clearly, the convergence of the agent opinions depends on the existence and the nature of W∞ . When W∞ exists, let us denote the converged opinion profile for θp as π ∗ (θp ) ∈ RN [0,1] . Consensus (in the sense of Definition 4) is a special case of a converged opinion profile. Lemma 1. The agents form a consensus iff ∃ η = {ηp } ∈ RM [0,1] s.t., π ∗ (θp ) = ηp 1N , ∀p ∈ 1, M , ∀i ∈ 1, N . Proof. Suppose π ∗ (θp ) = ηp 1N , ∀p ∈ 1, M , ∀i ∈ 1, N , for some η = {ηp } ∈ RM [0,1] . This clearly means that limk→∞ Ei,k ≡ E∗ , ∀i ∈ 1, N . Thus, the agents form a consensus. Conversely, if limk→∞ Ei,k ≡ E∗ , ∀i ∈ 1, N , we must clearly have π ∗ (θp ) = ηp 1N , ∀p ∈ 1, M , ∀i ∈ 1, N . The limiting behavior of the stochastic matrix product {Wk } plays a crucial role in consensus analysis when DST BoEs possess only singleton focal elements. Lemma 2. Consider the stochastic chain {Wk }, k ∈ N≥0 , s.t. W∞ = 1 vT for some stochastic vector v ∈ RN [0,1] . Then, T the agents reach the consensus π ∗ (θp ) = (v π (θp )0 ) 1, where π (θp )0 ∈ RN [0,1] denotes the initial opinion profile. Proof. Use (6): limk→∞ π (θp )k+1 = 1 vT π (θp )0 = ηp 1, where ηp = vT π (θp )0 . So, from Lemma 1, we achieve a consensus. 1) No Opinion Leaders: This is the most widely studied scenario and many consensus-related results applicable to this case are available [6], [12], [34], [36], [37]. The work in [34] studied convergence when each element in the stochastic chain {Wk } has positive diagonals. From a graph theoretic viewpoint, this implies that there is a path from each vertex to itself; from an opinion dynamics perspective, this is referred to as having the self-communicating property [34]. 2) Single Opinion Leader: We first introduce Definition 8 (Opinion Dynamics Chain Driven By One Group (1-ODC)). The directed dynamic network Gk† (εε) = (V, Ek† (εε)) in (3) is said to be an opinion dynamics chain driven by one 6 IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS group (1-ODC) if its corresponding confidence matrix Wk in (4) can be expressed as the lower block triangular matrix   Ak 0 Wk = , Ck Dk C ×NC out ×Nout where Ak ∈ RN and Dk ∈ RN , and the other [0,1] [0,1] matrices have compatible sizes. for n ∈ N≥0 . Here, we have used (10). Employing the notation T ∆Pn = Pn − 1Nout vA , n ∈ N≥0 , we express this as T ∆Pn+1 = Cn+1 [An:0 − 1NC vA ] + Dn+1 ∆Pn , n ∈ N≥0 . Then, we may bound k∆Pn+1 − Dn+1 ∆Pn k as |k∆Pn+1 k − kDn+1 ∆Pn k| T ≤ k∆Pn+1 − Dn+1 ∆Pn k = kCn+1 [An:0 − 1NC vA ]k T ≤ kAn:0 − 1NC vA k. † GC,k (ε) Ck T We proceed by noting that limn→∞ An:0 = 1NC vA , where vA is a NC -sized stochastic vector, implies that the agents in VC converges to a consensus (see Lemma 2). Hence, given an arbitrary A > 0, ∃NA ∈ N≥0 s.t. † Gout,k (ε) Fig. 1: An opinion dynamics chain driven by one group (1ODC). One may view an 1-ODC as consisting of a ‘central’ † † component GC,k (εε) = (VC , EC,k (εε)) (with NC agents) and † † another component Gout,k (εε) = (Vout , Eout,k (εε)) (with Nout † agents) s.t. no agent in Gout,k (εε) belongs to the in-component † of GC,k (εε), for any k ∈ N≥0 . See Fig. 1. Note that, Ak and † Dk correspond to the confidence matrices of agents in GC,k (εε) † and Gout,k (εε), respectively. Theorem 1. Consider agents embedded in a 1-ODC employing a CUE-based update strategy. Furthermore, suppose that T C (a) limn→∞ An:0 = 1NC vA , where vA ∈ RN [0,1] is a stochastic vector so that the agents in VC reach their own consensus, and (b) kDk k ≤ ρ < 1, ∀k ∈ N≥0 . Then, the agents in V (i.e., agents in VC and Vout ) reach a consensus at the consensus reached by the agents in VC . Proof. The opinion update strategy yields the dynamic system     π A (θp )k+1 π A (θp )k = Wk , (7) π D (θp )k+1 π D (θp )k where k ∈ N≥0 , θp ∈ Θ, and    Ak 0 An:0 Wk = =⇒ Wn:0 = Ck Dk Pn T kAn:0 − 1NC vA k < A , ∀n ≥ NA . |k∆Pn+1 k − kDn+1 ∆Pn k| < A , ∀n ≥ NA . So, for n ≥ NA , we have k∆Pn+1 k < kDn+1 ∆Pn k + A < ρ k∆Pn k + A , where we use the fact that kDn+1 k ≤ ρ < 1, ∀n ≥ NA . This upper bound for k∆Pn+1 k yields k∆PNA +L k < A L−1 X ρ` + ρL k∆PNA k, L ≥ 0. (8) Pn+1 = Cn+1 An:0 + Dn+1 Pn , P0 = C0 , (9) for n ∈ N≥0 . Due to the row-stochasticity of Wk , we have 1Nout = Ck 1NC + Dk 1Nout , ∀k ∈ N≥0 . (10) T Subtract 1Nout vA from both sides of (9): T Pn+1 − 1Nout vA (13) `=0 We note that lim L→∞ A L−1 X ! ` L ρ + ρ k∆PNA k = `=0 A , 1−ρ i.e., given an arbitrary P > 0, ∃LP ∈ N≥0 s.t. A L−1 X ρ` + ρL k∆PNA k − `=0 A < P , ∀L ≥ LP . 1−ρ Use this in (13): k∆PNA +L k < P + A /(1 − ρ), ∀L ≥ LP . In other words, T lim k∆Pn k = lim kPn − 1Nout vA k = 0. 0 . Dn:0 (12) From (11) and (12), we can obtain the following: given an arbitrary A > 0, ∃NA ∈ N≥0 s.t. n→∞  Here the sub matrices have sizes compatible with Wk . Use Wn+1:0 = Wn+1 Wn:0 to get = Cn+1 An:0 + Dn+1 Pn − (11) n→∞ Using (8) in (7), we get    π A (θp )n+1 An:0 = π D (θp )n+1 Pn 0NC ×Nout Dk:0   π A (θp )0 π D (θp )0 (14) (15) Let us take the consensus among agents in VC as T π ∗A (θp ) = (1NC vA ) π A (θp )0 . T However, from (14), we know that limn→∞ Pn = 1Nout vA . Then, by (15), we can write   ∗    T π A (θp )0 π A (θp ) 1NC vA 0NC ×Nout , (16) = T π ∗D (θp ) 1Nout vA 0Nout ×Nout π D (θp )0 {z } | 1NC +Nout v∗T T 1Nout vA T = Cn+1 An:0 + Dn+1 Pn − [Cn+1 1NC + Dn+1 1Nout ] vA T T = Cn+1 [An:0 − 1NC vA ] + Dn+1 [Pn − 1Nout vA ], where v∗ is a (NC + Nout )-sized stochastic vector created by concatenating the vectors vA and 0Nout ×1 , and T π ∗D (θp ) = 1Nout vA π A (θp )0 . (17) DABARERA, et al.: CONSENSUS IN THE PRESENCE OF MULTIPLE OPINION LEADERS ... Since (16) satisfies the conditions of Lemma 2, all agents in V achieve a consensus. Moreover, as (16) and (17) show, this consensus is the same consensus achieved within VC . An immediate consequence of Theorem 1 is Corollary 1. Consider the network Gk† (εε) = (V, Ek† (εε)) in (3) populated with receptively updating opinion followers and a single cautiously updating opinion leader. Suppose Dk corresponds to the confidence matrix of the receptively updating opinion followers with kDk k ≤ ρ < 1, ∀k ∈ N≥0 . Then, with a CUE-based update strategy, all the agents reach a consensus opinion at the opinion of the opinion leader. † Proof. Construct a 1-ODC as in Definition 8 with GC,k (εε) † containing the opinion leader only and Gout,k (εε) populated with the opinion followers. Proposition 1 implies that VC† (which consists of the only cautiously updating agent) generates a consensus. So, from Theorem 1, all the agents in V reach a consensus at the opinion of the opinion leader. † GC1,k (ε) Ck(1) † Gout,k (ε) Ck(2) † GC2,k (ε) 7 Theorem 2. Consider agents embedded in a 2-ODC employing a CUE-based update strategy. Furthermore, suppose that (1) (2) (a) limn→∞ An:0 = 1NC1 v1T and limn→∞ An:0 = NC2 NC1 T 1NC2 v2 , where v1 ∈ R[0,1] and v2 ∈ R[0,1] are stochastic vectors so that the agents in VC1 and VC2 achieve their own consensus opinions, and (b) kDk k ≤ ρ < 1, ∀k ∈ N≥0 . Then, the following are true: (i) The agents in V (i.e., agents in VC1 , VC2 , and Vout ) reach a consensus iff the consensus opinions of the agents in VC1 and VC2 are equal. (ii) When the consensus opinions of the agents in VC1 and VC2 are not equal, a consensus among the agents in (1) (2) (1) (2) Vout occurs if ∃ λk , λk ∈ (0, 1) s.t. λk + λk = 1 and (1) (1) (2) (2) λk Ck 1NC1 = λk Ck 1NC2 , ∀k ∈ N≥0 . Proof. Note that we may write  (1) A 0  n:0 (2) Wn:0 =  0 An:0 (2) (1) Pn Pn  0  0 , Dn:0 where, for n ∈ N≥0 , (1) (1) (1) (1) = C0 ; (2) (2) (2) (2) = C0 . Pn+1 = Cn+1 An:0 + Dn+1 Pn(1) , P0 Fig. 2: An opinion dynamics chain driven by two groups (2ODC). 3) Two Opinion Leaders: The situation turns out to be significantly more complicated when there are multiple opinion leaders. To look at the two opinion leader case, let us introduce Definition 9 (Opinion Dynamics Chain Driven By Two Groups (2-ODC)). The directed dynamic graph Gk† (εε) = (V, Ek† (εε)) in (3) is said to be an opinion dynamics chain driven by two groups (2-ODC) if its corresponding confidence matrix Wk in (4) can be expressed as the lower block triangular matrix  (1)  Ak 0 0   (2) Wk =  0 Ak 0 . (1) (2) Ck Ck Dk (1) (2) C1 ×NC1 C2 ×NC2 Here, Ak ∈ RN , Ak ∈ R N , and Dk ∈ [0,1] [0,1] Nout ×Nout R[0,1] ; the other matrices have compatible sizes. One may view a 2-ODC as consisting of two ‘central’ † † components GC1,k (εε) = (VC1 , EC1,k (εε)) (with NC1 agents) † † ε ε and GC2,k (ε ) = (VC2 , EC2,k (ε )) (with NC2 agents), plus a † † third component Gout,k (εε) = (Vout , Eout,k (εε)) (with Nout † agents) s.t. no agent in Gout,k belongs to the in-components (1) † † of either GC1,k (εε) or GC1,k (εε). See Fig. 2. Note that, Ak , (2) Ak , and Dk correspond to the confidence matrices of agents † † † in GC1,k (εε), GC2,k (εε), and Gout,k (εε), respectively. We now demonstrate that the agents in even a 2-ODC cannot reach a consensus in general, even though the agents in VC1 and VC2 may have achieved their own consensus opinions. (18) Pn+1 = Cn+1 An:0 + Dn+1 Pn(2) , P0 (1) (2) (19) (i) Suppose the two consensus opinions of the agents in VC1 and VC2 are equal. One may then recast the 2-ODC as a 1DOC with the confidence matrices corresponding  to the central  (1) component and the other component taken as Ak 0 0 Ak (2) and Dk , respectively. Noting that the central component reaches a common consensus opinion, apply Theorem 1 to show that all the agents must reach a consensus which is identical to the common consensus opinion formed within the central component. Conversely, if the two consensus opinions of the agents in VC1 and VC2 are not equal, no consensus is possible among the agents in VC1 and VC2 because these two sets of agents do not update from each other. (ii) Suppose the two consensus opinions of the agents in VC1 and VC2 are not equal. The row stochasticity of Wk implies (1) (2) (1) (2) = Ck 1NC1 + Ck 1NC2 + Dk 1Nout ; 1Nout (2) λk 1Nout = Ck 1NC1 + λk Dk 1Nout , k ∈ N≥0 , (1) (1) (2) (2) (20) (1) where we used λk Ck 1NC1 = λk Ck 1NC2 and λk + (2) λk = 1. Now, proceed as we did in the proof of Theorem 1. (2) Subtract λk 1Nout v1T from both sides of (19) and substitute for 1Nout from (20): (1) (2) Pn+1 − λk 1Nout v1T (1) (1) (2) = Cn+1 [An:0 − 1NC1 v1T ] + Dn+1 [Pn(1) − λk 1Nout v1T ], (1) (1) for n ∈ N≥0 . As before, we use the notation ∆Pn = Pn − (2) λk 1Nout v1T to express this as (1) (1) (1) ∆Pn+1 = Cn+1 [An:0 − 1NC1 v1T ] + Dn+1 ∆Pn(1) , 8 IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS (1) (1) for n ∈ N≥0 . Now, bound k∆Pn+1 − Dn+1 ∆Pn k as B. Dirichlet Agent Opinions (1) |k∆Pn+1 k − kDn+1 ∆Pn(1) k| (1) (1) (1) ≤ k∆Pn+1 − Dn+1 ∆Pn(1) k = kCn+1 [An:0 − 1NC1 v1T ]k (1) ≤ kAn:0 − 1NC1 v1T k, (1) where we used the sub-stochasticity of Cn . Now, as in the proof of Theorem 1, use the fact that the agents in VC1 and VC2 each achieve a consensus to show that lim n→∞ kPn(1) − (2) λk 1Nout v1T k = lim n→∞ kPn(2) − (1) λk 1Nout v2T k = 0. In other words, (2) lim Pn(1) = λk 1Nout v1T ; n→∞ (1) lim Pn(2) = λk 1Nout v2T . n→∞ Denote the consensus among the agents in VC1 and VC2 as π ∗A(1) (θp ) = (1NC1 v1T ) π A(1) (θp )0 ; π ∗A(2) (θp ) = (1NC2 v2T ) π A(2) (θp )0 , respectively. Then we have  ∗     1NC1 v1T 0 0 π A(1) (θp )0 π A(1) (θp ) π ∗ (2) (θp ) =  0 1NC2 v2T 0π A(2) (θp )0 , A (2) (1) ∗ π D (θp )0 π D (θp ) λk 1Nout v1T λk 1Nout v2T 0 where π ∗D (θp ) is given as h T π ∗D (θp ) = 1Nout λ(2) k v1 (1) λk v2T i π A(1) (θp )0  π A(2) (θp )0 . Hence, from Lemma 2, we conclude that the agents in Vout (1) (2) reach a consensus if λk + λk = 1, ∀k ∈ N≥0 . One may interpret this result in the following manner: the (1) (2) matrices Ck and Ck signify the ‘weights’ or ‘bias’ that agents in Vout give to the agents in VC1 and VC2 , respectively. To reach a consensus, each agent in Vout must give the same proportion of weights to the agents in VC1 and VC2 for all (2) (1) k ∈ N≥0 : λk > λk implies that a higher weight is given to the opinions of the agents in VC1 than to the opinions of the agents in VC2 . This might be due to stronger interconnections between the agents in VC1 and Vout or it could simply be due to a bias towards the opinions of the agents in VC1 . As an immediate consequence of Theorem 2 we get Gk† (εε) (V, Ek† (εε)) Corollary 2. Consider the network = in (3) populated with receptively updating opinion followers and two cautiously updating opinion leaders. Suppose Dk corresponds to the confidence matrix of the receptively updating opinion followers with kDk k ≤ ρ < 1, ∀k ∈ N≥0 . Then, with a CUEbased update strategy, the following are true: (i) All the agents reach a consensus iff the opinions of the two opinion leaders are equal. (ii) When the opinions of the opinion leaders are not equal, the opinion followers form an opinion cluster if the proportion of weights each receptively updating agent gives to the two opinion leaders is identical and no opinion leader is given zero weight. Next, let us suppose that agents opinions are modeled via Dirichlet BoEs. Then, using the properties Bl(θi |θi ) = 1, Bl(θi |θj ) = 0, i 6= j, and Bl(B|Θ) = B, ∀B ⊆ Θ, one can easily show that the CUE-based update mechanism in Definition 5 retains the Dirichlet property of the updated BoEs at each step. For this Dirichlet BoE case, the CUE-based opinion update reduces to the following DT dynamic system: π (θp )k+1 = W̆k π (θp )k , p ∈ 1, M . (21) Here π (·)k is as in (4) and W̆k = {w̆ij,k } ∈ RN ×N where w̆ij,k , i, j ∈ 1, N , k ∈ N≥0 . When the i-th agent is receptively updating,  αi,k , for i = j;    (1 − α )(1 + m (Θ) ) i,k j k , for j ∈ Ni,k (εi ); w̆ij,k =  |Ni,k (εi )|   0, otherwise; (22) when the i-th agent is cautiously updating,  1, for i = j;    (1 − α )m (Θ) i,k i k , for j ∈ Ni,k (εi ); (23) w̆ij,k =  |Ni,k (εi )|   0, otherwise. While we may still refer to W̆k as the corresponding confidence matrix, unlike Wk , W̆k is not necessarily stochastic. To proceed, we take inspiration from [31], where it is shown that, under mild conditions, the masses for complete ambiguity Θ vanish when two Dirichlet agents mutually update each other. The same result turns out to hold true for multiple BoEs. Lemma 3. Consider the CUE-based updating of the Dirichlet BoEs as in (21). If X αi,k + βij (Θ)k ≤ ρ < 1, ∀i, j ∈ 1, N , ∀k ∈ N≥0 , j6=i then limn→∞ mi (Θ)n = 0, ∀i ∈ 1, N . Proof. Observe that the update of π (Θ) can be written as π (Θ)k+1 = Γ kπ (Θ)k , where  α1,k  β21 (Θ)k  Γk =  ..  . β12 (Θ)k α2,k .. . β13 (Θ)k β23 (Θ)k .. . ··· ··· .. . βN 1 (Θ)k βN 2 (Θ)k βN 3 (Θ)k ···  β1N (Θ)k β2N (Θ)k   . ..  . αN,k Γk k∞ ≤ ρ < The condition in the statement implies that kΓ 1, ∀k ∈ N≥0 , which guarantees the claim. Note that, each BoE being updated possessing at least one singleton focal element ensures that the condition in Lemma 3 is satisfied, which in turn, ensures that the mass for each completely ambiguous proposition vanishes in the limit. When this occurs, one may show the following results which apply to Dirichlet agents. These are the counterparts to Corollaries 1 and 2 which apply to probabilistic agents. Rigorous proofs of DABARERA, et al.: CONSENSUS IN THE PRESENCE OF MULTIPLE OPINION LEADERS ... Corollary 3. Consider the network Gk† (εε) = (V, Ek† (εε)) in (3) populated with receptively updating Dirichlet opinion followers and a single cautiously updating Dirichlet opinion leader. Suppose that the condition in Lemma 3 is satisfied. Let Dk denote the confidence matrix of the receptively updating opinion followers with kDk k ≤ ρ < 1, ∀k ≥ ND , for some ND ∈ N≥0 . Then all the agents reach a consensus opinion. Corollary 4. Consider the network Gk† (εε) = (V, Ek† (εε)) in (3) populated with receptively updating Dirichlet opinion followers and two cautiously updating Dirichlet opinion leaders. Suppose that the condition in Lemma 3 is satisfied. Let Dk denote the confidence matrix of the receptively updating opinion followers with kDk k ≤ ρ < 1, ∀, k ≥ ND , for some ND ∈ N≥0 . Then, with a CUE-based update strategy, the following are true: (i) All the agents reach a consensus iff the converged opinions of the two opinion leaders are equal. (ii) When the opinions of the opinion leaders are not equal, the opinion followers form an opinion cluster if the proportion of weights each receptively updating agent gives to the two opinion leaders is identical for k ≥ ND and no opinion leader is given zero weight. No Opinion Leaders. Fig. 3(a) shows the network topology of the seven receptively updating agents Ri , i ∈ 1, 7. As the corresponding bifurcation diagram in Fig. 3(b) shows, for smaller values of ε, seven ‘opinion clusters’ are generated because agents are essentially isolated. As the value of ε is increased, the number of opinion clusters decreases because the agents are updating their opinions based on opinions of their neighbors who are within their confidence bounds. Eventually, for ε > 0.46 (approx.), as expected from our analytical results in Section IV-A1, a consensus emerges. 1.0 0.8 DS mass, m(θ1) these results are not provided; they can be carried out in a manner which parallel the proofs of Corollaries 1 and 2. 9 0.6 0.4 0.2 0.0 0.0 (0.017) 0.4 0.6 Confidence bound, ε R2 R1 (0.088) We now present some typical results obtained through extensive simulations of scenarios where agent opinions are captured via p.m.f.s (see Section V-A), Dirichlet BoEs (see Section V-B), and more general DST BoEs (see Section V-C). The results confirm our theoretical analysis in Section IV and demonstrate the applicability of these results for the more general DST models presented in Section III. The agents in all the simulations employ a CUE-based opinion update strategy with αi = 0.50, ∀i ∈ 1, N . The agents’ bounds of confidence are taken as identical, i.e., εi = ε, ∀i ∈ 1, N . Note that, for αi > 0, ∀i ∈ 1, N , and for sufficiently large ε, all agents satisfy the self-communicating or the strong-aperiodic property [34], [37]. Even though being embedded in a static network, the agents must accommodate the bounds of confidence as the opinions are updated. In effect, this creates a dynamic network Gk† (εε). For ease of visualization, consensus/cluster formation are displayed using bifurcation diagrams that depict the state of consensus/cluster formation in the limit density versus ε [12]. A. Probabilistic Agent Opinions For our simulations we embed seven agents on a graph of seven nodes and 100 agents on Erdős-Rényi (ER) random graphs of 100 nodes. 1) Simulations with Seven Agents: The FoD of the opinion BoE of each agent is Θ = {θ1 , θ2 , θ3 }. For the results shown in Figures 3 to 6, initial opinion profile of θ1 is selected as π (θ1 )0 = [0.80, 0.78, 0.76, 0.40, 0.80, 0.10, 0.20]T ; the remaining masses are equally distributed among the opinion profiles π (θ2 )0 and π (θ3 )0 . (0.035) R3 (0.065) (0.329) (0.312) R4 (0.146) (0.346) R5 R3 (0.089) (0.146) R4 (0.52) > ε = 0.5 (0.572) > ε = 0.5 R6 1.0 R2 (0.017) V. E MPIRICAL E VALUATIONS AND D ISCUSSION 0.8 (b) Bifurcation diagram for π (θ1 ). (a) Network topology. R1 0.2 (0.154) R5 (0.421) < ε (0.351) < ε (0.087) R7 (c) For ε = 0.5, first iteration: (R3 , R6 ) and (R5 , R7 ) do not exchange opinions because the corresponding opinion distances are above ε = 0.5. R6 (0.078) R7 (d) For ε = 0.5, second iteration: All neighbor agents exchange opinions because all corresponding opinion distances are below ε = 0.5. Fig. 3: Probabilistic agents: Simulation results for seven receptively updating agents (Ri , i ∈ 1, 7) and no opinion leaders. A consensus occurs for ε > 0.46 (approx.). For ε = 0.5, Figs 3(c) and 3(d) show the ‘directions’ of opinion exchange at the first two iterations. Edge labels indicate the distance between the opinions of the corresponding agent pair. Even though the underlying network topology shown in Fig. 3(a) is static, opinion updating occurs in a dynamic network Gk† (εε). To illustrate this further, consider the case when ε = 0.5. As Fig. 3(c) illustrates, agent pairs (R3 , R6 ) and (R5 , R7 ) do not exchange opinions because their opinion distances exceed the bound of confidence ε = 0.5. However, after the first iteration of opinion exchanges, distances among agents change. As Fig. 3(d) illustrates, the opinion distances of all agents (including (R3 , R6 ) and (R5 , R7 )) are now well within ε = 0.5 and, at the second iteration, all agents exchange opinions with their neighboring agents. Single Opinion Leader. We create this scenario by replacing agent R1 in Fig. 3(a) with a cautiously updating agent C1 10 IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS thus obtaining the graph in Fig. 4(a). For this topology the bifurcation diagram for π (θ1 ) is depicted in Fig.4(b). As before, for smaller values of ε, each agent forms its own ‘opinion cluster’. For larger values of ε, in accordance with Corollary 1, a consensus emerges, and this consensus opinion is the opinion of the opinion leader C1 (viz., m(θ1 ) = 0.80). As Fig. 4(b) indicates, this consensus begins to emerge for ε > 0.46 (approx.). The dynamic nature of opinion exchange in the first three iterations is illustrated in Figs 4(c), 4(d), and 4(e). 1.0 DS mass, m(θ1) 0.8 0.6 0.4 0.2 0.0 0.0 0.6 0.8 1.0 Fig. 5: Probabilistic agents: Simulation results for two opinion leaders (C1 and C7 ) and five receptively updating agents (Ri , i ∈ 2, 6). With the two opinion leaders possessing different opinions, no consensus is achieved. A minimum of 2 opinion clusters are achieved for 0.31 < ε < 0.42 (approx.). There is no consensus among the receptively updating agents. 0.8 DS mass, m(θ1) 0.4 Confidence bound, ε (b) Bifurcation diagram for π (θ1 ). (a) Network topology. 1.0 0.2 0.6 0.4 0.2 0.0 0.0 R2 C1 (0.067) R2 (0.017) R3 (0.312) R4 R5 R3 (0.078) R4 (0.52) > ε = 0.46 (0.572) > ε = 0.46 R6 C1 (0.087) (0.079) R2 (c) For ε = 0.46, first iteration: (R3 , R6 ) and (R5 , R7 ) do not exchange opinions. (0.055) (0.176) (0.091) R5 R3 (0.042) R4 (0.472) > ε = 0.46 (0.459) < ε R7 1.0 (0.029) (0.115) (0.104) (0.346) 0.8 (0.024) (0.329) (0.035) 0.6 (0.027) R5 {C1 , R2 , R3 , R, R5 } and {C7 , R6 } because kE3 − E6 k > ε and kE5 − E7 k > ε, for 0.31 < ε < 0.42 (approx.). The ensuing network generates two opinion clusters at the opinions of the two opinion leaders C1 and C7 . For larger values of ε, some (or all) receptively updating agents get influenced by both opinion leaders which creates different opinion clusters that are influenced by both opinion leaders. (0.456) < ε (0.272) < ε R6 (0.001) R7 (d) For ε = 0.46, second iteration. (R3 , R6 ) now exchange opinions; (R5 , R7 ) still do not exchange opinions. R6 (0.115) R7 1.0 (e) For ε = 0.46, third iteration. All agents exchange opinions with their neighbors. Fig. 4: Probabilistic agents: Simulation results for one opinion leader (C1 ) and six receptively updating agents (Ri , i ∈ 2, 7). A consensus occurs for ε > 0.46 (approx.), at C1 ’s opinion (i.e., m(θ1 ) = 0.80). For ε = 0.46, Figs 4(c), 4(d), and 4(e) show the ‘directions’ of opinion exchange at the first three iterations. Edge labels indicate the distance between the opinions of the corresponding agent pair. Two Opinion Leaders. Here we replaced the two agents {R1 , R7 } in Fig. 3(a) by the cautiously updating agents {C1 , C7 }, respectively. Figs 5(a) and 5(b) show the corresponding network topology and bifurcation diagram for π (θ1 ), respectively. In accordance with Corollary 2, no consensus is reached because the two opinion leaders {C1 , C7 } possess different opinions. With the opinions of two opinion leaders being different, the number of opinion clusters created depends on the bound of confidence ε. For 0.31 < ε < 0.42 (approx.), we observe two opinion clusters, the minimum number of clusters possible. We have achieved this by picking the agent BoEs carefully so that the network separates into two components, each with its own opinion leader, for the aforementioned values of ε. For these values, the network gets separated into two components 0.8 DS mass, m(θ1) (0.017) 0.4 Confidence bound, ε (b) Bifurcation diagram for π (θ1 ). (a) Network topology. C1 0.2 0.6 0.4 0.2 0.0 0.0 (a) Altered topology. 0.2 0.4 0.6 Confidence bound, ε 0.8 1.0 (b) Bifurcation diagram for π (θ1 ). Fig. 6: Probabilistic agents: Simulation results for two opinion leaders (C1 and C7 ) and five receptively updating agents (Ri , i ∈ 2, 6) embedded in a topology that generates a consensus among the receptively updating agents. This consensus appears for ε > 0.43 (approx.). As asserted in Corollary 2, when the two opinion leaders possess different opinions, the receptively updating agents will (1) (2) reach a consensus if the matrices Ck and Ck in Definition 9 (1) (1) (2) (2) satisfy λk Ck 1NC1 = λk Ck 1NC2 , ∀k ∈ N≥0 . Fig. 6(a) shows a network topology which satisfies this condition, and the corresponding bifurcation diagram in Fig. 6(b) shows the emergence of a third opinion cluster around m(θ)1 = 0.50 (approx.) for ε > 0.43 (approx.). 2) Simulations with 100 Agents: Here we embed 100 agents in random graphs of 100 nodes generated using the Erdős-Rényi (ER) random graph model. As is well known, for an ER random graph, the phase transition for network 11 1.0 1.0 0.8 0.8 0.8 0.6 0.4 0.2 0.0 0.0 DS mass, m(θ1) 1.0 DS mass, m(θ1) DS mass, m(θ1) DABARERA, et al.: CONSENSUS IN THE PRESENCE OF MULTIPLE OPINION LEADERS ... 0.6 0.4 0.2 0.2 0.4 0.6 Confidence bound, ε 0.8 1.0 0.0 0.0 (a) No opinion leaders. 0.6 0.4 0.2 0.2 0.4 0.6 Confidence bound, ε 0.8 1.0 0.0 0.0 (b) One opinion leader. 0.2 0.4 0.6 Confidence bound, ε 0.8 1.0 (c) Two opinion leaders. Fig. 7: Probabilistic agents: Simulation results for 100 agents embedded in an Erdős-Rényi random graph with p = 0.10 and agent BoEs sampled from Dir(1, 1, 1). Consensus can be seen in Fig. 7(a) and 7(b), for ε > 0.26 and ε > 0.21, respectively. Bifurcation Diagram 1.0 0.4 0.2 0.8 DS mass, m(θ1 ) 0.6 0.6 0.4 0.2 0.2 0.4 0.6 confidence bound, ε (a) No opinion leaders. 0.8 1.0 0.0 0.0 Bifurcation Diagram 1.0 0.8 DS mass, m(θ1 ) DS mass, m(θ1 ) 0.8 0.0 0.0 Bifurcation Diagram 1.0 0.6 0.4 0.2 0.2 0.4 0.6 confidence bound, ε (b) One opinion leader. 0.8 1.0 0.0 0.0 0.2 0.4 0.6 confidence bound, ε 0.8 1.0 (c) Two opinion leaders. Fig. 8: Dirichlet agents: Simulation results for 7 agents with no opinion leaders, one opinion leader and two opinion leaders embedded in the graphs in Figs 3(a), 4(a), and 5(a) respectively. Consensus can be seen in Fig. 8(a) and 8(b), for ε > 0.51 and ε > 0.5, respectively. connectivity occurs when the edge formation probability p exceeds ln n/n [29]. With n = 100, ln n/n = 0.046 and we used p = 0.10 for generating all our random graphs. Moreover, every random graph was tested for connectedness at initialization. For sufficiently large values of ε, the graph ε) is therefore essentially the same as Gk , and thus it is Gk† (ε) connected as well. The BoE of each agent was sampled from the symmetric Dirichlet distribution Dir(1, 1, 1), which is equivalent to a uniform distribution over the open standard 2-simplex [38]. As Figs 7(a) and 7(b) show, for ε > 0.26 (approx.) and ε > 0.21 (approx.), a consensus appears when there are no opinions leaders and when only one opinion leader is present, respectively. In accordance with Corollary 2, Fig. 7(c) shows that there is no consensus among the 100 agents when the two opinion leaders have different opinions. Fig. 8 shows the corresponding bifurcation diagrams. As is evident, and in consistent with Corollary 3, a consensus can be seen in Figs 8(a) and 8(b) for ε > 0.51 and ε > 0.5, respectively. However, in Fig. 8(c), there is no consensus among the agents. This is consistent with Corollary 4(i) because the cautious agents do not possess the same converged opinion. The minimum number of opinion clusters appear for 0.26 < ε < 0.52 (approx.). Interestingly, even for higher values of ε, no consensus emerges even among the receptive agents. Indeed, one would expect that the receptive agents who are now less restrained to exchange opinions with their neighbors would form an opinion clusters of their own. In contrast, when the agents are embedded in the graph shown in Fig. 6(a), a consensus emerges among the receptive agents for ε > 0.46 (approx.). See Fig. 9. This is because the graph topology in Fig. 6(a) satisfies the condition in Corollary 4(ii). B. Dirichlet Agent Opinions Here, we repeat the experiments conducted with the 7-agent topologies in Section V-A1 but with Dirichlet agent opinions. For all the agents, we kept the same mass vectors π (θ2 )0 and π (θ3 )0 as those in Section V-A1 while we used π (Θ)0 = 0.1; the remaining masses were assigned to π (θ1 )0 . C. General DST Agent Opinions 1) Simulations with Seven Agents: In this study, we assigned random DST mass assignments for the seven agents embedded within the topology in Fig. 6(a). For this purpose, we utilized the Dirichlet distribution which has been widely 12 IEEE TRANSACTIONS ON SIGNAL AND INFORMATION PROCESSING OVER NETWORKS Bifurcation Diagram 0.5 0.2 0.1 0.4 DS mass, m(θ1 ) 0.3 0.3 0.2 0.1 0.2 0.4 0.6 confidence bound, ε 0.8 0.0 0.0 1.0 (a) No opinion leaders. Bifurcation Diagram 0.5 0.4 DS mass, m(θ1 ) DS mass, m(θ1 ) 0.4 0.0 0.0 Bifurcation Diagram 0.5 0.3 0.2 0.1 0.2 0.4 0.6 confidence bound, ε 0.8 0.0 0.0 1.0 0.2 (b) One opinion leader. 0.4 0.6 confidence bound, ε 0.8 1.0 (c) Two opinion leaders. Fig. 10: General DST agents: Simulation results for seven receptively updating agents embedded within the network topology in 6(a) and DST mass values sampled from Dir(4, 4, 4, 2, 2, 2, 1). A consensus appears for the no opinion leader and one opinion leaders cases in Fig. 10(a) and 10(c) for ε > 0.18 (approx.) and ε > 0.17 (approx.), respectively. formed by {R1 , . . . , R5 } converge to the probabilistic opinion {m∗1 (θ1 ), m∗1 (θ2 ), m∗1 (θ3 )} = {0.63, 0.19, 0.18}; the second cluster formed by R6 and R7 converge to the general DST opinion {m∗2 (θ1 ), m∗2 (θ2 , θ3 )} = {0.15, 0.85} which allows no further ‘refinement’ between the singletons θ2 and θ3 . Such emergent behavior is qualitatively different than what appears in prior models [12]–[16]. Bifurcation Diagram 1.0 DS mass, m(θ1 ) 0.8 0.6 0.4 0.2 TABLE I: Initial and Converged Opinions (with ε = 0.30) 0.0 0.0 0.2 0.4 0.6 confidence bound, ε 0.8 1.0 Fig. 9: Dirichlet agents: Simulation results for two opinion leaders (C1 and C7 ) and five receptively updating agents (Ri , i ∈ 2, 6) embedded in the graph in Fig. 6(a) generates a consensus among the receptively updating agents. This consensus appears for ε > 0.46 (approx.). employed in opinion modeling [39]–[41]. In particular, for each agent in each trial, the DST masses for θ1 , θ2 , θ3 , (θ1 θ2 ), (θ1 θ3 ), (θ2 θ3 ), and Θ = (θ1 θ2 θ3 ) were sampled from the Dirichlet distribution Dir(4, 4, 4, 2, 2, 2, 1). Figs 10(a), 10(b), and 10(c) show the bifurcation diagrams when the network contains no opinion leaders, one opinion leader, and two opinion leaders, respectively. As Fig. 10(a) shows, with no opinion leaders, a consensus appears for ε > 0.18 (approx.). Fig. 10(b) shows bifurcation diagram when only one opinion leader is present, and we can see that a consensus appears for ε > 0.17 (approx.). As Fig. 10(c) shows, with two opinion leaders, no consensus is reached among the agents. However, it is interesting to note that three opinion clusters emerge for ε > 0.21 (approx.). As mentioned earlier, the main reason for utilizing the DST framework for capturing agent opinions is its ability to capture the types of uncertainties and the nuances that are characteristic of agent states and opinions. DST agent opinions can also generate new emergent behavior which cannot be captured via probabilistic agents. For example, consider 7 receptive agents embedded within the topology in Fig. 3(a). The initial opinions and the converged opinions for ε = 0.30 appear in Table I. Notice that two opinion clusters have emerged: the first cluster Agent θ1 θ2 DST Mass Values θ3 (θ1 , θ2 ) Initial Opinions: R1 0.60 0.10 0.10 R2 0.62 0.11 0.04 R3 0.51 0.12 0.05 R4 0.57 0.15 0.03 R5 0.60 0.10 0.10 R6 0.10 – – R7 0.20 – – Converged Opinions (with ε = 0.30): {R1 , . . . , R5 } 0.63 0.19 0.18 {R6 , R7 } 0.15 – – (θ2 , θ3 ) 0.10 0.11 0.12 0.15 0.10 – – 0.10 0.12 0.20 0.10 0.10 0.90 0.80 – – — 0.85 VI. C ONCLUSION In this paper, we use the DST framework for representing agent opinions and explore the formation of consensus and opinion clusters when agents residing within a network exchange and update their opinions. In particular, we explore the effect that opinion leaders have on these processes. Our opinion model accounts for aspects from SJT and possesses the ability to capture a wider variety of uncertainties and nuances in agent opinions, an advantage inherited from its DST basis. Theoretical analysis, which focuses on probabilistic and Dirichlet agent opinions, provides conditions for the emergence of consensus and opinion clusters in the presence of opinion leaders. Our results show that a consensus can be formed when the number of opinion leaders is no more than one and with a sufficiently high bound of confidence of the agents. With two or more opinion leaders possessing different opinions, no consensus can be reached in general. We also explore the conditions for opinion cluster formation among the opinion followers. DABARERA, et al.: CONSENSUS IN THE PRESENCE OF MULTIPLE OPINION LEADERS ... Our current work involves extending this theoretical analysis to scenarios where agent opinions are captured via more general DST BoEs, which may require recourse to tools from paracontractions theory [7]. It is also noteworthy that we have taken all agents to possess the identical bound of confidence value. When this is not the case, the opinion exchange mechanism itself would be directional (because an agent with a lower bound of confidence may update itself from its neighbor agent who may not update itself because of a higher bound of confidence value). An interesting future research problem is the study of networked agents whose bounds of confidence values are different. Another interesting issue to be addressed is the assessment of the convergence speed of our algorithms [42]. R EFERENCES [1] R. Olfati-Saber, J. A. Fax, and R. M. Murray, “Consensus and cooperation in networked multi-agent systems,” Proc. IEEE, vol. 95, no. 1, pp. 215–233, Jan. 2007. [2] Z. Qu, J. Wang, and R. A. Hull, “Cooperative control of dynamical systems with application to autonomous vehicles,” IEEE Transactions on Automatic Control, vol. 53, no. 4, pp. 894–911, 2008. [3] L. Xiao, S. Boyd, and S. Lall, “A scheme for robust distributed sensor fusion based on average consensus,” Int. Symp. on Inf. Proc. in Sensor Netw. (IPSN), pp. 63 – 70, Apr. 2005. [4] C. Chamley, A. Scaglione, and L. Li, “Models for the diffusion of beliefs in social networks: An overview,” IEEE Signal Processing Magazine, vol. 30, no. 3, pp. 16–29, May 2013. [5] S. Fortunato, V. Latora, A. Pluchino, and A. Rapisarda, “Vector opinion dynamics in a bounded confidence consensus model,” Int. J. of Modern Phys. C, vol. 16, no. 10, pp. 1535–1551, Oct. 2005. [6] W. Ren, R. W. Beard, E. M. Atkins, and A. G. Theory, “A survey of consensus problems in multi-agent coordination,” Amer. Cont. Conf. (ACC), pp. 1859–1864, 2005. [7] T. Wickramarathne, K. Premaratne, M. Murthi, and N. Chawla, “Convergence analysis of iterated belief revision in complex fusion environments,” IEEE J. of Selected Topics in Sig. Proc., Special Issue on Sig. Proc. for Social Netw., vol. 8, no. 4, pp. 598–612, Aug. 2014. [8] G. Shafer, A Mathematical Theory of Evidence. Princeton Univ. Press, 1976. [9] R. Fagin and J. Y. Halpern, “A new approach to updating beliefs,” Proc. Conf. on Uncertainty in Art. Intell. (UAI), pp. 347–374, 1991. [10] S. Blackman and R. Popoli, Design and Analyis of Modern Tracking Systems. Norwood, MA: Artech House, 1999. [11] T. Wickramarathne, K. Premaratne, M. Kubat, and D. Jayaweera, “CoFiDS: A belief-theoretic approach for automated collaborative filtering,” IEEE Transactions on Knowledge and Data Engineering, vol. 23, no. 2, pp. 175–189, Feb. 2011. [12] J. Lorenz, “Continuous opinion dynamics under bounded confidence: A survey,” Int. J. of Modern Phys. C, vol. 18, no. 12, pp. 1819–1838, Jul. 2007. [13] U. Krause, “A discrete nonlinear and non-autonomous model of consensus formation,” Comm. Diff. Equations, no. 1, pp. 227–236, 2000. [14] R. Hegselmann and U. Krause, “Opinion dynamics and bounded confidence models, analysis and simulation,” J. of Art. Societies and Social Simulation, vol. 5, no. 3, Jun. 2002. [15] G. Deffuant, D. Neau, F. Amblard, and G. Weisbuch, “Mixing beliefs among interacting agents,” Adv. in Complex Syst., vol. 03, no. 04, pp. 87–98, Jan. 2000. [16] G. Weisbuch, “Bounded confidence and social networks,” The European Physical J. B - Condensed Matter, vol. 38, no. 2, pp. 339–343, Mar. 2004. [17] R. Dabarera, R. Nunez, K. Premaratne, and M. Murthi, “Dynamics of belief theoretic agent opinions under bounded confidence,” Int. Conf. on Inf. Fusion (FUSION), pp. 1–8, Jul. 2014. [18] M. Sherif and C. Hovland, Social Judgment: Assimilation and Contrast Effects in Communication and Attitude Change, ser. Yale Studies in Attitude and Communication. Greenwood Pub. Group, Inc., 1980. 13 [19] A. A. Rad, H. Rahmandad, and M. Yahyanejad, “Estimating the dynamics of individual opinions in online communities,” in Proceedings of the International System Dynamics Conference, Delft, 2014. [20] K. Varshney, “Opinion dynamics with bounded confidence in the Bayes risk error divergence sense,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, May 2013, pp. 6600–6604. [21] A. Josang, “Cumulative and averaging fusion of beliefs,” Information Fusion, vol. 11, no. 2, pp. 192–200, Apr. 2010. [22] X. Lu, R. Lu, S. Chen, and J. Lu, “Finite-time distributed tracking control for multi-agent systems with a virtual leader,” IEEE Trans. Circ. and Syst. I: Regular Papers, vol. 60, no. 2, pp. 352–362, Feb. 2013. [23] M. Bauer, “Approximation algorithm and decision making in the Dempster-Shafer theory of evidence—an empirical study,” International Journal of Approximate Reasoning, vol. 17, no. 2/3, pp. 217–237, Aug./Oct. 1997. [24] N. Wilson, “Algorithms for Dempster-Shafer theory,” in Algorithms for Uncertainty and Defeasible Reasoning, ser. Handbook of Defeasible Reasoning and Uncertainty Management Systems, D. M. Gabbay and P. Smets, Eds. Kluwer, 2000, vol. 5, pp. 421–475. [25] T. Wickramarathne, K. Premaratne, and M. Murthi, “Toward efficient computation of the Dempster-Shafer belief theoretic conditionals,” IEEE Transactions on Cybernetics, vol. 43, no. 2, pp. 712–724, Apr. 2013. [26] D. Denneberg, “Conditioning (updating) non-additive measures,” Ann. of Operations Research, vol. 52, no. 1, pp. 21–42, Mar. 1994. [27] A.-L. Jousselme, D. Grenier, and E. Bossé, “A new distance between two bodies of evidence,” Inf. Fusion, vol. 2, no. 2, pp. 91–101, Jun. 2001. [28] A. Martin, A.-L. Jousselme, and C. Osswald, “Conflict measure for the discounting operation on belief functions,” 11th Int. Conf. on Inf. Fusion (FUSION), pp. 1–8, Jun. 2008. [29] M. E. J. Newman, Networks: An Introduction. New York, NY: Oxford University Press, 2012. [30] K. Premaratne, D. A. Dewasurendra, and P. H. Bauer, “Evidence combination in an environment with heterogeneous sources,” IEEE Trans. on Syst., Man, and Cyber. - A: Syst. and Humans, vol. 37, no. 3, pp. 298–309, 2007. [31] K. Premaratne, M. Murthi, J. Zhang, M. Scheutz, and P. Bauer, “A Dempster-Shafer theoretic conditional approach to evidence updating for fusion of hard and soft data,” Proc. Int. Conf. on Inf. Fusion (FUSION), Seattle, WA, pp. 2122–2129, Jul. 2009. [32] J. Dittmer, “Consensus formation under bounded confidence,” Nonlinear Anal.: Theory, Methods & Applicat., vol. 47, pp. 4615–4621, 2001. [33] D. J. Hartfiel, Nonhomogeneous Matrix Products. World Scientific, 2002. [34] J. Lorenz, “Convergence of products of stochastic matrices with positive diagonals and the opinion dynamics background,” in Positive Systems, ser. Lecture Notes in Control and Inform. Sciences. Springer, 2006, vol. 341, pp. 209–216. [35] I. Daubechies and J. C. Lagarias, “Sets of matrices all infinite products of which converge ,” Linear Algebra and its Applicat. , vol. 161, no. 0, pp. 227 – 263, 1992. [36] S. Chatterjee and E. Seneta, “Towards consensus: Some convergence theorems on repeated averaging,” J. of Appl. Probability, vol. 14, no. 1, pp. 89–97, Mar. 1977. [37] B. Touri and A. Nedic, “Product of Random Stochastic Matrices,” IEEE Transactions on Automatic Control, vol. 59, no. 2, pp. 437–448, Feb. 2014. [38] C. M. Bishop, Pattern Recognition and Machine Learning. Secaucus, NJ, USA: Springer-Verlag New York, Inc., 2006. [39] K. Chaloner and G. T. Duncan, “Some properties of the Dirichletmultinomial distribution and its use in prior elicitation,” Communications in Statistics - Theory and Methods, vol. 16, no. 2, pp. 511–523, 1987. [40] E. Regazzini and V. V. Sazonov, “Approximation of laws of multinomial parameters by mixtures of Dirichlet distributions with applications to Bayesian inference,” Acta Applicandae Mathematica, vol. 58, no. 1-3, pp. 247–264, 1999. [41] R. E. Zapata-Vázquez, A. O’Hagan, and L. S. Bastos, “Eliciting expert judgements about a set of proportions,” Journal of Applied Statistics, vol. 41, no. 9, pp. 1919–1933, 2014. [42] A. Olshevsky and J. N. Tsitsiklis, “Convergence speed in distributed consensus and averaging,” SIAM J. Control Optim., vol. 48, no. 1, pp. 33–55, Feb. 2009.
3cs.SY
Ensemble computation approach to the Hough transform arXiv:1802.06619v1 [cs.CC] 19 Feb 2018 Timur M. Khanipov Institute for Information Transmission Problems of the Russian Academy of Sciences (IITP RAS) February 19, 2018 Abstract It is demonstrated that the classical Hough transform with shift-elevation parametrization of digital straight lines has additive complexity of at most O(n3 / log n) on a n × n image. The proof is constructive and uses ensemble computation approach to build summation circuits. The proposed method has similarities with the fast Hough transform (FHT) and may be considered a form of the “divide and conquer” technique. It is based on the fact that lines with close slopes can be decomposed into common components, allowing generalization for other pattern families. When applied to FHT patterns, the algorithm yields exactly the Θ(n2 log n) FHT asymptotics which might suggest that the actual classical Hough transform circuits could smaller size than Θ(n3 / log n). Keywords: Hough transform (HT), fast Hough transform (FHT), additive complexity, ensemble computation, partition tree, summation circuit, digital straight line. 1 Introduction The Hough transform is a well-known procedure in the area of image processing. It is one of discrete analogues of the integral Radon transform and is widely used for solving numerous tasks, the obvious one being line detection. A good (albeit incomplete) review is given in [1], it shows that a variety of techniques may be meant under this term. Here we concentrate on its simplest and most straightforward form which we shall call the classical Hough transform (in [1] it would be named the “standard Hough transform” (SHT) for the case of straight lines). Supposing that an n × n image is a numerical function f = fx,y on Z2 with bounded support {0, 1, ..., n−1} × {0, 1, ..., n−1}, the classical Hough transform HT (f ) maps quantizations L of continuous lines to sums X HT (f ) : L 7→ fx,y . (1) (x,y)∈L Patterns L, also called digital straight lines (DSL) [2], are taken from some specific family L(n), the choice of which defines the particular classical Hough transform type. The total number of all possible DSLs is Θ(n4 ) [3] but in practice |L(n)| = Θ(n2 ) is sufficient providing dense enough covering of continuous lines. Since the case of mostly vertical lines is symmetrical to the case of mostly horizontal lines, w.l.o.g. one can assume that line slopes belong to the interval [0, 1] (the [−1, 0] case is also symmetrical) and consider only the lines which are “mostly horizontal inclined 1 to the right” (i.e. all lines are split into four symmetrical “quadrants”). In this case one of possible L(n) choices would be to take all lines of form   e x + s, e = 0, 1, ..., n − 1, s ∈ Z, (2) Les : y= n−1 i.e. all lines which pass through pairs of integer points (0, s) and (n − 1, s + e), lying on continuations of the left and right image borders. For otherwise line (2) does not intersect with the image, intercept (or shift) s can be assumed to be in (−n, n) ∩ Z, e is called elevation. This elevation-intercept parametrization produces Θ(n2 ) digital straight lines. In fact such splitting of lines into two families is one way of overcoming the issue of slope unboundedness in (2) when the x axis intersection angle approaches π2 [1, section 2.1]. Another possible approach is to use normal line parametrization [4]. Computing the Hough transform (1) for all patterns (2) would require Θ(n3 ) additions when a straightforward independent summation along all lines is used. For performance-heavy applications this complexity might be a critical limitation, raising a natural question of reducing the number of binary operations by a careful choice of the summation order. In general form this task is known as the ensemble computation problem [5], it is more familiar with a different formulation in the boolean circuits theory [6]. The ensemble computation problem is NP-complete [5] making it extremely hard to devise an optimal algorithm. One possible workaround is to use a specific approximation to the Hough transform by replacing digital straight lines (2) with a different ensemble of patterns which would allow recursive computation (see fig. 5). The algorithm constructed in this manner is known (ambiguously) as the fast Hough transform (FHT) and was reinvented several times ([7], [8], [9], [10], [11]). Being extremely convenient for computation, it requires only Θ(n2 log n) summations, so certain lack of attention to this method is surprising (for example, published in 2015 survey [1] does not mention it). Using a specific result about boolean linear operators complexity [6, theorem 3.12] it has recently been proved [12] that neither the classical (2) nor the fast Hough transform can be computed in less than Θ(n2 log n) additions, but non-trivial (o(n3 )) upper bounds were unknown for the classical transform. In this paper we make an improvement in this direction by suggesting a method for n3 building a computational circuit computing the Hough transform in O( log n ) additions. The key idea of the complexity estimation is to combine lines with consequent slopes (elevations) from their common subpatterns, then repeat this for lines with slopes differing by 2 and so forth finally arriving to the ultimate single elevation. It was inspired by the FHT algorithm but is more sophisticated. The method constructs a tree consisting of image partitions with each parent node being a common refinement of its children. An interesting fact is that when applied to the FHT patterns, this tree produces exactly the Θ(n2 log n) circuit with optimal size, suggesting that the complexity of the classical Hough transform computational circuits produces by the proposed algorithm might be smaller than the proven upper bound. As in the case of the FHT, we consider “cyclic” lines from a single quadrant (mostly horizontal inclined to the right). Their “wrapping over image border” property is convenient because it provides a fixed line length and guarantees that every pattern is a function graph defined on the whole domain {0, 1, ..., n − 1}. The general case is of course reduced to this one, see the discussion section. The rest of the paper is organized as follows. Section 2 introduces basic notations and reproduces several useful common facts, section 3 establishes the ensembles framework (not connected with images) and provides the method for constructing computational circuits, section 4 introduces an important concept of span partitions and investigates its properties, section 5 formally defines the 2 Hough ensemble and proves the main complexity estimation theorem, while section 6 analyzes the obtained results and suggests a few directions for further research. 2 Notations and useful common facts We use the following notations for operating with numbers and sets. For t ∈ R symbols ⌊t⌋ and ⌈t⌉ def denote the usual floor and ceiling operations, [t] = ⌊t + 12 ⌋ is rounding to the nearest integer. For p ∈ N = {1, 2, 3, ...} and n ∈ Z we denote by modp (n) or modp n the remainder of dividing n by p, satisfying condition 0 6 modp (n) < p. Symbols ⊂ and ⊃ mean proper set inclusion, while ⊆ and ⊇ allow set equality. A ⊔ B means disjoint union, i.e. C = A ⊔ B if C = A ∪ B and A ∩ B = ∅. Set cardinality is denoted as |A| and 2A is the set of all A subsets. Function f : U → V is an injection if f (x1 ) = f (x2 ) yields x1 = x2 . Injections have the following important easily verifiable property: Proposition 2.1. Injective function f : U → V preserves set structure on U , i.e. for R, S ⊆ U the following statements are true: 1. f (R)f (S) = f (RS), where  ∈ {∩, ∪, ⊔, \}. 2. f (R) f (S) ⇔ R S, where ∈ {=, ⊂, ⊃, ⊆, ⊇}. 3. |f (R)| = |R|. def Any function f : U → V is naturally extended to a function f1 : 2U → 2V by rules f1 (P ) = def {f (x) | x ∈ P } ⊆ 2V for ∅ 6= P ⊆ U and f1 (∅) = ∅. It is usually clear which set the argument belongs to, so by standard practice we use the same symbol f for both cases. This extension can U further be performed for 22 and so forth, if f : U → V is injective then all such extensions are also injective. We actively use the concept of a function graph, so recall the necessary terms. Any function f : U → V induces injective embedding fˆ: U → U × V by the rule def fˆ(x) = (x, f (x)). A graph of function f on a subset A ⊆ U is the set G = fˆ(A) ⊆ A × V . Projection π : U × V → U def def def is defined as π((u, v)) = u. Restriction fˆ0 = fˆ A : A → G is a bijection with fˆ0−1 = π0 = π G . Where it does not lead to confusion, symbols fˆ and π are used in place of fˆ0 and π0 . The following property is obvious yet so useful that we formulate it separately: Proposition 2.2. For two functions f, g : U → V and sets A, B ⊆ U let G = fˆ(A) ∩ ĝ(B). Then the following statements are true: 1. f π(G) =g π(G) . 2. G = fˆ(π(G)) = ĝ(π(G)). 3. π(G) = A ∩ B ∩ X f,g , where X f,g = π(fˆ(U ) ∩ ĝ(U )) = {x ∈ U | f (x) = g(x)}. 3 3 3.1 Ensemble computation Ensembles, partitions and combinations Consider some finite set U which we shall call domain, its subsets will be called patterns. An ensemble on U is a non-empty collection A ⊆ 2U \ {∅} of non-empty patterns. Pattern C is def S A. Ensemble composed (combined) of patterns A and B when C = A ⊔ B. Support supp A = A∈A F A. Partitions have the following A is a U -partition, domain partition or simply partition, if U = A∈A obvious property: Proposition 3.1. If A is a partition and B = is unique. S A∈σ A, σ ⊆ A then B = F A and this presentation A∈σ Partition A is finer than partition B (and B is coarser than A) if any pattern A ∈ A is contained in some pattern B ∈ B (such B is unique because B patterns do not intersect). We also say that A is a refinement of B and denote this partial order relation between partitions as A 4 B or A → B (the latter variant for diagrams). This notation tacitly implies that both ensembles A and B are partitions of the appropriate domain (which in this section is U ). Of course, supp A = U for any partition A and A 4 B yields |A| > |B|. There is one finest partition def U = U ∗ = {{u} | u ∈ U }, (3) i.e. U 4 A for any partition A, so always |A| 6 |U | = |U |. Partition refinement is a fragmentation and vice versa: Proposition 3.2. Let A be a partition. Then ensemble B is a partition and A 4 B iff for any pattern B ∈ B G B= A, (4) A∈α(B) def where α(B) = {A ∈ A | A ⊆ B} ⊆ A and A= G α(B). (5) B∈B Proof. Suppose B is a partition and A 4 B. Then for any A ∈ A there is a unique BA ∈ B such that A ⊆ BA and for all other B ∈ B AF ∩ B = ∅,Fso α(B1 ) ∩ α(B2F ) = ∅ for B1 6= B2 . Any B ∈ B (B ∩ A) = A = A and since any A ∈ A is is decomposed as B = B ∩ U = B ∩ A∈A A∈A A∈α(B) F S α(B). The converse implication proof is even easier. α(B) = contained in some B, A = B∈B B∈B Partition C is a common refinement of partitions A and B if C 4 A and C 4 B. Of course, U is always a common refinement for any two partitions but there is always a unique coarsest common refinement def A ∨ B = {A ∩ B | A ∈ A, B ∈ B} \ {∅} 4 A, B. 4 The ∨ operation is obviously associative and commutative and A 4 B yields A∨B = A. Directly from the definition, |A ∨ B| 6 |A| · |B|. (6) We say that ensemble A combines ensemble B (A, B need not necessarily be partitions) if any pattern F B ∈ B can be combined (possibly in multiple ways) using some patterns from A: A, σ(B) ⊆ A. We denote this relation between ensembles as A ⊲ B. Obviously, B = A∈σ(B) U ⊲ A for any ensemble A. The combination relation is reflexive and transitive: A ⊲ A and from A ⊲ B, B ⊲ C (A ⊲ B ⊲ C for short) follows A ⊲ C. However, it is not antisymmetric and thus is not a partial order: A = {{u}, {v}, {u, v}}, B = {{u}, {v}} is an example of two ensembles which combine each other yet differ. If A ⊲ B then for every pattern B ∈ B we define its combination weight ωA (B) with respect to A as the minimal number of binary ⊔ operations needed to construct B from A patterns: def ωA (B) = min |σ| − 1. Fσ⊆A: A=B (7) A∈σ Consider a binary combination tree of pattern B ∈ B with its n = ωA (B) + 1 leaves being patterns from one of σ0 ⊆ A minimizing the expression above and all levels full except maybe the last one. The depth of such tree is obviously ⌈log2 n⌉. If all its non-leaf nodes are associated with the binary ⊔ operation, such tree represents a possible way of building B using binary disjoint unions and has the minimal depth among all binary trees combining B. This justifies defining pattern combination depth as def dA (B) = ⌈log2 (ωA (B) + 1)⌉. (8) Combination weight ωA (B) and depth dA (B) of ensemble B with respect to A are def ωA (B) = |A ⊲ B| = X ωA (B), B∈B def dA (B) = max dA (B). B∈B ωA (B) is the minimal number of binary ⊔ operations needed to assemble all B patterns from ensemble A patterns directly, i.e. without composing and reusing intermediate patterns. From combination relation and weight and depth definitions directly follow: Proposition 3.3. Any ensemble A combines itself with |A ⊲ A| = dA (A) = 0. Proposition 3.4. If A ⊲ B then 1. |A ⊲ B| 6 |B| · (|A| − 1). 2. For any B ∈ B its combination weight ωA (B) 6 min(|A| − 1, |A ⊲ B|). 3. dA (B) 6 ⌈log2 min(|A|, |A ⊲ B| + 1)⌉. Proposition 3.5. If A ⊲ B, C ⊲ D and P = A ∪ C, Q = B ∪ D then P ⊲ Q and 1. |P ⊲ Q| 6 |A ⊲ B| + |C ⊲ D|. 2. dP (Q) 6 max(dA (B), dC (D)). 5 If (a) supp A ∩ supp C = ∅ or (b) A = C and B ∩ D = ∅, then these inequalities transform to equalities. Corollary 3.6.SIf Ai , Bi are ensembles S S on domains Ui and each Ai ⊲ Bi then for ensembles A = Ai , B = Bi on domain U = Ui : i i i 1. A ⊲ B. 2. |A ⊲ B| 6 P i |Ai ⊲ Bi |. 3. dA (B) 6 max dAi (Bi ). i If (a) domains Ui do not intersect pairwise or (b) all Ai = A and B = transform to equalities. F i Bi , then the inequalities The refinement partial order is stronger than the combination relation: Proposition 3.7. If A 4 B then A ⊲ B and |A ⊲ B| = |A| − |B|. Proof. A ⊲ B follows from (4). By proposition 3.1 with α(B) from proposition 3.2, ωA (B) = |α(B)| P (|α(B)| − 1) = |A| − |B|. - 1 for B ∈ B, so using (5), |A ⊲ B| = B∈B Combination and refinement relations as well as the corresponding weights and depths are preserved by injections: Proposition 3.8. If f : U → V is an injection then 1. A ⊲ B yields f (A) ⊲ f (B) with |f (A) ⊲ f (B)| = |A ⊲ B| and df (A) (f (B)) = dA (B). 2. If A is a U -partition then f (A) is an f (U )-partition and A 4 B yields f (A) 4 f (B). For both cases decomposition structure is preserved, i.e. for every B ∈ B G G f (B) = f (A) ⇔ B = A. A∈γ A∈γ Proof. Follows from proposition 2.1. Obviously, unions of partitions on non-intersecting domains (such unions are of course disjoint) are again partitions and refinement relation is preserved, so from corollary 3.6 follows Proposition 3.9. If Ai , Bi are Ui -partitions each Ai 4 Bi and domains Ui do not intersect pairwise then F F def F 1. Ensembles A = Ai and B = Bi are U -partitions with U = Ui . i i i 2. A 4 B. 3. |A ⊲ B| = P i |Ai ⊲ Bi |. 4. dA (B) = max dAi (Bi ). i 6 3.2 Ensemble computation complexity def Computation chain of length n is a sequence C = A0 ⊲ A1 ⊲ ... ⊲ An−1 ⊲ An . We say that C computes An from A0 and write A0 ω(C) = |A0 C C An . Computation chain weight and depth are defined as def def An | = |A0 ⊲ ... ⊲ An | = def d(C) = n−1 X n−1 X i=0 |Ai ⊲ Ai+1 |, (9) dAi (Ai+1 ). i=0 C Let us say that A computes B and write A B if A B with some chain C. There is a natural interpretation of the computation relation hence its name. Suppose U = {u1 , u2 , ...} and associate each ui ∈ U with a variable containing, for example, integer values. Consider the task of computing n sums X sj = ui , j = 1, ..., n, (10) ui ∈Aj where patterns Aj ∈ A, |A| = n. What is the minimal binary addition operations count needed? We may assume that supp A = U (it does not change operations count because all variables from n P U \ supp A would remain unused). Computing (10) directly takes (|Aj | − 1) = ωU (A) operations j=1 which corresponds to the trivial chain U ⊲ A, here U = U ∗ again as in (3). If, however, we first once calculate certain ui combinations (B) and then reuse them, we might get a smaller operations count corresponding to chain U ⊲ B ⊲ A. If we also compute and reuse combinations of B patterns, we might reduce additions number even further (U ⊲ B ⊲ C ⊲ A). The ultimate question is to find the computation chain C = [U = A1 ⊲ ... ⊲ Am = A] with minimal ω(C), suggesting the following Definition 3.10. Computation complexity of ensemble B with respect to ensemble A is the number µA (B) = |A def B| = min ω(C). C A B If A is omitted, then we presume that A = (supp B)∗ , i.e. the (“internal”) computation complexity of ensemble B is def µ(B) = |(supp A)∗ A|. Proposition 3.11. Suppose B is a U -partition and some ensemble A ⊲ B. Then there is a partition A0 ⊆ A such that A0 4 B and |A0 ⊲ B| = |A ⊲ B|, dA0 (B) = dA (B). Proof. According to (7), for every B ∈ B we canS choose α(B) ⊆ A such that ωA (B) = |α(B)| − 1 F α(B) ⊆ A is also a partition and satisfies the A. Since B is a partition, A0 = and B = B∈B A∈α(B) desired conditions. Proposition 3.12. If partitions A 4 B, then µA (B) = |A| − |B|. C Proof. Suppose µA (B) = |A B| for computation chain C = [A ⊲ A1 ⊲ ... ⊲ Am = B]. We will transform C to C′ without increasing the computation weight so that each C′ element would be a 7 partition refining the next element. We start from the last pair Am−1 ⊲ Am . By proposition 3.11 there is a partition A′m−1 ⊆ Am−1 such that A′m−1 4 Am and |A′m−1 ⊲ Am | = |Am−1 ⊲ Am |. Obviously, still Am−2 ⊲ A′m−1 with |Am−2 ⊲ A′m−1 | 6 |Am−2 ⊲ Am−1 |, so the computation chain C1 with Am−1 changed to A′m−1 is still valid and its weight is not greater than that of C. Continuing in this manner by replacing Am−2 and etc., we will get computation chain C′ consisting of partitions with ω(C′ ) 6 µA (B). Since C has minimal possible weight, ω(C′ ) = µA (B) The statement then follows from (9) and proposition 3.7. 3.3 The classical ensemble computation problem and circuits complexity This section briefly establishes a connection between the the concept of computation complexity introduced in definition 3.10, the classical ensemble computation problem and the concept of additive circuit complexity. The ensemble computation problem is NP-complete and formulated as follows [5]. Given a collection A of U subsets and some number c ∈ N, is there a sequence z1 = x1 ⊔ y1 , z2 = x2 ⊔ y2 , ..., zn = xn ⊔ yc of n 6 c disjoint unions, where each xi , yi is either {u} for some u ∈ U or zj for some j < i, and for any A ∈ A there is some zj = A? In other words, one asks, whether an ensemble of A can be obtained from U = {{u} | u ∈ U } using not more than c disjoint union operations. An equivalent formulation originates from the circuits theory [13]. Suppose U = {ui } represents a set of number-valued variables, A = {Aj } ⊆ 2U and we need to compute all sums (10) using a circuit, i.e. an acyclic directed graph which has exactly |U | fanin-0 nodes ui , exactly |A| fanout-0 nodes Aj and other nodes representing the + operation (performing summation over its input edges and distributing the result over its output edges). What is the minimal size of such circuit? When restricted to using only fanin-0,1,2 nodes and after defining the circuit size to be the number of its fanin-2 nodes, we come to the classical ensemble computation problem. Remark 3.13. This is one of several possible circuit complexity definitions. One may also count the number of edges and consider unlimited fanin nodes and use different binary operations set [6]. It is obvious, that if the complexity defined in section 3.2 for ensemble A µ(A) = n, then the classical ensemble computation problem (and, hence, the corresponding minimal circuit complexity) does not exceed n. Indeed, take the computation chain C = [U = C0 ⊲ C1 ⊲ ... ⊲ Cd = A], such that C U A and ω(C) = n. We should simply transform every segment Ck ⊲ Ck+1 of the computation chain into a set of |Ck+1 | binary combination trees computing patterns from Ck+1 (see the paragraph right above (8)) and then join them for k = 1, 2, ..., d. The resulting circuit will have exactly n disjoint union nodes by µ(A) definition. The reverse is also true. Take the minimal circuit computing A. We can always transform it so that the distance (number of edges in a connecting path) any output node and all its input (fanin-0) nodes is exactly d, where d is the maximal such distance in the original circuit (its depth), and that the number of fanin-2 nodes does not change. We can then define ensembles Ck , consisting of nodes which have distance from the input nodes exactly k. Obviously, U = C0 ⊲ C1 ⊲ ... ⊲ Cd = A with the weight equal to the number of fanin-2 nodes. 3.4 Partition trees Proposition 3.14. Suppose A and B are U -partitions. Then µ(A ∪ B) 6 µ(A) + µ(B) − µ(A ∨ B) = |U | + |A ∨ B| − |A| − |B|. 8 (11) Proof. Consider computation chain C = U ⊲ A∨B ⊲ A∪B. By proposition 3.5, |A ∨ B ⊲ A ∪ B| 6 |A ∨ B ⊲ A| + |A ∨ B ⊲ B| = 2 · |A ∨ B| − |A| − |B|, so ω(C) = |U ⊲ A ∨ B|+|A ∨ B ⊲ A ∪ B| 6 |U |−|A∨B|+2·|A∨B|−|A|−|B| = µ(A)+µ(B)−µ(A∨B), the last equality follows from proposition 3.12. Proposition 3.14 shows that the cost of simultaneously computing two partitions A and B is at least by µ(A ∨ B) smaller than the weight of the A A∨B trivial chain U ⊲ A ∪ B, so the smaller |A ∨ B|, the better is the two-step U B chain U ⊲ A ∨ B ⊲ A ∪ B. Given some thought, it seems obvious. Indeed, we can efficiently compute A and B when they have many patterns with big intersections – we first combine the intersections and then assemble the rest. Suppose now that our computation target is a union of four partitions: T = A ∪ B ∪ C ∪ D. In a similar manner we could arrange U T computation in a hierarchical order (recall that notation A → B is equivalent to A 4 B) in many ways, for example as in fig. 1. This tree corresponds to A U A∨B∨C∨D A∨B C C∨D B D Figure 1: One of possible combination orders for U A ∪ B ∪ C ∪ D. chain C = U ⊲ A ∨ B ∨ C ∨ D ⊲ (A ∨ B) ∪ (C ∨ D) ⊲ T . Using the same technique as above, based on propositions 3.5 and 3.12, we get the following bound: µ(T ) 6 µ(A) + µ(B) + µ(C) + µ(D) − µ(A ∨ B ∨ C ∨ D) − µ(A ∨ B) − µ(C ∨ D), (12) or, using cardinalities, µ(T ) 6 |U | + |A ∨ B ∨ C ∨ D| + |A ∨ B| + |C ∨ D| − |A| − |B| − |C| − |D|. (13) It means that this particular order is good when each pair A, B and C, D has a lot of well intersecting patterns. In a different case another order might be more efficient. Inserting the A ∨ B ∨ C ∨ D node between U and the rest cannot spoil anything: when A ∨ B ∨ C ∨ D = U (the worst case), the inequality transforms to µ(T ) 6 2|U | + |A ∨ B| + |C ∨ D| − |A| − |B| − |C| − |D|, corresponding to a shorter diagram with A ∨ B ∨ C ∨ D replaced by U . def S These examples can be generalized using the concept of partition trees. Call L = Li a i partition-union ensemble if all Li are partitions. A binary partition tree T is a binary tree rooted at U where each node is a partition which refines its children. T computes partition-union ensemble T L if its leaves are exactly Li , in this case we write U L. No additional restrictions on tree structure are imposed — some nodes might have one child and leaves may reside at different levels. Remark 3.15. Any ensemble A can be extended to a partition-union ensemble by adding |A| complement patterns U \ A, A ∈ A. This number can be reduced if we group non-intersecting patterns of A. 9 L4 U S0 D1 D2 L0 L1 D0 L3 L2 Figure 2: Partition tree of depth 4 computing five partitions Li . Nodes of one type are numbered right to left because we build such trees starting from leaves. Let us define weight of an edge A → B as |A ⊲ B| = |A| − |B| (proposition 3.7) and the tree weight ω(T) as the sum of all edges weights: def ω(T) = X A→B (|A| − |B|). Suppose cumulative level ensemble Rk is a union of all partition nodes up to level k, so for the example in fig. 2, R0 = U , R1 = U ∪ L4 ∪ D2 , R2 = R1 ∪ D1 ∪ L3 , R3 = R2 ∪ S0 ∪ D0 , R4 = R3 ∪ L0 ∪ L1 ∪ L2 . The computation chain c(T) associated with tree T is def c(T) = [U = R0 ⊲ R1 ⊲ ... ⊲ Rd−1 ⊲ L], where d is tree depth (number of edges in a longest path). The chain is valid (indeed a computation chain) by corollary 3.6 applied to every segment Rk−1 ⊲ Rk . The last segment Rd−1 ⊲ L is valid because Rd−1 ⊲ Rd and L ⊆ Rd , so Rd−1 ⊲ L and |Rd−1 ⊲ L| = |Rd−1 ⊲ Rd |. By this same corollary, ω(c(T)) 6 ω(T), implying µ(L) 6 ω(T). (14) These facts make the term “T computes L” more clear. We define tree computation depth (not to be confused with ordinary depth d) as the depth of its associated chain: def d(T) = d(c(T)). The tree computation depth may not necessarily be equal to the depth of the longest chain U ⊲ P1 ⊲ ... ⊲ Pd . There may be a depth-1 branch U ⊲ P which has greater computational depth than any other branch because one of the patterns in P needs very many U components to be constructed. Proposition 3.16. If a binary tree T nodes are labeled with numbers and every edge α → β is assigned weight β − α, then the sum of all edge weights X X X (α − β) = ρ + δj − λi , (15) j α→β i where ρ is the root label, λi are leaves labels and δj are labels of nodes with exactly two children. Proof. For convenience we denote nodes and the corresponding labels by the same symbol. Let us use induction over tree depth d. Induction base d = 0 is obvious, both sides of the equality are zero. Suppose now it is valid for all trees with depth d and consider a tree with depth d + 1. If its root ρ has only one child ρ′ , then we apply the induction hypothesis to subtree rooted at ρ′ . It has the same 10 P P set of leaves and two-children nodes, so the new weight is expressed as (ρ − ρ′ ) + (ρ′ + j δj − i λi ) which transforms to (15) for the new root. Suppose now that root ρ has two children, ρ′ and ρ′′ and the corresponding subtrees have leaves and two-children nodes λ′k , δl′ and λ′′m , δn′′ resp. By induction hypothesis the new weight is X X X X (ρ − ρ′ ) + (ρ′ + δl′ − δn′′ − λ′′m ) = λ′k ) + (ρ − ρ′′ ) + (ρ′′ + l ρ + (ρ + X δl′ + l After noting that {λi } = {λ′k } n k ∪ {λ′′m } X n m X X δn′′ ) − ( λ′k + λ′′m ). m k and {δj } = {ρ} ∪ {δl′ } ∪ {δn′′ } we get (15). Proposition 3.17. For any binary tree the number of leaves is the number of two-children nodes plus one. Proof. Use the same tree depth induction technique as for for (15). Corollary 3.18. If a binary partition tree T computes partition-union ensemble L = nodes (partitions) with exactly two children are Dj , then X X X X ω(T) = |U | + |Dj | − |Li | = µ(Li ) − µ(Dj ). j i i S i Li and its j Due to (14), this equality generalizes (11), (12) and (13). Proof. The first equality directly follows from (15). The second one follows from propositions 3.17 and 3.12. 3.5 Algorithms for building trees Corollary 3.4 naturally suggests a greedy approach for building a binary partition tree (and hence the associated computation chain), see algorithm 1 which computes partition-union ensemble L = E−1 S Li consisting of E partitions and hopefully has weight smaller than the trivial chain U ⊲ L i=0 has. Data: partition-union ensemble L = ∪Li T Result: partition tree T such that U L Q := {L0 , ..., LE−1 } while |Q| > 1 do Take distinct A, B ∈ M with minimal |A ∨ B| C := A ∨ B Q := Q ∪ {C} \ {A, B} Create node C with edges C → A and C → B end Create root U and edge U → A0 for the single remaining A0 ∈ Q Algorithm 1: Greedy construction of a partition tree computing L. 11 One flaw of this algorithm is a lack of tree depth control. Another flaw is its complexity. The most costly procedure here is the computation of |Q|− 2 common refinement cardinalities |C ∨ X |, X ∈ Q after removing A, B but before adding C. The loop is executed E−1 times, so with a straightforward implementation Θ(E 2 ) refinements should be computed in total, which might be too much. Should this be the case or if some a priori information is known about the initial Li partitions, a fixed order based on this information might be used. A trivial order would be to arrange the Li partitions sequentially, refine the consequent pairs and repeat this procedure until a single partition is left, then connect it with U . Precisely this method works with the Hough patterns because with the natural elevation numbering consequent lines have small |A ∨ B| (see (19)). See algorithm 2 and its sample output in fig. 3. The total number of partition refinements here is E − 1 which a lot better than Θ(E 2 ). Data: partition-union ensemble L = ∪Li T Result: depth ⌈log2 E⌉ + 1 partition tree T such that U L for i := 0 to E − 1 do L0i := Li end k := 1 // currently constructed level prev level size := E while prev level size > 1 do i := 0 // new nodes with two children while 2i + 1 < prev level size do k−1 k−1 ∨ L2i+1 Lki := L2i k−1 k−1 Create node Lki with edges Lki → L2i and Lki → L2i+1 i := i + 1 end if 2i < prev level size then // the last new node has only one child k−1 Lki := L2i k−1 Create node Lki with edge Lki → L2i end k := k + 1 prev level size := i + 1 end Create root U and edge U → L0k−1 Algorithm 2: Building a depth ⌈log2 E + 1⌉ partition tree computing L by a predefined order. All Lki reside on the same level, let us denote their number as Ek and the number of Lki having two children (i.e. created inside the inner loop) as Ek∗ 6 Ek . In the beginning of every iteration of the outer loop prev level size = Ek−1 and the inner loop makes Ek∗ iterations. The distribution of single-child nodes depends on the binary representation of E but it is guaranteed that for any k it can only be the last node Lki (i.e. with the biggest possible i).     Proposition 3.19. Ek = 2Ek and Ek∗ = 2Ek . j ∗k l m E ∗ = 2k . Proof. Ek and Ek∗ obviously satisfy recurrence relations Ek+1 = E2k and Ek+1 l m   For any R ∋ t > 0 holds ⌈t⌉ = 2t . Indeed, case t ∈ Z is trivial, for other t use representation 2 t = ⌊t⌋ + {t}, 0 < {t} < 1 and consider cases of ⌊t⌋ being odd or even. The first formula follows 12 L00 = L0 L10 L01 = L1 L20 L30 U L02 = L2 L11 L21 L03 = L3 L04 = L4 L12 L05 = L5 Figure 3: Partition tree constructed by algorithm 2 to compute ensemble L0 ∪L1 ∪L2 ∪L3 ∪L4 ∪L5 . from this fact and jthe krecurrence relation by induction. The same proof works for the second one   = 2t . using the equality ⌊t⌋ 2 Corollary 3.20. The partition tree constructed by algorithm 2 has depth ⌈log2 E⌉ + 1. We can finally formulate the important statement for estimating the Hough patterns complexity. Lemma 3.21. Suppose the cardinalities of one level nodes Lki of the partition tree T constructed E−1 S by algorithm 2 for ensemble L = Li are bounded by a sequence ak : i=0 max|Lki | 6 ak , k = 0, 1, ..., ⌈log2 E⌉, i Then the tree weight ⌈log2 E⌉ X X ak E−1 |Li |, − k 2 ω(T) 6 |U | + E i=0 k=1 and the computational depth (16) ⌈log2 E⌉ d(T) 6 log2 |U | + X log2 ak . (17) k=1 Proof. The first statement follows from corollary 3.18 and proposition 3.19 after noting that Ek∗ 6 |E| . The second statement follows from proposition 3.4 applied to all edges Lki → Ljk−1 and 2k corollary 3.6 applied sequentially to consecutive unions of single-level partitions. 4 Ensembles and partitions on images 4.1 Image, shifts and spans def def Image of width w ∈ N and height h ∈ N is a set I = X ×Y = {px,y = (x, y) | x ∈ X, y ∈ Y } ⊂ R2 of def def |I| = w·h elements px,y called pixels, where X = {0, 1, ..., w−1}, Y = {0, 1, ..., h−1}. We consider numbers w and h fixed. Image subsets are also called patterns. Here and further projection is a def function π : I → X, π(px,y ) = x. The finest image partition I of course consists of pixel-singletons: def I = {{p} | p ∈ I}. 13 def Additive commutative group Z acts on I by (vertical) shifts according to the rule px,y + s = px,modh (y+s) for shift s ∈ Z. This action also induces action on patterns: def P + s = {p + s | p ∈ P }, supposing ∅ + s = ∅, and functions F : X → I: def (F + s)(x) = F (x) + s. Projection function π is obviously shift-invariant: for any P and s ∈ Z, π(P + s) = π(P ). For both cases we denote shift orbit as def hzi = {z + s | s ∈ Z} = {z + s | s ∈ Y }. Shift span of ensemble A on I is the set of A ∈ A patterns shifted to all possible positions (i.e. the union of pattern orbits): def [A] = [ A∈A hAi = {A + s | A ∈ A, s ∈ Y }. Obviously, [{A}] = hAi for any pattern A. Remark 4.1. As any group action, shifts on I and 2I are bijections, hence injections and proposition 2.1 statements also hold for shifts (with f (x) = x + s). 4.2 Function equality sets Definition 4.2. For any two functions f, g : X → Y and n ∈ Z, n-equality set Xnf,g is defined as def Xnf,g = {x ∈ X | ĝ(x) = fˆ(x) + n} = {x ∈ X | modh (g(x) − f (x) − n) = 0}. f, g-equality partition is ensemble def X f,g = {Xnf,g | n ∈ σ(f, g)} with the f, g-equality index set def σ(f, g) = {n ∈ Y | Xnf,g 6= ∅}. This definition can be visualized as cutting graph ĝ(X) by consequent slices fˆ(X), fˆ(X) + 1, fˆ(X) + 2, ... and taking projections. By projection shift-invariance property, Xnf +s,g+s = Xnf,g . The X f,g definition is consistent by the following Proposition 4.3. X f,g is always an X-partition, i.e. G X= Xnf,g . n∈σ(f,g) Proof. For any x ∈ X ĝ(x) = fˆ(x) + n with n = modh (g(x) − f (x)), so by definition x ∈ Xnf,g f,g ˆ implying suppX f,g = X. Suppose now x ∈ Xnf,g 1 ∩Xn2 , n1 , n2 ∈ Y . Then by definition, f (x)+n1 = fˆ(x) + n2 which is possible only when n1 = n2 if both n1 , n2 ∈ Y . 14 Proposition 4.4. Restrictions g B = (f + n) B for any B ⊆ Xnf,g . Proof. Immediately follows from Xnf,g definition. Proposition 4.5. For any set A ⊆ X g(A) = G f (A ∩ Xnf,g ) + n. n∈σ(f,g) Proof. Follows from decomposition g(A) = g(A ∩ X) = g(A ∩ proposition 4.4, σ = σ(f, g). F Corollary 4.6. ĝ(X) = F Xnf,g ) = n∈σ F n∈σ g(A ∩ Xnf,g ) by (f (Xnf,g ) + n). n∈σ(f,g) 4.3 Partition spans We will now investigate how span operation interacts with domain X-partitions via functions X → Y . The first obvious property allows to “span” I-partitions from X-partitions using a graph function: Proposition 4.7. If f : X → Y and A is an X-partition, then 1. [fˆ(A)] is an I-partition. 2. π([fˆ(A)]) = A. 3. |[fˆ(A)]| = h · |A|. [fˆ(A)] is a partition span or a span partition and fˆ is a spanning function. Proof. By proposition 3.8, slices Qs = fˆ(A) + s, s ∈ YF are partitions in Qs = supp Qs = f (X) + s. Qs = I and statement 1 and 3 follow from Supports Qs obviously do not intersect pairwise, so s∈Y proposition 3.9. Statement 2 follows from π(Q0 ) = π(fˆ(A)) = A, shift-invariance of projection and S Qs . Q= s∈Y Proposition 4.8. If f : X → Y and X-partitions A 4 B, then [fˆ(A)] 4 [fˆ(B)] and F A corresponds 1. Decomposition structure on every slice is the same as in A 4 B, i.e. B = A∈α F ˆ f (A) + s for any shift s, α = α(B) ⊆ A is the unique B decomposition to fˆ(B) + s = A∈α from proposition 3.2. 2. |[fˆ(A)] ⊲ [fˆ(B)]| = h · (|A| − |B|). 3. d[fˆ(A)] ([fˆ(B)]) = dA (B). Proof. The fact that [fˆ(B)] is an X-partition and the computation weight equality follow from propositions 3.7 and 4.7. Suppose P ∈ [fˆ(B)], F so P = fˆ(B) + some B ∈ B and shift s. Since Fs for F (fˆ(A) + s), where each component A) + s = A, so P = fˆ( A 4 B, we decompose B = A∈α A∈α A∈α is an element of [fˆ(A)]. This proves [fˆ(A)] 4 [fˆ(B)] and provides decomposition structure on slices. 15 Proposition 4.9. For any shifts s1 , s2 and sets A, B ⊆ X (fˆ + s1 )(A) ∩ (ĝ + s2 )(B) = (fˆ + s1 )(C) = (ĝ + s2 )(C), where C = A ∩ B ∩ Xsf,g . 1 −s2 Proof. It immediately follows from proposition 2.2 after noticing that Xsf,g = {x ∈ X | (fˆ + 1 −s2 s1 )(x) = (ĝ + s2 )(x)}. Corollary 4.10. For any X-partitions A and B [fˆ(A)] ∨ [ĝ(B)] = [fˆ(C)] = [ĝ(C)], where C = π([fˆ(A)] ∨ [ĝ(B)]) = A ∨ B ∨ X f,g . This corollary says that the common refinement of two span-partitions is also a span-partition with its spanning function being either of the two spanning functions used. It also shows that to construct this common refinement one may perform a one-dimensional ∨ procedure with mixing in an additional component, equality set of the span functions. This is much easier than building a refinement directly in I. The next corollary helps visualize it as well as better understand the nature of X f,g : Corollary 4.11. hfˆ(X)i ∨ hĝ(X)i = [fˆ(X f,g )] = [ĝ(X f,g )] and 5 X f,g = π(hfˆ(X)i ∨ hĝ(X)i). The Hough ensemble 5.1 Definition and basic properties We now arrived to the primary target of our research – the Hough patterns. Consider the following def base functions fe : X → Y with the number e ∈ E = {0, 1, 2, ..., |E| − 1} called elevation:   e def x . (18) fe (x) = modh w−1 The term “elevation” originates from the fact that without the modulo-operation the fe graphs would be elevated by e pixels at the image border comparing to the origin, i.e. they would pass through points (0, 0) and (w − 1, e). Definition 5.1. The Hough ensemble or the ensemble of discrete lines is the partition-union enS ˆ def hfe (X)i. semble L = [fˆe ({X}) | e ∈ E] = e∈E By proposition 4.7, every def Le = hfˆe (X)i = [fˆe ({X})] is an I-partition of size h, consisting of parallel lines with the same elevation. We say that any pattern fˆe (X) + s ∈ Le is a line with elevation e and shift s. If Le do not intersect pairwise, i.e. all line patterns with various elevations are distinct, then |L| = |E| · h. 16 This is always the case when |E| 6 h since every value fe (w − 1) would be unique. Anyway, in all cases |L| 6 |E| · h. Our point of interest is to find a non-trivial bound for µ(L). The trivial bound follows from I ⊲ L by corollary 3.6 and propositions 3.7, 4.7: µ(L) 6 |E| · h · (w − 1). To get a better result we will use one nice property of the Hough patterns – as elevations difference decreases, lines similarity grows. Proposition 5.2. For any two elevations e1 , e2 |X e1 ,e2 | 6 |e1 − e2 + 1|, here and further we for short use notations def def fe ,fe2 Xne1 ,e2 = Xn 1 X e1 ,e2 = X fe1 ,fe2 , . Proof. Assume that e2 > e1 (always |X f,g | = |X g,f |) and denote linear X → R functions ge (x) = e w−1 x, so fe (x) = modh [ge (x)]. One can easily see that for any x ∈ X ge1 (x) 6 ge2 (x) 6 ge1 (x) + e2 − e1 . Since t 6 t′ yields [t] 6 [t′ ] and [t + s] = [t] + s for t, t′ ∈ R, s ∈ Z we get [ge1 (x)] 6 [ge2 (x)] 6 [ge1 (x)] + e2 − e1 . This implies that for any x0 ∈ X, [ge2 (x0 )] = [ge1 (x0 )]+n(x0 ) and, hence, fe2 (x0 ) = modh (fe1 (x0 )+ e1 ,e2 n(x0 )) where n(x0 ) ∈ {0, 1, ..., e2 −e1 }, which by definition means that x0 ∈ Xn(x . The proposition 0) statement follows from proposition 4.3 and the fact that n(x0 ) takes e2 − e1 + 1 values. Corollary 5.3. For any elevation e > 0 the Hough ensemble has |X e−1,e 6 2|. (19) This corollary is illustrated in fig. 4: elevation-5 line (dark circles) is contained in two consecutive elevation-4 lines (variously shaded cells), generating the two-element X-partition X 4,5 = {X04,5 , X14,5 }. fˆ4 (X): elevation 4, shift 0 fˆ4 (X) + 1: elevation 4, shift 1 fˆ5 (X): elevation 5, shift 0 X 4,5 : X04,5 X14,5 Figure 4: Equality partition for elevations 4 and 5 on an image of width 15. 17 5.2 Building the partition tree and X domain reduction By definition, Hough patterns L is a partition-union ensemble consisting of I-partitions Le and we can apply algorithm 2 to build the corresponding partition tree. Let’s assume l m that its produced k . nodes are again denoted as Li , k = 0, 1, ..., ⌈log2 |E|⌉, i = 0, 1, ..., Ek = |E| 2k We say that Lki covers elevation e if node Le = L0e resides in the subtree rooted at Lki . Obviously, for a fixed k nodes Lki cover consequent intervals each consisting of 2k consequent numbers, except maybe the last i = Ek − 1 which may cover fewer elevations (only one in the worst case for |E| = 2n + 1, n ∈ N). If we denote the covering set of node Lki as C(k, i), then def C(k, i) = {i2k , i2k + 1, i2k + 2, ..., i2k + 2k − 1} ∩ E. Of course, for Lki having two children, C(k, i) = C(k − 1, 2i) ∪ C(k − 1, 2i + 1) and if Lki has one child, then C(k, i) = C(k − 1, 2i). By design of the algorithm and the ∨ operation associativity and commutativity, _ _ _ Le = [le ({X})] = hle (X)i . (20) Lki = e∈C(k,i) e∈C(k,i) e∈C(k,i) Proposition 5.4. All Lki are span-partitions with span functions le for any e ∈ C(k, i): Lki = [le (Pik )], where def Pik = π(Lki ). Proof. It follows from (20) by applying corollary 4.10 multiple times. Proposition 5.5. For any Lki having to children (i.e. when i < Ek∗ ) and any e1 ∈ C(k−1, 2i), e2 ∈ C(k − 1, 2i + 1) holds k−1 k−1 Pik = π(Lki ) = P2i ∨ P2i+1 ∨ X e1 ,e2 . (21) If Lki had no children then k−1 . Pik = P2i (22) Proof. The second part of the statement is obvious, so let’s concentrate on the first one. By k−1 k−1 k−1 k−1 two-children assumption, Lki = L2i ∨ L2i+1 = [le1 (P2i )] ∨ [le2 (P2i+1 )] for any e1 ∈ C(k − 1, 2i), e2 ∈ C(k − 1, 2i + 1) (proposition 5.4). The first statement then immediately follows from corollary 4.10. This proposition means that domain X projection partitions Pik can be retrieved independently of Lki by assuming Pe0 = {X} for all e ∈ E and using (21) or (22). Pik also form a partition tree with the structure identical to the one generated by algorithm 2. The Lki partitions can in turn be obtained from Pik using the spanning procedure. It effectively reduces the complex task of getting a common refinement of two Lki -sets to constructing the common refinement of the two corresponding Pik sets with one additional component, an equality set, mixed in. The arbitrary choice of e1 and e2 allows us to get a convenient bound on |Pik |. Proposition 5.6. For all k and i k −1 |Pik | 6 min(22 18 , w). (23) k−1 k−1 Proof. By proposition 5.5, either Pik = P2i ∨ P2i+1 ∨ X e1 ,e2 , with e1 ∈ C(k − 1, 2i), e2 ∈ C(k − k−1 1, 2i + 1), or Pik = P2i . For the first case we may always choose e1 and e2 so that e2 = e1 + 1, k−1 explicitely e1 = 2i · 2 + 2k−1 − 1 is the greatest element of C(k − 1, 2i) and e2 = e1 + 1 is the smallest element of C(k − 1, 2i + 1). With such choice, using (6), we have |Pik | 6 2(max|Pjk−1 |)2 , j k−1 which is of course also true for the second case Pik = P2i . Since |Pi0 | = |{X}| = 1 for all i and e ,e k X 1 2 6 2 by (19), |Pi | is bounded by sequence ck defined as c0 = 1, ck = 2c2k−1 . One can verify k that ck = 22 −1 . Inequality |Pik | 6 w is trivial, as Pik is an X-partition. Using proposition 4.7 we deduce Corollary 5.7. For all k and i k −1 |Lki | 6 h · min(22 5.3 , w). Complexity bound Lemma 5.8. For any n ∈ N n X k −k−1 22 n −n−1 < 22 n−1 −n+1 + 22 . (24) k=1 Proof. We prove this by induction. For n = 1, 2, 3 the inequality holds. Suppose that m > 3 and it is valid for all n < m. After denoting the sum on the left side of (24) as sn , the induction hypothesis implies m m−1 −m m−2 −m+2 m sm = sm−1 + 22 −m−1 < 22 + 22 + 22 −m−1 . m−2 −m+2 Since the second term 22 m−1 −m sm < 22 m−1 −m < 22 m−1 −m + 22 for m > 3 we get m −m−1 + 22 m −m−1 = 22 m−1 −m+1 + 22 . At last we can state the main theorem estimating the Hough ensemble complexity. Theorem 5.9. The complexity of the Hough ensemble L produced by E base lines on an image with width w and height h is bounded by the following inequality: r ! 4whE 2 1+ + h(w − E). (25) µ(L) < log2 w + 1 w The corresponding computation chain has depth at most log2 w · (⌈log2 E⌉ + 1). Proof. Suppose we have built the partition tree computing L as described in section 5.2. Because of (14) it is enough to estimate the weight of the constructed tree T. Denote t = log2 (log2 w + 1) and let k0 = ⌈t⌉ − 1, in this case t − 1 6 k0 < t. Taking into account that for the Hough ensemble |Li | = h and |I| = w · h, using corollary 5.7 we can rewrite (16) as ⌈log2 E⌉ k k0 X X w 22 −1 ω(T) 6 w · h + E · h( + ) − E · h. 2k 2k k=k0 +1 k=1 19 (26) Using (24) the first sum is bounded by t−1 t 2k0 −k0 −1 2 2k0 −1 −k0 +1 +2 2t −(t−1)−1 <2 2t−1 −(t−1)+1 +2 4 · 22 22 = t + 2 2t √ 2w + 4 2w = . log2 w + 1 The second sum is bounded by ∞ X k=k0 +1 w w w 2w . = k0 6 t−1 = k 2 2 2 log2 w + 1 After substitution of these terms to (26) we obtain (25). k−1 k−1 ) (same ) = dP k (P2i To prove the depth inequality note that by proposition 4.8 depth dLk (L2i i i k−1 ). The bound then follows from (17) for the Pik partition tree (obviously |Pik | 6 w). for L2i+1 Corollary 5.10. On a square n × n image (n > 1) the Hough ensemble L generated from n base lines has complexity r ! 2 1 4n3 + 1− . (27) µ(L) < log2 n log2 n + 1 n The corresponding computation chain has depth at most log2 n · (log2 n + 1). Remark 5.11. Inequalities (25) and (27) hold for any span generated patterns ensemble satisfying (19), because we used only this property to prove the theorem. In fact a weaker condition like |X e,e+1 | < C would also work with the same asymptotics but a different constant. 6 Discussion In the introduction we initially defined the classical Hough transform not for “cyclic” (wrapping over image border) lines (18) but for digital line segments (2). The latter case can always be reduced to the former one by extending the original image vertically (for mostly horizontal lines) and padding it with zero values which changes the computation asymptotics at most by a fixed factor. One can also then prune the redundant (constant zero) input pixels and all the nodes which depend only on them from the generated computation circuit. This justifies the “cyclic” modh (·) approach used in sections 4 and 5. The Hough ensemble complexity bound in theorem 5.9 is constructive as its proof uses an explicit binary partition tree and thus the associated computation chain which is straightforwardly transformed into a computation circuit (section 3.3). Of course, in practice one should not try k−1 k−1 to directly compute L2i ∨ L2i+1 in algorithm 2 but rather use recurrence relation (21) for the X-domain. It is worth noting that applying the proposed algorithm to the fast Hough transform patterns would produce the n2 log2 n asymptotics – precisely the FHT algorithm complexity! Indeed, consequent FHT patterns (fig. 5) for w = h = E = n = 2m overlap either on [0, n2 ) or on [ n2 , n), blocks of 3n patterns with four consequent elevations overlap on segments [0, n4 ), [ n4 , n2 ), [ n2 , 3n 4 ) or [ 4 , n) and k k so on, so |Pi | = 2 , which by (16) in the same manner as (26) gives ω(T) 6 n2 + n2 m X 2k k=1 2k 20 − n2 = n2 log2 n. Figure 5: Pairs of FHT patterns with consecutive elevations: 0-1, 2-3, 4-5, 6-7 (top to bottom, left to right). Vertical lines help distinguish common components. Image width is 8. It gives hope that in practice Hough ensemble circuits might yield a much better result than (25). Indeed, the cardinality bound in (23) is very rough, in practice the Pik sets might grow by far not that fast. Performing the necessary computational experiments as well as assessing the number of operations and memory requirements of algorithm 2 applied to the Hough ensemble is the plan of our next research. Another area of interest is generalizing or modifying the suggested approach to handle shiftinvariant ensembles consisting of patterns which are not function graphs so their pattern orbits do not per se produce image partitioning. References [1] P. Mukhopadhyay, B. Chaudhuri. A survey of Hough transform. Pattern Recognition, vol. 48, issue 3, 2015. [2] R. Klette, A. Rosenfeld. Digital straightness – a review. Discrete Applied Mathematics, vol. 139, issues 1–3, pp. 197-230, 2004. [3] J. Koplowitz, M. Lindenbaum, A. Bruckstein. The number of digital straight lines on an N×N grid. IEEE Transactions on Information Theory, vol. 36, issue 1, 1990. [4] R. Duda, P. Hart. Use of the Hough transformation to detect lines and curves in pictures. Comm. ACM, vol. 15, pp. 11–15, 1972. [5] M. Gary, D. Johnson. Computers and intractability. W. H. Freeman & Co, 1979. [6] S. Jukna, I. Sergeev. Complexity of linear boolean operators. Foundations and trends in theoretical computer science, vol. 9, no. 1, pp. 1–123, 2013. [7] W. Götz. Eine Schnelle Diskrete Radon Transformation basierend auf rekursiv definiertern Digitalen Geraden. Dissertation, University of Innsbruck, 1993. 21 [8] J. Vuillemin. Fast linear Hough transform. Proc. of the International conference on application specific array processors, 1994. [9] W. Götz, H. Druckmüller. A fast digital Radon transform – an efficient means for evaluating the Hough transform. Pattern recognition, vol. 29, no. 4, pp. 711–718, 1996. [10] M. Brady. A fast discrete approximation algorithm for the Radon transform. SIAM Journal on Computing, vol. 27 (1), pp. 107–119, 1998. [11] S. Karpenko, D. Nikolaev, P. Nikolayev, V. Postnikov. Fast Hough transform with controllable robustness (in Russian). In Proc. of IEEE AIS’04 and CAD-2004, 2:303–309, 2004. [12] T. Khanipov. Computational complexity lower bounds of certain discrete Radon transform approximations. http://arxiv.org/pdf/1801.01054.pdf, 2018. [13] I. Wegener. The complexity of boolean functions. John Wiley & Sons, 1987. 22
1cs.CV
Fully polynomial FPT algorithms for some classes of bounded clique-width graphs∗ David Coudert1 , Guillaume Ducoffe1,2,3 , and Alexandru Popa2,4 1 arXiv:1707.05016v2 [cs.DS] 18 Oct 2017 2 Université Côte d’Azur, Inria, CNRS, I3S, France National Institute for Research and Development in Informatics, Romania 3 The Research Institute of the University of Bucharest ICUB, Romania 4 University of Bucharest, Faculty of Mathematics and Computer Science Abstract Parameterized complexity theory has enabled a refined classification of the difficulty of NPhard optimization problems on graphs with respect to key structural properties, and so to a better understanding of their true difficulties. More recently, hardness results for problems in P were achieved using reasonable complexity theoretic assumptions such as: Strong Exponential Time Hypothesis (SETH), 3SUM and All-Pairs Shortest-Paths (APSP). According to these assumptions, many graph theoretic problems do not admit truly subquadratic algorithms, nor even truly subcubic algorithms (Williams and Williams, FOCS 2010 and Abboud, Grandoni, Williams, SODA 2015). A central technique used to tackle the difficulty of the above mentioned problems is fixed-parameter algorithms for polynomial-time problems with polynomial dependency in the fixed parameter (P-FPT). This technique was rigorously formalized by Giannopoulou et al. (IPEC 2015). Following that, it was continued by Abboud, Williams and Wang in SODA 2016, by Husfeldt (IPEC 2016) and Fomin et al. (SODA 2017), using the treewidth as a parameter. Applying this technique to clique-width, another important graph parameter, remained to be done. In this paper we study several graph theoretic problems for which hardness results exist such as cycle problems (triangle detection, triangle counting, girth, diameter), distance problems (diameter, eccentricities, Gromov hyperbolicity, betweenness centrality) and maximum matching. We provide hardness results and fully polynomial FPT algorithms, using clique-width and some of its upper-bounds as parameters (split-width, modular-width and P4 -sparseness). We believe that our most important result is an O(k 4 · n + m)-time algorithm for computing a maximum matching where k is either the modular-width or the P4 -sparseness. The latter generalizes many algorithms that have been introduced so far for specific subclasses such as cographs, P4 -lite graphs, P4 -extendible graphs and P4 -tidy graphs. Our algorithms are based on preprocessing methods using modular decomposition, split decomposition and primeval decomposition. Thus they can also be generalized to some graph classes with unbounded clique-width. ∗ This work has been partially supported by ANR project Stint under reference ANR-13-BS02-0007 and ANR program “Investments for the Future” under reference ANR-11-LABX-0031-01. 1 1 Introduction The classification of problems according to their complexity is one of the main goals in computer science. This goal was partly achieved by the theory of NP-completeness which helps to identify the problems that are unlikely to have polynomial-time algorithms. However, there are still many problems in P for which it is not known if the running time of the best current algorithms can be improved. Such problems arise in various domains such as computational geometry, string matching or graphs. Here we focus on the existence and the design of linear-time algorithms, for solving several graph problems when restricted to classes of bounded clique-width. The problems considered comprise the detection of short cycles (e.g., Girth and Triangle Counting), some distance problems (e.g., Diameter, Hyperbolicity, Betweenness Centrality) and the computation of maximum matchings in graphs. We refer to Sections 3.1, 4.1 and 5, respectively, for a recall of their definitions. Clique-width is an important graph parameter in structural graph theory, that intuitively represents the closeness of a graph to a cograph — a.k.a., P4 -free graphs [24, 32]. Some classes of perfect graphs, including distance-hereditary graphs, and so, trees, have bounded clique-width [57]. Furthermore, clique-width has many algorithmic applications. Many algorithmic schemes and metatheorems have been proposed for classes of bounded clique-width [31, 28, 40]. Perhaps the most famous one is Courcelle’s theorem, that states that every graph problem expressible in Monadic Second Order logic (M SO1 ) can be solved in f (k)·n-time when restricted to graphs with clique-width at most k, for some computable function f that only depends on k [31]. Some of the problems considered in this work can be expressed as an M SO1 formula. However, the dependency on the clique-width in Courcelle’s theorem is super-polynomial, that makes it less interesting for the study of graphs problems in P. Our goal is to derive a finer-grained complexity of polynomial graph problems when restricted to classes of bounded clique-width, that requires different tools than Courcelle’s theorem. Our starting point is the recent theory of “Hardness in P” that aims at better hierarchizing the complexity of polynomial-time solvable problems [84]. This approach mimics the theory of NPcompleteness. Precisely, since it is difficult to obtain unconditional hardness results, it is natural to obtain hardness results assuming some complexity theoretic conjectures. In other words, there are key problems that are widely believed not to admit better algorithms such as 3-SAT (k-SAT), 3SUM and All-Pairs Shortest Paths (APSP). Roughly, a problem in P is hard if the existence of a faster algorithm for this problem implies the existence of a faster algorithm for one of these fundamental problems mentioned above. In their seminal work, Williams and Williams [85] prove that many important problems in graph theory are all equivalent under subcubic reductions. That is, if one of these problems admits a truly sub-cubic algorithms, then all of them do. Their results have extended and formalized prior work from, e.g., [51, 67]. The list of such problems was further extended in [1, 17]. Besides purely negative results (i.e., conditional lower-bounds) the theory of “Hardness in P” also comes with renewed algorithmic tools in order to leverage the existence, or the nonexistence, of improved algorithms for some graph classes. The tools used to improve the running time of the above mentioned problems are similar to the ones used to tackle NP-hard problems, namely approximation and FPT algorithms. Our work is an example of the latter, of which we first survey the most recent results. 2 Related work: Fully polynomial parameterized algorithms. FPT algorithms for polynomial-time solvable problems were first considered by Giannopoulou et al. [55]. Such a parameterized approach makes sense for any problem in P for which a conditional hardness result is proved, or simply no linear-time algorithms are known. Interestingly, the authors of [55] proved that a matching of cardinality at least k in a graph can be computed in O(kn + k 3 )-time. We stress that Maximum Matching is a classical and intensively studied problem in computer sci√ ence [37, 45, 46, 49, 66, 72, 71, 86]. The well known O(m n)-time algorithm in [72] is essentially the best so far for Maximum Matching. Approximate solutions were proposed by Duan and Pettie [37]. More related to our work is the seminal paper of Abboud, Williams and Wang [3]. They obtained rather surprising results when using treewidth: another important graph parameter that intuitively measures the closeness of a graph to a tree [13]. Treewidth has tremendous applications in pure graph theory [79] and parameterized complexity [27]. Furthermore, improved algorithms have long been known for ”hard” graph problems in P, such as Diameter and Maximum Matching, when restricted to trees [65]. However, it has been shown in [3] that under the Strong Exponential Time Hypothesis, for any ε > 0 there can be no 2o(k) · n2−ε -time algorithm for computing the diameter of graphs with treewidth at most k. This hardness result even holds for pathwidth, that leaves little chance to find an improved algorithm for any interesting subclass of bounded-treewidth graphs while avoiding an exponential blow-up in the parameter. We show that the situation is different for clique-width than for treewidth, in the sense that the hardness results for clique-width do not hold for important subclasses. We want to stress that a familiar reader could ask why the hardness results above do not apply to clique-width directly since it is upper-bounded by a function of treewidth [25]. However, cliquewidth cannot be polynomially upper-bounded by the treewidth [25]. Thus, the hardness results from [3] do not preclude the existence of, say, an O(kn)-time algorithm for computing the diameter of graphs with clique-width at most k. On a more positive side, the authors in [3] show that Radius and Diameter can be solved in 2O(k log k) · n1+O(1) -time, where k is treewidth. Husfeldt [62] shows that the eccentricity of every vertex in an undirected graph on n vertices can be computed in time n·exp [O(k log d)], where k and d are the treewidth and the diameter of the graph, respectively. More recently, a tour de force was achieved by Fomin et al. [44] who were the first to design parameterized algorithms with polynomial dependency on the treewidth, for Maximum Matching and Maximum Flow. Furthermore they proved that for graphs with treewidth at most k, a tree decomposition of width O(k 2 ) can be computed in O(k 7 · n log n)-time. We observe that their algorithm for Maximum Matching is randomized, whereas ours are deterministic. We are not aware of the study of another parameter than treewidth for polynomial graph problems. However, some authors choose a different approach where they study the parameterization of a fixed graph problem for a broad range of graph invariants [11, 43, 71]. As examples, cliquewidth is part of the graph invariants used in the parameterized study of Triangle Listing [11]. Nonetheless, clique-width is not the main focus in [11]. Recently, Mertzios, Nichterlein and Niedermeier [71] propose algorithms for Maximum Matching that run in time O(k O(1) · (n + m)), for several parameters such as feedback vertex set or feedback edge set. Moreover, the authors in [71] suggest that Maximum Matching may become the “drosophila” of the study of the FPT algorithms in P. We advance in this research direction. 3 1.1 Our results In this paper we study the parameterized complexity of several classical graph problems under a wide range of parameters such as clique-width and its upper-bounds modular-width [32], splitwidth [78], neighbourhood diversity [68] and P4 -sparseness [8]. The results are summarized in Table 1. Roughly, it turns out that some hardness assumptions for general graphs do not hold anymore for graph classes of bounded clique-width. This is the case in particular for Triangle Detection and other cycle problems that are subcubic equivalent to it such as, e.g., Girth, that all can be solved in linear-time, with quadratic dependency on the clique-width, with the help of dynamic programming (Theorems 2 and 3). The latter complements the results obtained for Triangle Listing in [11]. However many hardness results for distance problems when using treewidth are proved to also hold when using clique-width (Theorems 5, 6 and 7). These negative results have motivated us to consider some upper-bounds for clique-width as parameters, for which better results can be obtained than for clique-width. Another motivation stems from the fact that the existence of a parameterized algorithm for computing the clique-width of a graph remains a challenging open problem [23]. We consider some upper-bounds for clique-width that are defined via linear-time computable graph decompositions. Thus if these parameters are small enough, say, in O(n1−ε ) for some ε > 0, we get truly subcubic or even truly subquadratic algorithms for a wide range of problems. Problem Diameter, Eccentricities Betweenness Centrality Hyperbolicity Maximum Matching Triangle Detection, Triangle Counting, Girth Parameterized time complexity O(mw(G)2 · n + m) O(sw(G)2 · n + m) 3 O(mw(G) + n + m) O(q(G)3 + n + m) 2 O(mw(G) · n + m) O(sw(G)2 · n + m) O(nd(G)3 + n + m) O(mw(G)3 · n + m) O(nd(G)4 + n + m) O(sw(G)3 · n + m) O(q(G)3 · n + m) 4 O(mw(G) · n + m) O(q(G)4 · n + m) O(k 2 · (n + m)) for any k ∈ {cw(G), mw(G), sw(G), q(G)} Table 1: Summary of positive results. Graph parameters and decompositions considered Let us describe the parameters considered in this work as follows. The following is only an informal high level description (formal definitions are postponed to Section 2). Split Decomposition. A join is a set of edges inducing a complete bipartite subgraph. Roughly, clique-width can be seen as a measure of how easy it is to reconstruct a graph by adding joins between some vertex-subsets. A split is a join that is also an edge-cut. By using pairwise non crossing splits, termed “strong splits”, we can decompose any graph into degenerate and prime subgraphs, that can be organized in a treelike manner. The latter is termed split decomposition [56]. We take advantage of the treelike structure of split decomposition in order to design dynamic programming algorithms for distance problems such as Diameter, Gromov Hyperbolicity and 4 Betweenness Centrality (Theorems 8, 9 and 11, respectively). Although clique-width is also related to some treelike representations of graphs [30], the same cannot be done for clique-width as for split decomposition because the edges in the treelike representations for clique-width may not represent a join. Modular Decomposition. Then, we can improve the results obtained with split decomposition by further restricting the type of splits considered. As an example, let (A, B) be a bipartition of the vertex-set that is obtained by removing a split. If every vertex of A is incident to some edges of the split then A is called a module of G. That is, for every vertex v ∈ B, v is either adjacent or nonadjacent to every vertex of A. The well-known modular decomposition of a graph is a hierarchical decomposition that partitions the vertices of the graph with respect to the modules [60]. Split decomposition is often presented as a refinement of modular decomposition [56]. We formalize the relationship between the two in Lemma 10, that allows us to also apply our methods for split decomposition to modular decomposition. However, we can often do better with modular decomposition than with split decomposition. In particular, suppose we partition the vertex-set of a graph G into modules, and then we keep exactly one vertex per module. The resulting quotient graph G0 keeps most of the distance properties of G. Therefore, in order to solve a distance problem for G, it is often the case that we only need to solve it for G0 . We so believe that modular decomposition can be a powerful Kernelization tool in order to solve graph problems in P. As an application, we improve the running time for some of our algorithms, from time O(k O(1) · n + m) when parameterized by the split-width (maximum order of a prime subgraph in the split decomposition), to O(k O(1) + n + m)-time when parameterized by the modular-width (maximum order of a prime subgraph in the modular decomposition). See Theorem 13. Furthermore, for some more graph problems, it may also be useful to further restrict the internal structures of modules. We briefly explore this possibility through a case study for neighbourhood diversity. Roughly, in this latter case we only consider modules that are either independent sets (false twins) or cliques (true twins). New kernelization results are obtained for Hyperbolicity and Betweenness Centrality when parameterized by the neighbourhood diversity (Theorems 16 and 17, respectively). It is worth pointing out that so far, we have been unable to obtain kernelization results for Hyperbolicity and Betweenness Centrality when only parameterized by the modular-width. It would be very interesting to prove separability results between splitwidth, modular-width and neighbourhood diversity in the field of fully polynomial parameterized complexity. Graphs with few P4 ’s. We finally use modular decomposition as our main tool for the design of new linear-time algorithms when restricted to graphs with few induced P4 ’s. The (q, t)-graphs have been introduced by Babel and Olariu in [7]. They are the graphs in which no set of at most q vertices can induce more than t paths of length four. Every graph is a (q, t)-graph for some large enough values of q and t. Furthermore when q and t are fixed constants, t ≤ q − 3, the class of (q, t)graphs has bounded clique-width [70]. We so define the P4 -sparseness of a given graph G, denoted by q(G), as the minimum q ≥ 7 such that G is a (q, q − 3)-graph. The structure of the quotient graph of a (q, q − 3)-graph, q being a constant, has been extensively studied and characterized in the literature [5, 7, 8, 6, 64]. We take advantage of these existing characterizations in order to generalize our algorithms with modular decomposition to O(q(G)O(1) · n + m)-time algorithms 5 (Theorems 18 and 20). Let us give some intuition on how the P4 -sparseness can help in the design of improved algorithms for hard graph problems in P. We consider the class of split graphs (i.e., graphs that can be bipartitioned into a clique and an independent set). Deciding whether a given split graph has diameter 2 or 3 is hard [17]. However, suppose now that the split graph is a (q, q − 3)-graph G, for some fixed q. An induced P4 in G has its two ends u, v in the independent set, and its two middle vertices are, respectively, in NG (u) \ NG (v) and NG (v) \ NG (u). Furthermore, when G is a (q, q − 3)-graph, it follows from the characterization of [5, 7, 8, 6, 64] either it has a quotient graph of bounded order O(q) or it is part of a well-structured subclass where the vertices of all neighbourhoods in the independent set follow a rather nice pattern (namely, spiders and a subclass of p-trees, see Section 2). As a result, the diameter of G can be computed in O(max{q 3 , n + m})-time when G is a (q, q − 3) split graph. We generalize this result to every (q, q − 3)-graph by using modular decomposition. All the parameters considered in this work have already received some attention in the literature, especially in the design of FPT algorithms for NP-hard problems [6, 53, 56, 50, 78]. However, we think we are the first to study clique-width and its upper-bounds for polynomial problems. There do exist linear-time algorithms for Diameter, Maximum Matching and some other problems we study when restricted to some graph classes where the split-width or the P4 -sparseness is bounded (e.g., cographs [86], distance-hereditary graphs [35, 36], P4 -tidy graphs [46], etc.). Nevertheless, we find the techniques used for these specific subclasses hardly generalize to the case where the graph has split-width or P4 -sparseness at most k, k being any fixed constant. For instance, the algorithm that is proposed in [36] for computing the diameter of a given distance-hereditary graph is based on some properties of LexBFS orderings. Distance-hereditary graphs are exactly the graphs with split-width at most two [56]. However it does not look that simple to extend the properties found for their LexBFS orderings to bounded split-width graphs in general. As a byproduct of our approach, we also obtain new linear-time algorithms when restricted to well-known graph families such as cographs and distance-hereditary graphs. Highlight of our Maximum Matching algorithms Finally we emphasize our algorithms for Maximum Matching. Here we follow the suggestion of Mertzios, Nichterlein and Niedermeier [71] that Maximum Matching may become the “drosophila” of the study of the FPT algorithms in P. Precisely, we propose O(k 4 · n + m)-time algorithms for Maximum Matching when parameterized either by modular-width or by the P4 sparseness of the graph (Theorems 22 and 24). The latter subsumes many algorithms that have been obtained for specific subclasses [46, 86]. Let us sketch the main lines of our approach. Our algorithms for Maximum Matching are recursive. Given a partition of the vertex-set into modules, first we compute a maximum matching for the subgraph induced by every module separately. Taking the union of all the outputted matchings gives a matching for the whole graph, but this matching is not necessarily maximum. So, we aim at increasing its cardinality by using augmenting paths [12]. In an unpublished paper [73], Novick followed a similar approach and, based on an integer 3 programming formulation, he obtained an O(k O(k ) n+m)-time algorithm for Maximum Matching when parameterized by the modular-width. Our approach is more combinatorial than his. Our contribution in this part is twofold. First we carefully study the possible ways an augment6 ing path can cross a module. Our analysis reveals that in order to compute a maximum matching in a graph of modular-width at most k we only need to consider augmenting paths of length O(k). Then, our second contribution is an efficient way to compute such paths. For that, we design a new type of characteristic graph of size O(k 4 ). The same as the classical quotient graph keeps most distance properties of the original graph, our new type of characteristic graph is tailored to enclose the main properties of the current matching in the graph. We believe that the design of new types of characteristic graphs can be a crucial tool in the design of improved algorithms for graph classes of bounded modular-width. We have been able to extend our approach with modular decomposition to an O(q 4 · n + m)-time algorithm for computing a maximum matching in a given (q, q − 3)-graph. However, a characterization of the quotient graph is not enough to do that. Indeed, we need to go deeper in the p-connectedness theory of [8] in order to better characterize the nontrivial modules in the graphs (Theorem 23). Furthermore our algorithm for (q, q − 3)-graph not only makes use of the algorithm with modular decomposition. On our way to solve this case we have generalized different methods and reduction rules from the literature [66, 86], that is of independent interest. We suspect that our algorithm with modular decomposition can be used as a subroutine in order to solve Maximum Matching in linear-time for bounded split-width graphs. However, this is left for future work. 1.2 Organization of the paper In Section 2 we introduce definitions and basic notations. Then, in Section 3 we show FPT algorithms when parameterized by the clique-width. The problems considered are Triangle Counting and Girth. To the best of our knowledge, we present the first known polynomial parameterized algorithm for Girth (Theorem 3). Roughly, the main idea behind our algorithms is that given a labeled graph G obtained from a k-expression, we can compute a minimum-length cycle for G by keeping up to date the pairwise distances between every two label classes. Hence, if a k-expression of length L is given as part of the input we obtain algorithms running in time O(k 2 L) and space O(k 2 ). In Section 4 we consider distance related problems, namely: Diameter, Eccentricities, Hyperbolicity and Betweenness Centrality. We start proving, in Section 4.2, none of these problems above can be solved in time 2o(k) n2−ε , for any ε > 0, when parameterized by the clique-width (Theorems 5—7). These are the first known hardness results for clique-width in the field of “Hardness in P”. Furthermore, as it is often the case in this field, our results are conditioned on the Strong Exponential Time Hypothesis [63]. In summary, we take advantage of recent hardness results obtained for bounded-degree graphs [41]. Clique-width and treewidth can only differ by a constant-factor in the class of bounded-degree graphs [28, 59]. Therefore, by combining the hardness constructions for bounded-treewidth graphs and for bounded-degree graphs, we manage to derive hardness results for graph classes of bounded clique-width. In Section 4.3 we describe fully polynomial FPT algorithms for Diameter, Eccentricity, Hyperbolicity and Betweenness centrality parameterized by the split-width. Our algorithms use split-decomposition as an efficient preprocessing method. Roughly, we define weighted versions for every problem considered (some of them admittedly technical). In every case, we 7 prove that solving the original distance problem can be reduced in linear-time to the solving of its weighted version for every subgraph of the split decomposition separately. Then, in Section 4.4 we apply the results from Section 4.3 to modular-width. First, since sw(G) ≤ mw(G) + 1 for any graph G, all our algorithms parameterized by split-width are also algorithms parameterized by modular-width. Moreover for Eccentricities, and for Hyperbolicity and Betweenness Centrality when parameterized by the neighbourhood diversity, we show that it is sufficient only to process the quotient graph of G. We thus obtain algorithms that run in O(mw(G)O(1) + n + m)-time, or O(nd(G)O(1) + n + m)-time, for all these problems. In Section 4.5 we generalize our previous algorithms to be applied to the (q, q − 3)-graphs. We obtain our results by carefully analyzing the cases where the quotient graph has size Ω(q). These cases are given by Lemma 4. Section 5 is dedicated to our main result, linear-time algorithms for Maximum Matching. First in Section 5.1 we propose an algorithm parameterized by the modular-width that runs in O(mw(G)4 · n + m)-time. In Section 5.2 we generalize this algorithm to (q, q − 3)-graphs. Finally, in Section 6 we discuss applications to other graph classes. 2 Preliminaries We use standard graph terminology from [15, 34]. Graphs in this study are finite, simple (hence without loops or multiple edges) and unweighted – unless stated otherwise. Furthermore we make the standard assumption that graphs are encoded as adjacency lists. We want to prove the existence, or the nonexistence, of graph algorithms with running time of the form k O(1) · (n + m), k being some fixed graph parameter. In what follows, we introduce the graph parameters considered in this work. Clique-width A labeled graph is given by a pair hG, `i where G = (V, E) is a graph and ` : V → N is called a labeling function. A k-expression can be seen as a sequence of operations for constructing a labeled graph hG, `i, where the allowed four operations are: 1. Addition of a new vertex v with label i (the labels are taken in {1, 2, . . . , k}), denoted i(v); 2. Disjoint union of two labeled graphs hG1 , `1 i and hG2 , `2 i, denoted hG1 , `1 i ⊕ hG2 , `2 i; 3. Addition of a join between the set of vertices labeled i and the set of vertices labeled j, where i 6= j, denoted η(i, j); 4. Renaming label i to label j, denoted ρ(i, j). See Fig. 1 for examples. The clique-width of G, denoted by cw(G), is the minimum k such that, for some labeling `, the labeled graph hG, `i admits a k-expression [29]. We refer to [31] and the references cited therein for a survey of the many applications of clique-width in the field of parameterized complexity. Computing the clique-width of a given graph is NP-hard [42]. However, on a more positive side the graphs with clique-width two are exactly the cographs and they can be recognized in 8 1 1 va va (a) 1(va ) 2 1 va vb (b) 2(vb ) 2 vb (c) η(1, 2) 3 2 3 2 1 3 2 1 va vb va vb vc va vb vc (d) ρ(1, 3) (e) 1(vc ) (f) η(2, 1) 3 3 1 3 3 1 2 3 3 1 2 va vb vc va vb vc vd va vb vc vd (g) ρ(2, 3) (h) 2(vd ) (i) η(1, 2) Figure 1: A 3-expression for the path P4 . linear-time [24, 32]. Clique-width three graphs can also be recognized in polynomial-time [23]. The parameterized complexity of computing the clique-width is open. In what follows, we focus on upper-bounds on clique-width that are derived from some graph decompositions. Modular-width A module in a graph G = (V, E) is any subset M ⊆ V (G) such that for any v ∈ V \ M , either M ⊆ NG (v) or M ∩ NG (v) = ∅. Note that ∅, V, and {v} for every v ∈ V are trivial modules of G. A graph is called prime for modular decomposition if it only has trivial modules. A module M is strong if it does not overlap any other module, i.e., for any module M 0 of G, either one of M or M 0 is contained in the other or M and M 0 do not intersect. Furthermore, let M(G) be the family of all inclusion wise maximal strong modules of G that are proper subsets of V . The quotient graph of G is the graph G0 with vertex-set M(G) and an edge between every two M, M 0 ∈ M(G) such that every vertex of M is adjacent to every vertex of M 0 . Modular decomposition is based on the following structure theorem from Gallai. Theorem 1 ( [52]). For an arbitrary graph G exactly one of the following conditions is satisfied. 1. G is disconnected; 2. its complement G is disconnected; 3. or its quotient graph G0 is prime for modular decomposition. Theorem 1 suggests the following recursive procedure in order to decompose a graph, that is sometimes called modular decomposition. If G = G0 (i.e., G is complete, edgeless or prime for modular decomposition) then we output G. Otherwise, we output the quotient graph G0 of G and, for every strong module M of G, the modular decomposition of G[M ]. The modular decomposition of a given graph G = (V, E) can be computed in linear-time [83]. See Fig. 2 for an example. Furthermore, by Theorem 1 the subgraphs from the modular decomposition are either edgeless, complete, or prime for modular decomposition. The modular-width of G, denoted by mw(G), is the minimum k ≥ 2 such that any prime subgraph in the modular decomposition has order (number of vertices) at most k 1 . The relationship between clique-width and modular-width is as follows. 1 This term has another meaning in [77]. We rather follow the terminology from [32]. 9 a b c de f ab g hi j k prime c d e f a edgeless g b h j c complete e i j j f prime h ik d h i edgeless k k edgeless Figure 2: A graph and its modular decomposition. Lemma 1 ( [31]). For every G = (V, E), we have cw(G) ≤ mw(G), and a mw(G)-expression defining G can be constructed in linear-time. We refer to [60] for a survey on modular decomposition. In particular, graphs with modularwidth two are exactly the cographs, that follows from the existence of a cotree [82]. Cographs enjoy many algorithmic properties, including a linear-time algorithm for Maximum Matching [86]. Furthermore, in [50] Gajarskỳ, Lampis and Ordyniak prove that for some W -hard problems when parameterized by clique-width there exist FPT algorithms when parameterized by modular-width. Split-width A split (A, B) in a connected graph G = (V, E) is a partition V = A∪B such that: min{|A|, |B|} ≥ 2; and there is a complete join between the vertices of NG (A) and NG (B). For every split (A, B) of G, let a ∈ NG (B), b ∈ NG (A) be arbitrary. The vertices a, b are termed split marker vertices. We can compute a “simple decomposition” of G into the subgraphs GA = G[A ∪ {b}] and GB = G[B ∪ {a}]. There are two cases of “indecomposable” graphs. Degenerate graphs are such that every bipartition of their vertex-set is a split. They are exactly the complete graphs and the stars [33]. A graph is prime for split decomposition if it has no split. A split decomposition of a connected graph G is obtained by applying recursively a simple decomposition, until all the subgraphs obtained are either degenerate or prime. A split decomposition of an arbitrary graph G is the union of a split decomposition for each of its connected components. Every graph has a canonical split decomposition, with minimum number of subgraphs, that can be computed in linear-time [20]. The split-width of G, denoted by sw(G), is the minimum k ≥ 2 such that any prime subgraph in the canonical split decomposition of G has order at most k. See Fig. 3 for an illustration. Lemma 2 ( [78]). For every G = (V, E), we have cw(G) ≤ 2 · sw(G) + 1, and a (2 · sw(G) + 1)expression defining G can be constructed in linear-time. We refer to [53, 56, 78] for some algorithmic applications of split decomposition. In particular, graphs with split-width at most two are exactly the distance-hereditary graphs [9]. Linear-time algorithms for solving Diameter and Maximum Matching for distance-hereditary graphs are presented in [36, 35]. We stress that split decomposition can be seen as a refinement of modular decomposition. Indeed, if M is a module of G and min{|M |, |V \ M |} ≥ 2 then (M, V \ M ) is a split. In what follows, we prove most of our results with the more general split decomposition. 10 prime complete a a f d star c i h b e g h b g c f star star i d e Figure 3: A graph and its split decomposition. Graphs with few P4 ’s A (q, t)-graph G = (V, E) is such that for any S ⊆ V , |S| ≤ q, S induces at most t paths on four vertices [7]. The P4 -sparseness of G, denoted by q(G), is the minimum q ≥ 7 such that G is a (q, q − 3)-graph. Lemma 3 ( [70]). For every q ≥ 7, every (q, q − 3)-graph has clique-width at most q, and a q-expression defining it can be computed in linear-time. The algorithmic properties of several subclasses of (q, q − 3)-graphs have been considered in the literature. We refer to [8] for a survey. Furthermore, there exists a canonical decomposition of (q, q − 3)-graphs, sometimes called the primeval decomposition, that can be computed in lineartime [10]. Primeval decomposition can be seen as an intermediate between modular and split decomposition. We postpone the presentation of primeval decomposition until Section 5. Until then, we state the results in terms of modular decomposition. More precisely, given a (q, q − 3)-graphs G, the prime subgraphs in its modular decomposition may be of super-constant size Ω(q). However, if they are then they are part of one of the wellstructured graph classes that we detail next. A disc is either a cycle Cn , or a co-cycle Cn , for some n ≥ 5. (a) Thin spider. (b) Thick spider. Figure 4: Spiders. A spider G = (S ∪ K ∪ R, E) is a graph with vertex set V = S ∪ K ∪ R and edge set E such that: 1. (S, K, R) is a partition of V and R may be empty; 11 2. the subgraph G[K ∪ R] induced by K and R is the complete join K ⊕ R, and K separates S and R, i.e. any path from a vertex in S and a vertex in R contains a vertex in K; 3. S is a stable set, K is a clique, |S| = |K| ≥ 2, and there exists a bijection f : S −→ K such that, either for all vertices s ∈ S, N (s) ∩ K = K − {f (s)} or N (s) ∩ K = {f (s)}. Roughly speaking, the edges between S and K are either a matching or an anti-matching. In the former case or if |S| = |K| ≤ 2, G is called thin, otherwise G is thick. See Fig. 4. If furthermore |R| ≤ 1 then we call G a prime spider. y x Figure 5: Spiked p-chain Pk . Let Pk = (v1 , v2 , v3 , . . . , vk ), k ≥ 6 be a path of length at least five. A spiked p-chain Pk is a supergraph of Pk , possibly with the additional vertices x, y such that: N (x) = {v2 , v3 } and N (y) = {vk−2 , vk−1 }. See Fig. 5. Note that one or both of x and y may be missing. In particular, Pk is a spiked p-chain Pk . A spiked p-chain Pk is the complement of a spiked p-chain Pk . Let Qk be the graph with vertex-set {v1 , v2 , . . . , vk }, k ≥ 6 such that, for every i ≥ 1, NQk (v2i−1 ) = {v2j | j ≤ i, j 6= i − 1} and NQk (v2i ) = {v2j | j 6= i} ∪ {v2j−1 | j ≥ i, j 6= i + 1}. A spiked p-chain Qk is a supergraph of Qk , possibly with the additional vertices z2 , z3 , . . . , zk−5 such that: • N (z2i−1 ) = {v2j | j ∈ [1; i]} ∪ {z2j | j ∈ [1; i − 1]}; • N (z2i ) = {v2j−1 | j ∈ [1; i + 1]} ∪ {z2j−1 | j ∈ [2; i]} Any of the vertices zi can be missing, so, in particular, Qk is a spiked p-chain Qk . See Fig. 6. A spiked p-chain Qk is the complement of a spiked p-chain Qk . z2 v2 v6 v4 v8 v7 v1 z3 v5 v3 Figure 6: Spiked p-chain Qk . Finally, we say that a graph is a prime p-tree if it is either: a spiked p-chain Pk , a spiked p-chain Pk , a spiked p-chain Qk , a spiked p-chain Qk , or part of the seven graphs of order at most 7 that are listed in [70]. Lemma 4 ( [6, 70]). Let G = (V, E), q ≥ 7, be a connected (q, q − 3)-graph such that G and G are connected. Then, one of the following must hold for its quotient graph G0 : 12 • either G0 is a prime spider; • or G0 is a disc; • or G0 is a prime p-tree; • or |V (G0 )| ≤ q. A simpler version of Lemma 4 holds for the subclass of (q, q − 4)-graphs: Lemma 5 ( [6]). Let G = (V, E), q ≥ 4, be a connected (q, q − 4)-graph such that G and G are connected. Then, one of the following must hold for its quotient graph G0 : • G0 is a prime spider; • or |V (G0 )| ≤ q. The subclass of (q, q − 4)-graphs has received more attention in the literature than (q, q − 3)graphs. Our results hold for the more general case of (q, q − 3)-graphs. 3 Cycle problems on bounded clique-width graphs Clique-width is the smallest parameter that is considered in this work. We start studying the possibility for k O(1) · (n + m)-time algorithms on graphs with clique-width at most k. Positive results are obtained for two variations of Triangle Detection, namely Triangle Counting and Girth. We define the problems studied in Section 3.1, then we describe the algorithms in order to solve these problems in Section 3.2. 3.1 Problems considered We start introducing our basic cycle problem. Problem 1 (Triangle Detection). Input: A graph G = (V, E). Question: Does there exist a triangle in G? Note that for general graphs, Triangle Detection is conjectured not to be solvable in O(n3−ε )-time, for any ε > 0, with a combinatorial algorithm [85]. It is also conjectured not to be solvable in O(nω−ε )-time for any ε > 0, with ω being the exponent for fast matrix multiplication [2]. Our results in this section show that such assumptions do not hold when restricted to bounded clique-width graphs. More precisely, we next describe fully polynomial parameterized algorithms for the two following generalizations of Triangle Detection. Problem 2 (Triangle Counting). Input: A graph G = (V, E). Output: The number of triangles in G. 13 Problem 3 (Girth). Input: A graph G = (V, E). Output: The girth of G, that is the minimum size of a cycle in G. In [85], the three of Triangle Detection, Triangle Counting and Girth are proved to be subcubic equivalent when restricted to combinatorial algorithms. 3.2 Algorithms Roughly, our algorithms in what follows are based on the following observation. Given a labeled graph hG, `i (obtained from a k-expression), in order to detect a triangle in G, resp. a minimumlength cycle in G, we only need to store the adjacencies, resp. the distances, between every two label classes. Hence, if a k-expression of length L is given as part of the input we obtain algorithms running in time O(k 2 L) and space O(k 2 ). Our first result is for Triangle Counting (Theorem 2). It shares some similarities with a recent algorithm for listing all triangles in a graph [11]. However, unlike the authors in [11], we needn’t use the notion of k-modules in our algorithms. Furthermore, since we only ask for counting triangles, and not to list them, we obtain a better time complexity than in [11]. Theorem 2. For every G = (V, E), Triangle Counting can be solved in O(k 2 · (n + m))-time if a k-expression of G is given. Proof. We need to assume the k-expression is irredundant, that is, when we add a complete join between the vertices labeled i and the verticed labeled j, there was no edge before between these two subsets. Given a k-expression of G, an irredundant k-expression can be computed in lineartime [32]. Then, we proceed by dynamic programming on the irredundant k-expression. More precisely, let hG, `i be a labeled graph, ` : V (G) → {1, . . . , k}. We denote by T (hG, `i) the number of triangles in G. In particular, T (hG, `i) = 0 if G is empty. Furthermore, T (hG, `i) = T (hG0 , `0 i) if hG, `i is obtained from hG0 , `0 i by: the addition of a new vertex with any label, or the identification of two labels. If hG, `i is the disjoint union of hG1 , `1 i and hG2 , `2 i then T (hG, `i) = T (hG1 , `1 i) + T (hG2 , `2 i). Finally, suppose that hG, `i is obtained from hG0 , `0 i by adding a complete join between the set Vi of vertices labeled i and the set Vj of vertices labeled j. For every p, q ∈ {1, . . . , k}, we denote by mp,q the number of edges in hG0 , `0 i with one end in Vp and the other end in Vq . Let np,q be the number of (non necessarily induced) P3 ’s with an end in Vp and the other end in Vq . Note that we are only interested in the number of induced P3 ’s for our algorithm, but this looks more challenging to compute. Nevertheless, since the k-expression is irredundant, ni,j is exactly the number of induced P3 ’s with one end in Vi and the other in Vj . Furthermore after the join is added we get: |Vi | new triangles per edge in G0 [Vj ], |Vj | new triangles per edge in G0 [Vi ], and one triangle for every P3 with one end in Vi and the other in Vj . Summarizing: T (hG, `i) = T (hG0 , `0 i) + |Vj | · mi,i + |Vi | · mj,j + ni,j . In order to derive the claimed time bound, we are now left to prove that, after any operation, we can update the values mp,q and np,q , p, q ∈ {1, . . . , k}, in O(k 2 )-time. Clearly, these values cannot change when we add a new (isolated) vertex, with any label, and they can be updated by simple 14 summation when we take the disjoint union of two labeled graphs. We now need to distinguish between the two remaining cases. In what follows, let m0p,q and n0p,q represent the former values. • Suppose that label i is identified with label j. Then:   0 if i ∈ {p, q}    0 0 0  mi,i + mi,j + mj,j if p = q = j  mp,q = m0p,j + m0p,i if q = j, p ∈ / {i, j} ,   0 0  if p = j, q ∈ / {i, j}  mj,q + mi,q   0 mp,q else np,q   0    0 0 0   nj,j + nj,i + ni,i = n0p,j + n0p,i    n0j,q + n0i,q     0 np,q if i ∈ {p, q} if p = q = j if q = j, p ∈ / {i, j} . if p = j, q ∈ / {i, j} else • Otherwise, suppose that we add a complete join between the set Vi of vertices labeled i and the set Vj of vertices labeled j. Then, since the k-expression is irredundant: ( |Vi | · |Vj | if {i, j} = {p, q} mp,q = . m0p,q else For every ui , vi ∈ Vi and wj ∈ Vj we create a new P3 (ui , wj , vi ). Similarly, for every uj , vj ∈ Vj and wi ∈ Vi we create a new P3 (uj , wi , vj ). These are the only new P3 ’s with two edges from the complete join. Furthermore, for every edge {ui , vi } in Vi and for every wj ∈ Vj we can create the two new P3 ’s (ui , vi , wj ) and (vi , ui , wj ). Similarly, for every edge {uj , vj } in Vj and for every wi ∈ Vi we can create the two new P3 ’s (uj , vj , wi ) and (vj , uj , wi ). Finally, for every edge {v, uj } with uj ∈ Vj , v ∈ / Vi ∪ Vj , we create |Vi | new P3 ’s, and for every edge {v, ui } with ui ∈ Vi , v ∈ / Vi ∪ Vj , we create |Vj | new P3 ’s. Altogether combined, we deduce the following update rules:   n0i,i + |Vi | · |Vj | · (|Vi | − 1)/2 if p = q = i     0  nj,j + |Vj | · |Vi | · (|Vj | − 1)/2 if p = q = j     0 0 0 ni,j + 2 · |Vj | · mi,i + 2 · |Vi | · mj,j if {p, q} = {i, j}    n0 + |V | · m0 if p = i, q ∈ / {i, j} i i,q j,q np,q = . 0 0  np,i + |Vi | · mp,j if q = i, p ∈ / {i, j}      n0j,q + |Vj | · m0i,q if p = j, q ∈ / {i, j}     0 0  np,j + |Vj | · mp,i if q = j, p ∈ / {i, j}    n0 else p,q 15 Our next result is about computing the girth of a graph (size of a smallest cycle). To the best of our knowledge, the following Theorem 3 gives the first known polynomial parameterized algorithm for Girth. Theorem 3. For every G = (V, E), Girth can be solved in O(k 2 · (n + m))-time if a k-expression of G is given. Proof. The same as for Theorem 2, we assume the k-expression to be irredundant. It can be enforced up to linear-time preprocessing [32]. We proceed by dynamic programming on the kexpression. More precisely, let hG, `i be a labeled graph, ` : V (G) → {1, . . . , k}. We denote by µ(hG, `i) the girth of G. By convention, µ(hG, `i) = +∞ if G is empty, or more generally if G is a forest. Furthermore, µ(hG, `i) = µ(hG0 , `0 i) if hG, `i is obtained from hG0 , `0 i by: the addition of a new vertex with any label, or the identification of two labels. If hG, `i is the disjoint union of hG1 , `1 i and hG2 , `2 i then µ(hG, `i) = min{µ(hG1 , `1 i), µ(hG2 , `2 i)}. Suppose that hG, `i is obtained from hG0 , `0 i by adding a complete join between the set Vi of vertices labeled i and the set Vj of vertices labeled j. For every p, q ∈ {1, . . . , k}, we are interested in the minimum length of a nonempty path with an end in Vp and an end in Vq . However, for making easier our computation, we consider a slightly more complicated definition. If p 6= q then we define dp,q as the minimum length of a Vp Vq -path of G0 . Otherwise, p = q, we define dp,q as the minimum length taken over all the paths with two distinct ends in Vp , and all the nontrivial closed walks that intersect Vp (i.e., there is at least one edge in the walk, we allow repeated vertices or edges, however a same edge does not appear twice consecutively). Intuitively, dp,p may not represent the length of a path only in some cases where a cycle of length at most dp,p is already ensured to exist in the graph (in which case we needn’t consider this value). Furthermore note that such paths or closed walks as defined above may not exist. So, we may have dp,q = +∞. Then, let us consider a minimum-size cycle C of G. We distinguish between four cases. • If C does not contain an edge of the join, then it is a cycle of G0 . • Else, suppose that C contains exactly one edge of the join. Then removing this edge leaves a Vi Vj -path in G0 ; this path has length at least di,j . Conversely, if di,j 6= +∞ then there exists a cycle of length 1 + di,j in G, and so, µ(hG, `i) ≤ 1 + di,j . • Else, suppose that C contains exactly two edges of the join. In particular, since C is of minimum-size, and so, it is an induced cycle, the two edges of the join in C must have a common end in the cycle. It implies that removing the two edges from C leaves a path of G0 with either its two ends in Vi or its two ends in Vj . Such paths have respective length at least di,i and dj,j . Conversely, there exist closed walks of respective length 2 + di,i and 2 + dj,j in G. Hence, µ(hG, `i) ≤ 2 + min{di,i , dj,j }. • Otherwise, C contains at least three edges of the join. Since C is induced, it implies that C is a cycle of length four with two vertices in Vi and two vertices in Vj . Such a (non necessarily induced) cycle exists if and only if min{|Vi |, |Vj |} ≥ 2. Summarizing: ( min{µ(hG0 , `0 i), 1 + di,j , 2 + di,i , 2 + dj,j } µ(hG, `i) = min{µ(hG0 , `0 i), 1 + di,j , 2 + di,i , 2 + dj,j , 4} 16 if min{|Vi |, |Vj |} = 1 otherwise. In order to derive the claimed time bound, we are now left to prove that, after any operation, we can update the values dp,q , p, q ∈ {1, . . . , k}, in O(k 2 )-time. Clearly, these values cannot change when we add a new (isolated) vertex, with any label, and they can be updated by taking the minimum values when we take the disjoint union of two labeled graphs. We now need to distinguish between the two remaining cases. In what follows, let d0p,q represent the former values. • Suppose that label i is identified with label j. Then:   +∞   0 0 0   min{di,i , di,j , dj,j } dp,q = min{d0p,i , d0p,j }    min{d0i,q , d0j,q }     0 dp,q if i ∈ {p, q} if p = q = j if q = j if p = j else. • Otherwise, suppose that we add a complete join between the set Vi of vertices labeled i and the set Vj of vertices labeled j. The values d0p,q can only be decreased by using the edges of the join. In particular, using the fact that the k-expression is irredundant, we obtain:   1 if {p, q} = {i, j}     0  min{2, dp,q } if p = q = i, |Vi | ≥ 2 or p = q = j, |Vj | ≥ 2     0 0 0  min{di,i , 1 + di,j , 2 + dj,j } if p = q = i, |Vi | = 1    min{d0 , 1 + d0 , 2 + d0 } if p = q = j, |V | = 1 j j,j i,j i,i dp,q = . 0 0  min{di,q , 1 + dj,q } if p = i, q ∈ / {i, j}      min{d0p,i , d0p,j + 1} if q = i, p ∈ / {i, j}     0 0 min{dj,q , 1 + di,q } if p = j, q ∈ / {i, j}    min{d0 , d0 + 1} if q = j, p ∈ / {i, j} p,j p,i For all the remaining values of p and q, the difficulty is to account for the cases where two consecutive edges of the join must be used in order to decrease the value d0p,q . We do so by using the updated values dp,i , di,q , dp,j , dj,q instead of the former values d0p,i , d0i,q , d0j,p , d0q,j . More precisely, dp,q = min{d0p,q , dp,i + 1 + dj,q , dp,j + 1 + di,q } else. The bottleneck of the above algorithms is that they require a k-expression as part of the input. So far, the best-known approximation algorithms for clique-width run in O(n3 )-time, that dominates the total running time of our algorithms [75]. However, on a more positive side a k-expression can be computed in linear time for many classes of bounded clique-width graphs. In particular, combining Theorems 2 and 3 with Lemmas 1, 2 and 3 we obtain the following result. Corollary 4. For every G = (V, E), Triangle Counting and Girth can be solved in O(k 2 · (n + m))-time, for every k ∈ {mw(G), sw(G), q(G)}. 17 4 Parameterization, Hardness and Kernelization for some distance problems on graphs We prove separability results between clique-width and the upper-bounds for clique-width presented in Section 2. More precisely, we consider the problems Diameter, Eccentricities, Hyperbolicity and Betweenness Centrality (defined in Section 4.1), that have already been well studied in the field of “Hardness in P”. On the negative side, we show in Section 4.2 that we cannot solve these three above problems with a fully polynomial parameterized algorithm, when parameterized by clique-width. However, on a more positive side, we prove the existence of such algorithms in Sections 4.3, 4.4 and 4.5, when parameterized by either the modular-width, the split-width or the P4 -sparseness. 4.1 Distance problems considered Eccentricity-based problems The first problem considered is computing the diameter of a graph (maximum length of a shortestpath). Problem 4 (Diameter). Input: A graph G = (V, E). Output: The diameter of G, that is maxu,v∈V distG (u, v). Hardness results for Diameter have been proved, e.g., in [80, 1, 17, 3, 41]. Our new hardness results are proved for Diameter, while our fully polynomial parameterized algorithms apply to the following more general version of the problem. The eccentricity of a given vertex v is defined as eccG (v) = maxu∈V distG (u, v). Observe that diam(G) = maxv eccG (v). Problem 5 (Eccentricities). Input: A graph G = (V, E). Output: The eccentricities of the vertices in G, that is maxu∈V distG (u, v) for every v ∈ V . Gromov hyperbolicity Then, we consider the parameterized complexity of computing the Gromov hyperbolicity of a given graph. Gromov hyperbolicity is a measure of how close (locally) the shortest-path metric of a graph is to a tree metric [58]. We refer to [38] for a survey on the applications of Gromov hyperbolicity in computer science. 18 Problem 6 (Hyperbolicity). Input: A graph G = (V, E). Output: The hyperbolicity δ of G, that is: max u,v,x,y∈V distG (u, v) + distG (x, y) − max{distG (u, x) + distG (v, y), distG (u, y) + distG (v, y)} . 2 Hardness results for Hyperbolicity have been proved in [17, 26, 47]. Some fully polynomial parameterized algorithms, with a different range of parameters than the one considered in this work, have been designed in [43]. Centrality problems There are different notions of centrality in graphs. For clarity, we choose to keep the focus on one centrality measurement, sometimes called the Betweenness Centrality [48]. More precisely, let G = (V, E) be a graph and let s, t ∈ V . We denote by σG (s, t) the number of shortest st-paths in G. In particular, for every v ∈ V , σG (s, t, v) is defined as the number of shortest st-paths passing by v in G. Problem 7 (Betweenness Centrality). Input: A graph G = (V, E). Output: The betweenness centrality of every vertex v ∈ V , defined as: X BCG (v) = σG (s, t, v)/σG (s, t). s,t∈V \v See [1, 17, 41] for hardness results on Betweenness Centrality. 4.2 Hardness results for clique-width The goal in this section is to prove that we cannot solve the problems of Section 4.1 in time 2o(cw) n2−ε , for any ε > 0 (Theorems 5—7). These are the first known hardness results for cliquewidth in the field of “Hardness in P”. Our results are conditioned on the Strong Exponential Time Hypothesis (SETH): SAT cannot be solved in O∗ (2c·n )-time, for any c < 1 [63]. Furthermore, they are derived from similar hardness results obtained for treewidth. Precisely, a tree decomposition (T, X ) of G = (V, E) is a pair consisting of a tree T and of a family X = (Xt )t∈V (T ) of subsets of V indexed by the nodes of T and satisfying: S • t∈V (T ) Xt = V ; • for any edge e = {u, v} ∈ E, there exists t ∈ V (T ) such that u, v ∈ Xt ; • for any v ∈ V , the set of nodes {t ∈ V (T ) | v ∈ Xt } induces a subtree, denoted by Tv , of T . 19 The sets Xt are called the bags of the decomposition. The width of a tree decomposition is the size of a largest bag minus one. Finally, the treewidth of a graph G, denoted by tw(G), is the least possible width over its tree decompositions. Several hardness results have already been obtained for treewidth [3]. However, cw(G) ≤ 2tw(G) for general graphs [25], that does not help us to derive our lower-bounds. Roughly, we use relationships between treewidth and clique-width in some graph classes (i.e., bounded-degree graphs [28, 59]) in order to transpose the hardness results for treewidth into hardness results for clique-width. Namely: Lemma 6 ([28, 59]). If G has maximum degree at most d (with d ≥ 1), we have: • tw(G) ≤ 3d · cw(G) − 1; • cw(G) ≤ 20d · tw(G) + 22. Our reductions in what follows are based on Lemma 6, and on previous hardness results for bounded treewidth graphs and bounded-degree graphs [3, 41]. Theorem 5. Under SETH, we cannot solve Diameter in 2o(k) · n2−ε -time on graphs with maximum degree 4 and treewidth at most k, for any ε > 0. In particular, we cannot solve Diameter in 2o(k) · n2−ε -time on graphs with clique-width at most k, for any ε > 0. Proof. In [3], they proved that under SETH, we cannot solve Diameter in O(n2−ε )-time, for any ε > 0, in the class of tripartite graphs G = (A ∪ C ∪ B, E) such that: |A| = |B| = n, |C| = O(log n), and all the edges in E are between C and A ∪ B. Note that there exists a tree decomposition (T, X ) of G such that T is a path and the bags are the sets {a} ∪ C, a ∈ A and {b} ∪ C, b ∈ B. Hence, tw(G) = O(|C|) = O(log n) [3]. Then, we use the generic construction of [41] in order to transform G into a bounded-degree graph. We prove that graphs with treewidth O(log n) can be generated with this construction2 . More precisely, let Tbig and Tsmall be rooted balanced binary trees with respective number of leaves |A| = |B| = n and |C| = O(log n). There is a bijective correspondance between the leaves of Tbig and the vertices in A, resp. between the leaves of Tbig and the vertices in B. Similarly, there is a bijective correspondance between the leaves of Tsmall and the vertices of C. In order to construct G0 from G, we proceed as follows: u of Tsmall . We also replace every • We replace every vertex u ∈ A ∪ B with a disjoint copy Tsmall c,A c,B vertex c ∈ C with two disjoint copies Tbig , Tbig of Tbig with a common root. • For every a ∈ A, c ∈ C adjacent in G, we add a path of length p (fixed by the construction) c,A a between the leaf of Tsmall corresponding to c and the leaf of Tbig corresponding to a. In the same way, for every b ∈ B, c ∈ C adjacent in G, we add a path of length p between the leaf c,B b of Tsmall corresponding to c and the leaf of Tbig corresponding to b. A and T B be two other disjoint copies of T . For every a ∈ A we add a path of length • Let Tbig big big A and the root of T a p between the leaf corresponding to a in Tbig small . In the same way, for B and the every b ∈ B we add a path of length p between the leaf corresponding to b in Tbig b root of Tsmall . 2 Our construction has less degrees of freedom than the construction presented in [41]. 20 u • Finally, for every u ∈ A ∪ B, we add a path of length p with one end being the root of Tsmall . The resulting graph G0 has maximum degree 4. In [41], they prove that, under SETH, we cannot compute diam(G0 ) in O(n2−ε )-time, for any ε > 0. We now claim that tw(G0 ) = O(log n). Since by Lemma 6 we have tw(G0 ) = Θ(cw(G0 )) for bounded-degree graphs, it will imply cw(G0 ) = O(log n). In order to prove the claim, we assume w.l.o.g. that the paths added by the above construction have length p = 13 . Indeed, subdividing an edge does not change the treewidth [14]. Note that in this situation, we can also ignore the pending vertices added for the last step of the construction. Indeed, removing the pending vertices does not change the treewidth either [13]. Hence, from now on we consider the graph G0 resulting from the three first steps of the construction by taking p = 1. Let (T 0 , X 0 ) be a tree decomposition of Tbig of unit width. There is a one-to-one mapping B c,A and ec,B be between the nodes t ∈ V (T 0 ) and the edges et ∈ E(Tbig ). Furthermore, let eA t , et , et t A , T B , T c,A and T c,B , c ∈ C, respectively. For every node t ∈ the copies of edge et in the trees Tbig big big big 0 ), we define a new bag Y as follows. If e is not incident to a leaf-node then we set Y = eA ∪eB ∪ V (T t t t t t hS  i c,A c,B e ∪ e . Otherwise, e is incident to some leaf-node. Let a ∈ A, b ∈ B correspond t t t t t c∈C i  hS    c,A c,B at bt A B . By construction, to the leaf. We set Yt = V Tsmall ∪ V Tsmall ∪ et ∪ et ∪ c∈C et ∪ et (T 0 , (Yt )t∈V (T 0 ) ) is a tree decomposition of G0 . In particular, tw(G0 ) ≤ maxt∈V (T 0 ) |Yt | = O(log n), that finally proves the claim. 0 Finally, suppose by contradiction that diam(G0 ) can be computed in 2o(tw(G )) · n2−ε -time, for some ε > 0. Since tw(G0 ) = O(log n), it implies that diam(G0 ) can be computed in O(n2−ε )-time, for some ε > 0. The latter refutes SETH. Hence, under SETH we cannot solve Diameter in 2o(k) · n2−ε -time on graphs with maximum degree 4 and treewidth at most k, for any ε > 0. This negative result also holds for clique-width since cw(G0 ) = Θ(tw(G0 )). The following reduction to Betweenness Centrality is from [41]. Our main contribution is to upper-bound the clique-width and the treewidth of their construction. Theorem 6. Under SETH, we cannot solve Betweenness Centrality in 2o(k) · n2−ε -time on graphs with maximum degree 4 and treewidth at most k, for any ε > 0. In particular, we cannot solve Betweenness Centrality in 2o(k) · n2−ε -time on graphs with clique-width at most k, for any ε > 0. Proof. Let G0 be the graph from the reduction of Theorem 5. In [41], the authors propose a reduction from G0 to H such that, under SETH, we cannot solve Betweenness Centrality for H in O(n2−ε )-time, for any ε > 0. In order to prove the theorem, it suffices to prove tw(H) = Θ(tw(G0 )). Indeed, the construction of H from G0 is as follows. u • For every u ∈ A ∪ B, we remove the path of length p with one end being the root of Tsmall , 0 added at the last step of the construction of G . This operation can only decrease the treewidth. A and T B . Recall that • Then, we add a path of length p between the respective roots of Tbig big we can assume p = 1 since subdividing an edge does not modify the treewidth [14]. Adding an edge to a graph increases its treewidth by at most one. 3 The hardness result of [41] holds for p = ω(log n). We reduce to the case p = 1 only for computing the treewidth. 21 • Finally, let H1 be the graph so far constructed. We make a disjoint copy H2 of H1 . This 0 b operation does not modify the treewidth. Then, for every b ∈ B, let Tsmall be the copy of 0 b b Tsmall in H2 . We add a new vertex b0 that is uniquely adjacent to the root of Tsmall . The addition of pending vertices does not modify the treewidth either [13]. Overall, tw(H) ≤ tw(G0 ) + 1 = O(log n). Furthermore, since H has maximum degree at most 4, by Lemma 6 we have cw(H) = Θ(tw(H)) = O(log n). Our next reduction for Hyperbolicity is inspired from the one presented in [17]. However, the authors in [17] reduce from a special case of Diameter where we need to distinguish between graphs with diameter either 2 or 3. In order to reduce from a more general case of Diameter we need to carefully refine their construction. Theorem 7. Under SETH, we cannot solve Hyperbolicity in 2o(k) · n2−ε -time on graphs with clique-width and treewidth at most k, for any ε > 0. Proof. We use the graph G0 from the reduction of Theorem 5. More precisely, let us take p = ω(log n) for the size of the paths in the construction. It has been proved in [41] that either diam(G0 ) = (4 + o(1))p or diam(G0 ) = (6 + o(1))p. Furthermore, under SETH we cannot decide in which case we are in truly subquadratic time. Our reduction is inspired from [17]. Let H be constructed from G0 as follows (see also Fig. 7). • We add two disjoint copies Vx , Vy of V (G0 ) and the three vertices x, y, z ∈ / V (G0 ). We stress that Vx and Vy are independent sets. Furthermore, for every v ∈ V , we denote by vx and vy the copies of v in Vx and Vy , respectively. • For every v ∈ V (G0 ), we add a vvx -path Pvx of length (3/2 + o(1))p, and similarly we add a vvy -path Pvy of length (3/2 + o(1))p. • Furthermore, for every v ∈ V (G0 ) we also add a xvx -path Qxv of length (3/2 + o(1))p; a yvy z,y path Qyv of length (3/2 + o(1))p; a zvx -path Qz,x v of length (3/2 + o(1))p and a zvy -path Qv of length (3/2 + o(1))p. z ux uy u x Vx G' Vy y v vy vx Figure 7: The graph H from the reduction of Theorem 7. We claim that the resulting graph H is such that tw(H) = tw(G0 ) + O(1) and cw(H) = cw(G0 ) + O(1). Indeed, let us first consider H 0 = H \ {x, y, z}. The graph H 0 is obtained from G0 by 22 adding some disjoint trees rooted at the vertices of V (G0 ). In particular, it implies tw(H 0 ) = tw(G0 ), hence (by adding x, y, z in every bag) tw(H) ≤ tw(H 0 ) + 3 ≤ tw(G0 ) + 3. Furthermore, let us fix a k-expression for G0 . We transform it to a (k + 16)-expression for H as follows. We start adding x, y, z with three distinct new labels. Then, we follow the k-expression for G0 . Suppose a new vertex v ∈ V (G0 ), with label i is introduced. It corresponds to some tree Tv in H 0 , that is rooted at v. Every such a tree has clique-width at most 3 [57]. So, as an intermediate step, let us fix a 3-expression for Tv . We transform it to a 12-expression for Tv : with each new label encoding the former label in the 3 expression (3 possibilities), and whether the node is either the root v or adjacent to one of x, y, z (4 possibilities). This way, we can make x, y, z adjacent to their neighbours in Tv , using the join operation. Then, since the root v has a distinguished label, we can “freeze” all the other nodes in Tv \ v using an additional new label and relabeling operations. Finally, we relabel v with its original label i in the k-expression of G0 , and then we continue following this k-expression. Summarizing, cw(H) ≤ cw(G0 ) + 16. Next, we claim that δ(H) ≥ (3 + o(1))p if diam(G0 ) = (6 + o(1))p, while δ(H) ≤ (11/4 + o(1))p if diam(G0 ) = (4 + o(1))p. Recall that by Theorem 5, under SETH we cannot decide in which 0 0 case we are in time 2o(tw(G )) n2−ε = 2o(cw(G )) n2−ε , for any ε > 0. Therefore, proving the claim will prove the theorem. First suppose that diam(G0 ) = (6 + o(1))p. Let u, v ∈ V (G0 ) satisfy distG0 (u, v) = (6 + o(1))p. Observe that diam(G0 ) ≤ (6 + o(1))p = 4 · (3/2 + o(1))p, therefore G0 is an isometric subgraph of H by construction. Then, S1 = distH (u, v) + distH (x, y) = (12 + o(1))p; S2 = distH (u, x) + distH (v, y) = (6 + o(1))p; S3 = distH (u, y) + distH (v, x) = S2 . As a result, we obtain δ(H) ≥ (S1 − max{S2 , S3 })/2 = (3 + o(1))p. Second, suppose that diam(G0 ) = (4 + o(1))p. We want to prove δ(H) ≤ (11/4 + o(1))p. By contradiction, let a, b, c, d ∈ V (H) satisfy: S1 = distH (a, b) + distH (c, d) ≥ S2 = distH (a, c) + distH (b, d) ≥ S3 = distH (a, d) + distH (b, c), S1 − S2 > (11/2 + o(1))p. The hyperbolicity of a given 4-tuple is upper-bounded by the minimum distance between two vertices of the 4-tuple [16, 22, 81]. So, let us consider the distances in H. • Let v ∈ V (G0 ). For every u ∈ V (G0 ), distH (u, v) ≤ distG (u, v) ≤ (4 + o(1))p. Furthermore for every u0 ∈ Pux , distH (v, u0 ) ≤ distH (v, u) + distH (u, u0 ) ≤ (11/2 + o(1))p. Similarly for every u0 ∈ Puy , distH (v, u0 ) ≤ distH (v, u) + distH (u, u0 ) ≤ (11/2 + o(1))p. For every u0 ∈ Qxu , distH (v, u0 ) ≤ distH (v, x) + distH (x, u0 ) ≤ (9/2 + o(1))p. We prove in the z,y 0 same way that for every u0 ∈ Qyu ∪ Qz,x u ∪ Qu , distH (v, u ) ≤ (9/2 + o(1))p. Summarizing, eccH (v) ≤ (11/2 + o(1))p. • Let v 0 ∈ Pvx , for some v ∈ V (G0 ). For every u ∈ V (G0 ) and u0 ∈ Pux there are two cases. Suppose that distH (u0 , ux ) ≤ p+o(1) or distH (v 0 , vx ) ≤ p + o(1). Then, distH (v 0 , u0 ) ≤ distH (v 0 , vx ) + distH (vx , ux ) + distH (ux , u0 ) ≤ (1 + 3 + 3/2 + o(1))p = (11/2 + o(1))p. Otherwise, max{distH (u0 , u), distH (v 0 , v)} ≤ (1/2 + o(1))p, and so, distH (u0 , v 0 ) ≤ distH (u0 , u) + distH (u, v) + distH (v 0 , v) ≤ (5 + o(1))p. Similarly (replacing ux with uy ), for every u0 ∈ Puy we have dist(v 0 , u0 ) ≤ (11/2 + o(1))p. 23 For every u0 ∈ Qxu , distH (v 0 , u0 ) ≤ distH (v 0 , vx ) + distH (x, vx ) + distH (x, u0 ) ≤ (9/2 + o(1))p. z,y 0 0 0 In the same way for every u0 ∈ Qz,x u ∪ Qu , distH (v , u ) ≤ distH (v , vx ) + distH (z, vx ) + 0 distH (z, u ) ≤ (9/2 + o(1))p. For every u0 ∈ Qyu , we first need to observe that distH (vx , uy ) = (3 + o(1))p and distH (v, y) = (3 + o(1))p. In particular if distH (v, v 0 ) ≤ p + o(1) then, distH (v 0 , u0 ) ≤ distH (v, v 0 ) + distH (v, y) + distH (y, u0 ) ≤ (11/2 + o(1))p. Otherwise, distH (v 0 , u0 ) ≤ distH (v 0 , vx ) + distH (vx , uy ) + distH (uy , u0 ) ≤ (1/2 + 3 + 3/2 + o(1))p = (5 + o(1))p. Summarizing, eccH (v 0 ) ≤ (11/2 + o(1))p. • Let v 0 ∈ Pvy , for some v ∈ V (G0 ). In the same way as above, we prove eccH (v 0 ) ≤ (11/2 + o(1))p. z,y 0 • Let v 0 ∈ Qz,x v ∪ Qv , for some v ∈ V (G ). z,y 0 0 0 For every u ∈ V (G0 ) and for every u0 ∈ Qz,x u ∪ Qu we have distH (v , u ) ≤ distH (v , z) + 0 distH (z, u ) ≤ (3 + o(1))p. For every u0 ∈ Qxu we have distH (v 0 , u0 ) ≤ distH (v 0 , z) + distH (z, ux ) + distH (ux , u0 ) ≤ (9/2 + o(1))p. Similarly for every u0 ∈ Qyu we have distH (v 0 , u0 ) ≤ (9/2 + o(1))p. Summarizing, eccH (v 0 ) ≤ (11/2 + o(1))p. In particular, every vertex in H has eccentricity at most (11/2 + o(1))p, except maybe S S y x However, S1 − S2 ≤ = X and those in those in v∈V (G0 ) Qv = Y . v∈V (G0 ) Qv min{distH (a, b), distH (c, d)} [22]. So, we can assume w.l.o.g. a, c ∈ X and b, d ∈ Y . Furthermore, S1 −S2 ≤ 2·distH (a, c) [16, 81]. Hence, (11/2+o(1))p < S1 −S2 ≤ 2·distH (a, c) ≤ 2·(distH (a, x)+ distH (c, x)). It implies max{distH (a, x), distH (c, x)} > (11/8+o(1))p = (3/2−1/8+o(1))p. Assume by symmetry that distH (a, x) > (3/2 − 1/8 + o(1))p. Then, distH (a, Vx ) < (1/8 + o(1))p. However, distH (a, c) ≤ distH (a, Vx ) + (3 + o(1))p + distH (c, Vy ) < (1/8 + 3 + 3/2 + o(1))p < (11/2 + o(1))p. A contradiction. Therefore, we obtain as claimed that δ(H) ≤ (11/4 + o(1))p. It is open whether any of these above problems can be solved in time 2O(k) · n on graphs with clique-width at most k (resp., on graphs with treewidth at most k, see [3, 62]). 4.3 Parameterized algorithms with split decomposition We show how to use split decomposition as an efficient preprocessing method for Diameter, Eccentricities, Hyperbolicity and Betweenness Centrality. Improvements obtained with modular decomposition will be discussed in Section 4.4. Roughly, we show that in order to solve the problems considered, it suffices to solve some weighted variant of the original problem for every split component (subgraphs of the split decomposition) separately. However, weights intuitively represent the remaining of the graph, so, we need to account for some dependencies between the split components in order to define the weights properly. In order to overcome this difficulty, we use in what follows a tree-like structure over the split components in order to design our algorithms. A split decomposition tree of G is a tree T where the nodes are in bijective correspondance with the subgraphs of the split decomposition of G, and the edges of T are in bijective correspondance with the simple decompositions used for their computation. More precisely: 24 • If G is either degenerate, or prime for split decomposition, then T is reduced to a single node; • Otherwise, let (A, B) be a split of G and let GA = (A ∪ {b}, EA ), GB = (B ∪ {a}, EB ) be the corresponding subgraphs of G. We construct the split decomposition trees TA , TB for GA and GB , respectively. Furthermore, the split marker vertices a and b are contained in a unique split component of GA and GB , respectively. We obtain T from TA and TB by adding an edge between the two nodes that correspond to these subgraphs. A split decomposition tree can be constructed in linear-time [20]. Diameter and Eccentricities Lemma 7. Let (A, B) be a split of G = (V, E) and let GA = (A ∪ {b}, EA ), GB = (B ∪ {a}, EB ) be the corresponding subgraphs of G. Then, for every u ∈ A we have: eccG (u) = max{eccGA (u), distGA (u, b) + eccGB (a) − 1}. Proof. Let C = NG (B) ⊆ A and D = NG (A) ⊆ B. In order to prove the claim, we first need to observe that, since (A, B) is a split of G, we have, for every v ∈ V : ( distGA (u, v) if v ∈ A distG (u, v) = distG (u, C) + 1 + distG (v, D) if v ∈ B. Furthermore, distG (u, C) = distGA (u, b) − 1, and similarly distG (v, D) = distGB (v, a) − 1 ≤ eccGB (a) − 1. Hence, eccG (u) ≤ max{eccGA (u), distGA (u, b) + eccGB (a) − 1}. Conversely, eccGA (u) = max{distGA (u, b)} ∪ {distGA (u, v) | v ∈ A} = max{distG (u, D)} ∪ {distG (u, v) | v ∈ A} ≤ eccG (u). In the same way, let v ∈ B maximize distG (v, C). We have: distG (u, v) = distGA (u, b) + eccGB (a) − 1 ≤ eccG (u). Theorem 8. For every G = (V, E), Eccentricities can be solved in O(sw(G)2 · n + m)-time. In particular, Diameter can be solved in O(sw(G)2 · n + m)-time. Proof. Let T be a split decomposition tree of G, with its nodes being in bijective correspondance with the split components C1 , C2 , . . . , Ck . It can be computed in linear-time [20]. We root T in C1 . For every 1 ≤ i ≤ k, let Ti be the subtree of T that is rooted in Ci . If i > 1 then let Cp(i) be its parent in T . By construction of T , the edge {Cp(i) , Ci } ∈ E(T ) corresponds to a split (Ai , Bi ) of G, where V (Ci ) ⊆ Ai . Let GAi = (Ai ∪ {bi }, EAi ), GBi = (Bi ∪ {ai }, EBi ) be the corresponding subgraphs of G. We observe that Ti is a split decomposition tree of GAi , T \ Ti is a split decomposition tree of GBi . Our algorithm proceeds in two main steps, with each step corresponding to a different traversal of the tree T . First, let G1 = G and let Gi = GAi for every i > 1. We first compute, for every 1 ≤ i ≤ k and for every vi ∈ V (Ci ), its eccentricity in Gi . In order to do so, we proceed by dynamic programming on the tree T : • If Ci is a leaf of T then Eccentricities can be solved: in O(|V (Ci )|)-time if Ci induces a star or a complete graph; and in O(|V (Ci )|3 ) = O(sw(G)2 · |V (Ci )|)-time else. 25 • Otherwise Ci is an internal node of T . Let Ci1 , Ci2 , . . . , Cil be the children of Ci in T . Every edge {Ci , Cit } ∈ E(T ), 1 ≤ t ≤ l corresponds to a split (Ait , Bit ) of Gi , where V (Cit ) ⊆ Ait . We name bit ∈ V (Cit ), ait ∈ V (Ci ) the vertices added after the simple decomposition. Furthermore, let us define e(ait ) = eccGit (bit ) − 1. For every other vertex u ∈ V (Ci ) \ {ai1 , ai2 , . . . , aik }, we define e(u) = 0. Then, applying Lemma 7 for every split (Ait , Bit ) we get: ∀u ∈ V (Ci ), eccGi (u) = max distCi (u, v) + e(v). v∈V (Ci ) We distinguish between three cases. 1. If Ci is complete, then we need to compute xi ∈ V (Ci ) maximizing e(xi ), and yi ∈ V (Ci )\{xi } maximizing e(yi ). It can be done in O(|V (Ci )|)-time. Furthermore, for every u ∈ V (Ci ), we have eccGi (u) = 1 + e(xi ) if u 6= xi , and eccGi (xi ) = max{e(xi ), 1 + e(yi )}. 2. If Ci is a star with center node r, then we need to compute a leaf xi ∈ V (Ci ) \ {r} maximizing e(xi ), and another leaf yi ∈ V (Ci ) \ {xi , r} maximizing e(yi ). It can be done in O(|V (Ci )|)-time. Furthermore, eccGi (r) = max{e(r), 1 + e(xi )}, eccGi (xi ) = max{e(xi ), 1 + e(r), 2 + e(yi )}, and for every other u ∈ V (Ci ) \ {xi , r} we have eccGi (u) = max{1 + e(r), 2 + e(xi )}. 3. Otherwise, |V (Ci )| ≤ sw(G), and so, all the eccentricities can be computed in O(|V (Ci )||E(Ci )|) = O(sw(G)2 · |V (Ci )|)-time. P Overall, this step takes total time O(sw(G)2 · i |V (Ci )|) = O(sw(G)2 · n). Furthermore, since G1 = G, we have computed eccG (v1 ) for every v1 ∈ V (C1 ). Second, for every 2 ≤ i ≤ k, we recall that by Lemma 7: ∀vi ∈ V (Gi ), eccG (vi ) = max{eccGi (vi ), distGi (vi , bi ) + eccGBi (ai ) − 1}. In particular, since we have already computed eccGi (vi ) for every vi ∈ V (Ci ) (and as a byproduct, distGi (vi , bi )), we can compute eccG (vi ) from eccGBi (ai ). So, we are left to compute eccGBi (ai ) for every 2 ≤ i ≤ k. In order to do so, we proceed by reverse dynamic programming on the tree T . More precisely, let Cp(i) be the parent node of Ci in T , and let Cj0 = Ci , Cj1 , Cj2 , . . . , Cjk denote the children of Cp(i) in T . For every 0 ≤ t ≤ k, the edge {Cp(i) , Cjt } represents a split (Ajt , Bjt ), where V (Cjt ) ⊆ Ajt . So, there has been vertices bjt ∈ V (Cjt ), ajt ∈ V (Cp(i) ) added by the corresponding simple decomposition. We define e0 (ajt ) = eccGjt (bjt ) − 1. Furthermore, if p(i) > 1, let Cp2 (i) be the parent of Cp(i) in T . Again, the edge {Cp2 (i) , Cp(i) } represents a split (Ap(i) , Bp(i) ), where V (Cp(i) ) ⊆ Ap(i) . So, there has been vertices bp(i) ∈ V (Cp(i) ), ap(i) ∈ V (Cp2 (i) ) added by the corresponding simple decomposition. Let us define e0 (bp(i) ) = eccGBp(i) (ap(i) ) − 1 (obtained by reverse dynamic programming on T ). Finally, for any other vertex u ∈ V (Cp(i) ), let us define e0 (u) = 0. Then, by applying Lemma 7 it comes: ∀0 ≤ t ≤ k, eccGBi (ait ) = t max v∈V (Cp(i) )\{ait } distCp(i) (ait , v) + e0 (v). We can adapt the techniques of the first step in order to compute all the above values in O(sw(G)2 · |V (Cp(i) )|)-time. Overall, the time complexity of the second step is also O(sw(G)2 · n). Finally, since a split decomposition can be computed in O(n+m)-time, and all of the subsequent steps take O(sw(G)2 · n)-time, the total running time of our algorithm is an O(sw(G)2 · n + m). 26 Gromov hyperbolicity It has been proved in [81] that for every graph G, if every split component of G is δ-hyperbolic then δ(G) ≤ max{1, δ}. We give a self-contained proof of this result, where we characterize the gap between δ(G) and the maximum hyperbolicity of its split components. Lemma 8. Let (A, B) be a split of G = (V, E) and let C = NG (B) ⊆ A, D = NG (A) ⊆ B. Furthermore, let GA = (A ∪ {b}, EA ), GB = (B ∪ {a}, EB ) be the corresponding subgraphs of G. Then, δ(G) = max{δ(GA ), δ(GB ), δ ∗ } where:   if neither C nor D is a clique; 1 ∗ δ = 1/2 if min{|C|, |D|} ≥ 2 and exactly one of C or D is a clique;   0 otherwise. Proof. Since GA , GB are isometric subgraphs of G, we have δ(G) ≥ max{δ(GA ), δ(GB )}. Conversely, for every u, v, x, y ∈ V define L and M to be the two largest sums amongst {distG (u, v) + distG (x, y), distG (u, x) + distG (v, y), distG (u, y) + distG (v, x)}. Write δ(u, v, x, y) = (L − M )/2. Furthermore, assume that δ(u, v, x, y) = δ(G). W.l.o.g., |{u, v, x, y} ∩ A| ≥ |{u, v, x, y} ∩ B|. In particular, if u, v, x, y ∈ A then δ(u, v, x, y) ≤ δ(GA ). Otherwise, there are two cases. • Suppose |{u, v, x, y} ∩ A| = 3. W.l.o.g., y ∈ B. Then, for every w ∈ {u, v, x} we have distG (w, y) = distGA (w, b) + distGB (a, y) − 1. Hence, δ(u, v, x, y) = δ(u, v, x, b) ≤ δ(GA ). • Otherwise, |{u, v, x, y} ∩ A| = 2. W.l.o.g. x, y ∈ B. Observe that M = distG (u, x) + distG (v, y) = distG (u, y) + distG (v, x) = distGA (u, b) + distGA (v, b) + distGB (a, x) + distGB (a, y) − 2. Furthermore, L = distG (u, v) + distG (x, y) ≤ distGA (u, b) + distGA (v, b) + distGB (a, x) + distGB (a, y). Hence, δ(u, v, x, y) = max{0, L − M }/2 ≤ 1. In particular: – Suppose min{|C|, |D|} = 1. Then, the 4-tuple u, v, x, y is disconnected by some cutvertex c. In particular, M = distG (u, c) + distG (v, c) + distG (c, x) + distG (c, y) ≥ L, and so, δ(u, v, x, y) = 0. Thus we assume from now on that min{|C|, |D|} ≥ 2. – Suppose L − M = 2. It implies both a is on a shortest xy-path (in GB ) and b is on a shortest uv-path (in GA ). Since there can be no simplicial vertices on a shortest path, we obtain that neither a nor b can be simplicial. Thus, C and D are not cliques. Conversely, if C and D are not cliques then there exists an induced C4 with two ends in C and two ends in D. As a result, δ(G) ≥ 1. – Suppose L − M = 1. Either C or D is not a clique. Conversely, if either C or D is not a clique then, since we also assume min{|C|, |D|} ≥ 2, there exists either an induced C4 or an induced diamond with two vertices in C and two vertices in D. As a result, δ(G) ≥ 1/2. Theorem 9. For every G = (V, E), Hyperbolicity can be solved in O(sw(G)3 · n + m)-time. Proof. First we compute in linear-time the split components C1 , C2 , . . . , Ck of G. By Lemma 8, we have δ(G) ≥ maxi δ(Ci ). Furthermore, for every 1 ≤ i ≤ k we have: if Ci induces a star or a complete graph, then δ(Ci ) = 0; otherwise, |V (Ci )| ≤ sw(G), and so, δ(Ci ) can be computed in 27 O(|V (Ci )|4 ) = O(sw(G)3 · |V (Ci )|)-time, simply P by iterating over all possible 4-tuples. Summariz3 ing, we can compute maxi δ(Ci ) in O(sw(G) · i |V (Ci )|) = O(sw(G)3 · n)-time. By Lemma 8 we have δ(G) ≤ max{1, maxi δ(Ci )}. Therefore, if maxi δ(Ci ) ≥ 1 then we are done. Otherwise, in order to compute δ(G), by Lemma 8 it suffices to check whether the sides of every split used for the split decomposition induce a complete subgraph. For that, we use a split decomposition tree T of G. Indeed, recall that the edges of T are in bijective correspondance with the splits. Let us root T in C1 . Notations are from the proof of Theorem 8. In particular, for every 1 ≤ i ≤ k let Ti be the subtree of T that is rooted in Ci . If i > 1 then let Cp(i) be its parent in T . By construction of T , the edge {Cp(i) , Ci } ∈ E(T ) corresponds to a split (Ai , Bi ) of G, where V (Ci ) ⊆ Ai . Let GAi = (Ai ∪ {bi }, EAi ), GBi = (Bi ∪ {ai }, EBi ) be the corresponding subgraphs of G. Vertex ai is simplicial in GBi if and only if the side NG (Ai ) is a clique. Similarly, vertex bi is simplicial in GAi if and only if the side NG (Bi ) is a clique. So, we perform tree traversals of T in order to decide whether ai and bi are simplicial. More precisely, we recall that Ti and T \ Ti are split decomposition trees of GAi and GBi , respectively. We now proceed in two main steps. • First, we decide whether bi is simplicial in GAi by dynamic programming. More precisely, let Ci1 , Ci2 , . . . , Cik be the children of Ci in T . (possibly, k = 0 if Ci is a leaf). Then, bi is simplicial in GAi if and only if: it is simplicial in Ci ; and for every 1 ≤ t ≤ k such that {bi , ait } ∈ E(Ci ), we have that bit is simplicial in GAit . In particular, testing whether bi is simplicial in Ci takes time: O(1) if Ci induces a star or a complete graph; and O(|V (Ci )|2 ) = O(sw(G) · |V (Ci )|) otherwise. Since a vertex can have at most |V (Ci )| − 1 neighbours in Ci , testing whether bi is simplicialP in GAi can be done in O(|V (Ci )|) additional time. So, overall, the first step takes O(sw(G) · i |V (Ci )|) = O(sw(G) · n)-time. • Second, we decide whether ai is simplicial in GBi by reverse dynamic programming. Let Cj0 = Ci , Cj1 , Cj2 , . . . , Cjk denote the children of Cp(i) in T . Furthermore, if p(i) 6= 1 then let Cp2 (i) be the parent of Cp(i) in T . Then, ai is simplicial in GBi if and only if: it is simplicial in Cp(i) ; for every 1 ≤ t ≤ k such that {ai , ajt } ∈ E(Cp(i) ), we have that bjt is simplicial in GAjt ; if p(i) 6= 1 and {ai , bp(i) } ∈ E(Cp(i) ), we also have that ap(i) is simplicial in GBp(i) . Testing, for every 0 ≤ t ≤ k, whether ajt is simplicial in Cp(i) takes total time: O(|V (Cp(i) )|) if Cp(i) induces a star or a complete graph; and O(|V (Cp(i) )|3 ) = O(sw(G)2 · |V (Cp(i) )|) otherwise. Then, for stars and prime components, we can test, for every 0 ≤ t ≤ k, whether ajt is simplicial in GBjt in total O(|E(Cp(i) )|)-time, that is O(|V (Cp(i) )|) for stars and O(|V (Cp(i) )|2 ) = O(sw(G) · |V (Cp(i) )|) for prime components. For the case where Cp(i) is a complete graph then, since all the vertices in Cp(i) are pairwise adjacent, we only need to check whether there is at least one vertex ajt such that bjt is non simplicial in GAjt , and also if p(i) > 1 whether ap(i) is non simplicial in GBp(i) . It takes O(|V (Cp(i) )|)-time. So, overall, the second step takes O(sw(G)2 · n)-time. Corollary 10 ( [81]). For every connected G = (V, E) we have δ(G) ≤ max{1, b(sw(G) − 1)/2c}. 28 Betweenness Centrality The following subsection can be seen as a broad generalization of the preprocessing method presented in [76]. We start introducing a generalization of Betweenness Centrality for vertexweighted graphs. Admittedly, the proposed generalization is somewhat technical. However, it will make easier the dynamic programming of Theorem 11. Precisely, let G = (V, E, α, β) with α, β : V → N be weight functions. Intuitively, for a split marker vertex v, α(v) represents the side of the split replaced by v, while β(v) represents the total number of vertices removed by the simple decomposition. For every path P = (v1 , v2 , . . . , v` ) of G, Q` the length of P is equal to the number ` of edges in the path, while the cost of P is equal to i=1 α(vi ). Furthermore, for every s, t ∈ V , the value σG (s, t) is obtained by summing the cost over all the shortest st-paths in G. Similarly, for every s, t, v ∈ V , the value σG (s, t, v) is obtained by summing the cost over all the shortest st-paths in G that contain v. The betweenness centrality of vertex v is defined as: X 1 σG (s, t, v) β(s)β(t) . α(v) σG (s, t) s,t∈V \v Note that if all weights are equal to 1 then this is exactly the definition of Betweenness Centrality for unweighted graphs. Lemma 9. Let (A, B) be a split of G = (V, E, α, β) and let C = NG (B) ⊆ A, D = NG (A) ⊆ B. Furthermore, let GA = (A ∪ {b}, EA , αA , βA ), GB = (B ∪ {a}, EB , αB , βB ) be the corresponding subgraphs of G, where:   αA (v) = α(v), βA (v) = β(v) if v ∈ A    α (u) = α(u), β (u) = β(u) if u ∈ B B B P P αA (b) = u∈D α(u), βA (b) = u∈B β(u)   P  α (a) = P B v∈C α(v), βB (a) = v∈A β(v). Then for every v ∈ A we have: BCG (v) = BCGA (v) + [v ∈ C]BCGB (a). Proof. Let v ∈ A be fixed. We consider all possible pairs s, t ∈ V \ v such that distG (s, t) = distG (s, v) + distG (v, t). Suppose that s, t ∈ A \ v. Since (A, B) is a split, the shortest st-paths in G are contained in NG [A] = A ∪ D. In particular, the shortest st-paths in GA are obtained from the shortest st-paths in G by replacing any vertex d ∈ D by the split marker vertex b. Conversely, the shortest st-paths in G are obtained from P the shortest st-paths in GA by replacing b with any vertex d ∈ D. Hence, σGA (s, t, b) = d∈D σG (s, t, d), that implies σG (s, t) = σGA (s, t). Furthermore, σG (s, t, v) = σG (s, v)σG (v, t) = σGA (s, v)σGA (v, t) = σGA (s, t, v). As a result, σG (s, t, v)/σG (s, t) = σGA (s, t, v)/σGA (s, t). Suppose that s ∈ B, t ∈ A \ v. Every shortest st-path in G is the concatenation of a shortσ (s,a)·σ (b,t) A . We can furtherest sD-path with a shortest tC-path. Therefore, σG (s, t) = GBαB (a)·αG A (b) more observe v is on a shortest st-path in G if, and only if, v is on a shortest bt-path in GA . σ (s,a)·σ (b,v) Then, σG (s, t, v) = σG (s, v)σG (v, t) = GBαB (a)·αGAA(b) σGA (v, t). As a result, σG (s, t, v)/σG (s, t) = σGA (b, t, v)/σGA (b, t). 29 Finally, suppose that s, t ∈ B. Again, since (A, B) is a split the shortest st-paths in G are contained in NG [B] = B ∪ C. In particular, σG (s, t, v) 6= 0 if, and only if, we have v ∈ C and σGB (s, t, a) 6= 0. More generally, if v ∈ C then σG (s, t, v) = ααBA (v) (a) σGB (s, t, a). As a result, if v ∈ C then σG (s, t, v)/σG (s, t) = αA (v) αB (a) · σGB (s, t, a)/σGB (s, t). Overall, we have: X σG (s, t, v) 1 β(s)β(t) BCG (v) = α(v) σG (s, t) s,t∈V \v = X σG (s, t, v) 1 1 β(s)β(t) + α(v) σG (s, t) α(v) s,t∈A\v = 1 αA (v) X βA (s)βA (t) s,t∈A\v X β(s)β(t) s,t∈B s∈B, t∈A\v σGA (s, t, v) 1 + σGA (s, t) αA (v) σG (s, t, v) 1 X σG (s, t, v) + β(s)β(t) σG (s, t) α(v) σG (s, t) X βB (s)βA (t) s∈B, t∈A\v σGA (b, t, v) σGA (b, t) 1 αA (v) σGB (s, t, a) [v ∈ C] βB (s)βB (t) · αA (v) αB (a) σGB (s, t) s,t∈B   P X β(s) X β (b) σ (b, t, v) σG (b, t, v) A G A  + s∈B + [v ∈ C]BCGB (a) = BCGA (v) − βA (t) βA (t) A αA (v) σGA (b, t) αA (v) σGA (b, t) + X t∈A\v t∈A\v = BCGA (v) + [v ∈ C]BCGB (a), that finally proves the lemma. Theorem 11. For every G = (V, E), Betweenness Centrality can be solved in O(sw(G)2 · n + m)-time. Proof. Let T be a split decomposition tree of G, with its nodes being in bijective correspondance with the split components C1 , C2 , . . . , Ck . It can be computed in linear-time [20]. As for Theorem 8, we root T in C1 . For every 1 ≤ i ≤ k, let Ti be the subtree of T that is rooted in Ci . If i > 1 then let Cp(i) be its parent in T . We recall that by construction of T , the edge {Cp(i) , Ci } ∈ E(T ) corresponds to a split (Ai , Bi ) of G, where V (Ci ) ⊆ Ai . Furthermore, let GAi = (Ai ∪ {bi }, EAi ), GBi = (Bi ∪ {ai }, EBi ) be the corresponding subgraphs of G. We observe that Ti is a split decomposition tree of GAi , while T \ Ti is a split decomposition tree of GBi . Let us assume G = (V, E, α, β) to be vertex-weighted, with initially α(v) = β(v) = 1 for every v ∈ V . For every i > 1, let GAi = (Ai ∪ {bi }, EAi , αAi , βAi ), GBi = (Bi ∪ {ai }, EBi , αBi , βBi ) be as described in Lemma 9. In particular, for every i > 1:   αAi (v) = α(v) = 1, βAi (v) = β(v) = 1 if v ∈ Ai    α (u) = α(u) = 1, β (u) = β(u) = 1 if u ∈ B i Bi Bi  α (b ) = |N (A )|, β (b ) = |B | i i Ai i G Ai i    α (a ) = |N (B )|, β (a ) = |A |. i i Bi i G Bi i Hence, all the weights can be computed in linear-time by dynamic programming over T . We set G1 = G while Gi = GAi for every i > 1. Furthermore, we first aim at computing BCGi (v) for every v ∈ V (Ci ). If Ci is a leaf of T then there are three cases to be considered. 30 1. Suppose Gi is a complete graph. Then, for every v ∈ V (Ci ) we have BCGi (v) = 0. 2. Suppose Gi is a star, with center node r. In particular, BCGi (v) = 0 for every v ∈ V (Ci )\{r}. Furthermore, since r is onto the unique shortest path between P every two leaves s, t ∈ V (Ci ) \ {r}, we have σGi (s, t, r) = σGi (s, t). Let us write β(Gi ) = v∈V (Ci )\{r} βGi (v). We have: BCGi (r) = 1 αGi (r) X βGi (s)βGi (t) s,t∈V (Ci )\{r}   = = 1 2αGi (r) X s∈V (Ci )\{r} 1 2αGi (r) X βGi (s)  X βGi (t) t∈V (Ci )\{r,s} βGi (s) (β(Gi ) − βGi (s)) . s∈V (Ci )\{r} It can be computed in O(|V (Ci )|)-time. 3. Finally, suppose Gi is prime for split decomposition. Brandes algorithm [18] can be generalized to that case. For every v ∈ V (Ci ), we first compute a BFS ordering from v. It takes O(|E(Ci )|)-time. Furthermore for every u ∈ V (Ci ) \ {v}, let N + (u) be the neighbours w ∈ NCi (u) such that w is on a shortest uv-path. We compute σGi (u, v) by  dynamic programming.  P Precisely, σGi (v, v) = αGi (v), and for every u 6= v, σGi (u, v) = αGi (u)· w∈N + (u) σGi (w, v) . It takes O(|E(Ci )|)-time. Overall in O(|V (Ci )||E(Ci )|)-time, we have computed σGi (u, v) and distGi (u, v) for every u, v ∈ V (Ci ). Then, for every v ∈ V (Ci ), we can compute BCGi (v) in O(|V (Ci )|2 )-time by enumerating all the pairs s, t ∈ V (Ci ) \ {v}. Since Gi is prime, the total running time is in O(|V (Ci )|3 ) = O(sw(G)3 ), and so, in O(sw(G)2 · |V (Ci )|). Otherwise, Ci is an internal node of T . Let Ci1 , Ci2 , . . . , Cik be the children of Ci in T . Assume that, for every 1 ≤ t ≤ k, BCGit (bit ) has been computed (by dynamic programming over T ). Let us define the following weight functions for Ci : ( αi (ait ) = αBit (ait ), βi (ait ) = βBit (ait ) αi (v) = αAi (v), βi (v) = βAi (v) otherwise. Observe that every edge {Ci , Cit } also corresponds to a split (A0it , Bi0t ) of Gi , where V (Cit ) ⊆ A0it = Ait . By applying all the corresponding simple decompositions, one finally obtains Hi = (V (Ci ), E(Ci ), αi , βi ). Then, let us define `i (ait ) = BCGit (bit ) and `i (v) = 0 else. Intuitively, the function `i is a corrective term updated after each simple decomposition. More precisely, we obtain by multiple applications of Lemma 9, for every v ∈ V (Ci ): X BCGi (v) = BCHi (v) + `i (u) u∈NHi (v) Clearly, this can be reduced in O(|E(Hi )|)-time, resp. in O(|V (Hi )|)-time when Hi is complete, to the computation of BCHi (v). So, it can be done in O(sw(G)2 · |V (Ci )|)-time (i.e., as explained for the case of leaf nodes). 31 P Overall, this first part of the algorithm takes time O(sw(G)2 · i |V (Ci )|) = O(sw(G)2 · n). Furthermore, since G1 = G, we have computed BCG (v) for every v ∈ V (C1 ). Then, using the same techniques as above, we can compute BCGBi (ai ) for every i > 1 by reverse dynamic programming over T . It takes O(sw(G)2 · n)-time. Finally, by Lemma 9 we can compute BCG (v) from BCGi (v) and BCGBi (ai ), for every v ∈ V (Ci ). It takes linear-time. 4.4 Kernelization methods with modular decomposition The purpose of the subsection is to show how to apply the previous results, obtained with split decomposition, to modular decomposition. On the way, improvements are obtained for the running time. Indeed, it is often the case that only the quotient graph G0 needs to be considered. We thus obtain algorithms that run in O(mw(G)O(1) + n + m)-time. See [71] for an extended discussion on the use of Kernelization for graph problems in P. We start with the following lemma: Lemma 10 (folklore). For every G = (V, E) we have sw(G) ≤ mw(G) + 1. Proof. First we claim that mw(H) ≤ mw(G) for every induced subgraph H of G. Indeed, for every module M of G we have that M ∩ V (H) is a module of H, thereby proving the claim. We show in what follows that a “split decomposition” can be computed from the modular decomposition of G such that all the non degenerate split components have size at most mw(G) + 14 . Applying this result to every prime split component of G in its canonical split decomposition proves the lemma. W.l.o.g., G is connected (otherwise, we consider each connected component separately). Let M(G) = {M1 , M2 , . . . , Mk } ordered by decreasing size. 1. If |M1 | = 1 (G is either complete or prime for modular decomposition) then we output G. 2. Otherwise, suppose |M1 | < n−1. We consider all the maximal strong modules M1 , M2 , . . . , Mt such that |Mi | ≥ 2 sequentially. For every 1 ≤ i ≤ t, we have that (Mi , V \ Mi ) is a split. Furthermore if we apply the corresponding simple decomposition then we obtain two subgraphs, one being the subgraph Gi obtained from G[Mi ] by adding a universal vertex bi , and the other being obtained from G by replacing Mi by a unique vertex ai with neighbourhood NG (Mi ). Then, there are two subcases. • Subcase M(G) = {M1 , M2 }. In particular, |M2 | ≥ 2. We perform a simple decomposition for M1 . The two resulting subgraphs are exactly G1 and G2 . • Subcase {M1 , M2 } ( M(G). We apply simple decompositions for M1 , M2 , . . . , Mt sequentially. Indeed, let i ∈ {1, . . . , t} and suppose we have already applied simple decompositions for M1 , M2 , . . . , Mi−1 . Then, S since there are at least three modules in M(G) we have that (Mi , {a1 , a2 , . . . ai−1 } ∪ j>i Mj ) remains a split, and so, we can apply a simple decomposition. The resulting components are exactly: the quotient graph G0 and, for every 1 ≤ i ≤ t, the subgraph Gi obtained from G[Mi ]. Furthermore, in both subcases we claim that the modular decomposition of Gi can be updated from the modular decomposition of G[Mi ] in constant-time. Indeed, the set of all universal vertices in a graph is a clique and a maximal strong module. We output G0 (only if {M1 , M2 } ( M(G)) and, for every 1 ≤ i ≤ t, we apply the procedure recursively for Gi . 4 Formally this is only a partial split decomposition, since there are subgraphs that could be further decomposed. 32 3. Finally, suppose |M1 | = n − 1. In particular, M(G) = {M1 , M2 } and M2 is trivial. Let M(G[M1 ]) = {M10 , M20 , . . . , Mp0 } ordered by decreasing size. If |M10 | = 1 (i.e., G[M1 ] is either edgeless, complete or prime for modular decomposition) then we output G. Otherwise we apply the previous Step 2 to the modular partition M10 , M20 , . . . , Mp0 , M2 . The procedure takes linear-time if the modular decomposition of G is given. Furthermore, the subgraphs obtained are either: the quotient graph G0 ; a prime subgraph for modular decomposition with an additional universal vertex; or a degenerate graph (that is obtained from either a complete subgraph or an edgeless subgraph by adding a universal vertex). Corollary 12. For every G = (V, E) we can solve: • Eccentricities and Diameter in O(mw(G)2 · n + m)-time; • Hyperbolicity in O(mw(G)3 · n + m)-time; • Betweenness Centrality in O(mw(G)2 · n + m)-time. In what follows, we explain how to improve the above running times in some cases. Theorem 13. For every G = (V, E), Eccentricities can be solved in O(mw(G)3 + n + m)-time. In particular, Diameter can be solved in O(mw(G)3 + n + m)-time. Proof. W.l.o.g., G is connected. Consider the (partial) split decomposition obtained from the modular decomposition of G (Lemma 10). Let T be the corresponding split decomposition tree. By construction, there exists a modular partition M1 , M2 , . . . , Mk of G with the two following properties: • All but at most one split components of G are split components of some Gi , 1 ≤ i ≤ k, where the graph Gi is obtained from G[Mi ] by adding a universal vertex bi . • Furthermore, the only remaining split component (if any) is the graph G0 obtained by replacing every module Mi with a single vertex ai . Either G0 is degenerate (and so, diam(G0 ) ≤ 2) or k ≤ mw(G) + 1. We can also observe in this situation that if we root T in G0 then the subtrees of T \ {G0 } are split decomposition trees of the graphs Gi , 1 ≤ i ≤ k. We can solve Eccentricities for G as follows. First for every 1 ≤ i ≤ k we solve Eccentricities for Gi . In particular, diam(Gi ) ≤ 2, and so, for every v ∈ V (Gi ) we have: eccGi (v) = 0 if and only if V (Gi ) = {v}; eccGi (v) = 1 if and only if v is universal in Gi ; otherwise, eccGi (v) = 2. Therefore, Pkwe can solve Eccentricities for Gi in O(|V (Gi )| + |E(Gi )|)-time. Overall, this step takes O( i=1 |Vi | + |Ei |) = O(n + m)-time. Then there are two subcases. Suppose G0 is not a split component. We deduce from Lemma 10 G = G[M1 ] ⊕ G[M2 ]. In this situation, for every i ∈ {1, 2}, for every v ∈ V (Gi ) we have eccG (v) = max{eccGi (v), 1}. Otherwise, let us compute Eccentrities for G0 . It takes O(|V (G0 )|) = O(n)-time if G0 is degenerate, and O(mw(G)3 )-time otherwise. Applying the algorithmic scheme of Theorem 8, one obtains eccG (v) = max{eccGi (v), distGi (v, ai ) + eccG0 (bi ) − 1} = max{eccGi (v), eccG0 (bi )} for every v ∈ Mi . Hence, we can compute eccG (v) for every v ∈ V in O(n)-time. Corollary 14. For every connected G = (V, E), diam(G) ≤ max{mw(G), 2}. 33 Next, we consider Hyperbolicity. It is proved in [81] that, for every G = (V, E) with quotient graph G0 , δ(G0 ) ≤ δ(G) ≤ max{δ(G0 ), 1}. The latter immediately implies the following result: Theorem 15. For every G = (V, E), we can decide whether δ(G) > 1, and if so, compute δ(G), in O(mw(G)4 + n + m)-time. However, we did not find a way to preprocess G in linear-time so that we can compute δ(G) from δ(G0 ). Indeed, let GM be a graph of diameter at most 2. Solving Eccentricities for GM can be easily done in linear-time. However, the following shows that it is not that simple to do so for Hyperbolicity. Lemma 11 ( [26]). For every G = (V, E) we have δ(G) ≤ bdiam(G)/2c. diam(G) ≤ 2 then δ(G) < 1 if and only if G is C4 -free. Furthermore, if The detection of an induced C4 in O(mw(G)O(1) + n + m)-time remains an open problem. Short digression: using neighbourhood diversity We show that by imposing more constraints on the modular partition, some more kernels can be computed for the problems in Section 4.1. Two vertices u, v are twins in G if NG (u) \ v = NG (v) \ u. Being twins induce an equivalence relationship over V (G). The number of equivalence classes is called the neighbourhood diversity of G, sometimes denoted by nd(G) [68]. Observe that every set of pairwise twins is a module of G. Hence, mw(G) ≤ nd(G). Theorem 16. For every G = (V, E), Hyperbolicity can be solved in O(nd(G)4 + n + m)-time. Proof. Let V1 , V2 , . . . , Vk , k = nd(G), partition the vertex-set V in twin classes. The partition can be computed in linear-time [68]. Furthermore, since it is a modular partition, we can compute a (partial) split decomposition as described in Lemma 10. Let G0 = (V 0 , E 0 ) such that V 0 = {v1 , v2 , . . . , vk } and E 0 = {{vi , vj } | Vi × Vj ⊆ E}. Then, the split components are either: G0 , stars S i (if the vertices of Vi are pairwise nonadjacent, i.e., false twins) or complete graphs K i (if the vertices of Vi are pairwise adjacent, i.e., true twins). Applying the algorithmic scheme of Theorem 9, in order to solve Hyperbolicity for G it suffices to compute, for every split component Cj , the hyperbolicity value δ(Cj ) and all the simplicial vertices in Cj . This can be done in O(|V (Cj )|)-time if Cj is a star or a complete graph, and in O(nd(G)4 )-time if Cj = G0 . Therefore, we can solve Hyperbolicity for G in total O(nd(G)4 + n + m)-time. In [43], the authors propose an O(2O(k) +n+m)-time algorithm for computing Hyperbolicity with k being the vertex-cover of the graph. Their algorithm is pretty similar to Theorem 16. This is no coincidence since every graph with vertex-cover at most k has neighbourhood diversity at most 2O(k) [68]. Finally, the following was proved implicitly in [76]. Theorem 17 ( [76]). For every G = (V, E), Betweenness Centrality can be solved in O(nd(G)3 + n + m)-time. 34 4.5 Applications to graphs with few P4 ’s Before ending Section 4, we apply the results of the previous subsections to the case of (q, q − 3)graphs. For that we need to consider all the cases where the quotient graph has super-constant size Ω(q) (see Lemma 4). Eccentricities Theorem 18. For every G = (V, E), Eccentricities can be solved in O(q(G)3 + n + m)-time. Proof. By Lemma 10, there exists a partial split decomposition of G such that the only split component with diameter possibly larger than 2 is its quotient graph G0 . Furthermore, as shown in the proof of Theorem 13, solving Eccentricities for G can be reduced in O(n + m)-time to the solving of Eccentricities for G0 . By Lemma 4 we only need to consider the following cases. We can check in which case we are in linear-time [6]. • Suppose G0 = (S 0 ∪ K 0 ∪ R0 , E 0 ) is a prime spider. There are two subcases. 1. If G0 is a thick spider then it has diameter two. Since in addition, there is no universal vertex in G0 , therefore every vertex of G0 has eccentricity exactly two. 2. Otherwise, G0 is a thin spider. Since there is no universal vertex in G0 , every vertex has eccentricity at least two. In particular, since K 0 is a clique dominating set of G0 , eccG0 (v) = 2 for every v ∈ K 0 . Furthermore, since there is a join between K 0 and R0 , eccG0 (v) = 2 for any v ∈ R0 . Finally, since every two vertices of S 0 are pairwise at distance three, eccG0 (v) = 3 for every v ∈ S. • Suppose G0 is isomorphic either to a cycle Cn0 , or to a co-cycle Cn0 , for some n0 ≥ 5. 1. If G0 is isomorphic to a cycle Cn0 then every vertex of G0 has eccentricity bn0 /2c. 2. Otherwise, G0 is isomorphic to a co-cycle Cn0 . We claim that every vertex of G0 has eccentricity 2. Indeed, let v ∈ Cn0 be arbitrary and let u, w ∈ Cn0 be the only two vertices nonadjacent to v. Furthermore, let u0 , w0 be the unique vertices of Cn0 \ v that are respectively nonadjacent to u and to w. Since n0 ≥ 5, we have u0 6= w0 . In particular, (v, u0 , w) and (v, w0 , u) are, respectively, a shortest vw-path and a shortest vu-path. Hence, eccG0 (v) = 2. • Suppose G0 is a spiked p-chain Pk , or its complement. – Subcase G0 is a spiked p-chain Pk . In particular, G0 contains the k-node path Pk = (v1 , v2 , . . . , vk ) as an isometric subgraph. Furthermore, if x ∈ V (G0 ) then distG0 (v1 , x) = 2, and x and v2 are twins in G0 \ v1 . Similarly, if y ∈ V (G0 ) then distG0 (vk , y) = 2, and y and vk−1 are twins in G0 \ vk . As a result: for every 1 ≤ i ≤ k, eccG0 (vi ) = eccPk (vi ) = max{i − 1, k − i}; if x ∈ V (G0 ) then eccG0 (x) = eccPk (v2 ) = k − 2; if y ∈ V (G0 ) then eccG0 (y) = eccPk (vk−1 ) = k − 2. – Subcase G0 is a spiked p-chain Pk . In particular, G0 is a spiked p-chain Pk . Since k ≥ 6, every spiked p-chain Pk has diameter more than four. Hence, diam(G0 ) ≤ 2, that implies Eccentricities can be solved for G0 in linear-time. 35 • Suppose G0 is a spiked p-chain Qk , or its complement. – Subcase G0 is a spiked p-chain Qk . There is a clique-dominating set K 0 = 0 {v2 , v4 , . . . , v2j , . . .} of G . In particular, every vertex of K 0 has eccentricity two. Furthermore, any zi is adjacent to both v2 , v4 . Every vertex v2i−1 , except v3 , is adjacent to v2 . Finally, every vertex v2i−1 , except v1 and v5 , is adjacent to v4 . As a result, any vertex zi has eccentricity two; any vertex v2i−1 , i ∈ / {1, 2, 3}, also has eccentricity two. However, since v2 and v4 are, respectively, the only neighbours of v1 and v3 , we get distG0 (v1 , v3 ) = distG0 (v3 , v5 ) = 3. Hence eccG0 (v1 ) = eccG0 (v3 ) = eccG0 (v5 ) = 3. – Subcase G0 is a spiked p-chain Qk . Roughly, we reverse the roles of vertices v2i with even index with the roles of vertices v2i−1 with odd index. More precisely, there is a clique-dominating set K 0 = {v1 , v3 , . . . , v2j−1 , . . .} of G0 . In particular, every vertex of K 0 has eccentricity two. Furthermore, any zi is adjacent to both v1 , v3 . Every vertex v2i , except v2 , is adjacent to v1 . Finally, every vertex v2i , except v4 , is adjacent to v3 . As a result, any vertex zi has eccentricity two; any vertex v2i , i ∈ / {1, 2}, also has eccentricity two. However, since v3 is the only neighbour of v2 , we get distG0 (v2 , v4 ) = 3, hence eccG0 (v2 ) = eccG0 (v4 ) = 3. • Otherwise, |V (G0 )| ≤ q(G). Then, solving Eccentricities for G0 can be done in O(q(G)3 )time. Therefore, in all the above cases, Eccentricities can be solved for G0 in O(min{q(G)3 , n + m})time. Corollary 19. For every connected (q, q − 4)-graph G = (V, E), diam(G) ≤ q. Corollary 19 does not hold for (q, q − 3)-graphs because of cycles and spiked p-chains Pk . Gromov hyperbolicity Theorem 20. For every G = (V, E), Hyperbolicity can be solved in O(q(G)3 · n + m)-time. Proof. By Lemma 10, we can compute a partial split decomposition from the modular decomposition of G. It takes O(n + m)-time. Let C1 , C2 , . . . , Ck be the split components. P By using the algorithmic scheme of Theorem 9, solving Hyperbolicity can be reduced in O( i |V (Ci )| + |E(Ci )|)time to the computation, for every 1 ≤ i ≤ k, of the hyperbolicity value δ(Ci ) and of all the simplicial vertices in Ci . P We claim that it can be done in O(q(G)3 · |V (Ci )| + |E(Ci )|)-time. Since P i |V (Ci )| = O(n) and i |E(Ci )| = O(n + m) [78], the latter claim will prove the desired time complexity. If Ci is degenerate then the above can be done in O(|V (Ci )|)-time. Otherwise, Ci is obtained from a prime subgraph G0 in the modular decomposition of G by possibly adding a universal vertex. In particular, we have: δ(G0 ) = δ(Ci ) if G0 = Ci ; δ(Ci ) = 0 can be decided in O(|V (Ci )| + |E(Ci )|)time [61]; otherwise, diam(Ci ) ≤ 2, and so, by Lemma 11 we have δ(Ci ) = 1 if and only if Ci contains an induced cycle of length four (otherwise, δ(Ci ) = 1/2). Therefore, we are left to compute the following for every prime subgraph G0 in the modular decomposition of G: • Compute δ(G0 ); • Decide whether G0 contains an induced cycle of length four; 36 • Compute the simplicial vertices in G0 . In particular, if |V (G0 )| ≤ q(G) then it can be done in O(|V (G0 )|4 ) = O(q(G)3 · |V (G0 )|)-time. Otherwise, by Lemma 4 we only need to consider the following cases. We can check in which case we are in linear-time [6]. • Suppose G0 is a prime spider. In particular it is a split graph, and so, it does not contain an induced cycle of length more than three. Furthermore the simplicial vertices of any chordal graph, and so, of G0 , can be computed in linear-time. If G0 is a thin spider then it is a block-graph, and so, δ(G0 ) = 0 [61]. Otherwise, G0 is a thick spider, and so, it contains an induced diamond. The latter implies δ(G0 ) ≥ 1/2. Since diam(G0 ) ≤ 2 and G0 is C4 -free, by Lemma 11 δ(G0 ) < 1, hence we have δ(G0 ) = 1/2. • Suppose G0 is a cycle or a co-cycle of order at least five. Since cycles and co-cycles are non complete regular graphs they do not contain any simplicial vertex [4]. Furthermore, a cycle of length at least five of course does not contain an induced cycle of length four; a co-cycle of order five is a C5 , and a co-cycle or order at least six always contains an induced cycle of length at least four since there is an induced 2K2 = C4 in its complement. Finally, the hyperbolicity of a given cycle can be computed in linear-time [21]; for every co-cycle of order at least six, since it has diameter at most two and it contains an induced cycle of length four, by Lemma 11 it has hyperbolicity equal to 1. • Suppose G0 is a spiked p-chain Pk , or its complement. In particular, if G0 is a spiked p-chain Pk then it is a block-graph, and so, a chordal graph. It implies δ(G0 ) = 0 [61], G0 does not contain any induced cycle of length four, furthermore all the simplicial vertices of G0 can be computed in linear-time. Else, G0 is a spiked p-chain Pk . Since, in G0 , every vertex is nonadjacent to at least one edge of Pk , it implies that G0 has no simplicial vertex. Furthermore, since Pk , and so, G0 , contains an induced 2K2 , the graph G0 contains an induced cycle of length four. Since diam(G0 ) = 2, it implies by Lemma 11 δ(G0 ) = 1. • Otherwise, G0 is a spiked p-chain Qk , or its complement. In both cases, G0 is a split graph, and so, a chordal graph. It implies that G0 does not contain an induced cycle of length four, and that all the simplicial vertices of G0 can be computed in linear-time. Furthermore, we can decide in linear-time whether δ(G0 ) = 0 [61]. Otherwise, it directly follows from the characterization in [19] that a necessary condition for a chordal graph to have hyperbolicity at least one is to contain two disjoint pairs of vertices at distance 3. Since there are no such pairs in G0 , δ(G0 ) = 1/2. The solving of Betweenness Centrality for (q, q − 3)-graphs is left for future work. We think it is doable with the techniques of Theorem 11. However, this would require to find ad-hoc methods for every graph family in Lemma 4. The main difficulty is that we need to consider weighted variants of these graph families, and the possibility to add a universal vertex. 5 New Parameterized algorithms for Maximum Matching A matching in a graph is a set of edges with pairwise disjoint end vertices. We consider the problem of computing a matching of maximum size. 37 Problem 8 (Maximum Matching). Input: A graph G = (V, E). Output: A matching of G with maximum cardinality. Maximum Matching can be solved in polynomial time with Edmond’s algorithm [39]. A naive implementation of the algorithm runs in O(n4 ) time. Nevertheless, Micali and Vazirani [72] √ show how to implement Edmond’s algorithm in time O(m n). In [71], Mertzios, Nichterlein and Niedermeier design some new algorithms to solve Maximum Matching, that run in O(k O(1) · (n + m))-time for various graph parameters k. They also suggest to use Maximum Matching as the “drosophilia” of the study of fully polynomial parameterized algorithms. In this section, we present O(k 4 · n + m)-time algorithms for solving Maximum Matching, when parameterized by either the modular-width or the P4 -sparseness of the graph. The latter subsumes many algorithms that have been obtained for specific subclasses [46, 86]. 5.1 Computing short augmenting paths using modular decomposition Let G = (V, E) be a graph and F ⊆ E be a matching of G. A vertex is termed matched if it is incident to an edge of F , and unmatched otherwise. An F -augmenting path is a path where the two ends are unmatched, all edges {x2i , x2i+1 } are in F and all edges {x2j−1 , x2j } are not in F . We can observe that, given an F -augmenting path P = (x1 , x2 , . . . , x2k ), the matching E(P )∆F (obtained by replacing the edges {x2i , x2i+1 } with the edges {x2j−1 , x2j }) has larger size than F . Theorem 21 (Berge, [12]). A matching F in G = (V, E) is maximum if and only if there is no F -augmenting path. We now sketch our approach. Suppose that, for every S module Mi ∈ M(G), a maximum matching Fi of G[Mi ] has been computed. Then, F = i Fi is a matching of G, but it is not necessarily maximum. Our approach consists in computing short augmenting paths (of length O(mw(G))) using the quotient graph G0 , until we obtain a maximum matching. For that, we need to introduce several reduction rules. The first rule (proved below) consists in removing, from every module Mi , the edges that are not part of its maximum matching Fi . Lemma 12. Let M be a module of G = (V, E), let G[M ] = (M, EM ) and let FM ⊆ EM be a maximum matching of G[M ]. Then, every maximum matching of G0M = (V, (E \ EM ) ∪ FM ) is a maximum matching of G. Proof. Let us consider an arbitrary maximum matching of G. We totally order M = {v1 , v2 , . . . , vl }, in such a way that unmatched vertices appear first, and for every edge in the matching FM the two ends of it are consecutive. Let S ⊆ M, |S| = k be the vertices of M that are matched with a vertex of V \ M . We observe that with the remaining |M | − k vertices of M \ S, we can only obtain a matching of size at most µM = min{|FM |, b(|M | − k)/2c}. Conversely, if S = {v1 , v2 , . . . , vk } then we can always create a matching of size exactly µM with the vertices of M \ S and the edges of FM . Since M is a module of G, this choice can always be made without any loss of generality. From now on we shall assume each module induces a matching. In particular, for every M ∈ M(G), the set V (E(G[M ])) stands for the non isolated vertices in the subgraph G[M ]. 38 Then, we need to upper-bound the number of edges in an augmenting path that are incident to a same module. Lemma 13. Let G = (V, E) be a graph such that every module M ∈ M(G) induces a matching. Furthermore let G0 = (M(G), E 0 ) be the quotient graph of G, and let F ⊆ E be a non maximum matching of G. There exists an F -augmenting path P = (x1 , x2 , . . . , x2` ) such that the following hold for every M ∈ M(G): • |{i | x2i−1 , x2i ∈ M }| ≤ 1; furthermore if |{i | x2i−1 , x2i ∈ M }| = 1 then, for every M 0 ∈ NG0 (M ) we have {i | x2i−1 , x2i ∈ M 0 } = ∅; • |{i | x2i , x2i+1 ∈ M }| ≤ 1; • |{i | x2i−1 ∈ / M, x2i ∈ M }| ≤ 1; • |{i | x2i ∈ / M, x2i+1 ∈ M }| ≤ 2; furthermore if |{i | x2i ∈ / M, x2i+1 ∈ M }| = 2 then there exist x2i0 +1 , x2i0 +3 , x2i0 +4 ∈ M ; • |{i | x2i−1 ∈ M, x2i ∈ / M }| ≤ 1; • |{i | x2i ∈ M, x2i+1 ∈ / M }| ≤ 2; furthermore if |{i | x2i ∈ M, x2i+1 ∈ / M }| = 2 then there exist x2i0 −1 , x2i0 , x2i0 +2 ∈ M . In particular, P has length O(|M(G)|). Proof. Let be a shortest F -augmenting path that minimizes i(P ) = S P  E(P ) ∩ Equivalently, P is a shortest augmenting path with the M ∈M(G) E(G[M ]) . minimum number of edges i(P ) with their two ends in a same module. There are four cases. 1. Suppose by contradiction there exist i1 < i2 such that x2i1 −1 , x2i1 , x2i2 −1 , x2i2 ∈ M . See Fig. 8-9. In particular, i2 − i1 ≥ 2 since M induces a matching. Furthermore, x2i1 +1 , x2i2 −2 ∈ NG (M ). Then, (x1 , . . . , x2i1 −1 , x2i1 +1 , x2i1 , x2i2 −2 , x2i2 −1 , x2i2 , . . . x2` ) is an F -augmenting path, thereby contradicting the minimality of i(P ). Figure 8: Case x2i1 −1 , x2i1 , x2i2 −1 , x2i2 ∈ M . Figure 9: Local replacement of P . Similarly, suppose by contradiction there exist x2i1 −1 , x2i1 ∈ M and there exist x2i2 −1 , x2i2 ∈ M 0 , M 0 ∈ NG0 (M ). See Fig 10. We assume by symmetry i1 < i2 . In this situation, either i1 = 1, and so, x2i1 −1 = x1 is unmatched, or i1 > 1 and so, x2i1 −1 is matched to x2i1 −2 6= x2i2 . Then, (x1 , . . . , x2i1 −1 , x2i2 , . . . , x2` ) is an F -augmenting path, thereby contradicting the minimality of |V (P )|. 39 Figure 10: Case x2i1 −1 , x2i1 ∈ M and x2i2 −1 , x2i2 ∈ M 0 . 2. Suppose by contradiction there exist i1 < i2 such that x2i1 , x2i1 +1 , x2i2 , x2i2 +1 ∈ M . See Fig 11. In particular, x2i1 −1 ∈ NG (M ) since M induces a matching. Then, (x1 , . . . , x2i1 −1 , x2i2 , x2i2 +1 , . . . x2` ) is an F -augmenting path, thereby contradicting the minimality of |V (P )|. Figure 11: Case x2i1 , x2i1 +1 , x2i2 , x2i2 +1 ∈ M . 3. Suppose by contradiction there exist i1 < i2 such that x2i1 −1 , x2i2 −1 ∈ / M, x2i1 , x2i2 ∈ M . See Fig 12. Either i1 = 1, and so, x2i1 −1 = x1 is unmatched, or i1 > 1 and so, x2i1 −1 is matched to x2i1 −2 6= x2i2 . Then, (x1 , . . . , x2i1 −1 , x2i2 , . . . , x2` ) is an F -augmenting path, thereby contradicting the minimality of |V (P )|. Figure 12: Case x2i1 −1 , x2i2 −1 ∈ / M, x2i1 , x2i2 ∈ M . By symmetry, the latter also proves that |{i | x2i−1 ∈ M, x2i ∈ / M }| ≤ 1. 4. Finally suppose by contradiction there exist i1 < i2 < i3 such that x2i1 , x2i2 , x2i3 ∈ / M, x2i1 +1 , x2i2 +1 , x2i3 +1 ∈ M . See Fig 13. Then, (x1 , . . . , x2i1 , x2i1 +1 , x2i3 , x2i3 +1 . . . , x2` ) is an F -augmenting path, thereby contradicting the minimality of |V (P )|. Figure 13: Case x2i1 , x2i2 , x2i3 ∈ / M , x2i1 +1 , x2i2 +1 , x2i3 +1 ∈ M . We prove in the same way that if there exist i1 < i2 such that x2i1 , x2i2 ∈ / M and x2i1 +1 , x2i2 +1 ∈ M then i2 = i1 + 1. See Fig 14. Furthermore, if x2i2 +2 = x2i1 +4 ∈ / M then (x1 , . . . , x2i1 , x2i1 +1 , x2i2 +2 , x2i2 +3 . . . , x2` ) is an F -augmenting path, thereby contradicting the minimality of |V (P )|. By symmetry, the same proof as above applies to {i | x2i ∈ M, x2i+1 ∈ / M }. 40 Figure 14: Case x2i2 +2 = x2i1 +4 ∈ / M. Overall, every M ∈ M(G) is incident to at most 8 edges of P , and so, P has length O(|M(G)|). Based on Lemmas 12 and 13, we introduce in what follows a witness subgraph in order to find a matching. We think the construction could be improved but we chose to keep is as simple as possible. Definition 1. Let G = (V, E) be a graph, G0 = (M(G), E 0 ) be its quotient graph and F ⊆ E be a matching of G. The witness matching F 0 is obtained from F by keeping a representative for every possible type of edge in an augmenting path. Precisely: • Let M ∈ M(G). If E(G[M ]) ∩ F 6= ∅ then there is exactly one edge {uM , vM } ∈ E(G[M ]) ∩ F such that {uM , vM } ∈ F 0 . Furthermore if E(G[M ]) \ F 6= ∅ then we pick an edge {xM , yM } ∈ E(G[M ]) \ F and we add in F 0 every edge in F that is incident to either xM or yM . • Let M, M 0 ∈ M(G) be adjacent in G0 . There are exactly min{4, |F ∩ (M × M 0 )|} edges {vM , vM 0 } added in F 0 such that vM ∈ M, vM 0 ∈ M 0 and {vM , vM 0 } ∈ F . The witness subgraph G0F is the subgraph induced by V (F 0 ) with at most two unmatched vertices added for every strong module. Formally, let M ∈ M(G). The submodule MF ⊆ M contains exactly min{2, |M \ V (F )|} vertices of M \ V (F ). Then,    [ G0F = G V (F 0 ) ∪  MF  . M ∈M(G) As an example, suppose that every edge of F has its two ends in a same module and every module induces a matching. Then, G0F is obtained from G0 by substituting every M ∈ M(G) with at most one edge (if F ∩ E(G[M ]) 6= ∅) and at most two isolated vertices (representing unmatched vertices). From the algorithmic point of view, we need to upper-bound the size of the witness subgraph, as follows. Lemma 14. Let G = (V, E) be a graph, G0 = (M(G), E 0 ) be its quotient graph and F ⊆ E be a matching of G. The witness subgraph G0F has order O(|E(G0 )|). Proof. By construction for every M ∈ M(G) we have |M ∩ V (G0F )| = O(degG0 (M )). Therefore, P 0 |V (GF )| = M ∈M(G) |M ∩ V (G0F )| = O(|E(G0 )|). 41 Our algorithm is based on the correspondance between F -augmenting paths in G and F 0 augmenting paths in G0F , that we prove next. The following Lemma 15 is the key technical step of the algorithm. Lemma 15. Let G = (V, E) be a graph such S that every module M ∈ M(G) induces a matching. Let F ⊆ E be a matching of G such that M ∈M(G) V (E(G[M ])) ⊆ V (F ). There exists an F augmenting path in G if and only if there exists an F 0 -augmenting path in G0F . Proof. In one direction, G0F is an induced subgraph of G. Furthermore, according to Definition 1, F 0 ⊆ F and V (F 0 ) = V (F ) ∩ V (G0F ). Thus, every F 0 -augmenting path in G0F is also an F augmenting path in G. Conversely, suppose there exists an F -augmenting path in G. Let P = (v1 , v2 , . . . , v2` ) be an F -augmenting path in G that satisfies the conditions of Lemma 13. We transform P into an F 0 -augmenting path in G0F as follows. For every 1 ≤ i ≤ 2` let Mi ∈ M(G) such that vi ∈ Mi . • We choose u1 ∈ M1 ∩ V (G0F ), u2` ∈ M2` ∩ V (G0F ) unmatched. Furthermore, if M1 = M2` then we choose u1 6= u2` . The two of u1 , u2` exist according to Definition 1. • Then, for every 1 ≤ i ≤ ` − 1, we choose u2i ∈ M2i ∩ V (G0F ), u2i+1 ∈ M2i+1 ∩ V (G0F ) such that {u2i , u2i+1 } ∈ F 0 . Note that if M2i = M2i+1 then {u2i , u2i+1 } is the unique edge of F 0 ∩ E(G[M2i ]). By Lemma 13 we also have that {v2i , v2i+1 } is the unique edge of E(P ) ∩ F such that v2i , v2i+1 ∈ M2i . Otherwise, M2i 6= M2i+1 . If there are p edges e ∈ F with one end in M2i and the other end in M2i+1 then there are at least min{p, 4} such edges in F 0 . By Lemma 13 there are at most min{p, 4} edges e ∈ E(P ) ∩ F with one end in M2i and the other end in M2i+1 . Hence, we can always ensure the uj ’s, 1 ≤ j ≤ 2`, to be pairwise different. The resulting sequence SP = (u1 , u2 , . . . , u2` ) is not necessarily a path, since two consecutive vertices u2i−1 , u2i need not be adjacent in G0F . Roughly, we insert alternating subpaths in the sequence in order to make it a path. However, we have to be careful not to use twice a same vertex for otherwise we would only obtain a walk. Let IP = {i | {u2i−1 , u2iS } ∈ / E}. Observe that for every i ∈ IP we have M2i−1 = M2i . In / {1, `}. Furthermore, particular, since we assume M ∈M(G) V (E(G[M ])) ⊆ V (F ), it implies i ∈ M2i−2 6= M2i and M2i 6= M2i+1 since otherwise v2i−2 , v2i−1 , v2i ∈ M2i or v2i−1 , v2i , v2i+1 ∈ M2i thereby contradicting that M2i induces a matching. According to Definition 1 there exist xi , yi ∈ M2i such that {xi , yi } ∈ E(G[M2i ]) \ F and every edge S of F that is incident to either xi or yi is in F 0 . Such two edges always exist since we assume M ∈M(G) V (E(G[M ])) ⊆ V (F ), hence there exist wi , zi such that {wi , xi }, {yi , zi } ∈ F 0 . Note that wi , zi ∈ / M2i since {xi , yi } ∈ E(G[M2i ]) and M2i induces a matching. Since by Lemma 13 {v2i−1 , v2i } is the unique edge e ∈ E(P ) \ F such that e ⊆ M2i , the vertices xi , yi , i ∈ IP are pairwise different. Furthermore, we claim that there can be no i1 , i2 ∈ IP such that si1 ∈ {xi1 , yi1 } and ti2 ∈ {xi2 , yi2 } are adjacent in G. Indeed otherwise, M2i1 ∈ NG0 (M2i2 ), there exist v2i1 −1 , v2i1 ∈ M2i1 and v2i2 −1 , v2i2 ∈ M2i2 , thereby contradicting Lemma 13. As a result, all the vertices wi , xi , yi , zi , i ∈ IP are pairwise different. However, we may have {wi , xi } = {u2j , u2j+1 } or {yi , zi } = {u2j , u2j+1 } for some j. We consider the indices i ∈ IP sequentially, by increasing value. By Lemma 13, v2j ∈ / M2i , v2j+1 ∈ M2i for some j 6= i − 1 implies j = i − 2. Similarly (obtained by reverting the 0 = v ), v indices, from v10 = v2` to v2` / M2i for some j 6= i implies j = i + 1. 1 2j ∈ M2i , v2j+1 ∈ 42 Therefore, if (wi , xi ) ∈ Sp then (wi , xi ) ∈ {(u2i−4 , u2i−3 ), (u2i−2 , u2i−1 ), (u2i+1 , u2i ), (u2i+3 , u2i+2 )}, and the same holds for (yi , zi ). Note also that the pairs (wi , xi ) and (zi , yi ) play a symmetric role. Thus we can reduce by symmetries (on the sequence and on the two of (wi , xi ) and (zi , yi )) to the six following cases: • Case xi , yi ∈ / SP . See Fig 15. In particular, wi , zi ∈ / SP . Figure 15: Case xi , yi ∈ / SP . We insert the F 0 -alternating subpath (u2i−1 , wi , xi , yi , zi , u2i ). • Case xi ∈ / SP , yi ∈ {u2i−1 , u2i }. We assume by symmetry yi = u2i . See Fig 16. In particular, we have wi ∈ / SP . Figure 16: Case xi ∈ / SP , yi = u2i . We insert the F 0 -alternating subpath (u2i−1 , wi , xi , yi = u2i ). {u2i−1 , u2i }, yi ∈ / SP is symmetrical to this one. Note that the case xi ∈ • Case xi ∈ / SP , yi ∈ Sp \ {u2i−1 , u2i }. We assume by symmetry (yi , zi ) = (u2i+2 , u2i+3 ) (the case (zi , yi ) = (u2i−4 , u2i−3 ) is obtained by reverting the indices along the sequence). See Fig 17. Figure 17: Case xi ∈ / SP , (yi , zi ) = (u2i+2 , u2i+3 ). 43 We replace (u2i−1 , u2i , u2i+1 , yi = u2i+2 ) by the F 0 -alternating subpath (u2i−1 , wi , xi , yi ). Note that the case xi ∈ Sp \ {u2i−1 , u2i }, yi ∈ / SP is symmetrical to this one. • Case (wi , xi ) = (u2i−4 , u2i−3 ), yi = u2i . See Fig 18. Figure 18: Case (wi , xi ) = (u2i−4 , u2i−3 ), yi = u2i . We replace (u2i−3 = xi , u2i−2 , u2i−1 , u2i = yi ) by the F 0 -alternating subpath (xi , yi ). Note that the case xi = u2i−1 , (yi , zi ) = (u2i+2 , u2i+3 ), and the two more cases obtained by switching the respective roles of (xi , wi ) and (yi , zi ), are symmetrical to this one. • Case (wi , xi ) = (u2i−4 , u2i−3 ), yi = u2i−1 . See Fig 19. Figure 19: Case (wi , xi ) = (u2i−4 , u2i−3 ), yi = u2i−1 . We replace (u2i−3 = xi , u2i−2 = zi , u2i−1 = yi , u2i ) by the F 0 -alternating subpath (xi , yi , zi , u2i ). Note that the case xi = u2i , (yi , zi ) = (u2i+2 , u2i+3 ), and the two more cases obtained by switching the respective roles of (xi , wi ) and (yi , zi ), are symmetrical to this one. • Case (wi , xi ) = (u2i−4 , u2i−3 ), (yi , zi ) = (u2i+2 , u2i+3 ). See Fig 20. Figure 20: Case (wi , xi ) = (u2i−4 , u2i−3 ), (yi , zi ) = (u2i+2 , u2i+3 ). Since xi = u2i−3 , yi = u2i+2 are adjacent we can remove (u2i−2 , u2i−1 , u2i , u2i+1 ) from SP . Overall, in every case the procedure only depends on the subsequence between u2i−4 and u2i+3 . In order to prove correctness of the procedure, it suffices to prove that this subsequence has not been modified for a smaller i0 ∈ IP , i0 < i. Equivalently, we prove that the above procedure does not modify the subsequence between u2j−4 and u2j+3 for any j ∈ IP , j > i. First we claim j ≥ i + 2. Indeed, M2i+1 ∈ NG0 (M2i ). Hence, by Lemma 13, i ∈ IP implies i + 1 ∈ / IP , that proves the claim. In this situation, 2j − 4 ≥ 2i. Furthermore, the subsequence (u2i , . . . , u2` ) is modified only if u2i+2 ∈ {xi , yi }. However in the latter case we have u2i+3 ∈ / M2i , hence M2i+3 ∈ NG0 (M2i ), and 44 so, by Lemma 13 j ≥ i + 3. In particular, 2j − 4 ≥ 2i + 2 and the subsequence (u2i+2 , . . . , u2` ) is not modified by the procedure. Altogether, it proves that the above procedure is correct. Finally, applying the above procedure for all i ∈ IP leads to an F 0 -alternating path in G0F . We can now state the main result in this subsection. Theorem 22. For every G = (V, E), Maximum Matching can be solved in O(mw(G)4 · n + m)time. Proof. The algorithm is recursive. If G is trivial (reduced to a single node) then we output an empty matching. Otherwise, let G0 = (M(G), E 0 ) be the quotient graph of G. For every module M ∈ M(G), we call the S algorithm recursively on G[M ] in order to compute a maximum matching FM of G[M ]. Let F ∗ = M ∈M(G) FM . By Lemma 12 (applied S to every M ∈ M(G) sequentially), ∗ we are left to compute a maximum matching for G = (V, (E \ M ∈M(G) E(G[M ]))∪F ∗ ). Therefore from now on assume G = G∗ . If G0 is edgeless then we can output F ∗ . Otherwise, by Theorem 1 G0 is either prime for modular decomposition or a complete graph. Suppose G0 to be prime. We start from F0 = F ∗ . Furthermore, we ensure that the two following hold at every step t ≥ 0: • All the vertices that are matched in F ∗ are also matched in the current matching Ft . For instance, it is the case if Ft is obtained from F0 by only using augmenting paths in order to increase the cardinality of the matching. • For every M ∈ M(G) we store |FM ∩ Ft |. For every M, M 0 ∈ M(G) adjacent in G0 we store |(MP× M 0 ) ∩ Ft |. In particular, |FM ∩ F0 | = |FM | and |(M × M 0 ) ∩ F0 | = 0. So, it takes time O( M ∈M(G) degG0 (M )) to initialize this information, that is in O(|E(G0 )|) = O(mw(G)2 ). Furthermore, it takes O(`)-time to update this information if we increase the size of the matching with an augmenting path of length 2`. We construct the graph G0Ft according to Definition 1. By using the information we store for the algorithm, it can be done in O(|E(G0Ft )|)-time, that is in O(|E(G0 )|2 ) = O(mw(G)4 ) by Lemma 14. Furthermore by Theorem 21 there exists an Ft -augmenting path if and only if Ft is not maximum. Since we can assume all the modules in M(G) induce a matching, by Lemma 15 there exists an Ft -augmenting path in G if and only if there exists an Ft0 -augmenting path in G0Ft . So, we are left to compute an Ft0 -augmenting path in G0Ft if any. It can be done in O(|E(G0Ft )|)-time [49], that is in O(mw(G)4 ). Furthermore, by construction of G0Ft , an Ft0 -augmenting path P 0 in G0Ft is also an Ft -augmenting path in G. Thus, we can obtain a larger matching Ft+1 from Ft and P . We repeat the procedure above for Ft+1 until we reach a maximum matching Ftmax . The total running time is in O(mw(G)4 · tmax ). Finally, assume G0 to be complete. Let M(G) = {M1 , M2 , . . . , Mk } be linearly ordered. For S every 1 ≤ i ≤ k, write Gi = G[ j≤i Mj ]. We compute a maximum matching F i for Gi , from a maximum matching F i−1 of Gi−1 and a maximum matching FMi of G[Mi ], sequentially. For that, we apply the same techniques as for the prime case, to some “pseudo-quotient graph” G0i isomorphic to K2 (i.e., the two vertices of G0i respectively represent V (Gi−1 ) and Mi ). Since the pseudo-quotient graphs have size two, this step takes total time O(|V (G0 )| + (|F k | − |F ∗ |)). 45 Overall, summing the order of all the subgraphs in the modular decomposition of G amounts to O(n) [78]. Furthermore, a maximum matching of G also has cardinality O(n). Therefore, the total running time is in O(mw(G)4 · n) if the modular decomposition of G is given. The latter decomposition can be precomputed in O(n + m)-time [83]. 5.2 More structure: (q, q − 3)-graphs The second main result in Section 5 is an O(q(G)4 ·n+m)-time algorithm for Maximum Matching (Theorem 24). Our algorithm for (q, q − 3)-graphs reuses the algorithm described in Theorem 22 as a subroutine. However, applying the same techniques to a case where the quotient graph has superconstant size Ω(q) happens to be more challenging. Thus we need to introduce new techniques in order to handle with all the cases presented in Lemma 4. Computing a maximum matching for the quotient graph is easy. However, we also need to account for the edges present inside the modules. For that, we need the following stronger variant of Lemma 4. The latter generalizes similar structure theorems that have been obtained for some specific subclasses [54]. Theorem 23. For an arbitrary (q, q − 3)-graph G, q ≥ 7, and its quotient graph G0 , exactly one of the following conditions is satisfied. 1. G is disconnected; 2. G is disconnected; 3. G is a disc (and so, G = G0 is prime for modular decomposition); 4. G is a spider (and so, G0 is a prime spider); 5. G0 is a spiked p-chain Pk , or a spiked p-chain Pk . Furthermore, for every v ∈ V (G0 ), if the corresponding module Mv ∈ M(G) is such that |Mv | ≥ 2 then we have v ∈ {v1 , vk , x, y}; 6. G0 is a spiked p-chain Qk , or a spiked p-chain Qk . Furthermore, for every v ∈ V (G0 ), if the corresponding module Mv ∈ M(G) is such that |Mv | ≥ 2 then we have either v ∈ {v1 , vk } or v = zi for some i; 7. |V (G0 )| ≤ q. The proof of Theorem 23 is postponed to the appendix. It is based on a refinement of modular decomposition called primeval decomposition. In what follows, we introduce our techniques for the cases where the quotient graph G0 is neither degenerate nor of constant size. Simple cases Lemma 16. For every disc G = (V, E), a maximum matching can be computed in linear-time. Proof. If G = Cn , n ≥ 5 is a cycle then the set of edges {{2i, 2i + 1} | 0 ≤ i ≤ bn/2c − 1} is a maximum matching. Otherwise, G = Cn is a co-cycle. Let Fn contain all the edges {4i, 4i+2}, {4i+ 1, 4i + 3}, 0 ≤ i ≤ bn/4c − 1. There are three cases. If n = 0 (mod 4) or n = 1 (mod 4) then there is at most one vertex unmatched by Fn , and so, Fn is a maximum matching of G. Otherwise, if 46 n = 3 (mod 4) then a maximum matching of G is obtained by adding the edge {n − 3, n − 1} to Fn . Finally, assume n = 2 (mod 4). By construction, Fn leaves unmatched the two of n − 2, n − 1. We obtain a perfect matching of G from Fn by replacing {0, 2} with {n − 2, 0}, {n − 1, 2}. Note that it is possible to do that since n ≥ 5. Lemma 17. If G = (S ∪K ∪R, E) is a spider then there exists a maximum matching of G composed of: a perfect matching between K and S; and a maximum matching of G[R]. Proof. We start from a perfect matching F0 between K and S. We increase the size of F0 using augmenting paths until it is no more possible to do so. By Theorem 21, the obtained matching Fmax is maximum. Furthermore, either there is a perfect matching between K and S or there is at least one vertex of S that is unmatched. Since V (F0 ) ⊆ V (Fmax ) the latter proves the lemma. The case of prime p-trees Roughly, when the quotient graph G0 is a prime p-tree, our strategy consists in applying the following reduction rules until the graph is empty. 1. Find an isolated module M (with no neighbour). Compute a maximum matching for G[M ] and for G[V \ M ] separately. 2. Find a pending module M (with one neighbour v). Compute a maximum matching for G[M ]. If it is not a perfect matching then add an edge between v and any unmatched vertex in M , then discard M ∪ {v}. Otherwise, discard M (Lemma 18). 3. Apply a technique known as “SPLIT and MATCH” [86] to some module M and its neighbourhood NG (M ). We do so only if M satisfies some properties. In particular, we apply this rule when M is a universal module (with a complete join between M and V \ M ). See Definition 2 and Lemma 19. We introduce the reduction rules below and we prove their correctness. Reduction rules. The following lemma generalizes a well-known reduction rule for Maximum Matching: add a pending vertex and its unique neighbour to the matching then remove this edge [66]. Lemma 18. Let M be a module in a graph G = (V, E) such that NG (M ) = {v}, FM is a maximum ∗ is obtained from F matching of G[M ] and FM M by adding an edge between v and any unmatched ∗ vertex of M (possibly, FM = FM if it is a perfect matching). There exists a maximum matching F ∗ ⊆ F. of G such that FM Proof. By Lemma 12, every maximum matching for G0M = (V, (E \ E(G[M ]) ∪ FM ) is also a maximum matching for G. There are two cases. Suppose there exists u ∈ M \ V (FM ). Then, u is a pending vertex of G0M . There exists a maximum matching of G0M that contains the edge {u, v} [66]. Furthermore, removing u and v disconnects the vertices of M \ u from V \ NG [M ]. It implies that a maximum matching F 0 of G \ (u, v) is the union of any maximum matching of G[M \ u] with any maximum matching of G[V \ NG [M ]]. In particular, FM is contained in some maximum matching F 0 of G \ (u, v). Since 47 {u, v} is contained in a maximum matching of G, therefore F = F 0 ∪ {{u, v}} is a maximum ∗ = F ∪ {{u, v}} ⊆ F by construction. matching of G. We are done since FM M Otherwise, FM is a perfect matching of G[M ]. For every edge {x, y} ∈ FM , we have that x, y have degree two in G0M . The following reduction rule has been proved to be correct in [66]: remove any x of degree two, merge its two neighbours and increase the size of the solution by one unit. In our case, since NG0M [y] ⊆ NG0M [v] the latter is equivalent to put the edge {x, y} in the matching. Overall, applying the reduction rule to all edges {x, y} ∈ FM indeed proves the existence of some ∗ ⊆ F. maximum matching F such that FM = FM Then, we introduce a technique known as “SPLIT and MATCH” in the literature [86]. Definition 2. Let G = (V, E) be a graph, F ⊆ E be a matching of G. Given some module M ∈ M(G) we try to apply the following two operations until none of them is possible: • Suppose there exist u ∈ M, v ∈ NG (M ) unmatched. We add an edge {u, v} to the matching (MATCH). • Otherwise, suppose there exist u, u0 ∈ M, v, v 0 ∈ NG (M ) such that u and u0 are unmatched, and {v, v 0 } is an edge of the matching. We replace the edge {v, v 0 } in the matching by the two new edges {u, v}, {u0 , v 0 } (SPLIT). The “SPLIT and MATCH” has been applied to compute a maximum matching in linear-time for cographs and some of its generalizations [45, 46, 86]. Our Theorem 22 can be seen as a broad generalization of this technique. In what follows, we introduce more cases where the “SPLIT and MATCH” technique can be used in order to compute a maximum matching directly. Lemma 19. Let G = G1 ⊕G2 be the join of two graphs G1 , G2 and let F1 , F2 be maximum matchings for G1 , G2 , respectively. For F = F1 ∪F2 , applying the ‘SPLIT and MATCH” technique to V (G1 ), then to V (G2 ) leads to a maximum matching of G. Proof. The lemma is proved in [86] when G is a cograph. In particular, let G∗ = (V, (V (G1 ) × V (G2 )) ∪ F1 ∪ F2 ). Since it ignores the edges from (E(G1 ) \ F1 ) ∪ (E(G2 ) \ F2 ), the procedure outputs the same matching for G and G∗ . Furthermore, G∗ is a cograph, and so, the outputted matching is maximum for G∗ . By Lemma 12, a maximum matching for G∗ is a maximum matching for G. Applications. We can now combine our reductions rules as follows. Proposition 1. Let G = (V, E) be a (q, q − 3)-graph, q ≥ 7, such that its quotient graph G0 is isomorphic S to a prime p-tree. For every M ∈ M(G) let FM be a maximum matching of G[M ] and let F ∗ = M ∈M(G) FM . A maximum matching Fmax for G can be computed in O(|V (G0 )| + |E(G0 )| + |Fmax | − |F ∗ |)-time if F ∗ is given as part of the input. Proof. There are five cases. If G0 has order at most 7 then we can apply the same techniques as for Theorem 22. Otherwise, G0 is either a spiked p-chain Pk , a spiked p-chain Pk , a spiked p-chain Qk or a spiked p-chain Qk . 48 Case G is a spiked p-chain Pk . By Theorem 23 we have that (v2 , v3 , . . . , vk−1 ) are vertices of G. In this situation, since NG0 (v1 ) = v2 , Mv1 is a pending module. We can apply the reduction rule of Lemma 18 to Mv1 . Doing so, we discard Mv1 and possibly v2 . Let S = Mx if v2 has already been discarded and let S = Mx ∪ {v2 } otherwise. We have that S is a pending module in the resulting subgraph, with v3 being its unique neighbour. Furthermore, by Lemma 18 we can compute a maximum matching of G[S] from FMvx , by adding an edge between v2 (if it is present) and an unmatched vertex in Mx (if any). So, we again apply the reduction rule of Lemma 18, this time to S. Doing so, we discard S, and possibly v3 . Then, by a symmetrical argument we can also discard Mvk , My , vk−1 and possibly vk−2 . We are left with computing a maximum matching for some subpath of (v3 , v4 , . . . , vk−2 ), that can be done in linear-time by taking half of the edges. Case G is a spiked p-chain Pk . By Theorem 23, the nontrivial modules of M(G) can only be Mv1 , Mvk , Mx , My . In particular, F ∗ = FMv1 ∪ FMvk ∪ FMx ∪ FMy . Let U = Mv1 ∪ Mvk ∪ Mx ∪ My . The graph G \ U is isomorphic to Pk−2 , k ≥ 6. Furthermore, let Fk−2 contain the edges {v2 , vdk/2e+1 }, {vbk/2c , vk−1 } plus all the edges {vi , vk+1−i }, 3 ≤ i ≤ bk/2c − 1. Observe that Fk−2 is a maximum matching of Pk−2 . In particular it is a perfect matching of Pk−2 if k is even, and if k is odd then it only leaves vertex vdk/2e unmatched. We set F0 = F ∗ ∪ Fk−2 to be the initial matching. Then, we repeat the procedure below until we cannot increase the matching anymore. We consider the modules M ∈ {Mv1 , Mvk , Mx , My } sequentially. For every M we try to apply the SPLIT and MATCH technique of Definition 2. Overall, we claim that the above procedure can be implemented to run in constant-time per loop. Indeed, assume that the matched vertices (resp., the unmatched vertices) are stored in a list in such a way that all the vertices in a same module Mv , v ∈ V (G0 ) are consecutive. For every matched vertex u, we can access to the vertex that is matched with u in constant-time. Furthermore for every v ∈ V (G0 ), we keep a pointer to the first and last vertices of Mv in the list of matched vertices (resp., in the list of unmatched vertices). For any loop of the procedure, we iterate over four modules M , that is a constant. Furthermore, since |NG (M )| ≥ |V (G) \ M | − 2 then we only need to check three unmatched vertices of V \ M in order to decide whether we can perform a MATCH operation. Note that we can skip scanning the unmatched vertices in M using our pointer structure, so, it takes constant-time. In the same way, we only need to consider three matched vertices of V \ M in order to decide whether we can perform a SPLIT operation. Again, it takes constant-time. Therefore, the claim is proved. Let Fmax be the matching so obtained. By the above claim it takes O(|Fmax | − |F0 |)-time to compute it with the above procedure. Furthermore, we claim that Fmax is maximum. Suppose for the sake of contradiction that Fmax is not a maximum matching. By Lemma 12, Fmax cannot be a maximum matching of G∗ , obtained from G by removing the edges in (E(G[Mv1 ]) ∪ E(G[Mvx ]) ∪ E(G[Mvy ]) ∪ E(G[Mvk ])) \ F ∗ . Let P = (u1 , u2 , . . . , u2` ) be a shortest Fmax -augmenting path in G∗ , that exists by Theorem 21. We prove as an intermediate subclaim that both u1 , u2` must be part of a same module amongst Mv1 , Mvk , Mx , My . Indeed, for every distinct M, M 0 ∈ {Mv1 , Mvk , Mx , My }, every vertex of M is adjacent to every vertex of M 0 . Furthermore, V (Fk−2 ) ⊆ V (Fmax ) by construction and vdk/2e (the only vertex of Pk−2 possibly unmatched) is adjacent to every vertex of U . Therefore, if the subclaim were false then u1 , u2` should be adjacent, hence they should have been matched together with a MATCH operation. A contradiction. So, the subclaim is proved. Let M ∈ {Mv1 , Mvk , Mx , My } so that u1 , u2` ∈ M . Since E(G∗ [M ]) = FM , and V (FM ) ⊆ 49 V (F ∗ ) ⊆ V (Fmax ) by construction, we have u2 ∈ NG (M ). Furthermore, u3 ∈ / NG (M ) since otherwise, by considering u1 , u2` ∈ M and u2 , u3 ∈ NG (M ), we should have increased the matching with a SPLIT operation. In this situation, either u3 ∈ M or u3 ∈ V \ NG [M ]. We prove as another subclaim that u3 , u4 ∈ M . Indeed, suppose by contradiction u4 ∈ NG (M ). In particular, (u1 , u4 , u5 , . . . , u2` ) is a shorter augmenting path than P , thereby contradicting the minimality of P . Therefore, u4 ∈ / NG (M ). Moreover, if u3 ∈ V \ NG [M ] then, since the set V \ NG [M ] induces a stable, we should have u4 ∈ NG (M ). A contradiction. So, u3 ∈ M , and u4 ∈ NG [M ]\NG (M ) = M , that proves the subclaim. The above subclaim implies {u3 , u4 } ∈ FM . Since {u3 , u4 } ∈ / Fmax , there exists a module M 0 such that u2 , u5 ∈ M 0 , and the edges {u2 , u3 }, {u4 , u5 } have been obtained with a SPLIT operation. However, since u1 , u2` ∈ M are unmatched, and M ⊆ NG (M 0 ), we should have performed two MATCH operations intead of performing a SPLIT operation. A contradiction. Therefore, as claimed, Fmax is a maximum matching of G. S Case G is a spiked p-chain Qk . For every 1 ≤ i ≤ dk/2e, let Vi = j≥i (Mv2j−1 ∪ Mv2j ∪ Mz2j−1 ∪ Mz2j ) (by convention Mv = ∅ if vertex v is not present). Roughly, our algorithm tries to compute recursively a maximum matching for Gi = G[Vi ∪ Ui−1 ], where Ui−1 is a union of modules in {Mv2i−2 , Mz2i−2 }. Initially, we set i = 1 and U0 = ∅. See Fig. 21. Ui-1 v 2i z 2i Vi+1 z 2i-1 v 2i-1 Figure 21: Schematic view of graph Gi . If i = dk/2e then the quotient subgraph G0i has order at most six. We can reuse the same techniques as for Theorem 22 in order to solve this case. Thus from now on assume i < dk/2e. We need to observe that v2i−1 is a pending vertex in the quotient subgraph G0i , with v2i being its unique neighbour. By Theorem 23, v2i ∈ V (G), hence Mv2i−1 is a pending module of Gi . Thus, we can apply the reduction rule of Lemma 18. Doing so, we can discard the set Si , where Si = Mv2i−1 ∪ {v2i } if FMv2i−1 is not a perfect matching of G[Mv2i−1 ], and Si = Mv2i−1 otherwise. Furthermore, in the case where Ui−1 6= ∅, there is now a complete join between Ui−1 and Vi \ Si . By Lemma 19 we can compute a maximum matching of Gi \ Si from a maximum matching of G[Ui−1 ] and a maximum matching of G[Vi \ Si ]. In particular, since Ui−1 is a union of modules in {Mv2i−2 , Mz2i−2 } and there is a complete join between Mv2i−2 and Mz2i−2 , by Lemma 19 a maximum matching of G[Ui−1 ] can be computed from FMv2i−2 and FMz2i−2 . So, we are left to compute a maximum matching of G[Vi \ Si ]. Then, there are two subcases. If v2i ∈ Si then Mz2i−1 is disconnected in G[Vi \ Si ]. Let Ui = Mz2i . The union of FMz2i−1 with a maximum matching of Gi+1 = G[Vi+1 ∪ Ui ] is a maximum matching of G[Vi \ Si ]. Otherwise, Mz2i−1 is a pending module of G[Vi \ Si ] with v2i being its unique 50 neighbour. We apply the reduction rule of Lemma 18. Doing so, we can discard the set Ti , where Ti = Mz2i−1 ∪ {v2i } if FMz2i−1 is not a perfect matching of G[Mz2i−1 ], and Ti = Mz2i−1 otherwise. Let Ui = Mz2i if v2i ∈ Ti and Ui = Mz2i ∪ Mv2i otherwise. We are left to compute a maximum matching of Gi+1 = G[Vi+1 ∪ Ui ]. Overall, the procedure stops after we reach an empty subgraph, that takes O(|V (G0 )|) recursive calls. Case G is a spiked p-chain Qk . Roughly, the case where G0 is isomorphic to a spiked p-chain Qk is obtained by reverting the S role of vertices with even index and vertices with odd index. For every 1 ≤ i ≤ bk/2c, let Vi = j≥i (Mv2j ∪ Mz2j ∪ Mv2j+1 ∪ Mz2j+1 ). Our algorithm tries to compute recursively a maximum matching for Gi = G[Vi ∪ Ui−1 ], where Ui−1 is a union of modules in {Mv2i−1 , Mz2i−1 }. Initially, we set i = 1 and U0 = Mv1 . If i = bk/2c then the quotient subgraph G0i has order at most six. We can reuse the same techniques as for Theorem 22 in order to solve this case. Thus from now on assume i < bk/2c. We need to observe that v2i is a pending vertex in the quotient subgraph G0i , with v2i+1 being its unique neighbour. By Theorem 23, v2i+1 ∈ V (G), hence Mv2i is a pending module of Gi . Thus, we can apply the reduction rule of Lemma 18. Doing so, we can discard the set Si , where Si = Mv2i ∪ {v2i+1 } if FMv2i is not a perfect matching of G[Mv2i ], and Si = Mv2i otherwise. Furthermore, in the case where Ui−1 6= ∅, there is now a complete join between Ui−1 and Vi \ Si . By Lemma 19 we can compute a maximum matching of Gi \ Si from a maximum matching of G[Ui−1 ] and a maximum matching of G[Vi \ Si ]. In particular, since Ui−1 is a union of modules in {Mv2i−1 , Mz2i−1 } and there is a complete join between Mv2i−1 and Mz2i−1 , by Lemma 19 a maximum matching of G[Ui−1 ] can be computed from FMv2i−2 and FMz2i−2 . So, we are left to compute a maximum matching of G[Vi \ Si ]. Then, there are two subcases. If v2i+1 ∈ Si then Mz2i is disconnected in G[Vi \ Si ]. Let Ui = Mz2i+1 . The union of FMz2i with a maximum matching of Gi+1 = G[Vi+1 ∪ Ui ] is a maximum matching of G[Vi \ Si ]. Otherwise, Mz2i is a pending module of G[Vi \ Si ] with v2i+1 being its unique neighbour. We apply the reduction rule of Lemma 18. Doing so, we can discard the set Ti , where Ti = Mz2i ∪ {v2i+1 } if FMz2i is not a perfect matching of G[Mz2i ], and Ti = Mz2i otherwise. Let Ui = Mz2i+1 if v2i+1 ∈ Ti and Ui = Mz2i+1 ∪ Mv2i+1 otherwise. We are left to compute a maximum matching of Gi+1 = G[Vi+1 ∪ Ui ]. Overall, the procedure stops after O(|V (G0 )|) recursive calls. Main result Theorem 24. For every G = (V, E), Maximum Matching can be solved in O(q(G)4 ·n+m)-time. Proof. We generalize the algorithm for Theorem 22. In particular the algorithm is recursive. If G is trivial (reduced to a single node) then we output an empty matching. Otherwise, let G0 = (M(G), E 0 ) be the quotient graph of G. For every module M ∈ M(G), we call the algorithm S recursively on G[M ] in order to compute a maximum matching FM of G[M ]. Let F ∗ = M ∈M(G) FM . If G0 is either edgeless, complete or a prime graph with no more than q(G) vertices then we apply the same techniques as for Theorem 22 in order to compute a maximum matching Fmax for G. It takes constant-time if G0 is a stable, O(q(G)4 · (|Fmax | − |F ∗ |))-time if G0 is prime and O(|V (G0 )| + (|Fmax | − |F ∗ |))-time if G0 is a complete graph. Otherwise by Theorem 23 the following cases need to be considered. • Suppose G is a disc. In particular, G = G0 . By Lemma 16, we can compute a maximum matching for G in O(|V (G0 )| + |E(G0 )|)-time. 51 • Suppose G = (S ∪ K ∪ R, E) is a spider. In particular, G0 = (S ∪ K ∪ R0 , E 0 ) is a prime spider. By Lemma 17, the union of FR = F ∗ with a perfect matching between S and K is a maximum matching of G. It can be computed in O(|V (G0 )| + |E(G0 )|)-time. • Otherwise G0 is a prime p-tree. By Proposition 1, a maximum matching Fmax for G can be computed in O(|V (G0 )| + |E(G0 )| + |Fmax | − |F ∗ |)-time. Overall, summing the order of all the subgraphs in the modular decomposition of G amounts to O(n) [78]. Summing the size of all the subgraphs in the modular decomposition of G amounts to O(n + m) [78]. Furthermore, a maximum matching of G also has cardinality O(n). Therefore, the total running time is in O(q(G)4 · n + m) if the modular decomposition of G is given. The latter decomposition can be precomputed in O(n + m)-time [83]. 6 Applications to other graph classes Our algorithmic schemes in Sections 4 and 5 are all based on preprocessing methods with either split decomposition or modular decomposition. If the prime subgraphs of the decomposition have constant-size then the input graph has bounded clique-width. However, when the prime subgraphs are “simple” enough w.r.t. the problem considered, we may well be able to generalize our techniques in order to apply to some graph classes with unbounded clique-width. In what follows, we present such examples. A graph is weak bipolarizable if every prime subgraph in its modular decomposition is a chordal graph [74]. Some cycle problems such as Girth (trivially) and Triangle Counting (by using a clique-tree) can be easily solved in linear-time for chordal graphs. The latter extends to the larger class of weak bipolarizable graphs by using our techniques. Another instructive example is the class of graphs with small prime subgraphs for cdecomposition. The c-decomposition consists in successively decomposing a graph by the modular decomposition and the split decomposition until all the subgraphs obtained are either degenerate (complete, edgeless or star) or prime for both the modular decomposition and the split decomposition [69]. Let us call c-width the minimum k ≥ 2 such that any prime subgraph in the c-decomposition has order at most k. The following was proved in [77]. Theorem 25 ( [77]). The class of graphs with c-width 2 (i.e., completely decomposable by the c-decomposition) has unbounded clique-width. It is not clear how to compute the c-decomposition in linear-time. However, both the modular decomposition and the split decomposition of graphs with small c-width already have some interesting properties which can be exploited for algorithmic purposes. Before concluding this section we illustrate this fact with Eccentricities. Lemma 20. Let G = (V, E) be a graph with c-width at most k that is prime for modular decomposition. Every split component of G that is not degenerate either has order at most k or contains a universal vertex. Proof. Since G has c-width at most k, every non degenerate split component of G with order at least k + 1 can be modularly decomposed. We show in the proof of Lemma 10 that if a non degenerate graph can be modularly decomposed and it does not contain a universal vertex then it has a split. 52 Therefore, every non degenerate split component of size at least k + 1 contains a universal vertex since it is prime for split decomposition. We now revisit the algorithmic scheme of Theorem 8. Proposition 2. For every G = (V, E) with c-width at most k, Eccentricities can be solved in O(k 2 · n + m)-time. In particular, Diameter can also be solved in O(k 2 · n + m)-time. Proof. Let G0 = (V 0 , E 0 ) be the quotient graph of G. Note that G0 has c-width at most k. Furthermore, by Theorem 13 the problem reduces in linear-time to solve Eccentricities for G0 . We compute the split-decomposition of G0 . It takes linear-time [20]. By Lemma 20 every split component of G0 either has order at most k or it has diameter at most 2. Let us consider the following subproblem for every split component Ci . Given a weight function e : V (Ci ) → N, compute maxu∈V (Ci )\{v} distCi (u, v) + e(u) for every v ∈ Ci . Indeed, the algorithm for Theorem 8 consists in solving the above subproblem a constant-number of times for every split component, with different weight functions e that are computed by tree traversal on the split decomposition tree. In particular, if the above subproblem can be solved in O(k 2 ·|V (Ci )|+|E(Ci )|)time for every split component Ci then we can solve Eccentricities for G0 in O(k 2 · |V (G0 )| + |E(G0 )|)-time. There are two cases. If Ci has order at most k then the above subproblem can be solved in O(|V (Ci )||E(Ci )|)-time, that is in O(k 2 · |V (Ci )|). Otherwise, by Lemma 20 Ci contains a universal vertex, that can be detected in O(|V (Ci )| + |E(Ci )|)-time. In particular, Ci has diameter at most two. Let V (Ci ) = (v1 , v2 , . . . , v|V (Ci )| ) be totally ordered such that, for every j < j 0 we have e(vj ) ≥ e(vj 0 ). An ordering as above can be computed in O(|V (Ci )|)-time, for instance using a bucket-sort algorithm. Then, for every v ∈ V (Ci ) we proceed as follows. We compute Dv = 1 + maxu∈NC (v) e(u). It takes O(degCi (v))-time. Then, we compute the smallest j such that i vj and v are nonadjacent (if any). Starting from v1 and following the ordering, it takes O(degCi (v))time. Finally, we are left to compare, in constant-time, Dv with 2 + e(vi ). Overall, the subproblem is solved in O(|V (Ci )| + |E(Ci )|)-time in this case. Therefore, Eccentricities can be solved in O(k 2 · n + m)-time for G. References [1] A. Abboud, F. Grandoni, and V. Vassilevska Williams. Subcubic equivalences between graph centrality problems, apsp and diameter. In SODA’15, pages 1681–1697. SIAM, 2015. [2] A. Abboud and V. Vassilevska Williams. Popular conjectures imply strong lower bounds for dynamic problems. In FOCS’14, pages 434–443. IEEE, 2014. [3] A. Abboud, V. Vassilevska Williams, and J. Wang. Approximation and fixed parameter subquadratic algorithms for radius and diameter in sparse graphs. In SODA’16, pages 377–391. SIAM, 2016. [4] M. Aigner and M. Fromme. A game of cops and robbers. Discrete Applied Mathematics, 8(1):1–12, 1984. [5] L. Babel. Tree-like P4 -connected graphs. Discrete Mathematics, 191(1-3):13–23, 1998. 53 [6] L. Babel. Recognition and isomorphism of tree-like P4 -connected graphs. Discrete Applied Mathematics, 99(1):295–315, 2000. [7] L. Babel and S. Olariu. On the structure of graphs with few P4 ’s. Discrete Applied Mathematics, 84(1–3):1–13, 1998. [8] L. Babel and S. Olariu. On the p-connectedness of graphs – a survey. Discrete Applied Mathematics, 95(1-3):11–33, 1999. [9] H.-J. Bandelt and H. Mulder. Distance-hereditary graphs. J. of Combinatorial Theory, Series B, 41(2):182–208, 1986. [10] S. Baumann. A linear algorithm for the homogeneous decomposition of graphs. Technical report, Citeseer, 1996. [11] M. Bentert, T. Fluschnik, A. Nichterlein, and R. Niedermeier. Parameterized Aspects of Triangle Enumeration. Technical Report arXiv:1702.06548, ArXiv, 2017. [12] C. Berge. Two theorems in graph theory. Proceedings of the National Academy of Sciences, 43(9):842–844, 1957. [13] H. Bodlaender. Treewidth: Characterizations, Applications, and Computations. In WG’06, volume 4271 of LNCS, pages 1–14. Springer, 2016. [14] H. L. Bodlaender and A. Koster. 306(3):337–350, 2006. Safe separators for treewidth. Discrete Mathematics, [15] J. A. Bondy and U. S. R. Murty. Graph theory. Grad. Texts in Math., 2008. [16] M. Borassi, D. Coudert, P. Crescenzi, and A. Marino. On computing the hyperbolicity of real-world graphs. In European Symposium on Algorithms - ESA’15, volume 9294 of LNCS, pages 215–226. Springer, 2015. [17] M. Borassi, P. Crescenzi, and M. Habib. Into the square: On the complexity of some quadratictime solvable problems. Electronic Notes in Theoretical Computer Science, 322:51–67, 2016. [18] U. Brandes. A faster algorithm for betweenness centrality. J. of mathematical sociology, 25(2):163–177, 2001. [19] G. Brinkmann, J. H. Koolen, and V. Moulton. On the hyperbolicity of chordal graphs. Annals of Combinatorics, 5(1):61–69, 2001. [20] P. Charbit, F. De Montgolfier, and M. Raffinot. Linear time split decomposition revisited. SIAM Journal on Discrete Mathematics, 26(2):499–514, 2012. [21] N. Cohen, D. Coudert, G. Ducoffe, and A. Lancin. Applying clique-decomposition for computing Gromov hyperbolicity. Theoretical Computer Science, to appear. [22] N. Cohen, D. Coudert, and A. Lancin. On computing the gromov hyperbolicity. Journal of Experimental Algorithmics (JEA), 20:1–6, 2015. 54 [23] D. Corneil, M. Habib, J.-M. Lanlignel, B. Reed, and U. Rotics. Polynomial Time Recognition of Clique-Width ≤ 3 Graphs. In LATIN’00, volume 1776 of LNCS, pages 126–134. Springer, 2000. [24] D. Corneil, Y. Perl, and L. Stewart. A linear recognition algorithm for cographs. SIAM Journal on Computing, 14(4):926–934, 1985. [25] D. Corneil and U. Rotics. On the relationship between clique-width and treewidth. SIAM Journal on Computing, 34(4):825–847, 2005. [26] D. Coudert and G. Ducoffe. Recognition of C4 -free and 1/2-hyperbolic graphs. SIAM Journal on Discrete Mathematics, 28(3):1601–1617, 2014. [27] B. Courcelle. The monadic second-order logic of graphs. I. recognizable sets of finite graphs. Information and computation, 85(1):12–75, 1990. [28] B. Courcelle. On the model-checking of monadic second-order formulas with edge set quantifications. Discrete Applied Mathematics, 160(6):866–887, 2012. [29] B. Courcelle, J. Engelfriet, and G. Rozenberg. Handle-rewriting hypergraph grammars. J. of Computer and System Sciences, 46(2):218–270, 1993. [30] B. Courcelle, P. Heggernes, D. Meister, C. Papadopoulos, and U. Rotics. A characterisation of clique-width through nested partitions. Discrete Applied Mathematics, 187:70–81, 2015. [31] B. Courcelle, J. Makowsky, and U. Rotics. Linear time solvable optimization problems on graphs of bounded clique-width. Theory of Computing Systems, 33(2):125–150, 2000. [32] B. Courcelle and S. Olariu. Upper bounds to the clique width of graphs. Discrete Applied Mathematics, 101(1):77–114, 2000. [33] W. Cunningham. Decomposition of directed graphs. SIAM Journal on Algebraic Discrete Methods, 3(2):214–228, 1982. [34] R. Diestel. Graph Theory. Grad. Texts in Math. Springer, 2010. 4th edition. [35] F. Dragan. On greedy matching ordering and greedy matchable graphs. In WG’97, volume 1335 of LNCS, pages 184–198. Springer, 1997. [36] F. Dragan and F. Nicolai. LexBFS-orderings of distance-hereditary graphs with application to the diametral pair problem. Discrete Applied Mathematics, 98(3):191–207, 2000. [37] R. Duan and S. Pettie. Linear-time approximation for maximum weight matching. Journal of the ACM, 61(1):1, 2014. [38] G. Ducoffe. Metric properties of large graphs. Phd thesis, Université Côte d’Azur, Dec. 2016. [39] J. Edmonds. Paths, trees, and flowers. Canadian J. of mathematics, 17(3):449–467, 1965. [40] W. Espelage, F. Gurski, and E. Wanke. How to solve NP-hard graph problems on clique-width bounded graphs in polynomial time. In WG’11, volume 1, pages 117–128. Springer. 55 [41] J. Evald and S. Dahlgaard. Tight Hardness Results for Distance and Centrality Problems in Constant Degree Graphs. Technical Report arXiv:1609.08403, ArXiv, 2016. [42] M. Fellows, F. A. Rosamond, U. Rotics, and S. Szeider. Clique-width is NP-complete. SIAM Journal on Discrete Mathematics, 23(2):909–939, 2009. [43] T. Fluschnik, C. Komusiewicz, G. Mertzios, A. Nichterlein, R. Niedermeier, and N. Talmon. When can Graph Hyperbolicity be computed in Linear Time? Technical Report arXiv:1702.06503, ArXiv, 2017. [44] F. Fomin, D. Lokshtanov, M. Pilipczuk, S. Saurabh, and M. Wrochna. Fully polynomial-time parameterized computations for graphs and matrices of low treewidth. In SODA’17, pages 1419–1432. SIAM, 2017. [45] J.-L. Fouquet, V. Giakoumakis, and J.-M. Vanherpe. Bipartite graphs totally decomposable by canonical decomposition. International J. of Foundations of Computer Science, 10(04):513– 533, 1999. [46] J.-L. Fouquet, I. Parfenoff, and H. Thuillier. An O(n)-time algorithm for maximum matching in P4 -tidy graphs. Information processing letters, 62(6):281–287, 1997. [47] H. Fournier, A. Ismail, and A. Vigneron. Computing the Gromov hyperbolicity of a discrete metric space. Information Processing Letters, 115(6):576–579, 2015. [48] L. Freeman. A set of measures of centrality based on betweenness. Sociometry, pages 35–41, 1977. [49] H. Gabow and R. Tarjan. A linear-time algorithm for a special case of disjoint set union. In STOC’83, pages 246–251. ACM, 1983. [50] J. Gajarskỳ, M. Lampis, and S. Ordyniak. Parameterized Algorithms for Modular-Width. In IPEC’13, volume 8246 of LNCS, pages 163–176. Springer, 2013. [51] A. Gajentaan and M. H. Overmars. On a class of o(n2 ) problems in computational geometry. Computational geometry, 5(3):165–185, 1995. [52] T. Gallai. Transitiv orientierbare graphen. Acta Mathematica Hungarica, 18(1):25–66, 1967. [53] C. Gavoille and C. Paul. Distance labeling scheme and split decomposition. Discrete Mathematics, 273(1):115–130, 2003. [54] V. Giakoumakis, F. Roussel, and H. Thuillier. On P4 -tidy graphs. Discrete Mathematics and Theoretical Computer Science, 1, 1997. [55] A. C. Giannopoulou, G. B. Mertzios, and R. Niedermeier. Polynomial fixed-parameter algorithms: A case study for longest path on interval graphs. Theoretical Computer Science, 2017. In Press. [56] E. Gioan and C. Paul. Split decomposition and graph-labelled trees: characterizations and fully dynamic algorithms for totally decomposable graphs. Discrete Applied Mathematics, 160(6):708–733, 2012. 56 [57] M. Golumbic and U. Rotics. On the clique-width of some perfect graph classes. International J. of Foundations of Computer Science, 11(03):423–443, 2000. [58] M. Gromov. Hyperbolic groups. In Essays in group theory, pages 75–263. Springer, 1987. [59] F. Gurski and E. Wanke. The tree-width of clique-width bounded graphs without Kn,n . In WG’00, volume 1928 of LNCS, pages 196–205. Springer, 2000. [60] M. Habib and C. Paul. A survey of the algorithmic aspects of modular decomposition. Computer Science Review, 4(1):41–59, 2010. [61] E. Howorka. On metric properties of certain clique graphs. J. of Combinatorial Theory, Series B, 27(1):67–74, 1979. [62] T. Husfeldt. Computing graph distances parameterized by treewidth and diameter. IPEC’16, volume 63. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2016. In [63] R. Impagliazzo, R. Paturi, and F. Zane. Which problems have strongly exponential complexity? In FOCS’98, pages 653–662. IEEE, 1998. [64] B. Jamison and S. Olariu. P-components and the homogeneous decomposition of graphs. SIAM Journal on Discrete Mathematics, 8(3):448–463, 1995. [65] C. Jordan. Sur les assemblages de lignes. J. Reine Angew. Math, 70(185):81, 1869. [66] R. Karp and M. Sipser. Maximum matching in sparse random graphs. In FOCS’81, pages 364–375. IEEE, 1981. [67] D. Kratsch and J. Spinrad. Between o(nm) and o(nα ). SIAM Journal on Computing, 36(2):310– 325, 2006. [68] M. Lampis. Algorithmic meta-theorems for restrictions of treewidth. Algorithmica, 64(1):19– 37, 2012. [69] J.-M. Lanlignel. Autour de la décomposition en coupes. PhD thesis, Université Montpellier 2, 2001. [70] J. Makowsky and U. Rotics. On the clique-width of graphs with few P4 ’s. International J. of Foundations of Computer Science, 10(03):329–348, 1999. [71] G. Mertzios, A. Nichterlein, and R. Niedermeier. Fine-grained algorithm design for matching. Technical Report arXiv:1609.08879, ArXiv, 2016. √ [72] S. Micali and V. Vazirani. An O( V E) algorithm for finding maximum matching in general graphs. In FOCS’80, pages 17–27. IEEE, 1980. [73] M. Novick. Fast parallel algorithms for the modular decomposition. Technical report, Cornell University, 1989. [74] S. Olariu. Weak bipolarizable graphs. Discrete Mathematics, 74(1-2):159–171, 1989. 57 [75] S. Oum and P. Seymour. Approximating clique-width and branch-width. Journal of Combinatorial Theory, Series B, 96(4):514–528, 2006. [76] R. Puzis, Y. Elovici, P. Zilberman, S. Dolev, and U. Brandes. Topology manipulations for speeding betweenness centrality computation. J. of Complex Networks, 3(1):84–112, 2014. [77] M. Rao. Clique-width of graphs defined by one-vertex extensions. Discrete Mathematics, 308(24):6157–6165, 2008. [78] M. Rao. Solving some NP-complete problems using split decomposition. Discrete Applied Mathematics, 156(14):2768–2780, 2008. [79] N. Robertson and P. Seymour. Graph minors. II. algorithmic aspects of tree-width. Journal of algorithms, 7(3):309–322, 1986. [80] L. Roditty and V. Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparse graphs. In STOC’13, pages 515–524. ACM, 2013. [81] M. Soto Gómez. Quelques propriétés topologiques des graphes et applications à internet et aux réseaux. PhD thesis, Univ. Paris Diderot (Paris 7), 2011. [82] D. Sumner. Graphs indecomposable with respect to the X-join. 6(3):281–298, 1973. Discrete Mathematics, [83] M. Tedder, D. Corneil, M. Habib, and C. Paul. Simpler linear-time modular decomposition via recursive factorizing permutations. In ICALP’08, volume 5125 of LNCS, pages 634–645. Springer, 2008. [84] V. Vassilevska Williams. Hardness of easy problems: Basing hardness on popular conjectures such as the strong exponential time hypothesis (Invited talk). In IPEC’15, pages 16–28. [85] V. Vassilevska Williams and R. Williams. Subcubic equivalences between path, matrix and triangle problems. In FOCS’10, pages 645–654. IEEE, 2010. [86] M.-S. Yu and C.-H. Yang. An O(n)-time algorithm for maximum matching on cographs. Information processing letters, 47(2):89–93, 1993. A Proof of Theorem 23 Our proof in this section involves a refinement of modules, that is called p-connected components. The notion of p-connectedness also generalizes connectivity in graphs. A graph G = (V, E) is p-connected if and only if, for every bipartition (V1 , V2 ) of V , there exists a path of length four with vertices in both V1 and V2 . The p-connected components of a graph are its maximal induced subgraphs which are p-connected. Furthermore, a p-connected graph is termed separable if there exists a bipartition (V1 , V2 ) of its vertex-set such that, for every crossing P4 , its two ends are in V2 and its two internal vertices are in V1 . The latter bipartition (V1 , V2 ) is called a separation, and if it exists then it is unique. We need a strengthening of Theorem 1: Theorem 26 ( [64]). For an arbitrary graph G exactly one of the following conditions is satisfied. 58 1. G is disconnected; 2. G is disconnected; 3. There is a unique proper separable p-connected component of G, with its separation being (V1 , V2 ) such that every vertex not in this component is adjacent to every vertex of V1 and nonadjacent to every vertex of V2 ; 4. G is p-connected. If G or G is disconnected then it corresponds to a degenerate node in the modular decomposition tree. So we know how to handle with the two first cases. It remains to study the p-connected components of (q, q − 3)-graphs. For that, we need to introduce the class of p-trees: Definition 3 ( [6]). A graph G = (V, E) is a p-tree if one of the following conditions hold: • the quotient graph G0 of G is a P4 . Furthermore, G is obtained from G0 by replacing one vertex by a cograph. • the quotient graph G0 of G is a spiked p-chain Pk , or its complement. Furthermore, G is obtained from G0 by replacing any of x, y, v1 , vk by a module inducing a cograph. • the quotient graph G0 of G is a spiked p-chain Qk , or its complement. Furthermore, G is obtained from G0 by replacing any of v1 , vk , z2 , z3 , . . . , zk−5 by a module inducing a cograph. We stress that the case where the quotient graph G0 is a P4 , and so, of order 4 ≤ 7 ≤ q can be ignored in our analysis. Other characterizations for p-trees can be found in [5]. The above Definition 3 is more suitable to our needs. Theorem 27 ( [8]). A p-connected component of a (q, q − 3)-graph either contains less than q vertices, or is isomorphic to a prime spider, to a disc or to a p-tree. Finally, before we can prove Theorem 23, we need to further characterize the separable pconnected components. We use the following characterization of separable p-connected components. Theorem 28 ( [64]). A p-connected graph G = (V, E) is separable if and only if its quotient graph is a split graph. Furthermore, its unique separation (V1 , V2 ) is given by the union V1 of the strong modules inducing the clique and the union V2 of the strong modules inducing the stable set. We are now ready to prove Theorem 23. Proof of Theorem 23. Suppose G and G are connected (otherwise we are done). By Theorem 26 there are two cases. First we assume G to be p-connected. By Theorem 27, G either contains less than q vertices, or is isomorphic to a prime spider, to a disc or to a p-tree. Furthermore, if G is a p-tree then according to Definition 3, the nontrivial modules can be characterized. So, we are done in this case. Otherwise, G is not p-connected. Let V = V1 ∪ V2 ∪ V3 such that: H = G[V1 ∪ V2 ] is a separable p-component with separation (V1 , V2 ), every vertex of V3 is adjacent to every vertex of V1 and nonadjacent to every vertex of V2 . Note that G0 is obtained from the quotient graph H 0 of H by possibly adding a vertex adjacent to all the strong modules in V1 . In particular, by Theorem 28 H 0 is a split graph, and so, G0 is also a split graph. By Lemma 4, it implies that G0 is either a prime 59 spider, a spiked p-chain Qk , a spiked p-chain Qk , or a graph with at most q vertices. Furthermore, if G0 is a prime spider then by Theorem 27 so is H, hence G is a spider. Otherwise, G0 is either a spiked p-chain Qk or a spiked p-chain Qk . It implies that H is a p-tree. In particular, the nontrivial modules in H can be characterized according to Definition 3. The only nontrivial module of G that is not a nontrivial module of H (if any) contains V3 . Finally, since the module that contains V3 has no neighbour among the modules in V2 , the corresponding vertex in the quotient can only be a zi , for some i. So, we are also done in this case. 60
8cs.DS
1 On the Shift Operator, Graph Frequency and Optimal Filtering in Graph Signal Processing arXiv:1511.03512v6 [math.SP] 5 Sep 2017 Adnan Gavili and Xiao-Ping Zhang, Senior member, IEEE Abstract—Defining a sound shift operator for signals existing on a certain graph structure, similar to the well-defined shift operator in classical signal processing, is a crucial problem in graph signal processing, since almost all operations, such as filtering, transformation, prediction, are directly related to the graph shift operator. We define a set of energy-preserving shift operators that satisfy many properties similar to their counterparts in classical signal processing. Our definition of the graph shift operator negates the shift operators defined in the literature, such as the graph adjacency matrix and Laplacian matrix based shift operators, which modify the energy of a graph signal. We decouple the graph structure represented by eigengraphs and the eigenvalues of the adjacency matrix or the Laplacian matrix. We show that the adjacency matrix of a graph is indeed a linear shift invariant (LSI) graph filter with respect to the defined shift operator. We introduce graph finite impulse response (GFIR) and graph infinite impulse response (GIIR) filters and obtain explicit forms for such filters. We further define autocorrelation and cross-correlation functions of signals on the graph, enabling us to obtain the solution to the optimal filtering on graphs, i.e., the corresponding Wiener filtering on graphs and the efficient spectra analysis and frequency domain filtering in parallel with those in classical signal processing. This new shift operator based GSP framework enables the signal analysis along a correlation structure defined by a graph shift manifold as opposed to classical signal processing operating on the assumption of the correlation structure with a linear time shift manifold. We further provide the solution to the optimal linear predictor problem over general graphs. Several illustrative simulations are presented to validate the performance of the designed optimal LSI filters. Index Terms—Graph signal processing, graph shift operator, graph Fourier transform, graph correlation function, graph spectral analysis, optimal filtering on graph I. I NTRODUCTION Graph signal processing (GSP) is an emerging field, focusing on representing signals as evolving entities on graphs and analyzing the signals based on the structure of the graph [1]–[4]. The temporally evolving measured data from variety of sources in a network, such as the measured data from sensors in wireless sensor networks, body area sensor networks, transportation networks and weather networks, are compatible with signal representation on certain graphs. For instance, a network of sensors implanted in a human body to measure the temperatures of different tissues can be viewed This work was supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC), Grant No. RGPIN239031. The authors are with the Department of Electrical and Computer Engineering, Ryerson University, 350 Victoria Street, Toronto, Ontario, Canada M5B 2K3. E-mail: [email protected] and [email protected]. Xiao-Ping Zhang is the corresponding author. Version: Thursday 7th September, 2017 as a graph in which the sensor nodes are the graph nodes and the graph structure shows the connection between the sensor nodes. Moreover, the measured temperatures by the nodes are the signals existing on the corresponding graph. Hence, GSP can be a powerful tool for analyzing and interpreting such signals existing on graphs. Classical signal processing has provided a wide range of tools to analyze, transform and reconstruct signals regardless of the true nature of the signals evolution. Indeed, classical signal processing may not provide an effective way to represent and analyze the signals that exist on a graph structure. GSP is an attempt to develop a universal tool to process signals on graphs. More specifically, GSP benefits from algebraic and graph theoretic concepts, such as graph spectrum and graph connectivity, to analyze structured data [1], [5], [6]. Two major approaches have been developed for signal processing on graphs. The first approach is to use the graph Laplacian matrix as the underlying building block for the definitions and tools in GSP [1]. The second approach is to use the adjacency matrix of the underlying graph as the shift operator on graph [2]–[4]. Both approaches define fundamental signal processing concepts on graphs, such as filtering, transformation, downsampling. Graph wavelet transforms are discussed in [7]–[9]. The idea of graph filter banks is developed in [10] with the design of critically-sampled wavelet-filter banks on graphs. Authors in [11] introduce two-channel (low-pass and highpass), critically-sampled, perfect-reconstruction filterbanks for signals defined on circulant graphs. The authors in [12] extend the framework of sampling and reconstructing signals with a finite rate of innovation (FRI) to the graph domain. Authors in [13] present novel families of wavelets and associated filterbanks for the analysis and representation of functions defined on circulant graphs and generalize to arbitrary graphs in the form of graph approximations. In [14], the authors present a method to decompose an arbitrary graph or filter into a combination of circulant structures. In [15]–[17], the authors focus on recovering the graph structure, i.e., the graph adjacency matrix, via formulating a design problem. The obtained graph structure can then be used to obtain the graph Fourier basis, the new graph shift operator and graph filters. In this paper, we assume that the graph structure is already obtained, e.g., using any of these approaches, and we aim to define a graph shift operator that satisfies certain properties. When the structure of a graph is known, the common effort in GSP is to define a shift operator on the graph and then introduce the concepts of filtering, transformation, denoising, prediction, compression and other operations similar to the 2 conventional counterparts in classical signal processing, based on the shift operator. It is defined in [1] as the translation on graph via generalized convolution with a delta centered at vertex n. In [2], the graph shift operator is the adjacency matrix of the graph and simple justification of such a choice is presented. However, none of these operators satisfy the energypreserving property similar to their counterpart in classical signal processing. More specifically, applying the shift operator in [1], [2] to a graph signal several times will change the energy content of the graph signal and its frequency components, making it difficult to justify and design the filter frequency response as in classical signal processing. An isometric shift operator has recently been introduced in [18]–[20], which satisfies the energy-preserving property. This shift operator is a matrix whose eigenvalues are derived from the graph Laplacian matrix. The limitation of this approach is that its phase shifts are structure-dependent and do not satisfy some other desired properties leading to computationally efficient spectral analysis. Motivated by the graph shift matrix defined in [2], but fundamentally different, we introduce a unique set of graph shift operators that satisfy the properties of the shift operator in classical signal processing. The new shift operator preserves the energy content of the graph signal in the frequency domain. We essentially decompose the graph adjacency matrix (the Laplacian matrix can be handled the same way) into two parts. The first part is the graph structure part represented by eigengraphs associated with frequency components of a graph. The second part is the filtering part represented by the eigenvalues of the adjacency matrix, which changes the amplitude of the frequency components. The eigenvalues of the new shift operators therefore only represent phase shift of frequency components that can be flexibly constructed. A special construction of these phase shift eigenvalues with nice properties is also given. We then elaborate on the structure of linear shift invariant (LSI) graph filters and show that any adjacency matrix can indeed be written as an LSI graph filter using the presented new shift operator. Furthermore, we define the graph finite impulse response (GFIR) and graph infinite impulse filters (GIIR), similar to the classical signal processing counterparts, and obtain an explicit form for such filters. Based on the defined shift operator, we introduce autocorrelation and crosscorrelation functions on graph. We then formulate the optimal filtering and spectrum analysis on graph, i.e., the corresponding Wiener-Hopf equation and Wiener filtering on graphs, and obtain the structure of such filters for any arbitrary graph structure. We finally elaborate on the best linear predictor graph filters and provide several illustrative simulation setups to verify the performance improvements of optimal filtering using our new graph shift operator. The contribution of this paper can be summarized as follows: • We define a general set of graph shift operators that satisfy the energy-preserving property in the frequency domain and other properties in classical signal processing. These shift operators only change the phase of frequency components. Especially, we design a specific • • • shift operator with the desired periodicity property as in classical signal processing. The shift operation can then be considered as discrete-time lossless information flowing structure on a graph. For a given graph, we construct a set of eigengraphs that represent basic correlation structures of a graph frequency component. When applied on any graph signal, each eigengraph is a projection operator that projects the signal to a single graph frequency component subject to only a phase shift. The new shift operator is a linear combination of eigengraphs. We investigate the properties of the presented shift operator for linear shift invariant filtering and show that the adjacency matrix is indeed a LSI filter based on our new graph shift operator. We define autocorrelation and cross-correlation functions of a signal on graph. We then obtain a closed-form solution to the Wiener filtering problem and show that it has efficient power-spectrum representation in certain graphs similar to classical signal processing. Such a power spectral analysis can only be obtained using our new shift operator. This new shift operator based GSP framework enables the signal analysis along a correlation structure defined by a graph shift manifold as opposed to classical signal processing operating on the assumption of the correlation structure with a linear time shift manifold. The paper is organized as follows. In section II, we discuss the basics of GSP and present a new set of shift operators. Section III introduces graph filters and Fourier transforms based on the new shift operator. We derive the optimal LSI graph filters in section IV. Section V presents the simulations and section VI concludes of the paper. Notations: Matrices and vectors are represented by uppercase and lowercase boldface letters, respectively. Transpose and Hermitian (conjugate transpose) operations are represented by (·)T and (·)H , respectively. The notation I stands for the identity matrix, and ~ and ∗ are the circular and aperiodic convolution operators, respectively. II. A N EW S ET OF S HIFT O PERATORS AND G RAPH F REQUENCY C OMPONENTS A. Signals on Graph Consider a dataset with N distinct elements, where some information regarding the relations between data elements is available. One can represent such a dataset and the corresponding relational information as a graph. A graph can be denoted by a G = {V, A}, where V = {ν0 , · · · νN −1 } is the set of all vertices of the graph, representing the elements in the dataset, and A is the weighted adjacency matrix that represents the relation between nodes. More specifically, if there is a relation between nodes νn and νm , then an,m = A(n, m) 6= 0, otherwise an,m = 0. We note that the elements of the adjacency matrix A is not restricted to a specific set of values. In this paper, we consider a general graph with real-valued adjacency matrix A, either directed or undirected, and assume that data elements take complex scalar values. We define a 3 1 b x[0] 1 b x[1] 1 b x[2] 1 b x[3] b x[N − 2] 1 b x[N − 1] Fig. 1. Graph representation of time series periodic data. graph signal as a one-to-one mapping from the set of all vertices to the set of complex numbers: x : V → C, νn → xn . (1) Without loss of generality, we represent a graph signal as a vector whose elements are complex numbers assigned to the nodes, x = [x1 , · · · , xN ]T , where T stands for the transpose operator. As a special case, a directed cyclic graph is shown in Fig. 1. Such a graph is compatible with the graph representation of a periodic time series signal, x[n] = x[n + N ], with N signal points, i.e., one can assign a node to each signal point and the relation between the signal points is the time shift. One can easily show that the graph adjacency matrix for the directed cyclic graph is given by   0 0 ··· 1 1 0 · · · 0   (2) A = C = . .. ..  . ..  .. . . . 0 ··· 1 0 There are two fundamental components in GSP: the signals represented by the values on vertices, and the signal correlation structure represented by the connections between vertices. B. Graph Shift Operator, Information Flow and Filtering A graph shift operator allows us to define the notion of information flow over a graph. Indeed, it represents one elementary discrete step on how the information propagates (shifts) from one node to its neighbors. In classical signal processing, i.e., the case where the graph structure is a cyclic graph, the information flow is unidirectional, i.e., from each node to only its next neighbor. In a more complicated graph structure, the information flow will neither be restricted to unidirectional structure nor to a limited number of physical neighbors but depend on the graph adjacency matrix. Therefore, the notion of shift operator on graph must be clarified. 1) Graph shift: In [3], the notion of shift operator is defined as a local operation that replaces a signal value at each node of a graph with the linear combination of the signal values at the neighbors of that node. Shift operator is a fundamental element in digital signal processing. Specifically, for a shift operator Φ and a graph signal x, the one-step shifted version of the graph signal, which is a new graph signal, is Φx. And the n-step shifted version of the signal is Φn x. 2) Graph signal state change: A graph shift operator is a linear operator such that when it applies to a graph signal xn at state (or time) n, it changes the graph signal into a new graph signal xn+1 at step n + 1. We use the index n to show the state of the graph signal. Equivalently, when a graph shift operator is applied to a graph signal, the state of the original graph signal is shifted to a new state by one unit of shift. Note that this is similar to time series analysis, when a signal x(t) is shifted in time by a certain amount T , y(t) = x(t − T ), the signal x(·) at time-state t − T will be mapped to y(·) at time-state t. The state of the signal at a certain time stamp is updated by the shift operator. Similarly, we defined the (n+1)-th state of the vector of the graph signal, i.e., xn , as the n-th shifted version of x0 . For instance, when the graph shift operator applies to a graph signal at state n, i.e., xn , and it changes the graph signal to xn+1 . More specifically, xn+1 = Φxn . Also note that in time series analysis, a time shift corresponds to a local shift in the cyclic graph. For a general graph shift, there is no such straightforward relationship. 3) Graph signal filtering: A linear filtering is defined by a matrix operation on the graph signal such that the result is also a graph signal. If we define the filter matrix as H, the filtered graph signal can be written as Hx. We will show later that if the filtering operation also satisfies the shift invariance property, the filter can be written as a polynomial of the new graph shift operator and the filter operation is indeed a modification of the amplitudes of existing signal frequency components, as in classical signal processing. C. The New Graph Shift Operator We now define a set of energy-preserving shift operators for an arbitrary graph structure. Definition : Given the adjacency matrix A for an arbitrary graph, assume that it is diagonalizable and its eigen decompoPN PN sition is A = VΛV−1 = i=1 λi vi ṽiT = i=1 λi V̂i , where V = [v1 v2 · · · vN ] and (V−1 )T = [ṽ1 ṽ2 · · · ṽN ], and vi T and ṽi are N × 1 column vectors of V and (V−1 P)N , respec−1 tively. We define the matrix Aφ = VΛφ V = i=1 λφi V̂i to be the shift operator with Λφ = diag(λφ1 , λφ2 , · · · , λφN ), (3) where λφk = ejφk , φk is an arbitrary phase in [0, 2π] where φk 6= φl for k 6= l, |Λφ | = I, | · | is defined as the point-wise absolute value operator. Thus, A = VΛV−1 = VΛh Λφ V−1 = VΛh V−1 VΛφ V−1 = Ah Aφ = Aφ Ah , (4) −1 where Λh = ΛΛ−1 . In essence, the shift φ and Ah = VΛh V operator Aφ preserves all the eigenvectors of the adjacency matrix A, but replaces all the eigenvalues of A with pure phase shifts. Definition: We further define a special new shift operator as Ae = VΛe V−1 , λek λ∗el = e−j 2π(k−l) N , ∀k, l = 1, · · · , N, (5) 4 where Λe = diag(λe1 , λe2 , · · · , λeN ). One can write −2π(k−1) j(φconst + ) N λ ek = e , (6) where φconst can be any arbitrary constant phase shift. Without loss of generality, we will assume φconst = 0 in the rest of this paper. The shift operator Ae and Aφ satisfies the following properties: 2 Property 1: k(Akφ x)F k2 = kxF k , where xF is frequency representation of graph signal defined by xF = V−1 x. Proof. Note that k-th shifted version of the graph signal in the Fourier domain is (Akφ x)F = V−1 Akφ x = V−1 (VΛkφ V−1 )x = Λkφ xF . (7) Thus its energy 2 k(Akφ x)F k22 = ||Λkφ xF ||22 = (Λkφ xF )H Λkφ xF = kxF k , (8) i.e., the energy of the graph signal in the frequency domain for any amount of shift is constant. Note that for a unitary graph Fourier operator, V−1 = VH , 2 2 then kxF k = kxk . The new graph operator Aφ of an undirected graph has such property since A is symmetric. We will further discuss the general graph Fourier transform and its energy-preserving in next subsection. Property 2: AN e x = x. The first property is energy-preserving. The second property specific for Ae is consistent with classic signal processing for an important phase shift property of the shift operator. Property 1 is of great importance in frequency domain graph signals filtering. From (7) and (8), it can be seen that if the modulus of the eigenvalues of the shift operator is not 1, the frequency components with small eigenvalues will disappear after several shifts. Indeed, only the frequency component with the largest eigenvalue will remain after many shifts. This is apparently undesirable. Property 1 implies that the new energy-preserving graph shift operator will preserve the energy of all frequency components. Moreover, as will be discussed later in this paper, linear shift invariant graph filter is defined PL−1by a polynomial of the graph shift operator, i.e., H = k=0 hk Ae k , where the following properties hold true: - Shift operator does not change the energy of the signal in the frequency domain. It only changes the phases of its frequency components - Filter coefficients can modify the energy contents of the graph signal in the frequency domain. We will see additional important property of Ae in filtering and spectral analysis in later sections. We note that our definition of the graph shift operator brings us the benefit to express the filtering operations in a more compact and meaningful form, similar to their counterparts in clas2π(k−1) sical signal processing. For the choice of λek = e−j N , the shift operator Ae may not be sparse. Also Ae (i, j) may not be real-valued. Therefore, a large memory may be needed to save the corresponding operator and conduct the filtering operation in the shift domain. We note that such large memory may not be necessary if the filtering operation is conducted in the Fourier domain. We will also show that an LSI filter with a non-sparse shift operator may be represented by a polynomial of a sparse graph operator and thus has efficient shift domain implementation. Remark: Most of existing shift operators in the literature do not satisfy the energy-preserving property. For instance, in [2], the graph shift operator is the adjacency matrix A of the graph. When such a shift operator applies to a graph signal, the energy content of the graph signal changes. To show this, note that A = VΛV−1 . Applying the graph shift operator n times to the graph signal x results in xn = An x = VΛn V−1 x. Since the magnitude of the diagonal elements of Λ in general are not equal to 1, as n becomes larger, some of the eigenvalues of Λn grow exponentially and the other eigenvalues approach zero. This means that the energy content of the signal is not preserved. We also note that there exist other definitions of the graph shift operator in the literature such as λmax1 (A) A as the normalized graph shift matrix [3] where λmax (A) is the maximum eigenvalue of A or Laplacian matrix based shift operators [1], [21]. Not only do these shift operators not preserve the energy, but also they actually filter the signals in that they modify the relative strength of different eigenvectors (frequency components). In [1], the translation on graph is defined via generalized convolution with a delta centered at vertex n. However, this translation operator aims to produce a geometrically localized shift in the vertex domain and does not preserve the energy. In [18], [20], a new isometric shift operator has recently been introduced that satisfies the energypreserving property with a similar general expression. It is indeed a special case of Aφ . Its eigenvalues are derived from the eigenvalue of the graph Laplacian matrix. Note that in our definition of graph shift operator, the eigenvalues (phase shifts) are detached from the eigenvalues of the graph adjacency matrix or Laplacian matrix and therefore are more flexible to accommodate other properties such as property 2 above. We will further show that our new shift operators have properties leading to computationally efficient spectral analysis and filtering through the detailed formulations of graph Fourier analysis in the next subsection. D. Frequency Content of Graphs, Eigengraphs and Graph Fourier Basis Consider the graph adjacency matrix A and its eigenvalue decomposition as A = VΛV−1 , where Λ is a diagonal matrix whose i-th diagonal element is the i-th eigenvalue of A. Note that in this paper, we will always assume that A is diagonalizable and eigenspaces have dimension equal to one for simplicity. In graph theory, the eigenvalues of the graph adjacency matrix are called the spectrum of the graph [22]. 1) Graph frequency content: Defining V = [v1 v2 · · · vN ] and (V−1 )T = [ṽ1 ṽ2 · · · ṽN ], where vi and ṽi are N × 1 column vectors of V and (V−1 )T , 5 respectively, one can show that A = VΛV−1 = N X i=1 λi vi ṽiT = N X λi V̂i . (9) i=1 The rank one matrix V̂i = vi ṽiT is called the i-th eigengraph, and vi is the i-th frequency component, of A. Moreover, if none of the elements of vi and ṽi are zero, the corresponding eigengraph is a complete graph, meaning that all nodes are connected to each other. However, the original graph that is a linear combination of the eigengraphs, stated in (9), may not be complete. Remark: The eigengraphs of the graph shift operator Aφ are the same as those of the adjacency matrix A by definition. 2) Eigengraph structure: To elaborate more on eigengraph structures, let us define vi , [vi1 vi2 · · · viN ]T and ṽi , [ṽi1 ṽi2 · · · ṽiN ]T . The corresponding i-th eigengraph is given by the rank one matrix   vi1 ṽi1 vi1 ṽi2 · · · vi1 ṽiN  vi2 ṽi1 vi2 ṽi2 · · · vi2 ṽiN    V̂i = vi ṽiT =  . .. ..  , (10) . . .  . . . .  viN ṽi1 viN ṽi2 · · · viN ṽiN where V̂i (l, m) = vil ṽim . The adjacency matrix of an eigengraph can be viewed as a signal/information transition matrix, where the weight vil ṽim is the transition weight from node l to node m. For instance, the eigengraph of a three node graph and the transition (bipartite) graph is shown in Fig. 3(a) and Fig. 3(b). A more general N node eigengraph is shown in Fig. 3(c). Note that for the i-th rank one eigengraph, the outgoing weight of node l is vil and the incoming weight of node m is ṽim , see Fig. 3(b). and Fig. 3(c). We note that in i these figures, wlm = vim ṽil is the signal transition weight from node l to node m. Note that an eigengraph V̂i is a special graph such that AV̂i = λi V̂i . Although an eigengraph is generally a complete graph, a linear combination of the eigengraphs may not be complete, as is evident for the cyclic graph. 3) Graph Fourier basis and Graph Fourier transform (GFT): We refer to F = V−1 as the graph Fourier transform (GFT) operator since its rows, span a basis to represent the graph signal. The Fourier transform of a graph signal x is xF = V−1 x. Thus F −1 = V is the inverse graph Fourier transform (IGFT) operator. Note that the rows of F = V−1 are not orthogonal (unitary) for a general shape graph. However, one can easily verify that the vector space Spank {ṽk } of the columns of (V−1 )T and the vector space Spank {vk } of the columns of F −1 = V construct a biorthogonal basis, i.e., ṽlT vm = δl−m . We further note that the corresponding eigengraph of the i-th frequency component is constructed by a pair of ṽi , vi meaning that they are constructed by the Fourier basis of the graph. This interpretation also confirms that the eigengraphs are the graph structures of graph frequency components, in which one can decompose a graph signal that is generated by the same graph structure, on those Fourier bases without any loss. For biorthogonal GFT, we further define a dual GFT: F̃ = VH and an inverse dual GFT F̃ −1 = V−H . As such, we have the inner product preservation: hx, yi = hx̃F , yF i, where x̃F = F̃x = VH x. Note that such biorthogonal transform satisfies the frame theory [23]. More specifically, the energy of a graph signal in the Fourier domain, i.e., kxF k2 = ||V−1 x||22 , is bounded by αkxk2 ≤ kxF k2 ≤ βkxk2 , where α = 1 ||V−1 ||22 and β = ||V−1 ||22 . (11) In other words, 1 1 kxF k2 ≤ kxk2 ≤ kxF k2 . β α (12) Furthermore, for unitary transform operator, i.e., V−1 = VH , α = β = 1. Therefore, such a transform preserves the energy in both shift and transform domains. The graph shift operator Aφ of an undirected graph has such property since its adjacency matrix A is symmetric and the corresponding V is unitary operator. Therefore Aφ for an undirected graph is a unitary operator by construction. The shift operator Aφ is a linear combination of eigengraphs. It may not be a local (sparse) operator, meaning that most entries of this matrix may be non-zero. This means that the complexity of applying Aφ to a graph signal of size N is of order of O(N 2 ). However, once the signal is transformed to the Fourier domain, several other operations such as filtering are computationally efficient, as will be discussed later in section IV-B. Also, we will show in Theorem 3 that Aφ can be represented as a polynomial of the adjacency matrix A in certain condition and thus has efficient local implementation. Remark: For a) the adjacency matrix of the undirected graph, b) the combinatorial graph Laplacian, and c) the normalized Laplacian matrix, the GFT matrix V is unitary and the GFT becomes orthogonal. 4) Linear operator, projection operator and graph shift operator: We note that a linear operator on a graph signal can be defined as L such that if it applies to a graph signal x, the result is also a graph signal y in which y = Lx. A projection operator W satisfies Wk x = Wx, for all k ∈ N . (13) It can be shown that, eigengraph operator, i.e., V̂i , satisfy this property and thus a projection operator. The eigengraph operator V̂i represents the i-th basis for decomposition of the graph adjacency matrix A. It means that, a graph structure, i.e., the graph adjacency matrix, is composed of a linear combination of n independent eigengraphs (as we assume that all eigenvalues of A are distinct, thus eigenvectors are linearly independent). Moreover, applying an eigengraph operator to a graph signal will select the corresponding frequency component of the graph signal. This operation is in accordance with the classical signal processing interpretation of a filter operation. More specifically, if a frequency selective filter applies to a signal several times, it returns the same frequency components of the signal similar to the case where the operator applies once. By defining the V̂i as the i-th frequency PN component of the graph, we interpret the λi in A = i=1 λi V̂i as the significance of the corresponding frequency component. 6 We further note that, indeed the frequency interpretation of time-series data comes from the linear cyclic graph structure of the time series data. We emphasize that, a graph shift operator should preserve the frequency contents of a graph. Therefore, it should be an equally weighted linear combination of the P eigengraphs N with only phase shifts. In other words, Aφ = i=1 αi V̂i , where |αi | = 1. This left us with the choice that αi = ejφi , where 0 ≤ φi < 2π. We further note that, to have a graph shift operator with independent eigengraph representation, we assume that φi 6= φj , for all i 6= j. This result is in accordance with the definition of graph shift operator as we defined earlier. Example : Consider the directed cyclic graph with three node as shown in Fig. 2. The adjacency matrix Acyclic of this graph is given by     1 1 1 0 0 1 1 2π2 2π1 ej 3 · Acyclic =1 0 0= √ 1 ej 3 2π2 2π4 3 j 0 1 0 1 e 3 ej 3 {z } | V  −j 2π0    3 1 1 1 e 0 0 1 2π2 2π1 2π1  0 e−j 3 , e−j 3 0  · √ 1 e−j 3 2π4 2π2 3 −j −j 2π2 3 3 e−j 3 1 e 0 0 e {z } | {z } | (14) where V−1 is the discrete Fourier (DFT) transform matrix. The eigengraphs and the signal transition (bipartite) graphs of the graph structure in Fig. 2 are shown in Fig. 3(a) and 2π(l−1)(i−1) 2π(m−1)(i−1) N N Fig. 3(b)., where vil = e , ṽim = e− . Also note that the Λcyclic is of the form of the special Λe defined in (6) and the adjacency matrix Acyclic is exactly Ae . 1 b b 1 node 2 b e node 3 1 Fig. 2. Directed cyclic graph with three nodes, vil = e 2π(m−1)(i−1) − N If we consider the shift operator on a graph to be Aφ , then the linear shift invariant property (LSI) of filters is HAφ x = Aφ Hx. Indeed, this property implies that, the filter and the shift operator are commutable. It is straightforward to show that the following theorem in [2], [3] still hold for a graph LSI filter defined by shift operator Aφ . Theorem 1. Every polynomial of a square matrix Aφ is a graph LSI filter and every graph LSI filter is a polynomial of a square matrix Aφ . This theorem shows that every LSI graph filter is a polynomial in the graph shift matrix, i.e., H = h(Aφ ) = L−1 X hk Aφ k (15) k=0 where hk is called the k-th tap of the graph filter and (L − 1) is the order of the polynomial representation of the LSI filter. We therefore can prove the following theorem: Theorem 2. Any arbitrary adjacency matrix A is an LSI filter under Aφ . V−1 Λcyclic node 1 A. Linear Shift Invariant Graph Filters 2π(l−1)(i−1) N , ṽim = . III. G RAPH F ILTERS BASED ON THE N EW S HIFT O PERATOR In classical signal processing, filters are referred to operators that apply on a signal as input, and produce another signal as output. Filters can be categorized into different classes, e.g., continues time or discrete time, linear and nonlinear, time invariant and time-varying. The compatible category of filter classes to graph signals is discrete time linear filters. Linear filtering on graphs is represented by multiplying the input signal vector x by a matrix H ∈ CN ×N , called filter matrix. The filtered output signal vector y = Hx. This filter operates on graph signals similar to the shift operator, i.e., the filtered signal y at the i-th vertex is a linear combination of the P value of the original signal x. More specifically, N y(i) = j=1 H(i, j)x(j). Proof. : We know from the definition of the graph shift operator that A = Ah Aφ = Aφ Ah , and hence the LSI filter H = Ah . PL−1 k Remark: Indeed, one can write A = k=0 hk Aφ . We note that when the shift matrix is Ae , one can show that hk = P N j 2πkl N λ , i.e., h l k is the k-th coefficient of the IDFT of l=1 e the eigenvalue vector λ, where λl is the l-th eigenvalue of A. This result allows us to compute the filter coefficients more efficiently. Theorem 2 shows that the adjacency matrix A can be decomposed into two parts. The first part is the energypreserving graph shift operator Aφ , i.e., frequency components of a graph. The second part is the filtering part represented by eigenvalues of the adjacency matrix, which changes the amplitudes of the frequency components. Theorem 3. The graph shift operator Aφ can be written as a polynomial of the graph adjacency matrix A, if the eigenvalues of A are all distinct. Proof. See Appendix A. Remark: The adjacency matrix A is often sparse (local). We can design an LSI filter using Aφ since it has good mathematical properties. We can then convert the LSI filter as a polynomial of A such that it has an efficient graph domain implementations. Note that using Aφ can have efficient in graph frequency domain as we will discuss in section IV. Example: Let us consider the discrete time circular conP volution y[n] = h[n] ~ x[n] = x[m]h[n − m] in m∈N classical signal processing for periodic time series data. Such an operator can be cast into the matrix form y = Hx where 7 i-th eigengraph node 1 vi1 node 1 b wi 13 wi 11 b w wi 11 i w 21 i-th bipartite equivalent graph node 2 node 3 vi2 vi3 b wi 21 wi 23 wi 22 wi 12 b wi 31 wi 32 wi 33 ⇐ apply V̂i i 13 wi 12 wi 31 wi 23 b w b i wi 33 wi 32 22 node 2 node 3 (a) b b ṽi1 node 1 ṽi2 node 2 b ṽi3 node 3 (b) i-th bipartite equivalent graph for N nodes node 1 vi1 b node 2 vi2 wi 21 b wi 23 node 3 vi3 b node N viN b wi N 1 wi 22 wi 11 wi N N wi 12 wi 13 b b ṽi1 node 1 b ṽi2 node 2 (c) b ⇐ apply V̂i b b b ṽiN node N ṽi3 node 3 i Fig. 3. Eigengraph structure for a three node graph is shown in (a), where wlm = vim ṽil is the signal transition weight from node l to node m. The signal/information transition representation of the i-th eigengraph is shown in (b). In this figure, vil is the outgoing weight from node l and ṽim is the incoming weight to node m. Such a weight distribution preserves the rank one property of the i-th eigengraph. Part (c) is the generalization of the signal transition representation of the i-th eigengraph for an N node graph structure. x and y are the input and output signal vectors, respectively. The filter matrix H has the following Toeplitz form   h[0] h[N − 1] h[N − 2] · · · h[1]  h[1] h[0] h[N − 1] · · · h[2]   H= .. .. .. ..  . ..  . . . . .  h[N − 1] h[N − 2] ··· h[1] h[0] (16) Note that, with a small abuse of notation, we will use hi in the graph representation instead of h[i] in the classical signal processing counterpart. Using some matrix calculation, one can show that the filter matrix can be written as a polynomial PN −1 of the circulant adjacency matrix (2) as H = h(C) = k=0 hk Ck . Note that in the cyclic graph, the adjacency matrix is exactly the Ae defined in (5), Ae = C. This means that the circular convolution is equivalent to the LSI graph filtering based on the graph representation of the periodic time series data. We note that every Toeplitz graph filter matrix can be considered as a linear time invariant filter for time series periodic data. Example: Let us now consider filtering aperiodic time series data in classical signal processing. We show that such a filtering operation is also equivalent to the LSI graph filtering. To show this, let us start with the traditional P∞ signal processing filtering as y[n] = h[n] ∗ x[n] = m=−∞ x[m]h[n − m]. Without loss of generality, we assume that x[n] 6= 0, for 0 ≤ n ≤ N − 1 and h[n] 6= 0, for 0 ≤ n ≤ L − 1, and L < N . Defining 01×L−1 , [0 0 · · · 0], x , [x[0] x[1] · · · x[N − 1] 01×L−1 ]T and y , [y[0] y[1] · · · y[N + L − 1]]T , one can rewrite the filtering equation as y = Hx where H(N +L−1)×(N +L−1) is defined in (17). H(N +L−1)×(N +L−1)  h[0] 0 0 h[1] h[0] 0  h[2] h[1] h[0]   .. .. ..  . . . 0 0 ··· = ··· ··· ··· .. . ··· 0 0 0 ··· ··· ··· .. . ··· h[L − 1] · · · 0 0 0 .. .     .   (17) h[0] The output of such a filtering operation, i.e., yP= Hx, is L−1 equivalent to that of the y = H̃x, where H̃ = l=0 hl Cl . Note that, in this example C is the (N + L − 1) × (N + L − 1) circulant matrix defined in (2). One can easily show that H̃ can be written as (18). This result shows that filtering aperiodic discrete time signals by the filter operator H is equivalent to filtering the zero-padded graph signal x by the graph filter H̃. Note that convolution for aperiodic signals is equivalent to circular convolution of the zero-padded periodic versions of the input signal, and hence it is equivalent to graph filtering where the graph filter is defined by the filter matrix H̃. More specifically, let us consider the zero-padded periodic versions of the aperiodic signal x[n] and filter h[n] as x̂[n] = x̂[n + N + L] and ĥ[n] = ĥ[n + N + L] where ( x[n] n = 0, 1, · · · N − 1 x̂[n]= 0 n = N, N + 1, · · · , N + L − 1 ( h[n] n = 0, 1, · · · L − 1 ĥ[n]= (19) 0 n = L, L + 1, · · · , N + L − 1 then, x[n] ∗ h[n] = x̂[n] ~ ĥ[n], for all n. Hence, filtering 8  h[0] 0 0 h[1] h[0] 0   H̃(N +L−1)×(N +L−1)=h[2] h[1] h[0]  .. .. ..  . . . 0 0 ··· ··· ··· ··· .. . 0 0 0 .. . ··· h[L − 1] aperiodic time series data can be written as the graph LSI filtering of the zero-padded graph signals. Theorem 4. When LAφ ≤ L, for a LSI filter there exists an equivalent form for the LSI filter in (15) as H = h̆(Aφ ) = PLAφ −1 h̆k Akφ , where LAφ is the degree of the minimal polyk=0 nomial of Aφ . Moreover, there exist a closed-form expression for the filter taps h̆k as a function of hk . Proof. See Appendix B for a constructive proof. Finite/infinite impulse response (FIR/IIR) filters are certain types of filters with great importance in classical signal processing and have simple frequency domain interpretation. We herein aim to bring those concepts to the graph signal processing as GFIR and GIIR filters where G stands for graph representation. As we have shown in Theorem 4, any LSI filter can be written as a polynomial of the graph shift operator with the maximum order of LAφ − 1. We therefore can define the GFIR and GIIR filters. : We define a GFIR filter to be H = PDefinition L−1 k h A where L < LAφ and a GIIR filter to be k=0P k φ L−1 k H = k=0 hk Aφ where L = LAφ . B. Frequency domain interpretation of filtering The derivation of the results presented earlier in this section is in the time domain for time series data or the shift domain for graph signals. One can also describe the filtering process, equivalently, in the frequency domain obtained by the Fourier transform operator. More specifically, if y = Hx is the filtering operation in the time/shift domain, it can also be represented in the frequency domain as yF = HF xF , where the subscript F stands for Fourier transformed versions of the corresponding signals/filters. Note that we have used yF = V−1 y, xF = V−1 x and HF = V−1 HV. Note that the filtering process Hx (matrix and vector multiplication) in the shift domain has a simpler representation in the Fourier domain as suggested by HF xF . To show this, we note that L−1 X HF = hk Λφ k k=0 PL−1 k=0   =   hk (λφ1 )k 0 ··· 0 PL−1 k  0 0 k=0 hk (λφ2 ) · · ·   (20) .. .. . .. ..  . . . PL−1 k 0 0 · · · k=0 hk (λφN ) Therefore, the filtering HF xF in the Fourier domain is a simple point-wise multiplication. More specifically, y(m) = h[L − 1] ··· 0 h[L − 1] 0 0 .. .. . . h[L − 2] h[L − 3]  h[2] h[1] · · · h[2]  · · · h[3]  ..  .. . .  · · · h[0] (18) PN n=1 H(m, n)x(n). However, yF (m) = HF (m, m) × xF (m). Note that for Aφ , HF (m, m) = L−1 X hk (λφm )k = k=0 L−1 X hk (ejφm k ) k=0 = HDT F T (ω|ω = φm ), (21) and for Ae , φm = − 2πm N , and thus HF (m, m) = L−1 X hk (λem )k k=0 = HDT F T   2πm ω ω=− . N (22) Interestingly, with the new set of energy-preserving shift operators Ae , the GFT coefficient of a LSI filter H can be computed using L-tap discrete-time Fourier transforms (DTFT). We further note that, the filtering equation (20) is composed of two components; the filter coefficients hk ’s and the complex exponentials λφi that are the eigenvalues of our defined graph shift operator. Since the magnitude of λφi ’s are one, λkφi does not change the magnitude of the k-th component of the graph filter HF (i, i), i.e., hk (λφi )k . This suggests that the filter coefficients hk ’s are the source of the change of the k-th component of HF (i, i). In contrast, the magnitude of the eigenvalues of arbitrary graph shift operators proposed in the literature are not normalized to one. Thus, the role of the filter coefficients (controlling the signal level/energy) are diminished. It leads to a saturating filtering performance, which is illustrated in the simulation section. IV. C ORRELATION F UNCTIONS OF G RAPH S IGNALS AND O PTIMAL LSI G RAPH F ILTERS In this section, we assume that the structure of the graph is known, meaning that the graph adjacency matrix A and the related shift operator Aφ is given. Assuming that Aφ is known, we aim to obtain the structure of the graph LSI filters such that a certain set of constraints are satisfied. We discuss several filter design problems in GSP in the sequel that arise in classical signal processing. A. Wiener Filter for Directed Cyclic Graph Data (Time Series) We will first reformulate the time series signal Wiener filter using GSP representation and then generalize it to arbitrary graph signals. Consider the graph representation of the time series data in Fig. 1. Assume that x is the graph signal and y is a noisy measurement of the graph signal x: yi = xi +ni , where 9      yH y H H y C y .. . yH Cy H H y C Cy .. . ··· ··· .. . yH (C)L−1 y H H y C (C)L−1 y .. . yH (CL−1 )H y yH (CL−1 )H Cy ··· yH (CL−1 )H (CL−1 )y ni is i.i.d. zero mean white Gaussian noise. A conventional question in denoising problems is to design an LSI filter such that the residual error kHy − xk22 is minimum. Strictly speaking, when x and y are given, we aim to solve the following optimization problem min kHy − xk22 . Since shift invariant, it can be written as H = PL−1 H is l h C , where C is defined earlier. Note that the filtered l k=0 PL−1 signal can be rewritten as Hy = k=0 hl Cl y = Bh where BN ×L = [y C1 y · · · CL−1 y], h = [h0 h1 · · · hL−1 ]T . (24) Rewrite (23) by replacing Hy by its equivalent Bh, min kBh − xk22 . (25) h Since L = LAφ ≤ N is the degree of minimal polynomial of the graph shift matrix, we only consider the cases where L ≤ N (Note that when N = L, the matrix B is full rank, hence the solution to the optimization problem (25) can be written as ho = B−1 x). If L < N , the solution of least square optimization problem (25) can be obtained by solving BH Bh = BH x, yH (CL−1 )H yH (CL−1 )H or, equivalently, as (27). We note that the circulant matrix C has the unitary property, i.e., (CH )k Ck = I, ∀k. Moreover, we claim that yH (Cl )H y is the autocorrelation of the vector y at lag l. To show this, we first note that Cl y is the circularly shifted version of the y by amount l. Defining the autocorrelation function of y as X ∗ Ryy (l) , yn yn+l , (28) n one can easily show that yH (Cl )H Cm y = (Cl−m y)H y X ∗ = yn yn+l−m = Ryy (l − m), (29) (30) BH Bh = Ryy h = rxy , (31) i.e.,  Ryy (0)  Ryy (1)   ..  .    ∗ ∗ Ryy (1) · · · Ryy (L−1) rxy (0) ∗   Ryy (0) · · · Ryy (L−2)   rxy (1)  . h= .. .. .. ..    . . . . rxy (L−1) Ryy (L−1) Ryy (L−2) · · · Ryy (0) (32) Eq. (32) is indeed the Wiener-Hopf equation. Note that Ryy is a Toeplitz matrix. Note that the LSI property of graph filters for time series data leads to the Wiener filtering in the classic signal processing. One can also compute the autocorrelation and crosscorrelation more efficiently as Ryy (i, j) = Ryy (i − j) = H yF (Λ∗ )i−1 Λj−1 yF = N X |yF (n)|2 λj−i n , (33) n=1 H rxy (i) = yF (Λ∗ ) i−1 xF = N X ∗ yF (n)xF (n)(λ∗n )i−1 , n=1 (34) which has lower computational complexity than calculating the autocorrelation and the cross-correlation using the definition directly. Note that yF = V−1 y and xF = V−1 x are the Fourier (DFT) representations of the output and input signals, respectively, and (ΛH )k Λk = I. The optimal LSI filtering (27) also has power spectrum representation, if L = N . Note that we can rewrite (33) in matrix form as Ryy = Wλ YF WλH , (35) (λ∗j )i−1 , where Wλ is a Vandermonde matrix with Wλ (i, j) = i.e.,   1 1 ··· 1  λ∗1 λ∗2 ··· λ∗N    Wλ =   .. .. .. ..   . . . . (λ∗1 )N −1 where yk is the (k mod N )-th element of the vector y and is the conjugation operator. We also define the cross-correlation (27) The linear equations (27) can hence be rewritten as n ∗ yH (CL−1 )H x   .  n∈N (26) where H is the Hermitian operator. Such a solution has an interesting interpretation for time series data as will be shown in the sequel. We note that (26) can be written as     yH yH  y H CH   y H CH       [y Cy · · · CL−1 y]h =  x  .. ..     . .     h =    between the input and output vectors x and y, as X ∗ rxy (l) , xn yn+l = yH (Cl )H x. (23) H yH x H H y C x .. .   (λ∗2 )N −1 ··· (36) (λ∗N )N −1 and YF = diag(|yF (n)|2 , n = 1, · · · , N ). (37) 10 yH y  y AH φy   ..  . yH (AL−1 )H y φ  H y H Aφ y y AH φ Aφ y .. . yH (AL−1 )H Aφ y φ H 2π(i−1) Given λi = e−j N , it is easy to see that WλH = where W is the DFT matrix. Then (31) becomes N WH YF Wh = rxy , √ ··· ··· .. . ··· N W,    yH (Aφ )L−1 y yH x H L−1 H H   y Aφ (Aφ ) y    y Aφ x  . h = .. ..    . . L−1 H L−1 H H yH (AL−1 y (A ) (A ) x )y φ φ φ H (43) We also define the cross-correlation between the input vectors x and the output vector y at lag l, as G rxy (l) , yH (Alφ )H x (38) = yH (VΛlφ V−1 )H x i.e., Wh = 1 −1 Y Wrxy . N F (39) 1 −1 Y rxy,F . N F (40) rxy F (i) . N |yF (i)|2 (41) Thus hF = = (V−1 y)H (Λ∗φ )l VH x. (45) As can be seen, the autocorrelation and the cross-correlation on graphs are indeed the correlations between a graph signal and a graph shifted signal, where a shift is defined by the graph shift operator. That is hF (i) = Here the subscript F represents the DFT. This result is consistent with the power spectrum interpretation in the classical signal processing. Note that the property of Λe is a key for the spectrum representation (41) to hold. We will show that a similar structure exists for a general LSI filter for a graph with special structures. B. Correlation Functions and Optimal (Wiener) Filtering for Arbitrary Graph Signals Arbitrary graph signals may have complex structures, e.g., directed or undirected, weighted or un-weighted, etc. As we defined the shift matrix to be the Aφ , we can construct a general LSI filter as a polynomial of the shift matrix, i.e., PL−1 H = h(Aφ ) = k=0 hk Akφ , where hk is the k-th filter tap. We also define h , [h0 h1 · · · hL−1 ]T as the vector of the filter. Consider again the denoising problem (25) given by min kBnew h − xk22 , h (42) where Bnew = [y Aφ y · · · Aφ L−1 y] and the solution to such a problem was obtained earlier. We proved that for the time series graph, the optimal solution is the Wiener filter given by (43). The Wiener filter structure depends on the availability of the autocorrelation function of the output data y and the crosscorrelation of the input x and output y. For a general graph, the autocorrelation and cross-correlation need to be defined on a particular graph structure. Definition : We define the autocorrelation function of the signal y on an arbitrary graph with lags l and m, i.e., the correlation between the shifted version with lag l, Alφ y, and the shifted version with lag m, Am φ y, as The linear equations (43) can hence be rewritten as G RG yy h = rxy , (46) i.e., G Ryy (0, 0) G  Ryy (1, 0)   ..  .  G Ryy (0, 1) G Ryy (1, 1) .. . G Ryy (L − 1, 1) G Ryy (L − 1, 0)  G  rxy (0) G  rxy (1)    = , ..   . G rxy (L − 1) ··· ··· .. . ···  G Ryy (0, L − 1) G Ryy (1, L − 2)   h ..  . G Ryy (L − 1, L − 1) (47) which can be considered the Wiener-Hopf equation for graph signals. Note that the autocorrelation matrix RG yy is generally not a Toeplitz matrix for a directed graph. We note that, a typical graph can have a large number of nodes, meaning that the size of the Aφ matrix is large. The optimal filtering (47) needs the autocorrelation and crosscorrelation functions. Since the computational complexity of calculating these functions are high (see the definition of the functions and the large multiplications of matrices), it is desirable to obtain the autocorrelation and cross-correlation functions in (47), using similar equations as (33) and (34). To do so, let us consider Aφ = VΛφ V−1 , where   λ1 0 0 ··· 0  0 λ2 0 ··· 0     .. . ..  . . .. .. Λφ =  . (48) ··· .    0  0 · · · λN −1 0 0 0 0 ··· λN G Ryy (l, m) , yH (Alφ )H Am φy −1 = yH (VΛlφ V−1 )H (VΛm )y φV −1 = (V−1 y)H (Λ∗φ )l VH VΛm y. φV (44) Now if V is unitary, i.e., VH = V−1 , true for all undirected graphs with real-valued A and the cyclic graph, then Aφ is 11 also unitary and we have RG yy (i, j) = = = = rG xy (i) = G Ryy (i − 1, j − 1) N X ∗ yF (n)yF (n)(λ∗n )i−1 λj−1 n n=1 N X ∗ yF (n)yF (n)(λ∗n )i−1 λj−1 n n=1 N X |yF (n)|2 λj−i n , n=1 N X i−1 G ∗ rxy (i − 1) = yF (n)xF (n)(λ∗n ) . n=1 cessing. However, it is non-trivial to transfer all the classical signal processing results on a linear time shift to a complex graph correlation structure. The new definition of auto/crosscorrelation and graph Wiener filtering are our efforts to develop graph signal processing tools in parallel to classical signal processing, and are also a major contribution of this paper. (50) Also note that, since λ∗n λn = 1 for Aφ , (λ∗n )i λjn = λj−i = (λ∗n )i−j . n (51) Now the autocorrelation matrix RG yy is now a Toeplitz matrix and the solution to (46) becomes similar to the Wiener filter for time series data. And we can get similar equations as (35): H RG yy = Wλ YF Wλ , V. S IMULATIONS (49) Fig. 4 shows a random deployment of 20 sensor nodes in a two-dimensional area. The coordinates of each node is randomly generated in a square area, where x and y limits are in [0, 1]. To construct an undirected graph, the 6 nearest neighbor rule is used – each node is connected to 6 of its nearest neighbors. The graph adjacency matrix of this random sensor network can be obtained from the connection between the nodes. We assign the weight 1 for each connection for simplicity. We plot the eigenvalues of the graph adjacency matrix in Fig. 5. The eigenvalues of the graph adjacency matrix are real-valued since the graph is undirected. (52) where Wλ is a Vandermonde matrix with Wλ (i, j) = (λ∗j )i−1 , defined in (36), and YF = diag(|yF (n)|2 , n = 1, · · · , N ). Now if we use the new shift operator Ae , where λi = √ 2π(i−1) e−j N , we also have WλH = N W, where W is the DFT matrix . Then (46) becomes N WH YF Wh = rxy . (53) Thus hDF T = 1 −1 Y rxy,DF T . N F (54) That is rxy,DF T (i) , N |yF (i)|2 (55) where hDF T = Wh, xy DF T = Wxy , and yF = V−1 y. Note that the subscript DF T represents ordinary DFT and the subscript F represents the GFT. Remark: The simple closed-form power spectrum solution (55) of optimal graph Wiener filter only holds under two conditions: (i) The matrix V consisting of eigenvectors of graph adjacency matrix is unitary. All undirected graphs satisfy this condition. Some directed graphs such as the cyclic graph also satisfy this condition. Note that the autocorrelation matrix Ryy is a Toeplitz matrix with this condition. (ii) The new shift operator Ae is applied. Any other graph shift operator does not lead to such efficient solution for the filtering problem such as (42). This is a major difference between our shift operator (3) and the shift operator proposed by [18]–[20]. For general directed graphs, the optimal filtering solution can only be obtained by solving the general graph WienerHopf equation (47). Note that a graph can represent an intrinsic network correlation structure that is a sophisticated generalization of a linear time shift correlation structure in classical signal pro- Fig. 4. Random sensor network with 20 nodes (undirected graph). 8 6 Eigenvalue values hDF T (i) = 4 2 0 -2 -4 0 2 4 6 8 10 12 14 16 18 20 Eigenvalue index Fig. 5. Eigenvalues of the graph adjacency matrix (undirected graph). 12 We now define a K-sparse graph signal, x, whose Fourier representation has K-nonzero values. That means x has Knonzero component in the Fourier domain, i.e., xF = V−1 x has K-nonzero components. To generate a K-sparse graph signal, we randomly generate an N × 1 vector whose first K components are generated from a Gaussian (this can be generated from any distributional function) and the rest of its elements are zero. For instance, we generate a graph signal in the Fourier domain as x = [−0.296 − 1.497 − 0.905 − 0.404 − 0.726 − 0.866 − 0.423 − 0.943 1.3419 − 0.989 0 0 0 0 0 0 0 0 0 0]T . Note that the energies of the graph signal in both shift and Fourier domains are equal to 8.32 (||x||22 = ||xF ||22 ) for this undirected graph. We plot the energy of the shifted versions of this graph signal in Fig. 6 for two alternatives of graph shift operators; graph adjacency matrix A and normalized graph shift matrix A (defined in [3]), Anorm = λmax (A) , where λmax (A) is the eigenvalue with the largest magnitude. Note that AN norm x = −1 VΛN V x, where N is the number of shifts. When the norm graph adjacency matrix A is used as shift operator, note that some of its eigenvalues are larger than one. After several shifts, the energy of frequency components corresponding to those eigenvalues larger than one become larger and larger, and those components will dominate the energy of the shifted graph signal. Therefore, the signal energy in the frequency domain increases as the number of shift increases. On the other hand, when the normalized graph shift matrix is used as the shift operator, none of the eigenvalues are larger than one. The energy of frequency components corresponding to those eigenvalues smaller than one are diminishing with increasing number of shifts. The energy of frequency components with eigenvalue equal to one will remain. Therefore, overall the signal energy in the frequency domain decreases as the number of shift increases. Note that our defined shift operator Aφ does not change the energy of the graph signal both in shift and Fourier domain for any amounts of shifts. Fig. 7 illustrates a random sensor network with asymmetric graph adjacency matrix, i.e., a directed graph. To construct 10 4 Graph Signal Energy 3.5 this graph, we randomly sample the graph adjacency matrix of the undirected graph presented in the previous example. We further plotted the magnitude of the eigenvalues of the graph adjacency matrix in Fig. 8 (since eigenvalues are generally complex numbers for directed graphs adjacency matrix). Fig. 9 shows the energy of a 10-sparse random signal for different amounts of shift when the graph structure is directed. The signal energy in the Fourier domain is a fixed number, i.e., 8.32. Note that we use our defined graph shift operator in this example to illustrate the difference between the energy of the shifted signal in shift and Fourier domains. To be consistent, we use the same graph signal in the undirected graph example presented earlier in this section. Fig. 9 demonstrates that the energy of the graph signal in the Fourier domain is a fix number while in the shift domain is oscillating. Since Fourier operator for a general directed graph is not unitary, the energy of the graph signal in the shift and Fourier domains are different. We can show the oscillating behavior of energy of the shifted graph signal xk in the shift domain as kxk k22 = kAke xk22 = kVΛke xF k22 = N X 2 λkel xF (l)vl l=1 N X λkel v̂l = l=1 2 = 2 N X N X (e−j 2π(m−l)k N 2 )v̂lH v̂m , (56) l=1 m=1 where v̂l = xF (l)vl . Note that, the energy of the shifted graph signal in the shift domain is a linear combination of constant terms v̂lH v̂m where the weights are complex-valued and functions of k (the number of shifts). Changing k leads to the variability of the energy in the shift domain. We can apply the frame theory results on frame bounds [23] to obtain a lower and an upper bound for the energy in the shift domain, as shown in (11). We further note that our shift operator Ae , although it does not preserve the energy in the shift domain for all amounts of shifts, it preserves the energy in the shift domain l N l for integer multiples of N since AlN e = (Ae ) = (I) = I. 0.7 3 0.6 2.5 0.5 2 0.4 1.5 0.3 1 0.2 0.5 0.1 0 0 1 1.5 2 2.5 3 3.5 4 4.5 5 Fig. 7. Directed sensor network with 20 nodes. Fig. 6. Energy of a 10-sparse random signal in the Fourier domain for different shift amounts (the graph structure is undirected). Note that the signal energy using the new shift operator is constant in this case. Figs. 10 and 11 show the percentage of the reconstruction error for the Wiener filtering problem (42), for two different 13 4 using our shift operator is much lower than the traditional adjacency-based operators. 3.5 Eigenvalue values 3 2.5 2 1.5 1 0.5 0 0 2 4 6 8 10 12 14 16 18 20 Eigenvalue index Fig. 8. Magnitude of the eigenvalues of the graph adjacency matrix (directed graph). 14 13 Graph Signal Energy 12 The source of errors comes from the following facts. For large values of L (the number of filter coefficients), the PL polynomial representation of the LSI filter H = l=0 hl Al dominates only the frequency components that have the largest eigenvalues of A. More specifically, adding further coefficients to the filter, does not improve the performance of the Wiener filtering since the frequency components corresponding to small eigenvalues are indistinguishable from the noise. This effect can be explained by Fig. 12 where we plot the eigenvalues of the graph adjacency matrix of the weather graph. We can observe that the magnitude of eigenvalues of the graph adjacency matrix are not equal to one. Therefore, the performance of the filtering is dominated by the largest eigenvalue(s) of A, i.e., adding further coefficients leads to diminishing all eigenvalues (and the corresponding Fourier basis) less than λmax (A); thereby saturating the performance of the optimal filtering. 11 10 9 8 7 6 5 0 5 10 15 20 25 30 Fig. 9. Energy of a 10-sparse random signal in shift and Fourier domain using our defined graph shift operator (directed graph). sets of noisy measurements namely; random i.i.d. Gaussian noises with variances σn2 = 1 and σn2 = 100. The dataset considered in this example contains the average temperatures of 40 US states capitals. The graph signal xt is a 40×1 vector and t ∈ {1, 2, · · · , M } for a horizon of M = 264 consecutive days in 2015, and we consider the noisy measurements of those graph signals as yt = xt + nt . For the two scenarios considered here, we define the ratio of the average power of signals of all nodes and the noise variance as signal-to-noiseratio (SNR). The SNR of the first scenario (where the noise variance σn2 = 1) and the second scenario (where the noise variance σn2 = 100) are 35.66 dB and 15.66 dB, respectively. The average percentage of the reconstruction error is defined PM ||xt −Hot yt || 1 , where Hot is the optimal graph filter as M t=1 ||xt || obtained by the optimization problem (42). We consider three different approaches to construct the graph, i.e., the k-nearest neighbor method with k = 9 [3], the exponentially distancebased weighted graph adjacency considered by [3], and the empirical covariance-based graph construction introduced in [24]. In all cases, the reconstruction error of Wiener filtering We further observe that after almost adding 15 taps (10 taps) when the noise variance is σn2 = 1, the performance of the adjacency-based approaches is saturated. Note that this number is specific to this example and for different simulation setups this saturating effect may be observed at a different location depending on the magnitudes of the eigenvalues of the graph adjacency matrix A. However, if we use our new graph shift operator, adding more coefficients will improve the performance of the filtering operation as it allows us to use more coefficients to reduce the reconstruction error while keeping all frequency components of the graph. Moreover, the cyclic property of our defined graph shift operator, i.e., AN e = I ensures that an LSI filter that uses Ae as a shift operator needs at most N filter taps to achieve its best performance, while there is no limit on the number of filter taps if other shift operators are used. This signifies the importance of our defined shift operator which offers low complexity (a need for less filter taps to achieve a predefined performance level) and high accuracy. Furthermore, Figs. 10 and 11 also show that, when the noise variance is larger, the performance of Wiener filtering will be affected and the percentage of the reconstruction error becomes larger, as we expect. One more important note is that for the case where the noise variance σn2 = 100, a noise level comparable to the level of the graph signal, we observe that the performance of Wiener filtering for the traditional adjacency-based operators saturates at earlier number of filter taps than the case where the noise variance is σn2 = 1. This shows that the performance of Wiener filtering is noise-level dependent for the traditional adjacency-based operators, while the performance of the Wiener filtering using the new shift operator is not noise level dependent. 14 0.02 Reconstruction error percentage 0.018 0.016 0.014 0.012 0.01 k-nearest A distance-based weighted A empirical A k-nearest Aφ distance-based weighted Aφ empirical Aφ 0.008 0.006 0.004 0.002 0 5 10 15 20 25 30 35 40 Number of filter taps Fig. 10. Average reconstruction error for the Wiener filtering problem (42), 2 = 1). where the SNR is 35.66 dB (the noise variance σn 0.18 Reconstruction error percentage 0.16 0.14 0.12 classical signal processing by resetting the eigenvalues of the adjacency matrix or the Laplacian matrix flexibly. We show that such shift operators preserve the energy content of the graph signal in both shift and frequency domains. We further investigate the properties of LSI graph filters and show that any LSI filter can be written as a polynomial of the graph shift operator. We then categorize the LSI filters as GFIR and GIIR filters, similar to the classical FIR and IIR filters and obtain explicit forms for such filters. Based on these energypreserving shift operators, we further define autocorrelation and cross-correlation functions of signals on the graph. We then obtain the structure of the optimal LSI graph filters, i.e., Wiener filtering, through the construction of the Wiener-Hopf equation on graph. We show that only with the proposed graph shift operator, we can possibly obtain the efficient spectra analysis and frequency domain filtering in parallel with those in classical signal processing. Several illustrative simulations are presented to validate the performance of designed optimal LSI filters. Our new shift operator based GSP framework enables the signal analysis along a correlation structure defined by a graph shift manifold as opposed to classical signal processing operating on the assumption of the correlation structure with a linear time shift manifold. 0.1 ACKNOWLEDGMENT 0.08 We would like to thank Dr. José Moura and Dr. Antonio Ortega for discussions and feedbacks of many concepts and ideas in the early stage of manuscript development. k-nearest A distance-based weighted A empirical A k-nearest Aφ distance-based weighted Aφ empirical Aφ 0.06 0.04 0.02 A PPENDIX 0 0 5 10 15 20 25 30 35 A. Proof of Theorem 3 40 Number of filter taps Fig. 11. Average reconstruction error for the Wiener filtering problem (42), 2 = 100). where the SNR is 15.66 dB (the noise variance σn Let us assume that Aφ can be represented as a polynomial of A, i.e., Aφ = 10 gk Ak . (A.1) k=0 Since the Fourier basis of A and Aφ are the same by the definition, we can diagonalize the two operator by multiplying V and V−1 to the two operator form right and left, respectively. Therefore, we can write 8 6 Eigenvalue values N −1 X 4 Λφ = 2 N −1 X gk Λk . (A.2) k=0 0 -2 -4 0 5 10 15 20 25 30 35 40 Eigenvalue index Fig. 12. Eigenvalues of the graph adjacency matrix of the weather network. This equation can also be as  1 λ1 λ21 · · · 1 λ2 λ22 · · ·  . .. .. ..  .. . . . 2 1 λN λN · · · {z | Z written as a linear matrix equation     λ1N −1 g0 λφ1     λ2N −1    g1   λφ2  =    ,  . . .. .   ..   ..  N −1 gN −1 λφN λN } (A.3) VI. C ONCLUSIONS In this paper, we define a new set of shift operators for graph signals satisfying the energy-preserving properties as in or more compactly, as Zg = λφ (A.4) 15 where g = [g0 g1 · · · gN −1 ]T and λ = [λφ1 λφ2 · · · λφN ]T . We note that, Z is the well-known Vandermonde matrix and has full-rank iff λi 6= λj , for i, j ∈ {1, 2, · · · , N }. Therefore, if Z is full-rank, then the linear equation (A.4) has a unique solution g = Z−1 λ (We emphasize that, there exists efficient recursive algorithms for obtaining the inverse of Vandermonde matrices with low computational complexity). This completes the proof. This procedure can be repeated for any arbitrary L > LAφ +1. Therefore, we only consider LSI graph filters with LAφ filter taps and we interchangeably use L instead of LAφ . LA We finally note that, for the special case Ae φ = I, meaning that if k > LAφ , then Ake = Am e where m = (k mod LAφ ). R EFERENCES B. Proof of Theorem 4 The minimal polynomial of an N × N matrix Aφ is defined by a polynomial with minimum degree that satisfies PLA p(Aφ ) = i=0φ αi Aiφ = 0N ×N . Note that for the degenerate case where Aφ is not full-rank, LAφ 6= N . Without loss of generality, we assume that αLAφ = 1. In order to obtain the PLA −1 LA other αi ’s, we first note that i=0φ αi Aiφ = −Aφ φ . We then write the diagonalized version of this equation as LAφ −1 X L Aφ αi Λiφ = −Λφ . (A.5) i=0 One can write this equation in a matrix form as  L    LA −1 Aφ   λ 1 λφ1 λ2φ1 · · · λφ1 φ α0  φL1A   LAφ −1   λ φ  1 λ  α 2  λ · · · λ 1  φ2    φ2 φ2 φ2  , .  ..  = − .. .. .. . . ..   .    . . . . . .   .   LAφ   LAφ −1  α 2 L −1 A φ λφL −1 1 λφLA λφL · · · λφLA Aφ Aφ φ φ | {z } Z̃ (A.6) or in a more compact form Z̃α = λ̃φ , where α = LA LA LA [α0 α1 · · · αN −1 ]T and λ̃φ = −[λφ1 φ λφ2 φ · · · λφL φ ]T . Aφ The solution to the α’s can be easily obtained as α = Z̃−1 λ̃φ . We also note that for the special Ae , we choose λek = 2π(k−1) e−j N , ∀k ∈ {1, · · · , N }, if A is full-rank, otherwise we choose λek = e −j 2π(k−1) LA e . We therefore obtain the closedPN j 2π(k−1) L form solution for the α as αk = − l=1 e LAe λelAe . That is α0 = −1 and αl = 0 for l 6= 0. This is also straightforward L L since λekAe = 1, ∀k, i.e., i.e., Ae Ae = I. LA Once we obtain αk , we can write Aφ φ = PLAφ −1 i − i=0 αi Aφ . Now consider an LSI filter with length L = LAφ + 1 as PL H = k=0 hk Aφ k . Using the results obtained earlier, we can rewrite this LSI filter as LAφ −1 LAφ H= X k hk Aφ = k=0 LAφ −1 = X = k=0 hk Aφ k + hLAφ Aφ LAφ k=0 LAφ −1 hk Aφ k + hLAφ (− k=0 LAφ −1 X X X αk Akφ ) k=0 LAφ −1 k (hk − hLAφ αk )Aφ = X k=0 h̆k Akφ . (A.7) [1] D. Shuman, S. Narang, P. Frossard, A. Ortega, and P. Vandergheynst, “The emerging field of signal processing on graphs: Extending highdimensional data analysis to networks and other irregular domains,” IEEE Signal Processing Magazine, vol. 30, no. 3, pp. 83–98, May 2013. [2] A. Sandryhaila and J. Moura, “Discrete signal processing on graphs,” IEEE Transactions on Signal Processing, vol. 61, no. 7, pp. 1644–1656, April 2013. [3] ——, “Discrete signal processing on graphs: Frequency analysis,” IEEE Transactions on Signal Processing, vol. 62, no. 12, pp. 3042–3054, June 2014. [4] ——, “Big data analysis with signal processing on graphs: Representation and processing of massive data sets with irregular structure,” Signal Processing Magazine, IEEE, vol. 31, no. 5, pp. 80–90, Sept 2014. [5] M. Puschel and J. Moura, “Algebraic signal processing theory: Foundation and 1-d time,” IEEE Trans. on Signal Process., vol. 56, pp. 3572– 3585, Aug 2008. [6] ——, “Algebraic signal processing theory: Cooley-tukey type algorithms for dcts and dsts,” IEEE Trans. on Signal Process., vol. 56, pp. 1502– 1521, April 2008. [7] N. Leonardi and D. Van De Ville, “Tight wavelet frames on multislice graphs,” IEEE Trans. on Signal Process., vol. 61, pp. 3357–3367, July 2013. [8] R. R. Coifman and M. Maggioni, “Diffusion wavelets,” Applied and Computational Harmonic Analysis, vol. 21, no. 1, pp. 53 – 94, 2006. [Online]. Available: http://www.sciencedirect.com/science/article/ pii/S106352030600056X [9] D. K. Hammond, P. Vandergheynst, and R. Gribonval, “Wavelets on graphs via spectral graph theory,” Applied and Computational Harmonic Analysis, vol. 30, no. 2, pp. 129 – 150, 2011. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S1063520310000552 [10] S. Narang and A. Ortega, “Perfect reconstruction two-channel wavelet filter banks for graph structured data,” IEEE Trans. on Signal Process., vol. 60, pp. 2786–2799, June 2012. [11] V. N. Ekambaram, G. Fanti, B. Ayazifar, and K. Ramchandran, “Critically-sampled perfect-reconstruction spline-wavelet filterbanks for graph signals,” in IEEE Global Conference on Signal and Information Processing, Dec 2013, pp. 475–478. [12] M. S. Kotzagiannidis and P. L. Dragotti, “Sparse graph signal reconstruction and image processing on circulant graphs,” in IEEE Global Conference on Signal and Information Processing (GlobalSIP), Dec 2014, pp. 923–927. [13] M. S. Kotzagiannidis and P. L. Dragotti, “Splines and Wavelets on Circulant Graphs,” ArXiv e-prints, Mar. 2016. [14] V. N. Ekambaram, G. C. Fanti, B. Ayazifar, and K. Ramchandran, “Circulant structures and graph signal processing,” in 2013 IEEE International Conference on Image Processing, Sept 2013, pp. 834–838. [15] X. Dong, D. Thanou, P. Frossard, and P. Vandergheynst, “Learning laplacian matrix in smooth graph signal representations,” IEEE Transactions on Signal Processing, vol. 64, no. 23, pp. 6160–6173, Dec 2016. [16] ——, “Laplacian matrix learning for smooth graph signal representation,” in IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), April 2015, pp. 3736–3740. [17] P.-L. Loh and M. J. Wainwright, “Structure estimation for discrete graphical models: Generalized covariance matrices and their inverses,” Ann. Statist., vol. 41, no. 6, pp. 3022–3049, 12 2013. [Online]. Available: http://dx.doi.org/10.1214/13-AOS1162 [18] B. Girault, P. Gonçalves, and É. Fleury, “Translation on graphs: An isometric shift operator,” IEEE Signal Processing Letters, vol. 22, no. 12, pp. 2416–2420, Dec 2015. [19] B. Girault, “Stationary graph signals using an isometric graph translation,” in European Signal Processing Conference (EUSIPCO), Aug 2015, pp. 1516–1520. [20] ——, Signal Processing on Graphs - Contributions to an Emerging Field, PhD thesis, Dec 2015. 16 [21] S. Segarra, G. Mateos, A. G. Marques, and A. Ribeiro, “Blind identification of graph filters,” IEEE Transactions on Signal Processing, vol. 65, no. 5, pp. 1146–1159, March 2017. [22] F. Chung, Spectral Graph Theory. CBMS Regional Conference Series in Mathematics, vol. 92). Providence, RI: AMS Bookstore, 1997. [23] P. G. Casazza, G. Kutyniok, and F. Philipp, Introduction to Finite Frame Theory. Springer, 2013. [24] C. Zhang, D. Florencio, and P. Chou, “Graph signal processing - a probabilistic framework,” Microsoft Publisher, Technical Report, April 2015. Adnan Gavili was born in Sanandaj, Kurdistan, Iran. He received the B.Sc., M.Sc. and PhD degrees in electrical engineering from Iran University of Science and Technology (IUST), Sharif University of Technology (SUT) and University of Ontario Institute of Technology (UOIT) in 2009, 2011 and 2015, respectively. From September 2015 to August 2016, he has worked on Graph Signal Processing (GSP) with Dr. Xiao-Ping Zhang as a post-doctoral research fellow at Ryerson University. Since 2013, he has served as a reviewer for IEEE Transactions on Signal Processing, IEEE Transactions on Wireless Communications and IEEE Signal Processing Letters. His research interests include GSP, classical signal processing, cooperative green communications, cognitive radio networks and signal processing applications in finance. Xiao-Ping Zhang (M’97, SM’02) received B.S. and Ph.D. degrees from Tsinghua University, in 1992 and 1996, respectively, both in Electronic Engineering. He holds an MBA in Finance, Economics and Entrepreneurship with Honors from the University of Chicago Booth School of Business, Chicago, IL. Since Fall 2000, he has been with the Department of Electrical and Computer Engineering, Ryerson University, where he is now Professor, Director of Communication and Signal Processing Applications Laboratory (CASPAL). He has served as Program Director of Graduate Studies. He is cross appointed to the Finance Department at the Ted Rogers School of Management at Ryerson University. His research interests include statistical signal processing, image and multimedia content analysis, sensor networks and electronic systems, machine learning, and applications in bioinformatics, finance, and marketing. He is a frequent consultant for biotech companies and investment firms. He is cofounder and CEO for EidoSearch, an Ontario based company offering a content-based search and analysis engine for financial data. Dr. Zhang is a registered Professional Engineer in Ontario, Canada, and a member of Beta Gamma Sigma Honor Society. He is the general co-chair for ICASSP2021. He is the general co-chair for 2017 GlobalSIP Symposium on Signal and Information Processing for Finance and Business. He is an elected member of ICME steering committee. He is the general chair for MMSP’15. He is the publicity chair for ICME’06 and program chair for ICIC’05 and ICIC’10. He served as guest editor for Multimedia Tools and Applications, and the International Journal of Semantic Computing. He is a tutorial speaker in ACMMM2011, ISCAS2013, ICIP2013, ICASSP2014, IJCNN2017. He is a Senior Area Editor for IEEE Transactions on Signal Processing. He is/was an Associate Editor for IEEE Transactions on Image Processing, IEEE Transactions on Multimedia, IEEE Transactions on Circuits and Systems for Video Technology, IEEE Transactions on Signal Processing, and IEEE Signal Processing Letters.
7cs.IT
Partial-Diffusion Least Mean-Square Estimation Over Networks Under Noisy Information Exchange Vahid Vadidpour, Amir Rastegarnia, Azam Khalili Department of Electrical Engineering Malayer University Malayer, Iran, 65719-95863 Email: [email protected] Abstract—Partial diffusion scheme is an effective method for reducing computational load and power consumption in adaptive network implementation. The Information is exchanged among the nodes, usually over noisy links. In this paper, we consider a general version of partial-diffusion least-mean-square (PDLMS) algorithm in the presence of various sources of imperfect information exchanges. Like the established PDLMS, we consider two different schemes to select the entries, sequential and stochastic, for transmission at each iteration. Our objective is to analyze the aggregate effect of these perturbations on general PDLMS strategies. Simulation results demonstrate that considering noisy link assumption adds a new complexity to the related optimization problem and the trade-off between communication cost and estimation performance in comparison to ideal case becomes unbalanced. Keywords—adaptive networks; diffusion adaptation; noisy informatin exchange; partial diffusion; sequential, stochastic. I. INTRODUCTION Due to limited electrical power and bandwidth resources for internode communication over a practical wireless sensor networks (WSN) or ad hoc networks, data transmission through radio communication links can become prohibitively expensive for realizing a collaborative task. Generally speaking, although benefits of diffusion strategies achieved by increasing internode communications, they are compromised by the communication cost. As a result, since various nodes can have various numbers of neighbors, they may require disparate hardware or consume power dissimilarity [1]. Therefore, reducing the communication cost while maintaining the benefits of cooperation is of practical importance [1]. There have been several attempts to reduce the communication cost without considerable degradation of the estimation and compromising the cooperation benefits in diffusion algorithms. Among them diffusion least mean-square (LMS), such as reducing the dimension of the estimates [2-4], selecting a subset of the entries of the estimates [5, 6], setmembership filtering [7, 8], or partial updating [9] have been reported in [10-12]. Among these methods, we focus on [5] which LMS algorithm for adaptive distribute estimation has been formulated and analyzed by utilizing partial-diffusion. In [5], an adapt-then-combine (ATC) partial-diffusion least meansquare (PDLMS) algorithm is proposed for distributed Saeid Sanei Department of Computing University of Surrey Surrey GU2 7XH, UK Email: [email protected] estimation over adaptive networks in which, at each iteration, each node transmits a subsets of the entries of intermediate estimate vector to its neighbors. In the PDLMS strategy proposed in [5], the weight estimates that are exchanged among the nodes can be subject to perturbations over communication links. The effect of link noise during the exchange of weight estimates, already appear for the diffusion algorithm in the works [13-17]. In comparison to the prior work on PDLMS in [5], this manuscript develops a more general class of PDLMS of which [5] is a special case. Like [5], we also consider two different schemes for selecting the entries for transmission at each iteration. It should be noted that since our objective is to minimize the internode communications, the nodes only exchange their intermediate estimates with their neighbors. Therefore, we allow for noisy exchange just during the two combination steps. We subsequently study the performance of this general case utilizing the energy conservation argument [18]. We established its stability and convergence in the mean and meansquare senses. We also derive a theoretical expression for the steady-state mean-square-deviation (MSD) and verify its accuracy via numerical simulations. The analysis further demonstrates that the noises related to the exchange of weight estimates do not change the dynamics of the network but lead to network performance deterioration. This paper is organized as follows. In Section II, we formulate the PDLMS under noisy information exchange. The performance analyses are examined in Section III. We provide simulation results in Section IV and draw conclusions in Section V. A. Notation We adopt the lowercase letters to denote vectors, uppercase letter for matrices, normal font for nonrandom (deterministic) quantities, and the boldface letters for random quantities. The . refer to notation . refers to conjugate transposition, the trace of its matrix argument, for the Kronecker product, and . for a vector formed by stacking the columns of its matrix argument. We shall also use … to denote a column vector formed by stacking its arguments on top of each other and . . . to denote a (block) diagonal matrix formed from its argument. All vectors in our treatment are column vectors, with the exception of regression vectors, , . II. PARTIAL DIFFUSION ALGORITHMS WITH IMPERFECT INFORMATION EXCHANGE Consider a connected network consisting of nodes. At time instant 0 , each node has access to scalar and 1 regression data vectors , . measurements The data across all nodes are assumed to be related to an unknown 1 vector via linear regression model of the form [18]:   where 1 and 1 are vector noise , , signal. They are temporally white and spatially independent random process with zero mean and covariance given by . The quantities are all zero if , , , , , , or when . It should be noted that the subscript indicates that is the source and the sink, the flow of information is from to . Using the perturbed data (7) and (8), the adaptive strategy (3)-(5) becomes where denotes the measurement noise with zero mean refers to the parameter of and variance , and the vector interest.  We are now interested in solving optimization problems of the type:  min ∑  ,  by The nodes in the network would like to estimate solving the equation above in adaptive and collaborative manners. We review the diffusion adaptation strategies with imperfect information exchange below. A. Diffusion Adaption with Imperfect Information Exchange Consider the following general adaptive diffusion strategies corresponding to the case in which the nodes only with share the weight estimates for 0 [19]: ∑ ,  , , ,  , , ,  ∑ , , , ,  The scalars are non-negative real coefficients , , , corresponding to the , entries of combination matrices , , respectively. The role of these combination matrices is in convergence behavior of the diffusion strategy , (3)-(5). These coefficients are zero whenever node where denotes the neighborhood of node . These matrices are assumed to satisfy the conditions:  , We model the noisy data received by node neighbor as follows (see Fig. 1): ,  , , , , ,   , , ∑ ,  , ,  ,    ,  , , , , ,  , , ,    ∑   ,   , ,  , ,  , , , ,  1 column vector with all where the notation denotes an its entries equal to one. ,  , According to (9) and (11) that can also be expressed as:  ∑ , , , , , ,   , , B. Partial-Diffusion with Imperfect information Exchange In order to lower the level of internode communication required among the nodes, we utilize partial-diffusion strategy proposed in [5], to transmit out of entries of the intermediate estimates at each time instant where the integer is fixed and pre-specified. Again, we develop a more general class of PDLMS of which [5] is a special case. The selection of to-be-transmitted entries at node and time instant can be portrayed by an diagonal entry-selection matrix, ones and zeros on its denoted by , , that has diagonal [5]. The position of ones states the selected entries. Multiplication of an intermediate estimate vector by this matrix replaces its non-selected entries with zero.   ∑ , from its   l k Source Sink , 1 , , 1 1 Figure 1. Several additive nise sources perturb the exchange of information from node to node . Each node needs the information of all entries of its neighbors’ intermediate estimate vectors for the consultation phase. However, when the intermediate estimates are broadcast partially 0 , nodes have no access to the noncommunicated entries. To resolve this indistinctness, we allow the nodes utilize their own intermediate estimates entries instead of ones from the neighbors that have not been communicated [5], i.e., at node , substitute , ,   , ,   for    for , (18) , Based on this approach together with using perturbed data as introduced in (7) and (8), we formulate general PDLMS under noisy exchange as follows:  , ,  ∑     , , , ∑ , , ,  ,  , , , ,     , , ,  ∑ , , ,  , ,  , Remark: The probability of transmission for all the entries at each node is equal and state as [5]   Moreover, the entry selection matrices, , , do not rely on any data/parameter with the exception of and . 1 zero mean noise Introduce the following aggregate signals: ,  , ∑ , , ∑ , ,  ,  ,   These noises correspond to the cumulative effect on node of all selected exchange noises from the neighbors of node , , in the course of while exchanging the estimates , the two consultation steps. The covariance matrices of these noises are given by: , ∑ , , ,   ,   In sequential partial-diffusion the entry selection matrices, , is a diagonal matrix: and , , , C. Entry Selection Method In order to select out of entries of the intermediate estimates of each node at each iteration, the methods we utilized are comparable to the selection processes in stochastic and sequential partial-update schemes [9, 20, 21]. In other word, we use the same schemes as that introduced in [14]. Here, we just review these methods namely sequential and stochastic partial-diffusion. , , ∑ , , , 0 0 , , ℓ, 1 0 ℓ  ⁄ . The number of selection entries at each with iteration is limited by . The coefficient subsets are not unique as long as they meet the following requirements [9]: 1. Cardinality of is between 1 and ; where 1,2, … , ; 2. , , 1, … , and 3. . The description of the entry selection matrices, , , in stochastic partial-diffusion is similar to that of sequential one. The only difference is as follows. At a given iteration, , sequential case one of the set , 1, … , is chosen in a predetermined fashion, whereas for stochastic case, one of the is sampled at random from , , … , sets . One might ask why these methods are considered to organize these selection matrices. To answer this question, it is worth mentioning that the nodes need to recognize which entries of their neighbors’ intermediate estimates have been propagated at each iteration. These schemes bypass the need for addressing (position in the vector) [5]. III. STEADY-STATE PERFORMANCE ANALYSIS We now move on to examine the behavior of the general PDLMS implementations (19)-(21), and the influence of the mentioned perturbations on its convergence and steady-state performance. For this reason, we shall study the convergence of the weight estimates both in the mean and mean-square senses. In order to make the analysis tractable, we introduce the following assumptions on statistical properties of the measurement data and noise signals. Assumptions: 1. The regression data , are temporally white and spatially independent random variables with zero mean Ε , , 0. and covariance matrix , 2. The noise signal , , and , are temporally white and spatially independent random variable with zero mean and covariance and , , , , , respectively. In addition, the quantities , , , are all zero if or when 3. The regression data , . , the model noise signals , and the link noise signals , and , are mutually independent random variables for all indexes , , , , , , , , , . 4. The step-sizes, , are small enough such that their squared values are negligible. We are interested in examining the evolution of the weighterror vectors. To do so, we let: ,  ,  We import the information from across the network into block vectors and matrices as follows: , , ,  , , , , , , ,…, , ,…, , ,    , , , ,…, ,    , , , ,…, ,     ,…, | | , ,…, 0 ,  Subsequently, some algebra demonstrates that   ,  , ,    , Α , , Α , , …  , Σ can , Σ   where Σ is an arbitrary positive semi-definite Hermitian matrix of size and ,  , , , , Σ´ Α , , Α , , 1,2  ,  ,    with , ,   ,  ,  A. Mean Performance Taking expectation of both sides of (35) under Remark and Assumptions, we find that the mean error vector evolves according to the following recursion: Ε Σ , ∑ where  Furthermore, the matrix Σ ´ can be expressed as where  Σ  ,  B. Mean-Square Performance The weighted variance relation for the error vector be obtained from the error recursion (35) as: , ,  1 ,    where . refers to the largest eigenvalue of a matrix. The is the union of the set of set of the eigenvalue of . Thus, (40) is satisfied when the eigenvalue of , 1, or 1 1, . , , These inequalities determine the stability bounds for step-sizes as ´   , From (38), we observe that in order for the recursion to be Ε stable in the mean sense, the matrix should be stable. Picking and which all their entries are real non-negative and all their rows add up to unity. Therefore, in the light of lemma 1 of [21], mean stability and asymptotic unbiasedness of the algorithm is guaranteed if the matrix is stable or equivalently if   , ,   The variance relation becomes       Σ    where , , , ,    , ,…, ,  , , 15 14  ,  , ,…,   , Tr (Rh,k)  13 12  11 10 , ,…,  ,  Therefore, the steady-state weighted variance relation (46) becomes 1 2 3 4 5 6 7 8 9 10 7 8 9 10 Node Index 0.03  2 0.02 v,k  0.01 lim IN M ,  , Σ  It is known that a recursion of type (53) is stable and convergent if the matrix , is stable. All the entries of and are real non, negative and all its columns sum up to one. Moreover, the eigenvalue of are square of the eigenvalue of . Therefore, stability of this matrix has the same conditions as . This means that choosing the the stability of step-sizes is accordance with (41) makes the algorithm stable likewise in the mean-square sense hence convergent to steady state. The network MSD is defined as: MSD ∑ lim ,   Since we are free to choose Σ , we select it as I , 0 nodes, and 4 , 5 6 Node Index , are shown in Fig. 2. We also use white Gaussian link noise signals such that and , . All link noise variances , , , , are randomly generated. The average power of , , each type of link noise across the network is 35 dB less than that of the model noise. In Fig. 3, we plot the experimental network MSD curves for ATC case ( ) of PDLMS algorithm using both sequential and stochastic partial diffusion schemes under noisy information exchange for different numbers of entries at each iteration, . We use uniform at combination phase at this stage. In weights for , , , Fig. 4, we compare network MSD learning curve of PDLMS 0 vec  Network MSD (dB) MSD NUMERICAL STUDIES A. Simulation In order to illustrate the PLDMS strategies performance under noisy information exchange, we consider an adaptive network with a random topology and 10 where each node is, in average, connected to two other nodes. The unknown parameter of length 8 is randomly generated. We adopt a uniform step-size, 0.01 , The measurements were generated according to model (1), and regressors, , , were chosen Gaussian i.i.d with randomly generated different diagonal covariance matrices, , . The additive noises at nodes are zero mean Gaussian with variances , and independent of the regression data. The traces of the covariance matrix regressors and the noise variances at all L=0 L=1 L=6 L=8 -10 -20 -30 -40 -50 0 200 400 600 800 1000 Iteration 0 Network MSD (dB) IV. , 3 / ,  2 Figure 2. Covariance matrix trace of the input signal and the variance of the noise at each node. then the expression (53) gives  1 L=0 L=1 L=6 L=8 -10 -20 -30 -40 -50 0 200 for both ATC and CTA ( 400 600 800 1000 ) under ideal and noisy links. Figure 3. Network MSD learning curve of PDLMS for ATC under nosiy links (top) sequential (bottom) stochastic. Network MSD (dB) 0 ATC Perfect CTA Perfect CTA Imperfect ATC Imperfect -10 -20 [3] -30 [4] -40 -50 0 200 400 600 800 100 Iteration 0 Network MSD (dB) [2] ATC Perfect CTA Perfect CTA Imperfect ATC Imperfect -10 -20 [5] [6] -30 -40 [7] -50 0 200 400 600 800 100 Iteration Figure 4. Network MSD learning curve of PDLMS for both ATC and CTA under ideal and noisy links (a) sequential (b) stochastic. B. Discussion From the simulation results, we make the following observations: --First, in [5], authors emphasized that the PDLMS algorithm delivers a tradeoff between communications cost and estimation performance. However, Based on simulation results considering the assumption of noisy links add a new complexity to the optimization problem and the trade-off between communication cost and estimation performance in comparison to ideal links become unbalanced. Because, the more entries are broadcast at each iteration, the more perturbed weight estimates are interred in consultant phase. --Second, the sequential partial-diffusion schemes outperform the stochastic partial-diffusion. --Third, adaptive ATC strategy outperforms the adaptive CTA strategy for both perfect and imperfect cases. V. [8] [9] [10] [11] [12] [13] [14] CONCLUSION In this work, we presented a general form of PDLMS algorithms, formulated the ATC and CTA versions of PDLMS under noisy Links, and investigated the performance of partialdiffusion algorithms under several sources of noise during information exchange for both sequential and stochastic schemes. We also illustrated that the PDLMS strategy could still stabilize the mean and mean-square convergence of the network with noisy information exchange. We derived analytical expressions for network learning curve MSD. The important result is that the noisy links are the main factor in performance degradation of a diffusion LMS strategy running in a network with imperfect communication. Furthermore, there is no direct relation between the MSD performance and number of selected entries under imperfect information exchange. [15] [16] [17] [18] [19] [20] [21] REFERENCE [1] R. Arablouei, K. Dogancay, S. Werner, and Y.-F. Huang, "ReducedCommunication Diffusion LMS Strategy for Adaptive Distributed Estimation," CoRR, vol. abs/1408.5845, 2014. [22] M. O. Sayin and S. S. Kozat, "Single bit and reduced dimension diffusion strategies over distributed networks," Signal Processing Letters, IEEE, vol. 20, pp. 976-979, 2013. M. O. Sayin and S. S. Kozat, "Compressive diffusion strategies over distributed networks for reduced communication load," Signal Processing, IEEE Transactions on, vol. 62, pp. 5308-5323, 2014. S. Chouvardas, K. Slavakis, and S. Theodoridis, "Trading off complexity with communication costs in distributed adaptive learning via Krylov subspaces for dimensionality reduction," Selected Topics in Signal Processing, IEEE Journal of, vol. 7, pp. 257-273, 2013. R. Arablouei, S. Werner, Y.-F. Huang, and K. Dogancay, "Distributed least mean-square estimation with partial diffusion," Signal Processing, IEEE Transactions on, vol. 62, pp. 472-484, 2014. R. Arablouei, K. Dogancay, S. Werner, and Y.-F. Huang, "Adaptive distributed estimation based on recursive least-squares and partial diffusion," Signal Processing, IEEE Transactions on, vol. 62, pp. 35103522, 2014. J. R. Deller, Jr. and Y. F. Huang, "Set-membership identification and filtering for signal processing applications," Circuits, Systems and Signal Processing, vol. 21, pp. 69-82, 2002/01/01 2002. S. Gollamudi, S. Nagaraj, S. Kapoor, and Y.-F. Huang, "Setmembership filtering and a set-membership normalized LMS algorithm with an adaptive step size," Signal Processing Letters, IEEE, vol. 5, pp. 111-114, 1998. K. Dogancay, Partial-update adaptive signal processing: Design Analysis and Implementation: Academic Press, 2008. S. Werner, T. Riihonen, and Y.-F. Huang, "Energy-efficient distributed parameter estimation with partial updates," in Green Circuits and Systems (ICGCS), 2010 International Conference on, 2010, pp. 36-40. A. Malipatil, Y.-F. Huang, and S. Werner, "An SMF approach to distributed average consensus in clustered sensor networks," in Signal Processing Advances in Wireless Communications, 2009. SPAWC'09. IEEE 10th Workshop on, 2009, pp. 81-85. S. Werner and Y.-F. Huang, "Time-and coefficient-selective diffusion strategies for distributed parameter estimation," in Signals, Systems and Computers (ASILOMAR), 2010 Conference Record of the Forty Fourth Asilomar Conference on, 2010, pp. 696-697. R. Abdolee and B. Champagne, "Diffusion LMS algorithms for sensor networks over non-ideal inter-sensor wireless channels," in Distributed Computing in Sensor Systems and Workshops (DCOSS), 2011 International Conference on, 2011, pp. 1-6. A. Khalili, M. A. Tinati, A. Rastegarnia, and J. A. Chambers, "Transient analysis of diffusion least‐mean squares adaptive networks with noisy channels," International Journal of Adaptive Control and Signal Processing, vol. 26, pp. 171-180, 2012. A. Khalili, M. A. Tinati, A. Rastegarnia, and J. Chambers, "Steady-state analysis of diffusion LMS adaptive networks with noisy links," Signal Processing, IEEE Transactions on, vol. 60, pp. 974-979, 2012. X. Zhao, S.-Y. Tu, and A. H. Sayed, "Diffusion adaptation over networks under imperfect information exchange and non-stationary data," Signal Processing, IEEE Transactions on, vol. 60, pp. 3460-3475, 2012. A. Rastegarnia, W. M. Bazzi, A. Khalili, and J. A. Chambers, “Diffusion adaptive networks with imperfect communications: link failure and channel noise,” IET Signal Processing, vol. 8, no. 1, pp. 59–66, 2014. A. Sayed, "Adaptive Filters. Hoboken," ed: NJ: John Wiley & Sons, 2008. A. H. Sayed, "Diffusion adaptation over networks," Academic Press Library in Signal Processing, vol. 3, pp. 323-454, 2013. M. Godavarti and A. O. Hero III, "Partial update LMS algorithms," Signal Processing, IEEE Transactions on, vol. 53, pp. 2382-2399, 2005. S. C. Douglas, "Adaptive filters employing partial updates," Circuits and Systems II: Analog and Digital Signal Processing, IEEE Transactions on, vol. 44, pp. 209-216, 1997. F. S. Cattivelli and A. H. Sayed, "Diffusion LMS strategies for distributed estimation," Signal Processing, IEEE Transactions on, vol. 58, pp. 1035-1048, 2010.
3cs.SY
T REE M EMORY N ETWORKS Tree Memory Networks for Modelling Long-term Temporal Dependencies Tharindu Fernando T. WARNAKULASUIRYA @ QUT. EDU . AU arXiv:1703.04706v1 [cs.LG] 12 Mar 2017 Image and Video Research Laboratory, SAIVT Queensland University of Technology, Australia. Simon Denman S . DENMAN @ QUT. EDU . AU Image and Video Research Laboratory, SAIVT Queensland University of Technology, Australia. Aaron McFadyen AARON . MCFADYEN @ QUT. EDU . AU Robotics and Autonomous Systems, Queensland University of Technology, Australia. Sridha Sridharan S . SRIDHARAN @ QUT. EDU . AU Image and Video Research Laboratory, SAIVT Queensland University of Technology, Australia. Clinton Fookes C . FOOKES @ QUT. EDU . AU Image and Video Research Laboratory, SAIVT Queensland University of Technology, Australia. Editor: Abstract In the domain of sequence modelling, Recurrent Neural Networks (RNN) have been capable of achieving impressive results in a variety of application areas including visual question answering, part-of-speech tagging and machine translation. However this success in modelling short term dependencies has not successfully transitioned to application areas such as trajectory prediction, which require capturing both short term and long term relationships. In this paper, we propose a Tree Memory Network (TMN) for modelling long term and short term relationships in sequence-to-sequence mapping problems. The proposed network architecture is composed of an input module, controller and a memory module. In contrast to related literature, which models the memory as a sequence of historical states, we model the memory as a recursive tree structure. This structure more effectively captures temporal dependencies across both short term and long term sequences using its hierarchical structure. We demonstrate the effectiveness and flexibility of the proposed TMN in two practical problems, aircraft trajectory modelling and pedestrian trajectory modelling in a surveillance setting, and in both cases we outperform the current state-of-the-art. Furthermore, we perform an in depth analysis on the evolution of the memory module content over time and provide visual evidence on how the proposed TMN is able to map both long term and short term relationships efficiently via a hierarchi1 F ERNANDO ET AL . cal structure. Keywords: Memory Networks, Trajectory Prediction, Recurrent Neural Networks 1. Introduction Sequence-to-sequence modelling is a vital element in machine learning and knowledge representation with multiple application areas including machine translation (ShafieiBavani et al., 2016), trajectory prediction (Judah et al., 2014), and part-of-speech tagging (Lafferty et al., 2001). This problem can be represented as predicting an output sequence, Y = [y1 , . . . , yT ], given an input sequence X = [x1 , . . . , xT ]. Predicting a future element yt of the sequence at time instance t utilising the current input to the model xt and the content of the memory from the previous time step Mt−1 can be represented as, yt = f (xt , Mt−1 ). (1) Modelling long term relationships within sequences can be considered one of the most challenging problems within the machine learning community (Mikolov et al., 2014). Although many memory architectures proposed for sequence-to-sequence modelling are capable of mapping short term relationships, they are less successful when handling long term dependencies (Xu et al. (2016)). Long term relationships within the data are extremely useful and can significantly influence the accuracy of the predictions considering the repetitive nature of many processes. For instance consider an air traffic modelling problem. Even though short term dependencies such as current weather and neighbouring traffic are the most influential factors, the repetitive nature of the aircraft trajectories and the flight schedules suggests that one can easily deduce a coherence among trajectories between days and seasons. A certain runway may be in use, so similar trajectories should be observed over the short term, but a sudden change of runway (due to weather for example) means “new” trajectories will be seen. Having a long term memory means that these are not actually “new” trajectories, but can instead be recalled from an earlier, similar weather event or operational configuration. A similar logic can be applied when modelling pedestrian behaviour in a surveillance scenario, such as in the example shown in Fig. 1. While the current location of neighbouring pedestrians are more influential, one cannot discard the influence of historical behaviour under similar contexts and events. Pedestrians may be wandering in a free area and then as new trains arrive a new “flow” of pedestrian movement appears in response to the congestion. But as we posses historical data under similar contexts one should be capable of accurately anticipating such pedestrian motion. In this paper we are interested in efficiently aggregating such long term dependencies among input data. In sample scenario from the Grand Central dataset (Yi et al. (2015)) presented in Fig. 1, a high pedestrian flow in the highlighted area is observed at the 07:08 time stamp with the arrival of a train before the flow decreases at the 10:32 time stamp. A similar flow to Fig. 1 (a) is observed at the 21:29 time stamp, in Fig. 1 (c) confirming our hypothesis that future pedestrian flow can be anticipated with the aid of historical data. As such, we propose an augmented memory architecture which can be generalised to any sequence to sequence modelling problem. The contributions of this work can be summarised as follows: 1. A new recursive memory network architecture capable of modelling long term temporal dependencies, using an efficient tree structure. 2 T REE M EMORY N ETWORKS (a) High pedestrian flow in  (b) Low pedestrian flow in  (c) Similar flow to (a) in  Figure 1: Pedestrian flow at different times in the Grand central dataset Yi et al. (2015). A high pedestrian flow in the highlighted area is observed at the 07:08 time stamp with the arrival of a train before the flow decreases at the 10:32 time stamp. A similar flow to subfigure (a) is observed at the 21:29 time stamp confirming our hypothesis that future pedestrian flow can be anticipated with the aid of historical data. 2. Application of the proposed memory architecture to two practical problems: aircraft trajectory modelling and pedestrian trajectory modelling in a surveillance setting, where in both cases we are able to achieve state-of-the-art results. 3. An in depth analysis on the evolution of the memory module content where we study the changes in hidden state representations over time and elaborate on some interpretable patterns. The two applications we demonstrate the proposed approach on, aircraft trajectory prediction and pedestrian trajectory prediction, are both related sequence-to-sequence modelling tasks, however they have quite distinct characteristics that illustrate the adaptability of the proposed approach. Aircraft trajectories are primarily a function of the flight schedule, which is typically fixed over a week, but still varies according to changes such as weather, off schedule arrivals/departures, etc. Pedestrian trajectories however are less dependent on a schedule and are more influenced by the behaviour of other nearby pedestrians. We would like to emphasise the fact that even though we are demonstrating our approach on two different application scenarios from the trajectory prediction domain, the varied nature of these problems demonstrates how the proposed model can be directly applied to any sequence-tosequence prediction problem where modelling long term relationships is necessary. Possible application areas include diver behaviour modelling for autonomous driving (Chen et al. (2015); Liu et al. (2017)), text and video synthesis (Reed et al. (2016)), and context aware machine translation (Banchs (2014)). 2. Related works Related work within the scope of this paper can be categorised into memory architectures (in Section 2.1), aircraft trajectory prediction approaches (in Section 2.2) and pedestrian trajectory prediction approaches (in Section 2.3). 3 F ERNANDO ET AL . Memory Module ct = fLST M (Xt , ct 1 ) Input Module ct-1 xt yt ct Controller Figure 2: Neural Network architecture with an external memory. The memory is used to store important historical facts which can be utilised for future predictions. The controller is responsible for issuing read and write commands in order to take out and write back to the memory. An input module is used to encode and generate a vector representation from the input 2.1 Memory architectures Deep learning models such as Recurrent Neural Networks (RNN) have been applied extensively for many sequence-to-sequence modelling problems and have been capable of producing state-of-theart results. A number of approaches (Weston et al. (2014); Kumar et al. (2015); Malinowski and Fritz (2014); Joulin and Mikolov (2015)) have also utilised what are termed “memory modules”, to aid prediction. The memory stores important facts from historical inputs and then generates the future predictions based on the stored knowledge. A sample architecture with an input module, controller and an external memory is shown in Fig. 2. Firstly the input module generates a vector representation ct for the input xt at time instance t. The controller then triggers a memory read operation. The memory module, with an attention process, searches the history and outputs relevant facts. The final output is generated by merging ct with the memory output. Finally, the controller triggers a memory update operation where the memory Mt−1 is updated with ct . Weston et al. (2014) have utilised a memory module to improve the accuracy on natural language processing problems. Their proposed memory architecture is not fully extendible considering the usage of an offline feature engineering process using a bag-of-words approach. In similar works, such as Joulin and Mikolov (2015) and Kaiser and Sutskever (2015) for image caption generation, and Malinowski and Fritz (2014) and Chen and Zitnick (2014) for visual question answering, the authors have extensively applied the notion of external memory. The memory architecture, “episodic memory”, proposed in Kumar et al. (2015) has been shown to be capable of outperforming the other external memory architectures proposed above in terms of accuracy . 4 T REE M EMORY N ETWORKS Mt = fLST M (mt , Mt 1) Memory Module Mt-1 Mt ct = fLST M (Xt , ct 1 ) Input Module ct-1 xt yt ct Controller (a) Episodic memory model proposed in Kumar et al. (2015) with LSTM memory cells Mt = f S LST M (mt , Mt 1 ) Memory Module ct = fLST M (Xt , ct 1 ) Input Module ct-1 xt yt ct Controller (b) Proposed TMN model with S-LSTM memory cells. Figure 3: Comparison of the memory model proposed in Kumar et al. (2015) (a) with the proposed memory model (b). In both approaches at time instance t, the input module generates representation ct for the input xt . Then the controller triggers a memory read operation. The memory module, with the attention process, output the relevant facts. The final output is given by merging ct with the memory output. Finally the memory update operation updates memory Mt−1 with ct . Fig. 3 (a) depicts the episodic memory model proposed in Kumar et al. (2015). The authors model the “episodic memory” as a hierarchical recurrent sequence model utilising the sequential nature of the memory. The authors propose a generalised neural sequential module with recurrent LSTM memory cells for sequence encoding, memory mechanism and response generation. The above work is further extended with a shared memory architecture in Neelakantan et al. (2015). 5 F ERNANDO ET AL . Even with the exemplary results for short term dependency modelling problems, none of the above stated architectures are capable of handling sequences with long term relationships. In approaches such as (Kumar et al., 2015; Neelakantan et al., 2015; Munkhdalai and Yu, 2016a) the memory is a composed of a single layer of memory units. The memory update mechanism in (Kumar et al., 2015; Neelakantan et al., 2015) can be written as, Mt = fLST M (mt , Mt−1 ), (2) where mt is a score value that quantifies the relevance of the content of the memory module (Mt−1 ) at time t−1 to the current context, ct (see 3 (a)); where as in Munkhdalai and Yu (2016a) the authors completely update the content of the memory locations based on mt . The main drawback of using approaches such as (Kumar et al. (2015); Neelakantan et al. (2015); Munkhdalai and Yu (2016a)) with long term dependency modelling and big data sets is that, in most cases, the attention mechanism will generate small scores for all the examples as they are all dissimilar to the input. Therefore with those approaches we are required to maintain an extremely large memory sequence as similar inputs only occur after long time intervals. Furthermore, in recurrent models such as in LSTMs, when the sequence becomes too long the output becomes more biased towards recent historical states (Chen et al. (2016)) rather than considering the entire set of historical states equally. Hypothetically if the memory module has enough non-linearity and if we have a sufficiently large database, any output should be able to be produced by the components that reside in the memory. Furthermore the model should be capable of learning and modelling the short term contextual effects as well as the long term contextual effects from what is input to its memory. This can be seen as a dictionary learning process where memory is the dictionary that we are learning and the memory module should learn to produce an accurate prediction for different combinations of inputs and historical trajectories. Recently the recursive LSTM (S-LSTM) (Zhu et al. (2015)) structure was proposed where the authors extend the sequential LSTM to tree structures, in which a memory cell can reflect the historical memories of multiple child cells or multiple descendant cells in a recursive process. Chen et al. (2016) have performed an in depth analysis of the strengths and weaknesses of sequential and recursive structures for a neural language modelling task; and found syntactical relationships such as structure and logic in the input data are best captured via a recursive LSTM structure (i.e. S-LSTM), where as when encoding the semantics of sentences, sequential LSTM models provide state-of-the-art results. The proposed model is illustrated in Fig 3 (b). Our approach eschews the sequence representation in favour of a tree-based approach, which is motivated by the positive characteristics that the S-LSTM architecture exhibits such as feature compression power and the preservation of semantic relationships among data. A detailed analysis of the architecture in comparison to state-of-the-art methods is provided in Section 3.3. 2.2 Aircraft trajectory prediction approaches Approaches such as (Prandini et al., 2000; Paielli and Erzberger, 1997) utilise probability models on aircraft dynamics in order to generate predictions on their future motion. They purely rely on the assumptions made on the dynamics of the aircraft, without using any historical information, which contributes to its main drawback. 6 T REE M EMORY N ETWORKS In Choi and Hebert (2006), de Leege et al. (2013), Winder (2004) researchers treated aircraft trajectory prediction as a machine learning problem, in which they train the model using historical trajectory data together with weather observations. Most recently Ayhan and Samet (2016) proposed an approach that considered trajectories as a set of 4 dimensional data cubes, together with weather parameters. Initially they performed time series clustering on data for segmentation and then learnt a HMM on top of each cluster. Still due to the uncertainty with weather observations, these trajectory prediction approaches become inefficient. Several efforts have been made to improve the trajectory prediction by better wind estimation (Mondoloni and Liang (2003); Cole et al. (2000); Rekkas et al. (1991); Delahaye (1992); Hollister et al. (1989)), yet these approaches have failed to achieve significant improvement in the task of trajectory prediction. Furthermore we would like to emphasise the fact that all of the above stated approaches consider aircrafts individually without considering the air traffic within the neighbourhood, completely discarding important factors such as the volume and proximity of nearby air traffic. Even though weather is a vital factor for future predictions it is implicit in neighbouring traffic behaviour. Therefore, inferring a notion of weather through neighbouring traffic is computationally inexpensive compared to tedious interpolations that ground based weather observations require (Ayhan and Samet, 2016). 2.3 Pedestrian trajectory prediction approaches When considering literature for human behaviour prediction the social force model (Helbing and Molnár (1995); Koppula and Saxena (2013); Pellegrini et al. (2010); Yamaguchi et al. (2011); Xu et al. (2012)) and its variants can be considered as well-established. Such approaches generate attractive and repulsive forces between pedestrians defining the optimal path under different contexts with respect to the neighbourhood. As a variant, a mixture model is presented in Zhou et al. (2015) but this approach ignores the interactions among pedestrians. Wang et al. (2008) proposed a “topic model” which was extended to incorporate spatio-temporal dependencies in Hospedales et al. (2009) and Emonet et al. (2011). All of the above stated approaches use hand-engineered features as the input to the prediction module, which can be considered their main drawback as they fail to account for the semantics of the scene. Depending on the domain knowledge of the feature engineer, handcrafted features may only capture abstract level semantics of the environment. Alahi et al. (2016) removed the need for hand-crafted features via an unsupervised feature learning approach. The authors encode the trajectory of each pedestrian in the scene at that particular time frame using LSTMs. The hidden states of the neighbouring pedestrians in the immediately preceding time step are used for generating their positions in the current time step. As pointed out in Fernando et al. (2017b) this approach is only sufficient for generating reactive behaviours such as collision avoidance but fails to generate smooth trajectories for long term trajectory planning. Fernando et al. (2017b) have extended the above idea to incorporate the entire trajectory of the pedestrian of interest as well as the neighbouring pedestrians. To the best of our knowledge none of the literature addressing human behaviour prediction has considered the long-term relationships among human behavioural patterns. Motivated by this limitation, we intend to explore the utility of temporal data for trajectory prediction via a tree memory network. 7 F ERNANDO ET AL . 3. Tree Memory Network (TMN) Model In this work, we are motivated by the exemplary results that were achieved from a tree structure for the task of discriminative dictionary learning from trajectories in Fernando et al. (2017a). In contrast to mapping all the historic data with a shallow layer of recurrent memory cells, we hierarchically map the memory with a bottom up tree structure where all the historical states are represented in the bottom layer of the tree and we go up the hierarchy concatenating the most significant features in order to generate the output at a particular time step. Furthermore, rather than stacking individual recurrent layers (such as in Serban et al. (2016); Li et al. (2015)), we utilise a Tree-LSTM structure as it focusses only on the historical information from its two neighbours. Therefore it can be seen as passing out significant features from two temporally adjacent neighbours to the upper layer. 3.1 Input Module th Let Xi = [x1i , x2i , . . . , xT i ] be the i input sequence where T represents the number of time steps. The input module computes a vector representation ct for the input sequence via a LSTM layer, ct = fLST M (xt , ct−1 ), (3) where ct ∈ Rk , and k is the embedding dimension of the LSTM. 3.2 Memory Module Consider N ∈ Rp×k as the sequence of historical LSTM embeddings, with length p and embedding dimension k, that we would like to model as the memory. It can be seen as a queue structure with length p and each data element within the queue has a dimension of k. We adapt the S-LSTM model to represent the memory module of the proposed framework. It extends the general sequential structure in LSTMs to a bottom up tree structure composed of a compressed representation of children nodes to a parent node. This provides us with a principled way of considering long-distance interactions between memory inputs, and avoids the current drawbacks of LSTM models when handling lengthy sequences (Chen et al. (2016)). In order to preserve the simplicity we only represent the recursive-LSTM structure as a binary tree, where each parent node has a maximum of two child nodes; however the extension of this model to any tree structure is straightforward. 3.2.1 M EMORY R EAD When computing an output at time instance t we extract out the tree configuration at time instance l t−1. Let Mt−1 ∈ Rk×(2 −1) be the memory matrix resultant from concatenating nodes from the tree from the top to l = [1, . . .] depth. This allow us to capture different levels of abstraction that exists in our memory network. Let f score be an attention scoring function which can be implemented as a multi-layer perceptron (Munkhdalai and Yu (2016b)), mt = f score (Mt−1 , ct ), (4) α = sof tmax(mt ). (5) 8 T REE M EMORY N ETWORKS Eq. 4 and Eq. 5 provide an attention mechanism that finds the most relevant memory items given the current input, zt = Mt−1 αT . (6) Then the final output can be represented as, yt = ReLU (Wout zt + (1 − Wout )ct ), (7) where Wout are the output weights. 3.2.2 M EMORY UPDATE In the proposed memory architecture each memory cell contains one input gate it , one output gate ot and two forget gates ftL and ftR . At time instance t each node in the memory network can be updated in the following manner, R R R R L L ht−1 + WciL cL ht−1 + Whi it = σ(Whi t−1 + Wci ct−1 ), (8) R R L L L L R R c ), c + Wcf h + Wcf + Whf ftL = σ(Whf h l t−1 l t−1 l t−1 l t−1 (9) L R L L R R ftR = σ(Whf hL + Whf hR + Wcf c + Wcf c ), r t−1 r t−1 r t−1 r t−1 (10) R R L L ht−1 , ht−1 + Whc β = Whc (11) R R cPt = ftL ⊗ cL t−1 + ft ⊗ ct−1 + it ⊗ tanh(β), (12) L L R R P P ot = σ(Who ht−1 + Who ht−1 + Wco ct ), (13) hPt = ot ⊗ tanh(cPt ), (14) R L R where hL t−1 , ht−1 , ct−1 and ct−1 are the hidden vector representations and cell states of the left and right children respectively. The relevant weight vectors W are represented with appropriate super and subscripts where the superscript represents the relevant child node, and the subscript represents the relevant gate and the vector which the weight is attached to. The process is also illustrated in Fig 4. 3.3 Relation to current state of the art The major difference between the proposed approach and current state of the art methods such as Kumar et al. (2015), Neelakantan et al. (2015) and Munkhdalai and Yu (2016a) is the representation of the memory. In those approaches the memory is a composed of a single layer of memory units. The memory update mechanism in Kumar et al. (2015) and Neelakantan et al. (2015) can be written as, Mt = LST M (mt , Mt−1 ), (15) 9 F ERNANDO ET AL . ht ht-1R x ct-1L ht-1R ct-1R ht-1L ct-1L x ftL ht-1L ht-1R ot ht-1L ct-1R x ct it x ftR ht-1R ct-1R ht-1L ct-1L ct-1R ht-1L ct-1L ht-1R Figure 4: Tree memory cell architecture. ftL , ftR , ot , itN represents the left forget gate, right forget gate, output gate and input gate respectively. represents multiplication where mt can be obtained using Eq. 4, where as in Munkhdalai and Yu (2016a) the authors completely update the content of the memory locations with respect to the output of Eq. 6. This process can be written as, Mt = Mt−1 (1 − (zt ⊗ ek )T ) + (ht ⊗ ep )(zt ⊗ ek )T , (16) where 1 is a matrix of ones and ek and ep are vectors of ones. ⊗ denotes the outer product which duplicates its left vector p or k times to form a matrix. In contrast we model our memory in a binary tree structure where it is updated in a bottom up fashion utilising Eq. 8 to 14. The main drawback of using approaches such as (Kumar et al. (2015); Neelakantan et al. (2015); Munkhdalai and Yu (2016a)) with long term dependency modelling and big data sets is that, in most cases, the attention mechanism will generate small score values for all the examples as they are dissimilar to the input. Therefore with those approaches we are required to maintain an extremely large memory sequence as similar inputs only occur after long time intervals. Furthermore in recurrent models such as in LSTMs, when the sequence becomes too long the output becomes more biased towards recent historic states (Chen et al. (2016)) rather than considering the entire set of historic states equally. In contrast, we represent memory with a tree structure where we learn the logical coherence among neighbouring memory cells with different levels of abstraction. 10 T REE M EMORY N ETWORKS 4. Experimental results We present the experimental results on two trajectory datasets: an aircraft trajectory database from the south east Queensland (SEQ) region in Australia; and a widely utilised pedestrian trajectory database. These datasets are specifically chosen to demonstrate the capability of the proposed model to handle varying dimensionalities and temporal relationships and present its real world applicability. 4.1 Experiment 1: Terminal Area Air Traffic Prediction We obtain air traffic data from the south east Queensland (SEQ) region in Australia from 30-11-2014 to 30-11-2015. We use the real position reports recorded by the Australian Advanced Air Traffic System (TAAATS) used for current air traffic management in Australia (McFadyen and Martin, 2016). As a pre-processing step the data is transformed into trajectories utilising the aircraft identification tags and reported timing. Trajectories with less than 3 position reports are then removed as they are too short for the trajectory modelling task. As the final step each flight trajectory is resampled to provide 50 equally spaced data points. This gives us 260,735 trajectories. The aircraft trajectories are represented as 3 dimensional data streams where each point xti of the input sequence Xi = [x1i , x2i , . . . , xT i ] can be represented as,  t  xi (17) xti =  yit  , zit where T is the number of time steps in the ith input sequence. In this experiment we observed the first 25 frames of the aircraft trajectory and predicted the trajectory for next 25 frames. For training we selected the first 182,515 (i.e 70%) trajectories chronologically. The remaining 78,220 trajectories were used for testing. Based on the recommendations provided in (Gong and McNally (2004); Ayhan and Samet (2016); Paglione and Oaks (2007)), we measure the following three error metrics for the aircraft trajectory prediction experiment. The trajectory prediction errors are calculated for each observed radar track point in each input trajectory segment. Let n be the number of trajectories in the testing set and we are interested in predicting the trajectory for the time period from t = T obs + 1 to T pred while observing the trajectory of the same aircraft from t = 1 to T obs . Let the predicted course from North for the trajectory i at tth time instance be denoted by θˆit . Then, and, ∆xti = x̂ti − xti , (18) ∆yit = yˆit − yit . (19) Now we can define, 1. Average along track error (AE): n P AE = pred TP (∆xti sin(θˆit ) + ∆yit cos(θˆit )) i=1 t=T obs +1 n(T pred − (T obs + 1)) 11 (20) F ERNANDO ET AL . 96 96 95 95 Average Average altitude error altitude error(feet) (feet) 94 94 93 93 92 92 91 91 90 90 89 89 DMN Module OUR Module OUR TMN Module Module 88 88 87 87 0 0 200 400 600 800 1000 2 10 4 6 8 Number of levels, from the top of the memory tree, Length of memory in memory read 1200 12 (a) Average altitude error vs length (b) Average altitude error vs embed- (c) Average altitude error vs numof memory module, p ding dimension, k ber of levels, from the top of the memory tree, in the memory read, l Figure 5: Parameter evaluation for length of memory module, p, embedding dimension, k, and the number of levels, from the top of the memory tree, in the memory read, l 2. Average cross track error (CE): n P pred TP (∆xti cos(θˆit ) − ∆yit sin(θˆit )) i=1 t=T obs +1 CE = n(T pred − (T obs + 1)) (21) 3. Average altitude error (ALE): n P ALE = s i=1 pred TP (zˆit − zit )2 t=T obs +1 n(T pred − (T obs + 1)) (22) As baseline models we implemented the HMM model (HMM) proposed in Ayhan and Samet (2016) and the Dynamic Memory Networks approach (DMN) given in Kumar et al. (2015). For the HMM model the required weather data is obtained from the data services provided by the Australian Bureau of Meteorology (BOM (November 2016)). We observed wind speed and direction and temperature at one minute frequency. The data interpolation and parameter quantisation is performed in the same way as in Ayhan and Samet (2016). 4.1.1 P REDICTION UNDER NORMAL CONDITIONS Hyper parameters, the length of the memory module, p, and the embedding dimension, k, of the proposed memory module (TMN) and DMN are evaluated experimentally. Fig. 5 (a) shows the variation in average altitude error against p for the TMN and for DMN modules in solid red and dashed green lines respectively. For the proposed TMN, as the error converges around p = 500, we set the value of p as 512. For DMN the plot shows that error decreases at first and it starts increasing again when the length of the memory exceeds 200 hidden units. This verifies our assertion that naive memory models with sequential LSTM architectures fail to model long term dependencies. 12 T REE M EMORY N ETWORKS As p = 180 gives the lowest altitude error, for the DMN model we set the value of p as 180. With a similar experiment we evaluated the optimal embedding dimension, k . Fig. 5 (b) shows the variation of average altitude error against k for the TMN and for DMN modules. As for both modules k = 300 produces the smallest altitude error, we set the embedding dimension to 300 units. Finally, we evaluated the number of levels from the top of the memory tree in the memory read, l, of the proposed memory module (TMN). The evaluation results, shown in Fig. 5 (c), suggest that l = 4 produces optimal results. It is observed that the error is reduced until l = 4 before increasing again when the number of levels in the memory read operation exceeds 6 levels. This is due to the density of the extracted memory activation. Using the tree structure of the memory we capture the information in a hierarchical manner, where only vital information from the bottom layers is passed to the top layer. Therefore when the extracted matrix becomes too dense, the decoding function fails to discriminate such vital facts, and the performance starts to degrade. We trained the TMN model using stochastic gradient descent (SGD) with momentum and evaluation results are presented in Table 1. Metirc AE CE ALE HMM 1.103 1.042 147.801 DMN 1.039 1.056 92.039 TMN 1.020 1.011 87.001 Table 1: Quantitative results for aircraft trajectory prediction. In all the methods the forecast trajectories are of length 25 frames. The first row reports the along track error (AE), the second row shows cross track error (CE) and the final row shows the altitude error (ALE). With reference to the results in Table 1 we illustrate the capability of the proposed model to infer different modes of air traffic behaviour. We would like to emphasise that without explicit weather modelling or neighbourhood modelling the proposed augmented memory architecture is capable of learning the salient aspects and long term dependencies which are necessary when modelling the aircraft trajectories. Another prominent factor is the accuracy improvement from the DMN model to the TMN model which illustrates that flat memory architectures such as that of Kumar et al. (2015) fail to capture long term dependencies; where as our proposed hierarchical memory architecture is able to successfully learn those long term relationships. In Section 5 we perform an in depth analysis on the hidden state activations of the memory module which illustrates how the proposed multi-layer architecture generates future trajectories while encoding the necessary information from the history. In Fig. 6 we show prediction results of the HMM model, DMN model and our model (TMN) on the aircraft trajectory dataset. It should be noted that our model generates better predictions even with the highly varied nature of the database (i.e take off, landing, cruising, etc). For instance in the 1st and 2nd rows we demonstrate how the same model adapts to takeoff and landing scenarios. In the last row of Fig. 6 we show some failure cases. The reason for such deviations from the ground truth were mostly due to sudden turns and movements. Even though these trajectories do not match the ground truth, the proposed method still outperforms the current state-of-the-art methods and generates much more realistic trajectories. 13 alt long F ERNANDO ET AL . lat lat (b) Latitude vs Altitude alt long (a) Latitude vs Longitude lat lat (d) Latitude vs Altitude long alt (c) Latitude vs Longitude lat lat (f) Latitude vs Altitude alt long (e) Latitude vs Longitude lat lat (g) Latitude vs Longitude (h) Latitude vs Altitude 14 Figure 6: Qualitative results under nominal conditions: Each row represents a particular example. Given (in green), Ground Truth (in Blue) and Predicted trajectories from the TMN model (in red), from the DMN model (in yellow), from the HMM model (in brown). T REE M EMORY N ETWORKS 4.1.2 H ANDLING DIFFERENT WEATHER CONDITIONS In order to verify the capability of the proposed model to understand and capture the effect of weather on aircraft trajectory prediction via historical trajectories we conducted a separate experiment, where the model is used to predict the air traffic on a stormy day. Severe storms affected South East Queensland on 28th of November 2015. We tested the model with the trajectories from 27th November to 29th November (i.e. 1916 trajectories) as it allows a sufficient number of examples to initialise the memory module. It should be noted that all these examples are not used for training the model. We compare the proposed model against the HMM model (Ayhan and Samet (2016)) which is explicitly fed with the weather information. Metirc AE CE ALE TMN 1.146 1.513 88.397 HMM 1.689 1.967 203.754 Table 2: Quantitative results for aircraft trajectory prediction under stormy conditions. In all the methods the forecast trajectories are of length 25 frames. The first row reports the along track error (AE), the second row shows cross track error (CE) and the final row shows the altitude error (ALE). When comparing Table. 2 with Table. 1, though the accuracy of the predictions of the TMN is slightly reduced, the predictions are still more accurate when compared with Ayhan and Samet (2016) in which the error has increased dramatically indicating that the baseline model does not adapt well to changing weather conditions. When referring to the results presented in Fig. 7 it is evident that the non uniform nature of the air traffic under stormy weather conditions is well captured by the proposed approach. Even with the accurate weather information, the HMM model fails to properly exploit this data and generates erroneous trajectories. The TMN model anticipates the uneven nature through looking at the recent history while also mapping how correlated trajectories have behaved when considering the long term history. Furthermore, we would like to emphasise the fact that for the TMN model, even under storm conditions, the altitude error is within the +-100ft altimeter tolerances provided to private pilots (AIP (2017)). 4.2 Experiment 2: Pedestrian trajectory prediction In this experiment we considered 3 months worth of trajectories from the Edinburgh Informatics Forum database (Majecka (2009)), where we trained our model on 60,000 trajectories and tested on 12,000 trajectories. For all the models we observed the trajectory for 30 frames and predicted the trajectory for the next 30 frames. In this experiment the trajectories are represented as 2 dimensional data where each point xti of the input sequence Xi = [x1i , x2i , . . . , xT i ] is represented as, xti  = 15 xti yit  . (23) alt long F ERNANDO ET AL . lat (a) (b) alt long lat lat lat (d) alt long (c) lat lat (f) alt long (e) lat lat (g) (h) 16 Figure 7: Qualitative results under storm conditions: Each row represents a particular example. Given (in green), Ground Truth (in Blue) and Predicted trajectories from TMN model (in red), from HMM model (in brown). T REE M EMORY N ETWORKS For comparison we implemented Soft+hard wired attention (SH-Atn) model from Fernando et al. (2017b), the Social LSTM (So-LSTM) model given in Alahi et al. (2016) and Dynamic Memory Networks (DMN) given in Kumar et al. (2015). For the So-LSTM model a local neighbourhood of size 32px was considered and the hyper-parameters were set according to Alahi et al. (2016). For Fernando et al. (2017b) we considered a neighbourhood size of 10 in the left, right and front directions and an embedding size of 300 hidden units. For DMN and TMN models we use the same experimental settings given the in previous experiment. Similar to (Fernando et al. (2017b); Alahi et al. (2016)) we report prediction accuracy with the following 3 error metrics. We are predicting a trajectory for the period from t = T obs + 1 to T pred while observing the same trajectory from t = 1 to T obs + 1. Let n be the number of trajectories in the testing set and X̂it be the predicted position for the trajectory i at the tth time instance, and Xit be the respective observed positions then, 1. Average displacement error (ADE): n P ADE = pred TP (X̂it − Xit )2 i=1 t=T obs +1 . n(T pred − (T obs + 1)) (24) 2. Final displacement error (FDE) : n q P pred pred 2 (X̂iT − XiT ) F DE = i=1 . n (25) 3. Average non-linear displacement error (n-ADE): The average displacement error for the non-linear regions of the trajectory. n − ADE = n P pred TP i=1 t=T obs +1 I(X̂it )(X̂it − Xit )2 pred TP n P i=1 t=T obs +1 where I(X̂it ) =   1  0 , I(X̂it ) d2 yit 6= 0. d(xti )2 o.w if (26) (27) As shown in Table 3, the proposed model outperforms the SH-Atn model, So-LSTM model and DMN in all three error metrics. The dataset is considered quite challenging where there are multiple source and sink positions, different crowd motion patterns are present and motion paths are heavily crowded. Without explicitly modelling the neighbourhood motion such as in the SH-Atn model and So-LSTM model, our approach is still outperforming the current state-of-the-art models. In Fig. 8 we show prediction results for the SH-Atn model, DMN model and our model TMN on the EIF trajectory dataset. With the examples shown it is evident how different modes of human motion are well captured and represented through the proposed augmented memory module. For instance in Fig. 8 (g) and Fig. 8 (k) the pedestrians exhibit a sudden change in motion which all baseline models fail to capture. But the proposed model has successfully anticipated that motion via historical behaviour. 17 F ERNANDO ET AL . Metirc ADE FDE n-ADE SH-Atn 1.066 1.551 1.021 So-LSTM 1.843 2.421 1.988 DMN 1.798 2.276 1.456 TMN 1.051 1.398 0.987 Table 3: Quantitative results for pedestrian trajectory prediction. In all the methods the forecast trajectories are of length 30 frames. The first row represents the average displacement error (ADE), the second row shows the final displacement error (FDE) and the third row shows the average non-linear displacement error (n-ADE). 5. Analysis of Memory Activations In this section we explore how elements of the memory module are activated under different conditions. In particular, we aim to show that the baseline model Kumar et al. (2015) and the first layer of the proposed approach have activations based more on the recent inputs to the model; while the last layer of the proposed approach has activations that are driven by the input itself rather than the recent history, due to it’s ability to better capture the long term dependencies. We conducted this investigation with the pedestrian dataset as it is simpler to visualise. 5.1 Correlated activations from the first layer In this section we analyse the memory activation for various test cases from Experiment 2. We randomly selected a memory cell from the first layer of the memory, and analysed the temporal evaluation of the activations of the hidden states of that particular memory cell. Each memory cell has a hidden state dimension of 100 and every input sequence has a length of 30 time steps. A smaller hidden state dimension is used compared to previous experiments to ensure the clear visibility of memory activations. Fig. 9 shows the results of our analysis process. We searched our test set for common activation patterns. The first column of Fig. 9 shows the memory activations, with the most highly correlated memory patterns shown in red, green and blue; and the remainder of the activations shown in grey. The second column shows the input to the model (in green) and the predicted sequence (in blue). The previous 10 trajectories that are fed to the memory are shown in the third column. From black to white we have colour coded the most recent trajectory to the oldest trajectory. We expect the first layer of the memory module to generate similar activation patterns when there exists a similar set of historical trajectories, and if there exists a similarity between those historical trajectories and the input. 5.2 Correlated activations from the last layer Fig. 10 illustrates the activations of final memory cell (i.e last layer). Column descriptions are identical to the that of Fig. 9. The second and third columns of Fig. 10 provide visual evidence that the proposed memory module has successfully learnt relationships among input trajectories. If our memory module has enough capacity and if it is capturing long term dependencies, the final layer should generate similar activations for similar input trajectory patterns, rather than being completely reliant on the current short term context. That is evident with the similarity shown in Fig. 10 where we observe similar activations (i.e column 1) for similar inputs patterns (i.e column 2). Importantly, 18 T REE M EMORY N ETWORKS (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l) Figure 8: Qualitative results: Given (in green), Ground Truth (in Blue) and Predicted trajectories from TMN model (in red), from DMN model (in yellow), from SH-Atn model (in purple). we note that despite the similar activations, the recent history (i.e. column 3) differs significantly between cases; unlike in Fig. 9. 19 F ERNANDO ET AL . 5.3 Activations from the baseline memory module (Kumar et al. (2015)) In Fig. 11 we visualise the correlated activations from the baseline memory model shown in Fig. 3 (a). The column labels are identical to that of Fig. 9. We compare the activations in Fig. 10 to those in Fig. 11. When observing Fig 11 column 3 it is evident that hidden state activations are dominated by the most recent inputs to the memory, and the long term dependencies are of little importance. This is noted to be an inherent problem with sequential LSTM architectures (Chen et al. (2016)). Therefore regardless of the input to the model (shown in Fig 11 column 2) the memory module is generating similar activations only considering the short term context. Hence the prediction error is high. Furthermore we would like to highlight the similarity between Fig 11 and the first layer of the proposed memory module (shown in Fig. 9 ). To further illustrate the limitations of the baseline model, we clustered the input trajectories and from one particular cluster we extracted out the highest correlated input trajectories (shown in Fig. 12) within that cluster. Even though we expect the baseline memory module to generate similar activations when the inputs to the prediction module are similar, it generates vastly different activations. In order to highlight the differences among memory activations we randomly selected 3 hidden units within the memory and illustrated their temporal evaluations in colour (see Fig. 12 column 1). The rest of the activations are shown in grey. As the short term history within the base line memory module is significantly different from one example to another (see Fig. 12 column 3) the memory module generates extremely different activations, completely discarding the input given. Furthermore when comparing Fig. 12 with Fig. 11 the baseline memory module generates similar activations (shown in Fig. 11 column 1) when the short term history is similar (shown in Fig. 11 column 3) and vastly different activations (shown in Fig. 12 column 1) when short term history is different (shown in Fig. 12 column 3). The input to the prediction module and its long term dependencies are of little importance. 6. Conclusion The proposed tree memory network (TMN) model is a generalised architecture for modelling long term and short term relationships, which can be applied directly for any sequence-to-sequence mapping task. With the evaluation results we demonstrated that our proposed memory architecture is able to outperform all the considered baselines and we provide visual evidence on the power of TMN, which is able to capture both long term and short term relationships via an efficient tree structure. We have demonstrated our approach on two different application scenarios from the trajectory prediction domain; however, the varied nature of these problems demonstrates how the proposed TMN model can be directly applied to any sequence-to-sequence prediction problem where modelling long term relationships is necessary. In future work we will be exploring the applications of TMN as an encoding mechanism for large scale multimodal inputs such as videos (i.e. a sequence of images), where the encoded vector representation of the memory can be utilised to generate a sparse representation of the entire video sequence with its temporal relationships. References AIP. Altimeter checks and flight tolerances, airservices, australia. Aeronautical Information Package, page 39, 2017. 20 T REE M EMORY N ETWORKS Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social lstm: Human trajectory prediction in crowded spaces. CVPR, 2016. Samet Ayhan and Hanan Samet. Aircraft trajectory prediction made easy with predictive analytics. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pages 21–30, New York, NY, USA, 2016. ACM. ISBN 978-1-45034232-2. doi: 10.1145/2939672.2939694. Rafael E Banchs. A principled approach to context-aware machine translation. EACL 2014, pages 70–74, 2014. BOM. Australian bureau of meteorology,. November 2016. URL http://www.bom.gov.au/ climate/data/stations/. Chenyi Chen, Ari Seff, Alain Kornhauser, and Jianxiong Xiao. Deepdriving: Learning affordance for direct perception in autonomous driving. In Proceedings of the IEEE International Conference on Computer Vision, pages 2722–2730, 2015. Qian Chen, Xiaodan Zhu, Zhenhua Ling, Si Wei, and Hui Jiang. Enhancing and combining sequential and tree lstm for natural language inference. arXiv preprint arXiv:1609.06038, 2016. Xinlei Chen and C Lawrence Zitnick. Learning a recurrent visual representation for image caption generation. arXiv preprint arXiv:1411.5654, 2014. Patrick Pakyan Choi and Martial Hebert. Learning and predicting moving object trajectory: a piecewise trajectory segment approach. Robotics Institute, page 337, 2006. Rod Cole, Steve Green, Matt Jardin, Barry Schwartz, and Stan Benjamin. Wind prediction accuracy for air traffic management decision support tools. In 3rd USA/Europe Air Traffic Management R&D Seminar, Napoli, Italy, 2000. AMP de Leege, MM Van Paassen, and M Mulder. A machine learning approach to trajectory prediction. 2013. D Delahaye. Wind field update using radar track data. PhD thesis, Masters thesis, Ecole Nationale de lAviation Civile, 1992. Rmi Emonet, Jagannadan Varadarajan, and Jean-Marc Odobez. Extracting and locating temporal motifs in video scenes using a hierarchical non parametric bayesian model. In CVPR, pages 3233–3240, 2011. ISBN 978-1-4577-0394-2. Tharindu Fernando, Simon Denman, Sridha Sridharan, and Clinton Fookes. Deep decision trees for discriminative dictionary learning with adversarial multi-agent trajectories. under review as a journal paper in IEEE Transactions on Knowledge and Data Engineering, 2017a. Tharindu Fernando, Simon Denman, Sridha Sridharan, and Clinton Fookes. Soft+ hardwired attention: An lstm framework for human trajectory prediction and abnormal event detection. arXiv preprint arXiv:1702.05552, 2017b. Chester Gong and Dave McNally. A methodology for automated trajectory prediction analysis. In AIAA Guidance, Navigation, and Control Conference and Exhibit, pages 16–19, 2004. 21 F ERNANDO ET AL . Dirk Helbing and Péter Molnár. Social force model for pedestrian dynamics. Phys. Rev. E, 51: 4282–4286, 1995. doi: 10.1103/PhysRevE.51.4282. WM Hollister, ER Bradford, and JD Welch. Using aircraft radar tracks to estimate wind aloft. The Lincoln Laboratory Journal, 2(3):555–565, 1989. Timothy M. Hospedales, Shaogang Gong, and Tao Xiang. A markov clustering topic model for mining behaviour in video. In ICCV, pages 1165–1172, 2009. ISBN 978-1-4244-4419-9. Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Advances in Neural Information Processing Systems, pages 190–198, 2015. Kshitij Judah, Alan P Fern, Thomas G Dietterich, et al. Active lmitation learning: formal and practical reductions to iid learning. The Journal of Machine Learning Research, 15(1):3925– 3963, 2014. Łukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. arXiv preprint arXiv:1511.08228, 2015. Hema Swetha Koppula and Ashutosh Saxena. Anticipating human activities using object affordances for reactive robotic response. In IROS, page 2071, 2013. ISBN 978-981-07-3937-9. Ankit Kumar, Ozan Irsoy, Jonathan Su, James Bradbury, Robert English, Brian Pierce, Peter Ondruska, Ishaan Gulrajani, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. arXiv preprint arXiv:1506.07285, 2015. John Lafferty, Andrew McCallum, Fernando Pereira, et al. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proceedings of the eighteenth international conference on machine learning, ICML, volume 1, pages 282–289, 2001. Jiwei Li, Minh-Thang Luong, and Dan Jurafsky. A hierarchical neural autoencoder for paragraphs and documents. arXiv preprint arXiv:1506.01057, 2015. HaiLong Liu, Tadahiro Taniguchi, Yusuke Tanaka, Kazuhito Takenaka, and Takashi Bando. Visualization of driving behavior based on hidden feature extraction by using deep learning. IEEE Transactions on Intelligent Transportation Systems, 2017. B. Majecka. Statistical models of pedestrian behaviour in the forum. MSc Dissertation, School of Informatics, University of Edinburgh, 2009. Mateusz Malinowski and Mario Fritz. A multi-world approach to question answering about realworld scenes based on uncertain input. In Advances in Neural Information Processing Systems, pages 1682–1690, 2014. Aaron McFadyen and Terry Martin. Terminal airspace modelling for unmanned aircraft systems integration. In Unmanned Aircraft Systems (ICUAS), 2016 International Conference on, pages 789–794. IEEE, 2016. Tomas Mikolov, Armand Joulin, Sumit Chopra, Michael Mathieu, and Marc’Aurelio Ranzato. Learning longer memory in recurrent neural networks. arXiv preprint arXiv:1412.7753, 2014. 22 T REE M EMORY N ETWORKS Stephane Mondoloni and Dianna Liang. Improving trajectory forecasting through adaptive filtering technique. In Proceedings of 5th USA-Europe ATM Seminar, 2003. Tsendsuren Munkhdalai and Hong Yu. Neural semantic encoders. arXiv preprint arXiv:1607.04315, 2016a. Tsendsuren Munkhdalai and Hong Yu. Neural tree indexers for text understanding. arXiv preprint arXiv:1607.04492, 2016b. Arvind Neelakantan, Quoc V Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent. arXiv preprint arXiv:1511.04834, 2015. Mike M Paglione and Robert D Oaks. Implementation and metrics for a trajectory prediction validation methodology. In Proceedings of the American Institute of Aeronautics and Astronautics (AIAA) Guidance, Navigation, and Control Conference, Hilton Head, South Carolina, 2007. Russell A Paielli and Heinz Erzberger. Conflict probability estimation for free flight. Journal of Guidance, Control, and Dynamics, 20(3):588–596, 1997. Stefano Pellegrini, Andreas Ess, and Luc J. Van Gool. Improving data association by joint modeling of pedestrian trajectories and groupings. In ECCV, pages 452–465, 2010. ISBN 978-3-64215548-2. Maria Prandini, Jianghai Hu, John Lygeros, and Shankar Sastry. A probabilistic approach to aircraft conflict detection. IEEE Transactions on intelligent transportation systems, 1(4):199–220, 2000. Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In Proceedings of The 33rd International Conference on Machine Learning, volume 3, 2016. CM Rekkas, CC Lefas, and NJ Krikelis. Three-dimensional tracking using on-board measurements. IEEE transactions on aerospace and electronic systems, 27(4):617–624, 1991. Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. arXiv preprint arXiv:1605.06069, 2016. Elaheh ShafieiBavani, Mohammad Ebrahimi, Raymond Wong, and Fang Chen. An efficient approach for multi-sentence compression. In JMLR: Workshop and Conference Proceedings, 2016. Xiaogang Wang, Keng Teck Ma, Gee Wah Ng, and W. Eric L. Grimson. Trajectory analysis and semantic region modeling using a nonparametric bayesian model. In CVPR, pages 1–8, 2008. ISBN 978-1-4244-2242-5. Jason Weston, Sumit Chopra, and Antoine Bordes. arXiv:1410.3916, 2014. Memory networks. arXiv preprint Lee Francis Winder. Hazard avoidance alerting with Markov decision processes. PhD thesis, Massachusetts Institute of Technology, 2004. 23 F ERNANDO ET AL . Jiacheng Xu, Danlu Chen, Xipeng Qiu, and Xuangjing Huang. Cached long short-term memory neural networks for document-level sentiment classification. arXiv preprint arXiv:1610.04989, 2016. Jingxin Xu, Simon Denman, Clinton B. Fookes, and Sridha Sridharan. Unusual scene detection using distributed behaviour model and sparse representation. AVSS, pages 48 – 53, 2012. Kota Yamaguchi, Alexander C. Berg, Luis E. Ortiz, and Tamara L. Berg. Who are you with and where are you going? In CVPR, pages 1345–1352, 2011. ISBN 978-1-4577-0394-2. Shuai Yi, Hongsheng Li, and Xiaogang Wang. Understanding pedestrian behaviors from stationary crowd groups. In CVPR, pages 3488 – 3496, 2015. Bolei Zhou, Xiaoou Tang, and Xiaogang Wang. Learning collective crowd behaviors with dynamic pedestrian-agents. Journal of Computer Vision, 111:50–68, 2015. Xiaodan Zhu, Parinaz Sobhani, and Hongyu Guo. Long short-term memory over tree structures. arxiv preprint. arXiv preprint arXiv:1503.04881, 2015. 24 T REE M EMORY N ETWORKS 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (a) (b) (c) (e) (f) (h) (i) (k) (l) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (d) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (g) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 (j) 20 25 30 Figure 9: Pedestrian trajectories: Correlated activations from the first layer of the memory. First column: Highest correlated Memory activations for the pattern selected (in colours) and the rest of the activations (in grey) over time. Second column: The input (observed (in green) and predicted (in blue)) to the model at that time step. Third column: Previous 10 trajectories that reside in the memory. Black to white represents most recent to oldest. 25 F ERNANDO ET AL . 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (a) (b) (c) (e) (f) (h) (i) (k) (l) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (d) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (g) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 (j) 20 25 30 Figure 10: Pedestrian trajectories: Correlated activations from the last layer of the memory. First column: Highest correlated Memory activations for the pattern selected (in colours) and the rest of the activations (in grey) over time. Second column: The input (observed (in green) and predicted (in blue)) to the model at that time step. Third column: Previous 10 trajectories that reside in the memory. Black to white represents most recent to oldest. 26 T REE M EMORY N ETWORKS 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (a) (b) (c) (e) (f) (h) (i) (k) (l) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (d) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (g) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 (j) 20 25 30 Figure 11: Pedestrian trajectories: Correlated activations from baseline memory model. First column: Highest correlated Memory activations for the pattern selected (in colours) and the rest of the activations (in grey) over time. Second column: The input (observed (in green) and predicted (in blue)) to the model at that time step. Third column: Previous 10 trajectories that reside in the memory. Black to white represents most recent to oldest. 27 F ERNANDO ET AL . 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (a) (b) (c) (e) (f) (h) (i) (k) (l) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (d) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 20 25 30 (g) 0.2 0.1 0 -0.1 -0.2 -0.3 0 5 10 15 (j) 20 25 30 Figure 12: Pedestrian trajectories: Memory activations from baseline memory model for correlated inputs. First column: Memory activations over time, the pattern we are considering (in colours) and the rest of the activations (in grey). Second column: The correlated inputs (observed (in green) and predicted (in blue)). Third column: For the input selected in the second column, previous 10 trajectories that reside in the memory. Black to white represents most recent to oldest. 28
9cs.NE
1 On the Estimation and Control of Human Body Composition arXiv:1704.00868v1 [cs.SY] 4 Apr 2017 Mahmood Karimi and Ramesh R. Rao Qualcomm Institute, Calit2, University of California, San Diego La Jolla, CA 92093, USA Email: {makarimi, rrao}@ucsd.edu Abstract—Obesity is a chronic disease that can lead to an increased risk of other serious chronic diseases and even death. We present switching and time-delayed feedback-based modelfree control methods for the dynamic management of body mass and its major components. The estimation of body composition based on human body weight dynamics is proposed using a soft switching-based observer. Additionally, this paper addresses the control allocation problem for optimal body weight management using linear algebraic equivalence of the nonlinear controllers based on dynamic behavior of body composition described in literature. A control allocator system computes the required energy intake and energy expenditure from a controlling range of inputs to track a desired trajectory of body mass by optimizing a weighted quadratic function. Simulation results validate the performance of the proposed controllers and the observer under disturbances in recording energy intake and energy expenditure figures. Keywords: obesity, human body, dynamic model, model-free control, observer design, body composition estimation, constrained control allocation, nonlinear control I. INTRODUCTION Obesity, a serious social and public health problem, is increasing dramatically among the population not only in high-income and developed countries, but also in low-tomiddle-income and poor, developing countries, particularly in urban settings. Obesity and being overweight result from a variety of factors, such as physical inactivity, high level of stress, as well as inappropriate diet. Obesity and being overweight are also associated with heart disease, certain types of cancer, type 2 diabetes, stroke, arthritis, breathing problems, and psychological disorders, such as depression (Laila, 2010), (Sentocnik, AtanasijevicKunc, Drinovec and Pfeifer, 2013). Many studies have been conducted to try and understand the etiology of weight gain and obesity. In (Chow and Hall, 2008), a model based on macronutrient and energy flux balance is presented. A computational model, presented in (Hall, 2010), shows how diet perturbations result in adaptations of fuel selection and energy expenditure that predict body weight and composition changes in both obese and non-obese individuals. In (NavarroBarrientos, Rivera and Collins, 2011), the authors incorporated both physiological and psychological factors in a dynamical model to help develop behavioral interventions. Solving the obesity problem through healthy body weight management has been of interest in the control community (Karimi and Rao, 2015). In (Laila, 2010), closed loop control of body composition was done, and the energy intake into the body is regarded as the input control to the system. Clinical open-loop and closed-loop control efforts for various scenarios were studied in (Sentocnik et al., 2013), and the efficacy of the treatment can, in this way, be significantly improved. Control of body mass or its major components may need daily body composition measurement. Several methods, such as air displacement plethysmography, dual-energy x-ray absorptiometry, bioimpedance spectroscopy, quantitative magnetic resonance and magnetic resonance imaging/spectroscopy, are presented in (Baracos and et al, 2012). These methods are expensive to administer and inconvenient to arrange for frequent measurements. To minimize the associated cost and inconvenience, we propose a technique for estimation of body composition using observer design based on daily measurements of total body weight alone. Feedback linearization (FL) and sliding mode control (SMC) are two widely used control schemes for nonlinear systems. Despite their desirable features, the inability to handle explicit input constraints is a major drawback of using FL/SMC, while the body weight control system described in this research clearly has input constraint–limitations in energy intake and physical activity. To resolve this problem, (Gwak and Masada, 2008) proposed a constrained FL/SMC nonlinear optimal controller that can be represented in a simple constrained linear least-square problem. A precise dynamic model is difficult to build, and the identification of the model parameters has to be individualized and can vary over time. Therefore, a controller that does not require a dynamic model would be a useful and more robust tool than model-based controllers, especially when precise tracking is achievable with small control gains. In addition, measurements of energy intake and energy expenditure are prone to errors and lead to huge disturbances to the system (Hall, 2015). Hence, the robustness of an observer to disturbances is essential for accurate prediction of body composition. This paper, partly presented in (Karimi and Rao, 2014), is based on the dynamic behavior of body weight based on macronutrient intake and the energy balance model. Here, two model-free control algorithms for body weight management using a priori knowledge of control input and a switchingbased PI controller are presented. The energy expenditure of the body is regarded as the input control to the system. Body components are estimated using a dynamic observer based 2 on daily measurement of total body weight supplemented by periodic measurement of individual body components. Next, control allocation problems are formulated using FL/SMC as linear algebraic equations, and input constraints and optimization issues are addressed. Finally, effectiveness and robustness of the proposed algorithms are demonstrated through simulations. II. PROBLEM DEFINITION The major components of human body mass are fat and lean masses and both of these factors as well as total body mass need to be managed. The goal of this work is to propose controllers that suggest daily energy intake or physical activity to track a preferred trajectory of weight/fat reduction or increase. It is suitable for professional athletes, the elderly individuals at risk of Sarcopenia, people with disabilities or sickness and those who need to precisely manage their weight/fat/lean due to medical reasons or less body weight fluctuation. Since the controllers are robust enough, some deviation from their suggestions is tolerable, and good tracking can be still practically achieved. So, the human preference issue is considered implicitly. When it is intended to control fat/lean mass, we need to have daily estimation of fat/lean mass to use in the controller whether the controller is model-free or model-based. Since measurement of fat/lean mass is hard and expensive to do every day, we design an observer to estimate the body compositions using daily total body weight measurement and periodic fat mass measurement. The dynamic model, which encompasses fat and lean masses as system states, is used for observer design. It is assumed that the subject is able to follow the control suggestions and their moods, energy intake and physiological behavior are normal and not pathological. Also, it is assumed that energy intake and expenditure are reasonably precisely measurable. III. BODY WEIGHT DYNAMICS BASED ON THE ENERGY BALANCE MODEL To describe the energy balance in humans, different mathematical models have been developed. A comprehensive threecompartment model is presented in (Sentocnik et al., 2013) and (NavarroBarrientos et al., 2011). The daily energy-balance (EB) equation is described as EB = EI − EE (1) where EI represents the daily energy intake, EE represents the daily energy expenditure, and BM is the body mass of the person expressed in terms of fat (F), lean (L) and extracellular fluid (ECF). BM = F + L + ECF (2) The energy intake is based on the consumed food and its caloric value EI = k1 ci + k2 f i + k3 pi (3) where ci indicates carbohydrate intake, f i and pi indicate the fat intake and the protein intake (all representing model inputs), respectively, and ki s are constant coefficients. To track fat mass, lean mass and extracellular fluid, the following balance equations were used: 1−r dF EB = dt ρF (4) r dL EB = dt ρL (5)    dECF ci ρw ζN a (ECFinit − ECF ) − ζci 1 − = dt Na cib (6) where ρF and ρL are the energy density of the body fat and lean muscle mass respectively, ρw is the density of water, cib is the baseline carbohydrate intake, and the ratio r is the parameter describing the imbalance denoted by EB to the compartments fat mass and lean mass. This parameter, r, was defined in (Hall, 2007) based on the Forbes formula (Forbes, 1987), which was obtained after analyzing body composition data collected from many adults: c ρL r= (7) ; c = kk c+F ρF Forbes found that this relationship was similar whether weight loss was due to diet or exercise. Prolonged exercise or a significant change in the protein intake may cause a different relationship for r. The daily energy expenditure is calculated as follows: EE = [P A] + [T EF ] + [RM R] (8) where P A (input to the model) represents the energy spent on physical activity, T EF is the thermic effect of food, and RM R is the resting metabolic rate needed for basic physiological processes. Equation (8) can be also written as h i EE = [δ·BM ]+[β ·EI]+ K + γL L + ηL L̇ + γF F + ηF Ḟ (9) PA represents the physical activity coefficient where δ = BM and the constant K depends on the initial conditions and is calculated using Equation (1) and Eqs. (4) – (6) in the steady ˙ =0 state: EB = Ḟ = L̇ = ECF Therefore, for the steady-state conditions, Eq. (9) can be rewritten as follows: ¯ − γL L̄ − γF F̄ − P¯A K = (1 − β)EI (10) where the bars over the variables indicate the steady state of the corresponding variables. The obtained model is used for an optimal controller, observer design, and simulations, which will be presented in the following sections. IV. MODEL-FREE CONTROL C ONTROLLER D ESIGN Let the control objective be steering any combination of body composition masses, including total body mass, to a desired reference value/trajectory without using the dynamic model in the controller. It is considered that physical activity 3 is the only control input to the system and that it conforms to a desired shape. The body weight dynamics (4)-(6) can be formed as ẋ = h(x, y, u) = f (x, y) + g(x, y)u (11) y = Cx (12) in which x = [F, L, ECF ], u = δ, y is a controlled output, C is a 1 × 3 matrix and (a)   (1 − a − bF )(EI − [β · EI] − [K + γL L + γF F ])  ])  f (t, x, y) =  (a +hbF )(EI − [β · EI] − [K + γLL + γF Fi  ρw ci ζNa (ECFinit − ECF ) − ζci 1 − cib Na (13)   −(1 − a − bF )BM g(x, y) =  −(a + bF )BM  0 (14) (b) Differentiating the output (12) with respect to t yields ẏ = Cf (x, y) + Cg(x, y)u (15) Introducing from (15) a constant, ḡ, representing the nominal value of g, we can rewrite (15) into the following equation: ẏ = ḡu + [Cf + (Cg − ḡ)u] = ḡu + H(t) (16) where H(t) denotes the total nonlinearity, which is expressed as H(t) = Cf + (Cg − ḡ)u (17) Fig. 1. Controller block diagram: (a) time delayed and (b) switching-based predefined physical activity shape. A possible formula for δ is given by u = δIN C = δ0 + k1 (y0 − y)ξ The parameters δ0 and y0 are the initial values for the δ and y, respectively. To steer the human body to a particular weight, the following algorithm is proposed (see Fig. 1(b)): δ = δIN C The desired error dynamics is defined with an asymptotically stable linear time invariant system as in the following: e˙y = Πey u = ḡ −1 (y˙d − H(t) − Πey ) (19) Note in equation (19) that the time delayed estimation of the total sum of system nonlinearities is used in place of the total sum of system nonlinearities. Namely, H(t) ≈ H(t − ∆) = ẏ(t − ∆) − ḡu(t − ∆) IF δIN C > δP I δ = δP I (18) The linearizing feedback control law results in (20) END, where δP I is a proportional-integral controller as Z u = δP I = k2 ey + k3 ey dt u = δT DC = ḡ (y˙d − H(t − ∆) − Πey ) = u(t − ∆) + ḡ −1 (y˙d − ẏ(t − ∆) − Πey ) (21) The stability condition was shown in (Youcef-Toumi and Wu, 1992). If a specific trajectory for weight loss is desired then, we can address the tracking problem. In this controller, not only the current and previous outputs are used, but the previous input is also considered, which could make it more efficient for tracking purposes. In many circumstances, a modest initial increase in physical activity is preferred at the beginning of the program. Switching-based set-point regulation is an alternative way to move the body weight to a desired value considering the (23) The control parameters are chosen in such a way that δP I is greater than δIN C at the beginning. So, the control action is started with δIN C and then switched to δP I when it is less than δIN C . Combining equations (19) and (20), the time delayed control law (Fig. 1(a)) can be obtained as −1 (22) O BSERVER D ESIGN The state vector containing fat, lean and extra cellular fluid masses is not easy to measure directly every day. Therefore, because of the cost and inconvenience, it is desirable to estimate these from the system input and body weight. The observer is designed to provide real-time estimates of inaccessible dynamical states that might be required for the implementation of control laws. Substituting r from (7) into (4) and (5) leads to ρF dF 1 = (1 − dt 1+ ρL 1 dL = dt 1+ F c F c )EB EB (24) (25) 4 To cope with the non-linearity, the following linear approximation is made 1 ≈ a + bF (26) 1 + Fc Constants a and b must be determined based on the regression. Then, Eqs. (24) and (25) are rewritten regarding the approximation as well as expansion of the EB components obtained from Eq. (1). dF = (1−a−bF )(EI −[δ·BM ]−[β·EI]−[K + γL L + γF F ]) dt (27) dL = (a + bF )(EI − [δ · BM ] − [β · EI] − [K + γL L + γF F ]) ρL dt (28) ρF For observer design, we arrange the obtained system of differential equations of (27), (28) and (6) as the following class of nonlinear systems: ẋ = h(t, x, y, u) = Ax + Bu + Φ(t, x, y, u) (29) y = Cx (30) where x = [F, L, ECF ] and A is a constant matrix. It can be shown that Φ(t, x, y, u) is Lipschitz i.e. kΦ − Φ̂k ≤ λk(x − x̂)k (31) and designing an observer for Eq. (29) is feasible if the pair (A,C) is observable.   A= −(1−a)γF +bK ρF −aγF −bK ρL L − (1−a)γ ρF 0 0 −aγL ρL C = [1 1 1] 0 0 ρw −N a ζN a    (32) (33) 2 λ + ǫ0 G(y−C x̂)+G1 (y−C x̂) x̂˙ = Ax̂+Bu+Φ(t, x̂, y, u)+ ||C||2 (34) where ǫ0 ≥ −λ2 and G1 is chosen such that A − G1 C is Hurwitz, and G is the observer gain matrix. Let the estimation error x̃ = x − x̂ (35) in which P0 is positive definite matrix. Then, by considering the following Lyapunov function candidate (36) the observer gain G is obtained as G = P0−1 C T /2 ǫ0 = −λ2 the following soft switching observer is presented (see Fig. 2) x̂˙ = Ax̂+Bu+Φ(t, x̂, y, u)+(1−q)G1 (y1 −C1 x̂)+qG2 (y2 (jT )−C2 x̂) (38) x̂˙ = f (x̂, y, u)+g(x̂, y)u+(1−q)G1 (y1 −C1 x̂)+qG2 (y2 (jT )−C2 x̂) (39) y1 = C1 x, y2 (jT ) = C2 x(jT ), j = 1, 2, ... (37) In reality, it may not be possible to measure precisely both energy intake and energy expenditure every day. To overcome this problem, it is assumed that the measurement of body components is performed periodically. Hence, in Eq. (34) with (40) in which C1 = [1 1 1], C2 = 1, Gi s are observer gain matrices, T is the period that measurement of components is performed, and 0 ≤ q ≤ 1 is a weighting factor for soft switching: q = exp(− The Luenberger observer is well-known and widely used for time-invariant linear systems in order to estimate the state vector when that is not directly measurable. Consider the following extended Luenberger observer for the system (29)(30) (Pagilla and Zhu, 2004): V (x̃) = x̃T P0 x̃ Fig. 2. Proposed observer block diagram t − jT ), kq jT ≤ t < (j + 1)T (41) kq is appropriately determined. Using intermittent measurement of full states in addition to daily body weight measurement, the degree of observability would be increased. S IMULATION R ESULTS In this section, we present simulation results based on our proposed controllers and observers. We use the following coefficients and parameters of the dynamic system (Sentocnik et al., 2013). k1 = 4 kcal/g, k2 = 9 kcal/g, k3 = 4 kcal/g, ρF = 9400 kcal(kg/d), ρL = 1800 kcal/(kg/d), kk = 10.4 kg, ρw = 1 kg/l, N a = 3.22 kg/l, ζN a = 3 kg/d/l, ζci = 4 kg/d, β = 0.24, γL = 22 kcal/kg, ηL = 230 kcal/(kg/d), γF = 3.2 kcal/kg, ηF = 180 kcal/(kg/d). The control objective in each simulation is tracking or regulation of body or fat masses with initial conditions ˆ ] = [30, 45, 25, 31, 44, 26]. [F, L, ECF, F̂ , L̂, ECF The influence of EI = 3492(1 + 0.02 ∗ rand), δ = δ(1 − 0.2 ∗ rand) disturbances on controllers and the soft switching observer are investigated in the following subsections. The variable rand is a MATLAB function that generates uniformly distributed pseudo-random numbers between 0 and 1. The coefficient of 0.2 for disturbance in the physical activity could 5 Fat 40 20 100 400 100 200 300 400 25 0 100 100 200 300 400 500 real estimated 90 80 70 0 100 200 300 400 500 100 200 300 400 500 100 200 300 400 500 100 200 300 400 500 40 30 0 26 500 25.5 20 0 0 50 500 ECF ECF 300 40 30 0 26 Body Mass 200 Lean Lean 0 0 50 Body Mass Fat 40 25 24 0 100 real estimated 90 80 70 0 100 Time (day) 200 300 400 500 Time (day) Fig. 3. The fat (F), lean (L) and extracellular fluid (ECF): time delayed body mass controller Fig. 5. The fat (F), lean (L) and extracellular fluid (ECF): switching-based body mass controller 15 12 δ (kCal / kg) δ (kCal / kg) 10 10 5 8 6 4 0 0 100 200 300 400 500 Time (day) 2 0 100 200 300 400 500 Time (day) Fig. 4. Control input δ: time-delayed body mass controller Fig. 6. Control input δ: switching-based body mass controller be up to 200 kcal of energy expenditure in this case. Since EI is multiple times greater than physical activity (δ · BM ), the coefficient of rand in EI is chosen much less frequently than the coefficient of rand in δ. For the observer (39), measurement of the body components is done every 90 days with the following parameters hereafter: G1 = [1.9 1.2 − 0.3], G2ii = [0.8 1 − 0.2], kq = 5 controller error is small in the presence of disturbances, which implies good performance of the controller. The control input δ in Fig. 4 has a dome shape using a time-delayed controller for a cubic polynomial trajectory. The results of the switching-based controller are presented in Figs. 5 through 6. The control parameters chosen for this controller are: δ0 = 4, k1 = 0.5, ξ = 1, k2 = 0.2, k3 = 0.4 It is seen that the desired body weight is achieved even in the presence of disturbances. The control input δ in Fig. 6 has a hat ( ˆ ) shape that is different from the dome shape of the time-delayed controller. We find that although the maximum of the dome shape is lower than the maximum of the hat shaped exercise profile, the desired weight can be achieved. Body mass controller Next, we address how to control body weight according to a desired cubic polynomial function using the controller (21) even in the presence of disturbances. The initial and final values of the body weight are 100 kg with slope -0.05 and 70 kg with slope 0, respectively. The control parameters considered in this simulation are ḡ = 0.1 and Π = 10. Since the controlled output is body weight and it is measurable directly, controlling based on observer is not needed. The results of the body weight control are shown in Figs. 3–4. The lean, fat and ECF masses are bounded without fluctuation while body weight is being controlled (Fig. 3). The Fat mass controller Here, the objective is to control fat mass to bring it to a desired cubic polynomial function using the time-delayed controller. The initial and final values of the fat mass are 6 Fat 30 10 20 8 100 ECF 300 400 500 40 35 0 26 Body Mass 200 δ (kCal / kg) Lean 10 0 45 100 200 300 400 6 4 2 500 0 0 25.5 100 200 300 400 500 Time (day) 25 0 100 100 200 300 400 500 200 300 400 500 Fig. 9. Control input δ: time delayed fat mass controller 90 real estimated 80 70 0 100 Time (day) Fig. 7. The fat (F), lean (L) and extracellular fluid (ECF): time delayed fat mass controller Fat 30 10 0 45 0.5 Lean fat lean ECF ECF 0 −0.5 100 200 300 400 500 Time (day) Fig. 8. Observer errors: Eq. (39) 100 200 300 400 500 100 200 300 400 500 100 200 300 400 500 200 300 400 500 40 35 0 26 Body Mass Observer Errors (Kg) 1 −1 0 20 25.5 25 0 100 90 real estimated 80 70 0 100 Time (day) Fig. 10. The fat (F), lean (L) and extracellular fluid (ECF): switching-based fat mass controller 1 Observer Errors (Kg) 30 kg with slope -0.02 and 15 kg with slope 0, respectively. All controller and observer parameters are the same as the 1st simulation for body mass control. Since the controlled output is fat mass and direct measurements are only available periodically, observer-based control is necessary. Simulation results of the controller and observer (39) are represented in Figs 7–9. In addition to the decreasing and bounded body composition masses in Fig. 7, small observer errors in Fig. 8 are achieved. There are some sharp changes in fat mass error and spikes in δ (see Fig. 9), which come from rapid observer corrections due to periodic measurement. The last simulation shows the results of a switching-based controller for the regulation of fat mass using the observer of (39) depicted in Figs. 10–12. The initial and final values of the fat mass are 30 kg and 15 kg, respectively. All parameters are similar to the parameters of the same controller for body mass, but k2 = 0.7. In summary, observer-based time delayed control methods perform well in the trajectory tracking problem as shown in the results of the fat mass controller where at least one of the body component measurements is needed. In the case of total body fat lean ECF 0.5 0 −0.5 −1 0 100 200 300 Time (day) Fig. 11. Observer errors: Eq. (39) 400 500 7 For sliding mode control (SMC), instead of setting the design surface temperature as the output, the sliding surfaces R S = ey + λsm ey dt are selected as the outputs. With only one differentiation 9 δ (kCal / kg) 8 7 6 Ṡ = ėy + λsm ey = ẏ − ẏdes + λsm ey 5 = Cf (x, y) + Cg(x, y)u − ẏdes + λsm ey 4 (50) = −Γ · sgn(S) 3 0 100 200 300 400 500 Time (day) [Cg(x, y)] u = [ẏdes − λsm ey − Cf (x, y) − Γ · sgn(S)] (51) Fig. 12. Control input δ: switching-based fat mass controller mass control, the observer is not necessary in the time delayed controller because the body weight is directly measurable. Also, a switching-based controller works well for set-point regulation, and the same discussion is valid for requiring an observer for this controller. V. CONTROL ALLOCATION ẋ = h(t, x, y, u) = f (t, x, y) + g(x, y)u (42) y = Cx (43) in which x = [F, L, ECF ], u = [EI, δ], y is a controlled output, C is a 1 × 3 matrix and  (1 − β)(1 − a − bF ) g(x, y) =  (1 − β)(a + bF ) ρw ζ z1 Na ci cib  −(1 − a − bF )BM −(a + bF )BM  0 (44) (45) It is presumed that the carbohydrate energy intake is proportional with total energy intake. k1 ci = z1 EI (46) Differentiating the output (43) with respect to t yields ẏ = Cf (x, y) + Cg(x, y)u (47) Let the desired dynamics for the feedback linearization be defined as ėy + λf l ey = 0 or ẏ = ẏdes − λf l ey (48) Then, substituting (48) into (47) results in [Cg(x, y)] u = [ẏdes − λf l ey − Cf (x, y)] 1 us = arg min( (u − ū)T W (u − ū)) subject to u 2 Au = b (52) ui min ≤ u ≤ ui max , i = 1, 2 where A = Cg(x, y) C ONSTRAINED O PTIMAL C ONTROL D ESIGN Let the control objective be steering any combination of body composition masses, such as body mass, to a desired trajectory. It is assumed that both energy intake and physical activity are the control inputs to the system. This shows overactuation and there are an infinite number of solutions. Hence, a control allocation procedure is required to find the best solution that fits within the objective and limitations of the problem. The body weight dynamics (4)-(6) can be formed as   −(1 − a − bF ) [K + γL L + γF F ]) f (t, x, y) =  −(a + bF ) [K + γL L + γF F ])  ρw [ζNa (ECFinit − ECF ) − ζci ] Na Now approaching the system as a control allocation problem, we define the optimization problem as (49) b= ( ẏdes − λf l ey − Cf (x, y) for F BL ẏdes − λsm ey − Cf (x, y) − Γ · sgn(S) for SM C (53) The objective function in (52) is given by the quadratic function of the control inputs in which W is a weighting matrix. Since A is a full row rank matrix and the dimension of u is larger than the number of equations, the problem is redundant and has an infinite number of solutions. Now, the aforementioned control allocation problem with input limitation is solved using the fmincon optimization solver in MATLAB. The ui min and ui max should be within bounds so that the allocation problem becomes feasible. The threshold values defining the bounds could depend on various factors, such as physical limits and initial and boundary conditions. Logically, to stop an increase in body mass, the maximum ¯ at the allowable amount of energy intake would be EI beginning of the program. It means that the first component ¯ at the of us = [us1 us2 ] should be equal to or less than EI ¯ initial time that is us1 (t = 0) ≤ EI. Hence, the minimum value for energy intake changes over time and is proposed as ¯ − ρ1 (1 − ρ2 exp(−t/τ )), u1 max = EI ¯ (54) u1 min = EI where the parameters ρ1 , ρ2 and τ are for determining lower bound, upper bound and speed of convergence from upper bound to lower bound of us1 to design appropriate behavior. ¯ − ρ1 (1 − At the beginning of treatment, EImin is equal to EI ¯ ρ2 ) and after the passing some time, it is EI − ρ1 . S IMULATION R ESULTS In this section, we consider simulations that rely on the proposed allocated controller for comparative analysis and performance investigation. The control objective in each simulation is computing energy intake and physical activity coefficients using (52) to track a desired cubic polynomial 8 400 100 200 300 400 500 Lean 50 100 200 300 400 100 200 300 400 500 80 100 200 300 400 500 40 30 0 25 500 90 70 0 10 0 500 24.8 24.6 0 100 100 200 300 400 500 24.6 0 100 100 200 300 400 500 70 0 100 200 300 400 500 (b) 6 5 5 δ (kCal / kg) 6 4 3 2 1 1 100 200 300 400 500 3000 3200 3100 3000 100 200 300 400 500 2900 0 100 (a) 200 300 400 500 Time (day) (b) 0 0 100 200 Fig. 15. Energy Intake for ρ1 = 500: (a) FL and (b) SMC VI. CONCLUSION 7 2 3100 3300 80 (a) 3 3200 3400 90 Time (day) 4 3300 Time (day) Time (day) 7 δ (kCal / kg) 3500 3400 2900 0 24.8 Fig. 13. The fat (F), lean (L) and extracellular fluid (ECF) for ρ1 = 500: (a) FL and (b) SMC 0 0 3600 3500 Energy Intake (kCal) 300 20 Energy Intake (kCal) 200 ECF Lean ECF 100 40 30 0 25 Body Mass Fat 20 10 0 50 3600 30 Body Mass Fat 30 300 Time (day) Time (day) (a) (b) 400 500 Fig. 14. Physical Activity Coefficient (δ) for ρ1 = 500: (a) FL and (b) SMC function of total body mass in the presence of uncertainty, noise and disturbances. The initial and final values of the body weight are 100 kg with slope -0.05 and 70 kg with slope 0, respectively. The control parameters considered in this simulation are λf l = 0.7, λsm = 0.1, W11 = 0.2, W22 = 1000, Wij = ¯ = 3500 0, Γ = 0.01, ū = [3500 0], ρ2 = 1, τ = 5, EI For true comparison, the bound of tracking errors for both controllers are considered to be equal so that λsm would be 7 times greater than λf l . The applied uncertainty to the system and noise to the measured daily body weight are r = (1+0.5∗rand)∗r and bm = bm+0.1∗rand, respectively and EI = 3492(1 + 0.01 ∗ rand) and δ = δ(1 − 0.1 ∗ rand) disturbances inserted in to the inputs. The rand is a MATLAB function that generates uniformly distributed pseudo-random numbers between 0 and 1. Here, the results of u1 min = EImin = 3000 (i.e. ρ1 = 500) is considered and the results are given in Figs. 13–15. As long as the energy intake meets the lower bound, increases in the physical activity coefficient occur (see Figs. 14 and 15). The sliding mode controller shows in Fig. 14 a significantly smaller increase in δ than the feedback linearization one. Instead of total body mass, we can consider any combination of body composition for control purposes by appropriate determination of matrix C in Eq. (12). Similar results are obtained when the fat mass is considered to be controlled. This paper has presented two model-free controllers for human weight management with physical activity as the control input. The first method is based on time-delayed feedback of the system input for approximate linearization and the second one is a switching-based controller. To estimate the daily body composition (fat, lean and extracellular fluid), a soft switchingbased observer using human body weight dynamics has been proposed. This is based on daily measurements of body weight and periodic measurement of whole body composition. This paper also has addressed weight management as a control allocation problem with energy intake and physical activity coefficients as the two inputs. Based on dynamic behavior of body composition, feedback linearization and sliding mode controllers have been used to form linear algebraic equivalence of the nonlinear controllers. Then, an input-constrained nonlinear optimal controller was designed using the constrained linear least squares method. Moreover, a subject may prefer that the start point of energy intake or expenditure is close to the current one. So this preference has been considered in the model-free set point control and optimal-model-based control. Also, it could be imposed through the reference trajectory planning of the model-free tracking control. 9 R EFERENCES Baracos, V. and et al (2012), ‘Advances in the science and application of body composition measurement’, Journal of Parenteral and Enteral Nutrition 36(1), 96–107. Chow, C. C. and Hall, K. D. (2008), ‘The dynamics of human body weight change’, PLOS Computational Biology 4(3). Forbes, G. (1987), ‘Lean body mass-body fat interrelationships in humans’, Nutr Rev. 45(8), 225–231. Gwak, K.-W. and Masada, G. (2008), ‘Nonlinear optimal control of an inputconstrained and enclosed thermal processing system’, International Journal of Control, Automation, and Systems, 6(2), 160–170. Hall, K. (2007), ‘Body fat and fat-free mass inter-relationships: Forbes’s theory revisited’, Br J Nutr. 97(6), 1059–1063. Hall, K. (2010), ‘Predicting metabolic adaptation, body weight change, and energy intake in humans’, Am J Physiol Endocrinol Metab 298, E449– E466. Hall, K. (2015), Computational modelling of energy metabolism and body composition dynamics, in ‘Translational Research Methods for Diabetes, Obesity and Cardiometabolic Drug Development’, Springer London, pp. 265–282. Karimi, M. and Rao, R. R. (2014), Human body composition estimation and model-free control design for weight management, in ‘ASME 2014 Dynamic Systems and Control Conference’, San Antonio, Texas. Karimi, M. and Rao, R. R. (2015), Optimal manual control for heart rate tracking during treadmill exercises, in ‘ASME 2015 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference’, Boston, MA. Laila, D. S. (2010), A note on human body weight dynamics and control based on the macronutrient and energy flux balance, in ‘American Control Conference’, Baltimore, MA, pp. 3580–3585. NavarroBarrientos, J. E., Rivera, D. E. and Collins, L. M. (2011), ‘A dynamical model for describing behavioural interventions for weight loss and body composition change’, Mathematical and Computer Modelling of Dynamical Systems 17(2), 183–203. Pagilla, P. and Zhu, Y. (2004), Controller and observer design for lipschitz nonlinear systems, in ‘American Control Conference’, Boston, MA, pp. 2379–2304. Sentocnik, T., AtanasijevicKunc, M., Drinovec, J. and Pfeifer, M. (2013), ‘Efficacy analysis of a body-mass-reduction treatment using mathematical modelling’, Mathematical and Computer Modelling of Dynamical Systems . Youcef-Toumi, K. and Wu, S.-T. (1992), ‘Input/output linearization using time delay control’, ASME J. Dyn. Syst. Meas. Control 114(1), 10–19.
3cs.SY
Subquadratic Algorithms for Succinct Stable Matching arXiv:1510.06452v5 [cs.DS] 20 Dec 2016 Marvin Künnemann∗ Daniel Moeller†‡ Ramamohan Paturi†‡ Stefan Schneider‡ Department of Computer Science and Engineering UC, San Diego La Jolla, CA 92093 December 21, 2016 Abstract We consider the stable matching problem when the preference lists are not given explicitly but are represented in a succinct way and ask whether the problem becomes computationally easier and investigate other implications. We give subquadratic algorithms for finding a stable matching in special cases of natural succinct representations of the problem, the d-attribute, d-list, geometric, and single-peaked models. We also present algorithms for verifying a stable matching in the same models. We further show that for d = ω(log n) both finding and verifying a stable matching in the d-attribute and d-dimensional geometric models requires quadratic time assuming the Strong Exponential Time Hypothesis. This suggests that these succinct models are not significantly simpler computationally than the general case for sufficiently large d. 1 Introduction The stable matching problem has applications that vary from coordinating buyers and sellers to assigning students to public schools and residents to hospitals [21, 29, 37]. Gale and Shapley [17] proposed a quadratic time deferred acceptance algorithm for this problem which has helped clear matching markets in many real-world settings. For arbitrary preferences, the deferred acceptance algorithm is optimal and even verifying that a given matching is stable requires quadratic time [33, 38, 19]. This is reasonable since representing all participants’ preferences requires quadratic space. However, in many applications the preferences are not arbitrary and can have more structure. For example, top doctors are likely to be universally desired by residency programs and students typically seek highly ranked schools. In these cases participants can represent their preferences succinctly. It is natural to ask whether the same quadratic time bounds apply with compact and structured preference models that have subquadratic representations. This will provide a more nuanced understanding of where the complexity lies: Is stable matching inherently complex, or is the complexity merely a result of the large variety of possible preferences? To this end, we ∗ Part of this research was conducted while being affiliated with Max Planck Institute for Informatics, Saarbrücken, Germany and visiting the Simons Institute for the Theory of Computing, Berkeley. † This research was partially supported by the Army Research Office grant number W911NF-15-1-0253. ‡ This research is supported by the Simons Foundation and was partially conducted while visiting the Simons Institute for the Theory of Computing, Berkeley. This research is supported by NSF grant CCF-1213151 from the Division of Computing and Communication Foundations. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation. The conference version is available at Springer via http://dx.doi.org/10.1007/978-3-319-34171-2 21 1 examine several restricted preference models with a particular focus on two originally proposed by Bhatnagar et al. [8], the d-attribute and d-list models. Using a wide range of techniques we provide algorithms and conditional hardness results for several settings of these models. In the d-attribute model, we assume that there are d different attributes (e.g. income, height, sense of humor, etc.) with a fixed, possibly objective, ranking of the men for each attribute. Each woman’s preference list is based on a linear combination of the attributes of the men, where each woman can have different weights for each attribute. Some women may care more about, say, height whereas others care more about sense of humor. Men’s preferences are defined analogously. This model is applicable in large settings, such as online dating systems, where participants lack the resources to form an opinion of every other participant. Instead the system can rank the members of each gender according to the d attributes and each participant simply needs to provide personalized weights for the attributes. The combination of attribute values and weights implicitly represents the entire preference matrix. Bogomolnaia and Laslier [9] show that representing all possible n × n preference matrices requires n − 1 attributes. Therefore it is reasonable to expect that when d ≪ n − 1, we could beat the worst case quadratic lower bounds for the general stable matching problem. In the d-list model, we assume that there are d different rankings of the men. Each women selects one of the d lists as her preference list. Similarly, each man chooses one of d lists of women as his preference list. This model captures the setting where members of one group (i.e. student athletes, sorority members, engineering majors) may all have identical preference lists. Mathematically, this model is actually a special case of the d-attribute model where each participant places a positive weight on exactly one attribute. However, its motivation is distinct and we can achieve improved results for this model. Chebolu et al. prove that approximately counting stable matchings in the d-attribute model for d ≥ 3 is as hard as the general case [12]. Bhatnagar et al. showed that sampling stable matchings using random walks can take exponential time even for a small number of attributes or lists but left it as an open question whether subquadratic algorithms exist for these models [8]. We show that faster algorithms exist for finding a stable matching in some special cases of these models. In particular, we provide subquadratic algorithms for the d-attribute model, where all values and weights are from a small set, and the one-sided d-attribute model, where one side of the market has only one attribute. These results show we can achieve meaningful improvement over the general setting for some restricted preferences. While we only provide subquadratic algorithms to find stable matchings in special cases of the attribute model, we have stronger results concerning verification of stable matchings. We demonstrate optimal subquadratic stability testing algorithms for the d-list and boolean d-attribute settings as well as a subquadratic algorithm for the general d-attribute model with constant d. These algorithms provide a clear distinction between the attribute model and the general setting. Moreover, these results raise the question of whether verifying and finding a stable matching are equally hard problems for these restricted models, as both require quadratic time in the general case. Additionally, we show that the stable matching problem in the d-attribute model for d = ω(log n) cannot be solved in subquadratic time under the Strong Exponential Time Hypothesis (SETH) [23, 25]. We show SETH-hardness for both finding and verifying a stable matching and for checking if a given pair is in any or all stable matchings, even when the weights and attributes are boolean. This adds the stable matching problem to a growing list of SETH-hard problems, including Fréchet distance [10], edit distance [6], string matching [1], k-dominating set [34], orthogonal vectors [42], and vector domination [24]. Thus the quadratic time hardness of the stable matching problem in the general case extends to the more restricted and succinct d-attribute model. This limits the 2 space of models where we can hope to find subquadratic algorithms. We further present several results in related succinct preference areas. Single-peaked preferences are commonly used to model preferences in social choice theory because of their simplicity and because they often approximate reality. Essentially, single-peaked preferences require that everyone agree on a common spectrum along which all alternatives can be ranked. However, each individual may have a different ideal choice and prefers the “closest” alternatives. A typical example is the political spectrum where candidates fall somewhere between liberal and conservative. In this setting, voters tend to prefer the candidates that are closer to their own ideals. As explained below, these preferences can be succinctly represented. Bartholdi and Trick [7] present a subquadratic time algorithm for stable roommates (and stable matching) with narcissistic, single-peaked preferences. In the narcissistic case, the participants are located at their own ideals. This makes sense in some applications but is not always realistic. We provide a subquadratic algorithm to verify if a given matching is stable in the general single-peaked preference model. Chung uses a slightly different model of single-peaked preferences where a stable roommate matching always exists [13]. In this model the participants would rather be unmatched than matched with someone further away from their ideal than they are themselves, leading to incomplete preference lists. We extend our algorithms and lower bounds for the attribute model to the geometric model where preference orders are formed according to euclidean distances among a set of points in multi-dimensional space. Arkin et al. [5] derive a subquadratic algorithm for stable roommates with narcissistic geometric preferences in constant dimensions. Our algorithms do not require the preferences to be narcissistic. It is worth noting that all of our verification and hardness results apply to the stable roommates problem as well. This problem is identical to stable matching except we remove the bipartite distinction between the participants [21]. Unlike with bipartite stable matching, there need not always exist a stable roommate matching. However Irving discovered an algorithm that produces a stable matching or identifies that none exists in quadratic time [26]. Since finding a stable roommate matching is strictly harder than finding a stable matching, this is also optimal. Likewise, verification is equally hard for both stable roommates and stable matching, as we can simply duplicate every participant and treat the roommate matching as bipartite. Therefore, our results show that verification can be done more efficiently for the stable roommates problem when the preferences are succinct. Finally, we address the issue of strategic behavior in these restricted models. It is often preferable for a market-clearing mechanism to incentivize truthful behavior from the participants so that the outcome faithfully captures the optimal solution. Particularly in matching markets, this objective complements the desire for a stable matching where participants have incentives to cooperate with the outcome. Roth [36] showed that there is no strategy proof mechanism to find a stable matching in the general preferences setting. Additionally, if a mechanism outputs the man-optimal stable matching, the women can manipulate it to obtain the woman-optimal solution by truncating their preference lists [36, 18]. Even if the women are required to rank all men, they can still achieve more preferable outcomes in some instances [41, 30]. However, in the d-attribute, d-list, single-peaked, and geometric preference models, there are considerably fewer degrees of freedom for preference misrepresentation. Nevertheless, we show that there is still no strategy proof mechanism to find a stable matching for any of these models with d ≥ 2 and non-narcissistic preferences. Dabney and Dean [14] study an alternative succinct preference representation where there is a canonical preference list for each side and individual deviations from this list are specified separately. They provide an adaptive O(n + k) time algorithm for the special one-sided case, where k is the number of deviations. 3 2 Summary of Results Section 4.1 gives an O(C 2d n(d + log n)) time algorithm for finding a stable matching in the dattribute model if both the attributes and weights are from a set of size at most C. This gives a 1 strongly subquadratic algorithm (i.e. O(n2−ε ) for ε > 0) if d < 2 log C log n. Section 4.2 considers an asymmetric case, where one side of the matching market has d attributes, while the other side has a single attribute. We allow both the weights and attributes to be arbitrary real values. Our algorithm for finding a stable matching in this model has time complexity Õ(n2−1/⌊d/2⌋ ), which is strongly subquadratic for constant d. In Section 5.1 we consider the problem of verifying that a given matching is stable in the d-attribute model with real attributes and weights. The time complexity of our algorithm is Õ(n2−1/2d ), which is again strongly subquadratic for constant d. Section 5.2 gives an O(dn) time algorithm for verifying a stable matching in the d-list model. This is linear in its input size and is therefore optimal. 2 In Section 5.3 we give a randomized Õ(n2−1/O(c log (c)) ) time algorithm for d = c log n for verifying a stable matching in the d-attribute model when both the weights and attributes are boolean. This algorithm is strongly subquadratic for d = O(log n). In Section 6 we give a conditional lower bound for the three problems of finding and verifying a stable matching in the d-attribute model as well as the stable pair problem. We show that there is no strongly subquadratic algorithm for any of these problems when d = ω(log n) assuming the Strong Exponential Time Hypothesis. For the stable pair problem we give further evidence that even nondeterminism does not give a subquadratic algorithm. Finally in Section 7 we consider the related preference models of single-peaked and geometric preferences. We extend our algorithms and lower bounds for the attribute model to the geometric model and give an O(n log n) algorithm for verifying a stable matching with single-peaked preferences. 3 Preliminaries A matching market consists of a set of men M and a set of women W with |M | = |W | = n. We further have a permutation of W for every m ∈ M , and a permutation of M for every w ∈ W , called preference lists. Note that representing a general matching market requires size Ω(n2 ). For a perfect bipartite matching µ, a blocking pair with respect to µ is a pair (m, w) 6∈ µ where m ∈ M and w ∈ W , such that w appears before µ(m) in m’s preference list and m appears before µ(w) in w’s preference list. A perfect bipartite matching is called stable if there are no blocking pairs. In settings where ties in the preference lists are possible, we consider weakly stable matchings where (m, w) is a blocking pair if and only if both strictly prefer each other to their partner. For simplicity, we assume all preference lists are complete though our results trivially extend to cases with incomplete lists. Gale’s and Shapley’s deferred acceptance algorithm [17] works as follows. While there is an unmatched man m, have m propose to his most preferred woman who has not already rejected him. A woman accepts a proposal if she is unmatched or if she prefers the proposing man to her current partner, leaving her current partner unmatched. Otherwise, she rejects the proposal. This process finds a stable matching in time O(n2 ). A matching market in the d-attribute model consists of n men and n women as before. A participant p has attributes Ai (p) for 1 ≤ i ≤ d and weights αi (p) for Pd 1 ≤ i ≤ d. For a man m and woman w, m’s value of w is given by valm (w) = hα(m), A(w)i = i=1 αi (m)Ai (w). m ranks the 4 P women in decreasing order of value. Symmetrically, w’s value of m is valw (m) = di=1 αi (w)Ai (m). Note that representing a matching market in the d-attribute model requires size O(dn). Unless otherwise specified, both attributes and weights can be negative. A matching market in the d-list model is a matching market where both sides have at most d distinct preference lists. Describing a matching market in this model requires O(dn) numbers. Throughout the paper, we use Õ to suppress polylogarithmic factors in the time complexity. 4 Finding Stable Matchings 4.1 Small Set of Attributes and Weights We first present a stable matching algorithm for the d-attribute model when the attribute and weight values are limited to a set of constant size. In particular, we assume that the number of possible values for each attribute and weight for all participants is bounded by a constant C. Algorithm 1: Small Constant Attributes and Weights Group the women into sets Si with a set for each of the C ′ = O(C 2d ) types of women. (O(C d ) possible attribute values and O(C d ) possible weight vectors.) Associate an empty min-heap hi with each set Si . for each man m do Create m’s preference list of sets Si . index(m) ← 1 while there is a man m who is not in any heap do Let Si be the index(m) set on m’s list. if |hi | < |Si | then hi . insert(m) else if valSi (m) > valSi (hi .min) then hi . delete min() hi . insert(m) index(m) ← index(m) + 1 ′ for i = 1 to S C do µ ← µ Arbitrarily pair women in Si with men in hi . return µ Theorem 1. There is an algorithm to find a stable matching in the d-attribute model with at most a constant C distinct attribute and weight values in time O(C 2d n(d + log n)). Proof. Consider Algorithm 1. First observe that each man is indifferent between the women in a given set Si because each woman has identical attribute values. Moreover, the women in a set Si share the same ranking of the men, since they have identical weight vectors. Therefore, since we are looking for a stable matching, we can treat each set of women Si as an individual entity in a many to one matching where the capacity for each Si is the number of women it contains. With these observations, the stability follows directly from the stability of the standard deferred acceptance algorithm for many-one stable matching. Indeed, each man proposes to the sets of women in the order of his preferences and each set of women tentatively accepts the best proposals, holding onto no more than the available capacity. The grouping of the women requires O(C 2d + dn) time to initialize the groups and place each woman in the appropriate group. Creating the men’s preference lists requires O(dC 2d n) time 5 to evaluate and sort the groups of women for every man. The while loop requires O(C 2d n(d + log n)) time since each man will propose to at most C 2d sets of women and each proposal requires O(d + log n) time to evaluate and update the heap. This results in an overall running time of O(C 2d n(d + log n)). 1 As long as d < 2 log C log n, the time complexity in Theorem 1 will be subquadratic. It is worth noting that the algorithm and proof actually do not rely on any restriction of the men’s attribute and weight values. Thus, this result holds whenever one side’s attributes and weight values come from a set of constant size. 4.2 One-Sided Real Attributes In this section we consider a one-sided attribute model with real attributes and weights. In this model, women have d attributes and men have d weights, and the preference list of a man is given by the weighted sum of the women’s attributes as in the two-sided attribute model. On the other hand there is only one attribute for the men. The women’s preferences are thus determined by whether they have a positive or negative weight on this attribute. For simplicity, we first assume that all women have a positive weight on the men’s attribute and show a subquadratic algorithm for this case. Then we extend it to allow for negative weights. To find a stable matching when the women have a global preference list over the men, we use a greedy approach: process the men from the most preferred to the least preferred and match each man with the highest unmatched woman in his preference list. This general technique is not specific to the attribute model but actually works for any market where one side has a single global preference list. (e.g. [14] uses a similar approach for their algorithm.) The complexity lies in repeatedly finding which of the available women is most preferred by the current top man. This leads us to the following algorithm: for every woman w consider a point with A(w) as its coordinates and organize the set of points into a data structure. Then, for the men in order of preference, query the set of points against a direction vector consisting of the man’s weight and find the point with the largest distance along this direction. Remove that point and repeat. The problem of finding a maximal point along a direction is typically considered in its dual setting, where it is called the ray shooting problem. In the ray shooting problem we are given n hyperplanes and must maintain a data structure to answer queries. Each query consists of a vertical ray and the data structure returns the first hyperplane hit by that ray. The relevant results are in Lemma 1 which follows from several papers for different values of d. For an overview of the ray shooting problem and related range query problems, see [3]. Lemma 1 ([22, 16, 2, 32]). Given an n point set in Rd for d ≥ 2, there is a data structure for ray shooting queries with preprocessing time Õ(n) and query time Õ(n1−1/⌊d/2⌋ ). The structure supports deletions with amortized update time Õ(1). For d = 1, queries can trivially be answered in constant time. We use this data structure to provide an algorithm when there is a global list for one side of the market. Lemma 2. For d ≥ 2 there is an algorithm to find a stable matching in the one-sided d-attribute model with real-valued attributes and weights in time Õ(n2−1/⌊d/2⌋ ) when there is a single preference list for the other side of the market. Proof. For a man m, let dim(m) denote the index of the last non-zero weight, i.e. αdim(m)+1 (m) = · · · = αd (m) = 0. We assume dim(m) > 0, as otherwise m is indifferent among all women and we can pick any woman as µ(m). We assume without loss of generality αdim(m) (m) ∈ {−1, 1}. For 6 ′ each d′ such that 1 ≤ d′ ≤ d we build a data structure consisting of n hyperplanes in Rd . For each woman w, consider the hyperplanes ) ( ′ −1 dX (1) Ai (w)xi − Ad′ (w) Hd′ (w) = xd′ = i=1 and for each d′ preprocess the set of all hyperplanes according to Lemma 1. Note that Hd′ (w) is the dual of the point (A1 (w), . . . , Ad′ (w)). For a man m we can find his most preferred partner by querying the dim(m)-dimensional data structure. Let s = αdim(m) (m). Consider a ray r(m) ∈ Rdim(m) originating at αdim(m)−1 (m) α1 (m) ,...,− , −s · ∞) (2) s s in the direction (0, . . . , 0, s). If αdim(m) = 1 we find the lowest hyperplane intersecting the ray, and if αdim(m) = −1 we find the highest hyperplane. We claim that the first hyperplane r(m) hits corresponds to m’s most preferred woman. Let woman w be preferred over woman w′ , Pdim(m) Pdim(m) i.e. valm (w) = Ai (w)αi (m) ≥ Ai (w′ )αi (m) = valm (w′ ). Since the ray r(m) is i=1 i=1 vertical in coordinate xd′ , it is sufficient to evaluate the right-hand side of the definition in equation 1. Indeed we have valm (w) ≥ valm (w′ ) if and only if (− dim(m)−1 X i=1 αi (m) −Ai (w) − Adim(m) (w) ≤ s dim(m)−1 X i=1 −Ai (w′ ) αi (m) − Adim(m) (w′ ) s (3) −Ai (w′ ) αi (m) − Adim(m) (w′ ) s (4) when s = 1 and dim(m)−1 X i=1 αi (m) −Ai (w) − Adim(m) (w) ≥ s dim(m)−1 X i=1 when s = −1. Note that the query ray is dual to the set of hyperplanes with normal vector (α1 (m), . . . , αd (m)). Now we pick the highest man m in the (global) preference list, consider the ray as above and find the first hyperplane Hdim(m) (w) hit by the ray. We then match the pair (m, w), remove H(w) from all data structures and repeat. Correctness follows from the correctness of the greedy approach when all women share the same preference list and the properties of the halfspaces proved above. The algorithm preprocesses d data structures, then makes n queries and dn deletions. The time is dominated by the n ray queries each requiring time Õ(n1−1/⌊d/2⌋ ). Thus the total time complexity is bounded by Õ(n2−1/⌊d/2⌋ ), as claimed. 7 Algorithm 2: One-Sided Stable Matching // For points in P ∈ Rd we use the notation (x1 , . . . , xd ) to refer to its coordinates. Input: matching µ for d′ = 1 to d do for each woman w do P H(w) ← {xd = d−1 i=1 Ai (w)xi − Ad′ (w)} Hd′ ← Hd′ ∪ H(w) Hd′ .preprocess() for each man m in order of preference do s ← αdim(m) (m) α dim(m)−1 r(m) ← (− α1 (m) s ,...,− s H(w) ← Query(Hdim(m) , r(m)) µ ← µ ∪ (m, w) for d′ = 1 to d do Hd′ ← Hd′ − Hd′ (w) (m) , ∞ · s) + t · (0, . . . , 0, −s) return µ Note that for d = 1 there is a trivial linear time algorithm for the problem. We use the following lemma to extend the above algorithm to account for positive and negative weights for the women. It deals with settings where the women choose one of two lists (σ1 , σ2 ) as their preference lists over the men while the men’s preferences can be arbitrary. Lemma 3. Suppose there are k women who use σ1 . If the top k men in σ1 are in the bottom k places in σ2 , then the women using σ1 will only match with those men and the n − k women using σ2 will only match with the other n − k men in the woman-optimal stable matching. Proof. Consider the operation of the woman-proposing deferred acceptance algorithm for finding the woman-optimal stable matching. Suppose the lemma is false so that at some point a woman using σ1 proposed to one of the last n − k men in σ1 . Let w be the first such woman. w must have been rejected by all of the top k, so at least one of those men received a proposal from a woman, w′ , using σ2 . However, since the top k men in σ1 are the bottom k men in σ2 , w′ must have been rejected by all of the top n − k men in σ2 . But there are only n − k women using σ2 , so one of the top n − k men in σ2 must have already received a proposal from a woman using σ1 . This is a contradiction because w was the first woman using σ1 to propose to one of the bottom n − k men in σ1 (which are the top n − k men in σ2 ). We can now prove the following theorem where negative values are allowed for the women’s weights. Theorem 2. For d ≥ 2 there is an algorithm to find a stable matching in the one-sided d-attribute model with real-valued attributes and weights in time Õ(n2−1/⌊d/2⌋ ). Proof. Suppose there are k women who have a positive weight on the men’s attribute. Since the remaining n − k women’s preference list is the reverse, we can use Lemma 3 to split the problem into two subproblems. Namely, in the woman-optimal stable matching the k women with a positive weight will match with the top k men, and the n − k women with a negative weight will match with the bottom n − k men. Now the women in each of these subproblems all have the same list. Therefore we can use Lemma 2 to solve each subproblem. Splitting the problem into subproblems can be done in time O(n) so the running time follows immediately from Lemma 2. 8 Table 1: Two-list preferences where no participant receives their top choice in the stable matching σ1 m1 m2 m3 m4 m5 σ2 m3 m5 m1 m4 m2 π1 w1 w2 w3 w4 w5 π2 w3 w5 w1 w4 w2 Man m1 m2 m3 m4 m5 List π1 π1 π2 π1 π2 Woman w1 w2 w3 w4 w5 List σ2 σ2 σ1 σ2 σ1 As a remark, this “greedy” approach where we select a man, find his most preferred available woman, and permanently match him to her will not work in general. Table 1 describes a simple 2list example where the unique stable matching is {(m1 , w2 ), (m2 , w3 ), (m3 , w5 ), (m4 , w4 ), (m5 , w1 )}. In this instance, no participant is matched with their top choice. Therefore, the above approach cannot work for this instance. This illustrates to some extent why the general case seems more difficult than the one-sided case. An alternative model of a greedy approach that is based on work by Davis and Impagliazzo in [15] also will not work. In this model, an algorithm can view each of the lists and the preferences of the women. It can then (adaptively) choose an order in which to process the men. When processing a man, he must be assigned a partner (not necessarily his favorite available woman) once and for all, based only on his choice of preference list and the preferences of the previously processed men. This model is similar to online stable matching [28] except that it allows the algorithm to choose the processing order of the men. Using the preferences in Table 2 and minor modifications to them, we can show that no greedy algorithm of this type can successfully produce a stable matching. Indeed, the unique stable matching of the preference scheme below is µ = {(m1 , w3 ), (m2 , w1 ), (m3 , w2 )}. However, changing the preference list for whichever of m1 or m2 is processed later will form a blocking pair with the stable partner of the other. If m1 uses π1 , (m1 , w1 ) blocks µ and if m2 uses π2 , (m2 , w3 ) blocks µ. Therefore, no algorithm can succeed in assigning stable partners to these men without first knowing the preference list choice of all three. Table 2: Two-list preferences where a greedy approach will not work σ1 m1 m2 m3 4.3 σ2 m2 m1 m3 π1 w1 w2 w3 π2 w3 w2 w1 Man m1 m2 m3 List π2 π1 π1 Woman w1 w2 w3 List σ1 σ2 σ2 Strategic Behavior As mentioned earlier, strategic behavior in the general preference setting allows for participants to truncate or rearrange their lists. However, in the d-attribute and d-list models, we assume that the attributes or lists are fixed, so that the only manipulation the participants are allowed is to misrepresent their weight vectors or which list they choose. Despite this limitation, there is still no strategy proof mechanism for finding a stable matching when d ≥ 2. Theorem 3. For d ≥ 2 there is no strategy proof algorithm to find a stable matching in the d-list model. 9 Proof. Table 3 describes true preferences that can be manipulated by the women. Observe that there are two stable matchings: the man-optimal matching {(m1 , w1 ), (m2 , w2 ), (m3 , w3 ), (m4 , w4 )} and the woman-optimal matching {(m1 , w2 ), (m2 , w3 ), (m3 , w1 ), (m4 , w4 )}. However, if w2 used list σ2 instead of σ1 , then there is a unique stable matching which is {(m1 , w2 ), (m2 , w3 ), (m3 , w1 ), (m4 , w4 )}, the woman-optimal stable matching from the original preferences. Therefore, any mechanism that does not always output the woman optimal stable matching can be manipulated by the women to their advantage. By symmetry, any mechanism that does not always output the man-optimal matching could be manipulated by the men. Thus there is no strategy-proof mechanism for the d-list setting with d ≥ 2. Table 3: Two-list preferences that can be manipulated σ1 m1 m2 m3 m4 σ2 m3 m1 m4 m2 π1 w1 w2 w3 w4 π2 w3 w1 w2 w4 Man m1 m2 m3 m4 List π1 π1 π2 π2 Woman w1 w2 w3 w4 List σ2 σ1 σ1 σ1 Since the d-list model is a special case of the d-attribute model, we immediately have the following result from Theorem 3. Corollary 1. For d ≥ 2 there is no strategy proof algorithm to find a stable matching in the d-attribute model. Of course in the 1-list setting there is a trivial unique stable matching. Moreover, in the one-sided d-attribute model our algorithm is strategy proof since the women are receiving the woman-optimal matching and each man receives his best available woman, so misrepresentation would only give him a worse partner. 5 Verification We now turn to the problem of verifying whether a given matching is stable. While this is as hard as finding a stable matching in the general setting, the verification algorithms we present here are more efficient than our algorithms for finding stable matchings in the attribute model. 5.1 Real Attributes and Weights In this section we adapt the geometric approach for finding a stable matching in the one-sided dattribute model to the problem of verifying a stable matching in the (two-sided) d-attribute model. We express the verification problem as a simplex range searching problem in R2d , which is the dual of the ray shooting problem. In simplex range searching we are given n points and answer queries that ask for the number of points inside a simplex. In our case we only need degenerate simplices consisting of the intersection of two halfspaces. Simplex range searching queries can be done in sublinear time for constant d. Lemma 4 ([31]). Given a set of n points in Rd , one can process it for simplex range searching in 1 time O(n log n), and then answer queries in time Õ(n1− d ). 10 ′ For 1 ≤ d′ ≤ d we use the notation (x1 , . . . , xd , y1 , . . . , yd′ −1 , z) for points in Rd+d . We again let dim(w) be the index of w’s last non-zero weight, assume without loss of generality αdim(w) ∈ {−1, 1}, and let sgn(w) = sgn(αdim(w) ). We partition the set of women into 2d sets Wd′ ,s for 1 ≤ d′ ≤ d and s ∈ {−1, 1} based on dim(w) and sgn(w). Note that if dim(w) = 0, then w is indifferent among all men and can therefore not be part of a blocking pair. We can ignore such women. For a woman w, consider the point P (w) = (A1 (w), . . . , Ad (w), α1 (w), . . . , αdim(w)−1 (w), valw (m)) (5) where m = µ(w) is the partner of w in the input matching µ. For a set Wd′ ,s we let Pd′ ,s be the set of points P (w) for w ∈ Wd′ ,s . The basic idea is to construct a simplex for every man and query it against all sets Pd′ ,s . nP o d Given d′ ,s, and a man m, let H1 (m) be the halfspace α (m)x > val (w) where w = i m i=1 i ′ µ(m). For w′ ∈ Wd′ ,s wenhave P (w′ ) ∈ H1 (m) if and only o if m strictly prefers w to w. Further let Pd′ −1 ′ ′ H2 (m) be the halfspace i=1 Ai (m)yi + Ad′ (m)s > z . For w ∈ Wd′ ,s we have P (w ) ∈ H2 (m) if and only if w′ strictly prefers m to µ(w′ ). Hence (m, w′ ) is a blocking pair if and only if P (w′ ) ∈ H1 (m) ∩ H2 (m). Using Lemma 4 we immediately have an algorithm to verify a stable matching. Theorem 4. There is an algorithm to verify a stable matching in the d-attribute model with realvalued attributes and weights in time Õ(n2−1/2d ) Proof. Partition the set of women into sets Wd′ ,s for 1 ≤ d′ ≤ d and s ∈ {−1, 1} and for w ∈ Wd′ ,s ′ construct P (w) ∈ Rd+d as above. Then preprocess the sets according to Lemma 4. For each man m query H1 (m) ∩ H2 (m) against the points in all sets. By the definitions of H1 (m) and H2 (m), there is a blocking pair if and only if for some man m there is a point P (w) ∈ H1 (m) ∩ H2 (m) in one of the sets Pd′ ,s . The time to preprocess is O(n log n). There are 2dn queries of time Õ(n1−1/2d ). Hence the whole process requires time Õ(n2−1/2d ) as claimed. Algorithm 3: Verify Stable Matching with Reals ′ // For points in P ∈ Rd+d we use the notation (x1 , . . . , xd , y1 , . . . , yd′ −1 , z) to refer to its coordinates. Input: matching µ for each woman w do m ← µ(w) P (w) ← (A1 (w), . . . , Ad (w), α1 (w), . . . , αd (w), val w (m)) Pdim(w),sgn(w) ← Wdim(w),sgn(w) ∪ P (w) for d′ = 1 to d and s ∈ {−1, 1} do Pd′ ,s .preprocess() for each man m do w ← µ(m)n o Pd H1 (m) ← α (m)x > val (w) i i m nPi=1 o d′ −1 ′ H2 (m) ← (m) · s > z A (m)y + A i i d i=1 if Query(Pd′ ,s , H1 (m) ∩ H2 (m)) > 0 then return µ is not stable return µ is stable 11 5.2 Lists When there are d preference orders for each side, and each participant uses one of the d lists, we provide a more efficient algorithm. Here, assume µ is the given matching between M and W . Let {πi }di=1 be the set of d permutations on the women and {σi }di=1 be the set of d permutations on the men. Define rank(w, i) to be the position of w in permutation πi . This can be determined in constant time after O(dn) preprocessing of the permutations. Let head(πi , j) be the first woman in πi who uses permutation σj and next(w, i) be the next highest ranked woman after w in permutation πi who uses the same permutation as w or ⊥ if no such woman exists. These can also be determined in constant time after O(dn) preprocessing by splitting the lists into sublists, with one sublist for the women using each permutation of men. The functions rank, head, and next are defined analogously for the men. Algorithm 4: Verify d-List Stable Matching for i = 1 to d do for j = 1 to d do w ← head(πi , j). m ← head(σj , i). while m 6= ⊥ and w 6= ⊥ do if rank(w, i) > rank(µ(m), i) then m ← next(m, j). else if rank(m, j) > rank(µ(w), j) then w ← next(w, i). else return (m, w) is a blocking pair. return µ is stable. Theorem 5. There is an algorithm to verify a stable matching in the d-list model in O(dn) time. Proof. We claim that algorithm 4 satisfies the theorem. Indeed, if the algorithm returns a pair (m, w) where m uses πi and w uses σj , then (m, w) is a blocking pair because w appears earlier in πi than µ(m) and m appears earlier in σj than µ(w). On the other hand, suppose the algorithm returns that µ is stable but there is a blocking pair, (m, w), where m uses πi and w uses σj . The algorithm considers permutations πi and σj since it does not terminate early. Clearly if the algorithm evaluates m and w simultaneously when considering permutations πi and σj , it will detect that (m, w) is a blocking pair. Therefore, the algorithm either moves from m to next(m, j) before considering w or it moves from w to next(w, i) before considering m. In the former case, rank(µ(m), i) < rank(w′ , i) for some w′ that comes before w in πi . Therefore m prefers µ(m) to w. Similarly, in the latter case, rank(µ(w), j) < rank(m′ , i) for some m′ that comes before m in σj so w prefers µ(w) to m. Thus (m, w) is not a blocking pair and we have a contradiction. The for and while loops proceed through all men and women once for each of the d lists in which they appear. Since at each step we are either proceeding to the next man or the next woman unless we find a blocking pair, the algorithm requires time O(dn). This is optimal since the input size is dn. 12 5.3 Boolean Attributes and Weights In this section we consider the problem of verifying a stable matching when the d attributes and weights are restricted to boolean values and d = c log n. The algorithm closely follows an algorithm for the maximum inner product problem by Alman and Williams [4]. The idea is to express the existence of a blocking pair as a probabilistic polynomial with a bounded number of monomials and use fast rectangular matrix multiplication to evaluate it. A probabilistic polynomial for a function f is a polynomial p such that for every input x Pr[f (x) 6= p(x)] ≤ 1 3 (6) We use the following tools in our algorithm. THRd is the threshold function that outputs 1 if at least d of its inputs are 1. Lemma p 5 ([4]). There is a probabilistic polynomial for THRd on n variables and error ε with degree O( n log(1/ε)). Lemma 6 ([35, 40]). There is a probabilistic polynomial for the disjunction of n variables and error ε with degree O(log(1/ε)) Lemma 7 ([43]). Given a polynomial P (x1 , . . . , xm , y1 , . . . ym ) with at most n0.17 monomials and two sets X, Y ⊆ {0, 1}m with |X| = |Y | = n, we can evaluate P on all pairs (x, y) ∈ X × Y in time Õ(n2 + m · n1.17 ). We construct a probabilistic polynomial that outputs 1 if there is a blocking pair. To minimize the degree of the polynomial, we pick a parameter s and divide the men and women into sets of size at most s. The polynomial takes the description of s men m1 , . . . , ms and s women w1 , . . . , ws along with their respective partners as input, and outputs 1 if and only if there is a blocking pair (mi , wj ) among the s2 pairs of nodes with high probability. 2 Lemma 8. Let u be a large constant and s = n1/uc log c . There is a probabilistic polynomial with the following inputs: • The attributes and weights of s men, A(m1 ), . . . , A(ms ), α(m1 ), . . . , α(ms ) • The attributes of the s women that are matched with these men A(µ(m1 )), . . . , A(µ(ms )) • The attributes and weights of s women, A(w1 ), . . . , A(ws ), α(w1 ), . . . , α(ws ) • The attributes of the s men that are matched with these women A(µ(w1 )), . . . , A(µ(ws )) The output of the polynomial is 1 if and only if there is a blocking pair with respect to the matching µ among the s2 pairs in the input. The number of monomials is at most n0.17 and the polynomial can be constructed efficiently. Proof. A pair (mi , wj ) is a blocking pair if and only if hα(mi ), A(µ(mi ))i < hα(mi ), A(wj )i and hα(wj ), A(µ(wj ))i < hα(wj ), A(mi )i. Rewriting F (x, y, a, b) := hx, yi < ha, bi = THRd+1 (¬(x1 ∧ y1 ), . . . , ¬(xd ∧ yd ), a1 ∧ b1 , . . . , ad ∧ bd ) (7) we have a blocking pair if and only if _  F (α(mi ), A(µ(mi )), α(mi ), A(wj )) ∧ F (α(wj ), A(µ(wj )), α(wj ), A(mi )) (8) i∈[1,s] j∈[1,s] 13 Note that we can easily adapt this algorithm to finding strongly blocking pairs by defining F (x, y, a, b) as hx, yi ≤ ha, bi. Using√Lemma 5 with ε = s13 and Lemma 6 with ε = 1/4 we get a probabilistic polynomial of degree a d log s for some constant a and error 1/4 + 1/s < 1/3. Furthermore, since we are only interested in boolean inputs we can assume the polynomial to be multilinear. For large enough u p of the number of variables) and the number we have 2d > a d log(s) (i.e. the degree  is at most half 2   s2 a√d4dlog(s) of monomials is then bounded by O . Simplifying the binomial coefficient we have       4c log n 4d 4c log n q √ √ = = a d log s a log n/ u log c a (log2 n)/u log2 c √ Setting δ = a/( u log(c)) we can upper bound this using Stirling’s inequality by  4c log n δ log n  ≤  (4c log n) · e δ δ log n = nδ log(4ce/δ) By choosing u to be a large enough constant, we can make δ and the exponent arbitrarily small. The factor of s2 only contributes a trivial constant to the exponent. Therefore we can bound the number of monomials by n0.17 . Theorem 6. In the d-attribute model with n men and women, and d = c log n boolean attributes and weights, there is a randomized algorithm to decide if a given matching is stable in time 2 Õ(n2−1/O(c log (c)) ) with error probability at most 1/3. 2 Proof. We again choose s = n1/uc log c and construct the probabilistic polynomial as in Lemma 8. We then divide the men and women into ⌈ ns ⌉ groups of size at most s. For a group of men m1 , . . . , ms we let the corresponding input vector be A(m1 ), . . . , A(ms ), α(m1 ), . . . , α(ms ), A(µ(m1 )), . . . , A(µ(ms )) We set X as the set of all input vectors for the ⌈ ns ⌉ groups. We define the set Y symmetrically for the input vectors corresponding to the ⌈ ns ⌉ groups of women. Using Lemma 7 we evaluate the polynomial on all pairs x ∈ X, y ∈ Y in time       n 1.17  2 n 2 n 2 + O(sd) = Õ = Õ(n2−1/O(c log (c)) ) (9) Õ s s s The probability that the output is wrong for any fixed input pair is at most 1/3. We repeat this process O(log n) times and take  the threshold output for every pair of inputs, such that the error probability is at most O n12 for any fixed pair of inputs. Using a union bound we can make the probability of error at most 1/3 on any input. 6 6.1 Conditional Hardness Background The Strong Exponential Time Hypothesis has proved useful in arguing conditional hardness for a large number of problems. We show SETH-hardness for both verifying and finding a stable matching 14 in the d-attribute model, even if the weights and attributes are boolean. The main step of the proof is a reduction from the maximum inner product problem to the stable matching problem. The maximum inner product problem is known to be SETH-hard. We give the fine-grained reduction from cnfsat to the vector orthogonality problem and from the vector orthogonality problem to the maximum inner product problem for the sake of completeness. Definition 1 ([23, 25]). The Strong Exponential Time Hypothesis (SETH) stipulates that for each ε > 0 there is a k such that k-sat requires time Ω(2(1−ε)n ). Definition 2. For any d, the vector orthogonality problem is to decide if two input sets U, V ⊆ Rd with |U | = |V | = n have a pair u ∈ U , v ∈ V such that hu, vi = 0. The boolean vector orthogonality problem is the variant where U, V ⊆ {0, 1}d . Definition 3. For any d and input l, the maximum inner product problem is to decide if two input sets U, V ⊆ Rd with |U | = |V | = n have a pair u ∈ U , v ∈ V such that hu, vi ≥ l. The boolean maximum inner product problem is the variant where U, V ⊆ {0, 1}d . Lemma 9 ([25, 42, 4]). Assuming SETH, for any ε > 0, there is a c such that solving the boolean maximum inner product problem on d = c log n dimensions requires time Ω(n2−ε ). Proof. The proof is a series of reductions from k-sat to boolean inner product. By the Sparsification Lemma [25] we can reduce k-sat to a subexponential number of k-sat instances with at most d = ck n clauses, where ck does not depend on n. Hence, assuming SETH, for any ε > 0, there is a c such that cnfsat with cn clauses requires time Ω(2(1−ε)n ). We reduce cnfsat to the boolean vector orthogonality problem using a technique called Split and List. Divide the variable set into two sets S, T of size n2 and for each set consider all N = 2n/2 assignments to the variables. For every assignment we construct a d-dimensional vector where the ith position is 1 if and only if the assignment does not satisfy the ith clause of the CNF formula. Let U be the set of vectors corresponding to the assignments to S and let V be the set of vectors corresponding to T . A pair u ∈ U , v ∈ V is orthogonal if and only if the corresponding assignment satisfies all clauses. An algorithm for boolean vector orthogonality in dimension d = cn = 2c log N and time O(N 2−ε ) = O(2(1−ε/2)n ) would contradict SETH. Hence assuming SETH, for every ε > 0 there is a c such that the boolean vector orthogonality problem with d = c log N requires time Ω(N 2−ε ). Finally, we reduce the boolean vector orthogonality problem to the boolean maximum inner product problem by partitioning the set U into sets Ui for 0 ≤ i ≤ d where Ui contains all vectors with Hamming weight i. Observe that a vector v ∈ V is orthogonal to a vector u ∈ Ui if and only if hu, ¬vi = i, where ¬v is the element-wise complement of v. Thus U and V have an orthogonal pair, if and only if there is an i such that Ui and ¬V = {¬v | v ∈ V } have a pair with inner product at least i. Therefore, for any ε > 0 there is a c such that the maximum inner product problem on d = c log N dimensions requires time Ω(N 2−ε ) assuming SETH. 6.2 Finding Stable Matchings In this subsection we give a fine-grained reduction from the maximum inner product problem to the problem of finding a stable matching in the boolean d-attribute model. This shows that the stable matching problem in the d-attribute model is SETH-hard, even if we restrict the attributes and weights to booleans. Theorem 7. Assuming SETH, for any ε > 0, there is a c such that finding a stable matching in the boolean d-attribute model with d = c log n dimensions requires time Ω(n2−ε ). 15 Proof. The proof is a reduction from maximum inner product to finding a stable matching. Given an instance of the maximum inner product problem with sets U, V ⊆ {0, 1}d where |U | = |V | = n and threshold l, we construct a matching market with n men and n women. For every u ∈ U we have a man mu with A(mu ) = u and α(mu ) = u. Similarly, for vectors v ∈ V we have women wv with A(wv ) = v and α(wv ) = v. This matching market is symmetric in the sense that for mu and wv , valmu (wv ) = valwv (mu ) = hu, vi. We claim that any stable matching contains a pair (mu , wv ) such that the inner product hu, vi is maximized. Indeed, suppose there are vectors u ∈ U , v ∈ V with hu, vi ≥ l but there exists a stable matching µ with hu′ , v ′ i < l for all pairs (mu′ , wv′ ) ∈ µ. Then (mu , wv ) is clearly a blocking pair for µ which is a contradiction. 6.3 Verifying Stable Matchings In this section we give a reduction from the maximum inner product problem to the problem of verifying a stable matching, showing that this problem is also SETH-hard. Theorem 8. Assuming SETH, for any ε > 0, there is a c such that verifying a stable matching in the boolean d-attribute model with d = c log n dimensions requires time Ω(n2−ε ). Proof. We give a reduction from maximum inner product with sets U, V ⊆ {0, 1}d where |U | = |V | = n and threshold l. We construct a matching market with 2n men and women in the d′ attribute model with d′ = d + 2(l − 1). Since d′ < 3d the theorem then follows immediately from the SETH-hardness of maximum inner product. For u ∈ U , let mu be a man in the matching market with attributes and weights A(mu ) = α(mu ) = u ◦ 1l−1 ◦ 0l−1 where we use ◦ for concatenation. Similarly, for v ∈ V we have a woman wv with A(wv ) = α(wv ) = v ◦ 0l−1 ◦ 1l−1 . We further introduce dummy women wu′ for u ∈ U with A(wu′ ) = α(wu′ ) = 0d ◦ 1l−1 ◦ 0l−1 and dummy men m′v for v ∈ V with A(m′v ) = α(m′v ) = 0d ◦ 0l−1 ◦ 1l−1 . We claim that the matching consisting of pairs (mu , wu′ ) for all u ∈ U and (m′v , wv ) for all v ∈ V is stable if and only if there is no pair u ∈ U , v ∈ V with hu, vi ≥ l. For u, u′ ∈ U we have valmu (wu′ ′ ) = valw′ ′ (mu ) = l − 1, and for v, v ′ ∈ V we have valwv (m′v′ ) = valm′ ′ (wv ) = l − 1. In v u particular, any pair in µ has (symmetric) value l − 1. Hence there is a blocking pair with respect to µ if and only if there is a pair with value at least l. For u 6= u′ and v 6= v ′ the pairs (mu , wu′ ′ ) and (wv , m′v′ ) can never be blocking pairs as their value is l − 1. Furthermore for any pair of dummy nodes wu′ and m′v we have valm′v (wu′ ) = valwu′ (m′v ) = 0, thus no such pair can be a blocking pair either. This leaves pairs of real nodes as the only candidates for blocking pairs. For non-dummy nodes mu and wv we have valmu (wv ) = valwv (mu ) = hu, vi so (mu , wv ) is a blocking pair if and only if hu, vi ≥ l. 16 u1 ◦ 1l−1 ◦ 0l−1 mu1 wu′ 1 0d ◦ 1l−1 ◦ 0l−1 u2 ◦ 1l−1 ◦ 0l−1 mu2 wu′ 2 0d ◦ 1l−1 ◦ 0l−1 u3 ◦ 1l−1 ◦ 0l−1 mu3 wu′ 3 0d ◦ 1l−1 ◦ 0l−1 0d ◦ 0l−1 ◦ 1l−1 m′v1 wv1 v1 ◦ 0l−1 ◦ 1l−1 0d ◦ 0l−1 ◦ 1l−1 m′v2 wv2 v2 ◦ 0l−1 ◦ 1l−1 0d ◦ 0l−1 ◦ 1l−1 m′v3 wv3 v3 ◦ 0l−1 ◦ 1l−1 Figure 1: A representation of the reduction from maximum inner product to verifying a stable matching 6.4 Checking a Stable Pair In this section we give a reduction from the maximum inner product problem to the problem of checking whether a given pair is part of any or all stable matchings, showing that these questions are SETH-hard when d = c log n for some constant c. For general preferences, both questions can be solved in time O(n2 ) [27, 20] and are known to require quadratic time [33, 38, 19]. Theorem 9. Assuming SETH, for any ε > 0, there is a c such that determining whether a given pair is part of any or all stable matchings in the boolean d-attribute model with d = c log n dimensions requires time Ω(n2−ε ). Proof. We again give a reduction from maximum inner product with sets U, V ⊆ {0, 1}d where |U | = |V | = n and threshold l. We construct a matching market with 2n men and women in the d′ -attribute model with d′ = 7d+7(l −1)+18. Since d′ < 15d the theorem then follows immediately from the SETH-hardness of maximum inner product. For simplicity, we will first describe the preference scheme, then provide weight and attribute vectors that result in those preferences. For u ∈ U , let mu be a man in the matching market and for v ∈ V we have a woman wv . We also have n − 1 dummy men mi : i = 1 . . . n − 1 and n − 1 dummy women wj : j = 1 . . . n − 1. Finally, we have a special man m∗ and special woman w∗ . This special pair is the one we will test for stability. Let the preferences be n−1 mu :{wv : hu, vi ≥ l} ≻ {wj }j=1 ≻ w∗ ≻ {wv : hu, vi < l} mi :{wv } ≻ n−1 {wj }j=1 ≻w ∗ n−1 m∗ :w∗ ≻ {wv } ≻ {wj }j=1 n−1 wv :{mu : hu, vi ≥ l} ≻ {mi }i=1 ≻ m∗ ≻ {mu : hu, vi < l} wj :{mu } ≻ w ∗ n−1 :{mi }i=1 n−1 {mi }i=1 ≻m ≻ {mu } ≻ m ∗ ∗ 17 ∀u ∈ U ∀i ∈ {1 . . . n − 1} ∀v ∈ V ∀j ∈ {1 . . . n − 1} so that, for example, man mu corresponding to u ∈ U will most prefer women wv for some v ∈ V with hu, vi ≥ l (in decreasing order of hu, vi), then all of the dummy women (equally), then the special woman w∗ , and finally the remaining women wv (in decreasing order of hu, vi). First suppose for some û ∈ U and v̂ ∈ V we have hû, v̂i ≥ l and let this be the pair with largest inner product. Now consider the deferred acceptance algorithm for finding the woman-optimal stable matching. First, wv̂ will propose to mû and will be accepted. The dummy women will propose to the remaining men corresponding to U . Then any other woman wv will be accepted by either a dummy man or a man mu , causing the dummy woman matched with him to move to a dummy man. In any case, all men besides m∗ are matched to a woman they prefer over w∗ , so when she proposes to them, they will reject her. Thus w∗ will match with m∗ . Since w∗ receives her least preferred choice in the woman optimal stable matching, (m∗ , w∗ ) is a pair in every stable matching. Now suppose hu, vi < l for every u ∈ U ,v ∈ V . Consider the deferred acceptance algorithm for finding the man-optimal stable matching. First, the dummy men will propose to the women corresponding to V and will be accepted. Then every man mu will propose to the dummy women, but only n − 1 of them can be accepted. The remaining one will propose to w∗ . When m∗ proposes to w∗ , she rejects him, causing him to eventually be accepted by the available woman wv . Thus m∗ will not match with w∗ in any stable matching since she is his most preferred choice but he is not matched with her in the man-optimal stable matching, so (m∗ , w∗ ) is not a pair in any stable matching. Figure 2 demonstrates each of these cases. Since the stable pair questions for whether (m∗ , w∗ ) are a stable pair in any or all stable matchings are equivalent with these preferences, this reduction works for both. Finally, we claim the following vectors realize the preferences above for the attribute model. We leave it to the reader to verify this. As in our other hardness reductions, the weight and attribute vectors are identical for each participant. mu mi m∗ wv wj w∗ : : : : : : u7 07d 07d v7 07d 07d ◦ ◦ ◦ ◦ ◦ ◦ 17(l−1) 17(l−1) 17(l−1) 07(l−1) 17(l−1) 17(l−1) ◦ ◦ ◦ ◦ ◦ ◦ 07(l−1) 17(l−1) 17(l−1) 17(l−1) 07(l−1) 07(l−1) ◦ 16 ◦ 06 ◦ 06 ◦ 06 ◦ 16 3 ◦ (1 ◦ 03 ) 18 ◦ 06 ◦ 16 ◦ 06 ◦ 16 ◦ (15 ◦ 0) ◦ (14 ◦ 02 ) ◦ 06 ◦ 06 ◦ 16 ◦ (1 ◦ 05 ) ◦ 06 2 ◦ (1 ◦ 04 ) {mu } {wv } {mu } {wv } {mi } {wj } {mi } {wj } m∗ w∗ m∗ w∗ (a) A representative stable matching when there (b) A representative stable matching when is a pair (u, v) with hu, vi ≥ l hu, vi < l for every pair (u, v) Figure 2: A representation of the reduction from maximum inner product to checking a stable pair This reduction also has consequences on the existence of nondeterministic algorithms for the stable pair problem assuming the Nondeterministic Strong Exponential Time Hypothesis. Definition 4 ([11]). The Nondeterministic Strong Exponential Time Hypothesis (NSETH) stipulates that for each ε > 0 there is a k such that k-sat requires co-nondeterministic time Ω(2(1−ε)n ). In other words, the Nondeterministic Strong Exponential Time Hypothesis stipulates that for cnfsat there is no proof of unsatisfiability that can be checked deterministically in time Ω(2(1−ε)n ). Assuming NSETH, any problem that is SETH-hard at time T (n) under deterministic reductions either require T (n) time nondeterministically or co-nondeterministically, i.e. either there is no proof that an instance is true or there is no proof that an instance is false that can be checked in time faster than T (n). Note that all reductions in this paper are deterministic. In particular, the maximum inner product problem does not have a O(N 2−ε ) co-nondeterministic time algorithm for any ε > 0 assuming NSETH, since it has a simple linear time nondeterministic algorithm. Since the reduction of Theorem 9 is a simple reduction that maps a true instance of maximum inner product to a true instance of the stable pair problem, we can conclude that the stable pair problem is also hard co-nondeterministically. Corollary 2. Assuming NSETH, for any ε > 0, there is a c such that determining whether a given pair is part of any or all stable matchings in the boolean d-attribute model with d = c log n dimensions requires co-nondeterministic time Ω(n2−ε ). We also have a reduction so that the given pair is stable in any or all stable matchings if and only if there is not a pair of vectors with large inner product. This shows that the stable pair problem is also hard nondeterministically. Theorem 10. Assuming NSETH, for any ε > 0, there is a c such that determining whether a given pair is part of any or all stable matchings in the boolean d-attribute model with d = c log n dimensions requires nondeterministic time Ω(n2−ε ). 19 Proof. This reduction uses the same setup as the one in Theorem 9 except that we now have n dummy men and women instead of n − 1 and we slightly change the preferences as follows: mu :{wv : hu, vi ≥ l} ≻ {wj }nj=1 ≻ w∗ ≻ {wv : hu, vi < l} mi :{wv } ≻ w ∗ ∗ ∗ m :w ≻ {wv } ≻ {wj }nj=1 ≻ {wj }nj=1 wv :{mu : hu, vi ≥ l} ≻ {mi }ni=1 ≻ m∗ ≻ {mu : hu, vi < l} wj :{mu } ≻ w ∗ :{mi }ni=1 {mi }ni=1 ≻m ≻ {mu } ≻ m ∗ ∗ ∀u ∈ U ∀i ∈ {1 . . . n} ∀v ∈ V ∀j ∈ {1 . . . n} First suppose for some û ∈ U and v̂ ∈ V we have hû, v̂i ≥ l and let this be the pair with largest inner product. Consider the deferred acceptance algorithm for finding the man-optimal stable matching. First, some of the men corresponding to U will propose to the women corresponding to V and at least mû will be accepted by wv̂ . The remaining men corresponding to U will be accepted by dummy women. The dummy men will propose to the women corresponding to V but not all can be accepted. These rejected dummy men will propose to w∗ who will accept one. Then when m∗ proposes to w∗ she will reject him, as will the women corresponding to V , so he will be matched with a dummy woman. Since m∗ and w∗ are not matched in the man optimal stable matching, (m∗ , w∗ ) is not a pair in any stable matching. Now suppose hu, vi < l for every u ∈ U ,v ∈ V and consider the deferred acceptance algorithm for finding the woman-optimal stable matching. First, the dummy women will propose to the men corresponding to U and will be accepted. Then every woman wv will propose to the dummy men and be accepted. Since every man besides m∗ is matched with a woman he prefers to w∗ , when she proposes to them, she will be rejected, so she will pair with m∗ . Since w∗ receives her least preferred choice in the woman optimal stable matching, (m∗ , w∗ ) is a pair in every stable matching. Figure 3 demonstrates each of these cases. We can amend the vectors from Theorem 9 as follows so that they realize the changed preferences with the attribute model. mu mi m∗ wv wj w∗ : : : : : : u7 07d 07d v7 07d 07d ◦ ◦ ◦ ◦ ◦ ◦ 17(l−1) 17(l−1) 17(l−1) 07(l−1) 17(l−1) 17(l−1) ◦ ◦ ◦ ◦ ◦ ◦ 07(l−1) 17(l−1) 17(l−1) 17(l−1) 07(l−1) 07(l−1) ◦ 16 ◦ 06 ◦ 06 ◦ 06 ◦ 16 3 ◦ (1 ◦ 03 ) 20 ◦ 06 ◦ 16 ◦ 06 ◦ 16 ◦ (13 ◦ 03 ) ◦ (14 ◦ 02 ) ◦ 06 ◦ 06 ◦ 16 ◦ (1 ◦ 05 ) ◦ 06 2 ◦ (1 ◦ 04 ) {mu } {wv } {mu } {wv } {mi } {wj } {mi } {wj } m∗ w∗ m∗ w∗ (a) A representative stable matching when there (b) A representative stable matching when is a pair (u, v) with hu, vi ≥ l hu, vi < l for every pair (u, v) Figure 3: A representation of the reduction from maximum inner product to checking a stable pair such that a true maximum inner product instance maps to a false stable pair instance We would like to point out that the results on the hardness for (co-)nondeterministic algorithms do not apply to Merlin-Arthur (MA) algorithms, i.e. algorithms with access to both nondeterministic bits and randomness. Williams [44] gives fast MA algorithms for a number of SETH-hard problems, and the same techniques also yield a O(dn) time MA algorithm for the verification of a stable matching in the boolean attribute model with d attributes. We can obtain MA algorithms with time O(dn) for finding stable matchings and certifying that a pair is in at least one stable matching by first nondeterministically guessing a stable matching. 7 Other Succinct Preference Models In this section, we provide subquadratic algorithms for other succinct preference models, singlepeaked and geometric, which are motivated by economics. 7.1 One Dimensional Single-Peaked Preferences Formally, we say the men’s preferences over the women in a matching market are single-peaked if the women can be ordered as points along a line (p(w1 ) < p(w2 ) < · · · < p(wn )) and for each man m there is a point q(m) and a binary preference relation ≻m such that if p(wi ) ≤ q(m) then p(wi ) ≻m p(wj ) for j < i and if p(wi ) ≥ q(m) then p(wi ) ≻m p(wj ) for j > i. Essentially, each man prefers the women that are “closest” to his ideal point q(m). One example of a preference relation for m would be the distance from q(m). If the women’s preferences are also single-peaked then we say the matching market has single peaked preferences. Since these preferences only consist of the 21 p and q values and the preference relations for the participants, they can be represented succinctly as long as the relations require subquadratic space. 7.1.1 Verifying a Stable Matching for Single-Peaked Preferences Here we demonstrate a subquadratic algorithm for verifying if a given matching is stable when the preferences of the matching market are single-peaked. We assume that the preference relations can be computed in constant time. Theorem 11. There is an algorithm to verify a stable matching in the single-peaked preference model in O(n log n) time. Proof. Let p(mi ) be the point associated with man mi , q(mi ) be mi ’s preference point, and ≻mi be mi ’s preference relation. The women’s points are denoted analogously. We assume that p(mi ) < p(mj ) if and only if i < j and the same for the women. Let µ be the given matching we are to check for stability. First, for each man m, we compute the intervals along the line of women which includes all women m strictly prefers to µ(m). If this interval is empty, m is with his most preferred woman and cannot be involved in any blocking pairs so we can ignore him. For all nonempty intervals each endpoint is p(w) for some woman w. We also compute these intervals for the women. Note that for any man m and woman w, (m, w) is a blocking pair for µ if and only if m is in w’s interval and w is in m’s interval. We will process each of the women in order from w1 to wn maintaining a balanced binary search tree of the men who prefer that woman to their partners. This will allow us to easily check if she prefers any of them by seeing if any elements in the tree are between the endpoints of her interval. Initially this tree is empty. When processing a woman w, we first add any man m whose interval begins with w to the search tree. Then we check to see if w prefers any men in the tree. If so, we know the matching is not stable. Otherwise, we remove any man m from the tree whose interval ends with w and proceed to the next woman. Algorithm 5 provides pseudocode for this algorithm. Computing the intervals requires O(n log n). Since we only insert each man into the tree at most once, maintaining the tree requires O(n log n). The queries also require O(log n) for each woman so the total time is O(n log n). 22 Algorithm 5: Single-Peaked Stable Matching Verification for each woman w do Create two empty lists w.begin and w.end. Use binary search to find the leftmost man m and rightmost man m′ that w prefers to µ(w) if any. (Otherwise remove w.) Let w.s = p(m) and w.t = p(m′ ). for each man m do Use binary search to find the leftmost woman w and rightmost woman w′ that m prefers to µ(m) if any. (Otherwise ignore m.) Add m to w.begin and w′ .end. Initialize an empty balanced binary search tree T . for i = 1 to n do for m ∈ wi .begin do T. insert(p(m)) if there are any points p(m) in T between wi .s and wi .t then return (m, wi ) is a blocking pair. for m ∈ wi .end do T. delete(p(m)) return µ is stable. 7.1.2 Remarks on Finding a Stable Matching for Single-Peaked Preferences The algorithm in [7] relies on the observation that there will always be a pair or participants who are each other’s first choice with narcissistic single-peaked preferences. Thus a greedy approach where one such pair is selected and then removed works well. However, this is not the case when we remove the narcissistic assumption. In fact, as with the two-list case, Table 4 presents an example where no participant is matched with their top choice in the unique stable matching. Note that the preferences for the men and women are symmetric. The reader can verify that these preferences can be realized in the single-peaked preference model using the orderings p(m1 ) < p(m2 ) < p(m3 ) < p(m4 ) and p(w1 ) < p(w2 ) < p(w3 ) < p(w4 ) and that the unique stable matching is {(m1 , w4 ), (m2 , w2 ), (m3 , w3 ), (m4 , w1 )} where no participant receives their first choice. Table 4: Single-peaked preferences where no participant receives their top choice in the stable matching Man m1 m2 m3 m4 Preference List w3 ≻ w2 ≻ w4 ≻ w1 w3 ≻ w2 ≻ w4 ≻ w1 w4 ≻ w3 ≻ w2 ≻ w1 w2 ≻ w1 ≻ w3 ≻ w4 Woman w1 w2 w3 w4 m3 m3 m4 m2 Preference List ≻ m2 ≻ m4 ≻ m1 ≻ m2 ≻ m4 ≻ m1 ≻ m3 ≻ m2 ≻ m1 ≻ m1 ≻ m3 ≻ m4 Also no greedy algorithm following the model inspired by [15] will succeed for single-peak preferences because the preferences in Table 2 can be realized in the single-peaked preference model using the orderings p(m1 ) < p(m2 ) < p(m3 ) and p(w1 ) < p(w2 ) < p(w3 ). 23 7.2 Geometric Preferences We say the men’s preferences over the women in a matching market are geometric in d dimensions if each women w is defined by a location p(w) and for each man m there is an ideal q(m) such that m prefers woman w1 to w2 if and only if kp(m) − q(w1 )k22 < kp(m) − q(w2 )k22 , i.e. p(w1 ) has smaller euclidean distance from the man’s ideal than p(w2 ). If the women’s preferences are also geometric we call the matching market geometric. We further call the preferences narcissistic if p(x) = q(x) for every participant x. Our results for the attribute model extend to geometric preferences. Note that one-dimensional geometric preferences are a special case of single-peaked preferences. As such, geometric preferences might be used to model preferences over political candidates who are given a score on several (linear) policy areas, e.g. protectionist vs. free trade and hawkish vs. dovish foreign policy. Arkin et al. [5] also consider geometric preferences, but restrict themselves to the narcissistic case. Our algorithms do not require the preferences to be narcissistic, hence our model is more general. On the other hand, our lower bounds for large dimensions also apply to the narcissistic special case. While Arkin et al. take special care of different notions of stability in the presence of ties, we concentrate on weakly stable matchings. Although we restrict ourselves to the stable matching problem for the sake of presentation, all lower bounds and verification algorithms naturally extend to the stable roommate problem. Since all proofs in this section are closely related those for the attribute model, we restrict ourselves to proof sketches highlighting the main differences. Theorem 1 extends immediately to the geometric case without any changes in the proof. Corollary 3 (Geometric version of Theorem 1). There is an algorithm to find a stable matching in the d-dimensional geometric model with at most a constant C distinct values in time O(C 2d n(d + log n)). For the verification of a stable matching with real-valued vectors we use a standard lifting argument. Corollary 4 (Geometric version of Theorem 4). There is an algorithm to verify a stable matching in the d-dimensional geometric model with real-valued locations and ideals in time Õ(n2−1/2(d+1) ) Proof. Let q ∈ Rd be an ideal and letPa, b ∈ Rd be two locations.P Define q ′ , a′ , b′ ∈ Rd+1 as q ′ = (q1 , . . . , qd , −1/2), a′ = (a1 , . . . , ad , di=1 a2i ) and b′ = (b1 , . . . , bd , di=1 b2i ). P We have ha′ , qi = 1/2 di=1 qi − 1/2kq − ak22 . Hence we get kq − ak22 < kq − bk22 if and only if hq ′ , a′ i > hq ′ , b′ i, so we can reduce the stable matching problem in the d-dimensional geometric model to the d + 1-attribute model. For the boolean case, we can adjust the proof of Theorem 6 by using a threshold of parities instead of a threshold of conjunctions. The degree of the resulting polynomial remains the same. Corollary 5 (Geometric version of Theorem 6). In the geometric model with n men and women, with locations and ideals in {0, 1}d with d = c log n, there is a randomized algorithm to decide if a 2 given matching is stable in time Õ(n2−1/O(c log (c)) ) with error probability at most 1/3. For lower bounds we reduce from the minimum Hamming distance problem which is SETH-hard with the same parameters as the maximum inner product problem [4]. The Hamming distance of two boolean vectors is exactly their squared euclidean distance, hence a matching market where the preferences are defined by Hamming distances is geometric. Definition 5. For any d and input l, the minimum Hamming distance problem is to decide if two input sets U, V ⊆ {0, 1}d with |U | = |V | = n have a pair u ∈ U , v ∈ V such that ku − vk22 < l. 24 Lemma 10 ([4]). Assuming SETH, for any ε > 0, there is a c such that solving the minimum Hamming distance problem on d = c log n dimensions requires time Ω(n2−ε ). For the hardness of finding a stable matching, the construction from Theorem 7 works without adjustments. Corollary 6 (Geometric version of Theorem 7). Assuming SETH, for any ε > 0, there is a c such that finding a stable matching in the (boolean) d-dimensional geometric model with d = c log n dimensions requires time Ω(n2−ε ). For the hardness of verifying a stable matching, the construction is as follows. Corollary 7 (Geometric version of Theorem 8). Assuming SETH, for any ε > 0, there is a c such that verifying a stable matching in the (boolean) d-dimensional geometric model with d = c log n dimensions requires time Ω(n2−ε ). Proof. Let U, V ⊆ {0, 1}d be the inputs to the minimum Hamming distance problem and let l be the threshold. For every u ∈ U , define a real man mu with both ideal and location as u ◦ 0l and a dummy woman wu′ with ideal and location u ◦ 1l . Symmetrically for v ∈ V define wv with v ◦ 0l and m′v with v ◦ 1l . The matching (mu , wu′ ) for all u ∈ U and (wv , m′v ) for all v ∈ V is stable if and only if there is there is no pair u, v with Hamming distance less than l. The hardness results for checking a stable pair also translate to the geometric model. In particular, since both variants of the proof extend to the geometric model we have the same consequences for nondeterministic algorithms. Corollary 8 (Geometric version of Theorem 9). Assuming SETH, for any ε > 0, there is a c such that determining whether a given pair is part of any or all stable matchings in the (boolean) d-dimensional geometric model with d = c log n dimensions requires time Ω(n2−ε ). Proof. We again reduce from the minimum Hamming distance problem. We assume without loss of generality that d is even and the threshold l is exactly d/2 + 1, i.e. the instance is true if and only if there are vectors u, v with Hamming distance at most d/2. We can reduce to this case from any other threshold by padding the vectors. We use the same preference orders as in the d-attribute model. The following narcissistic instance realizes the preference order from Theorem 9. For a vector u ∈ {0, 1}d , u denotes its component-wise complement. mu :(u ◦ u ◦ u ◦ u)3 ◦000000000 mi :012d ◦100000000 m∗ :012d 3 ◦001111111 wv :(v ◦ v ◦ v ◦ v) ◦000000000 wj :(02d ◦ 12d )3 ∗ 2d w :(0 2d 3 ◦1 ) ◦010000000 ◦101110000 Likewise the preference orders for Theorem 10 are achieved by the following vectors. 25 mu :(u ◦ u ◦ u ◦ u)3 ◦00000000000 mi :012d ◦10000000000 m∗ :012d 3 ◦00111111100 wv :(v ◦ v ◦ v ◦ v) ◦00000000000 wj :(02d ◦ 12d )3 ∗ 2d w :(0 7.3 ◦01000000011 2d 3 ◦1 ) ◦10111000000 Strategic Behavior With geometric and single-peaked preferences, we assume that the participants are not allowed to misrepresent their location points. Rather they may only misrepresent their preference ideal. As such, the results of this section do not apply when preferences are narcissistic. Theorem 12. There is no strategy proof algorithm to find a stable matching in the geometric preference model. Proof. We consider one-dimensional geometric preferences. Let the preference points and ideals be as given in Table 5 which yield the depicted preference lists. As in the proof for 3, there are two stable matchings: the man-optimal matching {(m1 , w3 ), (m2 , w1 ), (m3 , w2 )} and the woman-optimal matching {(m1 , w3 ), (m2 , w2 ), (m3 , w1 )}. However, if w2 changes her ideal to 5/3 then her preference list is m2 ≻ m1 ≻ m3 . Now there is a unique stable matching which is {(m1 , w3 ), (m2 , w2 ), (m3 , w1 )}, the woman-optimal stable matching from the original preferences. Therefore, any mechanism that does not always output the woman optimal stable matching can be manipulated by the women to their advantage. Similarly, any mechanism that does not always output the man-optimal matching could be manipulated by the men in some instances. Thus there is no strategy-proof mechanism for geometric preferences. Table 5: Geometric preferences that can be manipulated Man m1 m2 m3 Location (p) 1 2 3 Man m1 m2 m3 Ideal (q) 7/3 1 5/3 Woman w1 w2 w3 Location (p) 1 2 3 Ideal (q) 3 7/3 3 Preference List w2 ≻ w3 ≻ w1 w1 ≻ w2 ≻ w3 w2 ≻ w1 ≻ w3 Woman w1 w2 w3 Preference List m3 ≻ m2 ≻ m1 m2 ≻ m3 ≻ m1 m3 ≻ m2 ≻ m1 Since one-dimensional geometric preferences are a special case of single-peaked preferences the following corollary results directly from Theorem 12. 26 Corollary 9. There is no strategy proof algorithm to find a stable matching in the single-peaked preference model. 8 Conclusion and Open Problems We give subquadratic algorithms for finding and verifying stable matchings in the d-attribute model and d-list model. We also show that, assuming SETH, one can only hope to find such algorithms if the number of attributes d is bounded by O(log n). For a number of cases there is a gap between the conditional lower bound and the upper bound. Our algorithms with real attributes and weights are only subquadratic if the dimension is constant. Even for small constants our algorithm to find a stable matching is not tight, as it is not subquadratic for any d = O(log n). The techniques we use when the attributes and weights are small constants do not readily apply to the more general case. There is also a gap between the time complexity of our algorithms for finding a stable matching and verifying a stable matching. It would be interesting to either close or explain this gap. On the one hand, subquadratic algorithms for finding a stable matching would demonstrate that the attribute and list models are computationally simpler than the general preference model. On the other hand, proving that there are no subquadratic algorithms would show a distinction between the problems of finding and verifying a stable matching in these settings which does not exist for the general preference model. Currently, we do not have a subquadratic algorithm for finding a stable matching even in the 2-list case, while we have an optimal algorithm for verifying a stable matching for d lists. This 2-list case seems to be a good starting place for further research. Additionally it is worth considering succinct preference models for other computational problems that involve preferences to see if we can also develop improved algorithms for these problems. For example, the Top Trading Cycles algorithm [39] can be made to run in subquadratic time for dattribute preferences (when d is constant) using the ray shooting techniques applied in this paper to find participants’ top choices. Acknowledgment: We would like to thank Russell Impagliazzo, Vijay Vazirani, and the anonymous reviewers for helpful discussions and comments. References [1] Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. Quadratic-time hardness of LCS and other sequence similarity measures. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on. IEEE, 2015. [2] Pankaj K Agarwal, Lars Arge, Jeff Erickson, Paolo G Franciosa, and Jeffry Scott Vitter. Efficient searching with linear constraints. In Proceedings of the seventeenth ACM SIGACTSIGMOD-SIGART symposium on Principles of database systems, pages 169–178. ACM, 1998. [3] Pankaj K. Agarwal, Jeff Erickson, et al. Geometric range searching and its relatives. Contemporary Mathematics, 223:1–56, 1999. [4] Josh Alman and Ryan Williams. Probabilistic polynomials and hamming nearest neighbors. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on. IEEE, 2015. 27 [5] Esther M. Arkin, Sang Won Bae, Alon Efrat, Kazuya Okamoto, Joseph S.B. Mitchell, and Valentin Polishchuk. Geometric stable roommates. Information Processing Letters, 109(4):219– 224, 2009. [6] Arturs Backurs and Piotr Indyk. Edit distance cannot be computed in strongly subquadratic time (unless SETH is false). In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages 51–58, 2015. [7] John Bartholdi and Michael A. Trick. Stable matching with preferences derived from a psychological model. Operations Research Letters, 5(4):165–169, 1986. [8] Nayantara Bhatnagar, Sam Greenberg, and Dana Randall. Sampling stable marriages: why spouse-swapping won’t work. In Proceedings of the nineteenth annual ACM-SIAM symposium on Discrete algorithms, pages 1223–1232. Society for Industrial and Applied Mathematics, 2008. [9] Anna Bogomolnaia and Jean-François Laslier. Euclidean preferences. Journal of Mathematical Economics, 43(2):87–98, 2007. [10] Karl Bringmann. Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless seth fails. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 661–670. IEEE, 2014. [11] Marco L. Carmosino, Jiawei Gao, Russell Impagliazzo, Ivan Mihajlin, Ramamohan Paturi, and Stefan Schneider. Nondeterministic extensions of the strong exponential time hypothesis and consequences for non-reducibility. In Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science, pages 261–270. ACM, 2016. [12] Prasad Chebolu, Leslie Ann Goldberg, and Russell Martin. The complexity of approximately counting stable matchings. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, pages 81–94. Springer, 2010. [13] Kim-Sau Chung. On the existence of stable roommate matchings. Games and economic behavior, 33(2):206–230, 2000. [14] John Dabney and Brian C. Dean. Adaptive stable marriage algorithms. In Proceedings of the 48th Annual Southeast Regional Conference, page 35. ACM, 2010. [15] Sashka Davis and Russell Impagliazzo. Models of greedy algorithms for graph problems. Algorithmica, 54(3):269–317, 2009. [16] David P. Dobkin and David G. Kirkpatrick. A linear algorithm for determining the separation of convex polyhedra. Journal of Algorithms, 6(3):381–392, 1985. [17] David Gale and Lloyd S. Shapley. College admissions and the stability of marriage. The American Mathematical Monthly, 69(1):9–15, 1962. [18] David Gale and Marilda Sotomayor. Ms. machiavelli and the stable matching problem. The American Mathematical Monthly, 92(4):261–268, 1985. [19] Yannai A. Gonczarowski, Noam Nisan, Rafail Ostrovsky, and Will Rosenbaum. A stable marriage requires communication. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1003–1017. SIAM, 2015. 28 [20] Dan Gusfield. Three fast algorithms for four problems in stable marriage. SIAM Journal on Computing, 16(1):111–128, 1987. [21] Dan Gusfield and Robert W. Irving. The Stable Marriage Problem: Structure and Algorithms. Foundations of Computing Series. Mit Press, 1989. [22] John Hershberger and Subhash Suri. A pedestrian approach to ray shooting: Shoot a ray, take a walk. Journal of Algorithms, 18(3):403–431, 1995. [23] Russell Impagliazzo and Ramamohan Paturi. On the complexity of k-sat. Journal of Computer and System Sciences, 62(2):367 – 375, 2001. [24] Russell Impagliazzo, Ramamohan Paturi, and Stefan Schneider. A satisfiability algorithm for sparse depth two threshold circuits. In Foundations of Computer Science (FOCS), 2013 IEEE 54th Annual Symposium on, pages 479–488. IEEE, 2013. [25] Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63:512–530, 2001. [26] Robert W. Irving. An efficient algorithm for the “stable roommates” problem. Journal of Algorithms, 6(4):577–595, 1985. [27] Robert W. Irving and Paul Leather. The complexity of counting stable marriages. SIAM Journal on Computing, 15(3):655–667, 1986. [28] Samir Khuller, Stephen G. Mitchell, and Vijay V. Vazirani. On-line algorithms for weighted bipartite matching and stable marriages. Theoretical Computer Science, 127(2):255–267, 1994. [29] Donald E. Knuth. Stable marriage and its relation to other combinatorial problems: An introduction to the mathematical analysis of algorithms, volume 10. Amer Mathematical Society, 1997. [30] Hirotatsu Kobayashi and Tomomi Matsui. Cheating strategies for the gale-shapley algorithm with complete preference lists. Algorithmica, 58(1):151–169, 2010. [31] Jiřı́ Matoušek. Efficient partition trees. Discrete & Computational Geometry, 8(1):315–334, 1992. [32] Jiřı́ Matoušek and Otfried Schwarzkopf. Linear optimization queries. In Proceedings of the eighth annual symposium on Computational geometry, pages 16–25. ACM, 1992. [33] Cheng Ng and Daniel S. Hirschberg. Lower bounds for the stable marriage problem and its variants. SIAM Journal on Computing, 19(1):71–77, 1990. [34] Mihai Patrascu and Ryan Williams. On the possibility of faster SAT algorithms. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2010, Austin, Texas, USA, January 17-19, 2010, pages 1065–1075, 2010. [35] Alexander A. Razborov. Lower bounds on the size of bounded depth circuits over a complete basis with logical addition. Mathematical Notes, 41(4):333–338, 1987. [36] Alvin E. Roth. The economics of matching: Stability and incentives. Mathematics of operations research, 7(4):617–628, 1982. 29 [37] Alvin E. Roth and Marilda A. Oliveira Sotomayor. Two-sided Matching: A Study in Game - Theoretic Modeling and Analysis. Econometric Society Monographs. Cambridge University, 1990. [38] Ilya Segal. The communication requirements of social choice rules and supporting budget sets. Journal of Economic Theory, 136(1):341–378, 2007. [39] Lloyd Shapley and Herbert Scarf. On cores and indivisibility. Journal of mathematical economics, 1(1):23–37, 1974. [40] Roman Smolensky. Algebraic methods in the theory of lower bounds for boolean circuit complexity. In Proceedings of the nineteenth annual ACM symposium on Theory of computing, pages 77–82. ACM, 1987. [41] Chung-Piaw Teo, Jay Sethuraman, and Wee-Peng Tan. Gale-shapley stable marriage problem revisited: Strategic issues and applications. Management Science, 47(9):1252–1267, 2001. [42] Ryan Williams. A new algorithm for optimal constraint satisfaction and its implications. In Automata, Languages and Programming, pages 1227–1237. Springer, 2004. [43] Ryan Williams. Faster all-pairs shortest paths via circuit complexity. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing, pages 664–673. ACM, 2014. [44] Ryan Williams. Strong ETH breaks with merlin and arthur: Short non-interactive proofs of batch evaluation. In 31st Conference on Computational Complexity, CCC 2016, May 29 to June 1, 2016, Tokyo, Japan, pages 2:1–2:17, 2016. 30
8cs.DS
Proof rules for purely quantum programs arXiv:cs/0507043v3 [cs.PL] 16 Mar 2006 Yuan Feng, Runyao Duan, Zhengfeng Ji, and Mingsheng Ying State Key Laboratory of Intelligent Technology and Systems, Department of Computer Science and Technology, Tsinghua University, Beijing, China, 100084 January 27, 2018 Abstract We apply the notion of quantum predicate proposed by D’Hondt and Panangaden to analyze a purely quantum language fragment which describes the quantum part of a future quantum computer in Knill’s architecture. The denotational semantics, weakest precondition semantics, and weakest liberal precondition semantics of this language fragment are introduced. To help reasoning about quantum programs involving quantum loops, we extend proof rules for classical probabilistic programs to our purely quantum programs. 1 Introduction The theory of quantum computing has attracted considerable research efforts in the past twenty years. Benefiting from the possibility of superposition of different states and the linearity of quantum operations, quantum computing may provide considerable speedup over its classical analogue [15, 6, 7]. The existing quantum algorithms, however, are described at a very low level: they are usually represented as quantum circuits. A few works have been done in developing quantum programming languages which identify and promote high-level abstractions. Knill [8] moved the first step by outlining a set of basic principles for writing quantum pseudo-code; while the first actual quantum programming language is due to Ömer [12]. After that, Sanders and Zuliani [13], Bettelli et al. [1], and Selinger [14] also proposed various quantum languages each having different features. The standard weakest precondition calculus [4] and its probabilistic extension [11] have been successful in reasoning about the correctness and even the rigorous derivation of classical programs. This success motivates us to develop analogous tools for quantum programs. Sanders and Zuliani [13] have provided for their qGCL a stepwise refinement mechanics. The approach, however, is classical in the sense that they treated quantum programs as special cases of probabilistic programs. As a consequence, known results about probabilistic weakest precondition calculus can be applied directly to quantum programs. Indeed, Butler and Hartel [2] have used it to reason about Grover’s algorithm. The first step towards really quantum weakest precondition calculus was made by D’Hondt and Panangaden [3]. They proposed the brilliant idea that we can treat an observable, mathematically described by a Hermitian matrix, as the quantum analogue of ‘predicate’. The elegant duality between state-transformer semantics and the weakest precondition semantics of quantum programs was then proven to hold in a more direct way. In this paper, we apply the ideas in [3] to analyze a purely quantum language fragment describing the quantum part of a potential quantum computer in Knill’s architecture [8]. The syntax follows Selinger’s style but we consider only purely quantum data. We introduce the denotational semantics for this purely quantum language fragment, which are represented by super-operators. The weakest precondition semantics corresponding to total correctness and weakest liberal precondition semantics corresponding to partial correctness are also introduced. To help reasoning about quantum loops, we also extend proof rules for classical probabilistic programs to our purely quantum programs. 2 Preliminaries In this section, we review some notions and results from [3] which are the basis of our work. Let H be the associated Hilbert space of the quantum system we are concerned with, and L(H) the set of linear operators (or complex matrices, we do not distinguish between these two notions) on H. Let DH be the set of all density operators on H, that is, DH := { ρ ∈ L(H) | 0 ⊑ ρ, Tr(ρ) ≤ 1}, where 0 denotes the zero operator. The convention of allowing the trace of a density matrix to be less than 1 makes it possible to represent both the actual state (by the normalized density matrix) and the probability with which the state is reached (by the trace of the density matrix) [14]. The partial order ⊑ is defined on the set of all matrices with the same dimension by letting M ⊑ N if N − M is positive. Then the set of quantum programs over H is defined as QH := {E ∈ DH → DH | E is a super-operator}. We lift the partial order in DH to the one in QH by letting E ⊑ F if E(ρ) ≤ F (ρ) for any ρ ∈ DH. It is proved in [3] that the two sets DH and QH are both CPOs. In D’Hondt and Panangaden’s approach, a quantum predicate is described by a Hermitian positive matrix with the maximum eigenvalue bounded by 1. To be specific, the set of quantum predicates on Hilbert space H is defined by PH := {M ∈ L(H) | M † = M, 0 ⊑M ⊑ I}. For any ρ ∈ DH and M ∈ PH, the degree of ρ satisfying M is denoted by the expression TrM ρ. It is exactly the expectation of the outcomes when performing a measurement represented by M on the state ρ. The ‘healthy’ predicate transformers which exactly characterize all valid quantum programs are proved to be those who are linear and completely positive [3]. That is, there exists an isomorphic map between the set of healthy quantum predicate transformers T H := {T ∈ PH → PH | T is linear and completely positve} and the set of quantum programs QH defined above, just as the cases for classical standard [4] and probabilistic programs [11]. 3 The purely quantum language fragment and its semantics In this section, we concentrate our attention on the purely quantum fragment of a general programming language. That is, only quantum data but no classical data are considered. Following Knill’s QRAM model [8], a quantum computer in the future possibly consists of a general-purpose classical computer which controls a special quantum hardware device. The quantum device contains a large, but finite number of individually addressable quantum bits. The classical controller communicates with the quantum device by sending a sequence of control instructions and receiving the results of the measurements on quantum bits. Our purely quantum language considered here then aims at 2 Figure 1: Denotational semantics [[abort]]ρ := 0 [[skip]]ρ [[q := 0]]ρ := ρ := |0iq h0|ρ|0iq h0| + |0iq h1|ρ|1iq h0| [[q̄∗ = U ]]ρ [[S1 ; S2 ]]ρ [[measure q then S0 else S1 ]]ρ [[while q do S ]]ρ := Uq̄ ρUq̄† := [[S2 ]]([[S1 ]]ρ) := [[S0 ]](|0iq h0|ρ|0iq h0|) + [[S1 ]](|1iq h1|ρ|1iq h1|) i := ⊔∞ i=0 [[(while q do S) ]]ρ describing the action of the special quantum device, rather than the behavior of the whole computer including the classical controller. Suppose S, S0 and S1 denote purely quantum programs, q1 , . . . , qn and q denote qubit-typed variables, and U denotes a unitary transformation which applies on a 2n -dimensional Hilbert space. The syntax of our purely quantum language is defined as follows: S ::= abort | skip | q := 0 | q1 , q2 , . . . , qn ∗ = U | S0 ; S1 | measure q then S0 else S1 | while q do S. Here we borrow the notations from [14] except for the loop statements in which loop conditions are also purely quantum. Intuitively, the statement q := 0 initializes qubit q by setting it to the standard state |0i. Note that it is the only assignment in the language. This is also why our language is functional rather than imperative. The statement q1 , q2 , . . . , qn ∗ = U applies the unitary transformation U on n distinct qubits q1 , q2 , . . . , qn . We put the constraint that q1 , q2 , . . . , qn must be distinct to avoid syntactically some no-go operations such as quantum cloning. The statement measure q then S0 else S1 first applies a measurement on qubit q, then executes S0 or S1 depending on whether the measurement result is 0 or 1. The loop statement while q do S measures qubit q first. If the result is 1, then it terminates; otherwise it executes S and the loop repeats. Formally, we have the following denotational semantics: Definition 3.1 For any purely quantum program S, the denotational semantics of S is a map [[S ]] from DH to DH defined inductively in Figure 1, where (while q do S)0 := abort and (while q do S)i+1 := measure q then S; (while q do S)i else skip. In Definition 3.1, q̄ denotes the abbreviation of q1 , . . . , qn , Uq̄ means applying U on the Hilbert space spanned by qubits q̄, and |0iq h0|ρ|0iq h0| denotes the application |0ih0| • |0ih0| on qubit q when the initial state is ρ, leaving other qubits unchanged. That is, |0iq h0|ρ|0iq h0| = (IH1 ⊗ |0ih0| ⊗ IH2 )ρ(IH1 ⊗ |0ih0| ⊗ IH2 ) for some appropriate Hilbert spaces H1 and H2 . In Section 4, we often omit the subscript q for simplicity when no confusion arises. The following lemma shows that the denotational semantics of our purely quantum programs are all super-operators. So they can be physically implemented in a future quantum computer. 3 Lemma 3.2 For any purely quantum program S, the denotational semantics of S is a super-operator on DH, i.e., [[S ]] ∈ QH. Proof. We prove the theorem by induction on the structure of S. When S has the form other than quantum loop, the proof is straightforward. So in what follows, we assume S ≡ while q do S ′ and [[S ′ ]] ∈ QH for induction hypothesis. To prove [[S ]] ∈ QH, we need only to show that for any i ≥ 0, [[(while q do S)i ]] ∈ QH (1) [[(while q do S)i ]] ⊑ [[(while q do S)i+1 ]]. (2) and Eq.(1) is easy to prove by induction on i. To prove Eq.(2), notice first that for any ρ ∈ DH, [[abort]]ρ = 0 is the bottom element of DH. So [[abort]] is the bottom element of QH and then Eq.(2) holds trivially for the case i = 0. Suppose further Eq.(2) holds for i = k. Then we calculate that for any ρ ∈ DH, = ⊒ = [[(while q do S)k+1 ]]ρ [[(while q do S)k ]]([[S ]](|0iq h0|ρ|0iq h0|)) + |1iq h1|ρ|1iq h1| [[(while q do S)k−1 ]]([[S ]](|0iq h0|ρ|0iq h0|)) + |1iq h1|ρ|1iq h1| by definition induction hypothesis by definition k ]] [[(while q do S) ρ. Finally, from the fact that QH is a CPO we have [[S ]] ∈ QH.  Note that the syntax of the language we consider does not provide the power to create new qubits. So by our purely quantum programs we cannot implement all super-operators on DH since in general to realize a super-operator we need to introduce some auxiliary qubits. It seems to be a bad news. In practice, however, the number of qubits a quantum program can use is restricted by the maximum a real quantum computer can provide. The domain of the semantics of our purely quantum programs is the Hilbert space associated with the quantum device as a whole, so they indeed include all real operations we can perform on a quantum computer. Following the idea of quantum predicate presented in [3], we define the weakest precondition semantics of our purely quantum programs as follows: Definition 3.3 For any purely quantum program S, the weakest precondition semantics of S is defined by a map wp.S from PH to PH defined inductively in Figure 2, where (while q do S)i is defined in Definition 3.1. An alternative definition of wp.(while q do S).M is the least fixed point µX·(|0iq h0|wp.S.X|0iq h0|+ |1iq h1|M |1iq h1|). It is easy to check that these two definitions are equivalent. The following theorem shows a quantitative relation between denotational semantics and weakest precondition semantics. Intuitively, the expectation of observing any quantum predicate on the output of a quantum program is equal to the expectation of observing the weakest precondition of this predicate on the input state. Theorem 3.4 For any purely quantum program S, quantum predicate M ∈ PH, and ρ ∈ DH, we have Tr(wp.S.M )ρ = TrM [[S ]]ρ (3) Proof. We need only to consider the case that S ≡ while q do S ′ is a quantum loop. Other cases are easy to check. 4 Figure 2: weakest precondition semantics wp.abort.M := 0 wp.skip.M wp.(q := 0).M := := M |0iq h0|M |0iq h0| + |1iq h0|M |0iq h1| wp.(q̄∗ = U ).M wp.(S1 ; S2 ).M := := Uq̄† M Uq̄ wp.S1 .(wp.S2 .M ) wp.(measure q then S0 else S1 ).M := 1 X wp.(while q do S).M := |iiq hi|wp.Si .M |iiq hi| i=0 i ⊔∞ i=0 wp.(while q do S) .M Suppose Eq.(3) holds for the program S ′ , i.e., ∀M ∈ PH; ρ ∈ DH · Tr(wp.S ′ .M )ρ = TrM [[S ′ ]]ρ. (4) We first prove by induction that for any i ≥ 0 ∀M ∈ PH; ρ ∈ DH · Tr(wp.S i .M )ρ = TrM [[S i ]]ρ. (5) When i = 0, Eq.(5) holds because both sides equal to 0. Suppose now that Eq.(5) holds for i = k. Then when i = k + 1, we calculate that for any M ∈ PH and ρ ∈ DH, Tr(wp.S k+1 .M ρ) = Tr(|0iq h0|wp.S ′ .(wp.S k .M )|0iq h0| + |1iq h1|M |1iq h1|)ρ = = Tr(wp.S ′ .(wp.S k .M )|0iq h0|ρ|0iq h0|) + TrM |1iq h1|ρ|1iq h1| by Eq.(4) Tr((wp.S k .M )[[S ′ ]]|0iq h0|ρ|0iq h0|) + TrM |1iq h1|ρ|1iq h1| TrM [[S k ]]([[S ′ ]]|0iq h0|ρ|0iq h0|) + TrM |1iq h1|ρ|1iq h1| by induction hypothesis TrM [[S k+1 ]]ρ. = = So we deduce that Eq.(5) holds for any i ≥ 0. And then Tr(wp.S.M )ρ = Tr(⊔i wp.S i .M )ρ = = ⊔i Tr(wp.S i .M )ρ ⊔i TrM [[S i ]]ρ TrM ⊔i [[S i ]]ρ TrM [[S ]]ρ. = = That completes our proof. by Eq.(5)  Taking M = I in Eq.(3), we have Tr(wp.S.I)ρ = Tr[[S ]]ρ. Notice that the righthand side of the above equation denotes the probability the (un-normalized) output state [[S ]]ρ is reached. So intuitively, for any purely quantum program S, the quantum 5 Figure 3: weakest liberal precondition semantics := I wlp.abort.M := M := |0iq h0|M |0iq h0| + |1iq h0|M |0iq h1| wlp.skip.M wlp.(q := 0).M := Uq̄† M Uq̄ := wlp.S1 (wlp.S2 .M ) wlp.(q̄∗ = U ).M wlp.(S1 ; S2 ).M wlp.(measure q then S0 else S1 ).M := wlp.(while q do S).M := 1 X |iiq hi|wlp.Si .M |iiq hi| i=0 i ⊓∞ i=0 wlp.(while q do S) .M predicate wp.S.I denotes the condition the program S terminates, in analogy with the predicate wp.S.true in classical standard setting and wp.S.1 in classical probabilistic setting. We have so far defined the weakest precondition semantics, which is useful when we consider the total correctness of quantum programs. That is, what we care is not only the correctness of the final state when the program terminates, but also the condition and the probability a quantum program can terminate. To deal with partial correctness of quantum programs, we introduce the notion of weakest liberal precondition semantics as follows: Definition 3.5 For any purely quantum program S, the weakest liberal precondition semantics of S is defined by a map wlp.S from PH to PH defined inductively in Figure 3, where (while q do S)i is defined in Definition 3.1. Analogous with weakest precondition semantics, an alternative definition of wlp. (while q do S).M is the greatest fixed point νX · (|0iq h0|wlp.S.X|0iq h0| + |1iq h1| M |1iq h1|). The following theorem shows a quantitative connection between denotational semantics and weakest liberal precondition semantics. Theorem 3.6 For any purely quantum program S, quantum predicate M ∈ PH, and ρ ∈ DH, we have Tr(wlp.S.M )ρ = TrM [[S ]]ρ + Trρ − Tr[[S ]]ρ. (6) Proof. Similar to Theorem 3.4.  Taking M = 0 in Eq.(6), we have Tr(wlp.S.0)ρ = Trρ − Tr[[S ]]ρ. Notice that the righthand side of the above equation denotes the probability the program S does not terminate when the input state is ρ. So intuitively the quantum predicate wlp.S.0 denotes the condition the program S diverges. Corollary 3.7 For any purely quantum program S and quantum predicate M ∈ PH, wp.S.M ⊑ wlp.S.M and wlp.S.M + wp.S.(I − M ) = I 6 To get a clearer picture of the connection between these two precondition semantics, let us introduce a notion which is the analogue of conjunction ∧ of classical standard predicates and probabilistic conjunction & of classical probabilistic predicates (see, for example, [10]). Definition 3.8 Suppose M and N are two quantum predicate. We define M &N as a new predicate M &N := (M + N − I)+ , P where P for any Hermitian matrix X, if X = i λi Pi is the spectrum decomposition of X, then X + = i max{λi , 0}Pi . It is obvious that if M + N ⊒ I, then M &N = M + N − I. Theorem 3.9 For any quantum predicates M, N ∈ PH and any purely quantum program S, if M + N ⊒ I then wp.S.(M &N ) = wp.S.M & wlp.S.N (7) and wlp.S.(M &N ) = wlp.S.M & wlp.S.N (8) Proof. We only prove Eq.(7); the proof of Eq.(8) is similar. From the assumption that M + N ⊒ I, we have M &N = M + N − I. Then for any ρ : DH, Trwp.S.(M &N )ρ = Trwp.S.(M + N − I)ρ = Tr(M + N − I)[[S ]]ρ = TrM [[S ]]ρ + TrN [[S ]]ρ − Tr[[S ]]ρ Theorem 3.4 = Trwp.S.M ρ + Trwlp.S.N ρ − Trρ Theorems 3.4 and 3.6 = Tr(wp.S.M + wlp.S.N − I)ρ So we have wp.S.(M &N ) = wp.S.M + wlp.S.N − I and then wp.S.(M &N ) = wp.S.M & wlp.S.N from the fact that wp.S.(M &N ) ⊒ 0.  When taking N = I in Eq.(7), we have the following direct but useful corollary: Corollary 3.10 For any purely quantum program S and quantum predicate M , wp.S.M = wp.S.I & wlp.S.M (9) Recall that wp.S.I denotes the condition the program S terminates. So the intuitive meaning of Eq.(9) is that a program is total correct (represented by weakest precondition semantics) if and only if it is partial correct (represented by weakest liberal precondition semantics) and it terminates. This capture exactly the intuition of total correctness and partial correctness. To conclude this section, we present some properties of weakest liberal precondition semantics which are useful in the next section. The proofs are direct so we omit the details here. Lemma 3.11 For any purely quantum program S and quantum predicate M, N ∈ PH, we have 1) wlp.S.I = I; 2) (monotonicity) if M ⊑ N then wlp.S.M ⊑ wlp.S.N ; 3) if M + N ⊑ I then wlp.S.(M + N ) = wp.S.M + wlp.S.N ; 4) if M ⊒ N then wlp.S.(M − N ) = wlp.S.M − wp.S.N . 7 4 Proof rules for quantum loops Proof rules for programs are important on the way to designing more general refinement techniques for programming. In this section, we derive some rules for reasoning about loops in our purely quantum language fragment. We find that almost all loop rules derived in classical probabilistic programming (see, for example, [10] or [9]) can be extended to quantum case. In classical standard or probabilistic programming languages, an appropriate invariant is the key to reasoning about loops. It is also true in quantum case. So our first theorem is devote to reasoning about quantum loops within partial correctness setting using wlp-invariants. Recall that in classical probabilistic programming, if Inv is a wlp-invariant of a loop statement loop ≡ “while b do S” satisfying [b] ∗ Inv ⇛ wlp.S.Inv, then Inv ⇛ wlp.loop.([b] ∗ Inv). Here ⇛ means “everywhere no more than”, which is the probabilistic analogue of the implication relation “⇒” in standard logic. Theorem 4.1 For any quantum predicate M ∈ PH, if 1 X |iihi|M |iihi|) |0ih0|M |0ih0| ⊑ wlp.S.( (10) i=0 then 1 X |iihi|M |iihi| ⊑ wlp.qloop.(|1ih1|M |1ih1|). i=0 Here and in what follows, by qloop we denote the quantum program “while q do S”. Proof. By definition, we have wlp.qloop.(|1ih1|M |1ih1|) = ⊓∞ j=0 Mj , where M0 = I and for j ≥ 1, Mj+1 = |0ih0|wlp.S.Mj |0ih0| + |1ih1|M |1ih1|. In what follows, we prove by induction that for any j ≥ 0, 1 X |iihi|M |iihi| ⊑ Mj . (11) i=0 When j = 0, Eq.(11) holds trivially. Suppose Eq.(11) holds for j = k. Then when j = k + 1, we have Mk+1 = |0ih0|wlp.S.Mk |0ih0| + |1ih1|M |1ih1| ⊒ 1 X |iihi|M |iihi|)|0ih0| + |1ih1|M |1ih1| |0ih0|wlp.S.( i=0 induction hypothesis and Lemma 3.11 (2) ⊒ |0ih0|M |0ih0| + |1ih1|M |1ih1|. With that we complete the proof of this theorem. 8 Eq.(10)  P1 P1 We say i=0 |iihi|M |iihi| is a wlp-invariant of qloop if Eq.(10) holds; similarly, i=0 |iihi|M |iihi| is a wp-invariant of qloop if 1 X |iihi|M |iihi|). |0ih0|M |0ih0| ⊑ wp.S.( (12) i=0 We now turn to reasoning about quantum loops in total correctness setting. Following the remark behind Corollary 3.10, we give the total correctness of quantum loops by combining partial correctness with the termination condition. To simplify notations, we define T := wp.qloop.I. Intuitively, T denotes the termination condition of qloop. For any quantum loop, if a wp-invariant implies the termination condition, then its partial correctness is sufficient to guarantee its total correctness, as the following lemma states. P Lemma 4.2 For any quantum predicate M ∈ PH, if 1i=0 |iihi|M |iihi| is a wp-invariant of qloop, wp.S.T ⊑ T , and 1 X |iihi|M |iihi| ⊑ T, (13) i=0 then 1 X |iihi|M |iihi| ⊑ wp.qloop.(|1ih1|M |1ih1|). i=0 Proof. Let M ′ := 1 X |iihi|M |iihi| + I − T. i=0 Noticing that from definition we have T = |0ih0|wp.S.T |0ih0| + |1ih1|, then and |0ih0|T |0ih0| = |0ih0|wp.S.T |0ih0|, (14) |1ih1|T |1ih1| = |1ih1| (15) 1 X (16) |iihi|T |iihi| = T. i=0 P Furthermore, we can check that M ′ = 1i=0 |iihi|M ′ |iihi|. From the assumption Eq.(13), we can easily derive 0 ⊑ M ′ ⊑ I, and M ′ is also a quantum predicate on H. We calculate X wlp.S. |iihi|M ′ |iihi| X = wlp.S.( |iihi|M |iihi| + I − T ) X = wp.S. |iihi|M |iihi| + wlp.S.(I − T ) Lemma 3.11 (3) X = wp.S. |iihi|M |iihi| + wlp.S.I − wp.S.T Lemma 3.11 (4) ⊒ |0ih0|M |0ih0| + I − T Lemma 3.11 (1) and Eq.(12) = = |0ih0|M |0ih0| + |0ih0| − |0ih0|T |0ih0| |0ih0|M ′ |0ih0|. Eqs.(14) − (16) 9 So P1 i=0 |iihi|M ′ |iihi| is a wlp-invariant of qloop. We further calculate 1 X |iihi|M |iihi| i=0 ′ = M +T −I ⊑ wlp.qloop.(|1ih1|M ′ |1ih1|) + T − I definition of M ′ Theorem 4.1 = wlp.qloop.(|1ih1|M ′ |1ih1|) & T = wp.qloop.(|1ih1|M ′ |1ih1|) Corollary 3.7 Eq. (9) = wp.qloop.(|1ih1|M |1ih1|). Eq. (15) That completes our proof.  To conclude this section, we generalize the powerful 0-1 law in classical programming to quantum case. Informally, 0-1 law states that if the probability of a loop terminating from a state is at least p for some fixed p > 0 (no matter how small p is), then the loop terminates with certainty when started from that state. In other words, the terminating probability is either 0 or 1 and cannot lie properly between 0 and 1. P1 Lemma 4.3 For any quantum predicate M ∈ PH, if i=0 |iihi|M |iihi| is a wp-invariant of qloop, P1 wp.S.T ⊑ T , and ∃ 0 < p ≤ 1 such that p ∗ i=0 |iihi|M |iihi| ⊑ T then 1 X |iihi|M |iihi| ⊑ T. i=0 Proof. Let M ′ := p ∗ M . Then P1 i=0 |iihi|M ′ |iihi| ⊑ T and furthermore, |0ih0|M ′ |0ih0| = p ∗ |0ih0|M |0ih0| 1 X |iihi|M |iihi|) ⊑ p ∗ wp.S.( i=0 1 X |iihi|M ′ |iihi|). = wp.S.( linearity of wp.S i=0 So we can derive that p∗ 1 X i=0 |iihi|M |iihi| = 1 X |iihi|M ′ |iihi| i=0 ⊑ wp.qloop.(|1ih1|M ′ |1ih1|) Lemma 4.2 = p ∗ wp.qloop.(|1ih1|M |1ih1|) ⊑ p ∗ wp.qloop.I linearity of wp.qloop monotonicity of wp.qloop = p ∗ T. Dividing both sides by the positive number p, we arrive at the desired result.  Theorem 4.4 (0-1 law for quantum loops) If T is positive-definite and wp.S.T ⊑ T , then for any quantum predicate M ∈ PH such that 1 X |iihi|M |iihi|), |0ih0|M |0ih0| ⊑ wp.S.( i=0 10 we have 1 X |iihi|M |iihi| ⊑ wp.qloop.(|1ih1|M |1ih1|). i=0 P1 Proof. From the assumption that T is positive-definite, for any wp-invariant i=0 |iihi|M |iihi| P1 of qloop there exists a sufficiently small but positive p such that p ∗ i=0 |iihi|M |iihi| ⊑ T . So P1 i=0 |iihi|M |iihi| ⊑ T from Lemma 4.3. Then the result of this theorem holds by applying Lemma 4.2.  5 Conclusion In this paper, we applied the notion of quantum predicate proposed by D’Hondt and Panangaden in [3] to analyze a purely quantum language fragment which involves only quantum-typed variables. This language can be treated as the quantum fragment of a general programming language, describing the quantum device of a future quantum computer in Knill’s architecture. The denotational semantics of this language was introduced. We further proposed the weakest precondition semantics and weakest liberal precondition semantics, corresponding respectively to total and partial correctness of quantum programs. The connections between these three semantics were discussed. To help reasoning about quantum loops, we extended all existing proof rules for loops in classical probabilistic programs to the case of our purely quantum programs. Acknowledgement The authors thank the colleagues in the Quantum Computation and Quantum Information Research Group for useful discussion. This work was partly supported by the Natural Science Foundation of China (Grant Nos. 60503001, 60321002, and 60305005), and by Tsinghua Basic Research Foundation (Grant No. 052220204). R. Duan acknowledges the financial support of Tsinghua University (Grant No. 052420003). References [1] S. Bettelli, T. Calarco, and L. Serafini. Toward an architecture for quantum programming. European Physical Journal D, 25(2):181–200, 2003. [2] Michael Butler and Pieter Hartel. Reasoning about grover’s quantum search algorithm using probabilistic wp. ACM Transactions on Programming Languages and Systems, 21(3):417–429, 1999. [3] Ellie D’Hondt and Prakash Panangaden. Quantum weakest preconditions. In P. Selinger, editor, Proceedings of the 2nd Workshop on Quantum Programming Languages (QPL04), Turku Centre for Computer Science, 2004. [4] E. W. Dijkstra. A Discipline of Programming. Prentice-Hall, 1976. [5] Y. Feng, R. Y. Duan, and M. S. Ying. Catalyst-assisted probabilistic entanglement transformation. IEEE Transactions On Information Theory, 51(3):1090–1101, 2005. [6] L. K. Grover. A fast quantum mechanical algorithm for database search. In Proc. ACM STOC, pages 212–219, 1996. 11 [7] L. K. Grover. Quantum mechanics helps in searching for a needle in a haystack. Physical Review Letters, 78(2):325, 1997. [8] E. H. Knill. Conventions for quantum pseudocode. LANL report LAUR-96-2724, 1996. [9] A. McIver and C. Morgan. Abstraction, refinement and proof for probabilistic systems. SpringerVerlag, 2005. [10] C. Morgan. Proof rules for probabilistic loops. Technical Report PRG-TR-25-95, 1995. Programming Research Group, Oxford University. [11] Carroll Morgan, Annabelle McIver, and Karen Seidel. Probabilistic predicate transformers. ACM Transactions on Programming Languages and Systems, 18(3):325–353, 1996. [12] B. Ömer. A procedural formalism http://tph.tuwien.ac.at/oemer/qcl.html. for quantum computing, July 1998. [13] J. W. Sanders and P Zuliani. Quantum programming. Mathematics of Program Construction, 1837:80–99, 2000. [14] P. Selinger. Towards a quantum programming language. Mathematical Structures in Computer Science, 14(4):527–586, 2004. [15] Peter W. Shor. Algorithms for quantum computation: discrete log and factoring. In Proceedings of the 35th IEEE FOCS, pages 124–134, 1994. [16] André van Tonder. Quantum computation, categorical semantics and linear logic, 2003. arXiv:quant-ph/0312174. [17] André van Tonder. A lambda calculus for quantum computation. SIAM Journal on Computing, 33(5):1109–1135, 2004. [18] M. S. Ying. Reasoning about probabilistic sequential programs in a probabilistic logic. Acta Informatica, 39(5):315–389, 2003. 12
6cs.PL
ON THE ASYMPTOTIC BEHAVIOR OF THE CONTAMINATED SAMPLE MEAN arXiv:1502.07181v5 [math.ST] 10 Dec 2017 BEN BERCKMOES AND GEERT MOLENBERGHS Abstract. An observation of a cumulative distribution function F with finite variance is said to be contaminated according to the inflated variance model if it has a large probability of coming from the original target distribution F , but a small probability of coming from a contaminating distribution that has the same mean and shape as F , though a larger variance. It is well known that in the presence of data contamination, the ordinary sample mean looses many of its good properties, making it preferable to use more robust estimators. It is insightful to see to what extent an intuitive estimator such as the sample mean becomes less favorable in a contaminated setting. In this paper, we investigate under which conditions the sample mean, based on a finite number of independent observations of F which are contaminated according to the inflated variance model, is a valid estimator for the mean of F . In particular, we examine to what extent this estimator is weakly consistent for the mean of F and asymptotically normal. As classical central limit theory is generally inaccurate to cope with the asymptotic normality in this setting, we invoke more general approximate central limit theory as developed by Berckmoes, Lowen, and Van Casteren (2013). Our theoretical results are illustrated by a specific example and a simulation study. 1. Introduction Suppose that we are given a finite number of independent observations X1 , . . . , Xn of a cumulative distribution F on the real line with mean P µ and finite variance. It is well known that the sample mean X n = n1 nk=1 Xk is an accurate estimator in the sense that it is consistent for µ, asymptotically normal, and under broad conditions also efficient. Now assume that there is an underlying mechanism causing each observation to be contaminated according to the inflated variance model (Titterington, Smith, and Makov 1985:108). That is, instead of each Xk having distribution F , there is a large probability that Xk comes from the distribution F , but a small probability that it comes from a contaminating distribution F ( σ·k ), σk ≥ Var(F ), which has the same shape and mean as F , though a larger variance. It is well known that in this contaminated setting, the ordinary sample mean becomes less reliable, and more robust estimators Key words and phrases. approximate central limit theory, asymptotic normality, consistency, contaminated data, Kolmogorov distance, Lindeberg index, sample mean. Ben Berckmoes is post doctoral fellow at the Fund for Scientific Research of Flanders (FWO). Geert Molenberghs gratefully acknowledges financial support from the IAP research network #P7/06 of the Belgian Government (Belgian Science Policy). 1 2 BEN BERCKMOES AND GEERT MOLENBERGHS should be used (Huber and Ronchetti 2009). It is insightful to show to what extent the good properties of the sample mean are lost in this setting. In this paper, we investigate under what conditions the sample mean in this contaminated setting remains (weakly) consistent for µ and asymptotically normal. It will turn out that the weak consistency can be easily established under a fairly weak condition using Chebyshev’s inequality (Theorem 4.1) and that the asymptotic normality can be established using classical central limit theory if the sequence of contaminating variances (σk )k can be controlled sufficiently (Theorem 4.4). However, if no sufficient control over the sequence (σk )k is possible, we end up with an interesting class of settings in which classical central limit theory is inaccurate to describe the asymptotic behavior of the sample mean. This is due to the fact that in this case the question of whether the sample mean is asymptotically normal should be answered, rather than in a dichotomous (yes/no) way, in a continuous fashion. Instead we will use the approximate generalization of classical central limit theory, as developed by Berckmoes et al. (2013), to produce a number between 0 and 1, which is interpretable as an upper bound for a canonical index measuring how far the sample mean deviates from being asymptotically normal (Theorem 4.10). We thus get a gradation in which we are closer to asymptotic normality in some cases, and further away from it in others. This will be made visible by QQ-plots coming from a simulation study The paper is structured as follows. In section 2 the formal framework in which we will work and the notation we will use is sketched. The key results of approximate central limit theory developed by Berckmoes et al. (2013) are explained in section 3. Section 4 is the core of this paper. Here we give the theoretical results concerning the asymptotic properties of the sample mean in the contaminated setting. A specific example and a simulation study are given in section 5. Finally, in section 6 we formulate some open questions for further research. 2. Formal framework Let F be a cumulative distribution function on the real line with Z ∞ xdF (x) = 0 −∞ and Z ∞ x2 dF (x) = 1. −∞ Fix µ ∈ R and let X1 , X2 , . . ., Xk , . . . be independent observations of F (· − µ) which are contaminated according to the inflated variance model (Titterington et al. 1985:108), that is   ·−µ , Xk ∼ (1 − pk )F (· − µ) + pk F σk where pk ∈ [0, 1] and σk ∈ [1, ∞[. Observe that E[Xk ] = µ 3 and Var[Xk ] = (1 − pk ) + pk σk2 . Now define the sample mean in the usual way as n Xn = 1X Xk . n k=1 Notice that E[X n ] = µ and Var[X n ] =  s 2 n n , where s2n = n X [(1 − pk ) + pk σk2 ]. k=1 Also, s2n ≥ n, (1) because σk2 ≥ 1 for all k. In this paper, we investigate to what extent the estimator X n is weakly consistent for µ in the sense that P Xn → µ and asymptotically normal in the sense that  w n X n − µ → N (0, 1). sn (2) (3) Notice that in the uncontaminated case where σk = 1 for all k, the weak law of large numbers implies the truth of (2) and the central limit theorem implies the validity of (3). For our study of the asymptotic normality, we fall back on approximate central limit theory as developed by Berckmoes et al. (2013). We briefly recall the basics of this theory in the next section. 3. Approximate central limit theory By a standard triangular array (STA) we mean a triangular array of real square integrable random variables ξ1,1 ξ2,1 ξ2,2 ξ3,1 ξ3,2 ξ3,3 .. . with the following properties: (1) ∀n : ξn,1 , . . . , ξn,n are independent, (2) ∀n, k : E [ξn,kh] = 0, i P 2 (3) ∀n : nk=1 E ξn,k = 1. 4 BEN BERCKMOES AND GEERT MOLENBERGHS We say that an STA {ξn,k } satisfies Lindeberg’s condition iff ∀ > 0 : lim n→∞ n X  2  E ξn,k ; |ξn,k | ≥  = 0 k=1 and that it satisfies Feller’s condition iff  2  n lim max E ξn,k = 0. n→∞ k=1 It is well known (and readily verified) that Lindeberg’s condition is strictly stronger than Feller’s condition. The importance of the notions explained above is reflected by the following key result in classical central limit theory (Feller 1971). Theorem 3.1 (Central Limit Theorem (CLT)). Consider, for ξ ∼ N (0, 1) and {ξn,k } an STA, the following assertions: P w (1) The weak convergence relation nk=1 ξn,k → ξ holds. (2) The STA {ξn,k } satisfies Lindeberg’s condition. Then assertion (2) implies assertion (1) and both assertions are equivalent if {ξn,k } satisfies Feller’s condition. Now suppose that we are given an STA {ξn,k } which satisfies Feller’s condition, but fails to satisfy Lindeberg’s condition. Then we infer from classical central limit theory (Theorem 3.1) that the row-wise sums of {ξn,k } fail to be asymptotically normal. However, inspired by approach theory, a topological theory pioneered by Lowen (2015) (the details of which are not needed for a proper understanding of this paper), we could ask the following P question. How far does nk=1 ξn,k deviate from ξ if n gets large? In order to formalize this question, recall that the Kolmogorov distance between random variables η and η 0 is given by K(η, η 0 ) = sup P[η ≤ x] − P[η 0 ≤ x] . (4) x∈R It is well known that for a continuously distributed random variable η and an arbitrary sequence of random variables (ηn )n the following are equivalent: w (1) ηn → η, (2) K(η, ηn ) → 0. P Thus, even for an STA {ξn,k } for which the sequence ( nk=1 ξn,k )n fails to converge weakly to ξ, it still makes sense to consider the number ! n X lim sup K ξ, ξn,k , (5) n→∞ k=1 which takes values between 0 and 1 and measures in a precise sense how far the sequence of row-wise sums deviates from being asymptotically normal. In the language of approach theory, expression (5) is referred to as a limit operator or an index of convergence (Berckmoes, P Lowen, and Van Casteren 2011; Lowen 2015). Notice that lim supn→∞ K (ξ, nk=1 ξn,k ) = 0 if and only P w if nk=1 ξn,k → ξ. 5 For an arbitrary STA {ξn,k } it also makes sense to introduce the number Lin ({ξn,k }) = sup lim sup >0 n→∞ n X  2  E ξn,k ; |ξn,k | ≥  , (6) k=1 which lies between 0 and 1 and is a canonical index which measures how far {ξn,k } deviates from satisfying Lindeberg’s condition. Expression (6) is called the Lindeberg index. Observe that Lin({ξn,k }) = 0 if and only if {ξn,k } satisfies Lindeberg’s condition. The following result, which connects the expressions (5) and (6) for an arbitrary STA satisfying Feller’s condition, lies at the heart of approximate central limit theory developed by Berckmoes et al. (2013). The proof relies on Stein’s method (Barbour and Chen 2005). Theorem 3.2 (Approximate Central Limit Theorem (ACLT)). Consider ξ ∼ N (0, 1) and {ξn,k } an STA which satisfies Feller’s condition. Then ! n X lim sup K ξ, ξn,k ≤ Lin ({ξn,k }) . n→∞ k=1 Notice that the ACLT is a generalization of the CLT which has the advantage that it can cope with STA’s which fail to satisfy Lindeberg’s condition. The ACLT heuristically states that if an STA is close to satisfying Lindeberg’s condition, then its row-wise sums are close to being asymptotically normally distributed. We make use of approximate central limit theory in the next section, where we study the asymptotic behavior of the contaminated sample mean as introduced in the previous section. 4. Consistency and asymptotic normality We keep the terminology and the notation from above. The following relatively straightforward result shows that the contaminated sample mean is weakly consistent under a fairly mild condition. Theorem 4.1. Suppose that n 1 X pk σk2 = 0. lim n→∞ n2 (7) k=1 Then P X n → µ. Proof. Assume without loss of generality that µ = 0. For  > 0, Chebyshev’s inequality gives   P Xn ≥  ≤ = 1 Var[X n ] 2 " # n n 1 1 X 1 X 2 (1 − pk ) + 2 pk σk , 2 n2 n k=1 k=1 6 BEN BERCKMOES AND GEERT MOLENBERGHS which easily implies that  lim sup P X n n→∞ n  1 1 X ≥  ≤ 2 lim sup 2 pk σk2 .  n→∞ n k=1 This finishes the proof.  Wennow turn toothe asymptotic normality of X n . It turns out that the STA s1n (Xk − µ) , which is of crucial importance, satisfies Lindeberg’s condition if the sequence of contaminating variances (σk )k is controllable in a sense made precise in the following theorem. Theorem 4.2. Suppose that 1 n lim 2 max σk2 → 0. sn k=1 o (Xk − µ) satisfies Lindeberg’s condition, i.e.   1 Lin (Xk − µ) = 0. sn n→∞ Then the STA n 1 sn (8) Proof. Assume without loss of generality that µ = 0 and let X be a random variable with cumulative distribution function F . Then, for  > 0, " # 2 n X 1 1 Xk ; Xk ≥  E sn sn k=1   n n   sn 1 X 1 X (1 − pk )E X 2 ; |X| ≥ sn + 2 pk σk2 E X 2 ; |X| ≥ , = 2 sn sn σk k=1 k=1 which is n   1 X (1 − pk )E X 2 ; |X| ≥ sn 2 sn k=1 s " # n 2 1 X s n + 2 pk σk2 E X 2 ; |X| ≥  sn maxnk=1 σk2 k=1 s " # s2n 2 2 ≤ E[X ; |X| ≥ sn ] + E X ; |X| ≥  . maxnk=1 σk2 ≤ The latter quantity converges to 0 as n tends to ∞ by (1) and (8). This finishes the proof.  Remark 4.3. Observe that (8) implies (7). Classical central limit theory (Theorem 3.1) now leads to the following result. Theorem 4.4. Let ξ ∼ N (0, 1) and suppose that 1 n 2 lim max σk → 0. n→∞ s2 n k=1 Then  w n X n − µ → ξ. sn 7 o n Proof. Notice that the n-th rowwise sum of s1n (Xk − µ) coincides with  n  sn X n − µ . Now apply Theorem 4.2 and Theorem 3.1. If the sequence (σk )k cannot be controlled by condition (8), then it is more appropriate to make use of approximate central limit theory as outlined in the previous section. As Feller’s condition plays an important role in this theory, we start with the following characterization. o n Theorem 4.5. The STA s1n (Xk − µ) satisfies Feller’s condition if and only if 1 n lim 2 max pk σk2 = 0. (9) n→∞ sn k=1 Proof. Assume without loss of generality that µ = 0. Now   1 2 1 n 1 n n max E 2 Xk = 2 max(1 − pk ) + 2 max pk σk2 , k=1 sn sn k=1 sn k=1 whence, by (1),  1 n 1 2 lim sup max E 2 Xk = lim sup 2 max pk σk2 . sn n→∞ sn k=1 n→∞ k=1 n  This finishes the proof.  Remark 4.6. Observe that (8) implies (9), which in turn implies (7). Theorems 4.8 and 4.9 will reveal that n even in the o absence of condition (8), the Lindeberg index of the STA s1n (Xk − µ) can still be bounded from above. Moreover, it can be explicitly computed under a fairly easy set of conditions. We need the following lemma.  P Lemma 4.7. Suppose that the sequence n1 nk=1 pk σk2 n is bounded and let X be a random variable with cumulative distribution function F . Then   1 Lin (Xk − µ) sn   n 1 X sn = sup sup lim sup 2 pk σk2 E X 2 ; |X| ≥ , σk γ>0 >0 n→∞ sn k=dγne where d·e is the ceiling function. Proof. Assume without loss of generality that µ = 0 and choose K ∈ R+ 0 such that for all n n 1X pk σk2 ≤ K. (10) n k=1 Next, fix γ > 0 small. Then, for n large, by (1) and (10),   dγne−1 1 X sn 2 2 p σ E X ; |X| ≥ k k s2n σk k=1 dγne−1 1 X ≤ γ pk σk2 γn k=1 8 BEN BERCKMOES AND GEERT MOLENBERGHS ≤ γ dγne−1 X 1 pk σk2 dγne − 1 k=1 ≤ Kγ, whence   n sn 1 X 2 2 pk σk E X ; |X| ≥ lim sup 2 σk n→∞ sn k=1   dγne−1 1 X sn 2 2 ≤ lim sup 2 pk σk E X ; |X| ≥ σk n→∞ sn k=1   n sn 1 X 2 2 pk σk E X ; |X| ≥ + lim sup 2 σk n→∞ sn k=dγne   n 1 X sn 2 2 ≤ Kγ + lim sup 2 . pk σk E X ; |X| ≥ σk n→∞ sn k=dγne Thus we have shown that   n 1 X sn lim sup 2 pk σk2 E X 2 ; |X| ≥ σk n→∞ sn k=1   n sn 1 X 2 2 pk σk E X ; |X| ≥ . = sup lim sup 2 σk γ>0 n→∞ sn (11) k=dγne Now, arguing analogously as in the proof of Theorem 4.2 and using (11), we get   1 Lin Xk sn   n 1 X sn = sup lim sup 2 E X 2 ; |X| ≥ σk >0 n→∞ sn k=1   n 1 X sn 2 2 = sup sup lim sup 2 pk σk E X ; |X| ≥ σk >0 γ>0 n→∞ sn = sup sup lim sup γ>0 >0 n→∞ 1 s2n k=dγne n X k=dγne   sn pk σk2 E X 2 ; |X| ≥ , σk completing the proof.  Theorem 4.8. The inequality   n 1 1 X Lin (Xk − µ) ≤ lim sup 2 pk σk2 sn s n→∞ n k=1 always holds. If, in addition, (1) (σn2 )n is monotonically increasing, 1 (2) lim inf σn2 > 0, n→∞ n (12) 9 n (3) 1X pk σk2 n k=1 ! is bounded, n then the inequality in (12) becomes an equality.   Proof. Inequality (12) is easily established by the fact that E X 2 = 1. Now suppose that the three additional conditions in Theorem 4.8 are fulfilled. The fact that 1 lim inf σn2 > 0 n→∞ n allows us to choose δ > 0 and n0 such that for all n ≥ n0 σn2 ≥ δn. 1 Pn (13)  2 Furthermore, the boundedness of n k=1 pk σk such that for all n n 1X pk σk2 ≤ K. n n allows us to pick K ∈ R+ 0 (14) k=1 Now fix γ > 0 small. Then, for n so large that dγne ≥ n0 (15) dγne ≤ k ≤ n, (16) and for k such that we have, by (15), (16), (14), and (13), Pn Pn  2 2 sn k=1 (1 − pk ) + k=1 pk σk = σk σk2 Pn Pn 2 k=1 pk σk k=1 (1 − pk ) + ≤ δk P Pn (1 − p ) + nk=1 pk σk2 k k=1 ≤ δdγne ! n n 1 1X 1X 2 ≤ (1 − pk ) + pk σk δγ n n k=1 ≤ k=1 1+K , δγ whence s " #   1 + K s n E X 2 ; |X| ≥ ≥ E X 2 ; |X| ≥  , σk δγ with X a random variable with cumulative distribution function F . In particular,   n 1 X sn 2 2 sup lim sup 2 pk σk E X ; |X| ≥ (17) σk >0 n→∞ sn k=dγne s " # n 1 X 1 + K ≥ sup lim sup 2 pk σk2 E X 2 ; |X| ≥  δγ >0 n→∞ sn k=dγne 10 BEN BERCKMOES AND GEERT MOLENBERGHS s " = sup E X 2 ; |X| ≥  >0 # n 1 X 1+K lim sup 2 pk σk2 δγ n→∞ sn k=dγne = lim sup n→∞ 1 s2n n X pk σk2 , k=dγne   where the last equality follows from the fact that E X 2 = 1. Combining Lemma 4.7 and the inequality shown by (17) gives   1 (Xk − µ) Lin sn   n 1 X sn = sup sup lim sup 2 pk σk2 E X 2 ; |X| ≥ σk γ>0 >0 n→∞ sn ≥ sup lim sup γ>0 n→∞ 1 s2n k=dγne n X pk σk2 k=dγne n 1 X pk σk2 , = lim sup 2 n→∞ sn k=1 the last equality following by mimicking the proof of Lemma 4.7. This finishes the proof.  Theorem 4.9. Suppose that ! n 1X 2 (1) is convergent to L ∈ R+ , pk σk n k=1 ! n n 1X (2) pk is convergent to 0. n k=1 n Then the inequality  Lin  1 L (Xk − µ) ≤ sn 1+L holds. If, in addition, (3) (σn2 )n is monotonically increasing, 1 (4) lim inf σn2 > 0, n→∞ n then the inequality in (18) becomes an equality. Proof. Theorem 4.8 gives   n 1 1 X Lin (Xk − µ) ≤ lim sup 2 pk σk2 sn n→∞ sn k=1 Pn σk2 k=1 pkP = lim sup Pn n 2 n→∞ k=1 (1 − pk ) + k=1 pk σk P n 1 2 k=1 pk σk n = lim sup P P n n 1 1 2 n→∞ 1 − n k=1 pk + n k=1 pk σk (18) 11 = L , 1+L the last equality following from conditions (1) and (2) in Theorem 4.9. This establishes (18). If conditions (3) and (4) in Theorem 4.9 are also satisfied, then Theorem 4.8 shows that the first inequality in the above calculation becomes an equality and we are done.  Now approximate central limit theory (Theorem 3.2) gives the following result. Recall that the Kolmogorov distance is given by (4). Theorem 4.10. Let ξ ∼ N (0, 1) and suppose that ! n 1X 2 is convergent to L ∈ R+ , (1) pk σk n k=1 ! n n 1X (2) pk is convergent to 0, n k=1 n   1 n is convergent to 0. max pk σk2 (3) s2n k=1 n Then    n L lim sup K ξ, Xn − µ ≤ . sn 1+L n→∞ (19) n o Proof. Theorem 4.5 is applicable to conclude that the STA s1n (Xk − µ) satisfies Feller’s condition. Furthermore, Theorem 4.9 reveals that the LinL . Finally, the n-th deberg index of this STA is bounded from above by 1+L  n row-wise sum of this STA coinciding with sn X n − µ , it suffices to apply Theorem 3.2.  We wish to make the following final reflection. If, in addition to the conditions formulated in Theorem 4.10, (σn )n increases monotonically and n o 1 1 L lim inf n→∞ n σn > 0, then, by Theorem 4.9, Lin = 1+L . sn (Xk − µ) Thus, if L 6= 0, classical central limit theory (Theorem 3.1) leads to the conclusion that the estimator X n fails to be asymptotically normal in the sense   that the sequence snn X n − µ does not converge weakly to ξ. However, n inequality (19), derived from more general approximate central limit theory (Theorem 3.2), shows that X n is still close to being asymptotically normal when L is small. We empirically demonstrate these ideas in the next section through an example and a simulation study. 5. Example and simulation study We keep the terminology and the notation of the previous sections. In the following theorem, we apply the results obtained in the previous section to a specific choice for pk and σk2 . Recall that we say that X n is weakly consistent (WC) for µ if (2) holds and asymptotically normal (AN) if (3) holds. 12 BEN BERCKMOES AND GEERT MOLENBERGHS Theorem 5.1. Let pk = pk −a with p ∈ ]0, 1[ and a ∈ ]0, ∞[ and σk2 = s2 k b with s ∈ ]1, ∞[ and b ∈ ]0, ∞[ . Then the following assertions are true. (1) If b < 1, then X n is WC for µ and AN. (2) If b ≥ 1 and a > b, then X n is WC for µ and AN. (3) If b ≥ 1 and a = b, then X n is WC for µ, but fails to be AN. However,    n ps2 lim sup K ξ, Xn − µ ≤ . sn 1 + ps2 n→∞ Proof of Theorem 5.1. Firstly, suppose that b < 1. Now, by (1), 1 n 2 nb max σ = 2 ≤ nb−1 , s2n k=1 k sn which clearly converges to 0 as n tends to ∞. Thus condition (8) is satisfied, which allows us to conclude from Theorem 4.4 that X n is AN. Also, Remark 4.3 shows that condition (7) holds, whence we infer from Theorem 4.1 that X n is WC for µ. This establishes the first assertion. Next, consider the case where b ≥ 1 and a > b. Then the sequence pk σk2 = ps2 k b−a converges to 0 as k tends to ∞, whence n 1X lim pk σk2 = 0. n→∞ n k=1 Now it easily follows from Theorem 4.1 that X n is WC for µ and from Theorem 4.10 that    n lim sup K ξ, X n − µ = 0. sn n→∞ Put otherwise, X n is AN and the second assertion is proved. Finally, let b ≥ 1 and a = b. Then n 1X pk σk2 = ps2 . n k=1 Then, by Theorem 4.1, X n is WC for µ. Furthermore, by Theorem 4.5, Feller’s condition is satisfied, and, by Theorem 4.9, the Lindeberg index is ps2 . Thus, by Theorem 3.1, X n fails to be AN. However, by Theorem 1+ps2 4.10, the desired inequality in the third assertion holds.  In order to illustrate Theorem 5.1, we have conducted a simulation study with the following setup. For specific instances of p, s, a, b we have created √n −E[X n ] with sample size n = 1000. In each case the an empirical cdf E for X Var(X n ) empirical cdf was based on 5000 simulations. We have tested for asymptotic normality by creating a QQ-plot the graph of which contains bullets with 13 -4 -2 0 2 3 1 -1 -3 -2 0 2 Sample Quantiles Figure 2 (p = 0.5, s = 3, a = 3, b = 1, Lin = 0) -4 Sample Quantiles Figure 1 (p = 0.5, s = 3, a = 0.2, b = 0.5, Lin = 0) 4 -4 -2 0 2 4 Theoretical Quantiles Figure 3 (p = 0.01, s = 1.5, a = 1, b = 1, Lin = 0.02) Figure 4 (p = 0.1, s = 1.5, a = 1, b = 1, Lin = 0.18) -4 -2 0 2 4 2 0 -2 -4 Sample Quantiles 2 0 -2 -4 Sample Quantiles 4 Theoretical Quantiles 4 -4 -2 0 2 4 Theoretical Quantiles Figure 5 (p = 0.2, s = 2, a = 1, b = 1, Lin = 0.44) Figure 6 (p = 0.5, s = 4, a = 1, b = 1, Lin = 0.89) 4 2 -6 -2 0 Sample Quantiles 4 2 0 -4 -2 Sample Quantiles 6 Theoretical Quantiles -4 -2 0 Theoretical Quantiles 2 4 -4 -2 0 2 4 Theoretical Quantiles coordinates (Φ−1 (t), E−1 (t)), where Φ is the cdf of a standard normal distribution, E is the empirical cdf, and t runs over a specific grid from 0 to 1. If a bullet (Φ−1 (t), E−1 (t)) is close to the line y = x, then Φ−1 (t) ≈ E−1 (t), whence E(Φ−1 (t)) ≈ t = Φ(Φ−1 (t)). Thus on each QQ-plot we have also added the graph of the line y = x. To each figure we have added the value of the Lindeberg index governing the asymptotic normality of the sample mean. Recall that the Lindeberg index always takes values between 0 and 1. The following conclusions can be drawn from this study. If b < 1, then the first assertion in Theorem 5.1 states that - even if p and s are large and a is below b - the sample mean is asymptotically normal because the Lindeberg index is 0. This is confirmed by Figure 1. If b ≥ 1 and a > b, then the second assertion in Theorem 5.1 states that even if p and s are large - the sample mean is asymptotically normal because the Lindeberg index is 0. This is confirmed by Figure 2. If b ≥ 1 and a = b, then the third assertion in Theorem 5.1 provides an upper bound for a canonical measure of the asymptotic normality of the ps2 sample mean because the Lindeberg index is 1+ps 2 . The larger the Lindeberg index, the more deviation from asymptotic normality could be seen. This is confirmed by Figures 3, 4 and 5. 14 BEN BERCKMOES AND GEERT MOLENBERGHS 6. Open questions We formulate some open questions which could be a source for future research. Question 1. Theorem 5.1 does not handle the case where b ≥ 1 and a < b. Assume without loss of generality that µ = 0. Then, arguing analogously as in the proof of Theorem 4.2, we easily see that     n 1 sn 1 X 2 Lin E X ; |X| ≥ Xk = sup lim sup 2 , sn σk >0 n→∞ sn k=1 X being a random variable with cumulative distribution function F and σk2 = s2 k b and s2n = n − p n X k −a + ps2 k=1 n X k b−a . k=1 It would be of interest to examine the existence of a more explicit formula for the Lindeberg index in this case. Also, the weak consistency should be investigated. Question 2. Strictly speaking, inequality (19) only shows that the Lindeberg index is an upper bound for a natural index measuring the asymptotic normality of the sample mean. This allows us to draw the conclusion that the sample mean is close to being asymptotically normal when the Lindeberg index is small, but we cannot say anything about what happens when the Lindeberg index is large. However, our simulation study empirically reveals that when the Lindeberg index gets larger, the sample mean tends to deviate more from asymptotic normality. It would be of  interest to establish   n a useful lower bound for lim supn K sn X n − µ → ξ in terms of the Lindeberg index, which serves as a theoretical underpinning of this observation. General lower bounds of this type have been obtained by Berckmoes et al. (2013), but they are so unsharp that they do not have the power to predict what we have seen in our simulation study. References [BH05] A.D. Barbour and L.H.Y. Chen, An introduction to Stein’s method (Singapore University Press, Singapore, 2004). [BLV11] B. Berckmoes, R. Lowen, and J. Van Casteren, “Distances on probability measures and random variables,” J. Math. Anal. Appl. 374, no. 2, 412–428 (2011). [BLV13] B. Berckmoes, R. Lowen, and J. Van Casteren, “An isometric study of the Lindeberg-Feller CLT via Stein’s method” J. Math. Anal. Appl. 405, no. 2, 484-498 (2013). [F71] W. Feller, An introduction to probability theory and its applications Vol. II (John Wiley & Sons, New York-London-Sydney, 1971). [HR09] P. J. Huber and E.M. Ronchetti, Robust statistics (John Wiley & Sons, Hoboken, NJ, 2009). [L15] R. Lowen, Index analysis. Approach theory at work (Springer, London, 2015). [TSM85] D. M. Titterington, A. F. M. Smith, and U. E. Makov, U. E. Statistical analysis of finite mixture distributions (John Wiley & Sons, Chichester. 1985).
10math.ST
Survivable Network Design for Group Connectivity in Low-Treewidth Graphs Parinya Chalermsook∗ Syamantak Das† Guy Even‡ Bundit Laekhanukit§ arXiv:1802.10403v1 [cs.DS] 28 Feb 2018 Daniel Vaz¶ March 1, 2018 Abstract In the Group Steiner Tree problem (GST), we are given a (vertex or edge)-weighted graph G = (V , E ) on n vertices, together with a root vertex r and a collection of groups {Si }i∈[h] : Si ⊆ V (G). The goal is to find a minimum-cost subgraph H that connects the root to every group. We consider a fault-tolerant variant of GST, which we call Restricted (Rooted) Group SNDP. In this setting, each group Si has a demand ki ∈ [k ], k ∈ N, and we wish to find a minimum-cost subgraph H ⊆ G such that, for each group Si , there is a vertex in the group that is connected to the root via ki (vertex or edge) disjoint paths. While GST admits O (log2 n log h) approximation, its higher connectivity variants are known to be Label-Cover hard, and for the vertex-weighted version, the hardness holds even when k = 2 (it is widely believed that there is no subpolynomial approximation for the Label-Cover problem 1− [Bellare et al., STOC 1993]). More precisely, the problem admits no 2log n -approximation unless NP ⊆ DTIME(npolylog(n) ). Previously, positive results were known only for the edgeweighted version when k = 2 [Gupta et al., SODA 2010; Khandekar et al., Theor. Comput. Sci., 2012] and for a relaxed variant where ki disjoint paths from r may end at different vertices in a group [Chalermsook et al., SODA 2015], for which the authors gave a bicriteria approximation. For k ≥ 3, there is no non-trivial approximation algorithm known for edge-weighted Restricted Group SNDP, except for the special case of the relaxed variant on trees (folklore). Our main result is an O (log n log h) approximation for Restricted Group SNDP that runs in time nf (k,w) , where w is the treewidth of the input graph. This nearly matches the lower bound when k and w are constants. The key to achieving this result is a non-trivial extension of a framework introduced in [Chalermsook et al., SODA 2017]. This framework first embeds all feasible solutions to the problem into a dynamic program (DP) table. However, finding the optimal solution in the DP table remains intractable. We formulate a linear program relaxation for the DP and obtain an approximate solution via randomized rounding. This framework also ∗ Aalto University, Finland. email: [email protected] Indraprastha Institute of Information Technology Delhi, India. email: [email protected] ‡ Tel-Aviv University, Israel. email: [email protected] § Max-Planck-Institut für Informatik, Germany & Shanghai University of Finance and Economics, China. email: [email protected] ¶ Max-Planck-Institut für Informatik, Germany & Graduate School of Computer Science, Saarland University, Germany. email: [email protected] † 1 allows us to systematically construct DP tables for high-connectivity problems. As a result, we present new exact algorithms for several variants of survivable network design problems in low-treewidth graphs. 1 Introduction Network design is an important subject in computer science and combinatorial optimization. The goal in network design is to build a network that meets some prescribed properties while minimizing the construction cost. Survivable network design problems (SNDP) are a class of problems where we wish to design a network that is resilient against link or node failures. These problems have been phrased as optimization problems on graphs, where we are given an n-vertex (undirected or directed) graph G = (V , E ) with costs on edges or vertices together with a connectivity requirement k : V × V → N. The goal is to find a minimum-cost subgraph H ⊆ G, such that every pair u, v ∈ V of vertices are connected by k (u, v ) edge-disjoint (resp., openly vertex-disjoint) paths. In other words, we wish to design a network in which every pair of vertices remains connected (unless k (u, v ) = 0), even after removing k (u, v ) − 1 edges (or vertices). The edge-connectivity version of SNDP (EC-SNDP) models the existence of link failures and the vertexconnectivity (VC-SNDP) models the existence of both link and node failures. These two problems were known to be NP-hard and have received a lot of attention in the past decades (see, e.g., [26, 16, 32, 34]). While VC-SNDP and EC-SNDP address the questions that arise from designing telecommunication networks, another direction of research focuses on the questions that arise from media broadcasting as in cable television or streaming services. In this case, we may wish to connect the global server to a single local server in each community, who will forward the stream to all the clients in the area through their own local network. The goal here is slightly different from the usual SNDP, as it is not required to construct a network that spans every client; instead, we simply need to choose a local server (or representative), which will take care of connecting to other clients in the same group. This scenario motivates the Group Steiner Tree problem (GST) and its fault-tolerant variant, the Rooted Group SNDP. In Rooted Group SNDP, we are given a graph G = (V , E ) with costs on edges or vertices, a root vertex r, and a collection of subsets of vertices called groups, S1 , . . . , Sh , together with connectivity demands k1 , . . . , kh ∈ [k ], k ∈ N. The goal in this problem is to find a minimum cost subgraph H ⊆ G such that H has ki edge-disjoint (or openly vertex-disjoint) paths connecting the root vertex r to some vertex vi ∈ Si , for all i ∈ [h]. In other words, we wish to choose one representative from each group and find a subgraph of G such that each representative is k-edge-(or vertex)-connected to the root. When k = 1, the problem becomes the well-known Group Steiner Tree (GST) problem. Here, we are given a graph G = (V , E ) with edge or vertex costs, a root r and a collection of subsets of vertices called groups, S1 , . . . , Sh ⊆ V , and the goal is to find a minimum-cost subgraph H ⊆ G that has a path to some vertex in each Si , for i ∈ [h]. The GST problem is known to admit an O (log3 n)-approximation algorithm [22] and cannot be approximated to a factor of log2− n unless NP ⊆ ZPTIME(npolylog(n) ) [25]. 2 The Rooted Group SNDP generalizes GST to handle fault tolerance. The case where k = 2 is studied in [27, 23], culminating in the Õ (log4 n)-approximation algorithm for the problem. For k ≥ 3, there is no known non-trivial approximation algorithm. It is known among the experts that this problem is at least as hard as the Label-Cover problem1 . Chalermsook, Grandoni and Laekhanukit [13] studied a relaxed version of the problem in which we are not restricted to connect to a single vertex in each group and thus need only ki edge-disjoint paths connecting the root vertex to the whole group Si . Despite being a relaxed condition, the problem remains as hard as the Label-Cover problem, and they only managed to design a bicriteria approximation algorithm. To date, there is no known bicriteria or even sub-exponential-time poly-logarithmic approximation for Rooted Group SNDP when k ≥ 3. The following is an intriguing open question: What are the settings (i.e., ranges of k or graph classes) in which Rooted Group SNDP admits a poly-logarithmic approximation? In this paper, we focus on developing algorithmic techniques to approach the above question. We design poly-logarithmic algorithms for a special class of graphs – graphs with bounded treewidth – in the hope that it will shed some light towards solving the problem on a more general class of graphs, for instance, planar graphs (this is the case for the Steiner tree problem, where a subexponential-time algorithm for planar graphs is derived via decomposition into low-tree width instances [33]). Our main technical building block is a dynamic program (DP) that solves rooted versions of EC-SNDP and VC-SNDP in bounded-treewidth graphs. However, a straightforward DP computation is not applicable for Restricted Rooted Group SNDP, simply because the problem is NP-hard on trees (so it is unlikely to admit a polynomial-size DP-table). Hence, we “embed” the DP table into a tree and devise a polylogarithmic approximation algorithm using randomized rounding of a suitable LP-formulation. We remark that when the cost is polynomially bounded (e.g., in the Word RAM model with words of size O (log n)), polynomial-time algorithms for EC-SNDP and VC-SNDP follows from Courcelle’s Theorem [17, 6] (albeit, with much larger running time). However, employing the theorem as a black-box does not allow us to design approximation algorithms for Restricted Rooted Group SNDP. To avoid confusion between the relaxed and restricted version of Rooted Group SNDP (usually having the same name in literature), we refer to our problem as Restricted Group SNDP. (For convenience, we also omit the word ”rooted”.) 1.1 Related Work SNDP problems on restricted graph classes have also been studied extensively. When k = 1, the problems are relatively well understood. Efficient algorithms and PTAS have been developed for many graph classes: low-treewidth graphs [1, 18], metric-cost graphs [14], Euclidean graphs [9], planar graphs [8], and graphs of bounded genus [7]. However, when k ≥ 2, the complexity of 1 The hardness for the case of directed graph was shown in [27], but it is not hard to show the same result for undirected graphs. 3 these problems remains wide open. Borradaile et al. [7, 10] showed an algorithm for k = 1, 2, 3 on planar graphs, but under the assumption that one can buy multiple copies of edges (which they called relaxed connectivity setting). Without allowing multiplicity, very little is known when k ≥ 2: Czumaj et al. [19] showed a PTAS for k = 2 in unweighted planar graphs, and Berger et al. [3] 2 showed an exact algorithm running in time 2O (w ) n for the uniform demand case (i.e., k (u, v ) = 2 for all pairs (u, v )). Thus, without the relaxed assumption, with non-uniform demands or k > 2, the complexity of SNDP problems on bounded-treewidth graphs and planar graphs is not adequately understood. The technique of formulating an LP from a DP table has been used in literature. It is known that any (discrete) DP can be formulated as an LP, which is integral [31]. (For Stochastic DP, please see, e.g., [30, 21, 11, 20].) However, the technique of producing a tree structure out of a DP table is quite rare. Prior to this paper the technique of rounding LP via a tree structure was used in [24] to approximate the Sparsest-Cut problem. The latter algorithm is very similar to us. However, while we embed a graph into a tree via a DP table, their algorithm works directly on the tree decomposition. We remark that our technique is based on the previous work in [12] with almost the same set of authors. 1.2 Hardness of Approximating Restricted Group SNDP As mentioned, it is known among the experts that vertex-cost variant of the Restricted Group SNDP has a simple reduction for the Label-Cover problem and more generally, the k-Constraint Satisfaction problem (k-CSP). The original construction was given by Khandekar, Kortsarz and Nutov [27] for the Restricted Group SNDP on directed graphs. However, the same construction applies for the Vertex-Weighted Restricted Group SNDP. We are aware that this fact might not be clear for the readers. Thus, we provide the sketch of the proof in Appendix C. We remark that the k-CSP hardness implies that even for ki ∈ {0, 2}, Vertex-Weighted Restricted 1− Group SNDP cannot be approximated to within a factor of 2log n , for any  > 0, unless NP ⊆ DTIME(npolylog(n) ), and the approximation hardness is conjectured to be polynomial on n, say nδ for some 0 < δ < 1, under the Sliding Scale Conjecture [2]. So far, we do not know of any non-trivial approximation for this problem for k ≥ 2. The edge-cost variant has been studied in [27, 23], and a polylogarithmic approximation is known for the case k = 2 [27]. For k > 3, there is no known non-trivial approximation algorithm. The relaxed variant where the k disjoint paths from the root may end at different vertices in each group Si has also been studied in [27, 23]. Chalermsook, Grandoni and Laekhanukit proposed a bicriteria approximation algorithm for the Relaxed Restricted Group SNDP [13]; however, their technique is not applicable for the restricted version. Note that the hardness of the edge-cost variant of Relaxed Restricted Group SNDP is k 1/6− , for any  > 0 [13]. It is not hard to construct the same hardness result for Restricted Group SNDP. We believe that Restricted Group SNDP is strictly harder than the relaxed variant. 1.3 Our Results & Techniques Our main result is the following approximation result for Restricted Group SNDP. 4 Theorem 1.1. There is an O (log n log h) approximation for Restricted Group SNDP that runs in time nf (w,k) for some function f . The proof of this theorem relies on the technique introduced in [12]. We give an overview of this technique and highlight how this paper departs from it. In short, this technique “bridges” the ideas of dynamic program (DP) and randomized LP rounding in two steps2 . Let us say that we would like to approximate optimization problem Π. In the first step, a “nice” DP table that captures the computation of the optimal solution is created, and there is a 1-to-1 correspondence between the DP solution and the solution to the problem. However, since the problem is NP-hard (in our case, even hard to approximate to within some poly-logarithmic factor), we could not follow the standard bottom-up computation of DP solutions. The idea of the second step is to instead write an LP relaxation that captures the computation of the optimal DP solution, and then use a randomized dependent rounding to get an approximate solution instead; the randomized rounding scheme is simply the well-known GKR rounding [22]. Roughly speaking, the size of the DP table is n · wO (w) , while the LP relaxation has nO (w log w) variables and constraints, so we could get an O (log n log k ) approximation in time nO (w log w) . The main technical hurdle that prevents us from using this technique to Restricted Group SNDP directly is that there was no systematic way to generate a “good” DP table for arbitrary connectivity demand k. (The previous result was already complicated even for k = 1.) This is where we need to depart from the previous work. We devise a new concept that allows us to systematically create such a DP table for any connectivity demand k. Our DP table has size n · f (k, w ) for some function k and w, and it admits the same randomized rounding scheme in time ng (k,w) , therefore yielding the main result. As by-products, we obtain new algorithms for some well-studied variants of SNDP, whose running time depends on the treewidth of the input graph (in particular, n · f (k, w )). Subset connectivity problems: Subset k-Connectivity is a well-studied SNDP problem (Subset k-EC and Subset k-VC for edge and vertex connectivity, respectively). In this setting, all pairs of terminals have the same demands, i.e., k (u, v ) = k for all u, v ∈ T . This is a natural generalization of Steiner tree that has received attention [14, 32, 29]. Theorem 1.2. There are exact algorithms for Subset k-EC and Subset k-VC that run in time f1 (k, w )n for some function f1 . This result holds for vertex- or edge-costs. Rooted SNDP: Another setting that has been studied in the context of vertex connectivity requirements is the Rooted SNDP [15, 32]. In this problem, there is a designated terminal vertex r ∈ T , and all positive connectivity requirements are enforced only between r and other terminals, i.e. k (u, v ) > 0 only if u = r or v = r. For the edge connectivity setting, Rooted SNDP captures Subset k-EC3 2 One may view our result as a “tree-embedding” type result. Please see [12] for more discussion along this line. Here we choose to present our result in the viewpoint of DP & LP. 3 This is due to the transitivity of edge-connectivity. Specifically, any vertices u, w that have k edge-disjoint paths connecting to the root r also have k edge-disjoint paths between themselves. 5 Theorem 1.3. There are exact algorithms for Rooted EC-SNDP and Rooted VC-SNDP that run in time f2 (k, w )n for some function f2 . This result holds for costs on vertices or edges. Further technical overview: Let us illustrate how our approach is used to generate the DP table, amenable for randomized rounding. The following discussion assumes a certain familiarity with the notion of treewidth and DP algorithms in low-treewidth graphs. Given graph G = (V , E ), let T be a tree decomposition of G having width w, i.e. each bag t ∈ V (T ) corresponds to a subset Xt ⊆ V (G) : |Xt | ≤ w. Let Tt denote the subtree of T rooted at t. For each bag t ∈ V (T ), let Gt denote the subgraph induced on all bags belonging to the S subtree of T rooted at t, i.e. Gt = G[ t∈Tt Xt ]. At a high level, DPs for minimization problems in low-treewidth graphs proceed as follows. For each “bag” t, there is a profile πt ∈ Π for t, and we define a DP cell c[t, πt ] for each possible such profile, which stores the minimum-cost of a solution (a subgraph of Gt ) that is consistent with the profile πt . Then, a recursive rule is applied: Let t0 , t00 be the left and right children of t in T respectively. The DP makes a choice to “buy” a subset of edges Y ⊆ E (G[Xt ]) (that appear in bag Xt ) and derives the cost by minimizing over all profiles πt0 , πt00 that are “consistent” with πt : c[t, πt ] = min πt0 ,πt00 ,Y :(πt0 ,πt00 ,Y )./πt (cost(Y ) + c[t0 , πt0 ] + c[t00 , πt00 ]) where the sign (πt0 , πt00 , Y ) ./ πt represents the notion of consistency between the profiles. Different optimization problems have different profiles and consistency rules. Often, consistency rules that are designed for connectivity-1 problems (such as Steiner tree) are not easily generalizable to higher connectivity problems (such as SNDP). In this paper, we devise a new consistency rule (abbreviated by m) for checking “reachability” (or connectivity 1) in a graph, which allows for easy generalization to handle high connectivity problems. Roughly speaking, our consistency rule m solves the Steiner tree problem (connectivity-1 problem). To solve a connectivity-k problem, we have a DP cell c[t, ~π ] for each ~π ∈ Πk . Then the consistency check is a “direct product” test for all coordinates, i.e., (~πt0 , ~πt00 , Y~ )mk ~πt ⇐⇒ (∀j ∈ [k ])(πt0 ,j , πt00 ,j , Yj )mπt,j In this way, our new concept makes it a relatively simple task to generalize a DP for connectivity-1 problems to a DP for connectivity-k problems (and facilitate the proof of correctness). There is a slight change in the way DPs are designed for each problem, but they follow the same principle. Organization: We develop our techniques over several sections, and along the way, show nontrivial applications for various SNDP problems. Section 2 provides some notation and important definitions. Section 3 presents the new viewpoint for designing DP and presents a simple showcase by deriving (known) results. Section 4 presents algorithms for EC-SNDP. Lastly, Section 5 presents an approximation algorithm for group connectivity problems. 6 2 Preliminaries Tree decomposition: Let G be any graph. A tree decomposition of G is a tree T with a collection of bags {Xt }t∈V (T ) ⊆ 2V (G) (i.e., each node of T is associated with a subset of nodes of V (G)) that satisfies the following properties: • V (G) = S t∈V (T ) Xt • For any edge uv ∈ E (G), there is a bag Xt such that u, v ∈ Xt . • For each vertex v ∈ V (G), the collection of nodes t whose bags Xt contain v induces a connected subgraph of T . That is, T [{t ∈ V (T ) : v ∈ Xt }] is a subtree of T . The treewidth of G, denoted tw (G), is the minimum integer k for which there exists a tree decomposition (T , {Xt }t∈V (T ) ) such that max |Xt | ≤ k + 1 (max |Xt | − 1 is the width of T ). Fix a tree decomposition (T , {Xt }) with the stated properties. For each node t ∈ V (T ), denote by Tt the subtree of T rooted at t. We also define Gt as the subgraph induced by Tt ; that is, S Gt = G t0 ∈Tt Xt0 . For each v ∈ V , let tv denote the topmost bag for which v ∈ Xtv . For each t ∈ V (T ), we say that an edge uv ∈ E (G) appears in the bag t if u, v ∈ Xt , and only if t is the topmost bag in which this happens. We denote the edges inside the bag Xt by Et . For a subset of bags, S ⊆ V (T ), we define S XS := t∈S Xt . We will use the following result, which shows that a tree decomposition of G of width O (tw (G)) is computable in time O (2O (tw(G)) n). Theorem 2.1 ([5]). There is an algorithm that, given a graph G, runs in time O (2O (tw(G)) n) and finds the tree decomposition (T , {Xt }t∈V (T ) ) such that |Xt | ≤ 5tw (G) for all t. In order to simplify notation, we assume that T is a binary tree. Furthermore, we require the height of T to be O (log n) in Section 5. The following lemma, based on the results of Bodlaender [4], summarizes the properties we assume. Lemma 2.2 (in [12], based on [4]). There is a tree decomposition (T , {Xt }t∈V (T ) ) with the following properties: (i) the height of T is at most O (log n); (ii) each bag Xt satisfies |Xt | ≤ O (w ); (iii) every leaf bag has no edges (Et = ∅ for leaf t ∈ T ); (iv) every non-leaf has exactly 2 children Connection sets and operators: Let S ⊆ V . A connection set Λ over S is a subset of S × S which will be used to list all pairs that are connected via a path, i.e., (u, v ) ∈ Λ iff there is a path connecting u to v. Let Λ be a connection set over S. The transitive closure operator, denoted by tc(·), is defined naturally such that tc(Λ) contains all pairs (w, w0 ) for which there is a sequence (w = w0 , w1 , . . . , wq = w0 ) and (wi , wi+1 ) ∈ Λ for all i < q. Let S 0 ⊆ S. The projection operator “|” is defined such that Λ 0 = Λ ∩ (S 0 × S 0 ). See Figure 1 for an illustration. S Given two connection sets Λ1 of S1 and Λ2 of S2 , the union Λ1 ∪ Λ2 is a connection set over S1 ∪ S2 . 7 𝑆′ 𝑆 𝑦 𝑥 𝑧 𝑤 Figure 1: Connection sets, transitive closures and projections. Λ = {(w, x), (x, z ), (z, y )} (dotted connections). tc(Λ) = {(w, x), (x, y ), (y, z ), (w, y ), (x, z ), (w, z )}. tc(Λ) 0 = {(x, y )}. S 3 New Key Concept: Global ⇔ Local Checking for DP This section introduces the key concept devised for handling all our problems systematically. High-level intuition: Our DP will try to maintain a pair of local and global information about connectivity in the graph. Roughly speaking, a local connection set Γt for t (more precisely, for Xt ) gives information about connectivity of the solution inside the subgraph Gt (the subgraph induced in subtree Tt ), while the other connection ∆t for t gives information about connectivity of the global solution (i.e., the solution for the whole graph G). For instance, if we have a tentative solution Y ⊆ E (G), we would like to have the information about the reachability of Y inside each bag, i.e., ∆t = tc(Y ) , so we could check the reachability t between u and v simply by looking at whether (u, v ) ∈ ∆t . However, a DP that is executing at bag t may not have this global information, and this often leads to complicated rules to handle this situation. We observe that global information can be passed along to all cells in the DP with simple local rules so that checking whether the connectivity requirements are satisfied can be done locally inside each DP cell. In the next section, we elaborate on this more formally. Equivalence: One could imagine having a DP cell c[t, Γt , ∆t ] for all possible connection sets Γt , ∆t , which makes a decision on Yt , the set of edges bought by the solution when executing the DP. The roles of Γt and ∆t are to give information about local and global reachability, respectively. We are seeking a solution Y that is “consistent” with these profiles, where Y can be partitioned based on the tree T as Yt = Y ∩ Et . Given Y , we say that the pairs {(Γt , ∆t )}t∈V (T ) satisfy the local (resp., global) connectivity definition if, for every bag t ∈ V (T ) (having left and right children as t0 and t00 , respectively), 8 Global Local Γt : = ∆t : =  ∅ if t is a leaf bag Γt := tc (Y ∩ ETt ) tc (Γt0 ∪ Γt00 ∪ Yt ) t  Γt otherwise ∆t := tc (Y ) tc(∆p(t) ∪ Γt ) t t if t = root(T ) otherwise t where the projection operator on Xt is simplified as |t . The main idea is that the local connectivity definition gives us “local” rules that enforce consistency of consecutive bags, and this would be suitable for being embedded into a DP. The global connectivity rules, however, are not easily encoded into DP, but it is easy to argue intuitively and formally about their properties. The following lemma (proof in Section 6) shows that the local and global connectivity definitions are, in fact, equivalent. Lemma 3.1. Let Yt ⊆ Et be a subset of edges and (Γt , ∆t ) a pair of connectivity sets for every t ∈ V (T ). Then, the pairs (Γt , ∆t ) satisfy the local connectivity definition iff they satisfy the global connectivity definition. The notions of local and global connectivity, as well as the equivalence between them can be generalized both for the edge-connectivity version with vertex-costs as well as vertex-connectivity with vertex-costs. We defer the details of this generalization to Appendix B. A warmup application: steiner trees. We now show an approach that allows us to solve the Steiner Tree problem exactly in nwO (w) time, given a tree decomposition of width w. We remark that the best known algorithm due to Cygan et al. [18] runs in time 2O (w) n. In this problem, we are given graph G = (V , E ) with edge-costs and terminals T = {v1 , . . . , vh }, and the goal is to find a min-cost subset E ∗ ⊆ E that connects all the terminals. For simplicity, we denote v1 by “root” r, and the goal is to connect the root to all other terminals in T \ r. Our DP table has a cell c[t, Γ, ∆] for every bag t ∈ V (T ) and every pair of connection sets (Γ, ∆) for t. We initialize the DP table by setting c[t, Γ, ∆] for all the leaf bags, and setting certain cells as invalid (by setting c[t, Γ, ∆] = ∞): • For every leaf bag t and every pair (Γ, ∆), we set c[t, Γ, ∆] = 0 if Γ = ∅ and c[t, Γ, ∆] = ∞ otherwise. • We mark the cells (root(T ), Γ, ∆) as invalid if Γ 6= ∆. • Let vi ∈ T be one of the terminals, and t ∈ V (T ) a bag. We mark a cell (t, Γ, ∆) as invalid if vi ∈ Xt but (r, vi ) 6∈ ∆. For all other cells, we compute the bags from their children. Let t be a bag with left-child t0 and right-child t00 . Let (Γ, ∆), (Γ0 , ∆0 ), (Γ00 , ∆00 ) be pairs of connection sets for t, t0 , t00 , respectively, and Yt ⊆ Et . We say that (Γ, ∆) is consistent with ((Γ0 , ∆0 ), (Γ00 , ∆00 )) via Yt (abbreviated by the Y t notation (Γ, ∆) ←→ ((Γ0 , ∆0 ), (Γ00 , ∆00 ))) if Γ = tc(Γ0 ∪ Γ00 ∪ Y ) t ∆0 = tc(∆ ∪ Γ0 ) 9 t0 ∆00 = tc(∆ ∪ Γ00 ) t00 r γ1 r γ2 γ1 γ2 Figure 2: Example of different partitions of edges into paths from demands γ1 , γ2 . On the left (resp., right), two paths from r to γ1 (resp., γ2 ) Now, for any choice of valid DP cells (t, Γt , ∆t ) and edge subsets Yt ⊆ Et for every t ∈ V (T ) (notice that a DP solution uses precisely one cell per bag t), we apply Lemma 3.1 to conclude that since the local connectivity definition is satisfied for (Γt , ∆t ) pairs, so does the global connectivity definition. Since, for every valid DP cell (t, Γ, ∆) such that t contains a terminal vi , (r, vi ) ∈ ∆, we conclude S that every terminal is connected to the root in the solution Y = t∈V (T ) Yt . Conversely, given a solution F ⊆ E (G), we can define Ft := F ∩ Et , and a pair (Γt , ∆t ) for every t ∈ V (T ), using the global connectivity definition. Lemma 3.1 implies that the pairs (Γt , ∆t ) satisfy the local connectivity definition, and therefore define valid DP cells (notice that for every terminal vi , F connects vi to the root, so (r, vi ) ∈ ∆t for every t ∈ V (T ) such that vi ∈ Xt ). We thus establish that for every valid DP solution there is a corresponding feasible solution F ⊆ E (G), and vice-versa. 4 Extension to High Connectivity This section shows how to apply our framework to problems with high connectivity requirements. We focus on edge-connectivity and leave the case of vertex-connectivity to Appendix B. When solving a problem in a high connectivity setting, there may be a requirement of k disjoint paths. In particular, for each demand pair (u, v ), there must be k (u, v ) disjoint paths in the solution. So we could start naturally with a profile of the form: (Γt,1 , . . . , Γt,k )(∆t,1 , . . . , ∆t,k ) for each bag t ∈ V (T ), and enforce the local consistency conditions for each coordinate. However, this idea does not work as a different demand pair, say (a, b), might use a path that belongs to different subgraphs Hj as defined above. In other words, the disjoint paths for the demand pair (a, b) might require a different partitioning of the solution set H. Figure 2 illustrates a case in which different demand pairs use different partitions. Therefore, we need to enumerate all possible ways for the demands to “locally” partition the graph and use them to support all k disjoint paths for each one of them. This requires a more careful local consistency check between the DP cells. 10 We consider the Rooted EC-SNDP problem with edge-costs as an example to explain how to apply our framework in high-connectivity. For convenience, we add r to every bag. To avoid confusion, the root of the tree T will be referred explicitly as root(T ). The organization of this section is as follows. In Section 4.1, we explain the setup of the cells of the DP table and a high-level intuition about how the DP works. In Section 4.2 we describe the algorithm, in particular, how to compute the values of the DP table. We leave the discussion of its correctness and running time to Section 7.2. 4.1 Profiles As in any standard dynamic programming approach based on tree decomposition, we have a profile for each bag t, which tries to solve the subproblem restricted to Gt in some way. Let t ∈ V (T ) be a bag. A connection profile for t is a k-tuple ~Γ = (Γ1 , Γ2 , . . . , Γk ) such that Γi ⊆ Xt × Xt . Let Xt be the set of all connection profiles for t. A profile Ψ of node t is a collection ~ ), i.e., Ψ ⊆ Xt × Xt . A partial solution F ⊆ E (Gt ) is said to be of pairs of connection profiles (~Γ, ∆ ~ ) ∈ Ψ, consistent with profile Ψ for t if, for all (~Γ, ∆ • For each (u, v ) ∈ Γi and (a, b) ∈ Γj for i 6= j, there are paths Puv , Pab ⊆ F connecting the respective vertices in Gt such that Puv and Pab are edge-disjoint. • There is a global solution F 0 ⊇ F such that, for each (u, v ) ∈ ∆i and (a, b) ∈ ∆j for i 6= j, there are paths Quv , Qab ⊆ F 0 connecting the respective vertices in G such that Puv and Pab are edge-disjoint. In other words, a solution consistent with a profile must “implement” all connectivity requirements ~ by ~Γ and must be extensible to satisfy ∆. Passing down both local and global requirements in the DP table leads to a clean and simple DP algorithm. Our DP table has a cell c[t, Ψ] for each bag t ∈ V (T ) and each profile Ψ for t. This cell tentatively stores the optimal cost of a solution consistent with profile Ψ. 4.2 The DP Valid cells: Some table entries do not correspond to valid solutions of the problem, so we mark them as invalid and remove them from consideration (another way to think about this is that we initialize c[t, Ψ] = ∞ for all invalid cells), i.e., the following cells are invalid: • Any leaf that has non-empty connectivity requirements is invalid. That is, c[t, Ψ] = 0 if Ψ ⊆ {(∅, . . . , ∅)} × Xt ; otherwise, c[t, Ψ] = ∞. • Any cell that cannot be extended into a feasible solution is invalid. If there is no pair ~ ) ∈ Ψ such that (r, γi ) ∈ ∆j for all j ∈ [ki ], then there are fewer than ki edge-disjoint (~Γ, ∆ paths between r and γi , and therefore the cell is invalid, so c[tγi , Ψ] = ∞. ~ ) ∈ Ψ such • The bag root(T ) together with profile Ψ is an invalid cell if there is a pair (~Γ, ∆ that Γj 6= ∆j for some j. In this case, we set c[root(T ), Ψ] = ∞. 11 Lemma 4.1. For every t ∈ T , there are at most exp(wO (wk) ) many valid cells (t, Ψ). DP computation: For all other cells, we compute their values from the values of their children. Let t be a bag with left-child t0 and right-child t00 . Let Ψ, Ψ0 , Ψ00 be their profiles respectively, Y and Y ⊆ Et . We say that Ψ is consistent with (Ψ0 , Ψ00 ) via Y (abbreviated by Ψ ←→ (Ψ0 , Ψ00 )) ~ ) ∈ Ψ, there are (~Γ0 , ∆ ~ 0 ) ∈ Ψ0 and if the following conditions are satisfied. For each pair (~Γ, ∆ 00 00 00 ~ ) ∈ Ψ , together with a partition of Y into Y1 ∪ Y2 ∪ . . . ∪ Yk such that, for every j ∈ [k ], (~Γ , ∆ Γj = tc(Γ0j ∪ Γ00j ∪ Yj ) ∆0j = tc(∆j ∪ Γ0j ) t t0 ∆00j = tc(∆j ∪ Γ00j ) t00 ~ 0 ) ∈ Ψ0 (resp., (Γ~00 , ∆~00 ) ∈ Ψ00 ) there are (Γ~00 , ∆~00 ) ∈ Ψ00 (resp., (Γ~0 , ∆ ~ 0 ) ∈ Ψ0 ) Similarly, for any (Γ~0 , ∆ ~ ) ∈ Ψ and some partition of Y , satisfying similar conditions as above. plus (~Γ, ∆ Then the value of c[t, Ψ] can be defined recursively among valid cells: c[t, Ψ] = (c[t0 , Ψ0 ] + c[t00 , Ψ00 ] + c(Y )) min Y Ψ←→(Ψ0 ,Ψ00 ) n o ~ ) ∈ Ψ)(∀j ∈ [k ])Γj = ∆j . The The final solution can be computed as min c[root(T ), Ψ] | (∀(~Γ, ∆ correctness of this DP is deferred to Section 7.1. 5 Algorithms for Restricted Group SNDP We now have sufficient technical tools to prove Theorem 1.1. In the first step, we turn the DP table into a tree instance of a variant of GST and, in the second step, apply randomized rounding to obtain a polylogarithmic approximation to the problem. Tree Instance: We start by showing how to transform the DP table into a tree Te , where we can solve a variant of the group Steiner tree problem. The following theorem formalizes this transformation, and we dedicate the rest of this section to proving the theorem. For convenience, we add a dummy bag tS with XtS = ∅ as the parent of the root bag. Theorem 5.1. Given a graph G rooted at r with treewidth w and groups Si ⊆ V , there is a tree e such that: (i) the size of Te is nwO(wk) ; (ii) for Te with groups Sei and a set of accepted solutions X e (and vice-versa) such that c(F ) = c(X ) and, for every i ∈ [h], every F ⊆ E (G), there is X ∈ X F ki -connects r to v ∈ Si iff X connects root(Te ) to t̃ ∈ Sei . For each cell of the DP table introduced in Section 4.2, we create a node in Te . Namely, we create a vertex t̃[t, Ψ] for every bag t ∈ V (T ) and Ψ ⊆ Xt × Xt . The root of the tree is t̃[tS , {(∅k , ∅k )}] (this is the only connection profile for tS ). For a bag t ∈ T with children t0 , t00 , we add connecting Y nodes t̃c [t, Ψ, Ψ0 , Ψ00 , Y ] connected to the nodes t̃[t, Ψ], t̃[t0 , Ψ0 ], t̃[t00 , Ψ00 ], for every Y ⊆ Et , if Ψ ←→ (Ψ0 , Ψ00 ). If there is only one child, the connecting node has degree 2, and we consider that Ψ00 = {(∅k , ∅k )} for the purpose of describing the algorithm. An edge from t̃[t, Ψ] to t̃c [t, Ψ, Ψ0 , Ψ00 , Y ] is 12 labeled with the set of edges Y and is assigned cost c(Y ). All other edges in the instance have cost 0. Notice that, at this point, Te is not a tree, but we can turn it into one by making copies of the nodes as required. Specifically, we process the tree in a bottom-up fashion: for each node t̃, we make the same number of copies of t̃ and its descendants as there are incoming edges of t̃ such that each edge is incident to a different copy. In this manner, all the copies of t̃ are now the roots of subtrees, which are disjoint. For convenience, we denote by t̃[t, Ψ] (resp., t̃c [t, Ψ, Ψ0 , Ψ00 , Y ]) any copy of the original node; when we need to distinguish copies, we denote by copies(t̃) the set of all copies of a node t̃. The final step in our construction is to prune the tree by removing nodes that cannot be reached or that represent choices that cannot be part of a feasible solution. To do that, it is sufficient to apply the following rules to exhaustion: (i) remove t̃ ∈ Te if it is not connected to the root; (ii) remove a connecting node if one of its children was removed; (iii) remove t̃[t, Ψ] if it is a leaf node but ~ ) ∈ Ψ). Ψ 6⊆ {(∅, . . . , ∅)} × Xt (i.e. ~Γ 6= (∅, . . . , ∅) for some (~Γ, ∆ We can now restate the goal of the problem in terms of Te : we want to find nodes t̃[t, Ψt ] and Y edge sets Yt ⊆ Et for every bag t ∈ V (T ), such that (Ψt0 , Ψt00 ) ←→ Ψt for all non-leaf bags t with children t0 , t00 . Further, for every group Si , there must be a vertex γi ∈ Si and a partition of S Y := t∈V (T ) Yt into ki sets, such that each contains a path from r to γi . The set of nodes {t̃[t, Ψt ]}t∈V (T ) with the respective connecting nodes t̃[t, Ψt , Ψt0 , Ψt00 , Yt ] (for all non-leaf bags t ∈ V (T )) induces a tree Te in Te . We say that such a tree Te is valid if every node t̃[t, Ψ] ∈ V (Te ) has exactly one child in the graph (or none if t is a leaf), and every connecting node t̃c [t, Ψ, Ψ0 , Ψ00 , Yt ] in Te has full-degree, i.e., all its neighbors are in the solution as well. For every group Si , we define Sei as follows: for every v ∈ Si and every Ψ ∈ Xt × Xt , every element ~ ) ∈ Ψ such that (r, v ) ∈ ∆j for all j ∈ [ki ]. of copies(t̃[tv , Ψ]) is in Sei if there is (~Γ, ∆ The size of the instance follows by considering its height and maximum degree: the maximum degree of Te is exp(wO (wk) ) by Lemma 4.1, and there is a tree decomposition of height O (log n) by O (wk ) Lemma 2.2, which implies that height(Te ) = O (log n). We conclude that |Te | = nw . The correctness of the reduction follows from the correctness of the DP for Rooted EC-SNDP, and its proof is left to Section 7.1. Algorithm: We now show how to obtain a valid tree Te, given Te . Let T ∗ be the min-cost valid tree in Te that connects all the groups {Sei }i∈[h] . Chalermsook et al. [12] showed that it is possible to find a valid tree Te with expected cost c(T ∗ ), but whose probability of covering a group is just O (1/ height(Te )). Using this result, we can obtain valid trees Te1 , . . . , Te` , where ` = O (log n log h). We can then obtain solutions Fj that k-connect the same groups and have the same cost as Tej , for all j ∈ [`], S and finally output the solution F := j∈[`] Fj . Since the expected cost of each T̃i is c(T ∗ ), the expected cost of F is O (log n log h)c(T ∗ ). By sampling c log n log h independent valid trees, for large enough c, we ensure that all the groups are covered with high probability (by union bound). We conclude that the algorithm outputs a 13 randomized O (log n log h)-approximation to the problem, with high probability. 6 Details of the Global ⇔ Local Checking for DP In this section, we will prove a generalized version of Lemma 3.1, that works for edge-connectivity and vertex-connectivity, both with edge and vertex costs. In vertex-connectivity problems, we are interested in finding internally disjoint paths. In order to handle this setting, we introduce a modified version of transitive closure. For a set of vertices Z and a set of edges S, we denote by tc∗Z (S ) the set of all pairs (u, v ) such that there is a u-v-path in the graph (Z ∪ {u, v}, S ), that is, a path whose internal vertices are in Z, and whose edges are in S. Formally, n tc∗Z (S ) = (u, v ) ∃w1 , . . . , w` ∈ Z, ∀i ∈ [` − 1], (u, w1 ), (w` , v ), (wi , wi+1 ) ∈ S o We then keep track, for every bag, of which vertices are allowed to be used in the solution, that is, we use triples (Z, Γ∗ , ∆∗ ), instead of the previously used pairs (Γ, ∆). Let Wt ⊆ Xt \ Xp(t) for every t ∈ V (T ), W = t∈V (T ) Wt , Yt ⊆ Et for every t ∈ V (T ), Y = S ∗ ∗ t∈V (T ) Yt , and a triple (Zt , Γt , ∆t ) for every t ∈ V (T ). For the purposes of this section, we introduce the following definitions for local and global connectivity. S We say that the triples (Zt , Γ∗t , ∆∗t ) satisfy the local (resp. global) connectivity definition if, for every bag t ∈ V (T ), Global Local  W t  Zt : =   Zp ( t ) ∪ Wt ∩ V t  ∅ Γ∗t := ∆∗t := tc∗Z t (Γ∗t0 ∪ Γ∗t00 Zt := W ∩ Xt otherwise Γ∗t := tc∗W (Y ∩ ETt ) if t is a leaf bag t ∪ Yt )  Γ∗ t tc∗Z t if t = root(T ) t ∆∗t := tc∗W (Y ) t t otherwise if t = root(T )  ∆∗p(t) ∪ Γ∗t  t otherwise We then prove the following lemma, proving that the given local and global connectivity definitions are equivalent. Lemma 6.1. Let Wt ⊆ Xt \ Xp(t) be a subset of vertices, Yt ⊆ Et a subset of edges and (Z, Γ∗t , ∆∗t ) a triple of profiles for every t ∈ V (T ). Then, the triples (Zt , Γ∗t , ∆∗t ) satisfy the local connectivity definition iff they satisfy the global connectivity definition. Before proving the lemma, we show how Lemma 3.1 follows. We will prove that, if we fix Wt = Xt \ Xp(t) and Zt = Xt , the definitions of Lemmas 6.1 and 3.1 are equivalent. 14 For this, it is sufficient to see that tc∗W (S ) = tc∗V (G) (S ) = tc(S ), and that the common vertices in Γ∗t0 , Γ∗t00 , and Yt are all in Xt , thus tc∗Zt (Γ∗t0 ∪ Γ∗t00 ∪ Yt ) = tc (Γ∗t0 ∪ Γ∗t00 ∪ Yt ) t t Similarly, since ∆∗p(t) and Γ∗t only intersect inside Xt × Xt ,  tc∗Zt ∆∗p(t) ∪ Γ∗t   t = tc ∆∗p(t) ∪ Γ∗t  t We conclude that when Zt = Xt , Γ∗t = Γt and ∆∗t = ∆t , the proof follows. The following technical lemma will be useful when proving Lemma 6.1. Lemma 6.2 (Path Lemma). Let G be any graph and T be a tree decomposition of G. Let t ∈ V (T ) be a bag and P be a path of length at least 2 whose endpoints x, y are the only vertices of P in t, that is, V (P ) ∩ Xt ⊆ {x, y}. Then there is a connected (subtree) component T 0 in T \ t such that, for any edge ab ∈ E (P ), T 0 has a bag t0 that contains ab, i.e., every edge ab ∈ Et0 for some bag t0 ∈ V (T 0 ). Proof. We provide a simple proof by contradiction. Assume that there are two consecutive edges, ab, bc ∈ E (P ) that are in different connected components of T \ t (otherwise, all edges must be in the same component). Since the set of bags containing b must be connected in T but is not connected in T \ {t}, b ∈ Xt , we reach a contradiction. Proof of Lemma 6.1. We remark that the function tc∗ shares some properties with the usual definition of transitive closure, which are used throughout the proof: Observation 6.3. The function tc∗ satisfies the following properties: • tc∗Z (tc∗Z (Y )) = tc∗Z (Y ) • tc∗Z 0 (Y 0 ) ⊆ tc∗Z (Y ) if Z 0 ⊆ Z, Y 0 ⊆ Y Equivalence for Zt : We prove that the two definitions for Z are equivalent by induction on the depth of the bag. At the root, we have that Wroot(T ) = W ∩ Xroot(T ) , so the equivalence holds. For the induction step, let t ∈ V (T ) be a bag other than the root. Then     Zp(t) ∪ Wt ∩ Xt = Zp(t) ∩ Xt ∪ (Wt ∩ Xt ) ⊆ (W ∩ Xt ) ∪ (W ∩ Xt ) = W ∩ Xt The second step follows from the induction hypothesis, as well as the definition of W . We now prove the converse inclusion.     W ∩ Xt = W ∩ Xp(t) ∩ Xt ∪ W ∩ Xt \ Xp(t)     ⊆ Zp(t) ∩ Xt ∪ Wt = Zp(t) ∪ Wt ∩ Xt We use the induction hypothesis, as well as the fact that Wt ⊆ Xt . 15  Equivalence for Γ∗t : We prove the statement by induction on the height of a bag t. Since ETt = ∅, both definitions are equivalent for every leaf t. Let t be any bag. By the induction hypothesis, Γ∗t0 , Γ∗t00 ⊆ tc∗W (Y ∩ ETt ). Therefore, tc∗Zt (Γ∗t0 ∪ Γ∗t00 ∪ Yt ) ⊆ tc∗W (Y ∩ ETt ) t t Here, we use that Zt = W ∩ Xt ⊆ W . To prove the converse inclusion, let (u, v ) ∈ tc∗W (Y ∩ ETt ) . By definition, there must be a path t p between u and v using internal vertices in W . Let u = w0 , w1 , . . . , w` = v be all the vertices of p (in the correct order) that are also in Xt . Each pair (wi , wi+1 ) is connected by a subpath of p. By Lemma 6.2, (wi , wi+1 ) is either an edge in Yt , or the subpath is fully contained in Y ∩ ETt0 or Y ∩ ETt00 , and uses internal vertices in W . In the first case, (wi , wi+1 ) ∈ Yt , while in the remaining cases, (wi , wi+1 ) is in Γt0 or Γt00 , by the induction hypothesis. We conclude that, since wi ∈ Zt = W ∩ Xt , for i ∈ [l − 1], then (u, v ) is in tc∗Zt (Γ∗t0 ∪ Γ∗t00 ∪ Yt ) t Equivalence for ∆∗t : We now prove that both definitions for ∆∗ are equivalent, by using induction on the depth of the bags. For the node root(T ), we have ETroot(T ) = E (G), and thus the base case follows. For the induction step, we remark that ∆∗p(t) , Γ∗t ⊆ tc∗W (Y ) by the induction hypothesis together with the statement of the lemma for Γ∗ . Therefore,  tc∗Zt ∆∗p(t) ∪ Γ∗t  t ⊆ tc∗W (Y ) t For the reverse inclusion, we fix a pair (u, v ) ∈ tc∗W (Y ) , and a path p that connects u to v in Y t using internal vertices in W . Further, let u = w0 , w1 , . . . , w` = v be all the vertices of p (in the correct order) that are also in Xt . By Lemma 6.2, (wi , wi+1 ) is either an edge in Y (b), or the subpath p0 of p connecting wi and wi+1 is contained either in Y ∩ ETt0 , Y ∩ ETt00 or Y ∩ (E \ ETt ). For all but the last case, (wi , wi+1 ) ∈ Γ∗t , by definition. In the remaining case, it must be that the vertices of p0 are also contained in XT \Tb . Specifically, because the bags containing a given vertex must form a connected component of T , wi , wi+1 ∈ Xp(t) , which implies (wi , wi+1 ) ∈ tc∗W (Y ) = ∆∗p(t) . p(t) In any case, since wi ∈ Zt = W  ∩ Xt , for i∈ [l − 1], we conclude that every pair (wi , wi+1 ) and ∗ thus (u, v ), are contained in tcZt ∆∗p(t) ∪ Γ∗t . t 7 7.1 Details of the DP for EC-SNDP Correctness The following two lemmas imply the correctness of our DP. 16 Lemma 7.1. Let F ⊆ E (G) be a feasible solution. Then, for every bag t, there is a profile Ψt for t Y t such that (t, Ψt ) is valid; for any bag t with children t0 , t00 , then Ψ ←→ (Ψ0 , Ψ00 ), where Yt = F ∩ Et . Furthermore, c[root(T ), Ψroot(T ) ] = c(F ). Proof. We first observe that for each demand (γi , ki ), i ∈ [h] the solution F can be partitioned into S F = j∈[k] Fji such that the partition Fji contains a path connecting γi to the root r. Note that, if ki < k, there might not be any path in the partitions Fki +1 , . . . , Fk . Let t be a bag. We define Ψt as follows. We define the pair (omitting the script of t for convenience) ~ i (t)) for all i ∈ [h] as follows. (~Γi (t), ∆ Γij (t) = tc(Fji ∩ E (Tt )) ∆ij (t) = tc(Fji ) t t ~ i (t)) : i ∈ [h]}. We now define Ψt = {(~Γi (t), ∆ We first show that any cell (t, Ψt ) is valid. For any leaf bag t, Et = ∅ and hence Γij (t) = ∅, i ∈ [h], j ∈ [k ]. For the bag root(T ), E (Tt ) = E and hence Γij (t) = ∆ij (t), i ∈ [h], j ∈ [k ]. Finally, since Pji connects r to γi for all i ∈ [h], j ∈ [ki ], then (r, γi ) ∈ ∆ij (tγi ). We conclude that any cell (t, Ψt ) defined as above is marked valid. Finally we define, for any bag t, a set of edges Y (t) ⊆ Et along with a suitable partition of Y (t). Let Y (t) = F ∩ Et and Yji (t) = Fji ∩ Et . The subsets Yji (t) indeed form a partition owing to the disjointness of the sets Fji , for all j ∈ [ki ] and a fixed i ∈ [h]. It is clear from the above definitions of Γij and ∆ij that they satisfy the global connectivity conditions for Yji . Applying Lemma 3.1, the local conditions must also be satisfied for the bag t along with Y (t) its children t0 , t00 and Y (t). This gives us Ψ ←→ (Ψ0 , Ψ00 ) and we are done. Notice that the c[root(T ), Ψroot(T ) ] = P t∈V (T ) c(Y (t)) = c(F ). We remark that the DP uses exactly one cell per bag in any valid solution. Lemma 7.2. Let C = {(t, Ψt ) : t ∈ V (T )} be the set of cells selected by the dynamic programming solution. Then there exists a set of edges F ⊆ E such that for each demand (γi , ki ), i ∈ [h], there exist ki edge-disjoint paths connecting r to γi . Furthermore, c(F ) = c[root(T ), Ψroot(T ) ]. Proof. First we define the set F . Consider the cells in C. Since each cell (t, Ψt ) is picked by the DP, there must exist a set of edges Yt ⊆ Et such that for some pair of children cells {(t0 , Ψt0 ), (t00 , Ψt00 )} ∈ Y t C, Ψt ←→ (Ψt0 , Ψt00 ). Define F = (t,Ψt )∈C Yt . We prove that for any demand (γi , ki ), i ∈ [h], there exist edge-disjoint paths Pji , j ∈ [ki ] in F that connect r to γi . S For a demand vertex γi , i ∈ [h], consider the bag t? = tγi and the cell (t? , Ψt? ) ∈ C. Since this cell ~ ) ∈ Ψt? such that (r, γi ) ∈ ∆j for all j ∈ [ki ]. is valid, there exists a connection profile (~Γ, ∆ ~ t ) and sets of edges Yt,j for every other bag We now suitably define connection profiles (~Γt , ∆ t ∈ V (T ), and prove that these elements satisfy the local connectivity property of Lemma 3.1. 17 We explicitly describe the definition for the children bags t0 and t00 of t? . The definition for every other bag in the subtree Tt can be carried out in a similar recursive fashion. ~ 0 ) ∈ Ψt0 , (~Γ00 , ∆ ~ 00 ) ∈ Ψt00 and a partition By definition of consistent DP cells, there exists (~Γ0 , ∆ S Yt? = j∈[k] Yt? ,j such that, for all j ∈ [h], the triplet (Γj , ∆j ), (Γ0j , ∆0j ), (Γ00j , ∆00j ) satisfies the local 0 ~ t0 ) = (~Γ0 , ∆ ~ 0 ), (~Γt00 , ∆ ~ t00 ) = (~Γ00 , ∆ ~ 00 ). connectivity conditions for Yt? ,j . We take (~Γt , ∆ ~ ) and defining a suitable A similar recursive definition works for all bags in T \ Tt , starting with (~Γ, ∆ connection profile in p(t). We now apply the equivalence from Lemma 3.1 to conclude that the global connectivity definition is satisfied by (Γtj , ∆tj ) and edge set Yt,j for any bag t ∈ V (T ). As a consequence, there exist paths S connecting r to γi in t∈V (T ) Yt,j , for j ∈ [ki ]. Since the sets Yt,j are disjoint for j ∈ [ki ], we obtain S the required ki edge-disjoint paths in the sets Yj = t∈V (T ) Yt,j . 7.2 Running Time Analysis To bound the running time of the DP algorithm, we start by proving a bound on the number of cells in the DP table (Lemma 4.1), and then show how this implies the running time of the algorithm. Proof of Lemma 4.1. The following observations are used to prove the lemma: Observation 7.3. 2 1. The number of possible subsets of edges between w elements is 2w . 2 2. The number of possible partitions of such a subset of edges is k w . 3. The number of possible equivalence relations in a set of w elements is ww . 2 Let t ∈ T . We know that Ψ ⊆ Xt × Xt , whose size can be up to 2kw . However, it is sufficient to consider equivalence relations in the bag t, as we always take the transitive closure in definitions. 2wk Therefore, there are at most ww possibilities for each Γj , ∆j (Observation 7.3) and at most 2w possibilities for Ψ. Note that the algorithm itself does one of the two possible options for each cell: it either initializes itself, for which it needs to check every element of Ψ, taking time O (w2wk kw ); or it computes the value based on children cells, for which it enumerates all sets Ψ0 , Ψ00 and checks them for 2wk consistency. The number of such sets to check is again 2w , and checking each triple of sets takes 2 time polynomial in wwk and k w . In sum, the algorithm takes time O (n exp(wO (wk) )). 8 Details on the Algorithms for Restricted Group SNDP In this section, we present Lemma 8.1 and Lemma 8.2, which prove the correctness of the reduction presented in Section 5 and complete the proof of Theorem 5.1. 18 Lemma 8.1. For every solution F ⊆ E (G), there is a valid tree Te ⊆ Te with the same cost and that connects the same groups that F ki -connects, that is, if F contains ki edge-disjoint paths to a vertex γi ∈ Si , then Te connects the root to some node t̃ ∈ Sei . Proof. Let {γi ∈ Si }i∈[h0 ] , h0 ≤ h, be the group vertices that are ki -connected by F (w.l.o.g. F the first h0 groups). For every i ∈ [h0 ], we partition the solution F into ki subsets that connect r to γi , i. e. we partition F into {Fij }j∈[ki ] , such that each Fij contains a r-γi -path. We also define Ψt and ~ i (t)) ∈ Ψt for all t ∈ V (T ) as is done in the proof of Lemma 7.1. (~Γi (t), ∆ F ∩E By the proof of Lemma 7.1, (Ψt0 , Ψt00 ) ←→t Ψt . Therefore, we can build a tree Te by picking one copy of each of the nodes t̃[t, Ψt ] and connecting nodes t̃c [t, Ψt , Ψt0 , Ψt00 , F ∩ Et ], such that Te is connected. Furthermore, for the topmost bag tγi containing γi , we have that t̃[tγi , Ψtγi ] ∈ Sei , since Fij connects r and γi , which implies that (r, γi ) ∈ ∆ij (tγi ), for j ∈ [ki ]. Therefore, if F ki -connects a group Si , Te contains a node of Sei . The proof that F and Te have the same cost follows from the proof of Lemma 7.1. Lemma 8.2. For every valid tree Te ⊆ Te , there is a solution F ⊆ E (G) with the same cost and which ki -connects a group Si if Te connects Sei , that is, if Te connects the root to some node t̃ ∈ Sei , then F contains ki edge-disjoint paths to a vertex γi ∈ Si . Proof. Let {Sei }i∈[h0 ] , h0 ≤ h be the groups connected by Te (w.l.o.g.). By the definition of Sei , there must be some γi ∈ Si and node t̃[tγi , Ψtγi ] ∈ Sei ∩ V (Te ) for every i ∈ [h0 ]. By the definition of valid tree, Te contains exactly one node t̃[t, Ψt ] for each t ∈ V (T ), as well as exactly one node t̃c [t, Ψt , Ψt0 , Ψt00 , Yt ] for each non-leaf node t ∈ V (T ) such that Y t (Ψt0 , Ψt00 ). Ψt ←→ The above conditions suffice to apply the proof of Lemma 7.2 (with demands {(γi , ki )}i∈[h0 ] ); thus, we can obtain a solution F such that for every i ∈ [h0 ], F contains ki edge-disjoint paths from r to γi . Furthermore, F has the same cost as Te. Acknowledgements. Part of this work was done while Parinya Chalermsook, Bundit Laekhanukit and Daniel Vaz were visiting the Simons Institute for the Theory of Computing. It was partially supported by the DIMACS/Simons Collaboration on Bridging Continuous and Discrete Optimization through NSF grant #CCF-1740425. Parinya Chalermsook is currently supported by European Research Council (ERC) under the European UnionâĂŹs Horizon 2020 research and innovation programme (grant agreement No 759557) and by Academy of Finland Research Fellows, under grant number 310415 19 References [1] M. Bateni, M. T. Hajiaghayi, and D. Marx. Approximation schemes for steiner forest on planar graphs and graphs of bounded treewidth. J. ACM, 58(5):21:1–21:37, 2011. [2] M. Bellare, S. Goldwasser, C. Lund, and A. Russeli. Efficient probabilistically checkable proofs and applications to approximations. In Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing, May 16-18, 1993, San Diego, CA, USA, pages 294–304, 1993. [3] A. Berger and M. Grigni. Minimum weight 2-edge-connected spanning subgraphs in planar graphs. In Automata, Languages and Programming, 34th International Colloquium, ICALP 2007, Wroclaw, Poland, July 9-13, 2007, Proceedings, pages 90–101, 2007. [4] H. L. Bodlaender. NC-algorithms for graphs with small treewidth. In J. van Leeuwen, editor, Graph-Theoretic Concepts in Computer Science, 14th International Workshop, WG ’88, Amsterdam, The Netherlands, June 15-17, 1988, Proceedings, volume 344 of Lecture Notes in Computer Science, pages 1–10. Springer, 1988. [5] H. L. Bodlaender, P. G. Drange, M. S. Dregi, F. V. Fomin, D. Lokshtanov, and M. Pilipczuk. A ck n 5-approximation algorithm for treewidth. SIAM J. Comput., 45(2):317–378, 2016. [6] R. B. Borie, R. G. Parker, and C. A. Tovey. Automatic generation of linear-time algorithms from predicate calculus descriptions of problems on recursively constructed graph families. Algorithmica, 7(5&6):555–581, 1992. [7] G. Borradaile, E. D. Demaine, and S. Tazari. Polynomial-time approximation schemes for subset-connectivity problems in bounded-genus graphs. Algorithmica, 68(2):287–311, 2014. [8] G. Borradaile, P. N. Klein, and C. Mathieu. An O(n log n) approximation scheme for steiner tree in planar graphs. ACM Trans. Algorithms, 5(3):31:1–31:31, 2009. [9] G. Borradaile, P. N. Klein, and C. Mathieu. A polynomial-time approximation scheme for euclidean steiner forest. ACM Trans. Algorithms, 11(3):19:1–19:20, 2015. [10] G. Borradaile and B. Zheng. A PTAS for three-edge-connected survivable network design in planar graphs. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2017, August 16-18, 2017, Berkeley, CA, USA, pages 3:1–3:13, 2017. [11] İ. E. Büyüktahtakin. Dynamic Programming Via Linear Programming. John Wiley & Sons, Inc., 2010. [12] P. Chalermsook, S. Das, B. Laekhanukit, and D. Vaz. Beyond metric embedding: Approximating group steiner trees on bounded treewidth graphs. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19, pages 737–751, 2017. 20 [13] P. Chalermsook, F. Grandoni, and B. Laekhanukit. On survivable set connectivity. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, pages 25–36, 2015. [14] J. Cheriyan and A. Vetta. Approximation algorithms for network design with metric costs. SIAM J. Discrete Math., 21(3):612–636, 2007. [15] J. Chuzhoy and S. Khanna. Algorithms for single-source vertex connectivity. In 49th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2008, October 25-28, 2008, Philadelphia, PA, USA, pages 105–114, 2008. [16] J. Chuzhoy and S. Khanna. An o(k3 log n)-approximation algorithm for vertex-connectivity survivable network design. Theory of Computing, 8(1):401–413, 2012. [17] B. Courcelle. The monadic second-order logic of graphs. i. recognizable sets of finite graphs. Inf. Comput., 85(1):12–75, 1990. [18] M. Cygan, J. Nederlof, M. Pilipczuk, M. Pilipczuk, J. M. M. van Rooij, and J. O. Wojtaszczyk. Solving connectivity problems parameterized by treewidth in single exponential time. In IEEE 52nd Annual Symposium on Foundations of Computer Science, FOCS 2011, Palm Springs, CA, USA, October 22-25, 2011, pages 150–159, 2011. [19] A. Czumaj, M. Grigni, P. Sissokho, and H. Zhao. Approximation schemes for minimum 2-edgeconnected and biconnected subgraphs in planar graphs. In Proceedings of the Fifteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2004, New Orleans, Louisiana, USA, January 11-14, 2004, pages 496–505, 2004. [20] D. P. de Farias and B. V. Roy. Approximate dynamic programming via linear programming. In Advances in Neural Information Processing Systems 14 [Neural Information Processing Systems: Natural and Synthetic, NIPS 2001, December 3-8, 2001, Vancouver, British Columbia, Canada], pages 689–695, 2001. [21] F. d’Epenoux. A probabilistic production and inventory problem. Management Science, 10(1):98–108, 1963. [22] N. Garg, G. Konjevod, and R. Ravi. A polylogarithmic approximation algorithm for the group steiner tree problem. J. Algorithms, 37(1):66–84, 2000. [23] A. Gupta, R. Krishnaswamy, and R. Ravi. Tree embeddings for two-edge-connected network design. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2010, Austin, Texas, USA, January 17-19, 2010, pages 1521–1538, 2010. [24] A. Gupta, K. Talwar, and D. Witmer. Sparsest cut on bounded treewidth graphs: algorithms and hardness results. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 281–290, 2013. [25] E. Halperin and R. Krauthgamer. Polylogarithmic inapproximability. In Proceedings of the 35th Annual ACM Symposium on Theory of Computing, June 9-11, 2003, San Diego, CA, USA, pages 585–594, 2003. 21 [26] K. Jain. A factor 2 approximation algorithm for the generalized steiner network problem. Combinatorica, 21(1):39–60, 2001. [27] R. Khandekar, G. Kortsarz, and Z. Nutov. Approximating fault-tolerant group-steiner problems. Theor. Comput. Sci., 416:55–64, 2012. [28] B. Laekhanukit. Parameters of two-prover-one-round game and the hardness of connectivity problems. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014, pages 1626–1643, 2014. [29] B. Laekhanukit. An improved approximation algorithm for the minimum cost subset kconnected subgraph problem. Algorithmica, 72(3):714–733, 2015. [30] A. S. Manne. Linear programming and sequential decisions. Management Science, 6(3):259– 267, 1960. [31] R. K. Martin, R. L. Rardin, and B. A. Campbell. Polyhedral characterization of discrete dynamic programming. Operations Research, 38(1):127–138, 1990. [32] Z. Nutov. Approximating minimum-cost connectivity problems via uncrossable bifamilies. ACM Trans. Algorithms, 9(1):1:1–1:16, 2012. [33] M. Pilipczuk, M. Pilipczuk, P. Sankowski, and E. J. van Leeuwen. Subexponential-time parameterized algorithm for steiner tree on planar graphs. In 30th International Symposium on Theoretical Aspects of Computer Science, STACS 2013, February 27 - March 2, 2013, Kiel, Germany, pages 353–364, 2013. [34] D. P. Williamson, M. X. Goemans, M. Mihail, and V. V. Vazirani. A primal-dual approximation algorithm for generalized steiner network problems. Combinatorica, 15(3):435–454, 1995. A Algorithms for VC-SNDP In this section, we focus on vertex connectivity problems, specifically, Rooted VC-SNDP with multiple roots, where there is a subset R ⊆ V such that the connectivity requirement k (u, v ) > 0 only if u ∈ R. We argue that any instance of Subset k-VC can be transformed into that of Rooted VC-SNDP with k roots as follows: Let T be a terminal set for k-subset vertex connectivity. Let R ⊆ T be arbitrary subset of terminals with |R| = k. We specify the connectivity k (r, v ) = k for all r ∈ R and v ∈ T . It is easy to verify that this instance is equivalent to the original instance. In the subsequent discussion, we focus on Rooted VC-SNDP with at most k roots. We start by adding, for each r ∈ R, vertex r into every bag Xt . This increases the width of the decomposition by an additive factor of at most k. The organization in this section is as follows. We start by extending the framework of Section 3 to vertex-connectivity in Appendix B. In Appendix B.1, we explain how the DP table is setup and the main ideas for the vertex-connectivity version of the problem. In Appendix B.2, we present the 22 DP algorithm, and how to compute the value of each cell. Finally, in Appendix B.3 we show that the algorithm finds an optimal solution to the VC-SNDP problem. Throughout this section, we will use the notation defined in Section 4, when applicable. B Global ⇔ Local Checking for Vertex Connectivity When dealing with vertex connectivity, we want to find paths that have disjoint internal vertices, but which all share the same source and sink. Therefore, we must introduce some changes to our connection sets and to the way they are defined. The most important change is the use of a function tc∗ , which is a modified version of transitive closure, introduced in Section 6. We recall its definition here: n tc∗Z (S ) = (u, v ) ∃w1 , . . . , w` ∈ Z, ∀i ∈ [` − 1], (u, w1 ), (w` , v ), (wi , wi+1 ) ∈ S o Our previous notion of pair of sets (Γ, ∆) is now extended with a subset Z ⊆ Xt , which represents the vertices that can be used as internal nodes in a bag. We denote the new triple (Z, Γ∗ , ∆∗ ). Let S Wt ⊆ Xt \ Xp(t) for every t ∈ V (T ), W = t∈V (T ) Wt , and a triple (Z, Γ∗t , ∆∗t ) for every t ∈ V (T ). Given W , we say that the triples (Zt , Γ∗t , ∆∗t ) satisfy the local (resp. global) connectivity definition if, for every bag t ∈ V (T ), Global Local  W t  Zt : =   Zp ( t ) ∪ Wt ∩ V t  ∅ Γ∗t := ∆∗t := tc∗Z (Γ∗t0 ∪ Γ∗t00 ∪ Et ) t t  ∗ Γ t tc∗Z (∆∗ p(t) t ∪ Γ∗t ) t if t = root(T ) Zt := W ∩ Xt otherwise Γ∗t := tc∗W (ETt ) t is a leaf bag ∆∗t := tc∗W t (E (G)) t otherwise if t = root(T ) otherwise As in Section 3, we prove that the the local and global connectivity definitions are equivalent (Lemma B.1). Lemma B.1. Let Wt ⊆ Xt \ Xp(t) be a subset of vertices and (Z, Γ∗t , ∆∗t ) a triple for every t ∈ V (T ). Then, the triples (Zt , Γ∗t , ∆∗t ) satisfy the local connectivity definition iff they satisfy the global one. The proof of the lemma follows from Lemma 6.1, by setting Yt = Et . The notions of local and global connectivity in Lemma B.1 are also used to design algorithms for edge-connectivity with node-costs. However, we do not need the modified definition of transitive closure tc∗ (·) and use the tc(·) operator instead. We omit the full definition to avoid repetition. We remark that, even though we can use tc∗ (·), even for edge-connectivity, we can achieve a better runtime using tc(·), as is shown in Section 4. 23 B.1 Profiles As before, let Xt be the set of all connection profiles for t. By analogy, we say a vertex profile for ~ = (Z1 , Z2 , . . . , Zk ) is such that Zi ⊆ Xt . Additionally, let Vt denote the set of all t is a k-tuple Z vertex profiles for t. ~ ∗ ), where Z ~ ~Γ∗ , ∆ ~ is a vertex profile and ~Γ∗ , The profile Ψ of node t is now a collection of triples (Z, ~ ∗ are connection profiles, i.e., Ψ ⊆ Vt × Xt × Xt . ∆ ~ ∗ ) ∈ Ψ, ~ ~Γ∗ , ∆ A partial solution H ⊆ V (Gt ) is said to be consistent with profile Ψ for t if, for all (Z, • For each (u, v ) ∈ Γ∗i and (a, b) ∈ Γ∗j for i 6= j, there are paths Puv , Pab ⊆ H connecting the respective vertices in Gt such that the internal vertices of Puv and Pab are disjoint. All the internal vertices in Puv , Pab which are in Xt are contained in Zi , Zj , respectively. • There is a global solution H 0 ⊇ H such that, for each (u, v ) ∈ ∆i and (a, b) ∈ ∆j for i 6= j, there are paths Quv , Qab ⊆ H 0 connecting the respective vertices in G such that the internal vertices of Quv and Qab are disjoint. All the internal vertices in Quv , Qab which are in Xt are contained in Zi , Zj , respectively. In other words, a solution consistent with a profile must “implement” all connectivity requirements ~ Furthermore, the vertices used by the solution in Xt are by ~Γ and must be extensible to satisfy ∆. ~ given by Z. The DP table has a cell c[t, Ψ] for each bag t ∈ V (T ) and each profile Ψ for t. This cell tentatively stores the optimal cost of a solution consistent with the profile. B.2 The DP Valid cells: We mark all the cells that do not correspond to valid solutions of the problem as invalid (for example, by setting c[t, Ψ] = ∞ for invalid cells). In particular, the following cells are invalid: • Any leaf that has any connectivity requirements is invalid. That is, we set c[t, Ψ] = 0 if Ψ ⊆ Vt × {(∅, . . . , ∅)} × Xt ; otherwise, c[t, Ψ] = ∞. • Any cell that cannot be extended into a feasible solution is invalid. Let tv be the topmost bag that contains a terminal v ∈ T . The cell is valid if, for every r ∈ R, there is a triple ~ ) ∈ Ψ such that (r, v ) ∈ ∆j for all j ≤ k (r, v ) and r, v ∈ S ~ ~Γ, ∆ (Z, j∈[k ] Zi . Otherwise, either r or v are not in the solution, or they are not connected by k (r, v ) vertexdisjoint paths, and hence the cell is invalid. ~) ∈ Ψ ~ ~Γ, ∆ • The root bag root(T ) together with profile Ψ is an invalid cell if there is a triple (Z, such that Γj 6= ∆j for some j. DP Computation: For all other cells, we compute their values from the values of the children. Let t be a bag with left-child t0 and right-child t00 . Let Ψ, Ψ0 , Ψ00 be their profiles, respectively, and W ⊆ Xt \ Xp(t) . 24 W We say that Ψ is consistent with (Ψ0 , Ψ00 ) via W (abbreviated by Ψ ←→ (Ψ0 , Ψ00 )) if the fol~ ) ∈ Ψ, there are (Z ~ 0 ) ∈ Ψ0 and ~ ~Γ, ∆ ~ 0 , ~Γ0 , ∆ lowing conditions are satisfied. For each triple (Z, ~ 00 ) ∈ Ψ00 , together with a partition of W into W1 ∪ W2 ∪ . . . ∪ Wk such that, for all j ∈ [k ], ~ 00 , ~Γ00 , ∆ (Z • Γj = tc∗Zt (Γ0j ∪ Γ00j ∪ Et ) • ∆0j = tc∗Zt0 (∆j ∪ Γ0j ) t t0 • ∆00j = tc∗Zt00 (∆j ∪ Γ00j ) t00 • Zj ∩ (Xt \ Xp(t) ) = Wj • Zj0 ∩ Xt = Zj ∩ Xt0 • Zj00 ∩ Xt = Zj ∩ Xt00 ~ 0 ) ∈ Ψ0 (resp., (Z ~ 00 ) ∈ Ψ00 ), there are (Z ~ 00 ) ∈ Ψ00 ~ 0 , ~Γ0 , ∆ ~ 00 , ~Γ00 , ∆ ~ 00 , ~Γ00 , ∆ Similarly, for any triple (Z ~ 0 ) ∈ Ψ0 ), plus (Z, ~ ) ∈ Ψ and some partition of W satisfying similar conditions ~ 0 , ~Γ0 , ∆ ~ ~Γ, ∆ (resp., (Z as above. We remark that the condition Zt = (Zp(t) ∪ Wt ) ∩ Xt in the local connectivity definition of Lemma B.1, can be equivalently written as Zt ∩ Xp(t) = Zp(t) ∩ Xt and Zt ∩ (Xt \ Xp(t) ) = Wt (since Wt and Zp(t) are always disjoint). We choose to use the second formulation for convenience. Then the value of c[t, Ψ] can be defined recursively among valid cells: c[t, Ψ] = min W (c[t0 , Ψ0 ] + c[t00 , Ψ00 ] + c(W )) Ψ←→(Ψ0 ,Ψ00 ) Solution: The solution can be computed by n ~ ) ∈ Ψ)(∀j ∈ [k ])Γj = ∆j ~ ~Γ, ∆ min c[root(T ), Ψ] | (∀(Z, B.3 o Correctness of the DP The following two lemmas imply correctness. Lemma B.2. Let H ⊆ V (G) be a feasible solution. Then, for every bag t, there is a profile Ψt W t for t such that (t, Ψt ) is valid; for any bag t with children t0 , t00 , then Ψ ←→ (Ψ0 , Ψ00 ), where Wt = H ∩ (Xt \ Xp(t) ). Furthermore, c[root(T ), Ψroot(T ) ] = c(H ). Proof. We fix r ∈ R, v ∈ T with k (r, v ) > 0. Observe that r, v ∈ H, and the solution H can be partitioned into H = {Hj }j∈[k] such that for j ≤ k (r, v ), there is a path Pj between r and v whose internal vertices are in Hj . Note that, if k (r, v ) < k, then Hj is irrelevant, for j > k (r, v ), and might be empty. 25 ~ ∗ (t)) is defined as: ~ (t), ~Γ∗ (t), ∆ For any bag t, we define Ψt as follows. The triple (Z Zj (t) := Hj ∩ Xt Γ∗ j (t) := tc∗Hj (ETt ) ∗ ∆ j (t) : = tc∗Hj t (E (G)) t ~ (t), ~Γ∗ (t), ~Γ∗ (t)) for all r ∈ R, v ∈ T . We add to Ψt the triples (Z We first show that any cell (t, Ψt ) is valid. We again fix r ∈ R, v ∈ T and take the corresponding ~ ∗ (t)) ∈ Ψt and partition {Hj } ~ (t), ~Γ∗ (t), ∆ triples (Z j∈[k ] . For every leaf bag t, Et = ∅ and hence Γ∗ j (t) = ∅. For the root bag, t = root(T ), E (Tt ) = E and hence Γ∗ j (t) = ∆∗ j (t). Finally, for j ∈ [k (r, v ), Pj connects r to γi using internal vertices in Hj , S so (r, v ) ∈ ∆∗ j (tv ). Since, r, v ∈ j∈[k] Zj (tv ), we conclude that the cells (t, Ψt ) defined above are marked valid. For each bag t ∈ V (T ), we additionally define Wj (t) = Hj ∩ (Xt \ Xp(t) ). Observe that the Wj (t), j = 1, 2, . . . , ki naturally induce a partition on Wt . It is clear from the definitions that Zj (t), Γ∗ j (t), ∆∗ j (t) satisfy the global connectivity definitions for vertex sets Wj (t). Therefore, we can apply Lemma B.1, for every j ∈ [k ] to conclude that W t Ψt ←→ (Ψt0 , Ψt00 ) for every bag t ∈ V (T ) with children t0 , t00 , where Wt = H ∩ (Xt \ Xp(t) ). Notice that the c[root(T ), Ψroot(T ) ] = P t∈V (T ) c ( Wt ) = c ( H ) . We remark that every DP solution uses exactly one cell per bag t ∈ V (T ). Lemma B.3. Let {(t, Ψt )}t∈V (T ) be the cells selected in a dynamic programming solution. There exists a solution H ⊆ V with cost c(H ) = c[root(T ), Ψroot(T ) ] such that for every demand (γi , ki ), i ∈ [h], H contains ki vertex-disjoint paths from r to γi . Proof. Let us start by defining the solution H. For every non-leaf t ∈ V (T ) with children t0 , t00 , there must be some set Wt such that W t Ψt ←→ (Ψt0 , Ψt00 ) We take H = S t∈V (T ) Wt as our solution. Now, fix r ∈ R, v ∈ V . We will prove that H contains k (r, v ) vertex-disjoint paths from r to ~ ∗ (t)) ∈ Ψt , as well as partition ~ (t), ~Γ∗ (t), ∆ v. We now define, for each bag t ∈ V (T ), the sets (Z {Wj (t)}j∈[k] of the vertices in Wt , as is done in the proof of Lemma 7.2. Now, since for every j ∈ [k ], Zj (t), Γ∗j (t), ∆∗j (t) satisfy the local connectivity constraints, we can apply Lemma B.1, which implies that Zj (t), Γ∗j (t), ∆∗j (t) satisfy the global connectivity constraints as well. Since all cells in (t, Ψt ) are valid, we know that (r, v ) ∈ ∆∗j (t) for j ∈ [k (r, v )] and r, v ∈ j∈[k] Zj (t). S Therefore, Hj = t∈V (T ) Hj (t) contains the internal nodes of a path between r and v, and r, v ∈ H. We conclude that H contains k (r, v ) vertex-disjoint paths between r and v. S 26 B.4 Running Time Analysis The running time for the presented algorithm follows closely that for the edge-connectivity version, with the exception that Γ∗ and ∆∗ are, in general, no longer equivalence relations, and there are 2 now 2(w+k) possibilities for each such set. We conclude that the running time of the algorithm is O (n · exp(exp(O ((w + k )2 k )))). We also remark that a very similar idea for the DP works for the edge-connectivity version of the problem with node-costs. However, we can use the definition of tc instead of tc∗ in order to define the DP cells and hence the runtime for that case is O (n · exp(poly(wwk )). C Hardness of Restricted Group SNDP on General Graphs In this section, we sketch the proof of the approximation hardness for the vertex-weighted Restricted Group SNDP on general graphs. The reduction is from Min-k-CSP. In Max-k-CSP, we are given a set of n variables x1 , . . . , xn over the domain [N ] and a set of m constraints (which are functions) C1 , . . . , Ch such that each Cj depends on (exactly) k variables. The goal in the Max-k-CSP is to find an assignment to variables that maximizes the number of constraints satisfied. In the minimization version, say Min-k-CSP, we are allowed to assign multiple values (or labels) to each variable to guarantee that each constraint can be satisfied by some of the assignments while minimizing the total number of labels. To be specific the assignment is a function σ : {x1 , . . . , xn } → 2[N ] , and we wish to find an assignment such that, for every constraint Cj depending on variables xi1 , . . . , xik , there exist labels a1 ∈ σ (xi1 ), . . . , ak ∈ σ (xik ) such that Cj (a1 , . . . , an ) evaluates to true for all j ∈ [m]. It is know that if the hardness of Max-k-CSP is α(n), then the hardness of the Min-k-CSP is Ω(α(n)1/k ) (see, e.g., [28]). The special case of k = 2 is called the Label-Cover problem. We reduce from Min-k-CSP to Restricted Group SNDP by representing the assignments of variables by positive weight vertices and representing accepting configurations of each constraints by a group of vertices. To be precise, we first construct a graph G = (V , E ) such that V = {r} ∪ {(xi , a) : i ∈ [n], a ∈ [N ]}∪ {(j, a1 , . . . , ak ) : j ∈ [h], a1 , . . . , ak ∈ [N ] and Cj (a1 , . . . , ak ) = true} E = {r (xi , a) : i ∈ [n], a ∈ [N ]}∪ {(xi , ai )(j, a1 , . . . , ak ) : (xi , ai ), (j, a1 , . . . , ak ) ∈ V and Cj depends on xi at the `-th argument, and a` = a} We set the cost of each vertex of the form (xi , a) to be one and set cost of other vertices to be zero. We define r to be the root vertex and, for each j ∈ [h], we define a group Sj = {(j, a1 , . . . , ak ) ∈ V }. We set the connectivity demands kj = k for all j ∈ [h]. This finishes the construction. Observe that every vertex that belongs to some group Sj has degree exactly k. Thus, the only way to have k-edge disjoint paths from some vertex in Sj to the root r is to choose all of its neighbors in {(xi , a) : Cj depends on xi , a ∈ [N ]}. It is not hard to see that vertices in the 27 latter set corresponding to an assignment to variables in the Min-k-CSP instance and that some vertex in Sj has k neighbors if and only if the chosen vertices correspond to an assignment that satisfies the constraint Cj . Moreover, ones may verify that a vertex v ∈ Sj has k neighbors in an induced subgraph H ⊆ G if and only if v has k edge-disjoint paths connecting to the root r. Consequently, this gives a reduction from Min-k-CSP to the vertex-weighted Restricted Group 1− SNDP. The approximation hardness then follows from the hardness of Min-k-CSP, which is 2log n under NP 6⊆ DTIME(npolylog(n) ), and nδ/k for some constant 0 < δ < 1 under the Sliding Scale Conjecture [2]. 28
8cs.DS
arXiv:1401.5438v1 [math.CA] 21 Jan 2014 On the Reduction of Singularly-Perturbed Linear Differential Systems∗ Moulay Barkatou, Suzy S. Maddah XLIM UMR 7252 ; DMI University of Limoges; CNRS 123, Avenue Albert Thomas 87060 Limoges, France [email protected] [email protected] † Hassan Abbas Laboratory of Mathematics Lebanese University, Beirut, Lebanon [email protected] February 17, 2018 Abstract In this article, we recover singularly-perturbed linear differential systems from their turning points and reduce their parameter singularity’s rank to its minimal integer value. Our treatment is Moser-based; that is to say it is based on the reduction criterion introduced for linear singular differential systems in [Moser, 1960]. Such algorithms have proved their utility in the symbolic resolution of the systems of linear functional equations [Barkatou, 1989; Barkatou et al., 2008, 2009], giving rise to the package ISOLDE [Barkatou et al., 2013], as well as in the perturbed algebraic eigenvalue problem [Jeannerod et al., 1999]. In particular, we generalize the Moser-based algorithm described in [Barkatou, 1995]. Our algorithm, implemented in the computer algebra system Maple, paves the way for efficient symbolic resolution of singularly-perturbed linear differential systems as well as further applications of Moser-based reduction over bivariate (differential) fields [Barkatou et al., 2014]. ∗ † Submitted to ISSAC’14, Kobe, Japan Enrolled under a joint PhD program with the Lebanese University 1 Keywords: Moser-based reduction, Perturbed linear differential systems, Turning points, Computer algebra. 1 Introduction Let K be a commutative field of characteristic zero equipped with a derivation δ, that is a map δ : K → K satisfying δ(f + g) = δf + δg and δ(f g) = δ(f )g + f δ(g) for all f, g ∈ K. We denote by C its field of constants, V a K-vector space of dimension n, and A an element in K n×n . Set ∆ = δ − A, then ∆ is a δ- differential operator acting on V , that is, a C-linear endomorphism of V satisfying the Leibniz condition: ∀f ∈ K, v ∈ V ∆(f v) = δ(f )v + f ∆(v). Let O = C[[x, ǫ]], the ring of formal power series in x and ǫ over the field of complex numbers, where x is a complex variable and ǫ is a small parameter. d Denote by K its field of fractions equipped with δ = ǫ dx . Let Ox = C[[x]], Kx be its fields of fractions, and h, p be integers (h ≥ 0). Thereby, ∆ is the differential operator associated to a singularly-perturbed linear differential system. Denoting by Y an unknown n-dimensional column vector, the former is written as ∞ X dY −h −p Ak (x)ǫk Y. (1) = A(x, ǫ)Y = ǫ x ǫ dx k=0 Such systems have countless applications which are traced back to the year 1817 and their study encompasses a vast body of literature (see, e.g. [Chen, 1984; Lin, 1966; McHugh, 1971; Wasow, 1985] and references therein). However, their symbolic resolution is still open to investigation. Clearly, system (1) is a singular perturbation of the widely studied linear singular system of differential equations (see, e.g., [Balser, 2000; Hsieh et al., d 1999] and references therein). The latter is obtained by setting δ = x dx and K = C((x)), the univariate field of formal Laurent power series. Hence ∆ is associated to ∞ X dY −p x Ak xk Y. (2) = A(x)Y = x dx k=0 Contrary to system (1), there exist efficient algorithms contributing to the formal reduction of system (2) (see, e.g [Barkatou, 1997; Pflugel , 2000]), that is the algorithmic procedure that computes a change of basis w.r.t. which A(x) has normal form facilitating the construction of formal solutions. Among which, rank reduction algorithms play an eminent role as they reduce the nonnegative integer p, called the Poincaré rank, to its minimal integer value, the true Poincaré rank (see, e.g., [Barkatou et al., 2009; Levelt, 1991]). In particular, if the latter is null then system (2) is said to be regular singular, 2 that is to say, in any small sector, its solutions grow at most as an algebraic function. Otherwise, it is irregular singular. However, the classical formal simplification of system (2) begins with the reduction of its leading coefficient matrix A0 to its Jordan form. Hence, in addition to the usual difficulties encountered within the formal reduction itself, additional ones arise for system (1) since its leading coefficient matrix A0 (x) is a matrix-valued function rather than a constant one. In particular, if it has mulitple eigenvalues then they might coalesce (see, e.g., the example page 223, [Wasow, 1985]). In classical textbooks, points where the Jordan form of A0 (x) is unstable, that is to say either the multiplicity of the eigenvalues or the degrees of the elementary divisors are not constant in a neighborhood of such points, are referred to as turning points (see, e.g., page 57, [Wasow, 1979]). The behavior of solutions of differential systems around such points is far more complicated than that of system (2) around an irregular singularity. In fact, the neighborhood of such a point is decomposed into a finite number of x-dependent neighborhoods in each of which the solution behaves quite differently though it may still be asymptotically accomplished (see, e.g., [Iwano et al., 1963]). In particular, if h ≤ −1 then the solution of system (1) can be sought upon presenting the solution as a power series in ǫ. The latter can then be inserted into (1) and the like powers of ǫ equated. This reduces the problem to solving recursively a set of non-homogeneous linear singular differential systems over Kx , the first of which is system (2) (see, e.g. page 52, [Chen, 1984] and page 101, [Wasow, 1979]). Hence, it seems plausible to investigate wether h rather than p can be diminished for such systems. The methods proposed in the literature of system (1) either exclude turning point [Chen, 1984] or are not algorithmic throughout. Moreover, they make an essential use of the so-called Arnold-Wasow form. For the univariate case, system (2), the research advanced profoundly in the last two decades making use of methods of modern algebra and topology. The former classical approach is substituted by efficient algorithms (see, e.g., [Barkatou, 1997; Barkatou et al., 2013, 2009; Pflugel , 2000] and references therein). It was the hope of Wasow [Wasow, 1985], in his 1985 treatise summing up contemporary research directions and results on system (1), that techniques of system (2) be generalized to tackle the problems of system (1). In this article, we are interested in recovering system (1) from its turning points and decoupling it into a set of systems of lower dimensions for each of which h has a minimal integer value. Given system (2), Moser defined two rational numbers: m(A) = µ(A) = rank(A0 ) ) and n min { m(T −1 ∆T ) | T ∈ GL(V )}. max (0, p + (3) (4) It follows that system (2) is regular whenever µ(A) ≤ 1. For m(A) > 1, he 3 proved that m(A) > µ(A) if and only if the polynomial θ(λ) := xrank(A0 ) det(λI + A0 + A1 )|x=0 x vanishes identically in λ. In this case, system (2) (resp. A(x)) is said to be Moser-reducible and m(A) can be diminished by applying a coordinate transformation Y = T Z where T ∈ GL(V ) of the form T = (P0 + P1 x) diag(1, . . . , 1, x, . . . , x) where P0 , P1 are constant matrices and det(P0 ) 6= 0 [Theorems 1 and 2, page 381, [Moser, 1960]]. This notion and algorithms developed (see, e.g. [Barkatou et al., 2009]), were generalized as well to linear functional matrix equations in [Barkatou et al., 2008], a particular case of which is system (2). This gave rise to the package ISOLDE [Barkatou et al., 2013], written in the computer algebra system Maple and dedicated to their symbolic resolution. Moser’s reduction criterion was also borrowed from the theory of differential systems to investigate efficient algorithmic resolution of the perturbed algebraic eigenvalue-eigenvector problem in [Jeannerod et al., 1999]. This problem is another prominent example in the univariate case, for which δ is the zero map and K = C((ǫ)). Thereby, ∆ is just a linear operator in the standard way and A(ǫ) is the widely studied perturbation of the constant matrix A0 (see, e.g., [Kato, 1980]). However, despite their utility and efficiency in these univariate cases, Moser-based algorithms are not considered yet over bivariate fields. In particular, the second author of this article developed in [Barkatou, 1995] a d Moser-based algorithm for the differential systems associated to δ = x dx and K = Q(x), the field of rational functions in x. This algorithm is the one we generalize here to system (1). Although Moser’s motivation for introducing these rational numbers for system (2) was to distinguish regular singular systems in the sense of Poincaré, we show hereby that they serve as well for the reduction of h to its minimal integer value. This article is organized as follows: In Section 2, we give preliminaries. In Section 3, we present a Moser-based method of recovery from turning points. In Section 4, we introduce a Moser-based reduction algorithm to diminish h to its minimal integer value. Our main results are Theorem 1 and Proposition 1. In Subection 4.3, we give an outline of a generalization of Levelt’s rank reduction algorithm of [Levelt, 1991] and illustrate by an example its comparison to the Moser-based one. Finally, we conclude in Section 5 and point out some prospects of further research. We remark however that as our interest is formal, reference to asymptotic behavior and/or convergence is dropped. One may consult in the latter direction, e.g., [Balser, 2000; Wasow, 1985]. 4 2 Preliminaries Consider system (1). Without loss of generality, we can assume that Ak (x) ∈ Kxn×n and the leading coefficient matrix A0 (x) is a nonzero element of Oxn×n otherwise h and p can be readjusted. We refer to A00 := A(0, 0) as the leading constant matrix. The nonnegative integer h will be referred to as the rank of singularity in ǫ (ǫ-rank, in short). We assume that system (1) has at most one turning point otherwise the region of study can be shrinked. Moreover, this turning point is placed at the origin, otherwise, a translation in the independent variable can be performed. We denote by Ik and Ok,l the identity and zero matrices respectively of prescribed dimensions. Let T ∈ GLn (K) then the change of the dependent variable Y = T Z in (1) gives ∞ X dZ Ak (x)ǫk Z. (5) ǫ = Ã(x, ǫ)Z = ǫ−h̃ x−p̃ dx k=0 where Ã(x, ǫ) ∈ K n×n and T [A] := Ã(x, ǫ) = T −1 A(x, ǫ)T − ǫ T −1 d T. dx (6) Systems (1) and (5) are called equivalent. In fact, T is a change of basis and Ã(x, ǫ) is the matrix of T −1 ∆T . Remark 1 Given system (1) and an equivalent system (5). • If h > 0 and T (x) ∈ GLn (Kx ) then it follows from (6) x−p̃ (Ã0 (x) + Ã1 (x)ǫ) = T −1 x−p (A0 (x) + A1 (x)ǫ)T. Hence, since we’ll be interested solely in Ã0 (x) and/or Ã1 (x), it suffices to investigate T −1 AT , the similarity term of T [A]. In particular, if T (x) ∈ GLn (Ox ) then p = p̃ as well. • If T = diag(ǫα1 , . . . , ǫαn ), where α1 , . . . , αn are integers, then δT is a zero matrix. Hence, T [A] = T −1 AT . A classical tool in perturbation theory is the so-called splitting which separates off the existing distinct coalescence patterns. Whenever the leading constant matrix A00 admits at least two distinct eigenvalues, there exists a coordinate transformation T ∈ GLn (O) which block-diagonalizes System (1) so that it can be decoupled into subsystems of lower dimensions whose leading constant matrices have a unique distinct eigenvalue each (see, e.g., Theorem XII − 4 − 1 page 381, [Hsieh et al., 1999]). Remark 2 In (Theorem 2.3 − 1, page 17, [Wasow, 1985]), we have a generalization of the splitting to the well-behaved case which refers to A0 (x) being 5 holomorphically similar to its holomorphic Jordan form. In particular, its eigenvalues don’t coalesce in the region of study. However, we limit ourselves to the weaker version given above as we aim to give a general discussion which doesn’t exclude turning points. We now consider one of these resulting subsystems and assume its leading constant matrix is in jordan normal form with a unique eigenvalue γ ∈ C. This can be always attained by a constant transformation. Upon applying the so-called eigenvalue shifting, i.e. Z −h−1 γx−p dx)Z, Y = exp(ǫ it is easy to verify from (6) that the resulting system has a nilpotent leading constant matrix. Hence, without loss of generality, we can assume that system (1) is such that A00 is nilpotent. Clearly, it doesn’t follow that A0 (x) is nilpotent and we deviate here from the classical treatment of system (2) as we may encounter turning points. The subscripts are to be ommitted and x, ǫ dropped from the notation whenever ambiguity is not likely to arise, e.g. A(x, ǫ) , A0 (x), A1 (x) will be denoted by A, A0 , A1 respectively. We set r = rank(A0 (x)). 3 Recovery from Turning Points We arrive at this section with A0 (x) of system (1) being nonnilpotent in contrary to the leading constant matrix A00 . We show that by Moser-based reduction of A0 (x) itself and ramification in x, that is a readjustment x = ts with s a positive integer, we can modify radically the nilpotency of A00 , i.e. arrive at a system for which splitting can be applied. The motivation behind considering such a general form of system (1) rather than that for which p ≤ 0 is to be justified in this section. In fact, system (1) will undergo a sequence of transformations which might introduce or elevate the order of the pole in x. This elevation is inevitable and is introduced identically in the classical treatment of such systems. However, the order of poles of Ak (x), k = 0, 1, 2, . . . grows at worst linearly with k which maintains an asymptotic validity of the formal construction [page 60, [Wasow, 1979]]. By Remark (1), the discussion is restricted to the similarity term T −1 AT of T [A]. Hence, A0 (x) can be treated as a perturbation of A00 . Proposition 1 Given system (1) ǫ ∞ X dY = A(x, ǫ)Y = ǫ−h x−p Ak (x)ǫk Y dx k=0 6 where A0 (x) = A00 + A01 x + A02 x2 + . . . such that A00 is a nilpotent constant matrix. If A0 (x) has a nonzero eigenvalue then there exist a positive integer s and a T ∈ GLn (Kx ) such that by setting x = ts , Y = T Z, we have in (5) Ã0 (t) := T −1 A0 (t)T = Ã00 + Ã01 t + Ã02 t2 + . . . where Ã00 has a nonzero constant eigenvalue. Proof. The eigenvalues of A0 (x) admit a formal expansion in the fractional powers of x in the neighborhood of x = 0 (see, e.g. [Kato,P1980]). We are j/s interested only in their first nonzero terms. Let µ(x) = ∞ be a j=0 µj x nonzero eigenvalue of A0 (x) whose leading exponent, i.e. smallest j/s for which µj 6= 0 and j, s are coprime, is minimal among the other nonzero eigenvalues. Then, without loss of generality, we can assume that s = 1 otherwise we set x = ts . Now, let T ∈ GLn (Kx ) such that Ã0 (x) is Moserirreducible in x i.e. θ(λ) = xrank(Ã00 ) det(λI + Ã00 + Ã01 )|x=0 x doesn’t vanish identically in λ. Then there are n − degθ eigenvalues of A0 (x) whose leading exponents lie in [0, 1[, and deg θ eigenvalues for which the leading exponent is greater or equal 1 [?]in [Jeannerod et al., 1999]]. But µ(x) is an eigenvalue of Ã0 (x) with a minimal leading exponent and hence it is among those whose leading exponents lie in [0, 1[. By our assumption, s = 1 and hence the leading exponent of µ(x) is zero and µ0 6= 0. Since µ0 is an eigenvalue of Ã00 , it follows that the latter is nonnilpotent. Remark 3 The eigenvalues of A0 (x) are the roots of the algebraic scalar equation f (x, µ) = det(A(x) − µIn ) = 0 and can be computed by NewtonPuiseux algorithm. The linear transformation T ∈ GLn (Kx ) can be computed efficiently via ISOLDE [Barkatou et al., 2013]. We illustrate our approach by an Example from [page 88, [Wasow, 1979]]. We remark however that the technique proposed in the former, adapted from [Turrittin, 1952] and [Iwano et al., 1963], debutes with the reduction of A(x, ǫ) to its Arnold-Wasow form as mentioned above and then constructing the so-called characteristic polygon. This particular example was given initially in that for simplicity and hence, the transformations computed by our algorithm, which doesn’t require reduction to this form, do not deviate hereby from those in the former.   0 1 0 Example 1 Let ǫ dY = ǫ−1 0 0 1  Y . Clearly, we have a truning point dx ǫ 0 x at x = 0 and   0 1 0 A0 (x) = 0 0 1  . 0 0 x 7 A00 is nilpotent in Jordan form while the eigenvalues of A0 (x) are 0, 0, x whence s = 1. A simple calculation shows that A0 (x) is Moser-reducible in x (θ(λ) ≡ 0). Let T = diag(1, x, x2 ) then upon setting Y = T Z we get     0 1 0 0 0 0 dZ = ǫ−1 x{0 0 1 + 0 0 0 x−3 ǫ + ǫ dx 0 0 1 1 0 0   0 0 0 0 −1 0  x−2 ǫ2 }Z. 0 0 −2 The constant leading coefficient matrix of the resulting matrix is no longer nilpotent. Hence the system can be decoupled into two subsystems upon setting Z = T W where     1 0 1 −1 −1 0 T = 0 1 1 + −1 −1 −2 x−3 ǫ + O(x−6 ǫ2 ). 0 0 1 −1 −1 0 The resulting equivalent system then consists of the two uncoupled lower dimension systems where W = [W1 , W2 ]T :     dW1 0 1 −1 0 −3 −1 ǫ = ǫ x{ + x ǫ+ 0 0 −1 0 dx   1 −1 x−6 ǫ2 + O(x−9 ǫ3 )}W1 . 1 −1 + x4 dW2 = ǫ−1 x{1 + x−3 ǫ + (1 + 2x4 )x−6 ǫ2 + O(x−9 ǫ3 )}W2 . dx For the former subsystem, A0 (x) and A00 are now simultaneously nilpotent. As for the latter, the exponential part is 21 ǫ−2 x2 (1 + O(x−3 ǫ)) which exhibits that the eigenvalue x of the leading coefficient matrix of the system we started with is recovered as expected. ǫ 4 ǫ-Rank Reduction Following Section 3, we can now assume without loss of generality that A0 (x) and A00 are simultaneously nilpotent. The system is recovered from its turning points and no further reduction can be attained via Splitting. In analogy to modern techniques for system (2), we investigate ǫ-rank reduction of system (1). 8 4.1 ǫ-Reduction Criteria Following (3) and (4), we define respectively the ǫ-Moser rank and ǫ-Moser Invariant of system (1) as the rational numbers: mǫ (A) = µǫ (A) = r ) and n min {mǫ (T [A])|T ∈ GLn (K) }. max (0, h + Definition 1 System (1) (the matrix A respectively) is called ǫ-reducible in the sense of Moser (ǫ-reducible, in short) if mǫ (A) > µǫ (A), otherwise it is said to be ǫ-irreducible. Remark 4 This definition is not to be mixed neither with the usual sense of reduced system in the literature, i.e. the system (2) obtained from system (1) (ǫ = 0); nor with the usual sense of Moser-reduced systems as for system (2), i.e. the systems whose p is minimal. In particular, if mǫ (A) ≤ 1 then h = 0 and no further reduction is to be sought via this approach. 4.2 ǫ-Reduction Algorithm We follow the algorithmic description of [Barkatou, 1995]. The main result of this section is the following theorem which is to be proved after giving its useful building blocks. Theorem 1 Given system (1) ∞ X dY −h −p ǫ Ak (x)ǫk Y = A(x, ǫ)Y = ǫ x dx k=0 such that rank(A0 (x)) = r and mǫ (A) > 1. A necessary and sufficient condition for the system to be ǫ-reducible (in the sense of Moser), i.e. the existence of a T (x, ǫ) ∈ Gln (K) such that r(Ã0 (x)) < r, is that the polynomial θ(λ) := ǫr det(λI + A0 + A1 )|ǫ = 0 ǫ vanishes identically in λ. Moreover, T (x, ǫ) can always be chosen to be a product of unimodular transformations in GLn (Ox ) and polynomial transformations of the form diag(ǫα1 , . . . , ǫαn ) where α1 , . . . , αn are nonnegative integers. 9 Lemma 1 There exists a unimodular matrix U(x) in GLn (Ox ) such that the leading coefficient matrix Ã0 (x) of U[A] have the following form  11  Ã0 O Ã0 = (7) Ã21 O 0  11  Ã0 11 where Ã0 is a square matrix of dimension r and is a n × r matrix of Ã21 0 full column rank r. Proof. By Remark 1, Ã0 = U −1 A0 U hence it suffices to search a similarity transformation U(x). Since Ox is a Principal Ideal Domain (the ideals of Ox are of the form xk O), it is well known that one can construct unimodular transformations Q(x), R(x) lying in GLn (Ox ) such that the matrix QA0 R has the Smith Normal Form Q A0 R = diag(xβ1 , . . . , xβr , 0, . . . , 0)) where detR(0) 6= 0, detQ(0) 6= 0 , and β1 , . . . , βr in Z with 0 ≤ β1 ≤ β2 ≤ · · · ≤ βr . It follows that we can compute a unimodular matrix R(x) in GLn (Ox ) so that its n − r last columns form a basis of ker(A0 ). Hence, we set U(x) = R(x). Remark 5 In practice, U(x) can be obtained by performing gaussian elimination on the columns of A0 (x) taking as pivots the elements of minimum order (valuation) in x as already suggested in [Barkatou et al., 2006]. Hence, we can suppose without loss of generality that A0 (x) consists of r independent columnsand (n−r) zero columns. We partition A1 (x) conformally A11 A12 1 1 , and consider with A0 , i.e. A1 = 21 A1 A22 1   11 A0 A12 1 . (8) Gλ (A) = A21 A22 0 1 + λIn−r We illustrate our progress with the following simple example. Example 2 Given ǫ dY = A(x, ǫ)Y where dx   ǫ −x3 ǫ (1 + x)ǫ 0  x2 xǫ 0 −2xǫ . A = ǫ−2  −x 0 0 2ǫ  0 2 0 ǫ2 Clearly, A0 (x) is nilpotent of rank 2  0  x2 Gλ (A) =  −x 0 and  0 x+1 0 0 0 −2x . 0 λ 2  2 0 λ 10 (9) This consideration of Gλ (A) gives an ǫ-reduction criteria equivalent to θ(λ) as demonstrated in the following lemma. Lemma 2 Det(Gλ (A) ≡ 0 vanishes identically in λ if and only if θ(λ) does. Proof. Let D(ǫ) = diag(ǫIr , In−r ) then we can write ǫ−1 A = ND −1 where N := N(x, ǫ) ∈ K n×n has no poles in ǫ. Set D0 = D(0) and N0 = N(x, 0). Then we have det(Gλ (A) = det(N0 + λD0 ) = det(N + λD)|ǫ=0 A = (det( + λIn ) det(D))|ǫ=0 ǫ A0 + A1 + λIn ) ǫr )|ǫ=0 = θ(λ). = (det( ǫ Proposition 2 If mǫ (A) > 1 and det(Gλ (A)) ≡ 0 then there exists a unimodular matrix Q(x) in GLn (Ox ) with det Q(x) = ±1 such that the matrix Gλ (Q[A]) has the form  11  A0 U1 U2 W2  , Gλ (Q[A]) =  V1 W1 + λIn−r−ρ (10) M1 M2 W3 + λIρ where 0 ≤ ρ ≤ n − r, W1 , W3 are square matrices of order (n − r − ρ) and ρ respectively , and   11   A0 U1 U1 ), (11) ) = rank( A11 rank( 0 M1 M2   U1 ) < r. rank( A11 (12) 0 Our procedure is that of [Barkatou, 1995] except for the properties of M1 , M2 , and W3 . The nullity of M1 and M2 in the former is replaced by the weaker condition (11) here. Otherwise, the unimodularity of Q(x) cannot be guaranteed. Moreover, this refinement avoids unnecessary computations. The bridge between both descriptions is established in Remark 6 before proceeding to the proof of the Proposition. Remark 6 Suppose that Gλ (Q[A]) has the form (10) and there exists a transformation T (x) ∈ GLn (Kx ) such that Gλ (T [Q[A]]) has the form   11 A0 U1 U2 W2  , Gλ (T [Q[A]]) =  V1 W1 + λIn−r−ρ O O W̃3 + λIρ 11 where 0 ≤ ρ ≤ n − r, W1 , W̃3 are square matrices of order (n − r − ρ) and ρ respectively, and W̃3 is upper triangular with zero diagonal. Then,  11  A0 U1 ρ det Gλ (T [Q[A]]) = λ det . V1 W1 + λIn−r−ρ If det(Gλ (A) ≡ 0) then we have as well det(Gλ (Q[A]) = det(Gλ (T [Q[A]]) ≡ 0. Hence,  11  A0 U1 det = 0. (13) V1 W1 + λIn−r−ρ   11 A0 U1 (ρ) (ρ) . We shall denote by G0 the matrix G0 = V1 W1 Proof. (Proposition 2) Since det(Gλ (A)) ≡ 0 then in particular, det(Gλ=0 (A)) = 0. The matrix Gλ=0 (A) is thus singular. Let E (respectively F ) be the vector space spanned by the first r (resp. last n − r) rows of Gλ=0 (A). We have dim(E + F ) = rank(Gλ=0 (A)) < n. If dim(E) < r then set ρ = 0. Otherwise, since dim(E + F ) = dim(E) + dim(F ) − dim(E ∩ F ) < n, it follows that either dim(F ) < n − r or dim(E ∩ F ) > 0. In both cases, there exists at least a row vector W1 (x) = (w1 , . . . , wn ) with entries in C((x)) in the left null space of Gλ=0 (A), such that wi 6= 0 for some r + 1 ≤ i ≤ n. We can assume without loss of generality that W1 (x) has its entries in Ox . Indeed, this assumption can be guaranteed by a construction as in Lemma 1. Let V1 (x) be the nonzero row vector whose entries vi are such that vi = wi for r + 1 ≤ i ≤ n and zero elsewhere. It can be attained that vn = 1 upon replacing A by P [A] where P is a permutation matrix which exchanges the rows of A so that the pivot is taken to have the minimum order (valuation) in x. Let R1 (x) be the matrix whose nth row is formed by V1 (x), the other rows being those of the identity matrix In . Note that R1 (x) is a lower triangular matrix in GLn (Ox ) with det R1 = 1. Now put A(1) = R1−1 [A]. Thus, Gλ (A(1) ) has the form (10) with (11) and ρ = 1. (1) By (13), the matrix G0 (x) is singular so if the condition (12) does not occur then one can find, by same argument as above, a vector V2 (x) in Ox (1) whose (n − 1)th component is 1 such that V2 G0 = 0. If R2 (x) denotes the matrix whose n − 1th row is formed by (V2 (x), 0), the others being those of the identity matrix In , and A(2) = R2−1 [A(1) ] then the matrix Gλ (A(2) ) has the form (10) with (11) and ρ = 2. A finite number of applications of this process yields an equivalent matrix (ρ) A with (11) for which either (12) occurs or ρ = n−r. But in the latter case one has, again by Remark 6 and (13), that det A11 0 = 0, and so (12) occurs. The matrix Q(x) we are seeking is obtained as a product of permutation 12 matrices or lower triangular matrices whose determinant is 1, and so its determinant is ±1. We consider again Example 2. Example* 1 A simple calculation shows that det(Gλ (A)) ≡ 0 hence A is ǫ-reducible. From (9), for λ = 0, we have the singular matrix     1 0 0 0 0 0 x+1 0    x2 0 0 −2x  . Let Q = 0 1 0 0 , Gλ=0 (A) =    −x 0 0 0 0 1 0 2 0 0 1 0 0 2 0 0   ǫ −x3 ǫ 0 (1 + x)ǫ  x2 xǫ −2xǫ 0  . hence Q[A] = ǫ−2  2  0 2 ǫ 0  −x 0 2ǫ 0 Moreover, Gλ (Q[A]) 0 0  x2 0 Gλ (Q[A]) =   0 2 −x 0 has the form  (10) with ρ = 1 and r = 2. In fact, 0 (1 + x) 0 0  . λ 0  2 λ Proposition 3 If mǫ (A) > 1 and Gλ (A) has the form (10) with conditions (11) and (12) satisfied, then system (1) (resp. A) is ǫ-reducible and reduction can be carried out with the so-called shearing transformations S = diag(ǫIr , In−r−ρ, ǫIρ ) whenever ρ 6= 0 and S = diag(ǫIr , In−r ) otherwise. Proof. We partition A(x, ǫ) as follows   11 A A12 A13 A = A21 A22 A23  A31 A32 A33 where A11 , A22 , A33 are of dimensions r, n − r − ρ, and ρ respectively. It is easy to verify then that   11 −1 12 A ǫ A A13 A22 ǫA23  . Ã(x, ǫ) = S −1 AS − S −1 δS = S −1 AS = ǫA21 31 −1 32 A ǫ A A33 Hence, the new leading coefficient matrix is  11  A0 U1 O O O Ã0 =  O M1 M2 O and rank(Ã0 ) = rank(A11 0 U1 ) < r. 13 Example* 2 Let S = diag(ǫ, ǫ, 1, ǫ) then   ǫ −x3 ǫ 0 (1 + x)ǫ  x2 xǫ −2x 0  . S[Q[A]] = ǫ−2  2  0 2ǫ ǫ 0  −x 0 2 0 It is clear that the leading term has rank 1 < r. Now, we are ready to give the proof of Theorem 1. Proof. (Theorem 1) We first prove that the condition is necessary. In fact, suppose that such a T exists then we have det(λI + Aǫ ) = det(λI + Ãǫ ). It then suffices to see that A Ã ǫr det(λI + )|ǫ=0 = ǫr det(λI + )|ǫ=0 = ǫr−m P (x, ǫ)|ǫ=0 ǫ ǫ n×n where m ≤ r(Ã0 ) < r and P (x, ǫ) ∈ K has no poles in ǫ. Moreover, it is evident that θ(λ) = 0 since ∞ X A A0 r r ǫ det(λI + )|ǫ=0 = ǫ det(λI + + A1 + Ak ǫk−1 )|ǫ=0 . ǫ ǫ k=2 As for the sufficiency of the theorem, by Lemma 1, we can assume that A0 (x) is in the form (7). Then, Gλ (A) is constructed as in (8). Since θ(λ) = 0 and mǫ (A) > 1, it follows from Lemma 2 that det(Gλ (A)) = 0 and A is ǫ-reducible. Hence, the matrix S[Q[A]] where S, Q are as in Propositions 2 and 3 respectively, has the desired property. Remark 7 The ǫ-reducibility of A implies that the rank of the leading coefficient matrix can be reduced without necessarily reducing the ǫ-rank of the system. If the ǫ-reduction criteria holds for a sufficient number of equivalent systems then a repetitive application of such a transformation results in an equivalent system whose leading coefficient matrix has a null rank, hence h is reduced by one (e.g. Example 3). At this point, the discussion restarts from the nature of the eigenvalues of the leading constant matrix. = A(x, ǫ)Y where Example 3 Given ǫ dY dx   3 2xǫ 3x2 ǫ4 2xǫ2 (2x + 1)ǫ5   0 ǫ4 0 0 . A = ǫ−3    0 0 ǫ2 0 −2x 0 0 0 The gauge transformaiton Y = T Z computed by our algorithm results in an equivalent ǫ-irreducible system whose ǫ-rank is diminished by two as illustrated below:     1 0 0 0 0 ǫ3 0 0   0 0 ǫ 0 2xǫ 3x2 2x + 1 −1 2x .  and T [A] = ǫ T = 0 ǫ3 0 0 0 0 ǫ2 0  0 −2xǫ 0 0 0 0 0 1 14 Algorithm 1 Moser-based ǫ-Rank Reduction of System (1) Input: A(x, ǫ) of system (1) Output: T (x, ǫ) ∈ GLn (K) and an equivalent system given by T [A] which is ǫ-irreducible in the sense of Moser. T ← In ; h ← ǫ-rank of A; U(x) ← unimodular transformation computed in Lemma 1 and Remark 5 such that U −1 A0 U has form (7); T ← T U; A ← U −1 AU − ǫU −1 dU ; dx while Det(Gλ (A)) = 0 and h > 0 do Q(x), ρ ← Proposition 2 ; S(ǫ) ← Proposition 3; P ← QS; T ← TP; ; A ← P −1 AP − ǫP −1 dP dx h ← ǫ-rank of A; U(x) ← Lemma 1 and Remark 5; T ← T U; A ← U −1 AU − ǫU −1 dU ; dx end while. return (T, A). 15 4.3 Example of Comparison with Levelt’s Approach While Moser defined two rational numbers in [Moser, 1960], Levelt investigated the existence of stationary sequences of free lattices in [Levelt, 1991]. Since Moser-based and Levelt’s algorithms serve the same utility, i.e. rank reduction of system (2), it is natural to question their comparison. The cost analysis in the univariate case of the Moser-based algorithm described in [Barkatou, 1995] and that of Levelt’s [Levelt, 1991] was given in [page 108, [LeRoux, 2006]]. Both algorithms turn out to have an identical cost which suggests a further experimental study so that they can be well-compared. The latter was generalized in [Barkatou et al., 2006] to a certain class of Pfaffian systems over bivariate fields. Consequently, following arguments similar to those of [Barkatou et al., 2006] whenever the leading coefficient matrix is nilpotent and to Section 3 of this article whenever it’s not, Levelt’s algorithm seems adaptable to system (1) as well. Such an attempt would give rise to Algorithm 2. Algorithm 2 Generalization of Levelt’s Rank Reduction to System (1) Input: A(x, ǫ) of system (1); Output: T (x, ǫ) ∈ GLn (K) computed via Levelt’s approach and an equivalent system given by T [A] which is ǫ-irreducible in the sense of Moser. T ← In i ← 0; h ← ǫ-rank of A; while i < n − 1 and h > 0 do r ← rank(A0 ); U(x) ← unimodular transformation of Lemma 1 and Remark 5 such that U −1 A0 U has the form (7); S(x) ← diag(ǫIr , In−r ); P ← US; T ← TP; A ← P −1 AP − ǫP −1 ∂P ; ∂x h̃ ← ǫ-rank of A; if h̃ < h then i ← 0; else i ← i + 1; end if h ← h̃; end while. return (T, A). It is clear that Algorithm 2 coincides with Algorithm 1 for ρ = 0. For ρ > 0, which frequently occurs for matrices of dimension greater than 3, we ran simple examples of systems (1). Despite the identical cost of both algo16 rithms, these examples exhibited that Algorithm 2 complicates dramatically the coefficient matrices of the system under reduction. One factor in this complication stems from the weak termination criterion of this algorithm. However, even upon adjoining Moser’s termination criterion (given by θ(λ)) to this algorithm, as suggested in [Secion 5 of [Barkatou et al., 2006]], the result remains less satisfying than that of Algorithm 1. We exhibit here a selected example over O = C[[x, ǫ]]. Additional examples along with our implementation are available online at [Maddah, 2014]. = ǫ−h x−p A(x, ǫ)Y where Example 4 Let ǫ dY dx   0 0 0 ǫx(ǫx + 3) ǫ3 (x + 9) ǫx2  x 0 0 0 9ǫ2 x2 0    2 6  x −1 0 ǫx(ǫx + 1) 0 0  .  A= 3 2  x + x −x 0 ǫx 0 0    0 0 x −3ǫ 0 0  x3 − 1 5 0 0 0 0 It is easily verified that A is Moser-reducible in ǫ. Furthermore, we have mǫ (A) = h+ 36 and µǫ (A) = h+ 62 . Hence, it suffices to run only one reduction step, for which the rank of the leading coefficient matrix is dropped by one. We give in the following the transformation T (x, ǫ) and T [A] as computed by our Moser-based algorithm, the generalization of Levelt’s algorithm with Moser’s reducibility criterion, and Levelt’s algorithm respectively. For the latter, T and T [A] are to be found at [Maddah, 2014] due to the lack of space here. However we illustrate the dramatic growth of their coefficients by listing one entry of each.   ǫ 0 0 0 0 0 0 ǫ 0 0 0 0   0 0 ǫ 0 0 0  • T = 0 0 0 0 0 ǫ  and   0 0 0 1 0 0 0 0 0 0 ǫ 0   0 0 0 ǫ2 (x + 9) x2 ǫ ǫx(ǫx + 3)   x 0 0 9x2 ǫ 0 0   2 6  x −1 0 0 0 ǫx(ǫx + 1)   T [A] =  2  0 0 ǫx 0 0 −3ǫ   3   x −1 5 0 0 0 0 2 2 x(x + 1) −x 0 0 0 xǫ  3 ǫ 0 0 0 0 −9xǫ2  0 0 −1/3x2 ǫ2 ǫ2 0 0     0 0 0 0 ǫ 0  and • T = 2  0 ǫ −1/3ǫx 0 0 0   0 0 0 0 0 1  0 0 ǫ 0 0 0 17 T [A] = [ãij ] including entries having 2-digit coefficients and degree 8 in x, e.g.,  ã12 = −x(27ǫ2 − ǫx − 3)    1 2   ã13 = 3 x (−x + 27ǫ) ã41 = ǫx4 − ǫx + 3    ã52 = ǫ2 x(ǫx6 + 1)    ã = −(1/3)ǫ2 x8 53 • T = [tij ], T [A] = [ãij ] have entries with 4-digit and 10-digit coefficients. Degrees in x surpass 8, e.g.  2 2 5 3 2 11 10  t23 = 1458ǫ x (x + 3x + 2) /(243x + 1944x +3627x9 + 1026x8 + 1944x7 − 8820x6 + 432x5   −4860x4 − 72x3 − 652x2 − 72x − 324)  25 24 23  ã13 = (39366ǫx + 1220346ǫx + 14565420ǫx +    83731482ǫx22 − 1003833x23 + 236309724ǫx21      −25095825x22 + 708588ǫ2x19 + 299723976ǫx20      −237858120x21 + 17714700ǫ2x18 + 191306610ǫx19      −1080181170x20 + 143134776ǫ2x17 + 140023890ǫx18     −2462664465x19 + 462261816ǫ2x16 − 236799612ǫx17      −3116776563x18 + 553879620ǫ2x15 + 98626896ǫx16      −4040830962x17 + 384763284ǫ2x14 − 334491552ǫx15      −5062097592x16 + 750333456ǫ2x13 + 149450184ǫx14      −3027609900x15 + 681679152ǫ2x12 − 469371996ǫx13    14 2 11 12   −4012634700x + 460735776ǫ x − 88155972ǫx −1297170936x13 + 804260016ǫ2x10 − 332366796ǫx11    −786840174x12 + 245153952ǫ2x9 − 90553302ǫx10      −404146368x11 + 383522040ǫ2x8 − 73322280ǫx9      +451532556x10 + 111422304ǫ2x7 − 9084492ǫx8      −104014116x9 + 74305512ǫ2x6 − 14703120ǫx7      +222024672x8 + 17635968ǫ2x5 − 7039224ǫx6     −17230320x7 − 23184ǫ2 x4 − 8030664ǫx5 + 88635312x6      −414720ǫ2 x3 − 3070548ǫx4 − 294176x5      −1819584ǫ2 x2 + 32403312x4 + 419904ǫ2x + 1692576x3      +944784ǫ2 + 3895776x2 + 524880x + 944784)/(243x11      +1944x10 + 3627x9 + 1026x8 + 1944x7 − 8820x6    +432x5 − 4860x4 − 72x3 − 652x2 − 72x − 324)2 ; 18 5 Conclusion and Further Investigations We proposed a Moser-based algorithm which recovers a singularly-perturbed linear differential system from its turning points and reduces its ǫ-rank to its minimal integer value. A complementary step to attain the full formal reduction would be to find the ramification in the parameter which renders the general case to the case discussed here in a recursive process. One approach is that based on analysis by a Newton polygon and applied to system (2) in [Barkatou, 1997] and the scalar case of system (1) in [Macutan, 1999]. The sufficient number of coefficient matrices in computations is still to be investigated. In the usual treatment of turning points, a restraining index χ is defined and updated at every reduction step to observe the growth of the order of poles in the Ak (x)’s (see, e.g. [Wasow, 1985, 1979] and references therein). This restraining index plays a role in the asymptotic interpretation of the formal solutions. As demonstrated in Section 3, the transformations we apply to recover from turning points are polynomial (shearings). Hence, the growth of the poles order is bounded and can be expected apriori. The insight this gives into the restraining index is to be investigated. Examples comparing this algorithm with a generalization of Levelt’s favors the former. However, it suggests that Levelt’s algorithm be generalized to system (1) and that a bit complexity study comparing both algorithms be held alongside. Furthermore, it motivates generalization of the Moserbased algorithms over differential bivariate fields, e.g. Pfaffian systems in two variables [Barkatou et al., 2014]. An additional field of investigation is the two-parameter algebraic eigenvalue problem as a generalization of the one parameter case investigated via Moser-based approach in [Jeannerod et al., 1999]. In fact, the main role in the reduction process is reserved to the similarity term of T [A]. Hence, the discussion of such problems is not expected to deviate from the discussion presented here in the differential case. References M. Barkatou, S.S. Maddah, and H. Abbas. Formal Reduction of a class of Pfaffian Systems in Two Variables. Submitted to ISSAC’14. A preliminary version is available at arXiv. W. Balser. Formal Power Series and Linear Systems of Meromorphic Ordinary Differential Equations. Springer-Verlag, New York, 2000. M. Barkatou. An algorithm to compute the exponential part of a formal fundamental matrix solution of a linear differential system. Journal of App. Alg. in Eng. Comm. and Comp., 8(1):1-23, 1997. 19 M. Barkatou. A Rational Version of Moser’s Algorithm. In Proceedings of the International Symposium on Symbolic and Algebraic Computation, pages 297-302. ACM Press, July 1995. M. Barkatou. On the reduction of Linear Systems of Difference Equations. In Proceedings of the International Symposium on Symbolic and Algebraic Computation, pages 1-6. ACM Press, USA, 1989. M. Barkatou, G. Broughton, and E. Pflugel. Regular Systems of Linear Functional Equations and Applications. In Proceedings of the International Symposium on Symbolic and Algebraic Computation, pages15-22. ACM Press, 2008. M. Barkatou and E. Pflugel. ISOLDE, Integration of Systems of Ordinary Linear Differential Equations. Available at: http://isolde.sourceforge.net/ M. Barkatou and E. Pflugel. On the Moser-and super-reduction algorithms of systems of linear differential equations and their complexity. Journal of Sym. Comput., 44 (8), 1017-1036, 2009. M. Barkatou and N. LeRoux. Rank Reduction of a class of Pfaffian Systems in Two Variables. In Proceedings of the International Symposium on Symbolic and Algebraic Computation, pages 204-211. ACM Press, 2006. G. Chen. Solutions Formelles de Systèmes d’Equations Différentièlles Linèaires Ordinaires Homogènes. PhD Thesis. Université Joseph Fourier. Grenoble 1. 1984. P.F. Hsieh and Y. Sibuya. Basic theory of Ordinary Differential Equations. Springer. NewYork, USA, 1999. M. Iwano and Y. Sibuya. Reduction of the Order of a Linear Ordinary Differential Equation Containing a Small Parameter. 1963 C.P. Jeannerod and E. Pflugel. A Reduction Algorithm for Matrices Depending on a Parameter. In Proceedings of the International Symposum on Symbolic and Algebraic Computation, Pages 121-128. ACM Press, USA 1999. T. Kato. Perturbation Theory for Linear Operators. Springer. Berlin. 1980. N. LeRoux. Solutions formelles d’équations aux dérivées partielles. Ph.D. Thesis. University of Limoges. 2006. A.H.M. Levelt. Stabilizing Differential Operators: a method for Computing Invariants at Irregular Singularities. Differential Equations and Computer Algebra, M. Singer (ed.), pages 181-228, 1991. C. C. Lin, The theory of hydrodynamic stability. Cambridge Univ. Press. Cambridge, 1966. 20 Y.O. Macutan. Formal Solutions of Scalar Singularly-Perturbed Linear Differential Equations. In Proceedings of the International Symposum on Symbolic and Algebraic Computation, Pages 113-120. ACM Press, USA 1999. Maddah S.S. http : //www.unilim.f r/pages perso/suzy.maddah/ J.A.M. McHugh. An historical Survey of Ordinary Linear Differential Equations with a Large Parameter and Turning Points. Archive for History of Exact Sciences, 7(4): pp 277-324,1971. J. Moser. The Order of a Singularity in Fuchs’ Theory. Mathematische Zeitschrift, 72:379- 398, 1960. E. Pflugel. Effective Formal Reduction of Linear Differential Systems. Journal of App. Alg. in Eng. Comm. and Comp., 10, 153-187, 2000. H. L. Turrittin. Asymptotic Expansions of Solutions of Systems of Ordinary Differential Equations. Contributions to the Theory of Nonlinear Oscillations II. Ann. of Math. Studies. No 29: 81-116. 1952. W. Wasow. Linear Turning Point Theory. Springer-Verlag. 1985. W. Wasow. Topics in the Theory of Linear Ordinary Differential Equations Having Singularities with respect to a Parameter. Institut de Recherche Mathématique Avancée. Université Louis Pasteur. Strasbourg. 1979. 21
0math.AC
A Note on Topology Preservation in Classification, and the Construction of a Universal Neuron Grid arXiv:1308.1603v4 [cs.NE] 1 Feb 2018 Dietmar Volz [email protected] February 2, 2018 Abstract It will be shown that according to theorems of K. Menger, every neuron grid if identified with a curve is able to preserve the adopted qualitative structure of a data space. Furthermore, if this identification is made, the neuron grid structure can always be mapped to a subset of a universal neuron grid which is constructable in three space dimensions. Conclusions will be drawn for established neuron grid types as well as neural fields. 1 Mathematical Preliminaries Topology is one of the basic branches of mathematics. It is sometimes also referred to as qualitative geometry, in a way that it deals with the qualitative properties and structure of geometrical objects. The geometrical objects of interest in this paper are vector spaces, manifolds, and curves. These form the basis of the presented mathematical treatment of clustering with neuron grids. Consequently, the paper has to begin with some mathematical preliminaries. 1.1 Manifolds In the following, a n-dimensional vector space will be identified with a subspace of IRn . It is assumed that IRn is equipped with a topology which in turn is induced by a metric. Mappings between subspaces of IRn are called homeomorphic or topology preserving if they are one-to-one and continuous in both directions. It is known from the theorem of dimension invariance (Brouwer, 1911) that mappings between non-empty open sets U ⊂ IRm and V ⊂ IRn for m 6= n are never homeomorphic. In the light of Brouwer’s theorem it is the open sets that fix the topological dimension of a subset of IRn . As the IRn is introduced as a metric space, the open sets are given by open balls that formalize the concept of distance between points of this metric space. Homeomorphic mappings preserve the neighborhood relationship between points of IRn . Amongst the huge variety of subsets of the metric space IRn , the n-dimensional manifolds (or n-manifolds) have turned out to be of interest as these describe solution spaces of equations or geometrical entities. Manifolds are parameterized geometrical objects, parameters could describe e.g. the coordinates of a physical space. As n-manifolds are locally Euclidean of dimension n they are subject to Brouwer’s theorem and therefore of fixed topological 1 dimension. As a consequence, dimension reducing mappings between manifolds will not be able to transfer mutual topological structures. A vivid example of the dimension conflict of two manifolds of different dimension is given by a surjective and continuous mapping of [0, 1] onto [0, 1] × [0, 1] which is also called a ’Peano curve’ (Peano, 1890). The convoluted structure of a Peano curve does not reflect the neighborhood relationship of elements of the underlying manifold ⊂ IR2 , not even locally: There is no topology preserving mapping of [0, 1] onto [0, 1] × [0, 1]. An illustration of a Peano curve to 4th iteration is given in figure 1. Figure 1: A Peano curve (source: Wikipedia) 1.2 Curves The Peano curve introduced in the preceding section is based on the conventional definition of a compact curve as a continuous mapping of [0, 1]. The following definition according to (Menger, 1968) renders the definition of a compact curve more precisely. Beforehand, a definition of a continuum is required. Definition A compact, connected set ⊂ IRn having more than one element is a continuum. A set ⊂ IRn which contains no continuum is called discontinuous. Definition A continuum K as a subset of a metric space is called a curve if every point of K is contained in arbitrary small neighborhoods having discontinuous intersects with K. From Menger’s definition of a curve the following theorem results: Theorem[Menger] Every curve defined in a metric space is homeomorphic to a curve defined in IR3 . The proof of this theorem is left here. The interested reader is referred to Menger’s textbook (Menger, 1968). The theorem states that with regard to topological aspects, the transition from curves defined in three-dimensional Euclidean space to curves de- 2 fined in an arbitrary metric space doesn’t give any generalization. Menger’s definition of a curve even leads to another theorem (Menger, 1968). Theorem[Menger] Every compact curve in a metric space can be mapped to a subset of a so-called universal curve ⊂ IR3 . The universal curve K is constructable and up to homeomorphism uniquely defined. The construction starts with a cube [0, 1]3 ⊂ IR3 . K is the set of all points of [0, 1]3 such that at least two of the three coordinates have triadic expansions that do not contain a 1. The hereby constructed set fulfills the definition of a curve (Menger, 1968) and leads to a self-similar structure. The construction is shown in figure 2. Figure 2: Menger’s universal curve in perspective view Summarizing, the topological relationships that arise from Brouwer’s and Menger’s theorems are as follows: ∼ 6 = ∼ 6 = X ⊂ IRn −−−−→ −−−−→ Z ⊂ IR3 , if C ⊂ IRn −−−−−−−−−−−−−−−−−−−−−→ C ⊂ IR3 , ∀n Y ⊂ IRm ∼ = m 6= n and m 6= 3 hereby X, Y, Z are (n,m,3)-manifolds, C a curve, ∼ = identifies a homeomorphic mapping. Subsets of the universal curve as introduced in this section usually are no manifolds. The only exception are the trivial cases of subsets that are homeomorphic to an interval or S1 . 3 2 Application to Neuron Grids 2.1 Vector Quantization The method of Vector Quantization (VQ) (Linde et al., 1980) classifies elements of a vector space V ⊂ IRn by approximating the probability density function p(v) of elements v of V . Hereby, the elements of V are mapped iteratively to a set of weight vectors U such that respective a suitable metric the quantization error functional gets minimal. An extension of the VQ method introduces a topology on the set of weight vectors such that U constitutes a topological space which is then called a neuron grid. By means of the topology of the neuron grid, elements of U are mutually adjacent if they are adjacent on the neuron grid. Using algorithms of machine learning, for example Kohonen’s feature maps (Kohonen, 1990) and several variants thereof (Fritzke, 1992; Oja et al., 1999) try to transfer the topology of the vector space V to the topology of the neuron grid U. Hereby, the topology of the neuron grid U as adapted to the vector space topology V is representative of the topology of V . The following section will provide some insight to the restrictions of topology preservation in clustering of a vector space with VQ methods. 2.2 Identification of a Neuron Grid with a Curve Assuming Menger’s curve definition, the following identification is made: Definition A neuron grid is a curve It is required that neurons of a neuron grid constitute a discrete point set of a curve. Subsets of a neuron grid which contain no neurons are called links between neurons. Consequently, the topology of the defined neuron grid corresponds to a curve topology. The identification of a neuron grid with a curve as motivated in this section is coherent and straightforward for neuron grids whose topologies are identifiable with a subset of Menger’s universal curve. This is the case for neuron grids of the Kohonen type (Kohonen, 1990) as well as some variants thereof e.g. (Fritzke, 1992; Oja et al., 1999) that constitute topological spaces of a discrete point set together with a set of links between the point set. The presented identification with a curve produces the following results: i All neuron grid topologies are uniquely definable in IR3 . There’s no need to introduce ’hypercubes’ or ’high-dimensional’ grid topologies. ii Given the neuron grid topology is adapted to a vector space topology ⊂ IRn , then the neuron grid topology will generally be retained in IR3 . Clustering results are always visualizable in IR3 . iii Up to homeomorphism it exists a uniquely defined universal neuron grid such that every connected neuron grid is a subset of the universal neuron grid. These results were inferred directly from Menger’s curve theorems. It should be mentioned though that Brouwer’s theorem precludes a direct topology preserving mapping between the vector space topology V which is induced by the metric of IRn and U ⊂ IRm if m 6= n. The conflict of dimension as illustrated in the example of section 1.1 is hereby reproduced, this time as the lack of homeomorphic mappings between open balls of metric spaces. In consequence, metrical properties of IRn generally won’t be reproduced on the clustering result. 4 It should also be mentioned that similar results are not possible for a neuron grid if it is defined by a two- or higher-dimensional manifold. The well-known ’Klein bottle’ (Klein, 1923) provides a vivid example what might happen to a two-dimensional surface that is defined in IRn , n > 3, and shows an apparent self-intersection if mapped to IR3 . The self-intersection generates a subset of points on the Klein bottle that are separate in IRn , n > 3 and get identified through the mapping to IR3 . Hereby, two separate clusters are spuriously merged into one. Discussion The presented theorems of Brouwer and Menger illustrate an alternative though simple and straightforward approach to the topological foundation of neuron grids. The identification of a neuron grid with a subset of the universal curve at a first or second glance may be seen as trivial. This is in particular due to the presented definition of a curve which is intuitive and comprehensible, also from a naive standpoint. The presented topological framework of neuron grids restricts neuron sets to discrete point sets. Alternative approaches (Amari, 1977; Bressloff, 2005; Cottet, 1995) introduce continuous models of neural fields. As neural fields per definition provide open sets in their domain, the present paper also incloses the caveat that neural fields might produce unusable results if applied to clustering tasks. Acknowledgements I would like to thank Catalin Dartu for the nice visualization of Menger’s universal curve. References Amari, S. (1977). Dynamics of pattern formation in lateral-inhibition type neural fields. Biol Cybern, 27, 77 – 87. Bressloff, P. C. (2005). Spontaneous symmetry breaking in self-organizing neural fields. Biol Cybern, 93(4), 256 – 274. Brouwer, L. E. J. (1911). Beweis der Invarianz der Dimensionszahl. Math. Ann., 70, 161 – 165 Cottet, G. (1995). Neural networks: Continuous approach and applications to image processing. Journal of Biological Systems, 3, 1131 – 1139. Fritzke, B. (1992). Growing Cell Structures - A Self-Organizing Network in k Dimensions. Artificial Neural Networks. North-Holland. Amsterdam, Vol. II, 1051 – 1056. Klein, F. (1923). Gesammelte Mathematische Abhandlungen. Springer. Berlin, Bd.III, 571 5 Kohonen, T. (1990). The self-organizing map. Proceedings of the IEEE, 78(9), 1464 – 1480. Linde, Y., Buzo, A., & Gray, R. M. (1980). An algorithm for vector quantizer design. IEEE Trans. Comm., 28, 84 – 95. Menger, K. (1968). Kurventheorie. Chelsea Pub Co, 347 – 360. Oja, E., Laaksonen, J., & Koskela, M. (1999). Application of Tree Structured SelfOrganizing Maps in Content-Based Image Retrieval. Proc. of the 9th Int. Conf. on ANN (ICANN’99), Vol. 1, 174 – 179. Peano, G. (1890). Sur une courbe, qui remplit toute une aire plane. Math. Ann., 36, 157 – 160. 6
2cs.AI
DeepLung: 3D Deep Convolutional Nets for Automated Pulmonary Nodule Detection and Classification Wentao Zhu, Chaochun Liu, Wei Fan, Xiaohui Xie arXiv:1709.05538v1 [cs.CV] 16 Sep 2017 University of California, Irvine and Baidu Research {wentaoz1,xhx}@ics.uci.edu and {liuchaochun,fanwei03}@baidu.com Abstract In this work, we present a fully automated lung CT cancer diagnosis system, DeepLung. DeepLung contains two parts, nodule detection and classification. Considering the 3D nature of lung CT data, two 3D networks are designed for the nodule detection and classification respectively. Specifically, a 3D Faster R-CNN is designed for nodule detection with a U-net-like encoder-decoder structure to effectively learn nodule features. For nodule classification, gradient boosting machine (GBM) with 3D dual path network (DPN) features is proposed. The nodule classification subnetwork is validated on a public dataset from LIDC-IDRI, on which it achieves better performance than state-of-the-art approaches, and surpasses the average performance of four experienced doctors. For the DeepLung system, candidate nodules are detected first by the nodule detection subnetwork, and nodule diagnosis is conducted by the classification subnetwork. Extensive experimental results demonstrate the DeepLung is comparable to the experienced doctors both for the nodule-level and patient-level diagnosis on the LIDC-IDRI dataset. Introduction Lung cancer is the most common cause of cancer-related death in men. Low-dose lung CT screening provides an effective way for early diagnosis, which can sharply reduce the lung cancer mortality rate. Advanced computer-aided diagnosis systems (CADs) are expected to have high sensitivities while at the same time maintaining low false positive rates. Recent advances in deep learning enable us to rethink the ways of clinician lung cancer diagnosis. Current lung CT analysis research mainly includes nodule detection (Dou et al. 2017; Ding et al. 2017), and nodule classification (Shen et al. 2015; 2016; Hussein et al. 2017; Yan et al. 2016). There is few work on building a complete lung CT cancer diagnosis system for fully automated lung CT cancer diagnosis, integrating both nodule detection and nodule classification. It is worth exploring a whole lung CT cancer diagnosis system and understanding how far the performance of current technology differs from that of experienced doctors. To our best knowledge, this is the first work for a fully automated and complete lung CT cancer diagnosis system. Copyright c 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. The emergence of large-scale dataset, LUNA16 (Setio et al. 2017), accelerates the nodule detection related research. Typically, nodule detection consists of two stages, region proposal generation and false positive reduction. Traditional approaches generally require manually designed features such as morphological features, voxel clustering and pixel thresholding (Murphy et al. 2009; Jacobs et al. 2014). Recently, deep convolutional networks, such as Faster R-CNN (Ren et al. 2015) and fully convolutional networks (Long, Shelhamer, and Darrell 2015), are employed to generate candidate bounding boxes (Ding et al. 2017; Dou et al. 2017). In the second stage, more advanced methods or complex features, such as more carefully designed texture features, are designed to remove false positive nodules. Due to the 3D nature of CT data and the effectiveness of Faster R-CNN for object detection in 2D natural images (Huang et al. 2016b), we design a 3D Faster R-CNN for nodule detection with Unet-like encoder-decoder structure to effectively learn latent features (Ronneberger, Fischer, and Brox 2015). Before the era of deep learning, feature engineering followed by classifiers is a general pipeline for nodule classification (Han et al. 2013). After the public large-scale dataset, LIDC-IDRI (Armato et al. 2011), becomes available, deep learning based methods have become dominant for nodule classification research (Shen et al. 2016). Multi-scale deep convolutional network with shared weights on different scales has been proposed for the nodule classification (Shen et al. 2015). The weight sharing scheme reduces the number of parameters and forces the multi-scale deep convolutional network to learn scale-invariant features. Inspired by the recent success of dual path network (DPN) on ImageNet (Chen et al. 2017; Deng et al. 2009), we propose a novel framework for CT nodule classification. First, we design a 3D deep dual path network to extract features. Then we use gradient boosting machines (GBM) with deep 3D dual path features, nodule size and cropped raw nodule CT pixels for the nodule classification (Friedman 2001). At last, we build a fully automated lung CT cancer diagnosis system, DeepLung, by combining the nodule detection network and nodule classification network together, as illustrated in Fig. 1. For a CT image, we first use the detection subnetwork to detect candidate nodules. Next, we employ the classification subnetwork to classify the detected nodules into either malignant or benign. Finally, the patient-level di- Figure 1: The framework of DeepLung. DeepLung first employs 3D Faster R-CNN to generate candidate nodules. Then it uses 3D deep dual path network (DPN) to extract deep features from the detected and cropped nodules. Lastly, gradient boosting machine (GBM) with deep features, detected nodule size, and raw nodule pixels are employed for classification. Patient-level diagnosis can be achieved by fusing the classification results of detected nodules in the CT. agnosis result can be achieved for the whole CT by fusing the diagnosis result of each nodule. Our main contributions are as follows: 1) To our best knowledge, DeepLung is the first work for a complete automated lung CT cancer diagnosis system. 2) Two 3D deep convolutional networks are designed for nodule detection and classification. Specifically, inspired by the effective of Faster R-CNN for object detection and deep dual path network’s success on ImageNet (Huang et al. 2016b; Chen et al. 2017), we propose 3D Faster R-CNN for nodule detection, and 3D deep dual path network for nodule classification. 3) Our classification framework achieves superior performance compared with state-of-the-art approaches, and the performance surpasses the average performance of experienced doctors on the largest public dataset, LIDC-IDRI dataset. 4) The DeepLung system is comparable to the average performance of experienced doctors both on nodulelevel and patient-level diagnosis. Related Work Traditional nodule detection requires manually designed features or descriptors (Lopez Torres et al. 2015). Recently, several works have been proposed to use deep convolutional networks for nodule detection to automatically learn features, which is proven to be much more effective than hand-crafted features. Setio et al. proposes multi-view convolutional network for false positive nodule reduction (Setio et al. 2016). Due to the 3D nature of CT scans, some work propose 3D convolutional networks to handle the challenge. The 3D fully convolutional network (FCN) is proposed to generate region candidates, and deep convolution network with weighted sampling is used in the false positive candidates reduction stage (Dou et al. 2017). Ding et al. uses the Faster R-CNN to generate candidate nodules, followed by 3D convolutional networks to remove false positive nodules (Ding et al. 2017). Due to the effective performance of Faster R-CNN (Huang et al. 2016b; Ren et al. 2015), we design a novel network, 3D Faster RCNN, for the nodule detection. Further, U-net-like encoderdecoder scheme is employed for 3D Faster R-CNN to effectively learn the features (Ronneberger, Fischer, and Brox 2015). Nodule classification has traditionally been based on segmentation (El-Baz et al. 2011; Zhu and Xie 2016) and manual feature design (Aerts et al. 2014). Several works designed 3D contour feature, shape feature and texture feature for CT nodule diagnosis (Way et al. 2006; El-Baz et al. 2011; Han et al. 2013). Recently, deep networks have been shown to be effective for medical images. Artificial neural network was implemented for CT nodule diagnosis (Suzuki et al. 2005). More computationally effective network, multi-scale convolutional neural network with shared weights for different scales to learn scale-invariant features, is proposed for nodule classification (Shen et al. 2015). Deep transfer learning and multi-instance learning is used for patientlevel lung CT diagnosis (Shen et al. 2016). A comparison on 2D and 3D convolutional networks is conducted and shown that 3D convolutional network is superior than 2D convolutional network for 3D CT data (Yan et al. 2016). Further, a multi-task learning and transfer learning framework is proposed for nodule diagnosis (Hussein et al. 2017; Zhu et al. 2017). Different from their approaches, we propose a novel classification framework for CT nodule diagnosis. Inspired by the recent success of deep dual path network (DPN) on ImageNet (Chen et al. 2017), we design a novel totally 3D deep dual path network to extract features from raw CT nodules. Then, we employ gradient boosting machine (GBM) with the deep DPN features, nodule size, and raw nodule CT pixels for the nodule diagnosis. Patientlevel diagnosis can be achieved by fusing the nodule-level diagnosis. DeepLung Framework The fully automated lung CT cancer diagnosis system, DeepLung, consists of two parts, nodule detection and nodule classification. We design a 3D Faster R-CNN for nodule detection, and propose gradient boosting machine with deep 3D dual path network features, raw nodule CT pixels and nodule size for nodule classification. Figure 2: The 3D Faster R-CNN framework contains residual blocks and U-net-like encoder-decoder structure. The model employs 3 anchors and multitask learning loss, including coordinates (x, y, z) and diameter d regression, and candidate box classification. The numbers in boxes are feature map sizes in the format (#slices*#rows*#cols*#maps). The numbers above the connections are in the format (#filters #slices*#rows*#cols). 3D Faster R-CNN for Nodule Detection The 3D Faster R-CNN with U-net-like encoder-decoder structure is illustrated in Fig. 2. Due to the GPU memory limitation, the input of 3D Faster R-CNN is cropped from 3D reconstructed CT images with pixel size 96×96×96. The encoder network is derived from ResNet-18 (He et al. 2016). Before the first max-pooling, two convolutional layers are used to generate features. After that, four residual blocks are employed in the encoder subnetwork. We integrate the Unet-like encoder-decoder design concept in the detection to learn the deep networks efficiently (Ronneberger, Fischer, and Brox 2015). In fact, for the region proposal generation, the 3D Faster R-CNN conducts pixel-wise multi-scale learning and the U-net is validated as an effective way for pixelwise labeling. This integration makes candidate nodule generation more effective. In the decoder network, the feature maps are processed by deconvolution layers and residual blocks, and are subsequently concatenated with the corresponding layers in the encoder network (Zeiler et al. 2010). Then a convolutional layer with dropout (dropout probability 0.5) is used for the second last layer. In the last layer, we design 3 anchors, 5, 10, 20, for scale references which are designed based on the distribution of nodule sizes. For each anchor, there are 5 parts in the loss function, classification loss Lcls for whether the current box is a nodule or not, regression loss Lreg for nodule coordinates x, y, z and nodule size d. If an anchor overlaps a ground truth bounding box with the intersection over union (IoU) higher than 0.5, we consider it as a positive anchor (p? = 1). On the other hand, if an anchor has IoU with all ground truth boxes less than 0.02, we consider it as a negative anchor (p? = 0). The multi-task loss function for the anchor i is defined as L(pi , ti ) = λLcls (pi , p?i ) + p?i Lreg (ti , ti ? ), (1) where pi is the predicted probability for current anchor i being a nodule, ti is the regression predicted relative coordinates for nodule position, which is defined as ti = ( x − xa y − ya z − za d , , , log( )), da da da da (2) where (x, y, z, d) are the predicted nodule coordinates and diameter in the original space, (xa , ya , za , da ) are the coordinates and scale for the anchor i. For ground truth nodule position, it is defined as x? − xa y ? − ya z ? − za d? t?i = ( , , , log( )), (3) da da da da where (x? , y ? , z ? , d? ) are nodule ground truth coordinates and diameter. The λ is set as 0.5. For Lcls , we used binary cross entropy loss function. For Lreg , we used smooth l1 regression loss function (Girshick 2015). Gradient Boosting Machine with 3D Dual Path Net Feature for Nodule Classification Inspired by the success of dual path network on the ImageNet (Chen et al. 2017; Deng et al. 2009), we design a 3D deep dual path network framework for lung CT nodule classification in Fig. 4. Dual path connection benefits both from the advantage of residual learning and that of dense connection (He et al. 2016; Huang et al. 2016a). The shortcut connection in residual learning is an effective way to eliminate gradient vanishing phenomenon in very deep networks. From a learned feature weights sharing perspective, residual learning enables feature reuse, while dense connection has an advantage of keeping exploiting new features (Chen et al. 2017). And densely connected network has fewer parameters than residual learning because there is no need to relearn redundant feature maps. The assumption of dual path connection is that there might exist some redundancy in the exploited features. And dual path connection uses part of feature maps for dense connection and part of them for residual learning. In implementation, the dual path connection splits its feature maps into two parts. One part, F(x)[d :], is used for residual learning, the other part, F(x)[: d], is used for dense connection as shown in Fig. 3. Here d is the hyper-parameter for deciding how many new features to be exploited. The dual path connection can be formulated as y = G([F(x)[: d], F(x)[d :] + x]), (4) where y is the feature map for dual path connection, G is used as ReLU activation function, F is convolutional layer functions, and x is the input of dual path connection block. Dual path connection integrates the advantages of the two advanced frameworks, residual learning for feature reuse and dense connection for keeping exploiting new features, into a unified structure, which obtains success on the ImageNet dataset. For CT data, advanced method should be effective to extract 3D volume feature (Yan et al. 2016). We design a 3D deep dual path network for the 3D CT lung nodule classification in Fig. 4. We firstly crop CT data centered at predicted nodule locations with size 32 × 32 × 32. After that, a convolutional layer is used to extract features. Then 4 dual path blocks are employed to learn higher level features. Lastly, the 3D average pooling and binary logistic regression layer are used for benign or malignant diagnosis. The 3D deep dual path network can be used as a classifier for nodule diagnosis directly. And it can also be employed to learn effective features. We construct feature by Figure 3: Illustration of dual path connection (Chen et al. 2017), which benefits both from the advantage of residual learning (He et al. 2016) and that of dense connection (Huang et al. 2016a) from network structure design intrinsically. Figure 4: The 3D deep dual path network framework in the nodule classification subnetwork, which contains 4 dual path connection blocks. After the training, the deep 3D dual path network feature is extracted for gradient boosting machine to do nodule diagnosis. The numbers in the figure are of the same formats as Fig. 2. concatenating the learned 3D deep dual path network features (the second last layer, 2,560 dimension), nodule size, and raw 3D cropped nodule pixels. Given complete and effective features, gradient boosting machine (GBM) is a superior method to build an advanced classifier from these features (Friedman 2001). We validate the feature combining nodule size with raw 3D cropped nodule pixels, employ GBM as a classifier, and obtain 86.12% test accuracy averagely. Lastly, we employ GBM with the constructed feature and achieve the best diagnosis performance. DeepLung System: Fully Automated Lung CT Cancer Diagnosis The DeepLung system includes the nodule detection using the 3D Faster R-CNN, and nodule classification using gradient boosting machine (GBM) with constructed feature (deep dual path features, nodule size and raw nodule CT pixels) in Fig. 1. Due to the GPU memory limitation, we first split the whole CT into several 96 × 96 × 96 patches, process them through the detector, and combine the detected results together. We only keep the detected boxes of detection probabilities larger than 0.12 (threshold as -2 before sigmoid function). After that, non-maximum suppression (NMS) is adopted based on detection probability with the intersection over union (IoU) threshold as 0.1. Here we expect to not miss too many ground truth nodules. After we get the detected nodules, we crop the nodule with the center as the detected center and size as 32×32×32. The detected nodule size is kept for the classification model as a part of features. The 3D deep dual path network is employed to extract features. We use the GBM and construct features to conduct diagnosis for the detected nodules. For CT pixel feature, we use the cropped size as 16 × 16 × 16 and center as the detected nodule center in the experiments. For patient-level diagnosis, if one of the detected nodules is positive (cancer), the patient is a cancer patient, and if all the detected nodules are negative, the patient is a negative (non-cancer) patient. Experiments We conduct extensive experiments to validate the DeepLung system. We perform 10-fold cross validation using the detector on LUNA16 dataset. For nodule classification, we use the LIDC-IDRI annotation, and employ the LUNA16’s patientlevel dataset split. Finally, we also validate the whole system based on the detected nodules both on patient-level diagnosis and nodule-level diagnosis. In the training, for each model, we use 150 epochs in total with stochastic gradient descent optimization and momentum as 0.9. The used batch size is relied on the GPU memory. We use weight decay as 1 × 10−4 . The initial learning rate is 0.01, 0.001 at the half of training, and 0.0001 after the epoch 120. Datasets LUNA16 dataset is a subset of the largest public dataset for pulmonary nodules, the LIDC-IDRI dataset (Armato et al. 2011). LUNA16 dataset only has the detection annotations, while LIDC-IDRI contains almost all the related information for low-dose lung CTs including several doctors’ annotations on nodule sizes, locations, diagnosis results, nodule texture, nodule margin and other informations. LUNA16 dataset removes CTs with slice thickness greater than 3mm, slice spacing inconsistent or missing slices from LIDC-IDRI dataset, and explicitly gives the patient-level 10-fold cross validation split of the dataset. LUNA16 dataset contains 888 low-dose lung CTs, and LIDC-IDRI contains 1,018 lowdose lung CTs. Note that LUNA16 dataset removes the annotated nodules of size smaller than 3mm. For nodule classification, we extract nodule annotations from LIDC-IDRI dataset, find the mapping of different doctors’ nodule annotations with the LUNA16’s nodule annotations, and get the ground truth of nodule diagnosis by taking different doctors’ diagnosis averagely (Do not count the 0 score for diagnosis, which means N/A.). If the final average score is equal to 3 (uncertain about malignant or benign), we remove the nodule. For the nodules with score greater than 3, we label them as positive. Otherwise, we label them as negative. For doctors’ annotations, we only keep those of four doctors who label most of the nodules for comparison. We only keep the CTs within LUNA16 dataset, and use the same cross validation split as LUNA16 for classification. Preprocessing We firstly clip the raw data into [−1200, 600]. Secondly, we transform the range linearly into [0, 1]. Thirdly, we use the Table 1: Nodule classification comparisons on LIDC-IDRI dataset. Nodule Size All feat. 3D DPN m-CNN Models +Pixel+GBM +GBM Acc. (%) 88.74 86.12 90.44 86.84 Table 2: Nodule-level diagnosis accuracy (%) between nodule classification subnetwork in DeepLung and experienced doctors on doctor’s individually confident nodules. Dr 1 Dr 2 Dr 3 Dr 4 Average Doctors 93.44 93.69 91.82 86.03 91.25 DeepLung 93.55 93.30 93.19 90.89 92.74 Figure 5: Sensitivity (Recall) rate with respect to false positives per scan. The FROC (average recall rate at the false positives as 0.125, 0.25, 0.5, 1, 2, 4, 8) is 83.4%. The 3D Faster R-CNN has a recall rate 94.6% for all the nodules. The dash lines are lower bound and upper bound FROC for 95% confidence interval using bootstrapping with 1,000 bootstraps (Setio et al. 2017). The solid line is the interpolated FROC based on prediction. LUNA16’s given segmentation ground truth and remove the useless background. It is worth visualizing the processed data during processing because some segmentations are imperfect, and need to be removed. After that, the data can be processed by the deep networks. DeepLung for Nodule Detection We train and evaluate the detector on LUNA16 dataset following 10-fold cross validation with given patient-level split. In the training, we use the flipping, randomly scale from 0.75 to 1.25 for the cropped patches to augment the data. The evaluation metric, FROC, is the average recall rate at the average number of false positives as 0.125, 0.25, 0.5, 1, 2, 4, 8 per scan, which is the official evaluation metric for LUNA16 dataset. The FROC performance on LUNA16 is visualized in Fig. 5. The solid line is interpolated FROC based on true prediction, and the dash lines are upper bound and lower bound for the bootstrapped FROC performance. The 3D Faster R-CNN achieves 83.4% FROC without any false positive nodule reduction stage, which is comparable with 83.9% for the best method, which uses two-stage training (Dou et al. 2017). DeepLung for Nodule Classification We validate the nodule classification performance of the DeepLung system on the LIDC-IDRI dataset with the LUNA16’s split principle, 10-fold patient-level cross validation. There are 1,004 nodules left and 450 nodules are positive. In the training, we firstly pad the nodules of size 32 × 32 × 32 into 36 × 36 × 36, randomly crop 32 × 32 × 32 from the padded data, horizontal flip, vertical flip, z-axis flip the data for augmentation, randomly set 4 × 4 × 4 patch as 0, and normalize the data with the mean and std. obtained from training data. The total number of epochs is 1,050. The learning rate is 0.01 at first, then became 0.001 after epoch 525, and turned into 0.0001 after epoch 840. Due to time and resource limitation for training, we use the fold 1, 2, 3, 4, 5 for test, and the final performance is the average performance on the five test folds. The nodule classification performance is concluded in Table 1. From the table 1, our 3D deep dual path network (DPN) achieves better performance than that of multi-scale CNN (Shen et al. 2015) because of the power of 3D structure and deep dual path network. Because of the power of gradient boosting machine (GBM), GBM with nodule size and raw nodule pixels with crop size as 16 × 16 × 16 achieves comparable performance as multi-scale CNN (Shen et al. 2015). Finally, we construct feature with 3D deep dual path network features, nodule size and raw nodule pixels, and obtain 90.44% accuracy. Compared with Experienced Doctors on Their Individually Confident Nodules We compare our predictions with those of four experienced doctors on their individually confident nodules (with individual score not as 3). Note that about 1/3 nodules are labeled as 3 for each doctor. Comparison results are concluded in Table 2. From Table 2, these doctors’ confident nodules are easy to be diagnosed nodules from the performance comparison between our model’s performances in Table 1 and Table 2. To our surprise, the average performance of our model is 1.5% better than that of experienced doctors. In fact, our model’s performance is better than 3 out of 4 doctors (doctor 1, 3, 4) on the nodule diagnosis task. The result validates deep network surpasses human-level performance for image classification (He et al. 2016), and the DeepLung is better suited for nodule diagnosis than experienced doctors. DeepLung for Fully Automated Lung CT Cancer Diagnosis We also validate the DeepLung for fully automated lung CT cancer diagnosis on the LIDC-IDRI dataset with the same protocol as LUNA16’s patient-level split. Firstly, we employ the 3D Faster R-CNN to detect suspicious nodules. Then we retrain the model from nodule classification model on the detected nodules dataset. If the center of detected nodule is Table 3: Comparison between DeepLung’s nodule classification on all detected nodules and doctors on all nodules. Method TP Set FP Set Doctors Acc. (%) 81.42 97.02 74.05-82.67 Table 4: Patient-level diagnosis accuracy(%) between DeepLung and experienced doctors on doctor’s individually confident CTs. Dr 1 Dr 2 Dr 3 Dr 4 Average Doctors 83.03 85.65 82.75 77.80 82.31 DeepLung 81.82 80.69 78.86 84.28 81.41 within the ground truth positive nodule, it is a positive nodule. Otherwise, it is a negative nodule. Through this mapping from the detected nodule and ground truth nodule, we can evaluate the performance and compare it with the performance of experienced doctors. We adopt the test fold 1, 2, 3, 4, 5 to validate the performance the same as that for nodule classification. Different from pure nodule classification, the fully automated lung CT nodule diagnosis relies on nodule detection. We evaluate the performance of DeepLung on the detection true positive (TP) set and detection false positive (FP) set individually in Table 3. If the detected nodule of center within one of ground truth nodule regions, it is in the TP set. If the detected nodule of center out of any ground truth nodule regions, it is in FP set. From Table 3, the DeepLung system using detected nodule region obtains 81.42% accuracy for all the detected TP nodules. Note that the experienced doctors obtain 78.36% accuracy for all the nodule diagnosis on average. The DeepLung system with fully automated lung CT nodule diagnosis still achieves above average performance of experienced doctors. On the FP set, our nodule classification subnetwork in the DeepLung can reduce 97.02% FP detected nodules, which guarantees that our fully automated system is effective for the lung CT cancer diagnosis. Compared with Experienced Doctors on Their Individually Confident CTs We employ the DeepLung for patientlevel diagnosis further. If the current CT has one nodule that is classified as positive, the diagnosis of the CT is positive. If all the nodules are classified as negative for the CT, the diagnosis of the CT is negative. We evaluate the DeepLung on the doctors’ individually confident CTs for benchmark comparison in Table 4. From Table 4, DeepLung achieves 81.41% patient-level diagnosis accuracy. The performance is 99% of the average performance of four experienced doctors, and the performance of DeepLung is better than that of doctor 4. Thus DeepLung can be used to help improve some doctors’ performance, like that of doctor 4, which is the goal for computer aided diagnosis system. We also employ Kappa coefficient, which is a common approach to evaluate the agreement between two raters, to test the agreement between DeepLung and the ground truth patient-level labels (Landis and Koch 1977). For comparison, we valid those of 4 individual doctors on their individual confident CTs. The Kappa coefficient of DeepLung is 63.02%, while the average Kappa coefficient of doctors is 64.46%. It shows the predictions of DeepLung are of good agreement with ground truths for patient-level diagnosis, and are comparable with those of experienced doctors. Discussion In this section, we are trying to explain the DeepLung by visualizing the nodule detection and classification results. Nodule Detection We randomly pick nodules from test fold 1 and visualize them in the first row and third row in Fig. 6. Detected nodules are visualized in the second, fourth and fifth row. The numbers below detected nodules are with the format (ground truth slice number-detected slice number-detection probability). The fifth row with red detection probabilies are the false positive detections. Here we only visualize the slice of center z. The yellow circles are the ground truth nodules or detected nodules respectively. The center of the circle is the nodule center and the diameter of the circle is relative to the nodule size. From the first four rows in Fig. 6, we observe the 3D Faster R-CNN works well for the nodules from test fold 1. The detection probability is also very high for these nodules. From the detected false positive nodules in the last row, we can find these false positives are suspicious to nodules visually if we observe them carefully. And the sizes of these false positive nodules are very small. Note that the nodules less than 3mm are removed in the ground truth annotations. Nodule Classification We also visualize the nodule classification results from test fold 1 in Fig. 7. The nodules in the first four rows are those the DeepLung predicted right, but some doctors predicted wrong. The first number is the DeepLung predicted malignant probability. The second number is which doctor predicted wrong. If the probability is large than 0.5, it is a malignant nodule. Otherwise, it is a benign nodule. The rest nodules are those the DeepLung predicted wrong with red numbers indicating the DeepLung predicted malignant probability. For an experienced doctor, if a nodule is big and has irregular shape, it has a high probability to be a malignant nodule. From the first 4 rows in Fig. 7, we can observe that doctors mis-diagnose some nodules. The reason is that, humans are not good at processing 3D CT data, which is of low signal to noise ratio. In fact, even for high quality 2D natural image, the performance of deep network surpasses that of humans (He et al. 2016). From the doctors’ individual experience point of view, some doctors intend to be optimistic to some nodules, and some doctors intend to be pessimistic to them. And they can just observe one slice each time. Some irregular boundaries are vague. The machine learning based methods can learn these complicated rules and high dimensional features from these doctors’ annotations, and avoid such bias. Figure 6: Visualization of central slices for nodule ground truths and detection results. We randomly choose nodules (the first row and third row) from test fold 1. Detection results are shown in the second row and fourth row. The numbers below detected nodules are with the format (ground truth slice number-detected slice number-detection probability). The last row shows the false positive detected nodules and detection probabilities. Note that the ground truth nodules are of diameter greater than 3mm. The DeepLung performs well for detection. The rest nodules with red numbers are the nodules the DeepLung predicted wrong for test fold 1 in Fig. 7. If the predicted malignant probability is large than 0.5, the ground truth label is benign. Otherwise, the ground truth label is malignant. From the central slices, we can hardly decide the DeepLung’s predictions are wrong. Maybe the DeepLung cannot find some weak irregular boundaries as for the bottom right 4 nodules, which is the possible reason why the DeepLung predicts them as benign. From the above analysis, the DeepLung can be considered as a tool to assist the diagnosis for doctors. Combing the DeepLung and doctor’s own diagnosis is an effective way to improve diagnosis accuracy. Conclusion In this work, we propose a fully automated lung CT cancer diagnosis system, DeepLung. DeepLung consists two parts, nodule detection and classification. For nodule detec- Figure 7: Visualization of central slices for nodule classification results on test fold 1. We choose nodules that is predicted right, but annotated wrong by some doctors in the first 4 rows. The numbers below the nodules are (model predicted malignant probability-which doctor is wrong). The last 2 rows show the nodules our model predicted wrong. The red number is the wrongly predicted malignant probabilities (> 0.5, predict malignant; < 0.5, predict benign). The DeepLung avoids doctors’ individual bias and achieves better performance than the average performance of doctors. tion, we design a 3D Faster R-CNN with U-net-like encoderdecoder structure to detect suspicious nodules. Then we input the detected nodules into the nodule classification network. The 3D deep dual path network is designed to extract features. Further, gradient boosting machine with different features combined together to achieve the state-of-the-art performance, which surpasses that of experienced doctors. Extensive experimental results on public available largescale datasets, LUNA16 and LIDC-IDRI datasets, demonstrate the superior performance of the DeepLung. In the future, we will develop more advanced nodule detection method to further boost the performance of DeepLung. Further, a unified framework for automated lung CT cancer diagnosis is expected for nodule detection and classification. Integrating multi-modality data, such as electronic medical report history, into the DeepLung is another direction to enhance the diagnosis performance. References Aerts, H. J.; Velazquez, E. R.; Leijenaar, R. T.; Parmar, C.; Grossmann, P.; Cavalho, S.; Bussink, J.; Monshouwer, R.; Haibe-Kains, B.; Rietveld, D.; et al. 2014. Decoding tumour phenotype by noninvasive imaging using a quantitative radiomics approach. Nature communications 5. Armato, S. G.; McLennan, G.; Bidaut, L.; McNitt-Gray, M. F.; Meyer, C. R.; Reeves, A. P.; Zhao, B.; Aberle, D. R.; Henschke, C. I.; Hoffman, E. A.; et al. 2011. The lung image database consortium (lidc) and image database resource initiative (idri): a completed reference database of lung nodules on ct scans. Medical physics 38(2):915–931. Chen, Y.; Li, J.; Xiao, H.; Jin, X.; Yan, S.; and Feng, J. 2017. Dual path networks. arXiv preprint arXiv:1707.01629. Deng, J.; Dong, W.; Socher, R.; Li, L.-J.; Li, K.; and Fei-Fei, L. 2009. Imagenet: A large-scale hierarchical image database. In CVPR, 248–255. IEEE. Ding, J.; Li, A.; Hu, Z.; and Wang, L. 2017. Accurate pulmonary nodule detection in computed tomography images using deep convolutional neural networks. arXiv preprint arXiv:1706.04303. Dou, Q.; Chen, H.; Jin, Y.; Lin, H.; Qin, J.; and Heng, P.-A. 2017. Automated pulmonary nodule detection via 3d convnets with online sample filtering and hybrid-loss residual learning. arXiv preprint arXiv:1708.03867. El-Baz, A.; Nitzken, M.; Khalifa, F.; Elnakib, A.; Gimelfarb, G.; Falk, R.; and El-Ghar, M. A. 2011. 3d shape analysis for early diagnosis of malignant lung nodules. In Biennial International Conference on Information Processing in Medical Imaging, 772–783. Springer. Friedman, J. H. 2001. Greedy function approximation: a gradient boosting machine. Annals of statistics 1189–1232. Girshick, R. 2015. Fast r-cnn. In ICCV, 1440–1448. Han, F.; Zhang, G.; Wang, H.; Song, B.; Lu, H.; Zhao, D.; Zhao, H.; and Liang, Z. 2013. A texture feature analysis for diagnosis of pulmonary nodules using lidc-idri database. In Medical Imaging Physics and Engineering (ICMIPE), 2013 IEEE International Conference on, 14–18. IEEE. He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Deep residual learning for image recognition. In CVPR, 770–778. Huang, G.; Liu, Z.; Weinberger, K. Q.; and van der Maaten, L. 2016a. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993. Huang, J.; Rathod, V.; Sun, C.; Zhu, M.; Korattikara, A.; Fathi, A.; Fischer, I.; Wojna, Z.; Song, Y.; Guadarrama, S.; et al. 2016b. Speed/accuracy trade-offs for modern convolutional object detectors. arXiv preprint arXiv:1611.10012. Hussein, S.; Cao, K.; Song, Q.; and Bagci, U. 2017. Risk stratification of lung nodules using 3d cnn-based multi-task learning. In IPMI, 249–260. Springer. Jacobs, C.; van Rikxoort, E. M.; Twellmann, T.; Scholten, E. T.; de Jong, P. A.; Kuhnigk, J.-M.; Oudkerk, M.; de Koning, H. J.; Prokop, M.; Schaefer-Prokop, C.; et al. 2014. Automatic detection of subsolid pulmonary nodules in thoracic computed tomography images. Medical image analysis 18(2):374–384. Landis, J. R., and Koch, G. G. 1977. The measurement of observer agreement for categorical data. biometrics 159–174. Long, J.; Shelhamer, E.; and Darrell, T. 2015. Fully convolutional networks for semantic segmentation. In CVPR, 3431–3440. Lopez Torres, E.; Fiorina, E.; Pennazio, F.; Peroni, C.; Saletta, M.; Camarlinghi, N.; Fantacci, M.; and Cerello, P. 2015. Large scale validation of the m5l lung cad on heterogeneous ct datasets. Medical physics 42(4):1477–1489. Murphy, K.; van Ginneken, B.; Schilham, A. M.; De Hoop, B.; Gietema, H.; and Prokop, M. 2009. A large-scale evaluation of automatic pulmonary nodule detection in chest ct using local image features and k-nearest-neighbour classification. Medical image analysis 13(5):757–770. Ren, S.; He, K.; Girshick, R.; and Sun, J. 2015. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 91–99. Ronneberger, O.; Fischer, P.; and Brox, T. 2015. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 234–241. Springer. Setio, A. A. A.; Ciompi, F.; Litjens, G.; Gerke, P.; Jacobs, C.; van Riel, S. J.; Wille, M. M. W.; Naqibullah, M.; Sánchez, C. I.; and van Ginneken, B. 2016. Pulmonary nodule detection in ct images: false positive reduction using multi-view convolutional networks. IEEE transactions on medical imaging 35(5):1160–1169. Setio, A. A. A.; Traverso, A.; de Bel, T.; Berens, M. S.; van den Bogaard, C.; Cerello, P.; Chen, H.; Dou, Q.; Fantacci, M. E.; Geurts, B.; et al. 2017. Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: the luna16 challenge. Medical Image Analysis 42:1–13. Shen, W.; Zhou, M.; Yang, F.; Yang, C.; and Tian, J. 2015. Multiscale convolutional neural networks for lung nodule classification. In IPMI, 588–599. Springer. Shen, W.; Zhou, M.; Yang, F.; Dong, D.; Yang, C.; Zang, Y.; and Tian, J. 2016. Learning from experts: Developing transferable deep features for patient-level lung cancer prediction. In MICCAI, 124–131. Springer. Suzuki, K.; Li, F.; Sone, S.; and Doi, K. 2005. Computer-aided diagnostic scheme for distinction between benign and malignant nodules in thoracic low-dose ct by use of massive training artificial neural network. IEEE Transactions on Medical Imaging 24(9):1138–1150. Way, T. W.; Hadjiiski, L. M.; Sahiner, B.; Chan, H.-P.; Cascade, P. N.; Kazerooni, E. A.; Bogot, N.; and Zhou, C. 2006. Computeraided diagnosis of pulmonary nodules on ct scans: Segmentation and classification using 3d active contours. Medical Physics 33(7):2323–2337. Yan, X.; Pang, J.; Qi, H.; Zhu, Y.; Bai, C.; Geng, X.; Liu, M.; Terzopoulos, D.; and Ding, X. 2016. Classification of lung nodule malignancy risk on computed tomography images using convolutional neural network: A comparison between 2d and 3d strategies. In ACCV, 91–101. Springer. Zeiler, M. D.; Krishnan, D.; Taylor, G. W.; and Fergus, R. 2010. Deconvolutional networks. In CVPR, 2528–2535. IEEE. Zhu, W., and Xie, X. 2016. Adversarial deep structural networks for mammographic mass segmentation. arXiv preprint arXiv:1612.05970. Zhu, W.; Lou, Q.; Vang, Y. S.; and Xie, X. 2017. Deep multiinstance networks with sparse label assignment for whole mammogram classification. In MICCAI, 603–611. Springer.
9cs.NE
Estimating the Spot Covariation of Asset Prices – arXiv:1707.02419v1 [math.ST] 8 Jul 2017 Statistical Theory and Empirical Evidence∗ Markus Bibinger† Nikolaus Hautsch‡ Peter Malec§ Markus Reiss¶ Abstract We propose a new estimator for the spot covariance matrix of a multi-dimensional continuous semi-martingale log asset price process which is subject to noise and non-synchronous observations. The estimator is constructed based on a local average of block-wise parametric spectral covariance estimates. The latter originate from a local method of moments (LMM) which recently has been introduced by Bibinger et al. (2014). We prove consistency and a point-wise stable central limit theorem for the proposed spot covariance estimator in a very general setup with stochastic volatility, leverage effects and general noise distributions. Moreover, we extend the LMM estimator to be robust against autocorrelated noise and propose a method to adaptively infer the autocorrelations from the data. Based on simulations we provide empirical guidance on the effective implementation of the estimator and apply it to high-frequency data of a cross-section of Nasdaq blue chip stocks. Employing the estimator to estimate spot covariances, correlations and volatilities in normal but also unusual periods yields novel insights into intraday covariance and correlation dynamics. We show that intraday (co-)variations (i) follow underlying periodicity patterns, (ii) reveal substantial intraday variability associated with (co-)variation risk, and (iii) can increase strongly and nearly instantaneously if new information arrives. ∗ Financial support from the Deutsche Forschungsgemeinschaft via SFB 649 “Economic Risk” and FOR 1735 “Structural Inference in Statistics: Adaptation and Efficiency” is gratefully acknowledged. Hautsch also acknowledges financial support from the Wiener Wissenschafts-, Forschungs- und Technologiefonds (WWTF). Malec thanks the Cambridge INET for financial support. † Department of Mathematics and Computer Science, University of Marburg. Email: [email protected] marburg.de. Address: Hans-Meerwein-Straße 6, D-35032 Marburg, Germany. ‡ Faculty of Business, Economics and Statistics, University of Vienna and Center for Financial Studies, Frankfurt. Email: [email protected]. Address: Oskar-Morgenstern-Platz 1, A-1090 Vienna, Austria. § Faculty of Economics, University of Cambridge. Email: [email protected]. Address: Sidgwick Avenue, Cambridge CB3 9DD, United Kingdom. ¶ Institute of Mathematics, Humboldt-Universität zu Berlin. Email: [email protected]. Address: Unter den Linden 6, D-10099 Berlin, Germany. 1 1 Introduction Recent literature in financial econometrics and empirical finance reports strong empirical evidence for distinct time variations in daily and long-term correlations between asset prices. While the literature proposes several approaches to estimate spot variances, there is a lack of empirical approaches and corresponding statistical theory to estimate spot covariances using high-frequency data. In this paper, we aim at filling this gap in the literature and propose a novel estimator for the spot covariance matrix of a multi-dimensional continuous semi-martingale log asset price process which is observed at non-synchronous times under noise. Our study is mainly related to two fields of literature. First, there is a vast body of papers on the estimation of integrated covariance matrices, while accounting for market microstructure noise and the asynchronicity of observations. Starting from the seminal realized covariance estimator by Barndorff-Nielsen and Shephard (2004) which neglects both types of frictions, Hayashi and Yoshida (2011) propose a consistent and efficient estimator under asynchronicity, but in the absence of microstructure noise. Estimators accounting for both types of frictions are, among others, the quasi maximum likelihood estimator by Ait-Sahalia et al. (2010), the multivariate realized kernel estimator by Barndorff-Nielsen et al. (2011), the multivariate preaveraging estimator by Christensen et al. (2013), the two-scale estimator by Zhang (2011), and the LMM estimator by Bibinger et al. (2014). Ait-Sahalia and Xiu (2015) show how to estimate diagonalized integrated covariance matrices exploiting methods from Jacod and Rosenbaum (2013) to deal with functional transformations of volatility. Second, there is considerable literature on spot volatility estimation. A nonparametric (kernel-type) estimator in the absence of microstructure noise is put forward by Foster and Nelson (1996), Fan and Wang (2008) and Kristensen (2010). To account for noise, the predominant approach is to compute a difference quotient based on a noise-robust integrated volatility estimator, e.g., the (univariate) realized kernel, the pre-averaging estimator or the two-scale estimator. Here, examples include Mykland and Zhang (2008), Mancini et al. (2015), Bos et al. (2012) and Zu and Boswijk (2014). An alternative approach based on series estimators of non-stochastic spot volatility is introduced by Munk and Schmidt-Hieber (2010b), while Munk and Schmidt-Hieber (2010a) study optimal convergence rates in the aforementioned setting. Similarly, rates for the stochastic volatility case are derived by Hoffmann et al. (2012) who also propose a wavelet-type estimator attaining this rate. Finally, estimators that are robust to jumps, but neglect microstructure noise are put forward, e.g., by Ait-Sahalia and Jacod (2009), Andersen et al. (2009) and Bandi and Reno (2009). Spot volatility estimation is relevant also for multiple-step approaches to perform inference on functionals that hinge on the volatility, 2 see, e.g., Kalnina and Xiu (2017) and Li and Xiu (2016). In the same way, our theory provides a foundation for multi-dimensional multiple-step inference based on the volatility matrix. Interestingly, the problem of estimating the spot covariance matrix in the presence of microstructure noise and asynchronicity effects has not yet been addressed in a study on its own. Our paper thus bridges the gap between the two fields of literature outlined above. In this context, note that spot covariance estimates are not derived as direct extensions of variance estimates under asynchronicity. Our estimator is constructed based on local averages of block-wise parametric spectral covariance estimates. The latter are estimated employing the local method of moments (LMM) estimator proposed by Bibinger et al. (2014), which has been shown to attain the optimal rate and, moreover, a statistical lower bound for the asymptotic variance for the estimation of the integrated covariance matrix. As the LMM estimator builds on locally constant approximations of the underlying covariance process and estimates them block-wise, it provides a natural setting to construct a spot covariance estimator. Our methodological contribution is as follows: First, we construct the new spot covariance matrix estimator. Second, we derive a stable central limit theorem, showing the consistency and asymptotic normality of this estimator. For both, we consider a more realistic model than previous works based on the LMM method, for instance, allowing for autocorrelated market microstructure noise. Compared to integrated (co-)variance estimators, spot estimators inherently feature slower convergence rates due to the additional smoothing involved. We prove that our spot estimator can attain rate-optimality and satisfies a point-wise stable central limit theorem at almost optimal rate. Moreover, the reduced variance effect of the LMM estimator due to multivariate weight matrices carries over to spot covariance matrix estimation and appears to be relevant in practice. Finally, as reported by Hansen and Lunde (2006), Ait-Sahalia et al. (2011), and Andersen et al. (2017) among others, microstructure noise appears to violate the traditional i.i.d. assumption, exhibiting more complex dependence structures. Adjusting both our spot covariance estimator as well as the original LMM integrated covariance estimator by Bibinger et al. (2014) to incorporate noise autocorrelation in a robust manner is an important extension, which makes the use of the methods in applications more attractive. The approach presented here does not account for jumps in the log-price process. From a methodological point of view, an extension to disentangle jumps and continuous components utilizing a truncation technique as in Bibinger and Winkelmann (2015) appears feasible. In the given framework, however, due to additional tuning parameters involved this would require a comprehensive extension, which would dilute the main new estimation ideas. Consequently, our proposed spot covariance estimator does not separate between a diffusive and jump component. For our empirical results and corresponding conclusions, this is not a limitation since in any case, potential jumps are consistently captured by the spot estimator. Moreover, Christensen 3 et al. (2014) show that, when considering data sampled at the tick-by-tick level, jumps are detected far less frequently than based on a coarser sampling grid. Our approach allows for an efficient recovery of latent intraday spot (co-)volatility paths of individual stocks. We provide simulation-based evidence on an effective implementation of the estimator depending on the choice of underlying smoothing parameters. Empirical studies on the role of high-frequency trading, the impact of market fragmentation and the usefulness of volatility circuit breakers might heavily benefit from the availability of high-frequency covariance estimators which are applicable in higher dimensions. Further, spot covariance estimates are a necessary building block for co-jump tests, see Bibinger and Winkelmann (2015). Finally, an important objective of this paper is to provide first empirical evidence on the intraday behavior of spot covariances and correlations. Applying the spot covariance estimator to four years of quote data for 30 of the most liquid constituents of the Nasdaq 100, we obtain novel empirical findings. First, there is a distinct intraday seasonality pattern going beyond volatilities as covariances exhibit a U-shape and correlations increase throughout the day. Second, spot (co-)variation reveals substantial intraday variability and thus reflect (co-)variation risk. Finally, spot covariances and correlations change substantially during flash crashes or the arrival of fundamental information. The remainder of the paper is structured as follows. Section 2 states a brief description of the data and empirical objectives. Section 3 theoretically introduces the proposed spot estimator and gives its asymptotic properties in detail. In Section 4, we present a simulation study analyzing the estimator’s sensitivity to the choice of input parameters and demonstrating its finite sample accuracy. Section 5 provides empirical evidence on spot (co-)variances, correlations and volatilities based on Nasdaq data. Finally, Section 6 concludes. Supplementary material is contained in a web appendix available on https://www.mathematik.uni-marburg. de/˜stochastik/material/Web_Appendix.pdf. 2 High-Frequency Data and Spot Covariances We employ ask and bid quote data for 30 of the most liquid constituents of the Nasdaq 100 index. The sample period is from May 2010 to April 2014. The underlying data is provided by the LOBSTER database. The latter reconstructs the order book from a message stream, which is part of Nasdaq’s historical TotalView-ITCH data and contains all limit order submissions, cancellations and executions on each trading day (see Huang and Polak, 2011) on the Nasdaq market. Accordingly, the corresponding transaction data can be read out from the above message files directly. For the resulting datasets all recorded events are time stamped with at 4 234 131 238.5 129 231.75 129 237 127 229.5 127 235.5 125 227.25 125 234 Quote –AAPL 123 225 14:50:00 14:40:05 Time of Day 14:50:05 Quote –AMZN 131 Quote –AMZN Quote –AAPL 240 123 14:50:10 Time of Day (a) 2:40:00 pm – 2:40:10 pm (b) 2:50:00 pm – 2:50:10 pm Figure 1: Bid- and ask-quotes of AAPL and AMZN on May 6th, 2010. Circles correspond to ask-quotes, crosses to bid-quotes. Black symbols correspond to AAPL, grey symbols to AMZN. least millisecond precision, which allows for an econometric analysis at the highest resolution possible. In the web appendix, we provide summary statistics of the underlying raw data corresponding to the best ask and bid quotes in the Nasdaq market, recorded whenever the first level of the order book is updated. The average daily number of (level one) order book updates is 185, 000, corresponding to a new observation every 0.2 seconds. Figure 1 depicts the ask and bid quotes for Apple (AAPL) and Amazon (AMZN) during two ten-second time intervals at 2:40 pm and 2:50 pm on May 6, 2010. We observe three features: (i) most of the underlying order book updates do not cause a change in the best ask and bid quotes. Consequently, most of the corresponding event-to-event mid-quote returns are zero. (ii) Despite the high precision of the time stamps, we observe time periods of several seconds without any activity, followed by other periods where order book activity is strongly clustered. Hence, the data is highly irregularly spaced. (iii) Orderbook updates of both stocks occur asynchronously over time. This is particularly due to obvious differences in event intensities. (iv) Particularly the Amazon quotes tend to bounce between different price levels. This is caused by considerable quoting activity and an obviously thin limit order book on the first level. The aforementioned effect even leads to a certain bouncing behavior in the resulting mid-quote returns, which is not necessarily attributed to movements of the underlying fundamental price, but rather to liquidity-induced noise. The left part of Figure 2, focusing on mid-quotes, shows that the two above ten-second periods are at the heart of the flash crash occurring on May 6th, 2010 between 2:00 pm and 3:00 pm. While both figures reveal a microscopic and macroscopic view of the price behavior around this time point, neither picture provides hints on the underlying covariance and correlation between the two stocks and how they may change in such an extreme period. 5 260 0.45 130.5 225 127 207.5 Mid-Quote –AMZN 242.5 Mid-Quote –AAPL 0.6 134 0.3 0.15 123.5 190 14:10 14:20 14:30 14:40 14:50 0 11:00 120 15:00 12:00 13:00 14:00 15:00 16:00 Time of Day (a) Mid-quotes: 2:00 pm – 3:00 pm (b) Spot correlations Figure 2: Mid-quotes and spot correlations of AAPL and AMZN on May 6th, 2010. In the left plot, black dots correspond to AAPL, grey dots to AMZN. In the right plot, dashed lines correspond to approximate pointwise 95% confidence intervals according to Corollary 1 in Section 3. The right part of Figure 2 shows the behavior of the estimated correlation path during this trading day, revealing a strong and highly significant downward movement which results in a significantly different correlation level after the flash crash. The (approximate) confidence intervals depicted in this figure are constructed based on quote data for the two assets under focus on the given trading day only and rely on a feasible central limit theorem provided in this paper (see Section 3.3). Figure 3 shows the ask/bid-quote behavior during two ten-second periods at 1:11 pm and 1:13 pm on April 23rd, 2013. While both pictures confirm the high-frequency properties of quote data discussed above, the asynchronicity of the two series becomes even more visible. As discussed in more detail in Section 5.3 and illustrated in the left part of Figure 4, during this period, most equity prices dropped sharply because of faked Twitter news. The right part of Figure 4 depicts the correlation path for this day, providing striking evidence for a strong and significant temporal shift in correlations. These two examples demonstrate that intraday movements in covariances and correlations can be substantial and can occur rapidly if new information arrives on the market. These movements can be empirically identified with sufficient precision, revealing important information for market surveillance and market microstructure research. The construction of correlation path estimates and corresponding confidence intervals, however, requires the optimal use of the underlying high-frequency information. From the illustrations above, it is obvious that a sufficiently precise identification of a correlation estimate at a single point in time (as, e.g., at 1:11 pm on April 23rd, 2013) cannot exploit information during the corresponding interval only, but needs to incorporate quote information from neighboring intervals. We therefore need to address the question of optimal smoothing over time, and thus the tradeoff between bias and 6 410 404 268 408.5 403 267 402 266 405.5 265 13:11:10 404 401 13:11:00 13:11:05 Quote –AAPL 269 Quote –AMZN Quote –AAPL 405 270 269.25 407 268.5 267.75 267 13:13:05 Time of Day Time of Day (a) 1:11:00 pm – 1:11:10 pm (b) 1:13:00 pm – 1:13:10 pm 410 270 407 268.5 404 267 401 265.5 0.7 0.475 Mid-Quote –AMZN Mid-Quote –AAPL Figure 3: Bid- and ask-quotes of AAPL and AMZN on April 23rd, 2013. Circles correspond to ask-quotes, crosses to bid-quotes. Black symbols correspond to AAPL, grey symbols to AMZN. 0.25 0.025 -0.2 11:00 398 264 13:05 13:06 13:07 13:08 13:09 13:10 13:11 13:12 13:13 13:14 13:15 12:00 13:00 14:00 15:00 16:00 Time of Day (a) Mid-quotes: 1:05 pm – 1:15 pm (b) Spot correlations Figure 4: Mid-quotes and spot correlations of AAPL and AMZN on April 23rd, 2013. In the left plot, black dots correspond to AAPL, grey dots to AMZN. In the right plot, dashed lines correspond to approximate pointwise 95% confidence intervals according to Corollary 1 in Section 3. 7 variance. A further challenge is to account for the asynchronicity and irregular spacing of the observations, avoiding downward biases of estimates due to the Epps effect. This is even more true as for some stocks a considerable amount of mid-quote returns equals zero and therefore does not necessarily provide new price information. In the web appendix, we show that on average only 13% of all mid-quote returns are non-zero. In the extreme case (e.g. for Microsoft), this quantity can amount to only 1%. One initial step to utilize the underlying information in a (computationally) more efficient way is therefore to make use of quote revisions only. Moreover, as sufficiently precise spot correlation estimates require exploiting high-frequency data on the highest possible frequency, correlation estimates need to be robust to possible market microstructure noise, i.e., deviations of the observed mid-quote price from the underlying “true” price process. Based on estimates of the (long-run) noise variance relying on an estimation procedure described in Section 1.3 of the web appendix and employing quote revisions, Table 5 of the the web appendix reports an average noise-to-signal ratio per observation of 1.5. On ultra-high observation frequencies, market microstructure noise, however, is moreover likely to be serially correlated with the order of serial dependence being unknown ex-ante. In fact, using a test for serial correlation in the noise process as developed in the web appendix, the latter provides evidence for serial dependence up to an order of 12 on average for mid-quote revisions. Finally, intraday trajectories of spot correlations are potentially subject to intraday periodicity effects. Indeed, one novel empirical finding of this paper is to identify distinct intraday seasonalities not only for individual asset return variances (as also documented in other work, e.g., in Andersen and Bollerslev (1997, 1998)), but also for cross-asset correlations. Figure 5 shows the cross-sectional medians of the across-day averages of pair-wise correlations, employing all combinations of the 30 most liquid Nasdaq stocks and all days through the period from May 2010 to April 2014 excluding “unusual days” as discussed in Section 5.3 as well as days with scheduled FOMC announcements. It turns out that correlations tend to systematically increase through the day with the highest rise during the morning hours. To address these challenges and to incorporate these stylized facts of the data, it is thus necessary to construct an estimator which (i) optimally makes use of local mid-quote information as, e.g., depicted in Figures 2 and 4, resulting in consistent and precise estimates with the highest convergence rates possible, (ii) allows for fairly general properties of the underlying spot volatility (matrix) process, incorporating, e.g., intraday periodicities, (iii) accounts for serially correlated and potentially endogenous noise, and (iv) yields feasible asymptotic inference, accounting for the pre-estimation of noise-dependent quantities. Based on the asymptotic results for such a spot covariance matrix estimator and the Delta-method, consistent estimators for other quantities of interest, such as spot betas and spot correlations can be deduced. 8 0.42 Spot Correlation 0.375 0.33 0.285 0.24 10:00 11:00 12:00 13:00 14:00 15:00 16:00 Time of Day Figure 5: Cross-sectional medians of across-day averages of spot correlations. Spot estimates are first averaged across days for each asset pair. Subsequently, cross-sectional sample medians of the across-day averages are computed. Solid horizontal line corresponds to the cross-sectional median of the across-day averages of integrated correlation estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. “Unusual days” discussed in Section 5.3 as well as days with scheduled FOMC announcements are removed. 3 3.1 Estimation of Spot Covariances Theoretical Setup and Assumptions Let (Xt )t≥0 denote the d-dimensional efficient log-price process. In line with the literature and motivated by well-known no-arbitrage arguments, we assume that Xt follows a continuous Itô semi-martingale Z Xt = X0 + t Z 0 t σs dBs , t ∈ [0, 1], bs ds + (1) 0  defined on a filtered probability space Ω, F, (F)t≥0 , P with drift bs , d-dimensional standard Brownian motion Bs and instantaneous volatility matrix σs . The latter yields the (d × d)dimensional spot covariance matrix Σs = σs σs> , which is our object of interest. We consider a setting in which discrete and non-synchronous observations of the process (1) are diluted by market microstructure noise, i.e., (p) Yi (p) (p) = X (p) + i , i = 0, . . . , np , p = 1, . . . , d , ti (p) (2) (p) with observation times ti , and observation errors i . Observed returns for component p ∈ {1, . . . , d} are given by (p) ∆i Y (p) = Yi (p) − Yi−1 = ∆i X (p) + ∆i (p) 9 (3) (p) (p) ti ti−1 (p) (p) = X (p) − X (p) + i − i−1 , i = 1, . . . , np . Let n = min np denote the number of observations of the least liquid asset. In Section 3.3, 1≤p≤d we consider high-frequency asymptotics with n/np → νp for constants 0 < νp ≤ 1, such that the asymptotic variance-covariance matrices for estimators of Σs are regular. Below we summarize the assumptions on the instantaneous volatility matrix and drift process, noise properties and observation times. In order to describe smoothness classes of the spot covariance matrix process and other functions, we consider balls in Hölder spaces of order α ∈ (0, 1] and with radius R > 0: C α,R ([0, 1], E) = {f : [0, 1] → E| kf kα ≤ R} , kf kα := kf k∞ + sup x6=y kf (x) − f (y)k , |x − y|α where k · k denotes the usual spectral norm and kf k∞ := supt∈[0,1] kf (t)k for functions on 0 [0, 1]. In our setup, we have E = Rd×d for matrix-valued functions, E = Rd for vectors or E = [0, 1] for distribution functions. First, for the drift process in (1), we only assume a very mild regularity: (1) (2) Assumption 1. (bs )s∈[0,1] is an (Fs )-adapted process with bs = g(bs , bs ), g : R2d → Rd (1) being a continuously differentiable function in all coordinates, bs an Itô semi-martingale with (2) locally bounded characteristics and bs ∈ C ν,R ([0, 1], Rd ) for some R < ∞ and some ν > 0. Assumptions on the instantaneous volatility matrix process in (1) can be summarized as: Assumption 2. (i) (σs )s∈[0,1] follows an (Fs )-adapted process satisfying Σs = σs σs> ≥ Σ uniformly for some strictly positive definite matrix Σ. 0 0 (1) (2)  (ii) (σs )s∈[0,1] satisfies σs = f σs , σs with f : R2d×2d → Rd×d being a continuously differentiable function in all coordinates, where (1) • For α ∈ (0, 1/2], σs is an Itô semi-martingale with locally bounded characteristics. (2) 0 • σs ∈ C α,R [0, 1], Rd×d  with some R < ∞. (1) Hence, σs is a function of an Itô semi-martingale σs component (2) σs . and an additional Hölder smooth The latter can capture intraday periodicity effects (see, e.g., Andersen and Bollerslev, 1997). Assumption 2 depends on the smoothness parameter α and reads similar as Assumption (K-v) in Jacod and Todorov (2010). The larger α, the more restrictive becomes (1) Assumption 2. If α > 1/2, we assume that the semi-martingale component σs vanishes and σs (2) is exclusively driven by the component σs . Hence, the more interesting case is α ≤ 1/2. Then, Assumption 2 allows also for a semi-martingale volatility with volatility jumps. Importantly, the 10 above assumptions also allow for leverage effects, that is, a non-zero correlation between σs and the Brownian motion Bs in (1). It is natural to develop results under this general smoothness assumption depending on α as it is commonly known that in nonparametric estimation problems, the underlying regularity α determines the size of smoothing windows and a fortiori the resulting (optimal) convergence rates. Our assumptions on the microstructure noise process in (2) are stated in observation time, which is in line with, e.g., Hansen and Lunde (2006) and Barndorff-Nielsen et al. (2011): (p) Assumption 3. (i)  = {i , i = 0, . . . , np , p = 1, . . . , d} is independent of X and has (p) independent components, i.e., i (q) is independent of j for all i, j and p 6= q. (p) (ii) At least the first eight moments of i , i = 0, . . . , np , exist for each p = 1, . . . , d. (p) (iii) i , i = 0, . . . , np , follows an R-dependent process for some R < ∞, implying that (p) (p)  Cov i , i+u = 0 for u > R and each p = 1, . . . , d. Define by ηp = (p) η0 +2 R X (p) (p)  ηu(p) , with ηu(p) := Cov i , i+u , u ≤ R, (4) u=1 (p) the component-wise long-run noise variances, where the ηu , 0 ≤ u ≤ R, are constant for all 0 ≤ i ≤ n − u. We impose that ηp > 0 for all p. The independence between noise and the efficient price, as stated in part (i) of Assumption 3, is standard in the literature (see, e.g., Zhang et al., 2005). On the other hand, however, Hansen and Lunde (2006) report evidence for an endogeneity with dependence between noise and efficient price and it is of interest that estimators are robust in that case. To meet this objective, we show in Section 1.3 of the web appendix that our estimator will be robust, in the sense of keeping the same asymptotic properties, to correlations between signal and noise. Considering serially dependent noise is non-standard and motivated by empirical results, e.g., in Hansen and Lunde (2006). The moving-average-type dependence structure in the noise process in part (iii) of Assumption 3 follows, e.g., Hautsch and Podolskij (2013), implying the long-run variance (4). Generalized realized kernel estimation of the covariation in a very general model with endogenous and serially correlated noise has been presented in Varneskov (2016). Crosssectional dependence of the noise is left aside in our theory, since a notion of simultaneous dependence in the presence of non-synchronicity is by now not established. In principle, nondiagonal noise variance-covariance matrices can be included in the multivariate framework below, see Bibinger and Reiß (2014) for a setup allowing for cross-sectional dependence when recordings are synchronous. 11 Finally, we assume that the timing of observations in (2) is driven by c.d.f.’s Fp governing the transformations of observation times to equidistant sampling schemes by means of suitable quantile transformations: Assumption 4. There exist differentiable cumulative distribution functions Fp , p = 1, . . . , d, (p) such that the observation regimes satisfy ti = Fp−1 (i/np ) , 0 ≤ i ≤ np , p ∈ {1, . . . , d}, where  Fp0 ∈ C α,R [0, 1], [0, 1] , p = 1, . . . , d, with α being the smoothness exponent in Assumption 2 for some R < ∞. Fp , p = 1, . . . , d, can be random, but independent from the observed process (p) {Yi }. A treatment of endogenous times in the given theoretical framework is beyond the scope of this paper. See Koike (2016) for a recent study of endogenous times and Li et al. (2014) for a study in a setting neglecting microstructure noise. Combining time-invariant (long-run) noise variances ηp and locally different observation frequencies from Assumptions 3 and 4 implies locally varying noise levels. In the asymptotic framework with n/np → νp , where 0 < νp ≤ 1, p = 1, . . . , d, for n → ∞, we define the continuous-time noise level matrix Hs = diag (ηp νp (Fp−1 )0 (s))1/2  1≤p≤d . (5) Note that for equally-spaced observations, we have Fp (s) = s, such that (Fp−1 )0 (s) = 1. Then, the p-specific (asymptotic) noise level is (ηp νp )1/2 with the constant νp expressing the inverse of the sample size of the p-th process relative to the “least liquid” process. Hence, having less frequent observations on a sub-interval is equivalent to having higher noise dilution by microstructure effects on this sub-interval. This interplay between noise and liquidity has been discussed by Bibinger et al. (2014). 3.2 Local Method of Moments Estimation of the Spot Covariance Matrix Our approach for estimating the instantaneous covariance matrix rests upon the concept of the local method of moments (LMM) introduced in Bibinger et al. (2014). We partition the interval [0, 1] into equidistant blocks [khn , (k + 1)hn ], k = 0, . . . , h−1 n − 1, with the block length hn asymptotically shrinking to zero, hn → 0 as n → ∞. The key idea is to approximate the underlying process (1) in model (2) by a process with block-wise constant covariance matrices and noise levels. In the (more simplified) setting of Bibinger et al. (2014), it is shown that such a locally constant approximation induces an estimation error for the integrated covariation, which, however, can be asymptotically neglected for sufficient smoothness of Σt and Fp if the block sizes hn shrink sufficiently fast with increasing n. This opens the path to construct 12 an asymptotically efficient estimator of the integrated covariation matrix based on optimal block-wise estimates. In the present setting, we build on the idea of block-wise constant approximations of the underlying covariance and the noise process and show that it allows constructing a consistent spot covariance estimator, which can attain an optimal rate. A major building block is the > construction of an unbiased estimator of the block-wise covariance matrix Σkhn = σkhn σkh n based on the local spectral statistics Sjk = πjh−1 n np  X (p) Yi − (p) Yi−1 i=1   t(p) + t(p)  i Φjk i−1 2 ! , (6) 1≤p≤d where Φjk denote orthogonal sine functions with (spectral) frequency j, whose derivatives Φ0jk form another orthogonal system corresponding to the eigenfunctions of the covariance operator of a Brownian motion, and are given by √ Φjk (t) =  2hn sin jπh−1 n (t − khn ) 1[khn ,(k+1)hn ) (t), j ≥ 1 . jπ (7) The statistics (6) de-correlate the noisy observations (3) and can be thought of as representing their block-wise principal components. They bear some resemblance to the pre-averaged returns as employed in Jacod et al. (2009). While pre-averaging estimators, however, utilize rolling (local) windows around each observation, our approach relies on fixed blocks and optimal combinations in the spectral frequency domain. Related approaches for a univariate framework can be found in Hansen et al. (2008), Reiß (2011) and Curci and Corsi (2012). It has been shown in Altmeyer and Bibinger (2015) that n Cov(Sjk ) = (Σkhn + π 2 j 2 h−2 n Hk )(1 + O(1)), (8) where Hnk denotes the block-wise constant diagonal noise level matrix with entries Hnk (pp) −1 0 = n−1 p ηp (Fp ) (khn ) . (9) The relation (8) corresponds to Equation (2.4) in Bibinger et al. (2014) plus a negligible remainder in the more general model and suggests estimating Σkhn based on the empirical > , which is bias-corrected by the noise-induced term π 2 j 2 h−2 Hn . covariance Sjk Sjk n k An initial (pre-) estimator of the spot covariance matrix at time s ∈ [0, 1], Σs , is then con> , which are averaged structed based on bias-corrected block-wise empirical covariances Sjk Sjk 13 across spectral frequencies j = 1, . . . , Jnp , and a set of adjacent blocks, p Us,n pre  X vec Σ̂khn = (Us,n − Ls,n + 1)−1 (Jnp ) Jn X −1   > n vec Sjk Sjk − π 2 j 2 h−2 Ĥ n k , (10) j=1 k=Ls,n −1 −1 with Ls,n = max{bsh−1 n c − Kn , 0} and Us,n = min{bshn c + Kn , dhn e − 1} for a two-sided −1 −1 estimator as well as Ls,n = max{bsh−1 n c − 2Kn , 0} and Us,n = min{bshn c, dhn e − 1} for a one-sided estimator, such that the length of the smoothing window obeys Us,n − Ls,n + 1 ≤ 2Kn + 1. In this context, two-sided means that at some time s, we estimate the covariances by locally smoothing over a window centered around s. One-sided refers to the same method, but with smoothing over a window before and up to time s. Asymptotic properties are the same. √ Ĥnk is a n-consistent estimator of Hnk with p-th diagonal element Ĥnk (pp) = η̂p hn (p) (p) 2 ti − ti−1 . X (11) (p) khn ≤ti ≤(k+1)hn Details on the construction of the estimator of the component-wise long-run noise variances, η̂p , are provided in Section 1.3 of the web appendix. > − π 2 j 2 h−2 Ĥn is an (asymptotically) For each spectral frequency j, the statistic Sjk Sjk n k unbiased though inefficient estimator of Σkhn . Averaging across different frequencies therefore increases the estimator’s efficiency. Equally weighting as in (10), however, is not necessarily optimal. A more efficient estimator can be devised by considering (10) as the pre-estimated spot covariance matrix and then, derive estimated optimal weight matrices Ŵj , yielding the final LMM spot covariance matrix estimator as Us,n Jn X X   vec Σ̂s = (Us,n − Ls,n + 1)−1 Ŵj Ĥnk , Σ̂pre khn k=Ls,n (12) j=1 × vec  > Sjk Sjk − n π 2 j 2 h−2 n Ĥk  . As outlined in detail in Bibinger et al. (2014), the true optimal weights are given proportionally to the local Fisher information matrices according to Jn −1  X   n −⊗2 n −⊗2 Wj Hnk , Σkhn = Σkhn + π 2 u2 h−2 H Σkhn + π 2 j 2 h−2 n Hk n k u=1 = Ik−1 Ijk , 14 (13) with Ijk being the Fisher information matrix associated with block k and spectral frequency j, given by Ijk = and Ik = PJn j=1 Ijk 1 2 n Σkhn + π 2 j 2 h−2 n Hk −⊗2 , (14) denoting the k-specific Fisher information (exploiting the independence across frequencies j). Here, A⊗2 = A ⊗ A denotes the Kronecker product of a matrix with itself and A−⊗2 = A−1 ⊗ A−1 = (A ⊗ A)−1 . We show in Section 3.3 that the estimator (12), which builds on the idealized model considered in Bibinger et al. (2014), is consistent and satisfies a stable CLT under the more realistic and general assumptions of Section 3.1. While both the pilot estimator (10) and the LMM estimator (12) are symmetric, neither is guaranteed to yield positive semi-definite estimates. Confidence is based on estimated Fisher information matrices Iˆk , see (13), which are by construction positive-definite. For the estimates themselves, we can set negative eigenvalues equal to zero, which is tantamount to a projection on the space of positive semi-definite matrices. This adjustment does not affect the asymptotic properties of the estimator. For a similar adjustment to a realized kernel integrated covariance estimator see Varneskov (2016). 3.3 Asymptotic Properties As a prerequisite for the discussion of the central limit theorem for the estimator (12), some considerations regarding Kn , which determines the length of the smoothing window, are needed. For this purpose, suppose that a certain smoothness α ∈ (0, 1] of the instantaneous volatility matrix is granted according to Assumption 2. Then, a simple computation   yields kCOV Σ̂s k = O Kn−1 , implying a bias-variance trade-off in the mean square error h i  MSE Σ̂s := E kΣ̂s − Σs k2 . More precisely, for a specific α > 0, we have    MSE Σ̂s = O Kn−1 + O Kn2α h2α n , (15) where the first term originates from the variance and the second term is induced by the squared bias. Consequently, for given hn ∝ log(n)n−1/2 , which optimally balances noise and discretization error as derived in Bibinger et al. (2014), choosing Kn ∝ nα/(2α+1) minimizes the √ MSE and facilitates an estimator with Kn convergence rate. Finally, the desired central limit theorem for the estimator (12) requires a slight undersmoothing, resulting in a smaller choice of Kn : Theorem 1. We assume a setup with observations of the type (2), a signal (1) and the validity of Assumptions 1-4. Then, for hn = κ1 log (n)n−1/2 , Kn = κ2 nβ (log (n))−1 with constants 15 κ1 , κ2 and 0 < β < α(2α + 1)−1 , for Jn → ∞ and n/np → νp with 0 < νp ≤ 1, p = 1, . . . , d, as n → ∞, the spot covariance matrix estimator (12) satisfies the pointwise F-stable central limit theorem: nβ/2 vec Σ̂s − Σs  d−(st)    1/2 1/2 −→ N 0, 2 Σ ⊗ ΣH + ΣH ⊗ Σ s Z , where ΣH = H H −1 ΣH −1 1/2 s ∈ [0, 1] , (16) H, with noise level H from (5) and Z = COV(vec(ZZ > )) for Z ∼ N(0, Ed ) being a standard normally distributed random vector. Theorem 1 is proved in the web appendix. Though Assumption 2 involves volatility jumps for α ≤ 1/2, (16) applies, because for any fixed s ∈ [0, 1], the probability of a jump in the asymptotically small smoothing window converges to zero. For finite-sample applications of estimating the spot covariance matrix in the vicinity of a structural change, however, one should carefully adjust the chosen smoothing windows. Lemma 1 in the web appendix provides the key step to extend the analysis to autocorrelated noise. Its proof reveals, at the same time, why the generalization from Gaussian i.i.d. noise in Bibinger et al. (2014) to the general Assumption 3 does not affect the asymptotic variance of the estimator. The convergence in (16) is F-stable, which is equivalent to joint weak convergence with any F-measurable bounded random variable defined on the same probability space as X. This allows for a feasible version of the limit theorem, even for general stochastic volatilities with leverage effects if we re-scale the estimator by the inclusively obtained estimated variance: Corollary 1. Under the assumptions of Theorem 1, the spot covariance matrix estimator (12) satisfies the feasible central limit theorem given by (Us,n − Ls,n + 1)1/2 V̂sn −1/2   d  vec Σ̂s − Σs → N 0, Z , Us,n where V̂sn = (Us,n − Ls,n + 1) X Jn X k=Ls,n j=1 −1 s ∈ [0, 1] , (17a) !−1 Iˆjk , (17b) with Us,n and Ls,n defined as in (10) and (12). Iˆjk is defined according to (14) with Hnk and Σkhn , k = 0, . . . , h−1 n − 1, replaced by the estimators (10) and (11), respectively. Unlike in (16), in which we obtain a mixed normal limiting distribution, the matrix Z is completely known. It is given by twice the “symmetrizer matrix” introduced by Abadir and Magnus (2005, ch. 11) and corresponds to the covariance structure of the empirical covariance of a d-dimensional (standard) Gaussian vector. 16 The asymptotic variance-covariance matrix in (16) is the same instantaneous process that appears integrated over [0, 1] as variance-covariance matrix of the integrated covariance matrix estimator in Bibinger et al. (2014). Accordingly, Theorem 1 is in line with the results on classical realized volatility in the absence of noise for d = 1 and the nonparametric NadarayaR Watson-type kernel estimator by Kristensen (2010) with asymptotic variance 2σs4 R k 2 (z) dz, where k denotes the used kernel. In our case, the estimator is of histogram-type and the rectangle kernel does not appear in the asymptotic variance. Let us point out that estimator (12), building on optimal combinations over spectral frequencies, is more advanced than a usual histogramestimator. When comparing our nonparametric estimator (12), e.g., to the aforementioned estimator by Kristensen (2010), in our case, the actual bandwidth is (2Kn + 1)hn (or smaller), since we smooth over (up to) (2Kn + 1) adjacent blocks of length hn . In this context, one can as well think of employing h−1 n de-noised block statistics as underlying observations. Regarding the convergence rate in (16), we may focus on the case α = 1/2, which is tantamount to the spot volatility matrix process (σs )s∈[0,1] being as smooth as a continuous semi-martingale. This assumption yields the rate n1/8−ε , for any ε > 0, such that we almost attain the optimal rate n1/8 , which is obviously lower than the corresponding rate for integrated (co-)variance estimators in the setting with noise, n1/4 (see Hoffmann et al., 2012). Notably, our spot covariance matrix estimator (12) converges considerably faster than existing noise-robust spot volatility estimators based on the difference quotient of integrated volatility estimates (e.g. Zu and Boswijk, 2014). The two-step approach (12) with combinations over different frequencies strongly reduces the estimator’s variance (compared to simpler methods). This is well confirmed in our finite-sample simulations in Section 4. Theorem 1 and Corollary 1 hold for estimation points s ∈ [0, 1], both in the interior and in the boundary region of the unit interval. This result is a consequence of the estimators (10) and (12) being of histogram-type, implying that smoothing is conducted by averaging over a set of adjacent blocks. The latter merely needs to contain time t, and does not have to be centered around the point of estimation. Finally, Theorem 1 may be employed to deduce asymptotic results for the estimators of spot correlations and spot betas. These can be considered as the instantaneous counterparts to the integrated quantities studied, e.g., in Andersen et al. (2003) and Barndorff-Nielsen and Shephard (2004). In this context, focus on those elements of the spot covariance matrix Σt , t ∈ [0, 1], involving only the indices p, q ∈ {1, . . . ,q d}. Further, denote the spot correlation (pq) and beta estimators based on (12) by ρ̂s (pq) = Σ̂s / (pp) Σ̂s (qq) Σ̂s (pq) and β̂s (pq) = Σ̂s (pp) /Σ̂s . Then, Theorem 1 implies by application of the Delta-method that nβ/2 ρ̂(pq) − ρ(pq) s s   d−(st)  −→ N 0, AV(pq) ρ,s , 17 s ∈ [0, 1] , (18a) nβ/2 β̂s(pq) − βs(pq)   d−(st)  (pq) −→ N 0, AVβ,s , s ∈ [0, 1] , (18b) with (pq) 2 (pp) (qq) (p−1)d+q,(p−1)d+q AV(pq) + ρ,s = Σs Σs AVs Σs (pp) 3 4 Σs (pq) 2 Σs + 4 (qq) 3 (pp) Σs Σs (qq) Σs (pq) Σs (pp) Σs AVs(p−1)d+q,(p−1)d+p (pq) 2 AV(p−1)d+q,(q−1)d+q + s Σs AVs(p−1)d+p,(q−1)d+q , (qq) 2 Σs −2 2 (pp) −4 = Σ(pp) AV(p−1)d+q,(p−1)d+q + Σ(pq) Σs AVs(p−1)d+p,(p−1)d+p s s s − AVβ,s AV(p−1)d+p,(p−1)d+p (18c) s (pq) AVs(q−1)d+q,(q−1)d+q − (pq) Σs (qq) Σs (pp) 2 Σs (18d)  (p,p) −3 − 2Σ(p,q) Σs s AV(p−1)d+q,(p−1)d+p , s where AVs denotes the asymptotic variance-covariance matrix in (16). Feasible versions of the central limit theorems (18a) and (18b) can be readily obtained analogously to Corollary 1. 3.4 Choice of Inputs The proposed spot covariance matrix estimator (12) depends on four input parameters to be chosen: (i) the block length hn , (ii) the maximum spectral frequency Jn , (iii) the maximum frequency for the pre-estimator (10), Jnp , as well as (iv) the length of the smoothing window, Kn .  For (i) , Theorem 1 requires that hn = O log (n)n−1/2 . (ii) is given by bminp np hn c,  but a spectral cut-off Jn = O log (n) can be chosen, since the optimal weights decay fast with increasing frequency j, making higher frequencies asymptotically negligible. The effect of quickly diminishing optimal weights implies that (iii) should be fixed at a value not “too large”, e.g., Jnp = 5. The reason is that the cut-off directly determines the (uniform) weights in the  pre-estimator (10). For (iv), we generally set Kn = O nα/(2α+1) . The latter choice implies undersmoothing, thereby forfeiting rate-optimality of the estimator, but provides us a central limit theorem. Under the “continuous semi-martingale or smoother” assumption (α ≥ 1/2) for the spot volatility matrix process, which seems admissible in most financial applications, we set  Kn = O n1/4−ε for some ε > 0. In practice, we introduce proportionality parameters for (i), (ii) and (iv), i.e. hn = θh log (n)n−1/2 , Jn = bθJ log (n)c and Kn = dθK n1/4−δ e, where θh , θJ , θK > 0 and δ 18 denotes a small positive number. We discuss the specific choice of the above input parameters in more detail in Sections 4 and 5.2. 4 Simulation Study We conduct a simulation study to examine the following issues. First, we analyze the impact of different choices of the input parameters θh , θJ and θK introduced in Section 3.4 on the estimator’s finite-sample performance. We consider different scenarios which mimic both “regular” trading days as well as “unusual” trading days in periods of financial stress. Second, we investigate the frequency of non-positive semi-definite estimates and whether simple eigenvalue truncation techniques translate into an improved finite-sample precision. We consider a high-dimensional setting with d = 15. For 15 assets, we estimate a 120dimensional volatility matrix and the estimator utilizes weight matrices with 7260 entries. To ensure parsimony in this framework, we assume that the efficient log-price process follows a simple factor structure as employed, e.g., in Barndorff-Nielsen et al. (2011). We extend the latter to incorporate both a flexible stochastic and a non-stochastic seasonal volatility component, which is modeled by a Flexible Fourier Form as introduced by Gallant (1981). We dilute the observations of the efficient log-price process by serially dependent microstructure noise with R = 1. Finally, asynchronicity effects are introduced by drawing the observation times (p) ti , i = 1, . . . , np , from independent Poisson processes. Details on the simulation setting are provided in the web appendix, Section 2. To investigate the impact of the chosen input parameters, we compute the LMM estimator (12) over a grid of values for θh , θJ and θK . For each combination and in each replication m = 1, . . . , M , we evaluate the (normalized) mean integrated Frobenius distance between the resulting estimates Σ̂t,m and their “true” counterparts. Hence, we compute MIFB := M d  2 −1 M Z X 1 d h X m=1 0 p,q=1 (pq) (pq) Σ̂t,m /Σt,m − 1 i2 dt, (19) where M is the number of replications. In addition, we evaluate the average normalized mean integrated squared errors of the variance and covariance estimates, respectively, i.e., MISEc := (M d(d − 1)/2)−1 M Z X 1Xh m=1 0 p6=q MISEv := (M d) −1 M Z X d h 1X m=1 0 p=1 (pq) (pq) Σ̂t,m /Σt,m − 1 i2 (pp) (pp) Σ̂t,m /Σt,m − 1 dt. 19 i2 dt, (20) (21) Table 1: Performance of LMM spot covariance matrix estimator depending on θh , θJ and θK . RMIFB, RMISEc and RMISEv are the square roots of (19), (20) and (21), respectively, computed based on M = 3000 Monte Carlo replications and reported in percentage points. % PSD denotes the percentage of Monte Carlo replications yielding exclusively positive semi-definite spot covariance matrix estimates. Opt* corresponds to inputs, which are optimal with respect to RMIFB. Full Covariance Matrix Opt θh θJ θK RMIFB % PSD 0.150 0.150 0.150 0.150 0.150 0.025 0.250 6.000 1.000 10.000 6.000 6.000 6.000 6.000 2.000 2.000 2.000 1.200 4.800 2.000 2.000 24.410 35.627 24.444 24.910 26.835 47.043 25.331 78.300 99.900 77.300 86.400 57.600 0.000 98.500 Covariances Opt Opt* θh θJ θK RMISEc 0.100 0.150 7.000 6.000 2.400 2.000 22.944 23.050 Variances Opt Opt* θh θJ θK RMISEv 0.150 0.150 2.000 6.000 1.200 2.000 17.720 22.846 Finally, to examine how often the estimator (12) yields non-positive semi-definite estimates, we compute the percentage of replications in which all spot covariance matrix estimates are positive semi-definite. Panels A, B and C of Table 1 report the values of the input parameters minimizing MIFB, MISEc and MISEv , respectively, for M = 3000 along with the square roots of the latter distance measures. Panel A additionally provides the performance implied by more “extreme” choices of the input parameters and the percentage of positive semi-definite estimates. Panels B and C also report MISEc and MISEv based on the optimal parameter values with respect to MIFB. The MIFB-optimal values of the input parameters yield a configuration with (on average) dh−1 n e = 80 blocks spanning about 5 minutes each, a spectral cut-off Jn = 19 and a smoothing window of Kn = 6 blocks. Regarding deviations from the MIFB-optimal values of the input parameters, considerable precision losses occur in only two cases. First, when setting θh extremely low, resulting in more than 480 blocks per day on average. Second, for a very small choice of θJ , as spectral frequencies are cut off too early. In particular, we observe that the two-step method (12) clearly outperforms a simple histogram-type estimator, which relies only on the first frequency Jn = 1. We can conclude that the performance of the (full) spot covariance matrix estimator is quite robust for a range of sensible input choices. 20 When focusing on covariance estimates only, MISEc -optimal values of the input parameters would mainly imply an increase in the average number of blocks to around 120 per day and a corresponding lengthening of the smoothing window to 7 blocks, while precision remains very close to the one implied by MIFB-optimal inputs. For the variances, the spectral cutoff would reduce to around 6, while the smoothing window would shorten to around 4 blocks. The MIFB-optimal values imply a non-negligible increase in MISEv . Table 1 further shows that employing MIFB-optimal values of the input parameters yields positive semi-definite spot covariance matrix estimates in around 78% of the cases, while increasing the spectral cutoff or reducing the block length leads to more cases with non-positive semi-definite outcomes. Simulation results based on a LMM estimator with a truncation of negative eigenvalues at zero, confirming an improved finite-sample performance, and for a setting with volatility (co-)jumps can be found in the web appendix. 5 5.1 Empirical Study Implementation We apply the estimators presented in Section 3 to our dataset described in Section 2. In order to obtain spot covariance matrix estimates for the entire trading day including the period immediately after the start of trading, we initially consider the two-sided version of the estimator (12). We then use the mid-quote revisions for the Nasdaq 100 constituents to estimate 30 × 30 spot covariance matrices, yielding pair-wise spot covariances and correlations, as well as individual volatilities. We select the relevant inputs as discussed in Section 3.4. The corresponding proportionality parameters are set to the values found to be “optimal” in the extended simulation study given in Section 2.2 of the web appendix. Hence, we set θh = 0.175, θJ = 7, θK = 2 and Jnp = 5. Section 4 of the web appendix reports summary statistics for the number of blocks, the spectral cut-off and the length of the smoothing window as induced by the underlying data for both the entire sample and each year. On average, we use approximately 27 blocks per day, resulting in an average block length of 14 minutes. Spectral frequencies are cut off at nearly 48, while the average length of the smoothing window is about 6 blocks, translating into roughly 80 minutes. 5.2 Intraday Behavior of Spot (Co-)Variances As a first step, we investigate the presence of seasonality effects in spot (co-)volatilities. Seasonal patterns in intraday volatilities have been confirmed, e.g., in the seminal studies by Andersen 21 and Bollerslev (1997, 1998). For equity returns, volatilities typically exhibit a U-shape, i.e., volatility is higher at the opening and before the closure of the market, while being lower around midday. Similar effects have been documented for other measures of intraday trading activity such as bid-ask spreads (e.g. Chan et al., 1995), durations between trade and quote arrivals (e.g. Engle and Russell, 1998) and transaction volumes (e.g. Brownlees et al., 2011). Figure 6 shows the cross-sectional deciles of across-day averages of spot covariances and correlations for each asset pair as well as volatilities for each asset. The averages were computed while omitting the “unusual” days analyzed in Section 5.3 as well as days with scheduled announcements of the federal funds rate target by the Federal Open Market Committee (FOMC). A more detailed discussion of the latter can be found below. We observe distinct intraday seasonality patterns, which, interestingly, do not only apply to volatilities. Rather, covariances clearly decline at the beginning of the trading day, stabilize around noon on a widely constant level and slightly increase before market closure. Interestingly, the resulting correlations show a reverse pattern and significantly increase during the first trading hour. The latter is caused by spot volatilities that decay faster than the corresponding covariances at the beginning of the trading day. Hence, the (co-)variability between assets is highest after start of trading which might be caused by the processing of common information analogously to the higher overall inflow of public and private information during that period (see, e.g., Hasbrouck, 1991; Madhavan et al., 1997). The latter effect, however, appears to imply an even more pronounced increase in assets’ idiosyncratic risk as reflected by spot volatilities, overcompensating higher covariances and leading to lower correlations at the beginning of the trading day. Interestingly, spot volatilities drop significantly faster than underlying covariances during the first trading hour. Shortly after opening, spot volatilities are approximately twice as high as the (average) daily volatility (computed based on the open-to-close integrated variance estimate), but strongly decline thereafter. This makes correlations sharply increasing between 10:00 and 11:00 am. Accordingly, we observe that median spot correlations range between approximately 0.2 and 0.4 across a day. This is in contrast to a daily correlation (computed from the open-to-close integrated covariance estimate) of approximately 0.3 and shows that even on average, intraday variability of correlations and covariances is substantial. Finally, we repeat the above analysis on a year-by-year basis. The results reported in Section 5 of the web appendix show that the intraday patterns mainly change in terms of level shifts over the years. We can summarize the findings above as follows. First, spot covariances exhibit an intraday seasonality pattern closely resembling the U-shape which is typical for volatilities. Second, the combined diurnal patterns of spot covariances and volatilities imply that spot correlations tend to increase throughout the trading day. 22 0.6 Avg. Correlation Deciles Avg. Covariance Deciles 0.07 0.0525 0.035 0.0175 0.45 0.3 0.15 0 0 10:00 11:00 12:00 13:00 14:00 10:00 15:00 11:00 12:00 13:00 14:00 15:00 Time of Day Time of Day (a) Covariances (b) Correlations Avg. Volatility Deciles 0.7 0.525 0.35 0.175 0 10:00 11:00 12:00 13:00 14:00 15:00 Time of Day (c) Volatilities Figure 6: Cross-sectional deciles of across-day averages of spot covariances, correlations and volatilities. Spot estimates are first averaged across days for each asset pair. Subsequently, cross-sectional sample deciles of the across-day averages are computed. The solid horizontal line corresponds to the crosssectional median of the across-day averages of integrated covariance, correlation and volatility estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. “Unusual days” discussed in Section 5.3 as well as days with scheduled FOMC announcements are removed. Covariances and volatilities are annualized. 23 0.3 Standard Deviation Deciles Standard Deviation Deciles 0.08 0.06 0.04 0.02 0.225 0.15 0.075 0 0 10:00 11:00 12:00 13:00 14:00 15:00 10:00 Time of Day 11:00 12:00 13:00 14:00 15:00 Time of Day (a) Covariances (b) Correlations Standard Deviation Deciles 0.3 0.225 0.15 0.075 0 10:00 11:00 12:00 13:00 14:00 15:00 Time of Day (c) Volatilities Figure 7: Cross-sectional deciles of across-day standard deviations of spot covariances, correlations and volatilities. First, sample standard deviations of spot estimates are computed across days for each asset pair. Subsequently, cross-sectional sample deciles of the across-day standard deviations are computed. “Unusual days” discussed in Section 5.3 as well as days with scheduled FOMC announcements are removed. Covariances and volatilities are annualized. In Figure 7, we additionally compute, for each asset pair or asset and each point during the day, the standard deviation of spot covariances, correlations and volatilities across days. We observe that the across-day variability in covariances is highest after market opening and shortly before closure. A similar picture is also observed for spot volatilities. We associate the patterns described above with effects arising from (overnight) information processed in the morning and increased trading activities in the afternoon, where traders tend to re-balance or close positions before the end of trading. Hence, idiosyncratic effects seem to become stronger during these periods, increasing the variability of (co-)variances. Interestingly, the across-day standard deviations in correlations show a reverse pattern. Thus, across-day variability in intraday correlations is lowest at the beginning of trading, increases until mid-day and is widely constant during the afternoon hours. Here, increased across-day covariance and volatility risk seem to compensate each other. 24 0.7 Avg. Correlation Deciles Avg. Covariance Deciles 0.09 0.0675 0.045 0.0225 0.525 0.35 0.175 0 0 10:00 11:00 12:00 13:00 14:00 15:00 10:00 Time of Day 11:00 12:00 13:00 14:00 15:00 Time of Day (a) Covariances (b) Correlations Avg. Volatility Deciles 0.7 0.525 0.35 0.175 0 10:00 11:00 12:00 13:00 14:00 15:00 Time of Day (c) Volatilities Figure 8: Cross-sectional deciles of across-day averages of spot covariances, correlations and volatilities on days with scheduled FOMC announcements. Spot estimates are first averaged across days for each asset pair. Subsequently, cross-sectional sample deciles of the across-day averages are computed. The solid horizontal line corresponds to the cross-sectional median of the across-day averages of integrated covariance, correlation and volatility estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. Covariances and volatilities are annualized. It is well-known that equity returns respond to macroeconomic announcements both in terms of conditional means and volatilities (see, e.g., Andersen et al., 2007; Lunde and Zebedee, 2009). Accordingly, we compute the across-day averages analyzed above excluding days with major scheduled macroeconomic news announcements that regularly fall well within Nasdaq trading hours. For that purpose, we focuse on scheduled FOMC announcements, occurring at 2:15 pm roughly every six weeks. For comparison, Figure 8 reports the counterpart of Figure 6 based on FOMC announcement days only. Interestingly, we observe that around 1 pm, i.e. roughly one hour before the scheduled announcement, spot covariances exhibit a pronounced increase, while the rise in volatilities remains comparably modest. As a consequence, spot correlations simultaneously increase by a considerable extent. 25 5.3 Two Unusual Days The previous section shows that spot correlations and covariances can substantially vary during a day, even if these patterns are averaged across time and assets. Here, we aim at analyzing the behavior of spot (co-)variability and the estimator (12) in unusual market periods. To prevent artifacts caused by “forward-looking” smoothing, we employ the one-sided version of the estimator. Further, we ensure a completely adaptive behavior of the latter by also estimating the long-run noise variance according to the method presented in the web appendix and determining the inputs following Section 3.4 only based on observations available up to the point of estimation. The first study analyses the flash crash on May 6, 2010, see, e.g. Kirilenko et al. (2017). Figure 9 shows the cross-sectional deciles of spot covariances, correlations and volatilities on this day. We observe that correlations are virtually constant during the morning, but increase slowly shortly after 2:00 pm, and, subsequently, decrease quickly around 2:45 pm when prices began to return to their pre-crash levels. The latter is accompanied by an underlying pronounced increase in covariances, while the deciles show that the cross-sectional distribution of covariances across all asset pairs is extremely skewed, revealing huge upward shifts in some covariances, but only very moderate reactions in others. Figure 9 also demonstrates that the corresponding reactions in spot volatilities have been much stronger, which explains the drop in median correlations from approx. 0.5 before 2:45 pm to approx. 0.3 right after 3:00 pm. For comparison, Figure 10 displays the spot covariance, correlation and volatility estimates along with the corresponding approximate 95% confidence intervals for AAPL and AMZN, which are the most liquid assets as measured by the number of mid-quote revisions. Most importantly, we observe that these particular spot covariance, correlation and volatility paths are in line with the patterns found in Figure 9. Accordingly, the latter are not an artifact of the cross-sectional aggregation across assets or asset pairs. Second, we analyze an event, which is characterized by completely non-anticipated (and ultimately wrong) news. On 04/23/13 at around 1:07 pm, a fake tweet from the account of the Associated Press (AP) reported “breaking” news on two explosions in the White House, where the U.S. president (supposedly) got injured. At 1:10 pm, AP officially denied this message and suspended its twitter account at 1:14 pm. Figure 11 shows the underlying price process and the timing of the corresponding events. Our results in Figure 12 show that (co-)variances and correlations strongly increase immediately after 1:07 pm. The increase in covariances is stronger than for volatilities, whereby correlations (median) increase from approximately 0.2 to 0.7. The estimates suggest that the effect of elevated (co-)variances and correlations has been present for about two hours. As in the case of the May 2010 flash crash, this result is widely confirmed by 26 1 0.9 0.675 Correlation Deciles Covariance Deciles 0.75 0.5 0.25 0 11:00 0.45 0.225 12:00 13:00 14:00 0 11:00 15:00 Time of Day 12:00 13:00 14:00 15:00 Time of Day (a) Covariances (b) Correlations 2.25 Volatility Deciles 1.6875 1.125 0.5625 0 11:00 12:00 13:00 14:00 15:00 Time of Day (c) Volatilities Figure 9: Cross-sectional deciles of spot covariances, correlations and volatilities (05/06/10). Solid horizontal line corresponds to the cross-sectional median of integrated covariance, correlation and volatility estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. Covariances and volatilities are annualized. 27 0.6 0.9 0.3 0.45 0.15 0 11:00 1.875 0.225 12:00 13:00 14:00 15:00 Spot Volatility 0.675 Covariance Correlation 0.45 2.5 1.25 0.625 0 16:00 0 11:00 Time of Day 12:00 13:00 14:00 15:00 16:00 Time of Day (a) Covariances/Correlations (b) Volatilities Figure 10: Spot covariances, correlations and volatilities for AAPL and AMZN (05/06/10). In left plot, black lines (and left y-axis) represent correlations, grey lines (and right y-axis) covariances. In right plot, black lines are for AMZN, grey lines for AAPL. The dashed lines correspond to approximate pointwise 95% confidence intervals according to Corollary 1. The horizontal lines correspond to the cross-sectional median of integrated covariance, correlation and volatility estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. Covariances and volatilities are annualized. the estimated paths for the specific asset pair of AAPL and AMZN displayed in Figure 13. The above findings are remarkable given that the flash crash itself lasted only a couple of minutes and is similar to the effects observed during the May 2010 flash crash. Hence, effects of (flash) crashes on covariances may remain in the market for a considerable time period. In summary, we conclude on the following findings: First, flash crash-type events cause abrupt upward movements in (co-)variances and correlations. Second, with prices ultimately returning to pre-shock levels, correlations move back, while the behavior of covariances and volatilities is more ambiguous. Depending on the nature of the market recovery process, they can both either decrease or increase. In the latter case, the rise in volatilities is more pronounced, leading to reduced correlations. Our spot estimator seems to capture these effects quite well, since the observed reactions in the spot quantities are aligned with the timing of the underlying event. This indicates that the estimators are suitable to capture changes in dependence structures on a high time resolution. 28 (a) Entire trading day (b) 1:00 pm – 1:30 pm Figure 11: QQQ transaction prices (04/23/13). (1): Fake tweet from the account of AP stating “Breaking: Two Explosions in the White House and Barack Obama is injured”. (2): Official denial by AP. (3): AP’s twitter account suspended. 1 0.12 0.7 Correlation Deciles Covariance Deciles 0.085 0.05 0.1 0.015 -0.02 11:00 0.4 12:00 13:00 14:00 -0.2 11:00 15:00 12:00 13:00 14:00 15:00 Time of Day Time of Day (a) Covariances (b) Correlations 0.45 Volatility Deciles 0.3375 0.225 0.1125 0 11:00 12:00 13:00 14:00 15:00 Time of Day (c) Volatilities Figure 12: Cross-sectional deciles of spot covariances, correlations and volatilities (04/23/13). The solid horizontal line corresponds to the cross-sectional median of integrated covariance, correlation and volatility estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. Covariances and volatilities are annualized. 29 0.04 0.475 0.0288 0.25 0.0175 0.025 0.0062 -0.2 11:00 12:00 13:00 14:00 15:00 0.3 0.2375 Spot Volatility Correlation 0.7 0.175 0.1125 -0.005 16:00 0.05 11:00 Time of Day 12:00 13:00 14:00 15:00 16:00 Time of Day (a) Covariances/Correlations (b) Volatilities Figure 13: Spot covariances, correlations and volatilities for AAPL and AMZN (04/23/13). In the left plot, black lines (and left y-axis) represent correlations, grey lines (and right y-axis) covariances. In the right plot, black lines are for AMZN, grey lines for AAPL. The dashed lines correspond to approximate pointwise 95% confidence intervals according to Corollary 1. The horizontal lines correspond to the cross-sectional median of integrated covariance, correlation and volatility estimates. These are based on the LMM estimator of the integrated (open-to-close) covariance matrix by Bibinger et al. (2014) accounting for serially dependent noise and using the same input parameter configuration as the spot estimators. Covariances and volatilities are annualized. 30 6 Conclusions In this paper, we introduce an estimator for spot covariance matrices, which is constructed based on local averages of block-wise estimates of locally constant covariances. The proposed estimator builds on the local method of moments approach introduced by Bibinger et al. (2014). We show how to extend the LMM approach to the case of autocorrelations as well as endogeneities in market microstructure noise and provide a suitable procedure for choosing the lag order in practice. For the resulting spot covariance matrix estimator, we derive a stable central limit theorem along with a feasible version that is straightforwardly applicable in empirical practice. An important result is that we are able to attain the optimal convergence rate, which is n1/8 under the assumption of a semi-martingale volatility matrix process with the efficient log-prices being subject to noise and a non-synchronous observation scheme. Simulation exercises provide guidance on how to implement the estimator in practice and demonstrate its relative insensitivity with respect to the choice of block sizes, cut-offs and smoothing windows. Moreover, based on Nasdaq blue chip stocks, we provide detailed empirical evidence on the intraday behavior of spot covariances, correlations and volatilities. In particular, we show that not only spot volatilities as previously documented in the literature, but also covariances and correlations reveal distinct intraday seasonality patterns. Further, we analyze how spot covariances change in periods of extreme market movements and show that intraday changes of (co-)volatility structures can be quite distinct and considerable. Acknowledgment and Web appendix In the web appendix, we provide the proofs, extended simulations and more detailed empirical results. Moreover, we provide commented code for the implementation of the methods. We are grateful to the editor, an associate editor and two referees for helpful comments on a previous version. References Abadir, K.M. and Magnus, J.R., 2005. Matrix algebra, Econometric Exercises, vol. 1, Cambridge: Cambridge University Press. Ait-Sahalia, Y., Fan, J., and Xiu, D., 2010. High-frequency estimates with noisy and asynchronous financial data, Journal of the American Statistical Association, 105 (492), 1504– 1516. 31 Ait-Sahalia, Y. and Jacod, J., 2009. Testing for jumps in a discretely observed process, Annals of Statistics, 37 (1), 184–222. Ait-Sahalia, Y. and Xiu, D., 2015. Principal component analysis of high-frequency data, Tech. rep., Princeton University and the University of Chicago. Ait-Sahalia, Y., Zhang, L., and Mykland, P.A., 2011. Ultra high frequency volatility estimation with dependent microstructure noise, Journal of Econometrics, 160, 160–165. Altmeyer, R. and Bibinger, M., 2015. Functional stable limit theorems for quasi-efficient spectral covolatility estimators, Stochastic Processes and their Applications, 125 (12), 4556–4600. Andersen, T.G. and Bollerslev, T., 1997. Intraday periodicity and volatility persistence in financial markets, Journal of Empirical Finance, 4 (2-3), 115–158. Andersen, T.G. and Bollerslev, T., 1998. Deutsche mark-dollar volatility: Intraday activity patterns, macroeconomic announcements, and longer run dependencies, Journal of Finance, 53 (1), 219–265. Andersen, T.G., Bollerslev, T., Diebold, F.X., and Labys, P., 2003. Modeling and forecasting realized volatility, Econometrica, 71 (2), 579–625. Andersen, T.G., Bollerslev, T., Diebold, F.X., and Vega, C., 2007. Real-time price discovery in global stock, bond and foreign exchange markets, Journal of International Economics, 73, 251–277. Andersen, T.G., Cebiroglu, G., and Hautsch, N., 2017. Volatility, information feedback and market microstructure noise: A tale of two regimes, Tech. Rep. 516, CFS Working Paper. Andersen, T.G., Dobrev, D., and Schaumburg, E., 2009. Duration-based volatility estimation, Global COE Hi-Stat Discussion Paper Series gd08-034, Institute of Economic Research, Hitotsubashi University. Bandi, F.M. and Reno, R., 2009. Nonparametric stochastic volatility, Global COE Hi-Stat Discussion Paper Series gd08-035, Institute of Economic Research, Hitotsubashi University. Barndorff-Nielsen, O.E., Hansen, P.R., Lunde, A., and Shephard, N., 2011. Multivariate realised kernels: consistent positive semi-definite estimators of the covariation of equity prices with noise and non-synchronous trading, Journal of Econometrics, 162 (2), 149–169. Barndorff-Nielsen, O.E. and Shephard, N., 2004. Econometric analysis of realized covariation: High frequency based covariance, regression, and correlation in financial economics, Econometrica, 72 (3), 885–925. 32 Bibinger, M., Hautsch, N., Malec, P., and Reiß, M., 2014. Estimating the quadratic covariation matrix from noisy observations: Local method of moments and efficiency, Annals of Statistics, 42 (4), 1312–1346. Bibinger, M. and Reiß, M., 2014. Spectral estimation of covolatility from noisy observations using local weights, Scandinavian Journal of Statistics, 41 (1), 23–50. Bibinger, M. and Winkelmann, L., 2015. Econometrics of co-jumps in high-frequency data with noise, Journal of Econometrics, 184 (2), 361 – 378. Bos, C.S., Janus, P., and Koopman, S.J., 2012. Spot variance path estimation and its application to high-frequency jump testing, Journal of Financial Econometrics, 10 (2), 354–389. Brownlees, C.T., Cipollini, F., and Gallo, G.M., 2011. Intra-daily volume modeling and prediction for algorithmic trading, Journal of Financial Econometrics, 9 (3), 489–518. Chan, K.C., Christie, W.G., and Schultz, P.H., 1995. Market structure and the intraday pattern of bid-ask spreads for nasdaq securities, Journal of Business, 68, 35–60. Christensen, K., Oomen, R.C., and Podolskij, M., 2014. Fact or friction: Jumps at ultra high frequency, Journal of Financial Economics, 114 (3), 576 – 599. Christensen, K., Podolskij, M., and Vetter, M., 2013. On covariation estimation for multivariate continuous itô semimartingales with noise in non-synchronous observation schemes., Journal of Multivariate Analysis, 120, 59–84. Curci, G. and Corsi, F., 2012. Discrete sine transform for multi-scales realized volatility measures, Quantitative Finance, 12 (2), 263–279. Engle, R.F. and Russell, J.R., 1998. Autoregressive conditional duration: A new model for irregularly spaced transaction data, Econometrica, 66 (5), 1127–1162. Fan, J. and Wang, Y., 2008. Spot volatility estimation for high-frequency data, Statistics and Its Interface, 1, 279–288. Foster, D.P. and Nelson, D.B., 1996. Continuous record asymptotics for rolling sample variance estimators, Econometrica, 64 (1), 139–174. Gallant, A.R., 1981. On the bias in flexible functional forms and an essentially unbiased form : The fourier flexible form, Journal of Econometrics, 15 (2), 211–245. Hansen, P.R., Large, J., and Lunde, A., 2008. Moving average-based estimators of integrated variance, Econometric Reviews, 27 (1-3), 79–111. 33 Hansen, P.R. and Lunde, A., 2006. Realized variance and market microstructure noise, Journal of Business & Economic Statistics, 24 (2), 127–161. Hasbrouck, J., 1991. Measuring the information content of stock trades, The Journal of Finance, 46 (1), 179–207. Hautsch, N. and Podolskij, M., 2013. Preaveraging-based estimation of quadratic variation in the presence of noise and jumps: Theory, implementation, and empirical evidence, Journal of Business & Economic Statistics, 31 (2), 165–183. Hayashi, T. and Yoshida, N., 2011. Nonsynchronous covariation process and limit theorems, Stochastic Processes and their Applications, 121, 2416–2454. Hoffmann, M., Munk, A., and Schmidt-Hieber, J., 2012. Adaptive wavelet estimation of the diffusion coefficient under additive error measurements, Ann. Inst. H. Poincaré Probab. Statist., 48 (4), 1186–1216. Huang, R. and Polak, T., 2011. Lobster: Limit order book reconstruction system, Technical report, Humboldt-Universität zu Berlin. Jacod, J., Li, Y., Mykland, P.A., Podolskij, M., and Vetter, M., 2009. Microstructure noise in the continous case: the pre-averaging approach, Stochastic Processes and their Applications, 119, 2803–2831. Jacod, J. and Rosenbaum, M., 2013. Quarticity and other functionals of volatility: Efficient estimation, Annals of Statistics, 41, 1462–1484. Jacod, J. and Todorov, V., 2010. Do price and volatility jump together?, Annals of Applied Probability, 20 (4), 1425–1469. Kalnina, I. and Xiu, D., 2017. Nonparametric estimation of the leverage effect: A trade-off between robustness and efficiency, Journal of the American Statistical Association, 112 (517), 384–396. Kirilenko, A.A., Kyle, A.S., Samadi, M., and Tuzun, T., 2017. The flash crash: High frequency trading in an electronic market, Journal of Finance, 72, 967–998. Koike, Y., 2016. Quadratic covariation estimation of an irregularly observed semimartingale with jumps and noise, Bernoulli, 22 (3), 1894–1936. Kristensen, D., 2010. Nonparametric filtering of the realized spot volatility: a kernel-based approach, Econometric Theory, 26 (1), 60–93. 34 Li, J. and Xiu, D., 2016. Generalized method of integrated moments for high-frequency data, Econometrica, 84, 1613–1633. Li, Y., Mykland, P.A., Renault, E., Zhang, L., and Zheng, X., 2014. Realized volatility when sampling times are possibly endogenous, Econometric Theory, 30, 580–605. Lunde, A. and Zebedee, A.A., 2009. Intraday volatility responses to monetary policy events, Financial Markets and Portfolio Management, 23, 383–399. Madhavan, A., Richardson, M., and Roomans, M., 1997. Why do security prices change? a transaction-level analysis of nyse stocks, Review of Financial Studies, 10 (4), 1035–1064. Mancini, C., Mattiussi, V., and Reno, R., 2015. Spot volatility estimation using delta sequences, Finance and Stochastics, 19 (2), 261–293. Munk, A. and Schmidt-Hieber, J., 2010a. Lower bounds for volatility estimation in microstructure noise models, in: J.O. Berger, T.T. Cai, and I.M. Johnstone, eds., Borrowing Strength: Theory Powering Applications – A Festschrift for Lawrence D. Brown, Beachwood, Ohio, USA: Institute of Mathematical Statistics, Collections, vol. 6, 43–55. Munk, A. and Schmidt-Hieber, J., 2010b. Nonparametric estimation of the volatility function in a high-frequency model corrupted by noise, Electronic Journal of Statistics, 4, 781–821. Mykland, P.A. and Zhang, L., 2008. Inference for volatility-type objects and implications for hedging, Statistics and Its Interface, 1, 255–278. Reiß, M., 2011. Asymptotic equivalence for inference on the volatility from noisy observations, Annals of Statistics, 39 (2), 772–802. Varneskov, R., 2016. Flat-top realized kernel estimation of quadratic covariation with nonsynchronous and noisy asset prices, Journal of Business and Economic Statistics, 34, 1–22. Zhang, L., 2011. Estimating covariation: Epps effect and microstructure noise, Journal of Econometrics, 160, 33–47. Zhang, L., Mykland, P.A., and Ait-Sahalia, Y., 2005. A tale of two time scales: Determining integrated volatility with noisy high-frequency data, Journal of the American Statistical Association, 100 (472), 1394–1411. Zu, Y. and Boswijk, H.P., 2014. Estimating spot volatility with high-frequency financial data, Journal of Econometrics, 181 (2), 117 – 135. 35
10math.ST
Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels Alexey Romanov 1 Anna Rumshisky 1 arXiv:1705.00574v1 [cs.LG] 1 May 2017 Abstract Learning a better representation with neural networks is a challenging problem, which was tackled extensively from different prospectives in the past few years. In this work, we focus on learning a representation that could be used for a clustering task and introduce two novel loss components that substantially improve the quality of produced clusters, are simple to apply to an arbitrary model and cost function, and do not require a complicated training procedure. We evaluate them on two most common types of models, Recurrent Neural Networks and Convolutional Neural Networks, showing that the approach we propose consistently improves the quality of KMeans clustering in terms of Adjusted Mutual Information score and outperforms previously proposed methods. 1. Introduction In the past few years, a substantial amount of work has been dedicated to learning a better representation of the input data that can be either used in downstream tasks, such as KMeans clustering, or to improve generalizability or perfromance of the model. In general, these works can be divided into two categories: (1) approaches that require a complicated training procedure; (2) approaches that introduce a new loss component that can be easily applied to an arbitrary cost function; For example, approaches by Liao et al. (2016) and Xie et al. (2016) can be assigned to the first category, as they propose to iteratively refine the clusters during the training. In contrast, approaches by Cogswell et al. (2015) and Cheung et al. Cheung et al. (2014) introduce new loss compo1 Department of Computer Science, University of Massachusetts Lowell, Lowell, Massachusetts, USA. Correspondence to: Alexey Romanov <[email protected]>. nents that can be added to the cost function while training the model with a standard gradient descent algorithm. Our work belongs to the second category and focuses on a challenging problem of learning disentangled representations while having access to labels that do not fully reflect the underlying partitioning of the data, but still separate it into distinguishable groups. For example, consider a case of predicting in-hospital mortality using multivariate physiological time series. This is a binary classification problem which can be solved using an Recurrent Neural Network model such as the one depicted on Figure 1. During a regular training procedure with a sigmoid cross-entropy loss, the model tends to learn the weights that lead to a strong activation of one of the neurons in the penultimate layer (FC1 ) for the instances that belong to the positive class and a strong activation of another neuron for the instances that belong to the negative class, whereas all other neurons tend to be not active for both classes (see the Figure 2a). However, we would like to separate patients into more than two groups by applying a clustering algorithm to the learned representations of the patients. Thus, we would need the model to learn a disentangled representation that can not only differentiate between the patients with different outcomes, but also between the patients with the same outcome using latent characteristics of the time series (see the Figure 2b). Output size: 128 RNN Multivariate time series Output size: 1 FC1 Output size: 15 FC2 Classification decision Figure 1. An RNN model with two fully-connected layers for binary classification of time series In order to force the network to learn such disentangled representations, we propose two novel loss components that can be applied to an arbitrary cost function. Although it can be used in any type of model, including autoencoders, this paper focuses on a task of learning disentangled representations during the binary classification problem. Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels (a) Without the proposed loss component (b) With the proposed loss component Lsingle Figure 2. Number of samples for which the neurons on the y axis were active the most in a binary classification task on MNIST strokes sequences dataset. The classes 0-4 have the label 0, and the classes 5-9 have the label 1. See the subsection 4.1 for details. 2. Related Work In the past few years we witnessed an astonishing success of neural networks. Starting with ILSVRC in 2012 (Russakovsky et al., 2015), where a deep convolutional neural network model won the challenge with a shocking gap (Krizhevsky et al., 2012), neural networks has achieved remarkable success in nearly every classification task. For a long time, it was unclear why deep neural networks, and convolutional neural networks (CNN) in particular, work so well and what is happening inside this “black box”, until the work of Zeiler & Fergus (2014), which showed that it is possible to visualize which features and representations specifically a network learns during the training, which answered this question for CNNs, but not for Recurrent Neural Networks (RNN). More recently, there have been a few works that sought to perform a similar analysis to RNNs. In particular, the work of Karpathy et al. (2015) showed what is happening inside an RNN cell during the inference and the areas of responsibility of neurons inside the cell. After that, Li et al. (2016) plotted the representations learned by an RNN trained on a task of sentiment classification and showed that the network is able to learn local compositionality, embedding the negated expressions (such as “not good”, “not nice”) into the space near words with a negative polarity (such as “bad”). More relevant to the goal of this paper, Cheung et al. (2014) proposed a cross-covariance penalty (XCov) to force the network to produce representations with disentangled factors. The proposed penalty is, essentially, cross-covariance between the predicted labels and the activations of samples in a batch. Their experiments showed that the network can produce a representation, with components that are responsible to different characteristics of the input data. For example, in case of the MNIST dataset, there was a classinvariant factor that was responsible for the style of the digit, and in case of the Toronto Faces Dataset (Susskind et al., 2010), there was a factor responsible for the subject’s identity. Similarly, but with a different goal in mind, Cogswell et al. (2015) proposed a new regularizer (DeCov) which minimizes cross-covariance of hidden activations, leading to non-redundant representations and, consequently, less overfitting and better generalization. DeCov loss is trying to minimize the Frobenius norm of the covariance matrix between all pairs of activations in the given layer. The authors’ experiments showed that the proposed loss significantly reduced overfitting and led to a better classification performance on a variety of datasets. While the aforementioned approaches do not require a complicated training procedure, there were also works that proposed more convoluted algorithms in order to obtain better representations that could be used in downstream tasks, such as clusterization. Liao et al. (2016) proposed a method to learn parsimonious representations. Essentially, the proposed algorithm iteratively calculates cluster centroids, which are updated every M iterations and used in the cost function. The authors’ experiments showed that such algorithm leads to a better generalization and a higher test performance of the model in case of supervised learning, as well as unsupervised and even zero-shot learning. Similarly, Xie et al. (2016) proposed an iterative algorithm that first calculates soft cluster assignments, then updates the weights of the network and cluster centroids. This process is repeated until convergence. In contrast to Liao et al. Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels (a) Without the proposed loss component (b) With the proposed loss component Lmulti Figure 3. Number of samples for which the neurons on the y axis were active the most in a binary classification task on the CIFAR-10 dataset. See the subsection 4.2 for details. (2016), the authors specifically focused on the task of learning better representations for clustering, and showed that the proposed algorithm gives a significant improvement in clustering accuracy. In contrast to the last two methods, our proposed loss components do not require such complicated training procedures and can be conveniently used in any cost function in a straightforward manner. 3. The proposed method Inspired by the work of Cheung et al. (2014) and Cogswell et al. (2015), we propose two novel loss components which despite their simplicity, significantly improve the quality of the clustering over the representation produced by the model. The first loss component Lsingle works on a single layer and does not affect the other layers in the network, which may be a desirable behaviour in some cases. The second loss component Lmulti affects the entire network behind the target layer and forces it to produce disentangled representations in more complex and deep networks in which the first loss may not give the desired improvements. 3.1. Single layer loss Consider the model on the Figure 1. The layer FC2 has the output size of 1 and produces a binary classification decision. The output of the layer FC1 is used to perform KMeans clustering. Recall from the example in the introduction that we want to force the model to produce divergent representations for the samples that belong to the same class, but are in fact substantively different from each other. One way to do it would be to force the rows of the weight matrix WFC1 of the FC1 layer be different from each other, leading to different patterns of activations in the output of the FC1 layer. Formally, it can be expressed as follows: Lsingle = k k X X fl (di , dj ) + fl (dj , di ) (1) i=1 j=i+1 where dk are normalized weights of the row k of the weights matrix W of the given layer: dk = softmax(W [k]) (2) and fl (di , dj ) is a component of the loss between the rows i and j: fl (xi , xj ) = max(0, m − DKL (xi ||xj )) (3) where m is a hyperparameter that defines the desired margin of the loss component and DKL (di ||dj ) is the KullbackLeibler divergence between the probability distributions di and dj . 3.2. Multilayer loss Note that the loss component Lsingle affects only the weights of the specific layer, as it operates not on the outputs of the layer but directly on its weights, similar to, for example, `2 regularization. Therefore, this loss component may help to learn a better representation only if the input to the target layer still contains the information about latent characteristics of the input data. This might be the case in simple shallow networks, but in case of very deep complex networks the input data is non-linearly transformed so many times that only the information that is needed for binary classification left, and all the remaining latent characteristics of the input data were lost as not important for binary classification (see the Figure 3a). Indeed, as we can see from the experiments in Section 4, the loss component Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels conv1 conv2 CNNs Pool 3x3 convolutions 256 filters conv3 CNNs Pool CNNs Pool 1x1 convolutions 8 filters CNN1 CNN2 Output size: 1 CNN3 FC1 FC2 Classification decision CIFAR-10 pictures pool1 pool2 3x3 convolutions 128 filters pool3 Output size: 15 VGG-16 layers Figure 4. A CNN model used in the CIFAR-10 experiments described above substantially improves the quality of the clustering in a simple baseline case. However, in case of a more complex model, this improvement is much less impressive. Therefore, we are also proposing a loss component that can influence not only one specific layer, but all layers before it, in order to force the network to produce a better representation. For example, as autoencoder models is a common choice to learn representations to use in a downstream task, the proposed loss components can be easily applied to its cost function as follows: Recall again that we want to force the model to produce disentangled representations of the input data. Namely, that these representations should be sufficiently different from each other even if two samples have the same label. We propose the following loss component in order to produce such properties: ( N N 1 X X fl (hsi , hsj ) + fl (hsj , hsi ) yi = yj Lmulti = 2 Ns i=1 j=1 0 yi 6= yj (4) where hsk is a normalized output of the target layer h for the sample k: hsk = softmax(hk ) (5) where the first part is a standard reconstruction cost for autoencoder, the second is the proposed loss component, and α is a hyperparameter reflecting how much importance is given to it. yk is its the ground truth label, N is the number of samples in the batch, Ns is number of samples that have the same label, and fl (hi , hj ) is the function defined in Equation 3. Note that this loss component Lmulti works on the outputs of the target layer, and therefore, it affects the whole network behind the layer on which it is applied, overcoming the local properties of the Lsingle loss. 3.3. Unsupervised learning Although our main focus in the presented experiments is on a binary classification task, both of our proposed loss components can be used in unsupervised learning as well. The loss component Lsingle does not require any labels so it can be used without modifications. The loss component Lmulti can be applied to unlabeled data by just taking the summations without consideration of labels of the samples as follows: Lmulti2 = N N 1 XX fl (hsi , hsj ) + fl (hsj , hsi ) N 2 i=1 j=1 (6) Lae = (1 − α) ∗ N 1 X ||Xi − X̂i ||2 + α ∗ Lmulti N i=1 (7) Table 1. Adjusted Mutual Information (AMI) and Normalized Mutual Information (NMI) scores for the MNIST strokes sequences experiments M ODEL AMI NMI BASELINE BASELINE + DeCov BASELINE + XCov BASELINE + LSINGLE BASELINE + LMULTI 0.467 0.287 0.525 0.544 0.502 0.477 0.313 0.547 0.553 0.523 3.4. Hyperparameter m One important choice to be made while using the proposed loss components is the value of the hyperparameter m. A larger value of m corresponds to a larger margin between the rows of the weights matrix in case of Lsingle and a larger margin between the activations of the target layer in case of Lmulti . The smaller the value of m, the less influence the proposed loss components have. In our experiments, we found that the proposed loss component Lsingle is relatively stable with respect to the choice of m, and generally performs better with larger values (in the range 5-10). In case of the loss component Lmulti , we found that even a small value of the margin m (0.1 1) disentangles the learned representations better and consequently leads to substantial improvements in the AMI Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels Table 2. Adjusted Mutual Information (AMI) and Normalized Mutual Information (NMI) scores for the CIFAR-10 experiments M ODEL VALIDATION SET AMI NMI T EST SET AMI NMI BASELINE BASELINE + DeCov BASELINE + XCov BASELINE + LSINGLE BASELINE + LMULTI 0.198 0.175 0.320 0.238 0.376 0.194 0.176 0.321 0.239 0.376 score. In all of the reported experiments, we found that the proposed loss component with a reasonably chosen m does not hurt the model’s performance in the classification task. 4. Experiments We performed experiments on the MNIST strokes sequences dataset (de Jong, 2016)1 to validate our hypotheses in case of an RNN model. This dataset contains pen strokes, automatically generated from the original MNIST dataset (LeCun et al., 1998). Although the generated sequences do not always reflect a choice a human would made in order to write a digit, the strokes are consistent across the dataset. To validate our hypothesis on a more complex dataset, we also experimented with the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) and a more complex CNN model based on the VGG-16 architecture (Simonyan & Zisserman, 2014). Our experiments therefore cover two types of neural networks most commonly used in modern research: Recurrent Neural Networks and Convolutional Neural Networks, which are used as baseline models in our experiments. We implemented the models used in all experiments with TensorFlow (Abadi et al., 2016) and used Adam optimizer (Kingma & Ba, 2014) to train the them. Hyperparameters for the baseline models were chosen based on the Adjusted Mutual Information (AMI) score on the validation set and then used in the subsequent models. Hence, the performance of the baseline system is close to an empirical maximum that these models are able to achieve. 4.1. MNIST strokes sequences experiments For this experiment, we split the examples into two groups: samples belonging to the classes from 0 to 4 were assigned to the first group, and samples belonging to the classes from 1 https://github.com/edwin-de-jong/ mnist-digits-stroke-sequence-data 0.204 0.191 0.327 0.245 0.384 0.199 0.191 0.326 0.246 0.385 5 to 9 were assigned to the second group. The model is trained to predict the group of a given sample and does not have any access to the underlying classes. This experiment is a simplified version of the example we discussed in the introduction where we wanted to cluster the patients into meaningful groups, while having only binary mortality outcomes, rather than the more fine-grained labels. We used the model depicted in the Figure 1 for this experiment. After the models were trained on the binary classification task, we used the output of the penultimate layer FC2 to perform KMeans clustering and evaluated the quality of the produced clustering using the original class labels as ground truth assignments. We compared our loss components Lsingle and Lmulti with the DeCov regularizer (Cogswell et al., 2015) and XCov penalty (Cheung et al., 2014) as these losses use similar ideas, even though they do not directly target the task of improving the quality of clustering. We did not do comparison with the work of Liao et al. (2016) and Xie et al. (2016) as they belong to the second group of methods which requires a more complicated training procedure, whereas the loss components proposed here are simple to apply to an arbitrary cost function and do not require any changes in the training procedure. We report the average of the Adjusted Mutual Information (AMI) and Normalized Mutual Information (NMI) scores (Vinh et al., 2010) across three runs in the Table 1. 4.2. CIFAR-10 experiments As in the MNIST strokes sequences experiments, we split the examples in two groups: samples belonging to the classes “airplan”, “automobile”, “bird”, “cat”, and “deer” were assigned to the first group, and samples belonging to the classes “dog”, “frog”, “horse”, “ship”, “truck” were assigned to the second group. Note that this assignment is quite arbitrary as it simply reflects the order of the labels of the classes in the dataset (namely, the labels 0-4 for the first group and the labels 4-9 for the second group). All groups contain rather different types of objects, both natural and Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels (a) Without the proposed loss component, colored by binary labels (b) Without the proposed loss component, colored by classes (c) With the proposed loss component Lmulti , colored by binary (d) With the proposed loss component L , colored by classes multi labels Figure 5. PCA visualizations of the learned representations on the MNIST strokes sequences dataset. See the section 6 for details. human-made. 5. Implementation details For the experiments on the CIFAR-10 dataset, we used a CNN model based on the VGG-16 architecture, depicted on the Figure 4. We discarded the bottom fully connected and convolutional layers as, perhaps, they are too big for this dataset. Instead, we appended three convolutional layers to the output of pool3 layer with number of filters 256, 128 and 8 correspondingly. The first two layers use 3x3 convolutions, and the last layer uses 1x1 convolutions. After that, we pass the output trough a fully-connected layer of size 15 (FC1 ), which will be producing the representations to be used in clustering, and a fully connected layer of size 1 (FC2 ) with the sigmoid activation function to produce a binary classification decision. Despite the fact the the proposed loss components can be directly implemented using two nested for loops, such implementation will not be computationally efficient, as it will lead to a big computational graph operating on separate vectors without using full advantages of highly optimized parallel matrix computations on GPU. Therefore, it is desirable to have an efficient implementation that can use full advantage of modern GPUs. We have developed such an efficient implementation that significantly accelerates the computation of the loss component in return for a higher memory consumption by creating two matrices that contain all combinations of di and dj from the summations in the Equation 1 and performing the operations to calculate the loss on them. We have made our implementation for TensorFlow (Abadi et al., 2016) publicly available on GitHub2 alongside with aforementioned models from As in the subsection 4.1, we compare the proposed losses with DeCov and XCov and report the AMI and NMI scores in Table 2. 2 http://github.com/placeholder/ Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels the subsection 4.1 and the subsection 4.2. It is worth noting that since the loss component Lsingle operates directly on the weights of the target layer, its computational complexity does not depend on the size of the batch. Instead, it depends on the size of that layer. In contrast, the Lmulti operates on the activations of the target layer on all samples in the batch, and its computational complexity depends on the number of samples in the batch. In practice, using the implementation described above, we were able to train models with batch size of 512 and higher without exhausting the GPU’s memory. belonging to different classes and placed the them more uniformly in the space. 6. Discussion As we can see from Figure 2 and Figure 3, during the binary classification task on both datasets without the proposed loss component the models tend to learn representations that is specific to the target binary label, even though the samples within one group come from different classes. The model learns to use mostly just two neurons to discriminate between the target groups and hardly uses the rest of the neurons in the layer. We observe this behaviour across different types of models and datasets: an RNN model applied to a timeseries dataset and an CNN model applied to an image classification dataset behave in the exactly the same way. Both proposed loss components Lsingle and Lmulti force the model to produce disentangled representations, and we can see how it changes the patterns of activations in the target layer. It is easy to see in Figure 2b that the patterns of activations learned by the networks roughly correspond to underlying classes, despite the fact that the network did not have access to them during the training. This pattern is not as easy to see in case of CIFAR-10 dataset (see the Figure 3b), but we can observe that the proposed loss component nevertheless forced the network to activate different neurons for different classes, leading to a better AMI score on the clustering task. In order to further investigate the representations learned by the model, we visualized the representations of samples from the MNIST strokes sequences dataset in Figure 5 using TensorBoard. Figure 5a and Figure 5b in the top row depict the representations learned by the baseline model, colored according to the binary label and the underlying classes, respectively. Figure 5c and Figure 5d in the bottom row depict the representations of the same samples, learned by the model with the Lmulti loss component, colored in the same way. It is easy to see that the Lmulti indeed forced the model to learn disentangled representations of the input data. Note how the baseline model learned dense clusters of objects, with samples from the same group (but different classes) compactly packed in the same area. In contrast, the model with the proposed loss component learned considerably better representations which disentangle samples Figure 6. Number of clusters and the corresponding AMI score on the CIFAR-10 dataset In the real world, the number of clusters is rarely known beforehand. To systematically examine the stability of the proposed loss component, we plotted the Adjusted Mutual Information scores for the baselines methods and Lmulti loss component with respect to the number of clusters in Figure 6, using the CIFAR-10 dataset. As can be seen from Figure 6, our loss component consistently outperforms the previously proposed methods regardless the number of clusters. 7. Conclusion In this paper, we proposed two novel loss components that substantially improve the quality of KMeans clustering using the representations of the input data learned by the model. We performed a comprehensive set of experiments using two important model types (RNNs and CNNs) and different datasets, demonstrating that the proposed loss components consistently increase the Adjusted Mutual Information score by a significant margin and outperform previously proposed methods. In addition, we analyzed the representations learned by the network by visualizing the activation patterns and relative positions of the samples in the learned space, and the visualizations show that the proposed loss components indeed force the network to learn disentangled representations. Forced to Learn: Discovering Disentangled Representations Without Exhaustive Labels References Abadi, Martı́n, Agarwal, Ashish, Barham, Paul, Brevdo, Eugene, Chen, Zhifeng, Citro, Craig, Corrado, Greg S, Davis, Andy, Dean, Jeffrey, Devin, Matthieu, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. Simonyan, Karen and Zisserman, Andrew. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. Susskind, Joshua, Anderson, Adam, and Hinton, Geoffrey E. The toronto face dataset. U. Toronto, Tech. Rep. UTML TR, 1:2010, 2010. Cheung, Brian, Livezey, Jesse A, Bansal, Arjun K, and Olshausen, Bruno A. Discovering hidden factors of variation in deep networks. arXiv preprint arXiv:1412.6583, 2014. Vinh, Nguyen Xuan, Epps, Julien, and Bailey, James. Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. Journal of Machine Learning Research, 11 (Oct):2837–2854, 2010. Cogswell, Michael, Ahmed, Faruk, Girshick, Ross, Zitnick, Larry, and Batra, Dhruv. Reducing overfitting in deep networks by decorrelating representations. arXiv preprint arXiv:1511.06068, 2015. Xie, Junyuan, Girshick, Ross, and Farhadi, Ali. Unsupervised deep embedding for clustering analysis. In International Conference on Machine Learning (ICML), 2016. de Jong, Edwin D. Incremental sequence learning. arXiv preprint arXiv:1611.03068, 2016. Zeiler, Matthew D and Fergus, Rob. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818–833. Springer, 2014. Karpathy, Andrej, Johnson, Justin, and Fei-Fei, Li. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015. Kingma, Diederik and Ba, Jimmy. method for stochastic optimization. arXiv:1412.6980, 2014. Adam: A arXiv preprint Krizhevsky, Alex and Hinton, Geoffrey. Learning multiple layers of features from tiny images. 2009. Krizhevsky, Alex, Sutskever, Ilya, and Hinton, Geoffrey E. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012. LeCun, Yann, Cortes, Corinna, and Burges, Christopher JC. The mnist database of handwritten digits, 1998. Li, Jiwei, Chen, Xinlei, Hovy, Eduard, and Jurafsky, Dan. Visualizing and understanding neural models in nlp. In Proceedings of NAACL-HLT, pp. 681–691, 2016. Liao, Renjie, Schwing, Alex, Zemel, Richard, and Urtasun, Raquel. Learning deep parsimonious representations. In Advances in Neural Information Processing Systems, pp. 5076–5084, 2016. Russakovsky, Olga, Deng, Jia, Su, Hao, Krause, Jonathan, Satheesh, Sanjeev, Ma, Sean, Huang, Zhiheng, Karpathy, Andrej, Khosla, Aditya, Bernstein, Michael, Berg, Alexander C., and Fei-Fei, Li. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
9cs.NE
LDPC Codes with Local and Global 1 Decoding arXiv:1801.03951v1 [cs.IT] 11 Jan 2018 Eshed Ram Yuval Cassuto Andrew and Erna Viterbi Department of Electrical Engineering Technion – Israel Institute of Technology, Haifa 32000, Israel E-mails: {s6eshedr@campus, ycassuto@ee}.technion.ac.il Abstract This paper presents a theoretical study of a new type of LDPC codes that is motivated by practical storage applications. LDPCL codes (suffix L represents locality) are LDPC codes that can be decoded either as usual over the full code block, or locally when a smaller sub-block is accessed (to reduce latency). LDPCL codes are designed to maximize the error-correction performance vs. rate in the usual (global) mode, while at the same time providing a certain performance in the local mode. We develop a theoretical framework for the design of LDPCL codes over the binary erasure channel. Our results include generalizing the density-evolution analysis to two dimensions, proving the existence of a decoding threshold and showing how to compute it, and constructing capacity-achieving sequences for any pair of local and global thresholds. In addition ,a trade-off between the gap to capacity and the number of fullblock accesses is studied, and a finite-length analysis of ML decoding is performed to exemplify a trade-off between the locality capability and the full-block error-correcting capability. Keywords: Multi-block coding, codes with locality, two-sided Tanner graphs, binary erasure channel (BEC), capacity, density evolution (DE), iterative decoding, linear programming (LP), low-density parity-check (LDPC) codes. I. I NTRODUCTION Low-density parity-check (LDPC) codes and their low-complexity iterative decoding algorithm [5] are a powerful method to achieve reliable communication and storage with rates that approach Shannon’s theoretical limit (see [12] and [16]). Due to their efficient encoding and decoding algorithms, communication applications such as WiFi, DVB, and Ethernet had adopted this 2 family of linear block codes. When used in data-storage applications, unlike in communications, retransmissions are not possible, and any decoding failure implies data loss; hence strong LDPC codes need to be provisioned for extreme data reliability. Another key feature of modern storage devices is fast access, i.e., low-latency and high-throughput read operations. However, high data reliability forces very large block sizes and high complexity, and thus degrades the device’s latency and throughput. This inherent conflict motivates a coding scheme that enables fast read access to small (sub) blocks with modest data protection and low complexity, while in case of failure providing a high data-protection ”safety net” in the form of decoding a stronger code over a larger block. Our objective in this paper is to design LDPC codes to operate in such a multi-block coding scheme, where error-correction performance (vs. rate) is maximized in both the sub-block and full-block modes. Formally, in a multi-block coding scheme a code block of length N is divided into M sub-blocks of length n (i.e., N = M n). Each sub-block is a codeword of one code, and the concatenation of the M sub-blocks forms a codeword of another (stronger) code. This paper is the first to design LDPC codes for the multi-block scheme. Earlier work, such as [2] recently and [6], [7], [1] before, addressed the design of Reed-Solomon and related algebraic codes in multi-block schemes. While that prior work attests to the importance of the multi-block scheme, designing LDPC codes for it requires all-new tools and methods. Toward that, we define a new type of LDPC codes we call LDPCL codes, where the suffix ’L’ points to the code’s local access to its sub-blocks. The LDPCL code is designed in such a way that each of the sub-blocks (of length n) can be decoded independently of the other sub-blocks (local decoding), and in addition the full block of length M n can be decoded (global decoding) when local decoding fails. In order to fulfil this requirement, an LDPCL code must have at least one parity-check matrix H in the form of   H1 0 · · · 0 0     0   0 H2 · · · 0   ..   . .. H =  .. , . .     0 0 ··· HM    H0 where i ×n Hi ∈ Fm , 2 1 ≤ i ≤ M, (1) 3 H0 ∈ F2m0 ×M n . Our theoretical results on analysis and construction of LDPCL codes lie upon the definition of the code through two distinct degree-distribution pairs. The local degree distribution specifies the connections between sub-block variable nodes and their local check nodes, while the joint degree distribution governs the connection of the global check nodes to variable nodes in the full block. The key challenge is to design the local and joint distributions such that both the local and the global (=local+joint composition) codes perform well. In particular, this requires the generalization of the binary erasure channel (BEC)’s density-evolution analysis [15] to two dimensions (2D), where the local and joint dimensions are shown to have inherent asymmetries that need to be addressed to make the analysis work. We note two prior works related to our results: [10] proposed global coupling as a similar structure for LDPC codes, but were not interested in local-decoding performance and focused on algebraic structured codes over non-binary alphabets; [14] studied a two-layer LDPC framework for a different application, but defined the codes through one big product degree distribution that is not amenable to asymptotic analysis and capacity-achieving constructions. The paper is structured as follows. Section II reviews known results on LDPC codes that are essential to fully understand this paper, and presents the two-sided Tanner graph. Section III introduces the LDPCL ensembles, and Section IV details the asymptotic analysis of the beliefpropagation (BP) decoding algorithm on these ensembles. In Section V we define a new notion of capacity-achieving sequences with both global and local decoding thresholds, prove that they exist, and provide a general construction for them. Section VI discusses a trade-off between the gap to capacity of an LDPCL ensemble to the number of decoding iterations that access the full block; minimizing access to full-block bits while decoding saves time and communication costs when the sub-blocks are distributed. In Section VII, we perform a finite-length analysis for ML decoding of (regular) LDPCL codes, and finally, Section VIII summarizes the results and insights given in the paper. II. P RELIMINARIES A. LDPC Codes: Review from [15] A linear block code is an LDPC code if it has at least one parity-check matrix that is sparse, i.e., the number of 1’s in H is linear in the block length. This sparsity enables the low-complexity (linear in block length) decoding algorithm. Every parity-check matrix H can be represented 4 by a bipartite graph, called a Tanner graph, with nodes partitioned to variable nodes and check nodes; there exists an edge between check node i and variable node j , if and only if Hij = 1 (this paper focuses on binary linear codes, but this representation can be generalized). The fraction of variable (resp. check) nodes in a Tanner graph with degree i is denoted by Λi (resp. Ωi ), and the fraction of edges connected to variable (resp. check) nodes of degree i is denoted by λi (resp. ρi ); Λi and Ωi are called node-perspective degree distributions, and λi and ρi are called edge-perspective degree distributions. The degree-distribution polynomials associated to a Tanner graph are given by X X Λ(x) = Λ i xi , λ(x) = λi xi−1 , x ∈ [0, 1], i Ω(x) = (3a) i X Ωi xi , ρ(x) = X ρi xi−1 , x ∈ [0, 1]. (3b) i i The node-perspective and edge-perspective polynomials are related through Λ(x) = Rx λ(t)dt R01 , λ(t)dt 0 Ω(x) = Rx ρ(t)dt R01 , ρ(t)dt 0 λ(x) = Λ0 (x) Λ0 (1) , ρ(x) = Ω0 (x) Ω0 (1) , x ∈ [0, 1], (4a) x ∈ [0, 1], (4b) where the operator 0 stands for the function’s derivative. The rate of an LDPC code defined by a tanner graph whose degree-distribution polynomials are given by (3a)–(3b) is lower bounded by the design rate, which is 1 − Λ0 (1) Ω0 (1) =1− R1 ρ(t)dt R 01 . λ(t)dt 0 B. The Two-Sided Tanner Graph We define an LDPCL code of length N = M n through a two-sided Tanner graph. The main difference between the two-sided Tanner graph and the one-sided Tanner graph (i.e., the Tanner graph representing an ordinary LDPC code) is that in the former, the variable nodes are divided to M disjoint sets of size n each, and the check nodes are divided into two disjoint sets: local check nodes and joint check nodes. To distinguish between local and joint check nodes, the former are drawn to the right of the variable nodes and the latter are drawn to the left (hence its name: two-sided Tanner graph). The graph construction is constrained such that each local check node is connected only to variable nodes that are in the same sub-block of length n; the joint check-node connections have no constraints. The parity-check matrix corresponding to a two-sided Tanner graph is in the form of (1). The check nodes representing parity constraints in P rows 1 to M i=1 mi are local check nodes, and the check nodes representing parity constraints in the last m0 rows are joint check nodes. The set of edges in the graph is partitioned into two sets 5 as well: edges connecting variable nodes to local check nodes (i.e., the right side of the graph) are called local edges and edges connecting variable nodes to joint check nodes are called joint edges. Finally, the local (resp. joint) degree of a variable node is the number of local (resp. joint) edges emanating from it. Example 1: A two-sided Tanner graph and its corresponding parity-check matrix are given in Figure 1 and Figure 2, respectively: the parity check matrix is of size 12 × 18, n = 6, M = 3, and m0 = m1 = m2 = m3 = 3. Fig. 1. A two-sided Tanner graph with n = 6, M = 3 and m0 = m1 = m2 = m3 = 3. Fig. 2. The parity check matrix of the two-sided Tanner graph in Figure 1. We denote by ΛL,i the fraction of variable nodes with local degree i, and by ΩL,i the fraction of local check nodes with degree i. Similarly, λL,i designates the fraction of local edges connected to a variable node with local degree i, and ρL,i designates the fraction of local edges connected to a local check node of degree i. We call (ΛL,i , ΩL,i , λL,i , ρL,i ) local degree distributions. Note that we do not distinguish between local degree distributions of different sub-blocks, and we assume that they are the same in all sub-blocks (but the instances drawn from the distributions are in general different between the sub-blocks). The joint degree distributions (ΛJ,i , ΩJ,i , λJ,i , ρJ,i ) are defined similarly with an important difference. In contrast to Tanner graphs associated to ordinary LDPC codes where the minimal variable-node degree is usually 2 (i.e., ΛL,0 = ΛL,1 = 0), in the two-sided Tanner graph we allow some variable nodes to have joint degree 0 or 1. The reason for removing this restriction is related to the iterative decoding algorithm, and will become clearer in Sections IV and V. In the rest of the paper we will use P0 to denote the coefficient ΛJ,0 , due to its importance. The local and joint degree-distribution polynomials ΛL (·), λL (·), ΩL (·), ρL (·) and ΛJ (·), λJ (·), ΩJ (·), ρJ (·) 6 are defined similarly to the degree-distribution polynomials for ordinary LDP C codes (3a)-(3b). Known relations between node-perspective and edge-perspective polynomials hold for the local polynomials. However, since some variable nodes may have a joint degree of zero, the equation that describes ΛJ in terms of λJ changes to Rx λ (t)dt ΛJ (x) = P0 + (1 − P0 ) R01 λJ (t)dt , 0 III. x ∈ [0, 1]. (5) J LDPCL E NSEMBLES In this section we define the ensembles of two-sided Tanner graphs: the LDPCL ensembles. These ensembles have six parameters: M, n, ΛL (·), ΛJ (·), ΩL (·), and ΩJ (·). M is the locality parameter that sets the number of sub-blocks in a code block, n is the sub-block length, and ΛL (·), ΛJ (·), ΩL (·), ΩJ (·) are the node-perspective degree-distribution polynomials; this ensemble is denoted by LDP CL(M, n, ΛL , ΩL , ΛJ , ΩJ ). We can refer to an LDPCL ensemble through its edge-perspective degree-distribution polynomials, and then it is denoted by LDP CL(M, n, λL , ρL , λJ , ρJ , P0 ) (when using the edge-perspective notation, one must specify P0 as well). A. Regular LDPCL Ensembles An LDPCL ensemble is called (lL , rL , lJ , rJ )-regular if in every two-sided Tanner graph in it, all of the variable nodes have fixed local and joint degrees of lL and lJ (thus P0 = 0), respectively, and all of the local and joint check nodes have fixed degrees of rL and rJ , respectively. The number of local and joint check nodes is therefore M n rlLL and M n rlJJ , respectively; hence, the design rate is R=1− lJ lL − . rL rJ (6) In what follows, we describe the sampling process from the (lL , rL , lJ , rJ )-regular ensemble. First, M ordinary (not two-sided) Tanner graphs are independently sampled from the (lL , rL )regular LDPC ensemble with block length n. These Tanner graphs are concatenated vertically with no inter-connections; call them local graphs. Another ordinary Tanner graph is then sampled from the ordinary (lJ , rJ )-regular LDPC ensemble with block length N = M n. The latter graph is called the joint graph and it is flipped such that the check nodes are on the left side. Finally, the M n variable nodes of the joint graph are merged with the M n variable nodes of the M local graphs to create a two-sided Tanner graph. 7 B. Irregular LDPCL Ensembles An obvious generalization of the construction of regular LDPCL ensembles is the construction of irregular LDPCL ensembles in which the degrees of the nodes vary. As in ordinary LDPC codes, this generalization enables better iterative decoding performance. The sampling process from the irregular LDP CL(M, n, ΛL , ΛJ , ΩL , ΩJ ) ensemble is a as follows. First, M Tanner graphs are sampled independently from the LDP C(n, ΛL , ΩL ) ensemble. These local graphs are concatenated vertically without inter-connections. Another Tanner graph is then sampled from the LDP C(M n, ΛJ , ΩJ ) ensemble. The latter joint graph is flipped, its M n variable nodes are randomly permuted, and merged with the M n variable nodes of the M local graphs to create a two-sided Tanner graph. Note that the regular ensemble construction in Section III-A did not include the variable nodes random permutation step described above; we add it here to force statistical independence between the local and joint degrees of the variable nodes. The design rate of an LDP CL(M, n, ΛL , ΛJ , ΩL , ΩJ ) ensemble is given by Λ0L (1) Λ0J (1) − Ω0L (1) Ω0J (1) R1 R1 ρJ (x)dx 0 ρL (x)dx − R 01 (1 − P0 ) . = 1− R1 0 λL (x)dx 0 λJ (x)dx R(ΛL , ΛJ , ΩL , ΩJ ) = 1 − (7) We can see in (7), that setting P0 > 0 allows increasing the code rate, which we later indeed do in our constructions. IV. I TERATIVE D ECODING A SYMPTOTIC A NALYSIS A standard decoding algorithm for ordinary LDPC codes over the BEC is a message-passing algorithm known as the belief-propagation (BP) algorithm; its decoding complexity is linear in the block length and despite being sub-optimal, there are LDPC ensembles that approach the BEC capacity with BP. To take advantage of the locality structure of the Tanner graphs described above, the suggested decoding algorithm will operate in two modes: local mode and global mode. In the local mode, the decoder tries to decode a sub-block of length n using BP on the local Tanner graph corresponding to the desired sub-block. If the decoder meets a failure criterion (e.g., maximum number of iterations or stable non-zero fraction of erased variable nodes), then it enters the global mode where it tries to decode the entire code block (of length N = M n) using BP on the complete two-sided Tanner graph. If the decoder succeeds, it extracts the wanted sub-block, and if it fails, it declares a decoding failure. 8 The message scheduling in the global mode is a flooding schedule: in the first step of a global decoding iteration, the variable nodes send messages to the local and joint check nodes in parallel, and in the second step the local and global check nodes send their messages back to the variable nodes. As in the case of ordinary LDPC codes, the messages passed are either erasures or decoded 0/1 bits (later in Section VI we change the schedule from flooding to be more locality aware). Example 2: Figure 3 exemplifies the decoding algorithm for an LDPCL code with locality M = 2 and sub-block length of n = 12; the desired sub-block is the upper one. First, the decoder tries to locally decode the upper sub-block using only its local parity checks (a). It fails and enters the global mode (b), where it runs BP on the complete graph. In every iteration, messages are sent in parallel to the local and joint side (c)-(d), until the decoder resolves all of the variable nodes, and in particular, the desired sub-block. Fig. 3. An example for local and global decoding where the desired sub-block is the upper one: (a) a complete two-sided Tanner graph with erased (black) variable nodes before decoding; (b) the decoder fails to locally decode the desired sub-block and gets stuck, then it enters the global mode; (c) after one iteration in global mode; (d) after two iterations in global mode; (e) the decoder resolves the desired sub-block. In the local mode, the asymptotic (as n → ∞) analysis of decoding algorithm is identical to the asymptotic analysis of ordinary LDPC codes. Specifically, in the limit where n → ∞, there exists a local decoding threshold denoted by ∗L that depends on the degree distributions, such that if the fraction of erasures  is less than ∗L , the decoder will resolve the desired sub-block 9 in the local mode with probability converging to 1, and if  > ∗L , the decoder will fail in the local mode with probability converging to 1. Moreover, ∗L can be calculated numerically via x . (0,1] λL (1 − ρL (1 − x)) ∗L = inf (8) In contrast to the local mode, in the global mode there is a major difference in the asymptotic analysis of the BP algorithm between LDPC and LDPCL codes. Due to the built-in structure of the LDPCL ensemble, i.e., the constraints on edge connections (see Section III), one cannot calculate the global degree-distribution polynomials (i.e., considering an ”effective” one-sided Tanner graph ensemble), and use them to find the global BP decoding threshold with an equation similar to (8) (except for some special cases detailed below). A. Decoding in Global Mode In this sub-section, we analyze the asymptotic performance (as n → ∞) of the BP decoding algorithm over the BEC in the global mode, and derive density-evolution equations for the LDPCL. Two important theorems about ordinary LDPC codes hold for LDPCL codes as well, namely, the concentration theorem and the convergence to tree channel theorem (see [15, Theorem 3.30, Theorem 3.50]). The former theorem allows us to analyze the performance of a particular LDPCL code via the analysis of the (expectation of the) ensemble as n → ∞, and the latter theorem enables us to consider the tree ensembles [15, Chapter 3.7.2] corresponding to the general-graph ensembles of Section III, as n → ∞. We adopt the notations from [15] in the following derivation. Definition 1 (LDPCL Tree Ensemble): Let l ∈ N and ΛL , ΩL , ΛJ , ΩJ be degree-distribution polynomials. The tree ensemble Tl (ΛL , ΩL , ΛJ , ΩJ ) is constructed in the following way. Let V (i, j) be a variable-node-rooted tree of depth 1, with i local check nodes and j joint check nodes as children. Let C(i) be a check-node-rooted tree of depth 1 with i variable-node children. T0 (ΛL , ΩL , ΛJ , ΩJ ) is the ensemble consisting of a single element which is a variable node. To sample from Tl (ΛL , ΩL , ΛJ , ΩJ ), l ≥ 1, start by sampling from Tl−1 (ΛL , ΩL , ΛJ , ΩJ ), and for each leaf variable node v , if v is the root (i.e., l = 1) or v ’s father is a local check node, replace it with V (i, j) with probability λL,i+1 · ΛJ,j , and if v ’s father is a joint check node replace it with V (i, j) with probability ΛL,i · λJ,j+1 . Subsequently, replace each local check-node leaf with C(i) with probability ρL,i+1 and each joint check-node leaf with C(i) with probability ρJ,i+1 . Figures 4 and 5 illustrate the (lL , rL , lJ , rJ ) = (2, 4, 1, 3)-regular and the (ΛL (x) = x2 , ΩL (x) = x3 , ΛJ (x) = 43 + 14 x, ΩJ (x) = x2 )-irregular tree ensembles of depth 2, respectively. In the regular 10 Fig. 4. The single element of the T2 (ΛL (x) = x2 , ΩL (x) = x4 , ΛJ (x) = x, ΩJ (x) = x3 ) (regular) ensemble. The local (resp. joint) check nodes are marked with ’L’ (resp. . ’J’) Fig. 5. The 8 elements of the T2 (ΛL (x) = x2 , ΩL (x) = x3 , ΛJ (x) = 3 4 + 14 x, ΩJ (x) = x2 ) (irregular) ensemble. The probability of each element is given above it. The local (joint) check nodes are marked with ’L’ (’J’). ensemble there is only one element, and in the irregular ensemble there are 8 elements; the graphs are illustrated with their corresponding sampling probabilities. In both figures, the local check nodes are tagged with ’L’ and the joint check nodes are tagged with ’J’. Theorem 1 (Two-dimensional density evolution): Consider a random element from the LDP CL(M, n, ΛL , ΛJ , ΩL , ΩJ ) ensemble. Let xl () and yl () denote the probability that a local and joint edge, respectively, carries a variable-to-check erasure message after l BP iterations over 11 the BEC() as n → ∞. Then, xl () =  · λL (1 − ρL (1 − xl−1 ())) · ΛJ (1 − ρJ (1 − yl−1 ())) , l ≥ 0, (9a) yl () =  · ΛL (1 − ρL (1 − xl−1 ())) · λJ (1 − ρJ (1 − yl−1 ())) , l ≥ 0, (9b) x−1 () = y−1 () = 1. (9c) Proof: The convergence to tree channel theorem implies that as n → ∞, we can consider tree ensembles (see Definition 1) instead of the ensembles in Section III for finding the bit-error probability of the BP decoding algorithm. Consider first an (lL , lJ , rL , rJ )-regular tree ensemble. The degree-distribution polynomials are ΛL (x) = xlL , λL (x) = xlL −1 , ρL (x) = xrL −1 , ΛJ (x) = xlJ , λJ (x) = xlJ −1 , ρJ (x) = xrJ −1 . For every l ≥ 0, the tree ensemble of a (lL , lJ , rL , rJ )- regular LDPCL ensemble consists of only one element which is a bipartite tree of depth 2l rooted in a variable node, such that every local (resp. joint) check node has rL − 1 (resp. rJ − 1) children, every variable node which has a local check node as a father, including the root, has lL −1 local check-node children and lJ joint check-node children, and every variable node which has a joint check node as a father, has lJ − 1 joint check-node children and lL local check-node children (see Figure 4). We use mathematical induction on the number of iterations l. For l = 0 the probability that a local or joint edge carries an erasure as a variable-to-check message is . Since x−1 () = y−1 () = 1, then (9a)-(9b) with l = 0 leads to  lL −1  l J x0 () =  · 1 − (1 − 1)rL −1 · 1 − (1 − 1)rJ −1 = ,  l L  lJ −1 y0 () =  · 1 − (1 − 1)rL −1 · 1 − (1 − 1)rJ −1 = , hence, (9a)-(9b) hold for regular ensembles and l = 0. Assume correctness of (9a)-(9b) for some l ≥ 0, and consider iteration l + 1. Each local (resp. joint) check node has rL − 1 (resp. rJ − 1) children variable nodes. Recall that in the BP decoding algorithm for the BEC, a check node will not send an erasure message to its father if and only if all of its incoming messages from its children are not erasures. Let ul () and wl () designate the probability that an outgoing message from a local and joint check node, respectively, is an erasure. Then, ul+1 () = 1 − (1 − xl ())rL −1 , (10) wl+1 () = 1 − (1 − yl ())rJ −1 . In addition, a variable-to-check message will be an erasure if and only if all of its incoming messages (including the one from the channel) are erasures. Since every variable node which 12 has a local (resp. joint) check node as a father, has lL − 1 (resp. lL ) local check-node children and lJ (resp. lJ − 1) joint check-node children, xl+1 () =  · (ul+1 ())lL −1 · (wl+1 ())lJ , (11) yl+1 () =  · (ul+1 ())lL · (wl+1 ())lJ −1 . Combining (10) and (11) yields that (9a)-(9b) hold in the regular case for l + 1, thus by mathematical induction it holds for every l ≥ 0. The irregular case follows by invoking the convergence theorem and taking the expected value in the induction step (i.e., in (10) and (11)) w.r.t. the tree ensemble construction in Definition 1. Since the probability that a local (resp. joint) edge is connected to a local (resp. joint) check node of degree i is given by ρL,i (resp. ρJ,i ), and the probability that a local (resp. joint) edge is connected to a variable node of local degree i and joint degree j is given by λL,i ΛJ,j (resp. ΛL,i λJ,j ), then ul+1 () = 1 − ρL (1 − xl ()) , wl+1 () = 1 − ρJ (1 − yl ()) , xl+1 () =  · λL (ul+1 ()) · ΛJ (wl+1 ()) , yl+1 () =  · ΛL (ul+1 ()) · λJ (wl+1 ()) . We call (9a)-(9b) the 2D density-evolution (2D-DE) equations of LDPCL codes over the BEC(). These equations prove that the analysis of the BP decoding algorithm in the global mode differs from the analysis of the standard BP decoding LDPC codes over the BEC(). Although for some special cases the 2D-DE equations can be reduced to the well-known 1DDE equations (Corollary 1 to follow), for the more interesting cases we will need the 2D-DE equations in (9a)-(9b). To simplify notations,  will be omitted from now on from xl () and yl () if it is clear from the context. Remark 1: Although xl and yl in (9a)-(9b) seem symmetric to each other, it is not necessarily true since we allow variable nodes to have joint degrees 0 (P0 > 0) or 1 (λJ (0) > 0), while their local degrees are forced to be greater then 1. This asymmetry has a crucial effect on the global decoding process which is explained and detailed in Section IV-B. Corollary 1: If for every x ∈ [0, 1], ρL (x) = ρJ (x), and the variable local and joint degrees are regular, i.e., λL (x) = xlL −1 , λJ (x) = xlJ −1 , then xl = yl , ∀l ≥ 0, (12) 13 and xl = λ(1 − ρ(1 − xl−1 )), ∀l ≥ 0, (13) where, ρ(x) , ρL (x), λ(x) , xlL +lJ −1 . Proof: Since in the regular case we have ΛL (x) = xλL (x), x ∈ [0, 1], ΛJ (x) = xλJ (x), x ∈ [0, 1], (12) and (13) follow immediately from (9a)-(9c). Corollary 1 asserts that if we use identical degree-distributions for local and joint check nodes and we force all variable nodes to have a local and joint regular degree, then the 2D-DE equations in (9a)-(9b) degenerate to the already known 1D-DE equation; hence, in this case we can use the analysis of BP decoding in ordinary LDPC codes for the LDPCL codes as well. Example 3: Consider the (lL , lJ , rL , rJ )-regular ensemble with lL = 2, lJ = 1, rL = rJ = 6. In view of (6), the corresponding design rate is 1 R= . 2 In addition, λ(x) = xlL +lJ −1 = x2 , ρ(x) = ρL (x) = x5 , and due to Corollary 1, we have xl = λ(1 − ρ(1 − xl−1 )) = (1 − (1 − xl−1 )5 )2 which is the 1D-DE equation for the (3, 6)-regular LDPC ensemble; in other words, in the local mode a (2, 6)-regular LDPC code is decoded, and in the global mode a (3, 6)-regular LDPC code is decoded. The local and global thresholds are therefore, ∗L = 0.2, respectively. ∗G = 0.4294, 14 B. Threshold In this sub-section, the asymptotic global threshold of the BP decoding algorithm on LDPCL ensembles is studied. We prove that for any given LDP CL(M, n, λL , ρL , λJ , ρJ , P0 ) ensemble, there exists a threshold denoted by ∗G such that when n → ∞, the BP algorithm will successfully globally decode (for sufficiently large number of iterations) a code block transmitted on the BEC() if and only if  < ∗G . A method to calculate this threshold is provided as well. Define f (, x, y) =  λL (1 − ρL (1 − x)) ΛJ (1 − ρJ (1 − y)) , x, y,  ∈ [0, 1] (14a) g(, x, y) =  ΛL (1 − ρL (1 − x)) λJ (1 − ρJ (1 − y)) , x, y,  ∈ [0, 1] (14b) such that (9a)-(9c) can be re-written as xl = f (, xl−1 , yl−1 ) , l≥0 yl = g (, xl−1 , yl−1 ) , l≥0 (15) x−1 = y−1 = 1. Lemma 1: The functions f and g are monotonically non-decreasing in all of their variables. Proof: Since the images of λL (·), ΛL (·), λJ (·), ΛJ (·), ρL (·) and ρJ (·) lie in [0, 1], then f and g are monotonically non-decreasing in  ∈ [0, 1]. The rest of the proof is similar and is left as an exercise. Definition 2: Let  ∈ (0, 1). We say that (x, y) ∈ [0, 1]2 is an (f, g)-fixed point if     f (, x, y) x .  = y g(, x, y) (16) Clearly, for every  ∈ (0, 1), (x, y) = (0, 0) is a trivial (f, g)-fixed point. However, it is not clear yet if there exists a non-trivial (f, g)-fixed point. In particular, we ask: for which choices of  ∈ (0, 1), λL , ρL , λJ , ρJ and P0 there exists a non-trivial (f, g)-fixed point? The following lemmas will help answering this question. Lemma 2: Let  ∈ (0, 1), and let (x, y) ∈ [0, 1]2 be an (f, g)-fixed point. Then, 1) x = 0 implies y = 0, and if P0 = 0 or λJ (0) > 0, then y = 0 implies x = 0. 2) (x, y) ∈ [0, )2 . 3) ∞ If {xl }∞ l=0 and {yl }l=0 are defined by (15), then xl ≥ x, yl ≥ y, ∀l ≥ 0. (17) 15 Proof: See Appendix A Remark 2: Item 1) in Lemma 2 expresses the asymmetry between the local and joint sides during the decoding algorithm discussed in Remark 1. Lemma 3: Let xl and yl be defined by (15) and let 0 <  ≤ 0 < 1. Then, xl+1 () ≤ xl (), ∀l ≥ 0 (18) yl+1 () ≤ yl (), ∀l ≥ 0, and xl () ≤ xl (0 ), ∀l ≥ 0 (19) 0 yl () ≤ yl ( ), ∀l ≥ 0. Proof: By mathematical induction on l and by Lemma 1. The details are left as an exercise. In view of (15), it can be verified that xl (0) = 0, xl (1) = 1, ∀l ≥ 0 yl (0) = 0, yl (1) = 1, ∀l ≥ 0. (20) Since xl and yl are bounded from below by 0, then Lemma 3 implies that the limits lim xl () l→∞ and lim yl () exist. In view of (20) we can define a BP global decoding asymptotic threshold l→∞ by ∗G   = sup  ∈ [0, 1] : lim yl () = lim xl () = 0 . l→∞ (21) l→∞ Note that from continuity of g in (14b), Item 1) in Lemma 2 implies that if lim xl () = 0, then l→∞ lim yl () = 0. Thus, (21) can be re-written as l→∞   ∗ G = sup  ∈ [0, 1] : lim xl () = 0 . l→∞ (22) Theorem 2 (Fixed-point characterization): Let ˆ = sup { ∈ [0, 1] : (16) has no solution with (x, y) ∈ (0, 1] × [0, 1]} . (23) Then, ∗G = ˆ. Proof: Let  < ˆ, and let x() = lim xl (), y() = lim yl (). Taking the limit l → ∞ in l→∞ l→∞ (15) yields that (x(), y()) is an (f, g)-fixed point. In view of (23), since  < ˆ, it follows that x() = 0. From (22) we have  < ∗G , for every  < ˆ; this implies that ˆ ≤ ∗G . 16 For the other direction let  > ˆ and let (z1 , z2 ) be an (f, g)-fixed point such that z1 > 0. Lemma 2-Item 3) implies that xl () ≥ z1 > 0, ∀l ≥ 0, thus lim xl () > 0, where the existence of this limit is assured due to Lemma 3; hence,  > ∗G . l→∞ Since this is true for all  > ˆ, then we deduce that ˆ ≥ ∗G and complete the proof. We proceed by providing a numerical way to calculate the threshold of a given choice of ΛL , ΛJ , ΩL and ΩJ . Define ΛL (1 − ρL (1 − x)) , λL (1 − ρL (1 − x)) ΛJ (1 − ρJ (1 − x)) qJ (x) , x · , λJ (1 − ρJ (1 − x)) x ∈ (0, 1] qL (x) , x · (24) x ∈ (0, 1] Lemma 4: limx→0 qL (x) = 0. Proof: See Appendix B. Since qL (1) = 1, Lemma 4 and the intermediate-value theorem imply that for every w ∈ (0, 1] there exists x ∈ (0, 1] such that qL (x) = w; it is not true in general that limx→0 qJ (x) = 0, and this limit may be infinite (check for example the case P0 > 0, ρJ (x) = x3 and λJ (x) = x2 ). Definition 3: For every y > 0 such that qJ (y) ≤ 1 define q(y) , max{x : qL (x) = qJ (y)}. (25) Lemma 5: If (x, y) is an (f, g)-fixed point with y > 0, then x ≤ q(y). (26) Proof: See Appendix C. Remark 3: If qL (·) is injective, then (25) and (26) can be restated as x = q(y) = qL−1 (qJ (y)). Theorem 3 (Threshold numerical calculation): Let λL , ρL , λJ , ρJ be degree-distribution polynomials, let P0 ∈ [0, 1], and let ∗G = ∗G (ΛL , ΛJ , ΩL , ΩJ ) be the BP global decoding threshold of the LDP CL(M, n, ΛL , ΛJ , ΩL , ΩJ ) ensemble on the BEC when n → ∞. If P0 = 0 or λJ (0) > 0 , then ∗G = inf y∈(0,1] qJ (y)≤1 y . g(1, q(y), y) (27) 17 Else, ∗G = min       inf   y∈(0,1] qJ (y)≤1 x y 1 · inf , . g(1, q(y), y) P0 (0,1] λL (1 − ρL (1 − x))   (28) Proof: See Appendix D. Remark 4: In the special case where ρJ (·) = ρL (·), and the variable local and joint degrees are regular (i.e. λL (x) = xlL −1 , λJ (x) = xlJ −1 ), (24) implies that qL (·) is injective, and that qL (x) = qJ (x), for every x ∈ (0, 1]. Therefore, in view of Remark 3, every (f, g)-fixed point lies on the line y = x. Further, since P0 = 0, Theorem 3 yields ∗G = inf y∈(0,1] qJ (y)≤1 y g(1, q(y), y) y y∈(0,1] g(1, y, y) y , = inf y∈(0,1] λ(1 − ρ(1 − y)) = inf where for every y ∈ [0, 1], ρ(y) = ρL (y), and λ(y) = y lL +lJ −1 . This is consistent with Corollary 1. Example 4: Consider an LDPCL ensemble characterized by λL (x) = x, ρL (x) = x9 λJ (x) = 0.3396x + 0.6604x4 , P0 = 0.2667, ρJ (x) = x9 . Using (7), (8) and (28), the design rate is R = 0.5571, the local decoding threshold is ∗L = 0.1112, and the global decoding threshold is ∗G = 0.35. Figure 6 illustrates the 2D-DE equations in (9a)-(9c) for three different bit erasure probabilities: 0.33, 0.35, 0.37, from left to right, respectively. When the channel’s erasure probability is  = 0.33, there are no (f, g)-fixed points – the decoding process ends successfully, and when  = 0.37, there are two (f, g)-fixed points, (0.335, 0.3202) and (0.2266, 0.1795) – the decoding process gets stuck at (0.335, 0.3202). When  = 0.35 = ∗G , there is exactly one (f, g)-fixed point at (0.27, 0.237), and the dashed and dotted lines osculate. V. A N LDPCL C ONSTRUCTION AND ACHIEVING C APACITY In this section, we present an LDPCL ensemble construction. First we assume that the local ensemble (i.e., λL , ρL ) is given (Sub-section V-A), and then we optimize the local ensemble 18 Fig. 6. Illustration of the density-evolution equations in (9a)-(9c) for the LDPCL ensemble in Example 4 which induce a global decoding threshold of ∗ = 0.35. The evolved channel erasure probabilities, from left to right, are  = 0.33, 0.35, 0.37. according to the proposed construction (Sub-sections V-B and V-C). Finally, we use capacityachieving sequences of LDPC ensembles to construct a LDPCL capacity-achieving sequence that in addition can be sub-block decoded up to the local threshold permitted by the local degree distributions. In general, inputs for the construction are the desired local and global decoding thresholds, L and G , respectively, and the outputs are degree-distributions (λL , ρL , λJ , ρJ , P0 ) such that ∗L (λL , ρL ) = L ∗G (λL , ρL , λJ , ρJ , P0 ) = . Note that setting P0 = 0, and picking any two LDPC ensembles (λL , ρL ) and (λJ , ρJ ) that induce thresholds ∗ (λL , ρL ) = L and ∗ (λJ , ρJ ) = G would suffice, but this choice yields poor rates (intuitively, with that choice the local and joint codes do not ”cooperate”). Another solution is not using a joint ensemble at all, i.e., choosing (λL , ρL ) such that ∗ (λL , ρL ) = G > L , and setting P0 = 1. However, this solution is an undesired overkill since it would miss the opportunity to have a low-complexity local decoder for the majority of decoding instances where the erasure probabilities are below L . 19 A. The Construction In this sub-section, we assume that the local ensemble (λL , ρL ) and the global decoding threshold G are given, and we give a simple way to determine the joint ensemble (λJ , ρJ , P0 ) such that ∗G (λL , ρL , λJ , ρJ , P0 ) = G . Definition 4: Let (λL , ρL ) be local degree-distribution polynomials, and let ∗ (λL , ρL ) = L be their BP decoding threshold. For  ∈ (L , 1), let 1) h (x) = λL (1 − ρL (1 − x)) − x, x ∈ [0, 1] 2) xs () = max{x ∈ [0, 1] : h (x) ≥ 0} 3) as () = ΛL (1 − ρL (1 − xs ())) For every x ∈ [0, 1], h (x) is the erasure-probability change in one iteration of the BP algorithm on the local graph, if the current erasure probability is x. By definition, since  > L , h (x) > 0 for some x ∈ [0, 1]. In addition, for every x > , h (x) < 0, so xs () is well defined. Operationally, xs () is the local-edge erasure probabilty when the local decoder gets stuck. Definitions similar to items 1) and 2) have appeared in [9]; we add as () as the variable-node erasure probability corresponding to xs (). Theorem 4: let (λL , ρL ) be a local ensemble inducing a local threshold L , and let G ∈ (L , 1). If P0 = L G , and (λJ , ρJ ) is an ensemble having a decoding threshold J = G · as (G ), then ∗G (λL , ρL , λJ , ρJ , P0 ) = G . Proof: Let ¯ < G . In view of (14a), for every x ∈ (0, 1], f (¯ , x, 0) = ¯λL (1 − ρL (1 − x))P0 < P0 G λL (1 − ρL (1 − x)) = L λL (1 − ρL (1 − x)) ≤ x. (29) Furthermore, Definition 4 implies that for every (x, y) ∈ (xs (¯ ), 1) × [0, 1], f (¯ , x, y) = ¯λL (1 − ρL (1 − x))ΛJ (1 − ρJ (1 − y)) < xΛJ (1 − ρJ (1 − y)) ≤ x, (30) 20 and from Lemma 1, if (x, y) ∈ (0, xs (¯ )] × (0, 1], g(¯ , x, y) ≤ g(¯ , xs (¯ ), y) = ¯λJ (1 − ρJ (1 − y))ΛL (1 − ρL (1 − xs (¯ ))) = ¯λJ (1 − ρJ (1 − y))as (¯ ). (31) Since ¯ < G , then J = G · as (G ) > ¯ · as (¯ ), where J is the BP decoding threshold of (λJ , ρJ ); thus (31) yields g(¯ , x, y) < J λJ (1 − ρJ (1 − y)) ≤ y, ∀(x, y) ∈ (0, xs (¯ )] × (0, 1]. (32) Combining (29), (30), and (32) implies that (16) has no solution in (0, 1] × [0, 1]. This in turns implies, due to Theorem 2, that ∗G ≥ ¯. Since this is true for any ¯ < G , we conclude that ∗G ≥ G . Finally, from Theorem 3 and (8), since P0 = ∗G ≤ L G (33) > 0, we have x 1 L · inf = = G . P0 (0,1] λL (1 − ρL (1 − x)) P0 (34) B. LP Optimized Degree-Distributions From the capacity bound, the design rate of an ensemble constructed by Theorem 4 is upper bounded by R1 R(λL , ρL , λJ , ρJ , P0 ) < 1 − R 01 0 ρL λL − J · (1 − P0 ). (35) In view of item 3) in Definition 4, for a fixed G ∈ (0, 1), J = G · as (G ) is monotonically increasing w.r.t. xs (G ), hence the design rate could increase if xs (G ) decreases. On the other hand, lowering xs (G ) adds constraints on the local ensemble, and it may degrade the design R1   ρ rate i.e., if R01 λL increases . 0 L In this sub-section we use linear programming to find a local ensemble that maximizes the bound on the design rate of the construction proposed in Theorem 4. In other words, we assume that the local and global thresholds (L , G ) are given and we ask: under a constraint on the maximum local degrees (lmax , rmax ), what are the local degree-distributions that bring the bound in (35) to maximum. This maximum-degree constraint is motivated by the low-complexity requirement of the local code. Note that the joint ensemble is not limited (as long as its decoding 21 threshold satisfies the hypothesis of Theorem 4), and one can think of it as an ensemble that almost achieves capacity. As usual, we iterate between optimizing the variables degree-distribution, (λL,1 , . . . , λL,lmax ), and checks degree-distribution, (ρL,1 , . . . , ρL,rmax ). Let xs ∈ (0, 1), fix ρL (x) = xrmax −1 , and solve maximize lmax P i=2 λL,i i subject to λL,i ≥ 0, i ∈ {2, . . . , lmax }, lmax P λL,i = 1, (36) i=2 L λL (1 − ρL (1 − x)) − x ≤ 0, x ∈ (0, 1] λL (1 − ρL (1 − x)) − x ≤ 0, x ∈ (xs , 1]. With the resulting λL in hand, solve minimize rP max i=2 ρL,i i subject to ρL,i ≥ 0, i ∈ {2, . . . , rmax }, rP max ρL,i = 1, (37) i=2 1 − z − ρL (1 − L λL (z)) ≤ 0, z ∈ (0, 1]  xs z ∈ λ−1 L (  ), 1 . 1 − z − ρL (1 − λL (z)), By iterating between (36) and (37) for different values of xs ∈ (0, 1), the design rate of the ensemble constructed in Theorem 4 is maximized. C. Low Degree Local Ensembles In most cases, it is hard to produce an analytical expression for xs (), but if we limit the local degrees of the ensemble to be small, then a closed-form expression could be derived for xs (), as (), and J . In particular, we consider local ensembles taking the form: λL (x) = x, ρL (x) = ρ2 x + ρ3 x2 + ρ4 x3 , ρi ≥ 0, ρ2 + ρ2 + ρ4 = 1. (38) This restriction to very low local degrees yields a very low-complexity local BP decoding algorithm. Lemma 6: For the family of ensembles given in (38), L = 1 . 1 + ρ3 + 2ρ4 (39) 22 In addition, for every  ∈ (L , 1), if ρ4 = 0, then 1 ρ3 1   −1 , (40)   1 (ρ3 +ρ4 )2 +4ρ4  −1 . 2ρ4 (41) xs () = 1 − and if ρ4 > 0, then r ρ3 +3ρ4 − xs () = Furthermore,  as () = xs ()  2 . (42) Proof: See Appendix E. Remark 5: To emphasize the fact the xs () depends on ρ3 , ρ4 , we use the notation xs (ρ3 , ρ4 , ) for the rest of this sub-section. In view of Lemma 6, in the special case where the the local ensemble is in the form of (38), the procedure of finding the optimal xs (ρ3 , ρ4 , ) described in Section V-B boils down to solving a closed-form optimization problem. Let 0 < L < G < 1. If (λL , ρL , λJ , ρJ , P0 ) is an ensemble such that (λL , ρL ) is in the form of (38), and (λJ , ρJ , P0 ) satisfies the hypotheses of Theorem 4, then from (35) and (42)   1 L 1 R < ρ3 + ρ4 − G · as (G ) · 1 − 3 2 G   1 1 x2s (ρ3 , ρ4 , G ) L = ρ3 + ρ4 − · 1− 3 2 G G , R̂(ρ3 , ρ4 ), (43) Moreover, in order to induce a local decoding threshold at least L , Lemma 6 implies that ρ3 + 2ρ4 ≤ 1 L − 1; hence, (43) yields the following two-variables optimization problem maximize R̂(ρ3 , ρ4 ) ρ3 ,ρ4 subject to ρ3 , ρ4 ≥ 0 (44) ρ3 + ρ4 ≤ 1 ρ3 + 2ρ4 ≤ 1 L − 1, that can be solved with some standard optimization techniques. 23 D. Achieving Capacity In this sub-section, we define the LDPCL notion of capacity-achieving sequences, and prove that such sequences exist. During the derivation, we will refer to δ(λ, ρ) as the additive gap to capacity of the LDP C(λ, ρ) ensemble, i.e., δ(λ, ρ) = 1 − ∗ (λ, ρ) − R(λ, ρ). Similarly, we define δ (λL , ρL , λJ , ρJ , P0 ) = 1 − ∗G (λL , ρL , λJ , ρJ , P0 ) − R(λL , ρL , λJ , ρJ , P0 ) as the global additive gap to capacity. Definition 5: Let 0 < L < G < 1. A sequence n o (k) (k) (k) (k) (k) λL , ρL , λJ , ρJ , P0 k≥1 is said to achieve capacity on a BEC(G ), with local decoding capability L if:   (k) (k) 1) lim ∗L λL , ρL = L k→∞   (k) (k) (k) (k) (k) 2) lim ∗G λL , ρL , λJ , ρJ , P0 = G k→∞   (k) (k) (k) (k) (k) 3) lim R λL , ρL , λJ , ρJ , P0 = 1 − G k→∞   (k) (k) (k) (k) (k) Note that Items 2) and 3) imply that lim δ λL , ρL , λJ , ρJ , P0 = 0. k→∞ Lemma 7: Let (λL , ρL , λJ , ρJ , P0 ) be degree-distribution polynomials constructed according to Theorem 4, and let δL , δ(λL , ρL ) and δJ , δ(λJ , ρJ ). Then, δ (λL , ρL , λJ , ρJ , P0 ) ≤ δL + δJ · (1 − P0 ) . (45) Proof: Let G = ∗G (λL , ρL , λJ , ρJ , P0 ) be the BP global decoding threshold of of the LDP CL(M, n, λL , ρL , λJ , ρJ , P0 ) ensemble as n → ∞. In view of Theorem 4, P0 = J , ∗ (λJ , ρJ ) = G · as (G ) ≤ G . L G , and (46) In addition, by definition we have, R1 R 01 ρL (x)dx = L + δL 0 λL (x)dx R1 ρJ (x)dx = J + δJ , R 01 0 λJ (x)dx (47) hence (7), (46) and (47) imply, δ (λL , ρL , λJ , ρJ , P0 ) = 1 − R (λL , ρL , λJ , ρJ , P0 ) − ∗G (λL , ρL , λJ , ρJ , P0 )   L = L + δL + (J + δJ ) 1 − − G G ≤0 ≥0   1 z }| { z }| { L = (J − G ) (G − L ) +δL + δJ 1 − G G   L ≤ δL + δJ 1 − G (48) 24 = δL + δJ (1 − P0 ) . (49) At this point, it is clear how to construct a capacity-achieving sequence of LDPCL ensembles on a BEC(G ), with a local decoding capability L . Choose any two sequences of (ordinary) n o n o (k) (k) (k) (k) that achieve capacity on the BEC(L ) and λJ , ρJ , LDPC ensembles λL , ρL , k≥1 k≥1   (k) and BEC(G ), respectively, and set P0 = 1 − GL , for all k ≥ 1. Item 1) in Definition 5 clearly holds for this sequence, and in view of Theorem 4, Item 2) in Definition 5 holds as well. Finally, Lemma 7 implies that       L  (k) (k) (k) (k) (k) (k) (k) (k) 1− lim δ λL , ρL , λJ , ρJ , P0 ≤ lim δ λL , ρL + lim δ λJ , ρJ = 0. k→∞ k→∞ k→∞  Example 5: We construct an LDPCL capacity-achieving sequence with local and global threshold L = 0.05 and G = 0.2, respectively. We set P0 = L G = 0.25 and we use the Tornado capacity-achieving sequence [11], D (D ) λL L (x) (D ) ρL L (x) D L X xi 1 = , H(DL ) i =e −αL i=1 ∞ X i=0 x)i (αL i! where H(·) is the harmonic sum, αL = (D ) λJ J (x) , J X xi 1 = , H(DJ ) i (D ) ρJ J (x) −αJ =e i=1 ∞ X i=0 H(DL ) L , and (αJ x)i , i! (D ) (D ) λJ J (x), ρJ J (x) (50) are defined simi- larly (the check degree-distribution series are truncated to get degree-distribution polynomials with finite degrees). DL (resp. DJ ) controls the local (resp. joint) gap to capacity δL (resp. δJ ); the bigger it is, the smaller the gap is. Table I exemplifies how the LDPCL sequence n o (D ) (D ) (D ) (D ) λL L , ρL L , λJ J , ρJ J , P0 approaches capacity as DL → ∞, DJ → ∞: Theorem 4 implies that for every value of DL and DJ , the global decoding threshold is ∗G ≥ 0.2; the local additive gap to capacity δL and joint additive gap to capacity δJ both vanish as DL → ∞ and DJ → ∞, which in view of (45), implies that the global additive gap to capacity δ vanishes as well. Table I shows the advantage of the multi-block scheme: one can achieve the local threshold with significantly simpler ensembles (use only few terms in (50)). Such simpler codes allow to approach the theoretical threshold with shorter blocks and with lower complexity. VI. R EDUCING T HE N UMBER OF J OINT I TERATIONS It has not been emphasized earlier in the paper, but in practical settings the local and joint decoding iterations are very different in terms of cost. Joint iterations access a much larger (factor TABLE I. L OCAL GAP TO CAPACITY δL , JOINT GAP TO CAPACITY δJ , AND RATE OF THE CAPACITY- ACHIEVING SEQUENCE GIVEN BY (50) WITH L = 0.05, G = 0.2, DL δL DJ δJ Rate 1 0.05 1 0.2 0.6 1 0.05 2 0.1 0.67 1 0.05 10 0.02 0.735 1 0.05 100 0.002 0.745 2 0.025 100 0.002 0.775 5 0.01 100 0.002 0.79 ∞ 0 ∞ 0 0.8 AND LDPCL 25 P0 = 0.25. M) data unit, which may involve a high cost of transferring the bits to the check-node logic. In distributed-storage applications the sub-blocks may even reside in remote sites, increasing the communication cost even further. Therefore, we would like to reduce the number of joint iterations (call it NJI ) performed by the decoder (i.e., rounds of variable-to-joint-check messages and joint-check-to-variable messages). Ideally, the decoder successfully decodes the desired subblock (of length n) on the local graph (see Section II-B), does not enter the global mode, and no joint iterations are needed (NJI = 0); this happens when the fraction of erased bits is equal or less than the local threshold, i.e.,  ≤ L . However, if  > L , then the decoder fails to decode in the local mode and it enters the global mode where at least one joint iteration is necessary (NJI ≥ 1). In this section, we suggest a scheduling scheme for updating the joint side of the two-sided Tanner graph during the global mode decoding, and we prove that it is optimal in the sense of minimizing NJI . In addition, we study how the parameters of the local and joint ensembles affect NJI . A. An NJI -optimal scheduling scheme Recall the density-evolution equations for the BP decoding algorithm over the BEC with erasure probability , of the LDP CL(M, n, ΛL , ΛJ , ΩL , ΩJ ) ensemble when n → ∞ : xl = f (, xl−1 , yl−1 ) , l ≥ 0, (51a) yl = g (, xl−1 , yl−1 ) , l ≥ 0, (51b) x−1 = y−1 = 1, (51c) 26 where f and g are given in (14a) and (14b), respectively; note that (51a) and (51b) express a local and a joint iteration, respectively. A scheduling scheme prescribes decoder access to the joint check nodes in only part of the iterations, and thus replaces (51b) with   g (, x , y ) l ∈ A l−1 l−1 yl =  y l∈ /A (52) l−1 for some A ⊆ N representing the iteration numbers where joint checks are accessed; in this case we have NJI = |A| . Note that when the check-node update is skipped in the joint side there is no need to access the variable nodes outside the sub-block. Since Lemma 3 still holds when (51b) is replaced with (52), the limits lim xl and lim yl exist for every scheduling scheme. l→∞ l→∞ Given local and joint degree-distributions, a scheduling scheme is called valid if for every  < G = ∗G (ΛL , ΛJ , ΩL , ΩJ ), lim xl () = 0 (successful decoding). Our goal is to find an l→∞ optimal scheduling scheme: a valid scheduling scheme that minimizes NJI . For example, if A = ∅ (no joint updates), then NJI = 0 but lim xl () > 0 if  ∈ (L , G ); thus, the scheduling l→∞ scheme is not valid. If, on the other hand, A = N (joint checks are accessed in every iteration), then the scheduling scheme is valid, but NJI equals the total number of iterations, which is the worst case. We do not require the scheduling scheme to be pre-determined, and it can use “on-line” information about the decoding process, for example, the current fraction of erasure messages or the change in this fraction between two consecutive iterations. In what follows, we present an optimal scheduling scheme that minimizes NJI while assuring that lim xl = 0. l→∞ Definition 6: Let (ΛJ , ρJ ) be joint degree-distribution polynomials, let  ∈ (0, 1) be the erasure probability of a BEC , and let y ∈ [0, 1] be an instantaneous erasure probability from the joint perspective. We define the effective erasure probability from the local perspective as loc (y) =  · ΛJ (1 − ρJ (1 − y)) . (53) In view of (14a) and (53), we have xl = f (, xl−1 , yl−1 ) = loc (yl−1 )λL (1−ρL (1 − xl−1 )). (54) loc (yl−1 ) takes the role of  when the local code is viewed as a standard LDPC code, hence the term ”effective erasure probability from the local perspective”. 27 Our scheduling scheme is parametrized by η > 0, and is given by xl = f (, xl−1 , yl−1 )   g (, x , y ) |x − x | ≤ η and  (y ) ≥  L l−1 l−1 l−2 l−1 loc l−1 yl = .  y else l−1 (55) Lemma 8: For every η > 0, the scheduling scheme described in (55) is valid. Proof: See Appendix F. Note that if η = 0, the scheduling scheme described in (55) is not valid. However, since local iterations have zero cost in our model, we can assume that we can apply arbitrarily many local iterations to get arbitrarily close to η = 0. Simulations show that η = 10−4 suffices for achieving minimal NJI . Thus, for the following analysis we will assume that η = 0, and that the scheduling scheme is still valid. In this scheduling scheme, the decoder tries to decode the sub-block on the local graph until it gets “stuck”, which refers to not being able to reduce the erasure probability while still strictly greater than zero. This happens first when xl1 = xs (), for some iteration l1 , where xs () is given in Definition 4. So, in the first joint update we have xl1 = xs (), xl1 +1 = xs (), yl1 = 1 yl1 +1 = g(, xs (), 1). In view of (54), the local graph now ”sees” 2 , loc (yl1 +1 ) <  as an effective erasure probability, and it will proceed the decoding algorithm locally. It may get “stuck” again and another joint update will be invoked; this procedure continues until loc (ylp +1 ) < L in the p’th (and last) update, which enables successful local decoding (i.e., NJI = p). In general, let JI {lk }N k=1 be the joint update iterations of the scheduling scheme described above and let k be the effective erasure probability from the local perspective between joint updates i − 1 and i. Then, yl1 = 1, 1 = , xl1 = xs (), ylk = g(, xlk−1 , ylk−1 ), k = loc (ylk ), xlk = xs (k ), 2 ≤ k ≤ NJI , 2 ≤ k ≤ NJI , 2 ≤ k ≤ NJI , (56a) (56b) (56c) (56d) where  = 1 > 2 > . . . > NJI −1 ≥ L > NJI . (57) 28 Note that (56b) holds for every scheduling scheme, but (56d) holds only for the suggested scheduling scheme; in view of Definition 4 Item 2, for any other scheme xlk ≥ xs (k ), 1 ≤ k ≤ NJI . (58) Lemma 9: The scheduling scheme in (56a)-(56d) is optimal. Proof: See Appendix G. We assume from now on that the decoder applies the optimal scheduling scheme in (56a)(56d). B. The Rate vs. NJI Trade-Off As shown in Section V-D, for every 0 < L <  < 1, there exist capacity-achieving LDPCL sequences for the BEC() with a local decoding threshold of L . Moreover, Theorem 4 and Lemma 7 provide a construction of such a sequence. However, the closer an LDPCL ensemble is to capacity, the higher the NJI is; therefore, to decrease NJI we have to pay with rate, and there are several ways to do so. In this section we study how the parameters of the local and joint degree-distributions, λL , ρL , λJ , ρJ , P0 , affect NJI . In particular, we focus on how the local and joint additive gaps to capacity δL and δJ , receptively, affect NJI .  ∞ It is well known that if λ(k) , ρ(k) k=1 is a (ordinary) capacity-achieving sequence for the BEC(), then lim λ(k) (1 − ρ(k) (1 − x)) = x, k→∞ x ∈ [0, ]. (59) This leads to the following lemma. Lemma 10: Let 0 < L <  < 1, and let n o (k) (k) ∞ λL , ρL k=1 be a capacity-achieving sequence for the BEC(L ). Then, xs () , lim x(k) s () = , k→∞   (k) (k) (k) where xs () corresponds to Definition 4 with λL , ρL . Proof: See Appendix H. Lemma 10 asserts that if the local degree-distribution polynomials imply a local threshold L and a design rate that is very close to capacity (1 − L ), and the channel erasure probability is  > L , then the BP decoding algorithm on the local graph gets “stuck” immediately after solving only a small fraction of the erasures. This leads, in view of (56b), to a small change in the erasure-message probability on the joint update, which in turn yields a minor progress 29 on the local side. Therefore, choosing close to capacity local degree-distribution polynomials implies high NJI . Another consequence of (59) is that the change in the erasure-message probability in one iteration of the BP decoding algorithm is small. Thus, close to capacity joint degree-distribution polynomials yield high NJI , regardless of the local degree-distribution polynomials. Example 6: Let L = 0.05 and G = 0.2. We use the capacity-achieving LDPCL sequence for the BEC(G ) with a local decoding threshold of L given in Example 5 A computer program simulated (56a)-(56d) with (50) for different values of DL and DJ , and the results are presented in Figure 7. The plot exemplifies the trade-off between rate and NJI : when the ensemble is close to capacity with δL = 10−2 , δJ = 2.5 · 10−4 (R = 0.79), we get NJI = 570, and to reduce NJI we have to pay with rate. However, there are several ways to do so. For example, changing in the above the local gap to δL = 5 · 10−2 while the joint gap stays δJ = 2.5 · 10−4 yields R = 0.75 and NJI = 26, and changing the local and joint gap to δL = 2.5 · 10−2 and δJ = 4 · 10−2 , respectively, yields the same R = 0.75 but a smaller NJI = 11. Fig. 7. Plot of NJI (◦ marks) and the design rate (+ marks) as a function of the joint additive gap to capacity δJ for different value of the local additive gap to capacity δL . 30 VII. F INITE -L ENGTH A NALYSIS F OR ML D ECODING In this section, we extend to LDPCL codes the finite block-length analysis of [3, Lemma B.2]. We derive upper bounds on the expected block erasure probability under ML decoding of regular LDPCL ensembles (see Section III-A). As shown in [3], the union bound is fairly tight for not too small block lengths, and the performance loss of iterative decoding compared to ML decoding is not too high. This motivates a bounding approach that simplifies the expressions by employing the union bound and the ML decoding analysis For a two-sided Tanner graph G picked from the (M, n, lL , rL , lJ , rJ )-regular ensemble, let L PM B (G, ) designate the expected block decoding failure probability of the code G over the P BEC() when decoded by the ML decoder. In what follows, for a power series f (x) = i fi xi ,   let coef f (x), xi designate the i-th coefficient of f (x), i.e., coef f (x), xi = fi . Definition 7: For every l, r, n, w ∈ N such that n rl ∈ N, l, r, n ≥ 1 and w ≤ n, let !  n l r r r (1+x) +(1−x) coef , xwl 2 A(l, r, n, w) = nl wl  . (60) Theorem 5 (Union Bound - ML Decoding of regular LDPCL Codes): 1) For  ∈ (0, 1), let ¯ = 1 − . 2) For n ∈ N+ , let [n] = {1, 2, . . . , n}, and [n]0 = {0} ∪ [n]. 3) + For m ∈ N, let em 1 = (e1 , e2 , . . . , em ), where for every i ∈ {1, 2, . . . , m}, ei ∈ N , and let [em 1 ]0 = [e1 ]0 × [e2 ]0 × . . . × [em ]0 . Then, M  ML  X E PB (G, ) ≤  m   M (M −m)n X Y n ei (n−ei ) ¯  ¯ m ei m m=1 i=1 em ∈[n] 1   m   X Y · min 1, −1 + A(lJ , rJ , M n, w1 + w2 + . . . + wm ) A(lL , rL , n, wi )   m m  w1 ∈[e1 ]0 i=1 (61) where the expectation is w.r.t. the (M, n, lL , rL , lJ , rJ )-regular ensemble. Proof: Let E ⊆ {1, 2, . . . , M n} be an erasure pattern specifying the indices of the erased code bits, and for every i ∈ {1, 2, . . . , M }, let Ei = E ∩{1+(i−1)n, 2+(i−1)n, . . . , n+(i−1)n} be the erasure pattern in the i-th sub-block. Consider the case that there are erasures only in the 31 first m sub-blocks, i.e., |Ei | > 0, 1≤i≤m (62) |Ei | = 0, l < m ≤ M. It is well known that the ML decoder fails if and only if rank (HE ) < |E|, where H is the parity-check matrix corresponding to a random member of the (lL , rL , lJ , rJ )-regular LDPCL ensemble, and HE is the sub-matrix comprised from the columns of H indexed by E . In view of (1), since the sub-matrices {Hi }M i=0 are picked independent of each other, then applying the union bound yields o n |E| Pr {rank (HE ) < |E|} = Pr ∃x ∈ F2 \ {0}, HE xT = 0 X  ≤ Pr HE xT = 0 x∈ |E| F2 (63a) (63b) \{0} = −1 + X x∈ = −1 +  Pr HE xT = 0 (63c) |E| F2 X |E1 | x1 ∈F2 X ...  Pr H0E (x1 , . . . , xl )T = 0 |Em | xm ∈ F 2 · m Y (63d) Pr HiEi xTi = 0  i=1 The steps until getting to (63c) are the standard ones from [3], while (63d) follows from the subblock structure introduced in LDPCL codes. By marking wi = w(xi ) for every i ∈ {1, 2, . . . , m}, |E | as the Hamming weight of the sub-word xi ∈ F2 i we get (see [3, Lemma B.2.])  Pr H0E (x1 , x2 , . . . , xl )T = 0 = A(lJ , rJ , M n, wi + w2 + . . . + wl ).  Pr HiEi xTi = 0 = A(lL , rL , n, wi ). (64) Combining (63d) and (64) implies that if (62) holds, then Pr {rank (HE ) < |E|} ≤ −1+ |E1 | |E2 | X X w1 =0 w2 =0 ... |El | X A(lJ , rJ , M n, wi + w2 + . . . + wl ) wm =0 m Y (65) A(lL , rL , n, wi ). i=1 Since the BEC is memoryless, then Pr {E} = ¯(M −m)n m Y |Ei | ¯(n−|Ei |) . (66) i=1 From symmetry, (65) holds for every error pattern E that lies in exactly m sub-blocks (i.e., not only the first m sub-blocks). Finally, summing over m ∈ {1, 2, . . . , M } and counting every error 32 pattern imply  L  X E PM Pr {E} Pr {rank (HE ) < |E|} B (G, ) = E M X  m   M (M −m)n X Y n ei (n−ei ) ¯  ¯ m ei m m m=1 e1 ∈[n] i=1   m   X Y · min 1, −1 + A(lJ , rJ , M n, w1 + w2 + . . . + wl ) A(ll , rL , n, wi ) .   m m ≤  i=1 w1 ∈[e1 ]0 (67) Figure 8 plots the upper bound in (61) for the (2, 6, 1, 6)-regular LDPCL ensemble, with locality M = 2, 3 and sub-block length n = 180, 120, respectively. Also shown is the upper bound in [3, Lemma B.2] for the standard (3, 6)-regular LDPC ensemble. The ensembles in Figure 8 have the same total block length of 360 (in view of Corollary 1, the iterative decoding performance of the (2, 6, 1, 6)-regular LDPCL ensemble and the (3, 6)-regular LDPC ensemble coincide as n → ∞). Figure 8 exemplifies the trade-off between the sub-block local-access capability (M ) and the error correcting capability over the global block; for every  ∈ [0.05, 0.5] the block decoding failure probability increases as M increases. While Figure 8 is just an example with not very realistic parameters1 , we expect the same trade-off to apply in more generality: finer sub-block access with efficient local decoding has a cost in terms of the global-decoding performance (for the same rate and global code length). VIII. S UMMARY This paper lays out the theoretical foundation for multi-block LDPC codes. This coding scheme enables fast read access to small blocks, and provides high data-protection on large blocks in case of more severe error events. The decoding algorithm suggested is the belief-propagation algorithm ,and by analyzing the asymptotic (as the sub-block length n tends to infinity) performance of this decoding algorithm on LDPCL codes, we provided a simple way to construct capacity-achieving sequences that enjoy a locality property (Theorem 4 and Lemma 7). We found that the fraction of jointly-unconnected variable nodes, P0 , plays an important role in determining the asymptotic decoding threshold and in achieving capacity. 1 Due to the combinatorial nature of the expression in (59), it is computationally difficult to evaluate the bounds for longer codes. 33 Fig. 8. Comparison of the bound in (61) ((2,6,1,6)-LDPCL code) with M = 2, 3 and n = 180, 120, respectively, and in [3, Lemma B.2] ((3,6)-LDPC code) with n = 360. It is known [16] that there is an inherent trade-off between the gap to capacity and the encoding and decoding complexity of irregular LDPC codes over the BEC . Since it is of interest that the decoding algorithm will avoid joint updates as much as possible, we studied another trade-off regarding the number of joint iterations and the gap to capacity (see Example 6). By deriving an upper bound on the block-erasure probability of finite-length LDPCL codes under ML decoding, we showed how the loss in performance is affected by the locality structure. Future work cis needed toward generalizing the results of this paper to other codes defined on graphs, such as Repeat-Accumulate (RA) [4], [8] codes or Accumulate-Repeat-Accumulate (ARA) codes [13], which achieve capacity on the BEC with bounded complexity per information bit. Future studies can also be on considering memoryless binary-input output-symmetric (MBIOS) channels other than the BEC . 34 A PPENDIX A P ROOF OF L EMMA 2 1) Assume that x = 0. Since ΛL (0) = 0, (14b) implies that y = g(, 0, y) = 0. Moreover, if y = 0 and P0 = 0, then (14a) yields x = f (, x, 0) = 0. Finally, if y = 0 and λJ (0) > 0, then (14b) implies that 0 = ΛL (1 − ρL (1 − x)), hence ρL (1 − x) = 1 and x = 0. 2) Follows immediately from (14a), (14b) and (16). 3) We prove (17) by a mathematical induction. For l = 0, (17) holds due to Item 2 and the fact that x0 = y0 = . Assume correctness of (17) for some l ≥ 0 and consider iteration l + 1. In view of Lemma 1, eq. (15) and the induction assumption, it follows that xl+1 = f (, xl , yl ) ≥ f (, x, y) = x, (68) yl+1 = g (, xl , yl ) ≥ g(, x, y) = y. This prove correctness of (17) for l + 1 and by mathematical induction proves (17) for all l ≥ 0. A PPENDIX B P ROOF OF L EMMA 4 Let I = min{i : ΛL,i > 0}. Since ΛL (0) = 0, then I ≥ 1. The connection between λL (·) and ΛL (·) in (4a) yields ΛL (u) ΛL (u) = lim 0 · Λ0 (1) u→0 λL (u) u→0 ΛL (u) P i i≥I ΛL,i u 0 = Λ (1) lim P i−1 u→0 i≥I iΛL,i u P uI i≥I ΛL,i ui−I 0 = Λ (1) lim I−1 P i−I u→0 u i≥I iΛL,i u lim = Λ0 (1) ΛL,I lim u IΛL,I u→0 = 0. Further, let u(x) = 1 − ρL (1 − x) and note that limx→0 u(x) = 0. Thus, lim x · x→0 ΛL (1 − ρL (1 − x)) ΛL (u(x)) ΛL (u) = lim x · lim = lim x · lim = 0. λL (1 − ρL (1 − x)) x→0 x→0 λL (u(x)) x→0 u→0 λL (u) (69) 35 A PPENDIX C P ROOF OF L EMMA 5 Let  ∈ (0, 1) and let (x, y) be a solution to (16) with y > 0. In view of (14a) and (14b), dividing the first equation of (16) with the second one yields x λL (1 − ρL (1 − x)) · ΛJ (1 − ρJ (1 − y)) = y λJ (1 − ρJ (1 − y)) · ΛL (1 − ρL (1 − x)) (70) which after some rearrangements implies qJ (y) = qL (x), (71) where qJ (·) and qL (·) are defined in (24). In view of (24), since (x, y) is an (f, g)-fixed point, then ΛJ (1 − ρJ (1 − y)) λJ (1 − ρJ (1 − y)) ΛJ (1 − ρJ (1 − y)) = g(, x, y) · λJ (1 − ρJ (1 − y)) qJ (y) = y · ≤1 ≤1 ≤1 }| { z }| { z}|{ z =  · ΛJ (1 − ρJ (1 − y)) · ΛL (1 − ρL (1 − x)) ≤ 1, (72) which together with Definition 3 and (71) completes the proof. A PPENDIX D P ROOF OF T HEOREM 3 Let > inf y∈(0,1] qJ (y)≤1 y . g(1, q(y), y) (73) There exists y0 ∈ (0, 1] such that qJ (y0 ) ≤ 1 and y0 =  · g(1, q(y0 ), y0 ) =  · λJ (1 − ρJ (1 − y0 )) · ΛL (1 − ρL (1 − q(y0 ))). (74) In view of (25), qL (q(y0 )) = qJ (y0 ), (75) 36 which combined with (14a) and (24) yields q(y0 ) = λL (1 − ρL (1 − q(y0 ))) ΛJ (1 − ρJ (1 − y0 )) · y0 · ΛL (1 − ρL (1 − q(y0 ))) λJ (1 − ρJ (1 − y0 )) =  · λL (1 − ρL (1 − q(y0 ))) · ΛJ (1 − ρJ (1 − y0 )) = f (, q(y0 ), y0 ). (76) Thus, (q(y0 ), y0 ) is a non zero (f, g)-fixed point, which in view of Theorem 2 implies that  > ∗G . Hence, ∗G ≤ inf y∈(0,1] qJ (y)≤1 y . g(1, q(y), y) (77) y g(1, q(y), y) (78) Next, let < inf y∈(0,1] qJ (y)≤1 and let (x, y) be a solution to (16). In what follows, we prove that y = 0. Assume to the contrary that y > 0. From Lemma 5 it follows that x ≤ q(y), which in view Lemma 1, (72) and (78) implies y = g(, x, y) ≤ g(, q(y), y) < y, (79) in contradiction; thus, y = 0. Next, consider two cases: 1) If P0 = 0 or λJ (0) > 0, then Item 1 of Lemma 2 implies that x = 0. Hence, every (f, g)-fixed point satisfies y = x = 0. In view of Theorem 2, it follows that if (78) holds, then  < ∗G , so ∗G ≥ inf y∈(0,1] qJ (y)≤1 y g(1, q(y), y) (80) which with (77) completes the proof when P0 = 0 or λJ (0) > 0. 2) If P0 > 0 and λJ (0) = 0, it is not true in general that for every fixed point (x, y), y = 0 implies x = 0. However, if in addition to (78), < 1 x · inf , P0 (0,1] λL (1 − ρL (1 − x)) (81) and y = 0 for some fixed point (x, y), then x = 0. To see this, assume to the contrary that x > 0. In view of (14a) and (81) it follows that x = f (, x, 0) =  · P0 · λL (1 − ρL (1 − x)) < x (82) 37 ∗G . in contradiction; hence, if (78) and (81) hold, x = 0 thus  < This means that       y ∗ x 1 (83) G ≥ min inf g(1,q(y),y) , P0 · inf λL (1−ρL (1−x)) .   (0,1]   y∈(0,1] qJ (y)≤1 To complete the proof, we must show that when P0 > 0 and λJ (0) = 0, then       y ∗ x 1 G ≤ min inf g(1,q(y),y) , P0 · inf λL (1−ρL (1−x)) .   (0,1]   y∈(0,1] (84) qJ (y)≤1 If inf y∈(0,1] qJ (y)≤1 y 1 y inf ≤ , g(1, q(y), y) P0 (0,1] λL (1 − ρL (1 − y)) then (84) follows immediately from (77); hence we can assume that y 1 y > . inf g(1, q(y), y) P0 (0,1] λL (1 − ρL (1 − y)) (85) y y 1 >> inf , g(1, q(y), y) P0 (0,1] λL (1 − ρL (1 − y)) (86) inf y∈(0,1] qJ (y)≤1 Let inf y∈(0,1] qJ (y)≤1 and let x0 ∈ (0, 1], such that x0 =  · P0 · λL (1 − ρL (1 − x0 )). Since λJ (0) = 0, it follows that (x0 , 0) is a fixed point with x0 > 0, thus  > ∗G . Since this is true for every  > 1 P0 inf (0,1] y λL (1−ρL (1−y)) , then ∗G ≤ 1 P0 inf (0,1] y λL (1−ρL (1−y)) . In view of (85), it follows that (84) holds. This completes the proof for the P0 > 0 and λJ (0) = 0 case. A PPENDIX E P ROOF OF L EMMA 6 In view of (8), x (0,1] λL (1 − ρL (1 − x)) x = inf . P4 i−1 (0,1] 1 − i=2 ρi (1 − x) L = inf Since ρ2 = 1 − ρ3 − ρ4 , we get x (0,1] (1 + ρ3 + 2ρ4 )x − (ρ3 + 3ρ4 )x2 + ρ4 x3 1 = sup(0,1] [(1 + ρ3 + 2ρ4 ) − (ρ3 + 3ρ4 )x + ρ4 x2 ] L = inf = 1 . 1 + ρ3 + 2ρ4 38 In view of Definition 4, we have   h (x) =  (1 + ρ3 + 2ρ4 )x − (ρ3 + 3ρ4 )x2 + ρ4 x3 − x    = x  (1 + ρ3 + 2ρ4 ) − (ρ3 + 3ρ4 )x + ρ4 x2 − 1 , thus xs () is a root of ρ4 x2 − (ρ3 + 3ρ4 )x + (1 + ρ3 + 2ρ4 ) − implies ρ3 = 1 L −1 > 1  1  (87) in (0, 1). If ρ4 = 0, then (39) − 1, so the solution given by (40) is in (0, 1). If ρ4 > 0, then the quadratic formula implies r ρ3 +3ρ4 ± xs () =   1 (ρ3 +ρ4 )2 +4ρ4  −1 . 2ρ4 (88) Note that ‘ + ‘ option violates the constraint xs () ≤ 1. Moreover, since  > L = 1+ρ31+2ρ4 , then q  p (ρ3 + ρ4 )2 + 4ρ4 1 − 1 ≤ ρ23 + 6ρ3 ρ4 + 9ρ24 = ρ3 + 3ρ4 ; hence xs () as given in (41) is q  strictly positive. Furthermore, we have (ρ3 + ρ4 )2 + 4ρ4 1 − 1 ≥ ρ3 + ρ4 , so xs () ≤ 1.  Finally, since λL (x) = x, then by definition 2 xs () , and completes the proof.  xs ()  = 1 − ρL (1 − xs ()), which yields as () = A PPENDIX F P ROOF OF L EMMA 8 To prove Lemma 8 we need the following lemma. Lemma 11: A scheduling scheme is valid if and only if, loc (yl ) < L , for some iteration l. Proof: Recall the definition of the local threshold, L = sup{ : x = λL (1 − ρL (1 − x)) has no solution in (0, 1]}, (89) and let x = lim xl and y = lim yl . Since under every scheduling scheme yl is monotonically l→∞ l→∞ non-increasing in l, then in view of (54), ∃l ∈ N, loc (yl ) < L m loc (y) < L m x = loc (y)λL (1−ρL (1 − x)) has no solution for x ∈ (0, 1] m lim xl = 0. l→∞ 39 Let (ΛL , ΛJ , ΩL , ΩJ ) be degree-distribution polynomials, and let  ≤ ∗G (ΛL , ΛJ , ΩL , ΩJ ). Let (x, y) = lim (xl , yl ). Assume in contradiction that loc (y) ≥ L . Since η > 0, letting l → ∞ l→∞ in (55) implies that (x, y) is a non-trivial (f, g)-fixed point. However, in view of Theorem 2, if  ≤ ∗G (ΛL , ΛJ , ΩL , ΩJ ), every (f, g)-fixed point is the trivial point, in contradiction. Thus, loc (y) < L which, due to Lemma 11, completes the proof. A PPENDIX G P ROOF OF L EMMA 9 (2) (1) n oNJI n oNJI (2) (1) be the joint-update iterations of the scheduling scheme described and lk Let lk k=1 k=1 in (56d) and in some arbitrary valid scheduling scheme, receptively. We need to show that (1) (2) NJI ≤ NJI . To proceed we need the next lemma: Lemma 12:   (1) (2) 1 ≤ k ≤ min NJI , NJI . (90) k k   (1) (2) Proof: By induction on 1 ≤ k ≤ min NJI , NJI . In the first joint update, we have yl(1) ≤ yl(2) , yl(1) = 1 = yl(2) , so (90) holds for k = 1. Assume correctness for some joint update k < 1 1  (1) (2) min NJI , NJI , and consider update k + 1. In view of Lemma 1, (56b)-(56d), (58) and the induction assumption,   yl(1) = g , xl(1) , yl(1) k+1 k+1 k+1     (1) = g , xs k , yl(1) k   ≤ g , xl(2) , yl(2) k k = yl(2) , k+1 which by induction, completes the proof. (1) (2) Assume, on the contrary, that NJI > NJI . Let   (1) (1) k = loc yl(1) , 1 ≤ k ≤ NJI , k   (2) (2) k = loc yl(2) , 1 ≤ k ≤ NJI . (91) k (2) Lemma 12 implies that yl(1) ≤ yl(2) , for every k ∈ {1, . . . , NJI }. Hence, k k (1) (2) k ≤ k , (2) ∀k ∈ {1, . . . , NJI }. (92) 40 Since (1) NJI > (2) NJI , (57) and (92) imply (2) (2) NJI  (1) (2) NJI ≥ (1) (1) NJI −1 ≥ ≥ L , (93) (2) n oNJI (2) is not which, in view of Lemma 11 yields that the scheduling scheme indexed by lk valid, in contradiction. Thus, (1) NJI ≤ k=1 (2) NJI . A PPENDIX H P ROOF OF L EMMA 10 (k) In view of Definition 4, let h (x) = λ(k) (1 − ρ(k) (1 − x)) − x. Eq. (59) yields      − 1 x 0 ≤ x ≤ L L h (x) = lim h(k)  (x) =  −x k→∞  ≤x≤ (94) L For every k ∈ N, and x ∈ (, 1], (k) (k) h(k)  (x) = λ (1 − ρ (1 − x)) − x ≤−x < 0, Thus x(k) s () ≤ , ∀k ∈ N. (95) In addition, for every 0 < a <  there exists K0 such that h(k)  ( − a) > 0, ∀k ≥ K0 , (k) so xs () ≥  − a, for every k ≥ K0 ; hence, lim inf x(k) s () ≥ . k→∞ (96) (k) Combining (95) and (96) implies that lim xs () exists, and completes the proof. k→∞ R EFERENCES [1] M. Blaum and S. Hetzler, “Integrated interleaved codes as locally recoverable codes: properties and performance,” Int. J. Inf. Coding Theory, vol. 3, no. 4, pp. 324344, Jan. 2016. [2] Y. Cassuto, E. Hemo, S. Puchinger and M. Bossert, “Multi-block interleaved codes for local and global read access”, Proc. 2017 IEEE International Symposium on Information Theory, pp. 1758–1762, Aachen, Germany, June 2017. 41 [3] C. Di, D. Proietti, E. Teletar, T. J. Richardson, and R. L. Urbanke, “Finite-length analysis of low-density parity-check codes on the binary erasure channel”, IEEE Trans. on Inf. Theory, vol. 48, no. 6, pp. 1570–1579, Aug. 2002. [4] D. Divsalar, H. Jin, and R. J. McEliece, “Coding theorems for turbo-like codes,” Proc. 36th Allerton Conf. on Communication, Control, and Computing, pp. 201-210, Allerton, Illinois, Sept. 1998. [5] R. Gallager, “Low-density parity-check codes,” IRE Trans. on Inf. Theory, vol. 8, no. 1, pp. 21–28, Jan. 1962. [6] M. Hassner, K. Abdel-Ghaar, A. Patel, R. Koetter, and B. Trager, “Integrated interleaving a novel ECC architecture,” IEEE Trans. Magn., vol. 37, no. 3, pp. 773-775, Feb. 2001. [7] J. Han and L. A. Lastras-Montano, “Reliable memories with subline accesses,” Proc. 2007 IEEE International Symposium on Information Theory, pp. 2531–2535, Nice, France, June 2007. [8] H. Jin A. Khandekar and R. J. McEliece, “Irregular repeat-accumlate codes,” Proc. 2nd Int. Conf. Turbo Codes and Related Topics, pp. 18, Brest, France, Sep. 2000. [9] S. Kudekar, T. J. Richardson, and R. L. Urbanke, “Threshold saturation via coupling: why convolutional LDPC ensembles perform so well over the BEC,” IEEE Trans. Inf. Theory, vol. 57, no. 2, pp. 803-834, Feb. 2011. [10] J. Li, K. Liu, S. Lin, K. Abdel-Ghaffar, “Reed-solomon based nonbinary globally coupled LDPC codes: Correction of random errors and bursts of erasures”, Proc. 2017 IEEE International Symposium on Information Theory, pp. 381–385, Aachen, Germany, June 2017. [11] M.G. Luby, M. Mitzenmacher, M.A. Shokrollahi, and D.A. Spielman, “Efficient erasure correcting codes,” IEEE Trans. on Inf. Theory, vol. 47, no. 2, pp. 569-584, Feb. 2001. [12] P. Oswald and M. A. Shokrollahi, “Capacity-achieving sequences for the erasure channel, IEEE Trans. on Inf. Theory, vol. 48, no. 12, pp. 3017-3028, Dec. 2002. [13] H. D. Pfister and I. Sason, “AccumulateRepeatAccumulate codes: capacity-achieving ensembles of systematic codes for the erasure channel with bounded complexity”, IEEE Trans. on Inf. Theory, vol. 53, no. 6, pp. 2088– 2115, June. 2007. [14] P. Razaghi and W. Yu, “Bilayer low-density parity-check codes for decode-and-forward in relay channels”, IEEE Trans. on Inf. Theory, vol. 53, no. 10, pp. 3723-3739, Sep. 2007. [15] T. Richardson and R. Urbanke, Modern Coding Theory, New York, NY, USA: Cambridge Univ. Press, 2008. [16] M. A. Shokrollahi, “New sequences of linear time erasure codes approaching the channel capacity,” in Proc. 13th International Symposium on Applied Algebra, Algebraic Algorithms, and Error-Correcting Codes, vol. 1719, pp. 65-76, Nov. 1999.
7cs.IT
arXiv:1510.09202v1 [cs.CL] 30 Oct 2015 Generating Text with Deep Reinforcement Learning Hongyu Guo National Research Council Canada [email protected] Abstract We introduce a novel schema for sequence to sequence learning with a Deep QNetwork (DQN), which decodes the output sequence iteratively. The aim here is to enable the decoder to first tackle easier portions of the sequences, and then turn to cope with difficult parts. Specifically, in each iteration, an encoder-decoder Long Short-Term Memory (LSTM) network is employed to, from the input sequence, automatically create features to represent the internal states of and formulate a list of potential actions for the DQN. Take rephrasing a natural sentence as an example. This list can contain ranked potential words. Next, the DQN learns to make decision on which action (e.g., word) will be selected from the list to modify the current decoded sequence. The newly modified output sequence is subsequently used as the input to the DQN for the next decoding iteration. In each iteration, we also bias the reinforcement learning’s attention to explore sequence portions which are previously difficult to be decoded. For evaluation, the proposed strategy was trained to decode ten thousands natural sentences. Our experiments indicate that, when compared to a left-to-right greedy beam search LSTM decoder, the proposed method performed competitively well when decoding sentences from the training set, but significantly outperformed the baseline when decoding unseen sentences, in terms of BLEU score obtained. 1 Introduction Many real-world problems can be effectively formulated as sequence to sequence learning. Important applications include speech recognition, machine translation, text rephrasing, question answering. For example, the last three can be expressed as mapping a sentence of words to another sequence of words. A major challenge of modeling these tasks is the variable length of sequences which is often not known a-priori. To address that, an encoder-decoder Long Short-Term Memory (LSTM) architecture has been recently shown to be very effective [8, 30]. The idea is to use one LSTM to encode the input sequence, resulting in a fixed dimensional vector representation. Subsequently, another LSTM is deployed to decode (generate) the output sequence, using the newly created vector as the LSTM’s initial state. The decoding process is essentially a recurrent neural network language model [19, 29]. Decoding schema based on recurrent language models naturally fits a left-to-right decoding procedure, which aims to obtain an output sequence with the maximal probability or to select the top list of sequence candidates for further post-processing. In this paper, we propose an alternative strategy for training an end-to-end decoder. Specifically, we employ a Deep Q-Network (DQN) to embrace an iterative decoding strategy. In detail, the input sequence is first encoded using an encoder-decoder LSTM network. This process automatically generates both informative features to represent the internal states of and a list of potential actions for a DQN. Next, the DQN is employed to iteratively decode the output sequence. Consider rephrasing a natural sentence. This list of potential actions can contain the ranked word candidates. In this scenario, the DQN learns to make decision on which word will be selected from the list to modify the current decoded sequence. The newly edited output sequence is subsequently used as the input to the DQN for the next decoding iteration. Inspired by the recent success of attention mechanisms [3, 13, 20, 28], we here also bias the reinforcement 1 learning’s attention, in each iteration, to explore sequence portions which are previously difficult to be decoded. The decoded sequence of the last iteration is used as the final output of the model. In this way, unlike the left-to-right decoding schema, the DQN is able to learn to first focus on the easier parts of the sequence, and the resulted new information is then use to help solve the difficult portions of the sequence. For example, a sentence from our testing data set was decoded by the encoder-decoder LSTMs as “Click here to read more than the New York Times .”, which was successfully corrected by the DQN as “Click here to read more from the New York Times .” in the second iteration. For evaluation, the proposed strategy was trained to encode and then decode ten thousands natural sentences. Our experimental studies indicate that the proposed method performed competitively well for decoding sentences from the training set, when compared to a left-to-right greedy beam search decoder with LSTMs, but significantly outperformed the baseline when decoding unseen sentences, in terms of BLEU [25] score obtained. Under the context of reinforcement learning, decoding sequential text will need to overcome the challenge arise from the very large number of potential states and actions. This is mainly due to the flexible word ordering of a sentence and the existence of a large number of words and synonyms in modern dictionaries. To our best knowledge, our work is the first to decode text using DQN. In particular, we employ LSTMs to not only generalize informative features from text to represent the states of DQN, but also create a list of potential actions (e.g., word candidates) from the text for the DQN. Intuitively, the application of the DQN here also has the effect of generating synthetic sequential text for the training of the networks, because of the DQN’s exploration strategy in training. 2 Background Reinforcement Learning and Deep Q-Network Reinforcement Learning (RL) is a commonly used framework for learning control policies by a computer algorithm, the so-called agent, through interacting with its environment Ξ [1, 27]. Given a set of internal states S = s1 , . . . , sI and a set of predefined actions A = a1 , . . . , ak , the agent takes action a at state s, by following certain policies or rules, will result in a new state s, and receive a reward r from Ξ. The aim of the agent is to maximize some cumulative reward through a sequence of actions. Each such action forms a transition tuple (s, a, r, s, ) of a Markov Decision Process (MDP). Practically, the environment is unknown or partially observed, and a sequence of state transition tuples can be used to formulated the environment. Q-Learning [34] is a popular form of RL. This model-free technique is used to learn an optimal action-value function Q(s, a), a measure of the action’s expected long-term reward, for the agent. Typically, Q-value function relies on all possible state-action pairs, which are often impractically to be obtained. A work around for this challenge is to approximate Q(s, a) using a parameterized function Q(s, a; θ). The parameter θ is often learned by features generalized over the states and actions of the environment [4, 31]. Promisingly, benefiting from the recent advance in deep learning techniques, which have shown be able to effectively generate informative features for a wide ranges of difficult problems, Mnih et al. [21] introduced the Deep Q-Network (DQN). The DQN approximates the Q-value function with a non-linear deep convolutional network, which also automatically creates useful features to represent the internal states of the RL. In DQN, the agent interacts with environment Ξ in discrete iteration i, taking aim to maximize its long term reward. Starting from a random Q-function, the agent continuously updates its Q-values by taking actions and obtaining rewards, through consulting a current Q-value function. The iterative updates are derived from the Bellman equation, where the expectation E is often computed over all transition tuples that involved the agent taking action a in state s [31]: Qi+1 (s, a) = E[r + λmax Qi (s, , a, |s, a) , a (1) Where λ is a discounted factor for future rewards. DQN requires informative representation of internal states. For playing video games, one can infer state representations directly from raw pixels of screens using a convolutional network [21]. However, text sentences, for instance, not only contain sequential nature of text, but also have variable length. The LSTM’s ability to learn on data with long range temporal dependencies and varying lengths makes it a natural choice to replace the convolutional network in the DQN for our application here. Next, we will briefly describe the LSTM network. 2 Long Short-Term Memory Recurrent Neural Networks Through deploying a recurrent hidden vector, Recurrent Neural Networks (RNNs) 1 can compute compositional vector representations for sequences of arbitrary length. The network learns complex temporal dynamics by mapping a length T input sequence < x1 , x2 , . . . , xT > to a sequence of hidden states < h1 , h2 , . . . , hT > (ht ∈ RN ). The networks compute the hidden state vector via the recursive application of a transition function: ht = Γ(Wxh xt + Whh ht−1 + bh ) (2) where Γ is an element-wise non-linearity sigmoid function; the W terms denote weight matrices (e.g. Wxh is the input-hidden weight matrix); bh is hidden bias vector. A popular variant of RNNs, namely LSTMs are designed to overcome the vanishing gradient issue in RNNs, thus better modeling long term dependencies in a sequence. In addition to a hidden unit ht , LSTM includes input gate, forget gate, output gate and memory cell unit vectors, for the following purposes. The memory cell unit ct , with a self-connection, is capable of considering two pieces of information. The first one is the previous memory cell unit ct−1 , which is modulated by the forget gate. Here, the forget gate embraces the hidden states to adaptively reset its cell unit through the self-connection. The second piece of information is a function of the current input and previous hidden state, modulated by the input gate. Intuitively, the LSTM can learn to selectively forget its previous memory or consider its current input. Similarly, the output gate learns how much of the memory cell to transfer to the hidden state. These additional cells enable the LSTM to preserve state over long periods of time [8, 12, 30, 32]. Figure 1: Iteratively decoding with DQN and LSTM; the encoder-decoder LSTM network is depicted as gray-filled rectangles on the bottom; the top-left is the graphical illustration of the DQN with bidirectional LSTMs; the dash arrow line on the right indicates the iteration loop. 3 Generating Sequence with Deep Q-Network We employ an encoder-decoder LSTM network, as presented in [30], to automatically generate informative features for a DQN, so that the DQN can learn a Q-value function to approximate its long term rewards. The learning algorithm is depicted in Figure 1 and Algorithm 1. 3.1 Generating State Representations with LSTMs The encoder-decoder LSTM network is depicted as gray-filled rectangles in Figure 1. For descriptive purpose, we named this State Generation Function (denoted as StateGF) under the context of DQN. In detail, given a natural sentence with N tokens, < x1 , x2 , . . . , xN > (denoted as EnSen). We first encode the sequence using one LSTM (denoted as EnLSTM), reading into the tokens (e.g., words) one timestep at a time (e.g., < A, B, C > in Figure 1). When reaching the end of the sentence (<EOS> in Figure 1), this encode process results in a fixed dimensional vector representation for en the whole sentence, namely the hidden layer vector hen N . Next, the resulted hN is used as the initial state of another LSTM (denoted as DeLSTM) for decoding to generate the target sequence < y1 , y2 , . . . , yT >. In this process, the hidden vectors of the DeLSTM are also conditioned on its input (i.e., < Ai , Bi , Ci > in Figure 1; for a typical language model, this will be < y1 , y2 , . . . , yT >). 1 We here describe the commonly used Elman-type RNNs [11]; other variants such as Jordan-type RNNs [15] are also available in the community. 3 de de de N Consequently, the DeLSTM creates a sequence of hidden states < hde 1 , h2 , . . . , hT > (ht ∈ R ) for each time step. Next, each of these hidden vectors is fed into a Softmax function to produce a distribution over the C possible classes (e.g., words in a vocabulary or dictionary), thus creating a t t t list of word probabilities at each time step t, i.e., < Wpro1 , Wpro2 , . . . , WproV > (V is the size of the dictionary): exp(wcT hde t ) t P (Wpro = c|EnSen, ϑ) = PC (3) T de c=1 exp(wc ht ) where wc is the weight matrix from the hidden layer to the output layer. These probabilities can be further processed by a Argmax function, resulting in a sequence of output words, namely a sentence < y1i , y2i , . . . , yTi > (denoted as DeSeni ; i indicates the i-th iteration of the DQN, which will discussed in detail later). The parameter ϑ for the decoder-encoder LSTMs, namely the StateGF function, is tuned to maximize the log probability of a correct decoding sentence Y given the source sentence X, using the following training objective: X logp(Y |X) (4) 1/|S| (X,Y )∈S where S is the training set. After training, decoding output sequence can be achieved by finding the most likely output sequence according to the DeLSTM: Ŷ = argmaxp(Y |X) (5) Y A straight forward and effective method for this decoding search, as suggested by [30], is to deploy a simple left-to-right beam search. That is, the decoder maintains a small number of incomplete sentences. At each timestep, the decoder extends each partial sentence in the beam with every possible word in the vocabulary. As suggested by [30], a beam size of 1 works well. In this way, feeding the state generate function with EnSen will result in a decoded sentence DeSen. The DQN decoding, which will be discussed next, employs an iteration strategy, so we denote this sentence sequence pair as EnSeni and DeSeni ; here i indicates the i-th iteration of the DQN. 3.2 Iteratively Decoding Sequence with Deep Q-Network At each decoding iteration i, the DQN considers the sentence pair, namely the EnSeni and DeSeni (i.e., < A, B, C > and < Ai , Bi , Ci >, respectively, in Figure 1) as its internal state. Also, the ranked words list 2 for each time step t of the DeLSTM is treated as the potential actions by the DQN. From these lists, the DQN learns to predict what actions should be taken in order to accumulate larger long time reward. In detail, each hidden vector hde t in the DeLSTM is fed into a neural network (depicted as DQN in figure 1 and graphically illustrated on the top-left subfigure; will be further discussed in Section 3.3). These neural networks learn to approximate the Q-value function given the DQN’s current state, which contains the EnSeni and DeSeni as well as the word probability list at each time step t of the DeLSTM. The DQN will take the action with the max Q-value in the outputs. Consider, the DQN takes an action, namely selects the t-th time step word ybti in iteration i. Then the current state of the DQN will be modified accordingly. That is, the DeSeni will be modified by replacing the word at time step t, namely replacing yti with ybti . This process results in a new decoded sentence, namely DeSeni+1 (depicted as < Ai+1 , Bi+1 , Ci+1 > in Figure 1). Next, the similarity of the target sentence < y1 , y2 , . . . , yT > and the current decoded sentence DeSeni+1 is evaluated by a BLEU metric [25], which then assigns a reward ri to the action of selecting ybti . Thus, a transition tuple for the DQN contains [(EnSeni , DeSeni ), ybti , ri , ([EnSeni , DeSeni+1 ]). In the next iteration of the DQN, the newly generated sentence DeSeni+1 is then fed into the DQN to generate the next decoded sentence DeSeni+2 . The training of the DQN is to find the optimal weight matrix θ in the neural networks. That is, the Q-network is trained by minimizing a sequence of loss functions Li (θi ) at each iteration i: Li (θi ) = Es,a [(qi − Q(s, a; θi ))2 ] 2 (6) This list has the same size as that of the vocabulary; but one can use only a few of the top ranked words. 4 Algorithm 1 Generating Text with Deep Q-Network 1: Initialize replay memory D; initialize EnLSTM, DeLSTM, and DQN with random weights 2: Pretraining Encoder-Decoder LSTMs 3: for epoch = 1,M do 4: randomize given training set with sequence pairs < X, Y >. 5: for each sequence pair EnSenk ∈ X and T aSenk ∈ Y do 6: Encode EnSenk with EnLSTM, and then predict the next token (e.g., word) in T aSenk with DeLSTM. 7: end for 8: end for 9: Training Q-value function 10: for epoch = 1,U do 11: for each sequence pair EnSenk ∈ X and T aSenk ∈ Y (with length l) do 12: feed EnSenk into pretrained encoder-decoder LSTMs; obtain the decoded sequence DeSenk 0 13: for iteration i = 1, 2l do 14: if random() < ǫ then 15: select a random action at (e.g., word w) at time step t of DeSenk i (selection biases to incorrect decoded tokens) 16: else 17: compute Q(si , a) for all actions using DQN; select at = argmaxQ(Si , a), resulting in a new token w for the 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: t-th token in DeSenk i end if k replace DeSeni with w, resulting DeSenk i+1 k compute the similarity of DeSenk i+1 and T aSen , resulting reward score ri k store transition tuple [si , ai , ri , si+1 ] in replay memory D; si = [EnSenk i , DeSeni ]. random sample of transition [si , at , ri , si+1 ] in D if ri > σ (preset BLEU score threshold) then qi = ri ; current sequence decoding successfully complete. else qi = ri + λmaxa, Q(s, , a, ; θi−1 ) end if perform gradient descent step on only the DQN network (qi − Q(s, a; θi ))2 end for end for end for where qi = Es,a [ri + λmaxa, Q(s, , a, ; θi−1 )|s, a] is the target Q-value, or reward, with parameters θi−1 fixed from the previous iteration. In other words, the DQN is trained to predict its expected future reward. The updates on the parameters Li (θi ) is performed with the following gradient: ∇θi Li (θi ) = Es,a [2(qi − Q(s, a; θi ))∇θi Q(s, a; θi )] (7) After learning the Q-value function, the agent chooses the action with the highest Q(s, a) in order to maximize its expected future rewards when decoding sequences. Quite often, a trade-off between exploration and exploitation strategy is employed for the agent. That is, through following an ǫgreedy policy, the agent can perform a random action with probability ǫ [31]. Inspired by the recent success of attention mechanisms [3, 13, 20, 28], we here bias the reinforcement learning’s attention to explore the sequence portions which are difficult to be decoded. That is, the random actions have more chance to be picked for tokens which were decoded incorrectly from the previous iterations. 3.3 Bidirectional LSTMs for DQN During decoding, we would like the DQN to have information about the entire input sequence, i.e., < Ai , Bi , Ci > in Figure 1. To attain this goal, we deploy a bidirectional LSTMs [12]. Specifically, for a specific time step t of a given sequence, a Bidirectional LSTM [12] enables the hidden states to summarize time step t’s past and future in the sequence. The network deploys two separate hidden layers to precess the data in both directions: one from left to right (forward), and another right to left (backward). At each time step, the hidden state of the Bidirectional LSTM is the concatenation of the forward and backward hidden states, and then fed forwards to the same output layer. That is, Equation 2 for the DQN is implemented as follows (illustrated in the top-left subfigure in Figure 1). −−→ → − −→ −h − xt + W→ −) ht = Γ(Wx→ (8) + b→ h h t−1 h h ← − ←−− −← −h − xt + W← −) ht = Γ(Wx← (9) + b← h h t−1 h h − → ← − ht = [hTt ; hTt ]T (10) → − In this scenario, hde t is equal to ht , namely the forward hidden vectors. The additional information ← − about the input sequence < Ai , Bi , Ci > is further summarized by the backward hidden vectors ht . 5 3.4 BLEU Score for DQN Reward Reward is calculated based on the closeness between the target sentence < y1 , y2 , . . . , yT > and the decoded output sentence (i.e., DeSen) after the DQN takes an action. We compute the similarity of this sentence pair using the popular score metric in statistical translation. Specifically, we obtain a BLEU [25] score between these two sentences. We measure the score difference between the current iteration and the previous iteration. If the difference is positive, then a reward of +1 is assigned; if negative then -1 as reward; otherwise, it is zero. Note that, since we here conduct a sentence level comparison, we adopt the smoothed version of BLEU [17]. Unlike the BLEU, the smoothedBLEU avoids giving zero score even when there are not any 4-gram matches in the sentence pair. 3.5 Empirical Observations on Model Design Separating State Generation Function from DQN Our experiments suggest that separating the state generation function from the DQN networks is beneficial. The aim here is to have a deterministic network for generating states from a sequence pair. That is, for any given input pair to the encoder-decoder LSTMs network, namely the state generation function StateGF, we will always have the same decoded output sequence. Our empirical studies indicate that this is a very important for successfully training the DQN for decoding text. Our intuitive explanation is as follows. Using DQN to approximate the Q-value function, intuitively, equals to train a network against moving targets because here the network’s targets depend on the network itself. Suppose, for a given input feed, the StateGF would generate a different output sequence each time for the DQN. In this scenario, the DQN network has to also deal with a moving state function involving text with very high dimensionality. Intuitively, here the DQN agent is living in a changing environment Ξ. As a result, it may be very difficult for the DQN to learn to predict the Q-value, since, now, all the states and rewards are unstable, and change even for the same input feed. Pre-training the State Generation Function Two empirical techniques are employed to ensure that we have a deterministic network for generating states for DQN. Firstly, we deploy a pre-training technique. Specifically, we pre-train the state generation function StateGF with the input sequence X as the EnLSTM’s input and target sequence Y as the DeLSTM’s input. After the training converges, the networks’ weights will be fixed when the training of the DQN network starts. Secondly, during training the DQN, the input sequence is fed into the EnLSTM, but the decoded sequence from the previous iteration is used by the DeLSTM as input (indicated as dot line in Figure 1). In this stage, only the red portions of Figure 1 are updated. That is, the reward errors from the DQN networks are not backpropagated to the state generation functions. Updating with Replay Memory Sampling Our studies also indicate that, performing updates to the Q-value function using transitions from the current training sentence causes the network to strongly overfit the current input sentence. As a result, when a new sentence is fed in for training, it may always predict the previous sentence used for training. To avoid this correlation issue, a replay memory strategy is applied when updating the DQN. That is, the DQN is updated by transition tuples which may be different from the current input sequence. To this end, for each action the DQN takes, we save its transition tuple in the replay memory pool, including the EnSeni , DeSeni , DeSeni+1 , ri , and ai . When updating the DQN, we then randomly sample a transition tuple from the replay memory pool. More sophisticated replay memory update could be applied here; we would like to leave it for future work. For example, one can use the priority sampling of replay technique [22]. That is, transitions with large rewards have more chance to be chose. In our case, we can bias the selection to transitions with high BLEU scores. Importance of Supervised Softmax Signal We also conduct experiments without the supervised Sof tmax error for the network. That is, the whole network, including the LSTMs and DQN, only receive the error signals from the Q-value predictions. We observed that, without the supervised signal the DQN was very difficult to learn. The intuition is as follows. Firstly, as discussed before, for decoding text, which typically involves a very large number of potential states and actions, it is very challenge for the DQN to learn the optimal policy from both a moving state generation function and a moving Q-value target function. Secondly, the potential actions for the DQN, namely the word probability list for each output of the DeLSTM is changing and unreliable, which will further complicate the learning of the DQN. 6 Simultaneously Updating with Both Softmax and Q-value Error If during training the DQN, we not only update the DQN as discussed previously, but also update the state generation functions, i.e., the encoder-decoder LSTMs. We found that the network could be easily bias to the state generation functions since the Sof tmax error signal is very strong and more reliable (compared to the moving target Q-value function), thus the DQN may not be sufficiently tuned. Of course, we could bias towards the learning of DQN, but this would introduce one more tricky parameter for tuning. In addition, doing so, we have an indeterministic state generation function again. 4 Experiments 4.1 Task and Dataset Our experimental task here is to train a network to regenerate natural sentences. That is, given a sentence as input, the network first compresses it into a fixed vector, and then this vector is used to decode the input sentence. In other words, the X and Y in Algorithm 1 are the same. In our experiment, we randomly select 12000 sentences, with max length of 30, from the Billion Word Corpus [7]. We train our model with 10000 sentences, and then select the best model with the validation data which consist of 1000 sentences. We then test our model with 1000 seen sentences and 1000 unseen sentences. The seen test set is randomly sampled from the training set. 4.2 Training and Testing Detail For computational reason, we used an one-layer LSTM for the encoder-decoder LSTMs as well as the backward LSTM in the DQN, both with 100 memory cells and 100 dimensional word embeddings. We used a Softmax over 10000 words (which is the size of the vocabulary we used in the experiments) at each output (i.e., time step t) of the DeLSTM. We initialized all of the LSTMs parameters with the uniform distribution between -0.15 and +0.15, including the word vectors. We used Adaptive Stochastic Gradient Descent (AdaSGD) [9] without momentum, with a starting learning rate of 0.05. Although LSTMs tend to not suffer from the vanishing gradient problem, they can have exploding gradients. Thus we employ the gradient norm clip technique [26] with a threshold of 15. We used both L2 regularization (with a weight decay value of 0.00016) and dropout (with a rate of 0.2) to avoid overfitting the networks. We first pretrain the encoder-decoder LSTMs with both the target sentence as input. After the training converges, we then start to train the DQN. When training the DQN, we turn off the drop out in the encoder-decoder LSTMs, so that we have a deterministic network to generate states and the lists of word probabilities for the DQN. In addition, we scale down the epsilon ǫ to 0.1 after 2000000 iterations. In other words, most of actions at the beginning of the DQN training were random, and then became more greedy towards the end of the training. For each sentence with length of l, we allow DQN to edit the sentence with 2l iterations, namely taking 2l actions for the decoding. The sentence decoded in each iteration will be saved in a replay memory with a capacity of 500000. The discount factor λ was set to 0.95. Also, the BLEU score threshold σ for indicating decoding success was set to 0.92. For the initial states of the bi-directional LSTMs in the DQN, we used the fixed vector generated by the LSTM encoder. In testing phase, we also run the DQN for each sentence with 2l steps. Also, in our experiment, we used only the word with the max probability on each of the T lists as the potential actions for the DQN. Since the maximal length of a sentence in our experiment is 30, the DQN has at most 31 output nodes. Namely, the DQN can choose one of the 30 top words, each corresponding to a time step at the DeLSTM, as its action, or take the 31st action which indicates not modification is needed. We compared our strategy with an encoder-decoder LSTM network used in [30] for machine translation. This baseline decoder searches for the most likely output sequence using a simple left-to-right beam search technique. As suggested by [30], a beam size of 1 worked well. We adopt this approach as our decoding baseline. All our experiments were run on a NVIDIA GTX TitanX GPU with 12GB memory. We report the average SmoothedBLEU score for all the testing sentences. 4.3 Experimental Results The evolutions of the training for the state generation function StateGF and DQN are depicted in Figure 2, and the main testing results are presented in Table 1. From the training curves for both the encoder-decoder LSTMs and DQN as depicted in Figure 2, we can see that both of the trainings converged very well. For the LSTMs training, the average cost 7 Pretraining Curve for LSTMs Training Curve for DQN 6 1 0.2 2 0.1 1 Average Cost Average BLEU score 0 1 4 7 10 14 18 22 26 30 34 0 0.3 −1 0.2 −2 −3 0.1 −4 Average Reward Average BLEU score 0.0 38 1 2 3 4 5 6 7 8 9 Epoch 11 13 Average BLEU score 3 Average Reward Average Cost 0.3 4 0.4 Average BLEU score 0.4 5 0.0 15 Epoch Figure 2: The evolution of cost for training the StateGF and reward for training the DQN. was steadily decreasing, and the average BLEU score was gradually increasing. Both the two curves then stabilized after 20 iterations. Also, the right subfigure in Figure 2 indicates that, the reward obtained by the DQN was negative at the beginning of the training and then gradually moved to the positive reword zone. The negative rewards are expected here because most of the DQN’s actions were random at the beginning of the training. Gradually, the DQN knew how to decode the sentences to receive positive rewards. As shown in the right figure, the training of the DQN converged in about 6 epochs. These results indicate that both the state generation functions and the DQN were easy to be trained. Testing systems Average SmoothedBLEU on sentences IN the training set Average SmoothedBLEU on sentences NOT in the training set LSTM decoder 0.425 0.107 DQN 0.494 0.228 Table 1: Experimental results for decoding the seen and unseen sentences in testing. In Table 1, we show the testing results, in terms of average SmoothedBLEU obtained, for both the seen 1000 and unseen 1000 sentences. We can observe that, although the results achieved by the DQN on the seen data were only slightly better than that of the baseline LSTMs network, for the unseen data the DQN meaningfully outperformed the baseline. Our further analysis suggests the follows. With the seen data, the DQN decoder tended to agree with the LSTM decoder. That is, most of the time, its decision was “no modification”. As for the unseen data, because the DQN’s exploration strategy allows it to learn from many more noisy data than the LSTMs networks did, so the DQN decoder was able to tolerate better to noise and generalize well to unseen data. Intuitively, the application of the DQN here also has the effect of generating synthetic sequential text for the training of the DQN decoder, due to its exploration component. Effect of DQN Exploration Average BLEU score 0.25 0.20 0.15 0.10 0.05 0.00 0 0.05 0.1 0.2 0.5 Epsilon Value Figure 3: Impact, in terms of BLEU score obtained, of the DQN’s exploration in the testing phase. We also conducted experiments to observe the behaviors of the DQN for exploration; here we only considered the unseen testing data set. That is, we enabled the DQN to follow an ǫ-greedy policy with ǫ = 0, 0.05, 0.1, 0.2, 0.5, respectively. In other words, we allowed the agent to choose the best actions according to its Q-value function 100%, 95%, 90%, 80%, and 50% of the time. The experimental results, in terms of BLEU score obtained, are presented in Figure 3. From Figure 3, 8 we can conclude that the exploration strategy in testing time did not help the DQN. The results here indicate that allowing the DQN to explore in testing time decreased its predictive performance, in terms of BLEU score obtained 5 Related Work Recently, the Deep Q-Network (DQN) has been shown to be able to successfully play Atari games [14, 21, 24]. Trained with a variant of Q-learning [34], the DQN learns control strategies using deep neural networks. The main idea is to use deep learning to automatically generate informative features to represent the internal states of the environment where the software agent lives, and subsequently approximate a non-linear control police function for the learning agent to take actions. In addition to playing video games, employing reinforcement learning to learn control policies from text has also be investigated. Applications include interpreting user manuals [6], navigating directions [2, 16, 18, 33] and playing text-based games [5, 10, 23]. Also, DQN has recently been employed to learn memory access patterns and rearrange a set of given words [35]. Unlike the above works, our research here aims to decode natural text with DQN. In addition, we employ an encoder-decoder LSTM network to not only generalize informative features from text to represent the states of DQN, but also create a list of potential actions from the text for the DQN. 6 Conclusion and Future Work We deploy a Deep Q-Network (DQN) to embrace an iterative decoding strategy for sequence to sequence learning. To this end, an encoder-decoder LSTM network is employed to automatically approximate internal states and formulate potential actions for the DQN. In addition, we incorporate an attention mechanism into the reinforcement learning’s exploration strategy. Such exploration, intuitively, enables the decoding network to learn from many synthetic sequential text generated during the decoding stage. We evaluate the proposed method with a sentence regeneration task. Our experiments demonstrate our approach’s promising performance especially when decoding unseen sentences, in terms of BLEU score obtained. This paper also presents several empirical observations, in terms of model design, in order for successfully decoding sequential text with DQN. In the future, allowing the DQN to pick from the top n words from the list at each time step t of the DeLSTM would be further studied. Furthermore, we would like to experiment with sophisticated priority sampling techniques for the DQN training. In particular, we are interested in applying this approach to statistical machine translation. References [1] C. Amato and G. Shani. High-level reinforcement learning in strategy games. In AAMAS ’10, pages 75–82, 2010. [2] Y. Artzi and L. Zettlemoyer. Weakly supervised learning of semantic parsers for mapping instructions to actions. TACL, 1:49–62, 2013. [3] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014. [4] S. R. K. Branavan, D. Silver, and R. Barzilay. Learning to win by reading manuals in a monte-carlo framework. In ACL ’11, pages 268–277, 2011. [5] S. R. K. Branavan, D. Silver, and R. Barzilay. Learning to win by reading manuals in a monte-carlo framework. CoRR, abs/1401.5390, 2014. [6] S. R. K. Branavan, L. S. Zettlemoyer, and R. Barzilay. Reading between the lines: Learning to map highlevel instructions to commands. In ACL ’10, pages 1268–1277, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. [7] C. Chelba, T. Mikolov, M. Schuster, Q. Ge, T. Brants, P. Koehn, and T. Robinson. One billion word benchmark for measuring progress in statistical language modeling. In INTERSPEECH 2014, pages 2635–2639, 2014. [8] K. Cho, B. van Merrienboer, Ç. Gülçehre, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. 9 [9] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. J. Mach. Learn. Res., 12:2121–2159, July 2011. [10] J. Eisenstein, J. Clarke, D. Goldwasser, and D. Roth. Reading to learn: Constructing features from semantic abstracts. In EMNLP ’09, pages 958–967, Stroudsburg, PA, USA, 2009. Association for Computational Linguistics. [11] J. L. Elman. Finding structure in time. COGNITIVE SCIENCE, 14(2):179–211, 1990. [12] A. Graves, A. Mohamed, and G. E. Hinton. Speech recognition with deep recurrent neural networks. CoRR, abs/1303.5778, 2013. [13] K. Gregor, I. Danihelka, A. Graves, and D. Wierstra. DRAW: A recurrent neural network for image generation. CoRR, abs/1502.04623, 2015. [14] M. J. Hausknecht and P. Stone. Deep recurrent q-learning for partially observable mdps. CoRR, abs/1507.06527, 2015. [15] M. I. Jordan. Chapter 25 - serial order: A parallel distributed processing approach. In J. W. Donahoe and V. P. Dorsel, editors, Neural-Network Models of CognitionBiobehavioral Foundations, volume 121 of Advances in Psychology, pages 471 – 495. North-Holland, 1997. [16] T. Kollar, S. Tellex, D. Roy, and N. Roy. Toward understanding natural language directions. In Proceedings of the 5th ACM/IEEE International Conference on Human-robot Interaction, HRI ’10, pages 259–266, Piscataway, NJ, USA, 2010. IEEE Press. [17] C.-Y. Lin and F. J. Och. Automatic evaluation of machine translation quality using longest common subsequence and skip-bigram statistics. In ACL ’04, 2004. [18] C. Matuszek, E. Herbst, L. Zettlemoyer, and D. Fox. Learning to parse natural language commands to a robot control system. In Experimental Robotics, pages 403–415. Springer International Publishing, 2013. [19] T. Mikolov, M. Karafiát, L. Burget, J. Cernockỳ, and S. Khudanpur. Recurrent neural network based language model. In INTERSPEECH 2010, pages 1045–1048, 2010. [20] V. Mnih, N. Heess, A. Graves, and K. Kavukcuoglu. Recurrent models of visual attention. CoRR, abs/1406.6247, 2014. [21] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 02 2015. [22] A. W. Moore and C. G. Atkeson. Prioritized sweeping: Reinforcement learning with less data and less time. In Machine Learning, pages 103–130, 1993. [23] K. Narasimhan, T. Kulkarni, and R. Barzilay. Language understanding for text-based games using deep reinforcement learning. CoRR, abs/1506.08941, 2015. [24] J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. P. Singh. Action-conditional video prediction using deep networks in atari games. CoRR, abs/1507.08750, 2015. [25] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. Bleu: A method for automatic evaluation of machine translation. In ACL ’02, pages 311–318, 2002. [26] R. Pascanu, T. Mikolov, and Y. Bengio. On the difficulty of training recurrent neural networks. 2013. [27] D. Silver, R. Sutton, and M. Müller. Reinforcement learning of local shape in the game of go. In IJCAI’07, pages 1053–1058, San Francisco, CA, USA, 2007. [28] S. Sukhbaatar, A. Szlam, J. Weston, and R. Fergus. Weakly supervised memory networks. CoRR, abs/1503.08895, 2015. [29] M. Sundermeyer, R. Schlüter, and H. Ney. Lstm neural networks for language modeling. In INTERSPEECH, pages 194–197, 2012. [30] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. CoRR, abs/1409.3215, 2014. [31] R. S. Sutton and A. G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. [32] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. CoRR, abs/1411.4555, 2014. [33] A. Vogel and D. Jurafsky. Learning to follow navigational directions. In ACL ’10, pages 806–814, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. [34] C. J. C. H. Watkins and P. Dayan. Q-learning. In Machine Learning, pages 279–292, 1992. [35] W. Zaremba and I. Sutskever. Reinforcement learning neural turing machines. CoRR, abs/1505.00521, 2015. 10
9cs.NE
arXiv:1510.06181v3 [math.RT] 6 Dec 2017 BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS ULRICH THIEL Abstract. We study the behavior of blocks in flat families of finite-dimensional algebras. In a general setting we construct a finite directed graph encoding a stratification of the base scheme according to the block structures of the fibers. This graph can be explicitly obtained when the central characters of simple modules of the generic fiber are known. We show that the block structure of an arbitrary fiber is completely determined by “atomic” block structures living on the components of a Weil divisor. As a byproduct, we deduce that the number of blocks of fibers defines a lower semicontinuous function on the base scheme. We furthermore discuss how to obtain information about the simple modules in the blocks by generalizing and establishing several properties of decomposition matrices by Geck and Rouquier. 1. Introduction It is a classical fact in ring theory∏︀that a non-zero noetherian ring 𝐴 can be 𝑛 decomposed as a direct product 𝐴 = 𝑖=1 𝐵𝑖 of indecomposable rings 𝐵𝑖 . Such a decomposition is unique up to permutation and isomorphism of the factors. Let us denote by Bl(𝐴) the set of the 𝐵𝑖 , called the blocks ⨁︀𝑛 of 𝐴. The decomposition of 𝐴 into blocks induces a decomposition 𝐴-Mod = 𝑖=1 𝐵𝑖 -Mod of the category of (left) 𝐴-modules. In particular, a simple 𝐴-module is a simple 𝐵 for a unique ∐︀𝑖 -module 𝑛 block 𝐵𝑖 and so we get an induced decomposition Irr𝐴 = 𝑖=1 Irr𝐵𝑖 of the set of simple modules. Let us denote by Fam(𝐴) the set of the Irr𝐵𝑖 , called the families of 𝐴. The blocks and families of a ring are important invariants which help to organize and simplify its representation theory. The aim of this paper is to investigate how these invariants vary in a flat family of finite-dimensional algebras. More precisely, we consider a finite flat algebra 𝐴 over an integral domain 𝑅, i.e., 𝐴 is finitely generated and flat as an 𝑅-module. This yields a family of algebras parametrized by Spec(𝑅) consisting of the specializations (or fibers) (1) 𝐴(p) := k(p) ⊗𝑅 𝐴 ≃ 𝐴p /pp 𝐴p , where k(p) = Frac(𝑅/p) is the residue field of p ∈ Spec(𝑅) in 𝑅 and 𝐴p is the localization of 𝐴 in p. Note that the fiber 𝐴(p) is a finite-dimensional k(p)-algebra. Now, the primary goal would be to describe for any p the blocks of 𝐴(p), e.g., the number of blocks, and to describe the simple modules in each block, e.g., the number of such modules and their dimensions. It is clear that there will be no general theory giving the precise solutions to these problems for arbitrary 𝐴. For example, we can take the group ring 𝐴 = ZS𝑛 of the symmetric group. The fibers of 𝐴 are precisely the group rings QS𝑛 and F𝑝 S𝑛 Date: Dec 6, 2017 ULRICH THIEL, School of Mathematics and Statistics, University of Sydney, NSW 2006 Australia. Email: [email protected] 2 ULRICH THIEL for all primes 𝑝, and the questions above are still unanswered. Nonetheless, and this is the point of this paper, there are some general phenomena, some patterns in the behavior of blocks and simple modules along the fibers, which are true quite generally. 1.1. The setting. We assume that 𝑅 is noetherian and normal, and that the generic fiber 𝐴𝐾 is a split 𝐾-algebra, where 𝐾 is the fraction field of 𝑅, i.e., all simple modules of 𝐴𝐾 remain simple under field extension. This setting includes many interesting examples in representation theory like Brauer algebras, Hecke algebras, (restricted) rational Cherednik algebras, etc. We note that some results we mention below actually hold more generally and refer to the main body of the paper. At the very end we also establish a semicontinuity property of blocks in the (important) case of a non-split generic fiber, see Theorem 1.6. This then applies also to quantized enveloping algebras of semisimple Lie algebras at roots of unity, enveloping algebras of semisimple Lie algebras in positive characteristic, quantized function algebras of semisimple groups at roots of unity, etc. More generally, this applies to Hopf PI triples as introduced by Brown–Goodearl [6] (see also Brown–Gordon [7] and Gordon [18]). 1.2. Block stratification. Under the assumptions described above, we prove the following theorem (see Corollary 4.3) which is the backbone of this paper: Theorem 1.1. For any p ∈ Spec(𝑅) the natural map 𝐴p  𝐴(p) is block bijective, i.e., it induces a bijection between the block idempotents. This allows us to reduce the study of blocks of specializations to blocks of localizations, and this is much simpler from the general perspective. Since a block idempotent of a localization 𝐴p splits into a sum of block idempotents of the generic fiber 𝐴𝐾 , we can view the blocks of 𝐴p as being a partition of the set of blocks of 𝐴𝐾 , see §3 for details. This gives us a direct and natural way of comparing the block structures among the fibers—something which is in general, without the above theorem, not possible. Let Bl𝐴 : Spec(𝑅) → Part(Bl(𝐴𝐾 )) be the map just described. We equip the image Bl(𝐴) of this map with the partial order ≤ on partitions, where P ′ ≤ P if the members of P ′ are unions of members −1 of P. We let Bl−1 𝐴 (P), respectively Bl𝐴 (≤ P), be the locus of all p ∈ Spec(𝑅) such that the block structure of 𝐴p , and thus of 𝐴(p) under the above bijection, is equal to a given partition P, respectively coarser than P. We then obtain as Theorem 3.3: Theorem 1.2. The sets Bl−1 closed in Spec(𝑅), the sets Bl−1 𝐴 (≤ P) are∐︀ 𝐴 (P) are locally closed in Spec(𝑅), and Spec(𝑅) = P Bl−1 (P) is a stratification of Spec(𝑅). 𝐴 Denoting by ∙ the generic point of Spec(𝑅), so that 𝐴∙ = 𝐴(∙) = 𝐴𝐾 , this implies in particular that the set BlGen(𝐴) := Bl−1 𝐴 (Bl𝐴 (∙)) = {p ∈ Spec(𝑅) | Bl𝐴 (p) = Bl𝐴 (∙)} of primes p where the block structure of the fiber 𝐴(p) is equal to the one of the generic fiber 𝐴𝐾 is an open (dense) subset of Spec(𝑅). Hence, the set BlEx(𝐴) := {p ∈ Spec(𝑅) | Bl𝐴 (p) < Bl𝐴 (∙)} of primes where the block structure of the fiber is coarser than the one of the generic fiber is closed. This set has a nice property, see Corollary 3.5: BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 3 Theorem 1.3. If 𝑅 is a Krull domain (e.g., if 𝑅 is normal), then BlEx(𝐴) is a reduced Weil divisor, i.e., it is either empty or pure of codimension one in Spec(𝑅). We thus call BlEx(𝐴) the block divisor of 𝐴. This is an interesting new discriminant of 𝐴. Let At(𝐴) be the set of irreducible components of BlEx(𝐴). On any 𝑍 ∈ At(𝐴) there is a unique maximal block structure Bl𝐴 (𝑍), namely the one in the generic point. In §3.3 we show that these block structures have an atomic character : Theorem 1.4. For p ∈ Spec(𝑅) we have ⋀︁ Bl𝐴 (p) = Bl𝐴 (𝑍) , 𝑍∈At(𝐴) p∈𝑍 where ∧ is the meet of partitions, i.e., the members are the unios of all members with non-empty intersection. Hence, once we know At(𝐴) and the atomic block structures Bl𝐴 (𝑍) for 𝑍 ∈ At(𝐴), we know the block structure for any p ∈ Spec(𝑅). By considering sets of the form ⋂︁ ⋃︁ 𝑍∖ 𝑍 𝑍∈Z 𝑍 ∈Z / for subsets Z ⊆ At(𝐴), we obtain a stratification of Spec(𝑅) refining the one introduced above. We call this the block stratification of 𝐴. 1.3. Blocks via central characters. In §5 we discuss an approach to explicitly compute the block stratification and the block structures on the strata. This is based on the knowledge of central characters of simple 𝐴𝐾 -modules. Since 𝐴𝐾 splits, each simple 𝐴𝐾 -module 𝑆 has a central character Ω′𝑆 : Z(𝐴) → 𝑅, the image lying in 𝑅 since 𝑅 is normal. In Theorem 5.9 we show: Theorem 1.5. Two simple 𝐴𝐾 -modules 𝑆 and 𝑇 lie in the same 𝐴p -block if and only if Ω′𝑆 ≡ Ω′𝑇 mod p. The key ingredient in the proof is a (rather non-trivial) result by B. Müller stating that the cliques of a noetherian ring, which is a finite module over its center, are fibered over the center. We address this in detail in §5.1. If 𝑧1 , . . . , 𝑧𝑛 is an 𝑅-algebra generating system of Z(𝐴), then Ω′𝑆 ≡ Ω′𝑇 mod p if and only if Ω′𝑆 (𝑧𝑖 ) ≡ Ω′𝑇 (𝑧𝑖 ) mod p for all 𝑖. Hence, Theorem 1.5 gives a computational tool to explicitly determine Bl𝐴 (p) once the central characters of the generic fiber are known. Moreover, it follows from Theorem 1.5 that At(𝐴) is the set of maximal irreducible components of the zero loci of the sets (2) {Ω′𝑆 (𝑧𝑖 ) − Ω′𝑇 (𝑧𝑖 ) | 𝑖 = 1, . . . , 𝑛} for Ω′𝑆 ̸= Ω′𝑇 . The atomic block structures can then be determined by the vanishing of the differences Ω′𝑆 − Ω′𝑇 on the 𝑍 ∈ At(𝐴), and from these we obtain all block structures as described above. 1.4. An example. Let us illustrate this with an explicit example. Let 𝐴 be the generic Brauer algebra for 𝑛 = 3 over the polynomial ring 𝑅 := Z[𝛿], see [20]. There are four simple 𝐴𝐾 -modules, labelled by the partitions (0, (1, 1, 1)), (0, (3)), (0, (2, 1)), and (1, (1)). We will simply label these by 1, . . . , 4 from now on. Since 𝐴𝐾 is semisimple, we can identify the blocks of 𝐴𝐾 with the simple modules of 𝐴𝐾 , i.e., we can label the blocks by 1, . . . , 4. We can thus view blocks of specializations of 𝐴 as partitions of {1, . . . , 4} as described above. It is not too difficult to explicitly compute the central characters of the simple 𝐴𝐾 -modules. From these we deduce 4 ULRICH THIEL that the block structure of the fibers of 𝐴 over Z[𝛿] are distributed as in the following graph: {1},{2},{3},{4} (0) {1,2,3},{4} (3) {1},{2},{3,4} (𝛿−1) {1,2,3,4} (𝛿−1,3) {1,2},{3},{4} (2) {1,2},{3,4} (𝛿−1,2) {1},{2,4},{3} (𝛿+2) {1,2,4},{3} (𝛿,2) This graph encodes the block stratification of the two-dimensional base scheme Spec(Z[𝛿]), along with the block structures on the strata. We see that BlEx(𝐴) has four components of codimension one, the generic points of these components are 3, 𝛿 − 1, 2, and 𝛿 + 2, respectively. The block structure on any other point p is uniquely determined as the meet of the block structures on the components of BlEx(𝐴) containing p. We want to point out that it is central for us to work with (affine) schemes. For example, we have one skeleton with generic point (2), i.e., we consider the Brauer algebra in characteristic two. Now, we do not only have the case 𝛿 ∈ {0, 1} = F2 , which is described by the two strata below (2), but we also have a generic characteristic two case, described by the generic point of F2 [𝛿], and this is really different from the case of specialized 𝛿 as we can see from the block structures. Note that the components of BlEx(𝐴) are precisely the parameters where the Brauer algebra is not semisimple anymore (the precise parameters have been determined by Rui [39] for all 𝑛 ∈ N). We show in Lemma 6.7 that this is always the case for cellular algebras. 1.5. Blocks and decomposition matrices. In §6 we address questions about the simple modules in a block. The main tool here are the decomposition matrices introduced by Geck and Rouquier. In Theorem 6.2 we show that they satisfy Brauer reciprocity in a rather general setting in which it was not known to hold before. In §6.3 we generalize the concept of Brauer graphs and show how these relate to blocks. 1.6. An open problem. In §6.2 we contrast the preservation of simple modules with the preservation of blocks under specialization, and this leads to an interesting problem: in [42] we showed that decomposition matrices of 𝐴 are trivial precisely on an open subset DecGen(𝐴) of Spec(𝑅). In Theorem 6.3 we show: DecGen(𝐴) ⊆ BlGen(𝐴) . The obvious question is: are these two sets equal, and if not, when are they equal? We show in Example 6.5 that in general we do not have equality. In Lemma 6.7, on the other hand, we establish a context where we have equality (this includes Brauer algebras and explains why our Weil divisor is given by the non-semisimple parameters). It is an open problem to understand the complement BlGen(𝐴) ∖ DecGen(𝐴). BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 5 1.7. Semicontinuity of blocks in case of a non-split generic fiber. In §7 we consider the case of a non-split generic fiber. In this case we can no longer identify blocks of specializations with blocks of localizations, and so there is no natural way of comparing block structures among the fibers. However, it still makes sense to compare the number of blocks of the fibers, i.e., to consider the map Spec(𝑅) → N, p ↦→ #Bl(𝐴(p)). In case 𝑅 is normal and 𝐴𝐾 splits, this map is lower semicontinuous by the results discussed above. Without splitting of 𝐴𝐾 , this is no longer true, see Example 7.4. The problem is that we consider this map on all of Spec(𝑅). In Corollary 7.1 we construct a setting in which the restriction of p ↦→ #Bl(𝐴(p)) to certain subsets of Spec(𝑅) is still lower semicontinuous without assuming that the generic fiber splits. From this we obtain a rather nice result, see Corollary 7.3: Theorem 1.6. Suppose that 𝑅 is a finite type algebra over an algebraically closed field. Let 𝑋 be the set of closed points of Spec(𝑅). Then the map 𝑋 → N, m ↦→ #Bl(𝐴(m)), is lower semicontinuous. In particular, 𝑋 admits a stratification according to the number of blocks of fibers of 𝐴 over 𝑋. 1.8. Remark. The behavior of blocks under specialization has been studied in several situations already. All of our results are well-known in modular representation theory of finite groups since the work of R. Brauer and C. Nesbitt [5]. Our Corollary 4.3 and Theorem 6.9 generalize results by S. Donkin and R. Tange [12] about algebras over Dedekind domains. Our results about lower semicontinuity of the number of blocks generalize a result by P. Gabriel [14] to mixed characteristic and non-algebraically closed settings, see also the corresponding result by I. Gordon [18]. In general, K. Brown and I. Gordon [7, 8] used Müller’s theorem [32] to study blocks under specialization. Theorem 5.8 has been treated in a more special setting by K. Brown and K. Goodearl [6]. The codimension one property in Corollary 4.3 and Theorem 5.9 were proven by C. Bonnafé and R. Rouquier [2] in a more special setting. Their work is without doubt one of the main motivations for this paper. Blocks and decomposition matrices of generically semisimple algebras over discrete valuation rings have been studied by M. Geck and G. Pfeiffer [15], and more generally by M. Chlouveraki [9]. Brauer reciprocity has been studied more generally by M. Geck and R. Rouquier [16], and by M. Neunhöffer [35]. M. Neunhöffer and S. Scherotzke [36] have shown generic triviality of ep𝐴 over Dedekind domains. Acknowledgements. I would like to thank Cédric Bonnafé for many helpful discussions about this topic, for showing and explaining me the relevant part of the manuscript [2] with Raphaël Rouquier, and for providing Example 6.5. The manuscript [2] is without doubt one of the main motivations for this paper. I would furthermore like to thank Gwyn Bellamy, Ken Brown, Meinolf Geck, and Gunter Malle for commenting on parts of a preliminary version of this article. Moreover, I thank Ken Brown for providing Example 7.4. I was partially supported by the DFG SPP 1489. Contents 1. 2. 3. 4. 5. 6. Introduction Base change of blocks Blocks of localizations Blocks of specializations Blocks via central characters Blocks and decomposition matrices 1 6 8 14 17 22 6 ULRICH THIEL 7. Semicontinuity of blocks in case of a non-split generic fiber Appendix A. More on base change of blocks Appendix B. Further elementary facts References 29 32 37 39 2. Base change of blocks The basic principle underlying the behavior of blocks in a family of algebras is base change of blocks. In this section, we introduce a few basic notions about this principle. Appendix A contains some further material which will later be used in some proofs. Let us fix some basic notations for block theory. For us, a ring is always a ring with identity and a module is always a left module unless we explicitly say it is a right module. Let 𝐴 be a ring and let 𝑍 be its center. If 𝑐 is a central idempotent of 𝐴, then 𝐴𝑐 = 𝑐𝐴 is a two-sided ideal of 𝐴 and at the same time a ring with identity element equal to 𝑐 (so, not a subring). This yields a bijection between between the set of decompositions of 1 ∈ 𝐴 into a sum of pairwise orthogonal central idempotents and finite direct sum decompositions of the ring 𝐴 into non-zero two-sided ideals of 𝐴 up to permutation of the summands. Such decompositions are in turn in bijection with finite direct product decompositions of the ring 𝐴 into non-zero rings up to permutation of the factors. Primitive idempotents of 𝑍 are also called centrally-primitive idempotents of 𝐴. A central idempotent 𝑐 is centrally-primitive if and only if 𝐴𝑐 is an indecomposable ring. It is a standard fact—and the starting point of block theory—that if there is a decomposition of ∑︀ 1 = 𝑖 𝑐𝑖 into pairwise orthogonal centrally-primitive idempotents 𝑐𝑖 , then this is unique and any central idempotent of 𝐴 is a sum of a subset of the 𝑐𝑖 . We then say that 𝐴 has a block decomposition, call the centrally-primitive idempotents of 𝐴 also the block idempotents, and call the corresponding rings 𝐴𝑐 the blocks of 𝐴. In this case we prefer to write Bl(𝐴) := Idem𝑐𝑝 (𝐴). To avoid pathologies we set Bl(0) := ∅ for the zero ring 0. It is well-known that noetherian rings have block decompositions (the block idempotents are the class sums with respect to the linkage relation of a decomposition of 1 ∈ 𝐴 into pairwise orthogonal primitive idempotents). Let C := {𝑐𝑖 }𝑖∈𝐼 be a finite set of pairwise orthogonal central idempotents whose⨁︀sum is equal to 1 ∈ 𝐴. Let 𝐵𝑖 := 𝐴𝑐𝑖 . If 𝑉 is a non-zero 𝐴-module, then 𝑉 = 𝑖∈𝐼 𝑐𝑖 𝑉 as 𝐴-modules and each ⨁︀ summand 𝑐𝑖 𝑉 is a 𝐵𝑖 -module. In this way we obtain a decomposition 𝐴-Mod = 𝑖∈𝐼 𝐵𝑖 -Mod of module categories, which also restricts to a decomposition of the category of finitely generated modules. If a non-zero 𝐴-module 𝑉 is under this decomposition obtained from a 𝐵𝑖 -module, then 𝑉 is said to belong to 𝐵𝑖 . This is equivalent to 𝑐𝑖 𝑉 = 𝑉 and 𝑐𝑗 𝑉 = 0 for all 𝑗 ̸= 𝑖. An indecomposable, and thus any simple, ∐︀ 𝐴-module clearly belongs to a unique 𝐵𝑖 . We thus get a decomposition Irr𝐴 = 𝑖∈𝐼 Irr𝐵𝑖 of the set of (isomorphism classes of) simple modules. We call the sets Irr𝐵𝑖 the C -families of 𝐴 and denote the set of C -families by FamC (𝐴). Note that we have a natural bijection (3) ∼ C −→ FamC (𝐴) given by 𝑐𝑖 ↦→ Irr 𝐵𝑖 . In case C is actually a block decomposition, we call the C -families simply the families of 𝐴 and set Fam(𝐴) := FamC (𝐴). Recall that any central idempotent of 𝐴 is a sum of a subset of the block idempotents of 𝐴. Hence, BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 7 for general C as above the families are a finer partition of Irr𝐴 than the C -families, i.e., any C -family is a union of families. Now, consider a morphism 𝜑 : 𝑅 → 𝑆 of commutative rings. If 𝑉 is an 𝑅module, we write 𝑉 𝑆 := 𝜑* 𝑉 := 𝑆 ⊗𝑅 𝑉 for the scalar extension of 𝑉 to 𝑆 and by 𝜑𝑉 : 𝑉 → 𝑉 𝑆 we denote the canonical map 𝑣 ↦→ 1 ⊗ 𝑣. In most situations we consider, this map will be injective: Lemma 2.1. In each of the following cases the map 𝜑𝑉 : 𝑉 → 𝑉 𝑆 is injective: (a) 𝜑 is injective and 𝑉 is 𝑅-projective. (b) 𝜑 is faithfully flat. (c) 𝜑 is the localization morphism for a multiplicatively closed subset Σ ⊆ 𝑅 and 𝑉 is Σ-torsion-free. Proof. The first case follows from [4, II, §5.1, Corollary to Proposition 4], the second follows from [3, I, §3.5, Proposition 8(i,iii)], and the last case follows from the fact that 𝜑 is flat in conjunction with [3, I, §2.2, Proposition 4].  If 𝐴 is an 𝑅-algebra, then the 𝑆-module 𝐴𝑆 is naturally an 𝑆-algebra and the map 𝜑𝐴 : 𝐴 → 𝐴𝑆 is a ring morphism. Moreover, if 𝑉 is an 𝐴-module, then the underlying 𝑆-module of 𝐴𝑆 ⊗𝐴 𝑉 is simply 𝑉 𝑆 . Our aim is to study the behavior of blocks under the morphism 𝜑𝐴 : 𝐴 → 𝐴𝑆 . Clearly, if 𝑒 ∈ 𝐴 is an idempotent, also 𝜑𝐴 (𝑒) ∈ 𝐴𝑆 is an idempotent, and if 𝑒 is central, so is 𝜑𝐴 (𝑒) by the elementary fact that (4) 𝜑𝐴 (Z(𝐴)) ⊆ Z(𝐴𝑆 ) . Definition 2.2. We say that 𝜑𝐴 is (central) idempotent stable if 𝜑𝐴 (𝑒) ̸= 0 for any non-zero (central) idempotent 𝑒 of 𝐴. We say that 𝜑𝐴 is block bijective if 𝜑𝐴 induces a bijection between the centrally-primitive idempotents of 𝐴 and the centrally-primitive idempotents of 𝐴𝑆 . Note that in case 𝜑𝐴 is idempotent stable, respectively central idempotent stable, it induces a map between the sets of decompositions of 1 ∈ 𝐴 and 1 ∈ 𝐴𝑆 into pairwise orthogonal idempotents, respectively into pairwise orthogonal central idempotents. The following lemma shows two situations in which 𝜑𝐴 is idempotent stable (and thus central idempotent stable). We denote by Rad(𝐴) the Jacobson radical of 𝐴. Lemma 2.3. If Ker(𝜑𝐴 ) ⊆ Rad(𝐴), then 𝜑𝐴 is idempotent stable. This holds in the following two cases: (a) 𝜑𝐴 is injective (see Lemma 2.1), (b) 𝜑 is surjective, Ker(𝜑) ⊆ Rad(𝑅), and 𝐴 is finitely generated as an 𝑅-module. Proof. If 𝑒 ∈ 𝐴 is an idempotent contained in Rad(𝐴), then by a well-known characterization of the Jacobson radical (see [11, p. 5.10]) we conclude that 𝑒† = 1 − 𝑒 ∈ 𝐴× is a unit, and since 𝑒† is also an idempotent, we must have 𝑒† = 1, implying that 𝑒 = 0. If 𝜑𝐴 is injective, the condition clearly holds. In the second case we have Ker(𝜑𝐴 ) = Ker(𝜑)𝐴 ⊆ Rad(𝑅)𝐴 ⊆ Rad(𝐴), where the last inclusion follows from [27, Corollary 5.9].  Suppose that 𝜑𝐴 is idempotent stable and that both 𝐴 and 𝐴𝑆 have block decompositions. Let {𝑐𝑖 }𝑖∈𝐼 be the block idempotents of 𝐴 and let {𝑐′𝑗 }𝑗∈𝐽 be the block idempotents of 𝐴𝑆 . Since 𝜑𝐴 is idempotent stable, the set Bl𝜑 (𝐴𝑆 ) := 𝜑𝐴 ({𝑐𝑖 }𝑖∈𝐼 ) is a decomposition of 1 ∈ 𝐴𝑆 into pairwise orthogonal idempotents. We call the 𝜑𝐴 (𝑐𝑖 ) the 𝜑-blocks of 𝐴𝑆 and call the corresponding families (see above) the 𝜑-families of 𝐴𝑆 , denoted Fam𝜑 (𝐴𝑆 ). As explained above, each 𝜑-block 𝜑𝐴 (𝑐𝑖 ) is a 8 ULRICH THIEL sum of a subset of the block idempotents of 𝐴𝑆 and the 𝜑-families are coarser than the families in the sense that each 𝜑-family is a union of 𝐴𝑆 -families. In particular, we have #Bl(𝐴) = #Bl𝜑 (𝐴𝑆 ) ≤ #Bl(𝐴𝑆 ) . (5) The following picture illustrates this situation: ∙ ∙ · · · ′∙ 𝑐′1 𝑐′1 1 𝑐1𝑚 2 1 (6) ∙ ∙ · · · ′∙ 𝑐′2 𝑐′2 1 ··· 𝑐2𝑚 2 1 2 𝑐𝑛𝑚 2 ∙ ∙ 𝜑𝐴 (𝑐1 ) 𝜑𝐴 (𝑐2 ) 𝜑𝐴 (𝑐𝑛 ) 𝜑𝐴 𝜑𝐴 𝜑𝐴 ∙ 𝑐1 ∙ 𝑐2 ··· ··· 𝐴𝑆 -blocks ∙ ∙ ··· ′∙ 𝑐′𝑛 𝑐′𝑛 ∙ ∙ 𝑐𝑛 𝑛 𝜑-blocks 𝐴-blocks This paper is about this picture in the special case of specializations of an algebra in prime ideals. Before we begin investigating this, we record the following useful fact. Lemma 2.4. Suppose that 𝜑𝐴 : 𝐴 → 𝐴𝑆 is central idempotent stable. If 𝐴𝑆 has a block decomposition, then 𝐴 has a block decomposition. Proof. If 𝐴 does not contain any non-trivial central idempotent, then 𝐴 is indecomposable and thus has a block decomposition. So, assume that 𝐴 is not indecomposable and let 𝑐 be a non-trivial central idempotent. Then 𝐴 = 𝐴𝑐 ⊕ 𝐴𝑐† . We can now continue this process to get finer and finer decompositions of 𝐴 as a ring. Since 𝜑𝐴 is central idempotent stable, we get decompositions of the same size of 𝐴𝑆 . As 𝐴𝑆 has a block decomposition, this process has to end after finitely many steps. We thus arrive at a ring decomposition of 𝐴 with finitely many and indecomposable factors, hence, at a block decomposition of 𝐴.  Corollary 2.5. A non-zero finite flat algebra over an integral domain has a block decomposition. Proof. Let 𝑅 be an integral domain with fraction field 𝐾, let 𝜑 : 𝑅 ˓→ 𝐾 be the embedding, and let 𝐴 be a finite flat 𝑅-algebra. Since 𝐴 is 𝑅-torsion-free, it follows from Lemma 2.1(c) that 𝜑𝐴 is injective and so 𝜑𝐴 is idempotent stable by Lemma 2.3(a). Since 𝜑*𝐴 𝐴 = 𝐴𝐾 is a finite-dimensional algebra over a field, it has a block decomposition. Hence, 𝐴 has a block decomposition by Lemma 2.4.  The point of the corollary above is that we do not have to assume 𝑅 to be noetherian—otherwise 𝐴 is noetherian and we already know it has a block decomposition. 3. Blocks of localizations Before we consider blocks of specializations, we first take a look at blocks of localizations as these are much easier to control and are still strongly related to blocks of specializations as we will see in the next paragraph. Throughout this paragraph, we assume that 𝐴 is a finite flat algebra over an integral domain 𝑅 with fraction field 𝐾. It follows from Corollary 2.5 that 𝐴 and any localization 𝐴p for p ∈ Spec(𝑅) has a block decomposition, even if 𝐴 is not necessarily noetherian. Since the canonical BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 9 map 𝜑p : 𝐴p → 𝐴𝐾 is injective by Lemma 2.1, we have the notion of 𝜑p -blocks and 𝜑p -families of 𝐴𝐾 as defined in §2. To shorten notations, we call them the p-blocks and p-families, and write Famp (𝐴𝐾 ) for the p-families. Recall that we have a natural bijection (7) Bl(𝐴p ) ≃ Famp (𝐴𝐾 ) . 3.1. Block structure stratification. There is the following more concrete point of view of p-blocks. Let (𝑐𝑖 )𝑖∈𝐼 be the block idempotents of 𝐴𝐾 . If∑︀𝑐 ∈ 𝐴p is any block idempotent, we know from §2 that there is 𝐼 ′ ⊆ 𝐼 with 𝑐 = 𝑖∈𝐼 ′ 𝑐𝑖 in 𝐴𝐾 . Hence, to any block idempotent of 𝐴p we can associate a subset of 𝐼, and if we take all block idempotents of 𝐴p into account, we get a partition Bl𝐴 (p) of the set 𝐼, from which we can recover the block idempotents of 𝐴p by taking sums of the 𝑐𝑖 over the members of Bl𝐴 (p). In this way we get a map (8) Bl𝐴 : Spec(𝑅) → Part(𝐼) to the set of partitions of the set 𝐼. We denote by (9) Bl(𝐴) := Im Bl𝐴 the image of this map and call the partitions therein the block structures of 𝐴. The set Part(𝐼) is equipped with the partial order ≤ defined by P ≤ Q if P is a coarser partition than Q, i.e., the members of P are unions of members of Q. If q ⊆ p, then we have an embedding 𝐴p ˓→ 𝐴q and by the same argumentation as above, the block idempotents of 𝐴p are obtained by summing up block idempotents of 𝐴q , so (10) q ⊆ p =⇒ Bl𝐴 (p) ≤ Bl𝐴 (q) . Hence, the map Bl𝐴 is actually a morphism of posets if we equip Spec(𝑅) with the partial order ≤ defined by p ≤ q if q ⊆ p (i.e., V(p) ⊆ V(q)). For P ∈ Part(𝐼), we call the fiber Bl−1 𝐴 (P) ⊆ Spec(𝑅) the P-stratum and we call ⋃︁ ⋃︁ ′ ′ (11) Bl−1 Bl−1 Bl−1 𝐴 (≤ P) := 𝐴 (P ) = 𝐴 (P ) P ′ ≤P P ′ ≤P P ′ ∈Bl(𝐴) the P-skeleton. This is simply the locus of all p ∈ Spec(𝑅) where the block structure of 𝐴p is equal to P, respectively coarser than P. Since ⋃︁ −1 ′ (12) Bl−1 Bl−1 𝐴 (P) = Bl𝐴 (≤ P) ∖ 𝐴 (≤ P ) , P ′ <P we can recover the strata from the skeleta. We get a finite decomposition ∐︁ (13) Spec(𝑅) = Bl−1 𝐴 (P) P and we call this the block structure stratification. Our aim is now to show that this is indeed a stratification, i.e., the strata are locally closed subsets of Spec(𝑅) and the closure of a stratum is contained in its skeleton. The key ingredient in proving this is the following general proposition, which is essentially due to Bonnafé and Rouquier [2, Proposition D.2.11] but is proven here in a more general form. Proposition 3.1. Let 𝑅 be an integral domain with fraction field 𝐾, let 𝐴 be a finite flat 𝑅-algebra, and let F ⊆ 𝐴𝐾 be a finite set. Then Gen𝐴 (F ) := {p ∈ Spec(𝑅) | F ⊆ 𝐴p } 10 ULRICH THIEL is a neighborhood of the generic point of Spec(𝑅). If 𝐴 is finitely presented flat, then Gen𝐴 (F ) is an open subset of Spec(𝑅), and if moreover 𝑅 is a Krull domain, the complement Ex𝐴 (F ) of Gen𝐴 (F ) in Spec(𝑅) is a reduced Weil divisor, i.e., it is either empty or pure of codimension one with finitely many irreducible components. Proof. Let us first assume that 𝐴 is actually 𝑅-free. For an element 𝛼 ∈ 𝐾 we define 𝐼𝛼 := {𝑟 ∈ 𝑅 | 𝑟𝛼 ∈ 𝑅}. This is a non-zero ideal in 𝑅, and it has the property that 𝛼 ∈ 𝑅p if and only if 𝐼𝛼 * p. To see this, suppose that 𝛼 ∈ 𝑅p . Then we can write 𝛼 = 𝑥𝑟 for some 𝑥 ∈ 𝑅 ∖ p. Hence, 𝑥𝛼 = 𝑟 ∈ 𝑅 and therefore 𝑥 ∈ 𝐼𝛼 . Since 𝑥 ∈ / p, it follows that 𝐼𝛼 * p. Conversely, if 𝐼𝛼 * p, then there exists 𝑥 ∈ 𝐼𝛼 with 𝑥 ∈ / p. By definition of 𝐼𝛼 we have 𝑥𝛼 =: 𝑟 ∈ 𝑅 and since 𝑥 ∈ / p, we can write 𝛼 = 𝑥𝑟 ∈ 𝑅p . Now, let 1 , . . . , 𝑎𝑛 ) be an 𝑅-basis of 𝐴. Then we can write every element 𝑓 ∈ F ∑︀(𝑎 𝑛 as 𝑓 = 𝑖=1 𝛼𝑓,𝑖 𝑎𝑖 with 𝛼𝑓,𝑖 ∈ 𝐾. Let 𝐼 be the radical of the ideal ∏︁ 𝐼𝛼𝑓,𝑖 E 𝑅 . 𝑓 ∈F , 𝑖=1,...,𝑛 By the properties of the ideals 𝐼𝛼 we have the following logical equivalences: (F ⊆ 𝐴p ) ⇐⇒ ⇐⇒ ⇐⇒ (𝛼𝑓,𝑖 ∈ 𝑅p ∀𝑓 ∈ F , 𝑖 = 1, . . . , 𝑛) (𝐼𝛼𝑓,𝑖 ̸⊆ p ∀𝑓 ∈ F , 𝑖 = 1, . . . , 𝑛) (𝐼 ̸⊆ p) , the last equivalence following from the fact that p is prime. Hence, ⋃︁ (14) Ex𝐴 (F ) = Spec(𝑅) ∖ Gen𝐴 (F ) = V(𝐼) = V(𝐼𝛼𝑓,𝑖 ) , 𝑓 ∈F , 𝑖=1,...,𝑛 implying that Gen𝐴 (F ) is an open subset of Spec(𝑅). Next, still assuming that 𝐴 is 𝑅-free, suppose that 𝑅 is a Krull domain. To show that Ex𝐴 (F ) is either empty or pure of codimension 1 in Spec(𝑅) with finitely many √ irreducible components, it suffices to show this for the closed subsets V(𝐼𝛼 ) = V( / 𝑅. Let ⋃︀ 𝐼 𝛼 ). If 𝛼 ∈ 𝑅, then 𝐼𝛼 = 𝑅 and therefore V(𝐼𝛼 ) = ∅. So, let 𝛼 ∈ V(𝐼𝛼 ) = 𝜆∈Λ V(q𝜆 ) be the decomposition into irreducible components. Note that this decomposition is unique and contains every irreducible component of V(𝐼𝛼 ). √ √ The inclusion V(𝐼𝛼 ) ⊇ V(q𝜆 ) is equivalent to 𝐼𝛼 ⊆ 𝐼𝛼 ⊆ q𝜆 = q𝜆 . Since an irreducible component is a maximal proper closed subset, we see that the q𝜆 are the minimal prime ideals of Spec(𝑅) containing 𝐼𝛼 . Let q = q𝜆 for an arbitrary 𝜆 ∈ Λ. We will show that ht(q) = 1. Since 𝐼𝛼 ⊆ q, we have seen above that 𝛼 ∈ / 𝑅q . As 𝑅 is a Krull domain, also 𝑅q is a Krull domain by [30, Theorem 12.1]. By [3, VII, §1.6, Theorem 4] we have ⋂︁ ⋂︁ 𝑅q = (𝑅q )q′ = 𝑅q′ . q′ ∈Spec(𝑅q ) ht(q′ )=1 q′ ∈Spec(𝑅) q′ ⊆q ht(q′ )=1 Since 𝛼 ∈ / 𝑅q , this shows that there exists q′ ∈ Spec(𝑅) with q′ ⊆ q, ht(q′ ) = 1 and 𝛼∈ / 𝑅q′ . The last property implies 𝐼𝛼 ⊆ q′ and now the minimality in the choice of q implies that q′ = q. Hence, ht(q) = 1 and this shows V(𝐼𝛼 ) is pure of codimension 1. Since 𝐼𝛼 = ̸ 0, there is some 0 ̸= 𝑟 ∈ 𝐼𝛼 . This element is contained in all the height one prime ideals q𝜆 . As 𝑅 is a Krull domain, a non-zero element of 𝑅 can only be contained in finitely many height one prime ideals (see [24, p. 4.10.1]), so Λ must be finite. Now, assume that 𝑅 is an arbitrary integral domain and that 𝐴 is finite flat. Then Grothendieck’s generic freeness lemma [21, Lemme 6.9.2] shows that there BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 11 exists a non-zero 𝑓 ∈ 𝑅 such that 𝐴𝑓 is a free 𝑅𝑓 -module. Note that Spec(𝑅𝑓 ) can be identified with the distinguished open subset D(𝑓 ) of Spec(𝑅). We obviously have Gen𝐴𝑓 (F ) = Gen𝐴 (F ) ∩ D(𝑓 ) . By the arguments above, Gen𝐴𝑓 (F ) is an open subset of D(𝑓 ), and thus of Spec(𝑅). This shows that Gen𝐴 (F ) is a neighborhood in Spec(𝑅). Next, let 𝑅 be arbitrary and assume that 𝐴 is finitely presented flat. It is a standard fact (see [41, Tag 00NX]) that the assumptions on 𝐴 imply that 𝐴 is already finite locally free, i.e., there exist a family (𝑓𝑖 )𝑖∈𝐼 of elements of 𝑅 such that the standard open affines D(𝑓𝑖 ) cover Spec(𝑅) and 𝐴𝑓𝑖 is a finitely generated free 𝑅𝑓𝑖 -module for all 𝑖 ∈ 𝐼. Since Spec(𝑅) is quasi-compact, see [19, Proposition 2.5], we can assume that 𝐼 is finite. Again note that Spec(𝑅𝑓𝑖 ) can be identified with D(𝑓𝑖 ) and that (15) Gen𝐴𝑓𝑖 (F ) = Gen𝐴 (F ) ∩ D(𝑓𝑖 ) . By the above, the set Gen𝐴𝑓𝑖 (F ) is open and since the D(𝑓𝑖 ) cover Spec(𝑅), it follows that Gen𝐴 (F ) is open. Now, suppose that 𝑅 is a Krull domain. Similarly as in (15) we have (16) Ex𝐴𝑓𝑖 (F ) = Ex𝐴 (F ) ∩ D(𝑓𝑖 ) . Suppose that Ex𝐴 (F ) is not empty and let 𝑍 be an irreducible component of Ex𝐴 (F ). There is an 𝑖 ∈ 𝐼 with 𝑍 ∩ D(𝑓𝑖 ) ̸= ∅. The map 𝑇 ↦→ 𝑇 defines a bijection between irreducible closed subsets of D(𝑓𝑖 ) and irreducible closed subsets of Spec(𝑅) which meet D(𝑓𝑖 ), see [19, §1.5]. This implies that 𝑍 ∩ D(𝑓𝑖 ) is an irreducible component of Ex𝐴 (F ) ∩ D(𝑓𝑖 ) = Ex𝐴𝑓𝑖 (F ). It follows from the above that 𝑍 ∩ D(𝑓𝑖 ) is of codimension 1 in D(𝑓𝑖 ). Hence, 𝑍 is of codimension 1 in Spec(𝑅) by [41, Tag 02I4]. All irreducible components of Ex𝐴 (F ) are thus of codimension 1 in Spec(𝑅). Since each set Ex𝐴𝑓𝑖 (F ) has only finitely many irreducible components and since 𝐼 is finite, also Ex𝐴 (F ) has only finitely many irreducible components.  Remark 3.2. We note that 𝐴 is finitely presented flat if and only if it is finite projective, see [28, Theorem 4.30] or [41, Tag 058R]. Hence, we could have equally assumed that 𝐴 is finite projective in Proposition 3.1 but we preferred the seemingly more general notion. From now on, we assume that 𝐴 is finitely presented as an 𝑅-module. For p ∈ Spec(𝑅) let us denote by B𝐴 (p) ⊆ 𝐴𝐾 the set of block idempotents of 𝐴p . Clearly, B𝐴 (p) and Bl𝐴 (p) are in bijection by taking sums of the 𝑐𝑖 over the subsets in Bl𝐴 (p). Note that B𝐴 (p) is constant on Bl−1 𝐴 (P) for any P. We can thus define Gen𝐴 (P) := Gen𝐴 (B𝐴 (p)) where p ∈ Bl−1 (P) is arbitrary. 𝐴 −1 Theorem 3.3. Then Bl𝐴 (P) is a closed subset of Spec(𝑅) for any partition P. −1 Hence, each stratum Bl𝐴 (P) is open in Bl−1 𝐴 (≤ P), thus locally closed in Spec(𝑅), and (17) −1 Bl−1 𝐴 (P) ⊆ Bl𝐴 (≤ P) . In particular, the decomposition (13) is a stratification of Spec(𝑅). 12 ULRICH THIEL Proof. First, P is actually a block structure, i.e., P ∈ Bl(𝐴). Since ∐︀ assume that ′ Spec(𝑅) = P ′ Bl−1 (P ), we have 𝐴 ⋃︁ ′ Spec(𝑅) ∖ Bl−1 Bl−1 𝐴 (≤ P) = 𝐴 (P ) . P ′ ̸≤P Let P ′ ̸≤ P and p′ ∈ Gen𝐴 (P ′ ). Then P ′ ≤ Bl𝐴 (p′ ). But this implies that Bl𝐴 (p′ ) ̸≤ P since otherwise P ′ ≤ Bl𝐴 (p′ ) ≤ P. Hence, Gen𝐴 (P ′ ) ⊆ Spec(𝑅) ∖ −1 ′ ′ Bl−1 𝐴 (≤ P). Conversely, we clearly have Bl𝐴 (P ) ⊆ Gen𝐴 (P ). This shows that ⋃︁ ⋃︁ ′ Spec(𝑅) ∖ Bl−1 Bl−1 Gen𝐴 (P ′ ) . 𝐴 (P ) = 𝐴 (≤ P) = P ′ ̸≤P P ′ ̸≤P This set is open by Proposition 3.1, so (18) Bl−1 𝐴 (≤ P) = ⋂︁ Ex𝐴 (P ′ ) P ′ ̸≤P Bl−1 𝐴 (≤ is closed. From (11) we see that P) is also closed for an arbitrary partition P. Using (12), we see that Bl𝐴 (P) is locally closed. Moreover, we have Bl−1 𝐴 (P) ⊆ Bl−1 𝐴 (≤ P), so −1 −1 Bl−1 𝐴 (P) ⊆ Bl𝐴 (≤ P) = Bl𝐴 (≤ P) .  −1 Remark 3.4. In general it is not true that we have equality Bl−1 𝐴 (P) = Bl𝐴 (≤ P), so the stratification (13) is in general not a so-called good stratification: in the Brauer algebra example in the introduction we have P ′ := Bl𝐴 ((3)) = {{1, 2, 3}, {4}} < {{1, 2}, {3}, {4}} = Bl𝐴 ((2)) =: P, so (3) ∈ Bl−1 𝐴 (≤ P), but (3) is not contained −1 in Bl𝐴 (P) = V((2)). The problem here is that the skeleton Bl−1 𝐴 (≤ P) has an irreducible component on which the maximal block structure is strictly smaller than the maximal one on the entire skeleton. The poset Bl(𝐴) has a unique maximal element, namely the block structure Bl𝐴 (∙) of 𝐴 in the generic point ∙ := (0) of Spec(𝑅), i.e., Bl𝐴 (∙) = {{𝑖} | 𝑖 ∈ 𝐼} is the block structure of the generic fiber 𝐴𝐾 = 𝐴∙ . The deviation of block structures from the generic one thus takes place on the closed subset ⋃︁ (19) BlEx(𝐴) := {p ∈ Spec(𝑅) | Bl𝐴 (p) < Bl𝐴 (∙)} = Bl−1 𝐴 (≤ P) . P<Bl𝐴 (∙) We call this set the block structure divisor of 𝐴. In fact, since BlEx(𝐴) = Ex𝐴 (B𝐴 (∙)), Proposition 3.1 implies: Corollary 3.5. Suppose that 𝑅 is a Krull domain. Then BlEx(𝐴) is a reduced Weil divisor. The generic block structure lives precisely on the open dense subset (20) BlGen(𝐴) := Spec(𝑅) ∖ BlEx(𝐴) = {p ∈ Spec(𝑅) | Bl𝐴 (p) = Bl𝐴 (∙)} = Bl−1 𝐴 (∙) . 3.2. Block number stratification. From the map Bl𝐴 : Spec(𝑅) → Part(𝐼) we obtain the numerical invariant (21) # Bl𝐴 : Spec(𝑅) → N, p ↦→ # Bl𝐴 (p) = # Bl(𝐴p ) . This map is again a morphism of posets, so (22) q ⊆ p ⇒ # Bl𝐴 (p) ≤ # Bl𝐴 (q) . BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 13 For 𝑛 ∈ N we have (23) # Bl−1 𝐴 (𝑛) = {p ∈ Spec(𝑅) | # Bl(𝐴p ) = 𝑛} and we get a decomposition (24) Spec(𝑅) = ∐︁ # Bl−1 𝐴 (𝑛) . 𝑛∈N We call this the block number stratification. This decomposition is of course coarser than the one defined by the fibers of Bl𝐴 . We define ⋃︁ (25) # Bl−1 # Bl−1 𝐴 (≤ 𝑛) := 𝐴 (𝑚) = {p ∈ Spec(𝑅) | # Bl(𝐴p ) ≤ 𝑛} . 𝑚≤𝑛 Since (26) ⋃︁ # Bl−1 𝐴 (≤ 𝑛) = Bl−1 𝐴 (P) , #P≤𝑛 this set is closed in Spec(𝑅) by Theorem 3.3. This means that the map # Bl𝐴 : −1 Spec(𝑅) → N is lower semicontinuous. Hence, # Bl−1 𝐴 (𝑛) is open in # Bl𝐴 (≤ 𝑛), thus locally closed in Spec(𝑅), and (27) −1 #Bl−1 𝐴 (𝑛) ⊆ # Bl𝐴 (≤ 𝑛) , In particular, the partition (24) is a stratification of Spec(𝑅). Again, in general it will not be a good stratification. Note that (28) BlEx(𝐴) = {p ∈ Spec(𝑅) | # Bl𝐴 (p) < # Bl𝐴 (∙)} = Bl−1 𝐴 (≤ # Bl𝐴 (∙) − 1) . 3.3. Block stratification. The poset Part(𝐼) is actually a lattice, i.e., it has meets ∧ and joins ∨. The meet P ∧ P ′ of two partitions is the finest partition of 𝐼 being coarser than both P and P ′ , and this is obtained by joining members with non-empty intersection. The maximal elements in Part(𝐼) not equal to the maximal element itself (the trivial partition) are the partitions {𝑖, 𝑗} ∪ (𝐼 ∖ {𝑖, 𝑗}) with 𝑖 ̸= 𝑗. We call these the atoms of Part(𝐼) and we denote by At(𝐼) the set of atoms. This terminology comes from the fact that an arbitrary partition P is the meet of all atoms lying above it: ⋀︁ P= 𝑇 . 𝑇 ∈At(𝐼) P≤𝑇 Because of this property, we say that Part(𝐼) is atomic. The poset of block structures of 𝐴 has a similar atomic character. For 𝑖, 𝑗 ∈ 𝐼 with 𝑖 ̸= 𝑗 let us write (29) Gl𝐴 ({𝑖, 𝑗}) := Bl−1 𝐴 (≤ {𝑖, 𝑗} ∪ (𝐼 ∖ {𝑖, 𝑗})) . This is the locus of all p ∈ Spec(𝑅) such that the block idempotents 𝑐𝑖 and 𝑐𝑗 belong to the same block of 𝐴p , i.e., they are “glued” over p. We thus call this set a gluing locus. By Theorem 3.3 it is a closed subset of Spec(𝑅). It is clear that ⋃︁ (30) BlEx(𝐴) = Gl𝐴 ({𝑖, 𝑗}) . 𝑖̸=𝑗 Let At(𝐴) be the set of maximal elements of the set of irreducible components of the gluing loci, ordered by inclusion. Then we still have ⋃︁ (31) BlEx(𝐴) = 𝑍. 𝑍∈At(𝐴) Lemma 3.6. The 𝑍 ∈ At(𝐴) are precisely the irreducible components of BlEx(𝐴). 14 ULRICH THIEL Proof. Let 𝑌 be an irreducible component of BlEx(𝐴) and let 𝜉 be the generic point of 𝑌 . Since Bl𝐴 (𝜉) is not the trivial partition, there is 𝑖 ̸= 𝑗 with Bl𝐴 (𝜉) ≤ {𝑖, 𝑗} ∪ (𝐼 ∖ {𝑖, 𝑗}). Hence, 𝑌 ⊆ Gl𝐴 ({𝑖, 𝑗}). Since 𝑌 is a maximal irreducible closed subset of BlEx(𝐴) and Gl𝐴 ({𝑖, 𝑗}) ⊆ BlEx(𝐴), it is also a maximal irreducible closed subset of Gl𝐴 ({𝑖, 𝑗}), thus equal to an irreducible component 𝑍 of Gl𝐴 ({𝑖, 𝑗}). It is clear that 𝑍 ∈ At(𝐴). Conversely, let 𝑍 ∈ At(𝐴). Since 𝑍 ⊆ BlEx(𝐴), there is an irreducible component 𝑌 of BlEx(𝐴) containing 𝑍. With the same argumentation as above, there is 𝑍 ′ ∈ At(𝐴) with 𝑌 ⊆ 𝑍 ′ . Hence, 𝑍 ⊆ 𝑌 ⊆ 𝑍 ′ , and therefore 𝑍 = 𝑌 by maximality of the elements in At(𝐴).  It now follows that for any p ∈ Spec(𝑅) we have ⋀︁ ⋀︁ (32) Bl𝐴 (p) = P= Bl𝐴 (𝑍) , P∈At(𝐼) Bl𝐴 (p)≤P 𝑍∈At(𝐴) p∈𝑍 where Bl𝐴 (𝑍) denotes the block structure in the generic point of 𝑍, i.e., the unique maximal block structure on 𝑍. Hence, any block structure of 𝐴 is a meet of atomic block structures Bl𝐴 (𝑍) for 𝑍 ∈ At(𝐴). Recall from Corollary 3.5 that if 𝑅 is a Krull domain, the 𝑍 ∈ At(𝐴) are all of codimension one in Spec(𝑅). Following this observation, we introduce a refined stratification of Spec(𝑅). For a subset Z ⊆ At(𝐼) we define ⋂︁ (33) Bl−1 𝑍 𝐴 (≤ Z ) := 𝑍∈Z and (34) Bl−1 𝐴 (Z ) := ⋂︁ ⋃︁ 𝑍∖ 𝑍∈Z 𝑍. 𝑍∈At(𝐴)∖Z −1 It is clear that Bl−1 𝐴 (≤ Z ) is closed in Spec(𝑅), that Bl𝐴 (Z ) is locally closed −1 in Spec(𝑅) and that the block structure on Bl𝐴 (Z ) is in any point equal to ∧𝑍∈Z Bl𝐴 (𝑍). Note that in this notation Bl−1 𝐴 (≤ ∅) = Spec(𝑅) and ⋃︁ (35) Bl−1 𝑍 = BlGen(𝐴) . 𝐴 (∅) = Spec(𝑅) ∖ 𝑍∈At(𝐴) Clearly, (36) Bl−1 𝐴 (Z ) ⊆ ⋂︁ 𝑍 = Bl−1 𝐴 (≤ Z ) , 𝑍∈Z so we obtain a stratification (37) Spec(𝑅) = ∐︁ Bl−1 𝐴 (Z ) Z ⊆At(𝐴) refining the block structure stratification (13). We call this the block stratification of 𝐴. 4. Blocks of specializations We now turn to our actual problem, namely blocks of specializations of 𝐴. Compared to blocks of localizations there is in general no possibility to compare the actual block structures of specializations. However, there is a rather general setting where blocks of specializations are naturally identified with blocks of localizations, namely when 𝑅 is normal and 𝐴𝐾 splits. In this case we can compare the actual block structures of specializations and all results from the preceding paragraph BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 15 are actually also results about blocks of specializations. For the proof we need the following general result. Theorem 4.1. Let 𝜑 : 𝑅 ˓→ 𝑆 be a faithfully flat morphism of integral domains and let 𝐴 be a finite flat 𝑅-algebra. Let 𝐾 and 𝐿 be the fraction field of 𝑅 and 𝑆, respectively. If #Bl(𝐴𝐾 ) = #Bl(𝐴𝐿 ), then the morphism 𝜑𝐴 : 𝐴 → 𝐴𝑆 is block bijective. Proof. Recall from Corollary 2.5 that both 𝐴 and 𝐴𝑆 have block decompositions. The map 𝜑𝐴 : 𝐴 → 𝐴𝑆 is injective by Lemma 2.1(b) since 𝜑 is faithfully flat. Hence, 𝜑𝐴 is idempotent stable by Lemma 2.3(a) and therefore #Bl(𝐴) ≤ #Bl(𝐴𝑆 ) by (5). We thus have to show that #Bl(𝐴) ≥ #Bl(𝐴𝑆 ). We split the proof of this fact into several steps. The case 𝑅 = 𝐾 and 𝑆 = 𝐿 holds by assumption. Assume that 𝑅 = 𝐾 and that 𝑆 is general as in the theorem. Since 𝐴 is 𝑅-flat, the extension 𝐴𝑆 is 𝑆-flat and thus 𝑆-torsionfree. Hence, the map 𝐴𝑆 → 𝐴𝐿 is injective by Lemma 2.1(c). In particular, it is idempotent stable by Lemma 2.3(a) and so #Bl(𝐴𝑆 ) ≤ #Bl(𝐴𝐿 ) by (5). In total, we have #Bl(𝐴) ≤ #Bl(𝐴𝑆 ) ≤ #Bl(𝐴𝐿 ) = #Bl(𝐴𝐾 ) = #Bl(𝐴). Hence, #Bl(𝐴) = #Bl(𝐴𝑆 ). Finally, let both 𝑅 and 𝑆 be general as in the theorem. Let Σ := 𝑅 ∖ {0} and Ω := 𝑆 ∖ {0}. Then 𝐾 = Σ−1 𝑅 and 𝐿 = Ω−1 𝑆. Set 𝑇 := Σ−1 𝑆. Since 𝑅 and 𝑆 are integral domains, we can naturally view all rings as subrings of 𝐿 and so we get the two commutative diagrams (38) 𝐿 𝐴𝐿 𝑇 𝐴𝑇 𝐾 𝑆 𝐴𝐾 𝑅 𝐴𝑆 𝐴 the right one being induced by the left one. All morphisms in the left diagram are clearly injective. We claim the same holds for the right diagram. We have noted at the beginning that the map 𝐴 → 𝐴𝑆 is injective. Since 𝐴 is 𝑅-flat, it is 𝑅-torsionfree and so the map 𝐴 → 𝐴𝐾 is injective by Lemma 2.1(c). We have argued above already that the map 𝐴𝑆 → 𝐴𝐿 is injective. Since 𝑆 ˓→ 𝑇 is a localization map, the induced scalar extension functor is exact so that 𝐴𝑇 is a flat 𝑇 -module. In particular, 𝐴𝑇 is 𝑇 -torsionfree and so 𝐴𝑇 → 𝐴𝐿 is injective by 2.1(c). The map 𝐴𝐾 → 𝐴𝐿 is injective by Lemma 2.1(a). Due to the commutativity of the diagram, the remaining maps must be injective, too. We can thus view all scalar extensions of 𝐴 naturally as subsets of 𝐴𝐿 . We claim that (39) 𝐴 = 𝐴𝐾 ∩ 𝐴𝑆 as subsets of 𝐴𝐿 . Because of the commutative diagram above, this intersection already takes place in 𝐴𝑇 . Consider 𝐴𝐾 as an 𝑅-module now. We have a natural identification 𝜑* (𝐴𝐾 ) = 𝑆 ⊗𝑅 𝐴𝐾 = 𝑆 ⊗𝑅 (Σ−1 𝐴) = (Σ−1 𝑆) ⊗𝑅 𝐴 = 𝑇 ⊗𝑅 𝐴 = 𝐴𝑇 as 𝑆-modules by [3, II, §2.7, Proposition 18]. Note that the map 𝐴𝐾 → 𝐴𝑇 in the diagram above is the map 𝜑𝐴𝐾 , when considering 𝐴𝐾 as an 𝑅-module. The 𝑅-submodule 𝐴 of 𝐴𝐾 is now identified with 𝜑𝐴𝐾 (𝐴) and the 𝑆-submodule of 𝐴𝑇 generated by 𝐴 ⊆ 𝐴𝑇 is identified with 𝐴𝑆 . Since 𝜑 is faithfully flat, it follows from 16 ULRICH THIEL [3, I, §3.5, Proposition 10(ii)] applied to the 𝑅-module 𝐴𝐾 and the submodule 𝐴 that 𝐴 = 𝐴𝐾 ∩ 𝐴𝑆 inside 𝐴𝑇 . Let (𝑐𝑖 )𝑖∈𝐼 be the block idempotents of 𝐴𝑆 and let (𝑑𝑗 )𝑗∈𝐽 be the block idempotents of 𝐴𝐾 . By assumption the morphism 𝐴𝐾 → 𝐴𝐿 is block bijective, which means that (𝑑𝑗 )𝑗∈𝐽 are the block idempotents of 𝐴𝐿 . Since 𝐴𝑆 → 𝐴𝐿 is idempotent stable, there exists by the arguments preceding (5) a partition (𝐽𝑖 )∑︀ 𝑖∈𝐼 of 𝐽 such that the non-zero central idempotent 𝑐𝑖 can in 𝐴𝐿 be written as 𝑐𝑖 = 𝑗∈𝐽𝑖 𝑑𝑗 . But this shows that 𝑐𝑖 ∈ 𝐴𝐾 ∩ 𝐴𝑆 , hence 𝑐𝑖 ∈ 𝐴 and so (𝑐𝑖 )𝑖∈𝐼 gives a decomposition of 1 ∈ 𝐴 into pairwise orthogonal centrally-primitive idempotents of 𝐴 by (39). Hence, #Bl(𝐴) = #Bl(𝐴𝑆 ).  To formulate the next proposition more generally, we use the property block-split introduced in Definition A.2 but note that the reader might just simply replace it by the more special property split. Moreover, we recall that a local integral domain 𝑅 is called unibranch if its henselization 𝑅ℎ is again an integral (local) domain. This is equivalent to the normalization of 𝑅 being again local (see [37, IX, Corollaire 1]). This clearly holds if 𝑅 is already normal. Examples of non-normal unibranch rings are the local rings in ordinary cusp singularities of curves. Proposition 4.2. Let 𝑅 be an integral domain and let 𝐴 be a finite flat 𝑅-algebra with block-split generic fiber 𝐴𝐾 (e.g., if 𝐴𝐾 splits). Let p ∈ Spec(𝑅) and suppose that 𝑅p is unibranch (e.g., if 𝑅p is normal). Then the quotient morphism 𝐴p  𝐴(p) is block bijective. Proof. By assumption, 𝑅p and its henselization 𝑅pℎ are integral domains. Since 𝐴 is 𝑅-flat, it follows that 𝐴p = 𝑅p ⊗𝑅 𝐴 is 𝑅p -flat and that 𝐴ℎp := 𝑅pℎ ⊗𝑅p 𝐴p is 𝑅pℎ -flat. Hence, both 𝐴p and 𝐴ℎp have block decompositions by Lemma 2.5. Let pℎp be the maximal ideal of 𝑅pℎ . The henselization morphism 𝑅p → 𝑅pℎ is local and faithfully flat by [23, Théorème 18.6.6(iii)]. We now have a commutative diagram 𝐴p 𝐴ℎp 𝐴(p) = 𝐴p /pp 𝐴p 𝐴ℎp /pℎp 𝐴ℎp of idempotent stable morphisms. We know from Lemma A.12(b) and Lemma A.10 that 𝐴ℎp → 𝐴ℎp /pℎp 𝐴ℎp is block bijective. Since 𝐴 has block-split generic fiber and 𝑅p → 𝑅pℎ is a faithfully flat morphism of integral domains, we can use Theorem 4.1 to deduce that 𝐴p → 𝐴ℎp is block bijective. In [23, Théorème 18.6.6(iii)] it is proven that 𝑅p /pp ≃ 𝑅pℎ /pℎp . Hence, the map 𝐴p /pp 𝐴p → 𝐴ℎp /pℎp 𝐴ℎp is an isomorphism and so in particular block bijective. We thus have #Bl(𝐴ℎp ) = #Bl(𝐴p ) ≤ #Bl(𝐴(p)) = #Bl(𝐴ℎp /pℎp 𝐴ℎp ) = #Bl(𝐴ℎp ) by equation (5). Hence, #Bl(𝐴p ) = #Bl(𝐴(p)), so 𝐴p  𝐴(p) is block bijective.  Corollary 4.3. Suppose that 𝑅 is normal and 𝐴𝐾 splits. Then 𝐴p  𝐴(p) is block bijective for all p ∈ Spec(𝑅). Hence, all results from §3 apply also to blocks of specializations of 𝐴. BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 17 5. Blocks via central characters In this section we discuss an approach to explicitly compute the block structure of 𝐴 in any point p ∈ Spec(𝑅), and so to compute the whole block stratification. This is based on the knowledge of the central characters of the generic fiber of 𝐴. Parts of the arguments presented here are due to Bonnafé and Rouquier [2, Appendix D]. 5.1. Müller’s theorem. The central ingredient to establish a relationship between blocks and central characters is the general Lemma 5.6 below, which is usually referred to as Müller’s theorem. We were not able to find a proof of it in this generality in the literature, so we include a proof here but note that this is known. The main ingredient is an even more general result by B. Müller [32] about the fibration of cliques of prime ideals in a noetherian ring over its center, see Lemma 5.5. We will recall only a few basic definitions from the excellent exposition in [17, §12] and refer to loc. cit. for more details. Throughout this paragraph, we assume that 𝐴 is a noetherian ring. If p, q are prime ideals of 𝐴, we say that there is a link from p to q, written p q, if there is an ideal a of 𝐴 such that p ∩ q ) a ⊇ pq and (p ∩ q)/a is non-zero and torsion-free both as a left (𝐴/p)-module and as a right (𝐴/q)-module. The bimodule (p ∩ q)/q is then called a linking bimodule between q and p. The equivalence classes of the equivalence relation on Spec(𝐴) generated by are called the cliques of 𝐴. We write Clq(𝐴) for the set of cliques of 𝐴 and Clq(p) for the unique clique of 𝐴 containing p. For the proof of Lemma 5.6 we will need a few preparatory lemmas. We call the supremum of lengths of chains of prime ideals in a 𝐴 the classical Krull dimension of 𝐴. The following lemma is standard. Lemma 5.1. Suppose that 𝐴 is noetherian and of classical Krull dimension zero. Then there is a canonical bijection ∼ (40) Bl(𝐴) −→ 𝑐 ↦−→ Clq(𝐴) 𝑋𝑐 := {m ∈ Max(𝐴) | 𝑐† ∈ m} , where 𝑐† = 1 − 𝑐. If moreover 𝐴 is commutative, then the cliques are singletons, i.e., there is a unique m𝑐 ∈ Max(𝐴) with 𝑐† ∈ m𝑐 . Hence, in this case we have Bl(𝐴) ≃ Max(𝐴) ≃ Spec(𝐴). Proof. The first assertion is proven in [17, Corollary 12.13]. In a commutative noetherian ring the cliques are singletons (see [17, Exercise 12F]), and this immediately implies the second assertion.  Lemma 5.2. Let p be a prime ideal of a noetherian ring 𝐴 and let 𝑉 be a nonzero 𝐴-module with p ⊆ Ann(𝑉 ). If 𝑉 is torsion-free as an (𝐴/p)-module, then p = Ann(𝑉 ). Proof. Suppose that p ( Ann(𝑉 ). Then Ann(𝑉 )/p is a non-zero ideal of the noetherian prime ring 𝐴/p and thus contains a regular element 𝑥 by [25, Corollary 2.3.11]. But then 𝑥𝑉 = 0, contradicting the assumption that 𝑉 is a torsion-free (𝐴/p)-module.  Lemma 5.3. The following holds: (a) If p and q are prime ideals of 𝐴 and if b is an ideal of 𝐴 with b ⊆ p ∩ q such that p/b q/b in 𝐴/b, then p q in 𝐴. 18 ULRICH THIEL (b) Let p and q be two prime ideals of 𝐴 with p q and let b be an ideal of 𝐴. If there exists a linking ideal a from p to q with b ⊆ a, then p/b q/b in 𝐴/b. Proof. (a) We can write a linking ideal from p/b to q/b as a/b for an ideal a containing b. By definition, we have (p ∩ q)/b = (p/b) ∩ (q/b) ) a/b ⊇ (p/b) · (q/b) = (pq)/b , implying that p ∩ q ) a ⊇ pq. Moreover, we have ((p ∩ q)/b) / (a/b) ∼ = (p ∩ q)/a as (𝐴/b)-bimodules. By definition, (p ∩ q)/a is torsionfree as a left module over the ring (𝐴/b)/(p/b) ∼ = 𝐴/p . Similarly, it follows that (p ∩ q)/a is torsionfree as a right module over the ring 𝐴/q. Hence, a is a linking ideal from p to q. (b) We have p/b ∩ q/b = (p ∩ q)/b ) a/b ⊇ (pq + b)/b = (p/b) · (q/b) . Since ((p ∩ q)/b) / (a/b) ∼ = (p ∩ q)/a , (𝐴/b)/(p/b) ∼ = 𝐴/p , (𝐴/b)/(q/b) ∼ = 𝐴/q , it follows that a/b is a linking ideal from p/b to q/b.  Lemma 5.4. Let p and q be distinct prime ideals of a noetherian ring 𝐴 with p q. If z is a centrally generated ideal of 𝐴 with z ⊆ p or z ⊆ q, then z ⊆ p ∩ q and p/z q/z in 𝐴/z. Proof. This is proven in [33] but we also give a proof here for the sake of completeness. First note that since z is centrally generated and p q, it follows from [17, Lemma 12.15] that already z ⊆ p ∩ q. Let a be a linking ideal from p to q. We claim that z is contained in a. To show this, suppose that z is not contained in a. Then (a + z)/a is a non-zero submodule of (p ∩ q)/a which is torsionfree as a left (𝐴/p)-module and as a right (𝐴/q)-module. In conjunction with the fact that z is centrally generated it now follows from Lemma 5.2 that p = Ann(𝐴 ((a + z)/a)) = Ann(((a + z)/a)𝐴 ) = q, contradicting the assumption p ̸= q. Hence, we must have z ⊆ a and it thus follows from Lemma 5.3(b) that p/z q/z.  Lemma 5.5. Let z be a centrally generated ideal of a noetherian ring 𝐴. Let p be a prime ideal of 𝐴 with z ⊆ p. Then all prime ideals in Clq(p) contain z and the map Clq(p) − ↦ → q − ↦ → Clq(p/z) q/z is a bijection between a clique of 𝐴 and a clique of 𝐴/z. Proof. It follows immediately from [17, Lemma 12.15] that all prime ideals in Clq(p) contain z. If q ∈ Clq(p), then there exists a chain p = p0 , p1 , . . . , p𝑟−1 , p𝑟 = q of prime ideals of 𝐴 with p𝑖 p𝑖+1 or p𝑖+1 p𝑖 for all indices 𝑖. An inductive application of Lemma 5.4 shows now that p𝑖 /z p𝑖+1 /z or p𝑖+1 /z p𝑖 /z for all 𝑖. Hence, p/z and q/z lie in the same clique of 𝐴/z so that the map Clq(p) → Clq(p/z) is well-defined. On the other hand, similar arguments and Lemma 5.3(a) show that if q/z ∈ Clq(p/z), BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 19 then also q ∈ Clq(p), so that we also have a well-defined map Clq(p/z) → Clq(p). It is evident that both maps defined are pairwise inverse thus proving the first assertion. The second assertion is now obvious.  Lemma 5.6 (B. Müller). Let 𝐴 be a ring with center 𝑍 such that 𝑍 is noetherian and 𝐴 is a finite 𝑍-module. If z is a centrally generated ideal of 𝐴 such that 𝐴/z𝐴 is of classical Krull dimension zero, then the inclusion (𝑍 + z)/z ˓→ 𝐴/z𝐴 is block bijective. In other words, the block idempotents of 𝐴/z𝐴 are already contained in the central subalgebra (𝑍 + z)/z. Proof. Let 𝐴 := 𝐴/z and let 𝑍 := (𝑍 +z)/z. Then 𝐴 is a finitely generated 𝑍-module since 𝐴 is a finitely generated 𝑍-module. Hence, 𝑍 ⊆ 𝐴 is a finite centralizing extension and now it follows from going up in finite centralizing extensions [31, Theorem 10.2.9] that the classical Krull dimension of 𝑍 is equal to that of 𝐴, which is zero by assumption. Hence, by Lemma 5.1 we have Bl(𝑍) ≃ Clq(𝑍) and Bl(𝐴) ≃ Clq(𝐴). Since #Bl(𝑍) ≤ #Bl(𝐴), the claim is thus equivalent to the claim that over each clique of 𝑍, there is just one clique of 𝐴. So, let 𝑋, 𝑌 ∈ Clq(𝐴) be two cliques. We pick M/z ∈ 𝑋 and N/z ∈ 𝑌 with M, N maximal ideals of 𝐴. Assume that 𝑋 and 𝑌 lie over the same clique of 𝑍. Since 𝑍 is commutative, we know from Lemma 5.1 that all cliques are singletons and so the assumption implies that M/z and N/z lie over the same maximal ideal of 𝑍, i.e., (M/z) ∩ ((𝑍 + z)/z) = (N/z) ∩ ((𝑍 + z)/z) , hence M ∩ (𝑍 + z) = N ∩ (𝑍 + z) . Since 𝑍 ⊆ 𝑍 + z, we thus get M ∩ 𝑍 = M ∩ 𝑍 ∩ (𝑍 + z) = N ∩ 𝑍 ∩ (𝑍 + z) = N ∩ 𝑍 . Now, Müller’s theorem [17, Theorem 13.10] implies that M and N lie in the same clique of 𝐴. An application of Lemma 5.5 thus implies that M/z and N/z lie in the same clique of 𝐴/z, so 𝑋 = 𝑌 .  5.2. Blocks as fibers of a morphism. We assume that 𝐴 is a finite flat algebra over a noetherian integral domain 𝑅. By Lemma B.2 the morphism (41) Υ : Spec(𝑍) → Spec(𝑅) , induced by the canonical morphism from 𝑅 to the center 𝑍 of 𝐴 is finite, closed, and surjective. The center 𝑍 of 𝐴 is naturally an 𝑅-algebra and so we can consider its fibers (42) 𝑍(p) = k(p) ⊗𝑅 𝑍/p𝑍 = 𝑍p /pp 𝑍p in prime ideals p of 𝑅. On the other hand, the image of 𝑍p = Z(𝐴p ) under the canonical (surjective) morphism 𝐴p  𝐴(p) yields a central subalgebra (43) Zp (𝐴) := (𝑍p + pp 𝐴p )/pp 𝐴p of 𝐴(p). In general this subalgebra is not equal to the center of 𝐴(p) itself. We have a surjective morphism (44) 𝜙p : 𝑍(p)  Zp (𝐴) 20 ULRICH THIEL of finite-dimensional k(p)-algebras. This morphism is in general not injective—it is if and only if pp 𝐴p ∩ 𝑍p = pp 𝑍p . Nonetheless, we have the following result. Lemma 5.7. The map 𝜙p : 𝑍(p) → Zp (𝐴) in (44) is block bijective. Proof. Since 𝜙p is surjective, the induced map 𝑎 𝜙p : Spec(Zp (𝐴)) → Spec(𝑍(p)) is injective, so # Bl(Zp (𝐴)) ≤ # Bl(𝑍(p)) by Lemma 5.1. Now we just need to show that 𝜙p does not map any no non-trivial idempotent to zero. Since 𝑅p is noetherian, also 𝐴p is noetherian. The Artin–Rees lemma [30, Theorem 8.5] applied to the 𝑅p -module 𝐴p , the submodule 𝑍p of 𝐴p , and the ideal pp of 𝑅p shows that there is an integer 𝑘 ∈ N>0 such that for any 𝑛 > 𝑘 we have p𝑛p 𝐴p ∩ 𝑍p = p𝑛−𝑘 ((p𝑘p 𝐴p ) ∩ 𝑍p ) . p In particular, there is 𝑛 ∈ N>0 such that p𝑛p 𝐴p ∩ 𝑍p ⊆ pp 𝑍p . Now, let 𝑒 ∈ 𝑍(p) = 𝑍p /pp 𝑍p be an idempotent with 𝜙p (𝑒) = 0. By assumption, 𝑒 ∈ Ker(𝜙p ) = (pp 𝐴p ∩ 𝑍p )/pp 𝑍p . Hence, if 𝑒 ∈ 𝑍p is a representative of 𝑒, we have 𝑒 ∈ pp 𝐴p ∩ 𝑍p . We have 𝑒𝑛 ∈ p𝑛p 𝐴p ∩ 𝑍p ⊆ pp 𝑍p , so already 𝑒 = 0.  Theorem 5.8. For any p ∈ Spec(𝑅) there are canonical bijections (45) Bl(𝐴(p)) ≃ Bl(Zp (𝐴)) ≃ Bl(𝑍(p)) ≃ Υ−1 (p) . The first bijection Bl(𝐴(p)) ≃ Bl(Zp (𝐴)) is induced by the embedding Zp (𝐴) ˓→ 𝐴(p). In other words, all block idempotents of 𝐴(p) are already contained in the central subalgebra Zp (𝐴) of 𝐴(p). The second bijection is the bijection from Lemma 5.7. The last bijection Bl(𝑍(p)) ≃ Υ−1 (p) maps a block idempotent 𝑐 of 𝑍(p) to the (by the theorem unique) maximal ideal m𝑐 of 𝑍 lying above p such that 𝑐† ∈ (m𝑐 +pp 𝑍p )/pp 𝑍p , where 𝑐† = 1 − 𝑐. Proof. The first bijection follows directly from Lemma 5.6 applied to 𝐴p and the centrally generated ideal z := pp 𝐴p . Let Υp : Spec(𝑍p ) → Spec(𝑅p ) be the morphism induced by the canonical map 𝑅p → 𝑍p . Recall from Lemma B.2 that 𝑅p ⊆ 𝑍p is a finite extension so that Υp is surjective. We have Υ−1 p (pp ) = {Q ∈ Spec(𝑍p ) | Q ∩ 𝑅p = pp } = {Q ∈ Spec(𝑍p ) | pp ⊆ Q} = {Q ∈ Spec(𝑍p ) | pp 𝑍p ⊆ Q} ≃ Spec(𝑍(p)) . In the second equality we used the fact that 𝑅p → 𝑍p is a finite morphism and 𝑅p is local with maximal ideal pp . The identification with Spec(𝑍(p)) is canonical since 𝑍(p) = 𝑍p /pp 𝑍p . The morphism Θp : Spec(𝑍p ) → Spec(𝑍) induced by the localization map 𝑍 → 𝑍p is injective by [13, Proposition 2.2(b)]. We claim that −1 this map induces Υ−1 (p). If Q ∈ Υ−1 p (pp ) ≃ Υ p (pp ), then clearly (Q ∩ 𝑍) ∩ 𝑅 = −1 Q ∩ 𝑅 ⊆ 𝑅 ∩ pp = p and therefore Θp induces an injective map Υ−1 (p). p (pp ) → Υ If Q ∈ Υ−1 (p), then, since Q ∩ 𝑅 = p, we have Q ∩ (𝑅 ∖ p) = ∅ so that Qp ∈ Spec(𝑍p ) −1 −1 and clearly pp ⊆ Qp , implying that Qp ∈ Υ−1 (p) p (pp ). The map Υp (pp ) → Υ −1 is thus bijective. Hence, we have a canonical bijection Spec(𝑍(p)) ≃ Υ (p). Now, recall from Lemma 5.1 that Spec(𝑍(p)) ≃ Bl(𝑍(p)).  5.3. Blocks via central characters. We assume that 𝑅 is noetherian and normal, and that 𝐴 is a finite flat 𝑅-algebra with split generic fiber 𝐴𝐾 . BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 21 Recall from Corollary 4.3 that the quotient map 𝐴p  𝐴(p) induces Bl(𝐴p ) ≃ Bl(𝐴(p)), so together with Theorem 5.8 we have a canonical bijection (46) Bl(𝐴p ) ≃ Υ−1 (p) . Recall from §3 that Famp (𝐴𝐾 ) is the partition of Irr 𝐴𝐾 induced by the blocks of 𝐴p and that we naturally have Bl(𝐴p ) ≃ Famp (𝐴𝐾 ). Altogether, we now have canonical bijections (47) Famp (𝐴) ≃ Bl(𝐴p ) ≃ Υ−1 (p) ≃ Bl(𝐴(p)) . Since 𝐴 has split generic fiber 𝐴𝐾 , we have a central character Ω𝑆 : Z(𝐴𝐾 ) → 𝐾 for every simple 𝐴𝐾 -module 𝑆. Recall that Ω𝑆 (𝑧) is the scalar by which 𝑧 ∈ Z(𝐴𝐾 ) acts on 𝑆. Since 𝑅 is normal, the image of the restriction of Ω𝑆 to Z(𝐴) ⊆ Z(𝐴𝐾 ) is contained in 𝑅 ⊆ 𝐾. We thus get a well-defined 𝑅-algebra morphism (48) Ω′𝑆 : Z(𝐴) → 𝑅 . It is a classical fact that 𝑆, 𝑇 ∈ Irr 𝐴𝐾 lie in the same family if and only if Ω′𝑆 = Ω′𝑇 . We can thus label the central characters of 𝐴𝐾 as Ωℱ with ℱ a family (block) of 𝐴𝐾 . Using Theorem 5.8 this description generalizes modulo p so that we get an explicit description of the p-families, and thus of the block stratification. For p ∈ Spec(𝑅) let (49) Ωp𝑆 : Z(𝐴) → 𝑅/p be the composition of Ω′𝑆 with the quotient map 𝑅  𝑅/p. Theorem 5.9. Under the bijection Υ−1 (p) ≃ Famp (𝐴) from (47) the p-family of a simple 𝐴𝐾 -module 𝑆 corresponds to Ker Ωp𝑆 . Hence, two simple 𝐴𝐾 -modules 𝑆 and 𝑇 lie in the same p-family if and only if Ω′𝑆 (𝑧) ≡ Ω′𝑇 (𝑧) mod p for all 𝑧 ∈ Z(𝐴). So, if 𝑧1 , . . . , 𝑧𝑛 is an 𝑅-algebra generating system of Z(𝐴) and F , F ′ are two distinct 𝐴𝐾 -families, then the corresponding gluing locus is given by (50) Gl𝐴 (≤ {F , F ′ }) = V({ΩF (𝑧𝑖 ) − ΩF ′ (𝑧𝑖 ) | 𝑖 = 1, . . . , 𝑛}) . Proof. Considering the explicit form of the bijection given in Theorem 5.8 we see that the bijection (46) maps a block idempotent 𝑐 of 𝐴p to the (by the theorem unique) maximal ideal Q𝑐 of 𝑍 lying above p and satisfying 𝑐† ∈ (Q𝑐 )p . Let 𝑐Q be the block idempotent of 𝐴p corresponding to Q ∈ Υ−1 (p). For 𝑆 ∈ Irr 𝐴𝐾 let Ωp𝑆 : 𝑍 → 𝑅/p be the composition of Ω′𝑆 and the quotient morphism 𝑅 → 𝑅/p. It is clear that Ker(Ωp𝑆 ) ∈ Υ−1 (p). Note that Ω′𝑆 (𝑧) ≡ Ω′𝑇 (𝑧) mod p for all 𝑧 ∈ Z(𝐴) if and only if Ωp𝑆 = Ωp𝑇 . We have an exact sequence Ω′ 𝑆 0 −→ Ker(Ω′𝑆 ) −→ 𝑍 −→ 𝑅 −→ 0 of 𝑅-modules. Since Ω′𝑆 is an 𝑅-algebra morphism, the canonical map 𝑅 → 𝑍 is a section of Ω′𝑆 and therefore 𝑍 = 𝑅 ⊕ Ker(Ω′𝑆 ) as 𝑅-modules. Similarly, we have 𝑍 = 𝑅 ⊕ Ker(Ω′𝑇 ). Since Ker(Ω′𝑆 ) ⊆ Ker(Ωp𝑆 ) and Ker(Ω′𝑇 ) ⊆ Ker(Ωp𝑇 ), this implies that Ωp𝑆 = Ωp𝑇 if and only if Ker(Ωp𝑆 ) = Ker(Ωp𝑇 ). Now, suppose that Ker(Ωp𝑆 ) = Ker(Ωp𝑇 ). Denote this common kernel by Q. Clearly, Q ∈ Υ−1 (p). We know that the corresponding block idempotent 𝑐Q of 𝐴p has the property that 𝑐†Q ∈ Qp . Since Ker(Ω′𝑆 ) ⊆ Ker(Ωp𝑆 ) = Q = Ker(Ωp𝑇 ) ⊇ Ker(Ω′𝑇 ), this certainly implies that 𝑐†Q 𝑆 = 0 = 𝑐†Q 𝑇 . Hence, 𝑆 and 𝑇 lie in the same p-family. 22 ULRICH THIEL Conversely, suppose that 𝑆 and 𝑇 lie in the same p-family. We can write the corresponding block idempotent of 𝐴p as 𝑐Q for some Q ∈ Υ−1 (p). By definition, 𝑐†Q 𝑆 = 0 = 𝑐†Q 𝑇 . We know that 𝑐†Q ∈ Qp and 𝑐Q ∈ / Qp and there′ ′ ′ fore Ker((Ω𝑆 )p ) = Qp = Ker((Ω𝑇 )p ). Hence, Q ⊆ Ker(Ω𝑆 ) ⊆ Ker(Ωp𝑆 ) and Q ⊆ Ker(Ω′𝑇 ) ⊆ Ker(Ωp𝑇 ). Since Q, Ker(Ωp𝑆 ), Ker(Ωp𝑇 ) ∈ Υ−1 (p) and all prime ideals in Υ−1 (p) are incomparable, we thus conclude that Ker(Ωp𝑆 ) = Ker(Ωp𝑇 ). The equation for the gluing locus is now clear.  6. Blocks and decomposition matrices To obtain information about the actual members of the 𝐴(p)-families we use decomposition maps as introduced by Geck and Rouquier [16] (see also [15] and [42]). For a ring 𝐴 we denote by G0 (𝐴) := K0 (𝐴-mod) the Grothendieck group and by K0 (𝐴) := K0 (𝐴-proj) the projective class group. In case 𝐴 is semiperfect (e.g., artinian), K0 (𝐴) is the free abelian group with basis the isomorphism classes of the projective indecomposable modules. In case 𝐴 is artinian, G0 (𝐴) is the free abelian group with basis the isomorphism classes of simple modules and K0 (𝐴) ≃ G0 (𝐴) mapping 𝑃 to Hd(𝑃 ). For the theory of decomposition maps we need the following (standard) assumption: 𝐴 is finite free with split generic fiber and for any non-zero p ∈ Spec(𝑅) there is a discrete valuation ring O with maximal ideal m in 𝐾 dominating 𝑅p such that the canonical map G0 (𝐴(p)) → G0 (𝐴O (m)) of Grothendieck groups is an isomorphism. We call a ring O as above a perfect 𝐴-gate in p. We refer to [42] for more details. The following lemma lists two standard situations in which the above assumptions hold. Part (a) is obvious and part (b) was proven in [42, Theorem 1.22]. Lemma 6.1. A finite free 𝑅-algebra 𝐴 with split generic fiber satisfies the above assumptions in the following two cases: (a) 𝑅 is a Dedekind domain. (b) 𝑅 is noetherian and 𝐴 has split fibers. If O is a perfect 𝐴-gate in p, then there is a group morphism (51) 𝐾 dp,O 𝐴 : G0 (𝐴 ) → G0 (𝐴(p)) between Grothendieck groups generalizing reduction modulo p. In case 𝑅 is normal, it was proven by Geck and Rouquier [16] that this map is independent of the choice of O and in this case we just write dp𝐴 . We note that in case 𝑅 is noetherian and 𝐴 has split fibers, any decomposition map in the sense of Geck and Rouquier can be realized by a perfect 𝐴-gate, see [42, Theorem 1.22]. 6.1. Brauer reciprocity. An important tool for relating decomposition maps and blocks is Brauer reciprocity which we prove in Theorem 6.2 below in our general setup (this was known to hold before only in special settings). Recall that the intertwining form for a finite-dimensional algebra 𝐵 over a field 𝐹 is the Z-linear pairing ⟨·, ·⟩𝐵 : K0 (𝐵) × G0 (𝐵) → Z uniquely defined by (52) ⟨[𝑃 ], [𝑉 ]⟩ := dim𝐹 Hom𝐵 (𝑃, 𝑉 ) for a finite-dimensional projective 𝐵-module 𝑃 and a finite-dimensional 𝐵-module 𝑉 , see [16, §2]. Here, K0 (𝐵) is the zeroth K-group of the category of finite-dimensional BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 23 projective 𝐵-modules. The intertwining form is always non-degenerate, see Lemma A.6. Due to the non-degeneracy of ⟨·, ·⟩𝐴𝐾 there is at most one adjoint 𝐾 ep,O 𝐴 : K0 (𝐴(p)) → K0 (𝐴 ) (53) 𝐾 of dp,O 𝐴 : G0 (𝐴 ) → G0 (𝐴(p)) with respect to ⟨·, ·⟩𝐴(p) , characterized by the relation (54) p,O ⟨ep,O 𝐴 ([𝑃 ]), [𝑉 ]⟩𝐴𝐾 = ⟨[𝑃 ], d𝐴 ([𝑉 ])⟩𝐴(p) . for all finitely generated 𝐴𝐾 -modules 𝑉 and all finitely generated projective 𝐴(p)modules 𝑃 , see Lemma A.6. Brauer reciprocity is about the existence of this adjoint. p,O Theorem 6.2. The (unique) adjoint e𝐴 of dp,O exists. Moreover, the diagram 𝐴 K0 (𝐴𝐾 ) (55) c𝐴𝐾 G0 (𝐴𝐾 ) ep,O 𝐴 dp,O 𝐴 K0 (𝐴(p)) c𝐴(p) G0 (𝐴(p)) commutes, where the horizontal morphisms are the canonical ones (Cartan maps) mapping a class [𝑃 ] of a projective module 𝑃 to its class [𝑃 ] in the Grothendieck group. If 𝑅 is normal, the morphism ep,O does not depend on the choice of O and 𝐴 we denote it by ep𝐴 . Proof. Since ⟨·, ·⟩𝐴𝐾 is non-degenerate by Lemma A.6, it follows that dp,O has 𝐴 at most one adjoint ep,O , characterized by equation (54), see [40, Satz 78.1]. By 𝐴 assumption there is a perfect 𝐴-gate O in p. Let m be the maximal ideal of O. Since 𝐴𝐾 splits by assumption, Corollary A.14 implies that 𝐴O is semiperfect. The morphism K0 (𝐴O ) → K0 (𝐴O (m)) induced by the quotient map 𝐴O  𝐴O (m) is thus an isomorphism by lifting of idempotents. Furthermore, by assumption the O morphism dp,m 𝐴 : G0 (𝐴(p)) → G0 (𝐴 (m)) is an isomorphism and then the proof of O Theorem 4.1 shows that the canonical morphism ep,m 𝐴 : K0 (𝐴(p)) → K0 (𝐴 (m)) is p,O also an isomorphism. We can thus define a morphism e𝐴 : K0 (𝐴(p)) → K0 (𝐴𝐾 ) as the following composition (56) K0 (𝐴(p)) ≃ K0 (𝐴O (m)) ≃ K0 (𝐴O ) K0 (𝐴𝐾 ) ep,O 𝐴 p,O We will now show that ep,O 𝐴 is indeed an adjoint of d𝐴 . The arguments in the proof of [11, p. 18.9] can, with some refinements, be transferred to our more general situation and this is what we will do. Let 𝑃 be a finitely generated projective 𝐴(p)-module and let 𝑉 be a finitely generated 𝐴𝐾 -module. Since K0 (𝐴O ) ≃ K0 (𝐴O (m)), there ex−1 ists a finitely generated projective 𝐴O -module 𝑃 such that (ep,m ([𝑃/m𝑃 ]) = [𝑃 ] 𝐴 ) p,O 𝐾 O and then we have e𝐴 ([𝑃 ]) = [𝑃 ]. Let 𝑉̃︀ be an 𝐴 -lattice in 𝑉 . Then by definition p,O p,m −1 ̃︀ of dp,O ([𝑉 (m)]). We denote by 𝐴 , see [42, Corollary 1.14], we have d𝐴 ([𝑉 ]) = (d𝐴 ) 𝑉 a representative of dp,O ([𝑉 ]). Since 𝑃 is a finitely generated projective 𝐴O -module, 𝐴 O 𝑛 we can write 𝑃 ⊕ 𝑄 = (𝐴 ) for some finitely generated projective 𝐴O -module 𝑄 and some 𝑛 ∈ N. Since Hom𝐴O is additive, we get Hom𝐴O (𝑃, 𝑉̃︀ ) ⊕ Hom𝐴O (𝑄, 𝑉̃︀ ) = Hom𝐴O (𝑃 ⊕ 𝑄, 𝑉̃︀ ) = Hom𝐴O ((𝐴O )𝑛 , 𝑉̃︀ ) = (Hom𝐴O (𝐴O , 𝑉̃︀ ))𝑛 ≃ 𝑉̃︀ 𝑛 . 24 ULRICH THIEL This shows that Hom𝐴O (𝑃, 𝑉̃︀ ) is a direct summand of 𝑉̃︀ 𝑛 and as 𝑉̃︀ 𝑛 is O-free, we conclude that Hom𝐴O (𝑃, 𝑉̃︀ ) is O-projective and thus even O-free since O is a discrete valuation ring. Since 𝑃 is a finitely generated projective 𝐴O -module, it follows from Lemma B.3 that there is a canonical 𝐾-vector space isomorphism 𝐾 ⊗O Hom𝐴O (𝑃, 𝑉̃︀ ) ≃ Hom𝐴𝐾 (𝑃 𝐾 , 𝑉 ) and a canonical k(m)-vector space isomorphism k(m) ⊗O Hom𝐴O (𝑃, 𝑉̃︀ ) ≃ Hom𝐴O (m) (𝑃/m𝑃, 𝑉̃︀ /m𝑉̃︀ ) . Combining all results and the fact that both ep,O and dp,O preserve dimensions by 𝐴 𝐴 construction, we can now conclude that ⟨ep,O ([𝑃 ]), [𝑉 ]⟩𝐴𝐾 = dim𝐾 Hom𝐴𝐾 (𝑃 𝐾 , 𝑉 ) = dimO Hom𝐴O (𝑃, 𝑉̃︀ ) 𝐴 = dimk(m) Hom𝐴O (m) (𝑃/m𝑃, 𝑉̃︀ /m𝑉̃︀ ) = dimk(p) Hom𝐴(p) (𝑃 , 𝑉 ) p,O = ⟨[𝑃 ], d𝐴 ([𝑉 ])⟩𝐴(p) . Proving the commutativity of diagram (55) amounts to proving that c𝐴(p) ([𝑃 ]) = ∘ c𝐴𝐾 ∘ ep,O 𝐴 ([𝑃 ]) for every finitely generated projective 𝐴(p)-module 𝑃 . To prove this, note that the diagram dp,O 𝐴 K0 (𝐴O (m)) c𝐴O (m) ep,m 𝐴 G0 (𝐴O (m)) dp,m 𝐴 K0 (𝐴(p)) c𝐴(p) G0 (𝐴(p)) commutes. As above we know that there exists a finitely generated projective 𝐴O −1 𝐾 module 𝑃 such that (ep,m ([𝑃/m𝑃 ]) = [𝑃 ] and ep,O 𝐴 ) 𝐴 ([𝑃 ]) = [𝑃 ]. Since 𝑃 is a O finitely generated projective 𝐴 -module and 𝐴 is a finite O-module, it follows that 𝑃 is also a finitely generated projective O-module. As O is a discrete valuation ring, we conclude that 𝑃 is actually O-free of finite rank. Hence, 𝑃 is an 𝐴O -lattice in 𝑃 𝐾 and therefore p,O p,O p,m −1 𝐾 dp,O ([𝑃/m𝑃 ]) 𝐴 ∘ c𝐴𝐾 ∘ e𝐴 ([𝑃 ]) = d𝐴 ([𝑃 ]) = (d𝐴 ) −1 ∘ c𝐴(m) ([𝑃/m𝑃 ]) = (dp,m 𝐴 ) −1 ([𝑃/m𝑃 ]) = c𝐴(p) ([𝑃 ]). = c𝐴(p) ∘ (ep,m 𝐴 ) If 𝑅 is normal, then the independence of ep,O from the choice of O follows from the 𝐴 p,O independence of d𝐴 from the choice of O and the fact that dp,O has at most one 𝐴 adjoint.  6.2. Preservation of simple modules vs. preservation of blocks. In [42] we studied the set {︁ }︁ (57) DecGen(𝐴) := p ∈ Spec(𝑅) | dp,O is trivial for any 𝐴-gate in p . 𝐴 where dp,O being trivial means that it induces a bijection between simple modules. 𝐴 We have proven in [42, Theorem 2.3] that DecGen(𝐴) is open if 𝑅 is noetherian and 𝐴 has split fibers. Brauer reciprocity implies that ep,O is trivial if and only if dp,O is 𝐴 𝐴 trivial, so we deduce that the locus of all p such that ep,O is trivial for any O is an 𝐴 open subset of Spec(𝑅). If p ∈ DecGen(𝐴), then the simple modules of 𝐴𝐾 and 𝐴(p) are “essentially the same”, in particular their dimensions are the same. This is why explicit knowledge BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 25 about DecGen(𝐴) is quite helpful to understand the representation theory of the fibers of 𝐴, see [42]. So far, we do not have an explicit description of DecGen(𝐴), however. Brauer reciprocity enables us to prove the following relation between decomposition maps and blocks. Theorem 6.3. We have an inclusion (58) DecGen(𝐴) ⊆ BlGen(𝐴) . Proof. Let p ∈ Spec(𝑅) be non-zero. By assumption there is a perfect 𝐴-gate O in p. If p ∈ DecGen(𝐴), then by definition dp,O is trivial, so the matrix Dp,O of this 𝐴 𝐴 morphism in bases given by isomorphism classes of simple modules of 𝐴𝐾 and 𝐴(p), respectively, is equal to the identity matrix when ordering the bases appropriately. It now follows from Brauer reciprocity, Theorem 6.2, that C𝐴(p) = C𝐴𝐾 in appropriate bases, where C𝐴(p) is the matrix of the Cartan map c𝐴(p) and C𝐴𝐾 is the matrix of the Cartan map c𝐴𝐾 . Due to the linkage relation explained in §2, the families of 𝐴𝐾 and of 𝐴(p) are determined by the respective Cartan matrices. Since C𝐴(p) = C𝐴𝐾 , it follows that #Bl(𝐴(p)) = #Bl(𝐴𝐾 ), so p ∈ BlGen(𝐴).  Remark 6.4. Suppose that 𝐴 has split fibers and that 𝑅 is noetherian. Then the fact that #Bl(𝐴(p)) = #Bl(𝑍(p)) by Theorem 5.8 together with the Lemma A.9 yields the following equivalence: (59) p ∈ BlGen(𝐴) ⇐⇒ dim𝐾 (𝑍 𝐾 + Rad(𝐴𝐾 )) = dimk(p) (𝑍(p) + Rad(𝐴(p))) . Let O be a perfect 𝐴-gate in p. This exists by Lemma 6.1(b). Suppose that p ∈ DecGen(𝐴). In [42, Theorem 2.2] we have proven that this implies that dim𝐾 Rad(𝐴𝐾 ) = dimk(p) Rad(𝐴(p)) . Let 𝑋 := 𝑍 + 𝐽, where 𝐽 := Rad(𝐴𝐾 ) ∩ 𝐴O . The arguments in [42] show that 𝑋 is an 𝐴O -lattice of 𝑍 𝐾 + Rad(𝐴𝐾 ) and that the reduction in the maximal ideal m of O is equal to 𝑍 O (m) + Rad(𝐴O (m)). We thus have dim𝐾 (𝑍 𝐾 + Rad(𝐴𝐾 )) = dimk(m) (𝑍 O (m) + Rad(𝐴O (m))). Since 𝐴(p) splits, the k(m)-dimension of 𝑍 O (m) + Rad(𝐴O (m)) is equal to the k(p)-dimension of 𝑍(p) + Rad(𝐴(p)). Hence, we have p ∈ BlGen(𝐴) by (59). This yields another proof of the inclusion DecGen(𝐴) ⊆ BlGen(𝐴) in case 𝐴 has split fibers. Example 6.5. The following example due to C. Bonnafé shows that in the generality of Theorem 6.3 we do not have equality in (58). Let 𝑅 be a discrete valuation ring with fraction field 𝐾 and uniformizer 𝜋, i.e., p := (𝜋) is the maximal ideal of 𝑅. Denote by 𝑘 := 𝑅/p the residue field in p. Let {︂(︂ )︂ }︂ 𝑎 𝑏 𝐴 := ∈ Mat2 (𝑅) | 𝑏, 𝑐 ∈ p . 𝑐 𝑑 This is an 𝑅-subalgebra of Mat2 (𝑅) and it is 𝑅-free with basis (60) 𝑒 := 𝐸11 , 𝑓 := 𝐸22 , 𝑥 := 𝜋𝐸12 , 𝑦 := 𝜋𝐸21 , where 𝐸𝑖𝑗 = (𝛿𝑖,𝑘 𝛿𝑗,𝑙 )𝑘𝑙 is the elementary matrix. Clearly, 𝐴𝐾 = Mat2 (𝐾), so the generic fiber of 𝐴 is split semisimple. In particular, 𝐴𝐾 has just one block, and this block contains just one simple module we denote by 𝑆. Now, consider the specialization 𝐴 := 𝐴(p) = 𝐴/p𝐴. We know from Corollary A.14 that the quotient map 𝐴  𝐴, 𝑎 ↦→ 𝑎, is block bijective, so we must have #Bl(𝐴(p)) ≤ Bl(𝐴𝐾 ) and therefore #Bl(𝐴(p)) = 1, so p ∈ BlGen(𝐴). Let 𝐽 be the 𝑘-subspace of 𝐴 generated by 𝑥 and 𝑦. This is in fact a two-sided ideal of 𝐴 since it is stable under multiplication by the generators (60). Moreover, we have 𝑥2 = 0 = 𝑦 2 , 26 ULRICH THIEL so 𝐽 is a nilpotent ideal of 𝐴. Hence, dim𝑘 Rad(𝐴) ≥ 2. The number of simple modules of 𝐴 is by [27, Theorem 7.17] equal to dim𝑘 𝐴/(Rad(𝐴) + [𝐴, 𝐴]), so # Irr 𝐴 ≤ 2 since dim𝑘 𝐴 = dim𝐾 𝐴𝐾 = 4. The two elements 𝑒 and 𝑓 are orthogonal idempotents and so the constituents of the two 𝐴-modules 𝐴𝑒 and 𝐴𝑓 are nonisomorphic. So, we have # Irr 𝐴 ≥ 2 and due to the aforementioned we conclude that # Irr 𝐴 = 2. Let 𝑆 1 and 𝑆 2 be these two simple modules. Since 𝑅 is a discrete valuation ring, reduction modulo p yields the well-defined decomposition map dp𝐴 : G0 (𝐴𝐾 ) → G0 (𝐴(p)), see [42, Corollary 1.14]. It is an elementary fact that the all simple 𝐴-modules must be constituents of dp𝐴 ([𝑆]) = [𝑆/p𝑆]. Since dim𝐾 𝑆 = 2, the only possibility is that dp𝐴 ([𝑆]) = [𝑆 1 ] + [𝑆 2 ] and dim𝑘 𝑆 𝑖 = 1. In particular, p∈ / DecGen(𝐴), so p ∈ BlGen(𝐴) ∖ DecGen(𝐴). Finally, we note that 𝐴 also splits since # Irr(𝐴) = 2 implies by the above formula that dim𝑘 Rad(𝐴) = 2 and we have ∑︀2 dim𝑘 𝐴 = dim𝑘 Rad(𝐴) + 𝑖=1 (dim𝑘 𝑆 𝑖 )2 , so 𝐴 is split by [27, Corollary 7.8]. Lemma 6.6. Assume that the 𝐴𝐾 -families are singletons, and that # Irr 𝐴(p) ≤ # Irr 𝐴𝐾 for all p ∈ Spec(𝑅). Then BlGen(𝐴) ∖ DecGen(𝐴) = {p ∈ Spec(𝑅) | Dp𝐴 is diagonal but not the identity } . Proof. Since the 𝐴𝐾 -families are singletons, we have #Irr(𝐴𝐾 ) = #Bl(𝐴𝐾 ). We clearly have # Irr 𝐴(p) ≥ #Bl(𝐴(p)) for all p ∈ Spec(𝑅). Assume that p ∈ BlGen(𝐴). Then we have # Irr 𝐴(p) ≥ #Irr(𝐴𝐾 ), so # Irr 𝐴(p)) = # Irr 𝐴𝐾 by our assumption. Hence, the decomposition matrix Dp𝐴 is quadratic. By Theorem 6.9 the p-families are equal to the Brauer p-families. Since p ∈ BlGen(𝐴) and the 𝐴𝐾 -families are singletons, it follows that Dp𝐴 is a diagonal matrix. The claim is now obvious.  Lemma 6.7. Let 𝑅 be a noetherian integral domain with fraction field 𝐾 and let 𝐴 be a cellular 𝑅-algebra of finite dimension such that 𝐴𝐾 is semisimple. Then DecGen(𝐴) = BlGen(𝐴). Proof. First of all, specializations of 𝐴 are again cellular by [20, p. 1.8]. Moreover, it follows from [20, Proposition 3.2] that 𝐴 has split fibers, so 𝐴 satisfies Lemma 6.1(b) and therefore our basic assumption in this paragraph. Let Λ be the poset of the cellular structure of 𝐴𝐾 . Since 𝐴𝐾 is semisimple, each cell module 𝑀𝜆 has simple head 𝑆𝜆 and # Irr 𝐴𝐾 = #Λ. Let p ∈ Spec(𝑅). The poset for the cellular structure of 𝐴(p) is again Λ. Denote by 𝑀𝜆p the corresponding cell modules of 𝐴(p). There is a subset Λ′ of Λ such that 𝑀𝜆p has simple head 𝑆𝜆p for all 𝜆 ∈ Λ′ and that these heads are precisely the simple 𝐴(p)-modules. In particular, we have # Irr 𝐴(p) ≤ # Irr 𝐴𝐾 . Now, assume that p ∈ BlGen(𝐴). By Lemma 6.6 we just need to show that the decomposition matrix Dp𝐴 , which is square by the proof of Lemma 6.6, cannot be a non-identity diagonal matrix. By [20, Proposition 3.6] we know that [𝑀𝜆 : 𝑆𝜆 ] = 1 and [𝑀𝜆p : 𝑆𝜆p ] = 1. By construction, it is clear that dp𝐴 ([𝑀𝜆 ]) = [𝑀𝜆p ]. Hence, if dp𝐴 ([𝑆𝜆 ]) = 𝑛𝜆 [𝑆𝜆p ], we have 𝑛𝜆 = [𝑀𝜆p : 𝑆𝜆p ] = 1. Hence, Dp𝐴 is the identity matrix, so p ∈ BlGen(𝐴).  6.3. The Brauer graph. Geck and Pfeiffer [15] have introduced the so-called Brauer p-graph of 𝐴 in our general context but assuming that 𝐴𝐾 is semisimple so that the 𝐴𝐾 -families are singletons. For general 𝐴 this definition seems not to be the correct one. We introduce the following generalization of this concept. Definition 6.8. Suppose that 𝑅 is normal so that we have unique decomposition maps. The Brauer p-graph of 𝐴 is the graph with vertices the simple 𝐴𝐾 -modules and an edge between 𝑆 and 𝑇 if and only if in the 𝐴𝐾 -family of 𝑆 there is some 𝑆 ′ and in the 𝐴𝐾 -family of 𝑇 there is some 𝑇 ′ such that dp𝐴 ([𝑆 ′ ]) and dp𝐴 ([𝑇 ′ ]) have a BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 27 common constituent. The connected components of this graph are called the Brauer p-families of 𝐴. If the 𝐴𝐾 -families are singletons, we have an edge between 𝑆 and 𝑇 if and only if dp𝐴 ([𝑆]) and dp𝐴 ([𝑇 ]) have a common constituent, so this indeed generalizes the Brauer p-graph from [15] for 𝐴𝐾 semisimple. Our final theorem shows that decomposition maps are compatible with p-families and 𝐴(p)-families, and relates the Brauer p-families to the p-families. Theorem 6.9. Assume that 𝑅 is normal. The following holds: (a) A finite-dimensional 𝐴𝐾 -module 𝑉 belongs to a p-block of 𝐴 if and only if dp𝐴 ([𝑉 ]) belongs to a block of 𝐴(p). (b) Two finite-dimensional 𝐴𝐾 -modules 𝑉 and 𝑊 lie in the same p-block if and only if dp𝐴 ([𝑉 ]) and dp𝐴 ([𝑊 ]) lie in the same block of 𝐴(p). (c) If ℱ ∈ Famp (𝐴) is a p-family, then dp𝐴 (ℱ) := {𝑇 | 𝑇 is a constituent of dp𝐴 ([𝑆]) for some 𝑆 ∈ ℱ} is a family of 𝐴(p), and all families of 𝐴(p) are obtained in this way. (d) The Brauer p-families are equal to the p-families. Proof. (a) By assumption there is a perfect 𝐴-gate O in p. Let m be the maximal ideal of O. We have the following commutative diagram of canonical morphisms which are all idempotent stable: 𝐴p 𝐴O 𝐴(p) 𝐴O (m) 𝐴𝐾 (61) Since 𝑅 is assumed to be normal, it follows from Proposition 4.2 that 𝐴p  𝐴(p) O is block bijective. By assumption the morphism dp,m 𝐴 : G0 (𝐴(p)) → G0 (𝐴 (m)) is an isomorphism and therefore 𝐴(p) ˓→ 𝐴O (m) is block bijective by Theorem 4.1. Furthermore, by assumption the generic fiber 𝐴𝐾 is split and therefore 𝐴O  𝐴O (m) is block bijective by Corollary A.14. Because of (5) it thus follows that 𝐴p ˓→ 𝐴O is block bijective. Now, let 𝑉 be a finite-dimensional 𝐴𝐾 -module and let 𝑉̃︀ be an 𝐴O -lattice of 𝑉 . Suppose that 𝑉 belongs to an 𝐴p -block of 𝐴𝐾 . Since 𝐴p ˓→ 𝐴O is block bijective, the 𝐴p -blocks of 𝐴𝐾 coincide with the 𝐴O -blocks of 𝐴𝐾 and therefore 𝑉 belongs to an 𝐴O -block of 𝐴𝐾 . Since 𝑉̃︀ is O-free, it follows from Lemma A.1 that 𝑉̃︀ belongs to a block of 𝐴O . Again by Lemma A.1 and the fact that 𝐴O  𝐴O (m) is block bijective, it follows that 𝑉̃︀ /m𝑉̃︀ belongs to a block of 𝐴O (m). Since 𝐴(p) ˓→ 𝐴O (m) is block bijective, Lemma A.1 shows that dp𝐴 ([𝑉 ]) belongs to a block of 𝐴(p). Conversely, suppose that dp𝐴 ([𝑉 ]) belongs to a block of 𝐴(p). Then 𝑉̃︀ /m𝑉̃︀ belongs to a block of 𝐴O (m) and therefore 𝑉̃︀ belongs to a block of 𝐴O by Lemma A.1. But then 𝑉 belongs to an 𝐴O -block of 𝐴𝐾 and thus to an 𝐴p -block of 𝐴𝐾 by Lemma A.1. (b) This follows now from part (a). (c) Fix a p-family ℱ of 𝐴𝐾 . If 𝑆 ∈ ℱ, then dp𝐴 ([𝑆]) belongs to an 𝐴(p)-block by (a) and therefore all constituents of dp𝐴 ([𝑆]) belong to a fixed family ℱ 𝑆 . If 𝑆 ′ ∈ ℱ is another simple module, then by (b) the constituents of dp𝐴 ([𝑆 ′ ]) also lie in ℱ 𝑆 . Hence, dp𝐴 (ℱ) is contained in a fixed 𝐴(p)-family ℱ. Let 𝑇 ∈ ℱ be arbitrary. Due 28 ULRICH THIEL to the properties of decomposition maps there is some 𝑆 ∈ Irr 𝐴𝐾 such that 𝑇 is a constituent of dp𝐴 ([𝑆]). Since 𝑇 and dp𝐴 ([𝑆]) lie in the same 𝐴(p)-block by (a) and (b), we must have 𝑆 ∈ ℱ by (b). Hence, ℱ = dp𝐴 (ℱ) is an 𝐴(p)-family. Since every simple 𝐴(p)-module is a constituent of dp𝐴 ([𝑆]) for some simple 𝐴𝐾 -module 𝑆, it is clear that any 𝐴(p)-family is of the form dp𝐴 (ℱ) for a p-family ℱ. (d) Let 𝑆 and 𝑇 be simple 𝐴𝐾 -modules contained in the same Brauer p-family, i.e., in the 𝐴𝐾 -family of 𝑆 there is some 𝑆 ′ and in the 𝐴𝐾 -family of 𝑇 there is some 𝑇 ′ such that dp𝐴 ([𝑆 ′ ]) and dp𝐴 ([𝑇 ′ ]) have a common constituent. It follows from part (b) that 𝑆 ′ and 𝑇 ′ lie in the same p-family of 𝐴𝐾 . Since 𝑆 ′ is in the same 𝐴𝐾 -family as 𝑆, it is also in the same p-family as 𝑆 because the p-families are unions of 𝐴𝐾 -families. Similarly, 𝑇 ′ is in the same p-family as 𝑇 . Hence, 𝑆 and 𝑇 lie in the same p-family. Conversely, suppose that 𝑆 and 𝑇 lie in the same p-family. We have to show that they lie in the same Brauer p-family. Let (𝑆𝑖 )𝑛𝑖=1 be a system of representatives of the isomorphism classes of simple 𝐴𝐾 -modules and let (𝑈𝑗 )𝑚 𝑗=1 be a system of representatives of the isomorphism classes of simple 𝐴(p)-modules. Let Q := (𝑄𝑖 )𝑛𝑖=1 with 𝑄𝑖 being the projective cover of 𝑆𝑖 , and let P := (𝑃𝑗 )𝑚 𝑗=1 with 𝑃𝑗 being the projective cover of 𝑈𝑗 . Let C𝐴(p) be the matrix of the Cartan map c𝐴(p) with respect to the chosen bases, and similarly let C𝐴𝐾 be the matrix of c𝐴𝐾 . Furthermore, let Dp𝐴 be the matrix of dp𝐴 with respect to the chosen bases. Since C𝐴(p) = Dp𝐴 C𝐴𝐾 (Dp𝐴 )T by Brauer reciprocity, Theorem 6.2, we have 𝑛 ∑︁ (62) (C𝐴(p) )𝑝,𝑞 = (Dp𝐴 C𝐴𝐾 (Dp𝐴 )T )𝑝,𝑞 = (Dp𝐴 )𝑝,𝑘 (C𝐴𝐾 )𝑘,𝑙 (Dp𝐴 )𝑞,𝑙 𝑘,𝑙=1 dp𝐴 ([𝑆]) for all 𝑝, 𝑞. Let 𝑈 be a constituent of and let 𝑉 be a constituent of dp𝐴 ([𝑇 ]). Since 𝑆 and 𝑇 lie in the same p-family of 𝐴𝐾 , both dp𝐴 ([𝑆]) and dp𝐴 ([𝑇 ]) lie in the same block of 𝐴(p) by (b), and therefore 𝑈 and 𝑉 lie in the same family of 𝐴(p). As the families of 𝐴(p) are equal to the P-families of 𝐴(p) by §2, there exist functions 𝑓 : [1, 𝑟] → [1, 𝑚], 𝑔 : [1, 𝑟 − 1] → [1, 𝑚] with the following properties: 𝑈𝑓 (1) = 𝑈 , 𝑈𝑓 (𝑟) = 𝑉 , and for any 𝑗 ∈ [1, 𝑟 − 1] both 𝑃𝑓 (𝑗) and 𝑃𝑓 (𝑗+1) have 𝑈𝑔(𝑗) as a constituent. We can visualize the situation as follows: 𝑃𝑓 (𝑗) 𝑈𝑓 (𝑗) 𝑃𝑓 (𝑗+1) 𝑈𝑔(𝑗) 𝑈𝑓 (𝑗+1) where an arrow 𝑈 → 𝑃 signifies that 𝑈 is a constituent of 𝑃 . For any 𝑗 ∈ [1, 𝑟 − 1] we have (C𝐴(p) )𝑔(𝑗),𝑓 (𝑗) ̸= 0 and so it follows from (62) that there are indices 𝑘(𝑗) and 𝑙(𝑗) such that (Dp𝐴 )𝑔(𝑗),𝑘(𝑗) ̸= 0 , (C𝐴𝐾 )𝑘(𝑗),𝑙(𝑗) ̸= 0 , (Dp𝐴 )𝑓 (𝑗),𝑙(𝑗) ̸= 0 . Similarly, since (C𝐴(p) )𝑔(𝑗),𝑓 (𝑗+1) ̸= 0, there exist indices 𝑘 ′ (𝑗) and 𝑙′ (𝑗) such that (Dp𝐴 )𝑔(𝑗),𝑘′ (𝑗) ̸= 0 , (C𝐴𝐾 )𝑘′ (𝑗),𝑙′ (𝑗) ̸= 0 , (Dp𝐴 )𝑓 (𝑗+1),𝑙′ (𝑗) ̸= 0 . This can be visualized as follows: dp𝐴 ([𝑆𝑙(𝑗) ]) 𝑈𝑓 (𝑗) dp𝐴 ([𝑆𝑘(𝑗) ]) dp𝐴 ([𝑆𝑘′ (𝑗) ]) 𝑈𝑔(𝑗) dp𝐴 ([𝑆𝑙′ (𝑗) ]) 𝑈𝑓 (𝑗+1) BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 29 Here, the dashed edges in the upper row signify that the respective simple 𝐴𝐾 modules lie in the same 𝐴𝐾 -family. Since 𝑈𝑓 (1) = 𝑈 and 𝑈𝑓 (𝑟) = 𝑉 , this shows that 𝑆 and 𝑇 lie in the same Brauer p-family of 𝐴𝐾 .  7. Semicontinuity of blocks in case of a non-split generic fiber Let 𝐴 be a finite flat algebra over an integral domain 𝑅 with fraction field 𝐾. We have a map # Bl′𝐴 : Spec(𝑅) → N , (63) p ↦→ # Bl(𝐴(p)) , # Bl′𝐴 (p) i.e., is the number of blocks of the specialization 𝐴(p). Recall that in (21) we considered the map # Bl𝐴 with # Bl𝐴 (p) = # Bl(𝐴p ) being the number of blocks of the localization 𝐴p . In case 𝑅 is normal and 𝐴𝐾 splits, we know from Proposition 4.2 that # Bl′𝐴 = # Bl𝐴 . In particular, the map # Bl′𝐴 is lower semicontinuous and thus defines a stratification of Spec(𝑅), the block number stratification, see §3.2. In case 𝐴𝐾 does not split, it still makes perfect sense to consider the map (63) and ask if it is lower semicontinuous so that we have a stratification of Spec(𝑅) by the number of blocks of specializations. But since we do not have the connection from Proposition 4.2 between blocks of localizations of and blocks of specializations any more, we cannot directly apply the results from §3. In this section, we will establish a setting where the map # Bl′𝐴 is still lower semicontinuous without assuming that the generic fiber 𝐴𝐾 splits, the main result being Corollary 7.3. To achieve this, however, we have to restrict this map to a subset of Spec(𝑅). As we will see, in general it is not possible to have lower semicontinuity on all of Spec(𝑅). First of all, because of the difference between blocks of localizations and blocks of specializations, we introduce the following sets: (64) 𝛽(𝐴) := max{#Bl(𝐴(p)) | p ∈ Spec(𝑅)} , (65) BlEx′ (𝐴) := #Bl′−1 𝐴 (≤ 𝛽(𝐴) − 1) , (66) BlGen′ (𝐴) := Spec(𝑅) ∖ BlEx′ (𝐴) . Note that if 𝑅 is normal and 𝐴𝐾 splits, then 𝛽(𝐴) = # Bl(𝐴𝐾 ), so BlEx′ (𝐴) = BlEx(𝐴) and BlGen′ (𝐴) = BlGen(𝐴) as defined in (19) and (20). Now, assume that 𝑅′ is an integral extension of 𝑅 which is also an integral domain. Let 𝐾 ′ be the fraction field of 𝑅′ and let 𝜓 : Spec(𝑅′ )  Spec(𝑅) be the morphism induced by 𝑅 ⊆ 𝑅′ . The scalar extension 𝐴′ := 𝑅′ ⊗𝑅 𝐴 is again a finitely presented flat 𝑅′ -algebra (using Remark 3.2). For any p ∈ Spec(𝑅) and any p′ ∈ Spec(𝑅′ ) lying over p we have a diagram 𝐴′p′ (67) 𝐴(p) = 𝐴p /pp 𝐴p 𝐴′ (p′ ) = 𝐴′p′ /p′ p′ 𝐴′p′ and it then follows from (5) that (68) #Bl(𝐴(p)) ≤ #Bl(𝐴′ (p′ )) ≥ #Bl(𝐴′p′ ) . 30 ULRICH THIEL Let 𝑋 be a set contained in (69) 𝑋𝑅′ (𝐴) := {p ∈ Spec(𝑅) | #Bl(𝐴(p)) = #Bl(𝐴′ (p′ )) = #Bl(𝐴′p′ ) for all p′ ∈ 𝜓 −1 (p)}. We have seen in Corollary 4.3 that in case 𝑅 is normal and 𝐴𝐾 splits we can choose 𝑅 = 𝑅′ and have 𝑋 = Spec(𝑅). In general 𝑋 will be a proper subset of Spec(𝑅) and we have to choose 𝑅′ appropriately to enlarge it a bit more. Let us first concentrate on what we can say when restricting to 𝑋. We introduce the following restricted versions of our invariants: (70) # Bl′𝐴,𝑋 := # Bl′𝐴 |𝑋 : 𝑋 → N , (71) ′−1 −1 # Bl′−1 𝐴,𝑋 (≤ 𝑛) := # Bl𝐴 (≤ 𝑛) ∩ 𝑋 = 𝜓(# Bl𝐴′ (≤ 𝑛)) ∩ 𝑋 , (72) ′−1 −1 # Bl′−1 𝐴,𝑋 (𝑛) := # Bl𝐴 (𝑛) ∩ 𝑋 = 𝜓(# Bl𝐴′ (𝑛)) ∩ 𝑋 , (73) 𝛽𝑋 (𝐴) := max{# Bl(𝐴(p)) | p ∈ 𝑋} , (74) BlEx′𝑋 (𝐴) := Bl′−1 𝐴,𝑋 (≤ 𝛽𝑋 (𝐴) − 1) , (75) BlGen′𝑋 (𝐴) := 𝑋 ∖ BlEx′𝑋 (𝐴) . Corollary ∐︀ 7.1. The map 𝑋 → N, p ↦→ #Bl(𝐴(p)), is lower semicontinuous on 𝑋, so 𝑋 = 𝑛∈N Bl′−1 𝐴,𝑋 (𝑛) is a stratification of 𝑋 into locally closed subsets. Moreover, (76) ′ 𝛽𝑋 (𝐴) ≤ # Bl(𝐴𝐾 ) . ′ Proof. Since 𝜓 is a closed morphism and # Bl−1 𝐴′ (≤ 𝑛) is closed in Spec(𝑅 ) by (26), −1 ′−1 it follows that 𝜓(# Bl𝐴′ (≤ 𝑛))) is closed in Spec(𝑅), hence # Bl𝐴,𝑋 (≤ 𝑛) is closed ′−1 ′−1 in 𝑋 by (71). Since # Bl′−1 𝐴,𝑋 (𝑛) = # Bl𝐴,𝑋 (≤ 𝑛) ∖ # Bl𝐴,𝑋 (≤ 𝑛 − 1), it is clear −1 that # Bl′−1 𝐴,𝑋 (𝑛) is locally closed in 𝑋. We have seen in (27) that # Bl𝐴′ (𝑛) ⊆ ⋃︀ −1 𝑚≤𝑛 Bl𝐴′ (𝑚). Hence, since 𝜓 is closed, we obtain ⋃︁ ⋃︁ −1 # Bl′−1 𝜓(# Bl−1 # Bl′−1 𝐴,𝑋 (𝑚) . 𝐴,𝑋 (𝑛) = 𝜓(# Bl𝐴′ (𝑛)) ∩ 𝑋 ⊆ 𝐴′ (𝑚)) ∩ 𝑋 = 𝑚≤𝑛 𝑚≤𝑛  ′ Note that in (76) we could only bound 𝛽𝑋 (𝐴) above by # Bl(𝐴𝐾 ), and not by # Bl(𝐴𝐾 ). In fact, we will see in Example 7.4 that we may indeed have 𝛽𝑋 (𝐴) > # Bl(𝐴𝐾 ) in general. This is an important difference to blocks of localizations where we always have the maximal number of blocks in the generic point. ′ In the following lemma we describe a situation where we have 𝛽𝑋 (𝐴) = # Bl(𝐴𝐾 ). We recall that 𝑋 is called very dense if the embedding 𝑋 ˓→ Spec(𝑅) is a quasihomeomorphism, i.e., the map 𝑍 ↦→ 𝑍 ∩ 𝑋 is a bijection between the closed (equivalently, open) subsets of the two spaces. This notion was introduced by Grothendieck [22, §10]. Lemma 7.2. Suppose that 𝑋 is very dense in Spec(𝑅), that 𝑅 is noetherian, and ′ that 𝜓 is finite. Then 𝛽𝑋 (𝐴) = # Bl(𝐴𝐾 ), thus BlEx′𝑋 (𝐴) = 𝜓(BlEx(𝐴′ )) ∩ 𝑋. If ′ moreover 𝑅 is normal and 𝑅 is universally catenary, then BlEx′𝑋 (𝐴) is a reduced Weil divisor in 𝑋. BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 31 Proof. The assumptions imply that 𝑅′ is noetherian, too. We know from Theorem 3.3 that BlGen(𝐴′ ) is a non-empty open subset of Spec(𝑅′ ). In particular, it is constructible. Since Spec(𝑅) is quasi-compact, the morphism 𝜓 is quasi-compact by [19, Remark 10.2.(1)]. It thus follows from Chevalley’s constructibility theorem, see [19, Corollary 10.71], that 𝜓(BlGen(𝐴′ )) is constructible in Spec(𝑅). Since 𝑋 is very dense in Spec(𝑅), we conclude that 𝜓(BlGen(𝐴′ )) ∩ 𝑋 ̸= ∅ by [22, Proposition 10.1.2]. Hence, there is p ∈ 𝑋 and p′ ∈ BlGen(𝐴′ ) with 𝜓(p′ ) = p. But then we have ′ ′ # Bl(𝐴(p)) = # Bl(𝐴′ (p′ )) = # Bl(𝐴𝐾 ), so 𝛽𝑋 (𝐴) = # Bl(𝐴𝐾 ). Now, assume that 𝑅′ is normal and 𝑅 is universally catenary. We know that BlEx(𝐴′ ) is either empty or pure of codimension one in Spec(𝑅′ ) by Corollary 3.5. In [24, Theorem B.5.1] it is shown that the extension 𝑅 ⊆ 𝑅′ satisfies the dimension formula, hence 𝜓(BlEx(𝐴′ )) is either empty or pure of codimension one. Since 𝑋 is very dense in Spec(𝑅), the same is also true for 𝑋 ∩ 𝜓(BlEx(𝐴′ )) = BlEx′𝑋 (𝐴).  Corollary 7.3. Suppose that 𝑅 is a finite type algebra over an algebraically closed field. Let 𝑋 be the set of closed points of Spec(𝑅). ∐︀ Then the map 𝑋 → N, m ↦→ #Bl(𝐴(m)), is lower semicontinuous and so 𝑋 = 𝑛∈N # Bl′−1 𝐴,𝑋 (𝑛) is a stratification of 𝑋. Moreover, 𝛽𝑋 (𝐴) = # Bl(𝐴𝐾 ), where 𝐾 is an algebraic closure of 𝐾. If 𝑅 is also universally catenary, then BlEx′𝑋 (𝐴) is a reduced Weil divisor in 𝑋. ′ Proof. Let 𝐾 ′ be a finite extension of 𝐾 such that 𝐴𝐾 splits (this is always possible, see [11, Proposition 7.13]) and let 𝑅′ be the integral closure of 𝑅 in 𝐾 ′ . Now, # Bl(𝐴′ (p′ )) = # Bl(𝐴′p′ ) for all p′ ∈ Spec(𝑅) by Proposition 4.2. Since 𝑅 is a finite type algebra over an algebraically closed field 𝑘, the residue field in a closed point m of Spec(𝑅) is just 𝑘. Hence, the specialization 𝐴(m) is a finitedimensional algebra over an algebraically closed field, thus splits and we therefore have #Bl(𝐴(m)) = #Bl(𝐴′ (m′ )) for any m′ ∈ 𝜓 −1 (m) by Lemma A.3. Hence, 𝑋 ⊆ 𝑋𝑅′ (𝐴). The claim about semicontinuity and the stratification thus follows from Corollary 7.1. It is shown in [19, Proposition 3.35] that 𝑋 is very dense in Spec(𝑅). Since 𝑅 is a finite type algebra over a field, it is japanese, so 𝜓 is a finite ′ morphism. Hence, 𝛽𝑋 (𝐴) = #Bl(𝐴𝐾 ) = #Bl(𝐴𝐾 ) by Lemma 7.2. The claim that ′ BlEx𝑋 (𝐴) is a reduced Weil divisor if 𝑅 is universally catenary also follows from Lemma 7.2.  Example 7.4. The following example due to K. Brown shows that in the setting of Lemma 7.3 we may indeed have 𝛽𝑋 (𝐴) > #Bl(𝐴𝐾 ) so that the map p ↦→ #Bl(𝐴(p)) will not be lower semicontinuous on the whole of Spec(𝑅). Let 𝑘 be an algebraically closed field of characteristic zero, let 𝑋 be an indeterminate over 𝑘, let 𝑅 := 𝑘[𝑋 𝑛 ] for some 𝑛 > 1, and let 𝐴 := 𝑘[𝑋]. Let 𝐶𝑛 be the cyclic group of order 𝑛. We fix a generator of 𝐶𝑛 and let it act on 𝑋 by multiplication with a primitive 𝑛-th root of unity. Then 𝑅 = 𝑘[𝑋]𝐶𝑛 , so 𝐴 is free of rank 𝑛 over 𝑅. Moreover, Frac(𝐴) = 𝑘(𝑋) is a Galois extension of degree 𝑛 of 𝐾 := Frac(𝑅) by [1, Proposition 1.1.1], so in particular 𝐾 ̸= 𝑘(𝑋) since 𝑛 > 1. By [17, Ex. 6R] we have 𝐴𝐾 = 𝐴 ⊗𝑅 𝐾 = 𝐴[(𝑅 ∖ {0})−1 ] = Frac(𝐴) = 𝑘(𝑋) , so the 𝐾-algebra 𝐴𝐾 = Z(𝐴𝐾 ) is not split (and thus also not block-split by Lemma A.3). It is clear that (77) #Bl(𝐴𝐾 ) = 1 . 32 ULRICH THIEL Now, let m := (𝑋 𝑛 − 1) ∈ Max(𝑅). Then k(p) = 𝑘 and since 𝑘 is algebraically closed, we have 𝐴(m) = 𝐴/m𝐴 ≃ 𝑘 𝑛 as 𝑘-algebras. In particular, (78) #Bl(𝐴(m)) = 𝑛 > 1 = #Bl(𝐴𝐾 ) . We close with a setting where our base ring is not necessarily normal but we still get a global result on Spec(𝑅). Lemma 7.5. Suppose that 𝐴 has split fibers, i.e., 𝐴(p) splits for all p ∈ Spec(𝑅). Then the map ∐︀ Spec(𝑅) → N, p ↦→ #Bl(𝐴(p)), is lower semicontinuous and so Spec(𝑅) = 𝑛∈N Bl′−1 𝐴 (𝑛) is a partition into locally closed subsets. Moreover, 𝛽(𝐴) = #Bl(𝐴𝐾 ). If 𝑅 is also universally catenary, japanese, and noetherian, then BlEx′ (𝐴) is a reduced Weil divisor in Spec(𝑅). Proof. Let 𝑅′ be the integral closure of 𝑅 in 𝐾. Then #Bl(𝐴′ (p′ )) = #Bl(𝐴′p′ ) for all p′ ∈ Spec(𝑅′ ) by Proposition 4.2. Since 𝐴(p) splits, we moreover have #Bl(𝐴(p)) = #Bl(𝐴′ (p′ )) for all p ∈ Spec(𝑅) p′ ∈ 𝜓 −1 (p) by Lemma A.3. Hence, 𝑋𝑅′ (𝐴) = Spec(𝑅). The claim about semicontinuity and the partition follows from Corollary 7.1. Now, assume that 𝑅 is universally catenary, japanese, and noetherian. Since 𝑅 is japanese, it follows by definition that 𝜓 is finite. The claim about BlEx′ (𝐴) being a reduced Weil divisor now follows from 7.2.  Appendix A. More on base change of blocks In this appendix we collect several facts about base change of blocks. Some results here should also be of independent interest. A.1. Block compatibility of scalar extension of modules. Recall the decomposition of the module category of a ring 𝐴 relative to a decomposition in of 1 ∈ 𝐴 into pairwise orthogonal central idempotents described in §2. We have the following compatibility. Lemma A.1. Let 𝜑 : 𝑅 → 𝑆 be a morphism of commutative rings and let 𝐴 be an 𝑅-algebra. Suppose that 𝜑𝐴 is central idempotent stable and let 𝑉 be a non-zero 𝐴-module. In any of the following cases the 𝐴-module 𝑉 belongs to the block 𝑐𝑖 if and only if the 𝐴𝑆 -module 𝑉 𝑆 belongs to the 𝜑-block 𝜑𝐴 (𝑐𝑖 ): (a) 𝜑 is injective and 𝑉 is 𝑅-projective. (b) 𝜑 is faithfully flat. (c) 𝑅 is local or a principal ideal domain and 𝑉 is 𝑅-free. Proof. As 𝑐𝑗 𝑉 is a direct summand of 𝑉 , it follows that we have a canonical isomorphism between isomorphism 𝜑*𝐴 (𝑐𝑗 𝑉 ) ≃ 𝜑𝐴 (𝑐𝑗 )𝜑*𝐴 𝑉 of 𝐴𝑆 -modules for all 𝑗. The claim thus holds if we can show that no non-zero direct summand 𝑉 ′ of 𝑉 is killed by 𝜑*𝐴 , i.e., 𝜑*𝐴 𝑉 ′ ̸= 0. But this is implied by the assumptions in each case. Namely, in the first two cases it follows from Lemma 2.1 that 𝜑𝑉 is injective, which implies that 𝜑𝑉 ′ is also injective, so 𝜑*𝐴 𝑉 ′ cannot be zero for non-zero 𝑉 ′ . In the third case neither 𝜑 nor 𝜑𝑉 need to be injective, so this needs extra care. First of all, since 𝑉 is assumed to be 𝑅-free, the assumptions on 𝑅 imply that a direct summand 𝑉 ′ of 𝑉 , which a priori is only 𝑅-projective, is already 𝑅-free, too. In case 𝑅 is local, this follows from Kaplansky’s theorem [26] and in case 𝑅 is a principal ideal domain, this is a standard fact. Now, if 𝑉 is 𝑅-free with basis (𝑣𝜆 )𝜆∈Λ , then it is a standard fact (see [4, II, §5.1, Proposition 4]) that 𝜑*𝐴 𝑉 is 𝑆-free with basis (𝜑𝑉 (𝑣𝜆 ))𝜆∈Λ . This shows that 𝜑*𝐴 𝑉 ̸= 0 for any non-zero 𝑅-free 𝐴-module 𝑉 . This applied to direct summands of 𝑉 , which are 𝑅-free as shown, proves the claim.  BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 33 A.2. Field extensions. Throughout this paragraph let 𝐴 be a finite-dimensional algebra over a field 𝐾. From (5) we know that #Bl(𝐴) ≤ #Bl(𝐴𝐿 ) for any extension field 𝐿 of 𝐾. Definition A.2. We say that 𝐴 is block-split if #Bl(𝐴) = #Bl(𝐴𝐿 ) for any extension field 𝐿 of 𝐾. Our aim is to show the following lemma. Lemma A.3. If Z(𝐴) is a split 𝐾-algebra (e.g., if 𝐴 itself splits), then 𝐴 is blocksplit. The converse holds if 𝐾 is perfect. The first assertion of the lemma is essentially obvious since Z(𝐴) is semiperfect and therefore (79) #Bl(𝐴) = #Bl(Z(𝐴)) = rkZ K0 (Z(𝐴)) = #rkZ G0 (Z(𝐴)) = # Irr Z(𝐴) , where the second equality follows from the fact that idempotents in a commutative ring are isomorphic if and only if they are equal, see [27, Ex. 22.2]. The same equalities of course also hold for Z(𝐴)𝐿 = Z(𝐴𝐿 ), where 𝐿 is an extension field of 𝐾. Hence, if Z(𝐴) is split, then 𝐴 is block-split. If 𝐴 itself is split, it is a standard fact that its center splits, so 𝐴 is block-split. We will prove the converse (assuming that 𝐾 is perfect) from a more general point of view as the results might be of independent interest and we re-use some of them in the last section. First of all, the field extension 𝐾 ⊆ 𝐿 induces natural group morphisms (80) 𝐿 𝐿 𝐿 d𝐿 𝐴 : G0 (𝐴) → G0 (𝐴 ) and e𝐴 : K0 (𝐴) → K0 (𝐴 ) . Without any assumptions on the field 𝐾 we have the following property. 𝐿 Lemma A.4. The morphisms d𝐿 𝐴 and e𝐴 are injective. Proof. Let (𝑆𝑖 )𝑖∈𝐼 be a system of representatives of the isomorphism classes of simple 𝐴-modules. For each 𝑖 let (𝑇𝑖𝑗 )𝑗∈𝐽𝑖 be a system of representatives of the isomorphism classes of simple 𝐴𝐿 -modules which occur as constituents of 𝑆𝑖𝐿 . Then by [27, Proposition 7.13] the set (𝑇𝑖𝑗 )𝑖∈𝐼,𝑗∈𝐽𝑖 is a system of representatives of the 𝐿 isomorphism classes of simple 𝐴𝐿 -modules. Hence, the matrix D𝐿 𝐴 of d𝐴 in bases given by the isomorphism classes of simple modules is in column-echelon form, has no zero columns, and no zero rows. In particular, d𝐿 𝐴 is injective. For each 𝑖 ∈ 𝐼 let 𝑃𝑖 be the projective cover of 𝑆𝑖 and for each 𝑗 ∈ 𝐽𝑖 let 𝑄𝑖𝑗 be the projective cover of 𝑇𝑖𝑗 . By the above, (𝑄𝑖𝑗 )𝑖∈𝐼,𝑗∈𝐽𝑖 is a system of representatives of the isomorphism classes of projective indecomposable 𝐴𝐿 -modules. We claim that in the direct sum decomposition of the finitely generated projective 𝐴𝐿 -module 𝑃𝑖𝐿 into projective indecomposable 𝐴𝐿 -modules only the 𝑄𝑖𝑗 with 𝑗 ∈ 𝐽𝑖 occur. 𝐿 With the ⨁︀ same argument as above, this implies that e𝐴 is injective. So, let us write 𝐿 𝑃𝑖 = 𝜆∈Λ 𝑈𝜆 for (not necessarily non-isomorphic) projective indecomposable 𝐴𝐿 modules 𝑈𝜆 . The 𝑈𝜆 are the up to isomorphism unique projective indecomposable of 𝑃𝑖𝐿 . As the radical is additive by [27, 𝐴𝐿 -modules occurring as direct summands⨁︀ 𝐿 Proposition 24.6(ii)], we have Rad(𝑃𝑖 ) = 𝜆∈Λ Rad(𝑈𝜆 ), so ⨁︁ (81) 𝑆𝑖𝐿 = (𝑃𝑖 / Rad(𝑃𝑖 ))𝐿 = 𝑃𝑖𝐿 / Rad(𝑃𝑖 )𝐿 = 𝑈𝜆 /(Rad(𝑃𝑖 )𝐿 ∩ 𝑈𝜆 ) . 𝜆∈Λ 𝐿 Rad(𝑃𝑖𝐿 ). Moreover, we have Rad(𝑃𝑖 ) ⊆ This follows from the fact that Rad(𝐴)𝐿 ⊆ 𝐿 Rad(𝐴 ) by [27, Theorem 5.14] and the fact that Rad(𝑃𝑖 ) = Rad(𝐴)𝑃𝑖 and 34 ULRICH THIEL Rad(𝑃𝑖𝐿 ) = Rad(𝐴𝐿 )𝑃𝑖𝐿 by [27, Theorem 24.7] since 𝑃𝑖 and 𝑃𝑖𝐿 are projective. For each 𝜆 ∈ Λ the radical of 𝑈𝜆 is a proper submodule of 𝑈𝜆 and therefore Rad(𝑃𝑖 )𝐿 ∩ 𝑈𝜆 ⊆ Rad(𝑃𝑖𝐿 ) ∩ 𝑈𝜆 = Rad(𝑈𝜆 ) ( 𝑈𝜆 . Hence, the head of 𝑈𝜆 is a constituent of 𝑈𝜆 /(Rad(𝑃𝑖𝐿 ) ∩ 𝑈𝜆 ), and since all constituents of the latter are constituents of 𝑆𝑖𝐿 , we must have Hd(𝑈𝜆 ) ≃ 𝑆𝑖𝑗𝜆 for some 𝑗𝜆 ∈ 𝐽𝑖 by the above. This implies that 𝑈𝜆 = 𝑄𝑖𝑗𝜆 , thus proving the claim.  Lemma A.5. The following holds: (a) The morphism d𝐿 𝐴 is an isomorphism if and only if it induces a bijection between isomorphism classes of simple modules. Similarly, the morphism e𝐿 𝐴 is an isomorphism if and only if it induces a bijection between isomorphism classes of projective indecomposable modules. 𝐿 (b) If d𝐿 𝐴 is an isomorphism, so is e𝐴 . The converse holds if 𝐾 is perfect. For the proof of Lemma A.5 we will need the following well-known elementary lemma that is also used in the last section. Recall from (52) the intertwining form ⟨·, ·⟩𝐴 of 𝐴. Lemma A.6. Let 𝑃 be a projective indecomposable 𝐴-module and let 𝑉 be a finitely generated 𝐴-module. Then (82) ⟨[𝑃 ], [𝑉 ]⟩𝐴 = [𝑉 : Hd(𝑃 )] · dim𝐾 End𝐴 (Hd(𝑃 )) , where Hd(𝑃 ) = 𝑃/ Rad(𝑃 ) is the head of 𝑃 . In particular, ⟨·, ·⟩𝐴 is non-degenerate. Proof. We first consider the case 𝑉 = Hd(𝑃 ). Let 𝑓 ∈ Hom𝐴 (𝑃, Hd(𝑃 )) be non-zero. Since Hd(𝑃 ) is simple, this morphism is already surjective and thus induces an isomorphism 𝑃/ Ker(𝑓 ) ∼ = Hd(𝑃 ). But as Rad(𝑃 ) is the unique maximal submodule of 𝑃 , we must have Ker(𝑓 ) = Rad(𝑃 ) and thus get an induced morphism Hd(𝑃 ) → Hd(𝑃 ). This yields a 𝐾-linear morphism Φ : Hom𝐴 (𝑃, Hd(𝑃 )) → End𝐴 (Hd(𝑃 )). On the other hand, if 𝑓 ∈ End𝐴 (Hd(𝑃 )), then composing it with the quotient morphism 𝑃 → 𝑃/ Rad(𝑃 ) = Hd(𝑃 ) yields a morphism 𝑃 → Hd(𝑃 ). In this way we also get a 𝐾-linear morphism Ψ : End𝐴 (Hd(𝑃 )) → Hom𝐴 (𝑃, Hd(𝑃 )). By construction, Φ and Ψ are pairwise inverse, hence ⟨[𝑃 ], [Hd(𝑃 )]⟩𝐴 = dim𝐾 Hom𝐴 (𝑃, Hd(𝑃 )) = dim𝐾 End𝐴 (Hd(𝑃 )) as claimed. Now, suppose that 𝑉 is a simple 𝐴-module not isomorphic to Hd(𝑃 ). We can write 𝑃 = 𝐴𝑒 for some primitive idempotent 𝑒 ∈ 𝐴. Since 𝐴 is artinian, 𝑒 is already local and now it follows from [27, p. 21.19] that Hom𝐴 (𝐴𝑒, 𝑉 ) is non-zero if and only if 𝑉 has a constituent isomorphic to Hd(𝐴𝑒). This is not true by assumption, and therefore Hom𝐴 (𝑃, 𝑉 ) = 0, so ⟨[𝑃 ], [𝑉 ∑︀]⟩𝐴 = 0. Finally, for 𝑉 general we have [𝑉 ] = 𝑆∈Irr 𝐴 [𝑉 : 𝑆][𝑆] in G0 (𝐴). By the above we get ∑︁ ⟨[𝑃 ], [𝑉 ]⟩𝐴 = [𝑉 : 𝑆]⟨[𝑃 ], [𝑆]⟩𝐴 = [𝑉 : Hd(𝑃 )]⟨[𝑃 ], [Hd(𝑃 )]⟩𝐴 𝑆∈Irr 𝐴 = [𝑉 : Hd(𝑃 )] · dim𝐾 End𝐴 (Hd(𝑃 )) as claimed. It follows that the Gram matrix G of ⟨·, ·⟩ with respect to the basis (P(𝑆))𝑆∈Irr 𝐴 of K0 (𝐴) and the basis (𝑆)𝑆∈Irr 𝐴 of G0 (𝐴) is diagonal with positive diagonal entries. The determinant of G is thus a non-zero divisor on Z and since both K0 (𝐴) and G0 (𝐴) are Z-free of the same finite dimension, it follows that ⟨·, ·⟩𝐴 is non-degenerate, see [40, Satz 70.5].  BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 35 Proof of Lemma A.5. We use the same notations as in the proof of ⨁︀ Lemma A.4. Since 𝐴 𝐴 is a projective 𝐴-module, there is a decomposition 𝐴 𝐴 = 𝑖∈𝐼 𝑃𝑖𝑟𝑖 for some 𝑟𝑖 ∈ N. Using Lemma A.6 we see that ∑︁ dim𝐾 Hd(𝑃𝑗 ) = ⟨[𝐴 𝐴], [Hd(𝑃𝑗 )]⟩𝐴 = 𝑟𝑖 ⟨[𝑃𝑖 ], [Hd(𝑃𝑗 )]⟩𝐴 = 𝑟𝑗 ⟨[𝑃𝑗 ], [Hd(𝑃𝑗 )]⟩𝐴 𝑖∈𝐼 = 𝑟𝑗 dim𝐾 End𝐴 (Hd(𝑃𝑖 )) . Hence, 𝑟𝑖 = (83) 𝑛𝑖 𝑚𝑖 , where 𝑛𝑖 := dim𝐾 𝑆𝑖 and 𝑚𝑖 := dim𝐾 End𝐴 (𝑆𝑖 ). In particular, ∑︁ 𝑛𝑖 dim𝐾 𝐴 = dim𝐾 𝑃𝑖 . 𝑚𝑖 𝑖∈𝐼 Now, suppose that is an isomorphism. Then clearly # Irr 𝐴 = # Irr 𝐴𝐿 . The 𝐿 properties of the matrix D𝐿 𝐴 of the morphism d𝐴 derived in the proof of Lemma A.4 𝐿 immediately imply that D𝐴 is diagonal. Since it is invertible with natural numbers on the diagonal, it must already be the identity matrix, i.e., d𝐿 𝐴 induces a bijection between the isomorphism classes of simple modules. In particular, (𝑆𝑖𝐿 )𝑖∈𝐼 is a system of representatives of the isomorphism classes of simple 𝐴𝐿 -modules. The 𝐿 properties of the matrix E𝐿 𝐴 of e𝐴 derived in the proof of Lemma A.4 now imply 𝑠𝑖 𝐿 that we must have 𝑃𝑖 ≃ 𝑄𝑖 for some 𝑠𝑖 ∈ N. We argue that 𝑠𝑖 = 1. This shows that e𝐿 𝐴 is an isomorphism inducing a bijection between the isomorphism classes of projective indecomposable modules. In the same way we deduced equation (83) we now get ∑︁ 𝑛′ 𝑖 (84) dim𝐾 𝐴 = dim𝐿 𝐴𝐿 = dim𝐿 𝑄𝑖 𝑚′𝑖 d𝐿 𝐴 𝑖∈𝐼 with 𝑛′𝑖 = dim𝐿 Hd(𝑄𝑖 ) = dim𝐿 𝑆𝑖𝐿 = dim𝐾 𝑆𝑖 = 𝑛𝑖 and 𝑚′𝑖 = dim𝐿 End𝐴𝐿 (Hd(𝑄𝑖 )) = dim𝐿 End𝐴𝐿 (𝑆𝑖𝐿 ) = dim𝐾 End𝐾 (𝑆𝑖 ) = 𝑚𝑖 , using the fact that 𝐿 ⊗𝐾 End𝐴 (𝑆𝑖 ) ≃ End𝐴𝐿 (𝑆𝑖𝐿 ), see Lemma [38, Theorem 2.38]. Since dim𝐿 𝑄𝑖 ≤ dim𝐿 𝑃𝑖𝐿 = dim𝐾 𝑃𝑖 , equations (83) and (84) imply that dim𝐿 𝑄𝑖 = dim𝐾 𝑃𝑖 , so 𝑄𝑖 = 𝑃𝑖𝐿 . Conversely, suppose that e𝐿 𝐴 is an isomorphism. With the properties of the matrix 𝐿 E𝐴 of e𝐿 established in the proof of Lemma A.4 we see similarly as above that 𝐴 e𝐿 already induces a bijection between the projective indecomposable modules. In 𝐴 𝐿 particular, 𝑃𝑖𝐿 ≃ 𝑄𝑖 . Due to the properties of the matrix D𝐿 𝐴 of d𝐴 established in the 𝐿 proof of Lemma A.4 the only constituent of 𝑆𝑖 is 𝑇𝑖 . Since 𝑃𝑖 is the projective cover of 𝑃𝑖 , we have a surjective morphism 𝜙 : 𝑃𝑖  𝑆𝑖 with Ker(𝜙) = Rad(𝑃𝑖 ). Scalar extension induces a surjective morphism 𝜙𝐿 : 𝑃𝑖𝐿  𝑆𝑖𝐿 with Ker(𝜙𝐿 ) = Ker(𝜙)𝐿 = Rad(𝑃𝑖 )𝐿 ⊆ Rad(𝑃𝑖𝐿 ). It thus follows from [11, Corollary 6.25(i)] that 𝑃𝑖𝐿 is the projective cover of 𝑆𝑖𝐿 . Now, we assume that 𝐾 is perfect. Then by [11, Theorem 7.5] all simple 𝐴-modules are separable, so 𝑆𝑖𝐿 = 𝑇𝑖𝑠𝑖 for some 𝑠𝑖 . Since projective covers are additive, we get 𝑃𝑖𝐿 = 𝑄𝑠𝑖 𝑖 . As 𝑃𝑖𝐿 = 𝑄𝑖 , this implies that 𝑠𝑖 = 1, so 𝑆𝑖𝐿 = 𝑇𝑖 is simple. Hence, d𝐿 𝐴 induces a bijection between the isomorphism classes of simple modules.  Remark A.7. With the same arguments as in the proof of Lemma A.5 we can show that the converse in Lemma A.5(b) still holds when we only assume that all simple 𝐴-modules are separable, i.e., they remain semisimple under field extension. This 36 ULRICH THIEL holds for example when 𝐴 splits or if 𝐴 is a group algebra (over any field). We do not know whether it holds more generally. Proof of Lemma A.3. Let 𝑍 := Z(𝐴). Suppose that 𝐿 is an extension field of 𝐾 with #Bl(𝐴) = #Bl(𝐴𝐿 ). By (79) we know that # Irr 𝑍 = # Irr 𝑍 𝐿 . The arguments in the 𝐿 proof of Lemma A.4 thus imply that the matrix D𝐿 𝐴 of the morphism d𝑍 : G0 (𝑍) → G0 (𝑍 𝐿 ) must be a diagonal matrix. We claim that it is the identity matrix. Since this holds for any 𝐿, it means that the simple modules of 𝑍 remain simple under any field extension, so 𝑍 splits. Our assumption implies that #Idem𝑝 (𝑍) = #Idem𝑝 (𝑍 𝐿 ), so every primitive idempotent 𝑒 ∈ 𝑍 remains primitive in 𝑍 𝐿 . This shows that 𝐿 e𝐿 𝐴 : K0 (𝑍) → K0 (𝑍 ) induces a bijection between projective indecomposable modules. In particular, it is an isomorphism. Now, Lemma A.5 shows that also d𝐿 𝐴 is an isomorphism. Since its matrix D𝐿 𝐴 is invertible with natural numbers on the diagonal, it must be the identity.  Remark A.8. In the proof of Lemma A.3 we have deduced that for a commutative finite-dimensional 𝐾-algebra 𝑍 the condition rkZ K0 (𝑍) = rkZ K0 (𝑍 𝐿 ) already implies that e𝐿 𝑍 induces a bijection between projective indecomposable modules. This follows from the fact that idempotents in a commutative ring are isomorphic if and only if they are equal. This is not true for a non-commutative ring 𝐴. Here, we can have rkZ K0 (𝐴) = rkZ K0 (𝐴𝐿 ) but still a primitive idempotent 𝑒 ∈ 𝐴 can split into a sum of isomorphic orthogonal primitive idempotents of 𝐴𝐿 . Then the matrix 𝐿 E𝐿 𝐴 of e𝐴 is diagonal but not the identity. Let us record the following additional fact: Lemma A.9. If Z(𝐴) splits, then (85) #Bl(𝐴) = dim𝐾 Z(𝐴) − dim𝐾 Rad(Z(𝐴)) = dim𝐾 Z(𝐴) − dim𝐾 (Z(𝐴) ∩ Rad(𝐴)) . Proof. This follows immediately from (79) and the fact that that Rad(Z(𝐴)) = Z(𝐴) ∩ Rad(𝐴) since Z(𝐴) ⊆ 𝐴 is a finite normalizing extension, see [29, Theorem 1.5].  A.3. Reductions. Now, we consider a situation which in a sense is opposite to the one considered in the last paragraph, namely we consider the quotient morphism 𝜑 : 𝑅  𝑅/m =: 𝑆 for a local commutative ring 𝑅 with maximal ideal m and a finitely generated 𝑅-algebra 𝐴. By Lemma 2.3(b) the morphism 𝜑𝐴 : 𝐴  𝐴𝑆 ≃ 𝐴/m𝐴 =: 𝐴 is idempotent stable. We say that 𝜑 is idempotent surjective if for each idempotent 𝑒′ ∈ 𝐴𝑆 there is an idempotent 𝑒 ∈ 𝐴 with 𝜑𝐴 (𝑒) = 𝑒′ . We say that 𝜑𝐴 is primitive idempotent bijective if it induces a bijection between the isomorphism classes of primitive idempotents of 𝐴 and the isomorphism classes of primitive idempotents of 𝐴𝑆 , The question whether 𝜑𝐴 is idempotent surjective is precisely the question whether idempotents of 𝐴 can be lifted to 𝐴, and this is a classical topic in ring theory. The following lemma is standard, we omit the proof. Lemma A.10. If 𝜑𝐴 : 𝐴  𝐴 is idempotent surjective, it is primitive idempotent bijective and block bijective. The next theorem was proven by M. Neunhöffer [35, Proposition 5.10]. Theorem A.11 (M. Neunhöffer). The morphism 𝜑𝐴 : 𝐴  𝐴 is idempotent surjective if and only if 𝐴 is semiperfect. We recall two standard situations of idempotent surjective reductions. BLOCKS IN FLAT FAMILIES OF FINITE-DIMENSIONAL ALGEBRAS 37 Lemma A.12. In the following two cases the morphism 𝜑𝐴 : 𝐴  𝐴 is idempotent surjective: (a) 𝑅 is noetherian and m-adically complete. (b) 𝑅 is henselian. Proof. For a proof of the first case, see [27, Proposition 21.34]. For a proof of the second case assuming that 𝐴 is commutative, see [37, I, §3, Proposition 2]. To give a proof for non-commutative 𝐴 let 𝑒 ∈ 𝐴 be an idempotent. Let 𝑘 := 𝑅/m and let 𝐵 := 𝑘[𝑒] be the 𝑘-subalgebra of 𝐴 generated by 𝑒. Since 𝐴 is a finitedimensional 𝑘-algebra, also 𝐵 is finite-dimensional. Moreover, 𝐵 is commutative. Let 𝑒 ∈ 𝐴 be an arbitrary element with 𝜑𝐴 (𝑒) = 𝑒. Let 𝐵 := 𝑅[𝑒], a commutative subalgebra of 𝐴. Note that 𝐵 = 𝐵/m𝐵. Since 𝐴 is a finitely generated 𝑅-module, the Cayley–Hamilton theorem implies that 𝐵 is a finitely generated 𝑅-algebra. Now, by the commutative case, the map 𝜑𝐵 : 𝐵  𝐵 is idempotent surjective and so there is an idempotent 𝑒′ ∈ 𝐵 ⊆ 𝐴 with 𝜑𝐴 (𝑒′ ) = 𝜑𝐵 (𝑒′ ) = 𝑒. This shows that 𝜑𝐴 is idempotent surjective.  The next theorem was again proven by M. Neunhöffer [35, Proposition 6.2]. It is one of our key ingredients in proving Brauer reciprocity for decomposition maps in a general setting. Theorem A.13 (M. Neunhöffer). Suppose that 𝑅 is a valuation ring with fraction ̂︀ ⊗𝑅 𝐴 field 𝐾 and that 𝐴 is a finite flat 𝑅-algebra with split generic fiber 𝐴𝐾 . If 𝑅 ̂︀ is semiperfect, where 𝑅 is the completion of 𝑅 with respect to the topology defined by a valuation on 𝐾 defining 𝑅, then also 𝐴 is semiperfect. Corollary A.14 (J. Müller, M. Neunhöffer). Suppose that 𝑅 is a discrete valuation ring and that 𝐴 is a finite flat 𝑅-algebra with split generic fiber. Then 𝐴 is semiperfect. In particular, 𝜑𝐴 : 𝐴  𝐴 is primitive idempotent bijective and block bijective. Proof. Since 𝑅 is a discrete valuation ring, its valuation topology coincides with its ̂︀ is m-adically ̂︀ m-adic topology so that the topological completion 𝑅 complete, where ̂︀ Hence, ̂︀ denotes the maximal ideal of 𝑅. m denotes the maximal ideal of 𝑅 and m ̂︀ 𝑅 ⊗𝑅 𝐴 is semiperfect by Lemma A.12(a) and Theorem A.11. Now, Theorem A.13 shows that 𝐴 is semiperfect, too.  Remark A.15. One part of Corollary A.14, the fact that idempotents lift, was also stated earlier by C. Curtis and I. Reiner [11, Exercise 6.16] in an exercise in the special case where 𝐴𝐾 is assumed to be semisimple. The semisimplicity assumption was later removed by J. Müller in his PhD thesis [34, Satz 3.4.1] using the Wedderburn–Malcev theorem (this can be applied without perfectness assumption on the base field if 𝐴𝐾 splits since then 𝐴𝐾 / Rad(𝐴𝐾 ) is separable, see [10, Theorem 72.19]). Appendix B. Further elementary facts Here, we prove three further elementary facts that we used in the paper. Lemma B.1. A finitely generated module 𝑀 over an integral domain 𝑅 is flat if and only if it is faithfully flat. In particular, if 𝑀 ̸= 0, we have 0 ̸= k(p) ⊗𝑅 𝑀 = 𝑀 (p) for all p ∈ Spec(𝑅). Proof. We can assume that 𝑀 = ̸ 0. Since 𝑀 is flat, it is torsion-free and so the localization map 𝑀 → 𝑀p is injective, see Lemma 2.1(c). Hence, 𝑀p ̸= 0. Since 𝑀 is a finitely generated 𝑅-module, also 𝑀p is a finitely generated 𝑅p -module and now Nakayama’s lemma implies that 0 ̸= 𝑀p /pp 𝑀p = k(p) ⊗𝑅 𝑀 . Hence, 𝑀 is faithfully flat by [30, Theorem 7.2].  38 ULRICH THIEL Lemma B.2. Let 𝐴 be a finite flat algebra over an integral domain 𝑅. Then the structure map 𝑅 → 𝐴, 𝑟 ↦→ 𝑟 · 1𝐴 , is injective. Hence, we can identify 𝑅 ⊆ Z(𝐴). If 𝑅 is noetherian, the induced map Υ : Spec(Z(𝐴)) → Spec(𝑅) is finite, closed, and surjective. Proof. It follows from Lemma B.1 that 𝐴 is already faithfully flat. Let 𝜑 : 𝑅 → 𝐴 be the structure map. This is an 𝑅-module map and applying − ⊗𝑅 𝐴 yields a map 𝜑⊗𝑅 𝐴 𝐴 ≃ 𝑅 ⊗𝑅 𝐴 −→ 𝐴 ⊗𝑅 𝐴 of right 𝐴-modules, mapping 𝑎 to 1 ⊗ 𝑎. This map has an obvious section mapping 𝑎 ⊗ 𝑎′ to 𝑎𝑎′ , hence it is injective. Since 𝐴 is faithfully flat, the original map 𝜑 has to be injective, too. As the image of 𝜑 is contained in the center 𝑍 of 𝐴, the structure map is actually an injective map 𝑅 ˓→ 𝑍. Now, assume that 𝑅 is noetherian. Since 𝐴 is a finitely generated 𝑅-module, also 𝑍 is a finitely generated 𝑅-module. Hence, 𝑅 ⊆ 𝑍 is a finite ring extension and now it is an elementary fact that Υ is closed and surjective.  The following lemma about base change of homomorphism spaces is well known but we could not find a reference in this generality (see [3, II, §5.3] for a proof in case of a commutative base ring). Lemma B.3. Let 𝐴 be an algebra over a commutative ring 𝑅 and let 𝜑 : 𝑅 → 𝑆 be a morphism into a commutative ring 𝑆. Let 𝑉 and 𝑊 be 𝐴-modules. If 𝑉 is finitely generated and projective as an 𝐴-module, then there is a canonical 𝑆-module isomorphism. 𝑆 ⊗𝑅 Hom𝐴 (𝑉, 𝑊 ) ≃ Hom𝐴𝑆 (𝑉 𝑆 , 𝑊 𝑆 ) . (86) Proof. We can define a map 𝛾 : 𝑆 ⊗𝑅 Hom𝐴 (𝑉, 𝑊 ) → Hom𝐴𝑆 (𝑉 𝑆 , 𝑊 𝑆 ) by mapping 𝑠⊗𝑓 with 𝑠 ∈ 𝑆 and 𝑓 ∈ Hom𝐴 (𝑉, 𝑊 ) to 𝑠𝑟 ⊗𝑓 , where 𝑠𝑟 denotes right multiplication by 𝑠. It is a standard fact that this is an 𝑆-module morphism, see [38, (2.36)]). Recall that Hom𝐴 (−, 𝑊 ) commutes with finite direct sums by [4, II, §1.6, Corollary 1 to Proposition 6]. This shows that the canonical isomorphism Hom𝐴 (𝐴, 𝑊 ) ≃ 𝑊 induces a canonical isomorphism Hom𝐴 (𝐴𝑛 , 𝑊 ) ≃ 𝑊 𝑛 for any 𝑛 ∈ N and now we conclude that there is a canonical isomorphism 𝑆 ⊗𝑅 Hom𝐴 (𝐴𝑛 , 𝑊 ) ≃ 𝑆 ⊗𝑅 𝑊 𝑛 ≃ (𝑆 ⊗𝑅 𝑊 )𝑛 ≃ Hom𝐴𝑆 ((𝐴𝑆 )𝑛 , 𝑊 𝑆 ) , which is easily seen to be equal to 𝛾. The assertion thus holds for finitely generated free 𝐴-modules. Now, the assumption on 𝑉 allows us to write without loss of generality 𝐴𝑛 = 𝑉 ⊕ 𝑋 for some 𝐴-module 𝑋. It is not hard to see that we get a commutative diagram 𝑆 ⊗𝑅 Hom𝐴 (𝐴𝑛 , 𝑊 ) ≃ (𝑆 ⊗𝑅 Hom𝐴 (𝑉, 𝑊 )) ⊕ (︀ ⊕ (𝑆 ⊗𝑅 Hom𝐴 (𝑋, 𝑊 )) ≃ Hom𝐴𝑆 ((𝐴𝑆 )𝑛 , 𝑊 𝑆 ) ≃ )︀ Hom𝐴𝑆 (𝑉 𝑆 , 𝑊 𝑆 ) (︀ )︀ Hom𝐴𝑆 (𝑋 𝑆 , 𝑊 𝑆 ) where the horizontal morphisms are obtained by the projections and the vertical morphisms are the morphisms 𝛾 in the respective situation. The commutativity of this diagram implies that the morphism 𝑆 ⊗𝑅 Hom𝐴 (𝑉, 𝑊 ) → Hom𝐴𝑆 (𝑉 𝑆 , 𝑊 𝑆 ) also has to be an isomorphism.  REFERENCES 39 References [1] D. J. Benson. Polynomial invariants of finite groups. Vol. 190. London Mathematical Society Lecture Note Series. Cambridge University Press, 1993. [2] C. Bonnafé and R. Rouquier. Cherednik algebras and Calogero-Moser cells. 2017. url: https://arxiv.org/abs/1708.09764. [3] N. Bourbaki. Commutative Algebra. Chapters 1 to 7. Elements of mathematics. Translated from the French edition. Addison-Wesley Publishing Co., 1972. [4] N. Bourbaki. Algebra I. Chapters 1–3. Elements of mathematics. Translated from the 1970 French edition. Springer, 1989. [5] R. Brauer and C. Nesbitt. “On the modular characters of groups.” In: Ann. of Math. (2) 42 (1941), pp. 556–590. [6] K. A. Brown and K. R. Goodearl. Lectures on algebraic quantum groups. Advanced Courses in Mathematics. CRM Barcelona. Birkhäuser Verlag, Basel, 2002, pp. x+348. [7] K. A. Brown and I. Gordon. “The ramification of centres: Lie algebras in positive characteristic and quantised enveloping algebras.” In: Math. Z. 238.4 (2001), pp. 733–779. [8] K. A. Brown and I. Gordon. “The ramifications of the centres: quantised function algebras at roots of unity.” In: Proc. London Math. Soc. (3) 84.1 (2002), pp. 147–178. [9] M. Chlouveraki. Blocks and families for cyclotomic Hecke algebras. Vol. 1981. Lecture Notes in Mathematics. Springer-Verlag, Berlin, 2009. [10] C. W. Curtis and I. Reiner. Representation theory of finite groups and associative algebras. Pure and Applied Mathematics, Vol. XI. Interscience Publishers, a division of John Wiley & Sons, New York-London, 1962, pp. xiv+685. [11] C. W. Curtis and I. Reiner. Methods of representation theory. Vol. 1. New York: John Wiley & Sons, 1981. [12] S. Donkin and R. Tange. “The Brauer algebra and the symplectic Schur algebra.” In: Math. Z. 265.1 (2010), pp. 187–219. [13] D. Eisenbud. Commutative algebra. Vol. 150. Graduate Texts in Mathematics. With a view toward algebraic geometry. Springer-Verlag, New York, 1995. [14] P. Gabriel. “Finite representation type is open.” In: Proceedings of the International Conference on Representations of Algebras (Carleton Univ., Ottawa, Ont., 1974), Paper No. 10. Carleton Math. Lecture Notes 9. Carleton Univ., Ottawa, Ont., 1974. [15] M. Geck and G. Pfeiffer. Characters of finite Coxeter groups and Iwahori-Hecke algebras. Vol. 21. London Mathematical Society Monographs. New Series. The Clarendon Press, Oxford University Press, New York, 2000. [16] M. Geck and R. Rouquier. “Centers and simple modules for Iwahori-Hecke algebras.” In: Finite reductive groups (Luminy, 1994). Vol. 141. Progr. Math. Birkhäuser Boston, Boston, MA, 1997, pp. 251–272. [17] K. R. Goodearl and R. B. Warfield Jr. An introduction to noncommutative Noetherian rings. Second. Vol. 61. London Mathematical Society Student Texts. Cambridge University Press, Cambridge, 2004. [18] I. Gordon. “Representations of semisimple Lie algebras in positive characteristic and quantum groups at roots of unity.” In: Quantum groups and Lie theory (Durham, 1999). Vol. 290. London Math. Soc. Lecture Note Ser. Cambridge Univ. Press, Cambridge, 2001, pp. 149–167. 40 [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] REFERENCES U. Görtz and T. Wedhorn. Algebraic geometry I. Advanced Lectures in Mathematics. Schemes with examples and exercises. Vieweg + Teubner, Wiesbaden, 2010. J. J. Graham and G. I. Lehrer. “Cellular algebras.” In: Invent. Math. 123.1 (1996), pp. 1–34. A. Grothendieck. “Éléments de géométrie algébrique : IV. Étude locale des schémas et des morphismes de schémas, Seconde partie.” In: Publications mathématiques de l’I.H.É.S. 24 (1965), pp. 5–231. A. Grothendieck. “Éléments de géométrie algébrique : IV. Étude locale des schémas et des morphismes de schémas, Troisième partie.” In: Publications mathématiques de l’I.H.É.S. 28 (1966), pp. 5–255. A. Grothendieck. “Éléments de géométrie algébrique: IV. Étude locale des schémas et des morphismes de schémas, Quatrième partie.” In: Publications mathématiques de l’I.H.E.S. 32 (1967), pp. 5–361. C. Huneke and I. Swanson. Integral closure of ideals, rings, and modules. Vol. 336. London Mathematical Society Lecture Note Series. Cambridge University Press, Cambridge, 2006. A. V. Jategaonkar. Localization in Noetherian rings. Vol. 98. London Mathematical Society Lecture Note Series. Cambridge University Press, 1986. I. Kaplansky. “Projective modules.” In: Ann. of Math (2) 68 (1958), pp. 372– 377. T. Y. Lam. A first course in noncommutative rings. Vol. 131. Graduate Texts in Mathematics. Springer-Verlag, New York, 1991. T. Y. Lam. Lectures on modules and rings. Vol. 189. Graduate Texts in Mathematics. Springer-Verlag, New York, 1999, pp. xxiv+557. M. Lorenz. “Finite normalizing extensions of rings.” In: Math. Z. 176.4 (1981), pp. 447–484. H. Matsumura. Commutative ring theory. Vol. 8. Cambridge Studies in Advanced Mathematics. Cambridge University Press, 1986. J. C. McConnell and J. C. Robson. Noncommutative Noetherian rings. Revised. Vol. 30. Graduate Studies in Mathematics. American Mathematical Society, 2001. B. J. Müller. “Localization in non-commutative Noetherian rings.” In: Canad. J. Math. 28.3 (1976), pp. 600–610. B. J. Müller. “Affine Noetherian PI-rings have enough clans.” In: Journal of Algebra 97.1 (1985), pp. 116–129. J. Müller. “Zerlegungszahlen für generische Iwahori–Hecke-Algebren von exzeptionellen Typ.” PhD thesis. RWTH Aachen, 1995. url: www.math.rwthaachen.de/~Juergen.Mueller/preprints/jm3.pdf. M. Neunhöffer. “Untersuchungen zu James’ Vermutung über Iwahori–HeckeAlgebren vom Typ 𝐴.” PhD thesis. RWTH Aachen, 2003. url: http://www. math.rwth-aachen.de/~Max.Neunhoeffer/Publications/pdf/phd.pdf. M. Neunhöffer and S. Scherotzke. “Formulas for primitive idempotents in Frobenius algebras and an application to decomposition maps.” In: Represent. Theory 12 (2008), pp. 170–185. M. Raynaud. Anneaux locaux henséliens. Lecture Notes in Mathematics, Vol. 169. Springer-Verlag, Berlin-New York, 1970. I. Reiner. Maximal orders. Vol. 28. London Mathematical Society Monographs. New Series. Corrected reprint of the 1975 original. With a foreword by M. J. Taylor. The Clarendon Press Oxford University Press, 2003. REFERENCES [39] 41 Hebing Rui. “A criterion on the semisimple Brauer algebras.” In: J. Combin. Theory Ser. A 111.1 (2005), pp. 78–88. [40] G. Scheja and U. Storch. Lehrbuch der Algebra. Teil 2. Mathematische Leitfäden. Unter Einschluss der linearen Algebra. B. G. Teubner, Stuttgart, 1988. [41] The Stacks Project Authors. Stacks Project. http://stacks.math.columbia.edu. 2015. [42] U. Thiel. “Decomposition Matrices are Generically Trivial.” In: Int. Math. Res. Not. IMRN 7 (2016), pp. 2157–2196.
0math.AC
arXiv:1801.09041v1 [cs.CV] 27 Jan 2018 Tell-and-Answer: Towards Explainable Visual Question Answering using Attributes and Captions Qing Li1 , Jianlong Fu2 , Dongfei Yu1 , Tao Mei2 , Jiebo Luo3 1 University of Science and Technology of China 2 Microsoft Research, Beijing, China 3 University of Rochester, Rochester, NY 1 {sealq, ydf2010}@mail.ustc.edu.cn, 2 Explainable VQA {jianf, tmei}@microsoft.com, Abstract 3 [email protected] Attributes: sit, phone, bench, cell, talk, woman, chair, park Caption: a woman sitting on a bench talking on a cell phone. Visual Question Answering (VQA) has attracted attention from both computer vision and natural language processing communities. Most existing approaches adopt the pipeline of representing an image via pre-trained CNNs, and then using the uninterpretable CNN features in conjunction with the question to predict the answer. Although such end-to-end models might report promising performance, they rarely provide any insight, apart from the answer, into the VQA process. In this work, we propose to break up the end-to-end VQA into two steps: explaining and reasoning, in an attempt towards a more explainable VQA by shedding light on the intermediate results between these two steps. To that end, we first extract attributes and generate descriptions as explanations for an image using pre-trained attribute detectors and image captioning models, respectively. Next, a reasoning module utilizes these explanations in place of the image to infer an answer to the question. The advantages of such a breakdown include: (1) the attributes and captions can reflect what the system extracts from the image, thus can provide some explanations for the predicted answer; (2) these intermediate results can help us identify the inabilities of both the image understanding part and the answer inference part when the predicted answer is wrong. We conduct extensive experiments on a popular VQA dataset and dissect all results according to several measurements of the explanation quality. Our system achieves comparable performance with the state-of-theart, yet with added benefits of explanability and the inherent ability to further improve with higher quality explanations. What is the woman doing sitting on the bench? Answer Reasoning talking on phone Figure 1: An example of explanation and reasoning in VQA. We first extract attributes in the image such as “sit”, “phone” and “woman.” A caption is also generated to encode the relationship between these attributes, e.g. “woman sitting on a bench.” Then a reasoning module uses these explanations to predict an answer “talking on the phone.” A few ducks swim in the ocean near two ferries. QA Yes (0.99) QA Yes (0.99) Is there a ferry in the picture? A green fire hydrant sitting next to a street. Figure 2: Two contrasting cases that show how the explanations can be used to determine if the system learns from a training set bias or from the image content. processing communities. This task is considered as the milestone of “AI-complete.” Compared with text-based applications (e.g., sentence generation [25] and text QA [27]), VQA takes one step further, requiring a machine to be equipped with cross-modality understanding across language and vision [2, 36, 10]. Significant progress has been made on VQA in recent 1. Introduction Answering textual questions from images, which is referred to as visual question answering, presents fundamental challenges to both computer vision and natural language 1 years [28, 33, 20, 30]. A widely used pipeline is to first encode an image with Convolutional Neural Networks (CNNs) and represent associated questions with Recurrent Neural Networks (RNNs), and then formulate the vision-tolanguage task as a classification problem on a list of answer candidates. Although promising performance has been reported, this end-to-end paradigm fails to provide any insight to illuminate the VQA process. In most cases, giving answers without any explanation cannot satisfy human users, especially when the predicted answer is not correct. More frustratingly, the system gives no hint about which part of such systems is the culprit for a wrong answer. To address the above issues, we propose to break up the popular end-to-end pipeline into two steps: explaining and reasoning. The philosophy behind such a break-up is to mimic the image question answering process of human beings: first understanding the content of the image and then performing inference about the answer according to the understanding. As is shown in Fig.1, we first generate twolevel explanations for an image via pre-trained attribute detectors and image captioning model: 1). word-level: attributes, indicating individual objects and attributes the system learns from the image. 2). sentence-level: captions, representing the relationship between the objects and attributes. Then the generated explanations and question are infused to a reasoning module to predict an answer. The reasoning module is mainly composed of LSTMs. Our method has three benefits. First, these explanations are interpretable. According to the attributes and captions, we can tell what objects, attributes and their relationship the machine learns from the image as well as what information is lost during the image understanding step. In contrast, the fully-connected layer features of CNNs are usually uninterpretable to humans. When the predicted answer is correct, these attributes and captions can be provided for users as the supplementary explanations to the answer. Second, the separation of explaining and reasoning enables us to localize which step of the VQA process the error comes from when the predicted answer is wrong. If the explanations don’t include key information to answer the question, the error is caused by missing information during the explaining step. Otherwise, the reasoning module should be responsible for the wrong answer. Third, the explanations can also indicate whether the system really finds key information from the image to answer the question or merely guesses an answer. This especially works against a learner simply taking advantage of the training set bias instead of learning from the actual image content. Fig.2 presents two contrasting cases to illustrate this. In the first case, both the generated caption and the question include the key concept “ferry”, so the answer “Yes” with a high probability is reliable. However, although the answer “Yes” has the same high probability in the second case, the caption is irrelevant to the question. This implies that the system sticks to a wrong answer even with the correct input from sentence generation. A further investigation suggests that the error is due to the training set bias. A large proportion of questions starting with “is there” in the training set have the answer “Yes”. To our knowledge, this is the first effort to break down the previous end-to-end pipeline to shed light on the VQA process. Our main contributions are summarized as follows: • We propose to formulate VQA into two separate steps: explaining and reasoning. Our framework generate attributes and captions for images to shed light on why the system predicts any specific answer. • We adopt several ways to measure the quality of explanations and demonstrate a strong correlation between the explanation quality and the VQA accuracy. The current system achieves comparable performance to the state-of-the-art and can naturally improve with explanation quality. • Extensive experiments are conducted on the popular VQA dataset [2]. We dissect all results according to the measurements of the quality of explanations to present a thorough analysis of the strength and weakness of our framework. 2. Related Work There is a growing research interest in the task of visual question answering. In this section, we first discuss the popular CNN-RNN paradigm used in VQA and then summarize the recent advances from two directions. CNN-RNN. Inspired by the significant progress of image captioning achieved by combining CNN and RNN, the paradigm of CNN-RNN has become the most common practice in VQA [9, 17, 21]. Visual features of images are extracted via pre-trained convolutional neural networks (CNNs). Different from image captioning models, recurrent neural networks (RNNs) in VQA are used to encode questions. [21] treat the image as the first token and feed it into RNN along with the question to predict an answer. Inspired by [6], [17] pass the image into RNN at each time step, instead of only seeing the image once. [9] adapt m-RNN models [18] to handle the VQA task in the multi-lingual setting. Despite these methods show promising results, they fail to recognize novel instances in images and are highly relied on questions while neglecting the image content [1, 14]. Attention in VQA. The attention mechanism is firstly used in the machine translation task [3] and then is brought into the vision-to-language tasks [32, 34, 31, 33, 16, 12, 19, 35]. The visual attention in the vision-to-language tasks is used to address the problem of “where to look” [22]. In VQA, the question is used as a query to search for the relevant regions in the image. [33] propose a stacked attention model which queries the image for multiple times to infer the answer progressively. Beyond the visual attention, Lu et al. exploit a hierarchical question-image co-attention strategy to attend to both related regions in the image and crucial words in the question. [19] propose the dual attention network, which refines the visual and textual attention via multiple reasoning steps. [8] incorporate a powerful feature fusion method into visual attention and obtain impressive results. Attention mechanism can find the question-related regions in the image, which can account for the answer to some extent. But the attended regions still don’t explicitly exhibit what the system learns from the image and it is also not explained why these regions should be attended to. High-level Concepts. In the scenario of vision-tolanguage, high-level concepts exhibit superior performance than the low-level or middle-level visual features of the image [7, 28, 29]. Each concept corresponds to a word mined from the training image captions and represents the objects and attributes presented in the image. [7] first learn independent detectors for visual words based on a multi-instance learning framework and then generate descriptions for images based on the set of visually detected words via a maximum entropy language model. [28] presents a thorough study on how much the high-level concepts can benefit the image captioning and visual question answering tasks. [29] leverage the high-level concepts and captions to search external knowledge bases to further improve the VQA performance. These work mainly uses high-level concepts to obtain a better performance. Different from these work, our paper is focused on fully exploiting the readability and understandability of attributes and captions to explain the process of visual question answering and use these explanations to analyze our system. example, “horse” and “horses” are considered as the same word. This significantly decreases the size of our word list. Given the word list, every image is paired with multiple labels (words) according to its captions. Then we formulate word prediction as a multi-label classification task as [28]. Figure 4 summarizes our word prediction network. Different from [28], which uses VggNet [23] as the initialization of the CNN, we adopt the more powerful ResNet-152 [11] pre-trained on ImageNet [5]. After initialization, the CNN is fine-tuned on our image-words dataset by minimizing the element-wise sigmoid cross entropy loss: 3. Methodology However, this metric disregards the extent to which the predicted words are relevant to the question. Intuitively speaking, question-relevant explanations for images should be more likely to help predict right answers than irrelevant ones. Therefore, we propose another metric to measure the relevance between the words and the question. We first encode the question into a 0-1 vector q in terms of the word list. Then the relevance is computed as: In this section, we introduce the proposed framework for the breakdown of VQA. As illustrated in Figure 3, the framework consists of three modules: word prediction, sentence generation, and answer reasoning. Next, we describe the three modules in details. 3.1. Word Prediction From the work [7, 28, 34], we have learned that explicit high-level attributes can benefit vision-to-language tasks. In fact, besides performance gain, the readability and understandability of attributes also makes them an intuitive way to explain what the model learns from images. Similar to [7], we first build a word list based on MS COCO Captions [4]. We extract the most N frequent words in all captions and filter them by lemmatization and removing stop words to determine a list of 256 words, which cover over 90% of the word occurrences in the dataset. These words can be any part of speech, including nouns (object names), verbs (actions) or adjectives (properties). In contrast to [7], our words are not tense or plurality sensitive, for J= N V 1 XX −yij log pij − (1 − yij ) log(1 − pij ) (1) N i=1 j=1 where N is batch size, V is the size of word list, yi = [yi1 , yi2 , ..., yiV ], yij ∈ {0, 1} is the label vector of the ith image, pi = [pi1 , pi2 , ..., piV ] is the probability vector. In the testing phase, instead of using region proposals like [28], we directly feed the whole image into the word prediction CNN in order to keep simple and efficient. As a result, each image is encoded into a fixed-length vector, where each dimension represents the probability of the corresponding word occurring in the image. Word Quality Evaluation. We adopt two metrics to evaluate the predicted words. The first measures the accuracy of the predicted words by computing cosine similarity between the label vector y and the probability vector p: a= r= yT p ||y|| · ||p|| qT p ||q|| · ||p|| (2) (3) 3.2. Sentence Generation This section we talk about generating sentence-level explanations for images by using a pre-trained image captioning model. Similar to [26], we train an image captioning model by maximizing the probability of the correct caption given an image. Suppose we have an image I to be described by a caption S = {s1 , s2 , ..., sL }, st ∈ V, where V is the vocabulary, L is the caption length. First the image I is represented by the activations of the first fully connected layer of ResNet-152 pre-trained on ImageNet, denoted as Framework 𝐯𝒘 Q: what are the animals in the picture? LSTM Word Prediction grass LSTM Three giraffes … LSTM LSTM LSTM CNN … #end 𝐯𝑞 LSTM Sentence Generation ⊕ 𝐯𝑠 A: giraffe Answer Reasoning Figure 3: An overview of the proposed framework for VQA with three modules: word prediction (upper left), sentence generation (lower left), answer reasoning (right). Explaining: in word prediction, the image is fed into pre-trained visual detectors to extract word-level explanation, which is represented by probability vector vw ; in sentence generation, we input the image to pre-trained captioning model to generate a sentence-level explanation. Reasoning: the caption and question are encoded by two different LSTMs into vs and vq , respectively. Then vq , vw and vs are concatenated and fed to a fully connected layer with softmax to predict an answer. Pretrained Single-label CNN Single-label Images Single-label Losses ImageNet Parameters Initialization Finetuned Multi-label CNN Multi-label Images Multi-label Losses MS COCO Figure 4: Word prediction CNN: the model is firstly initialized from ResNet-152 pre-trained on ImageNet. Then the model is fine-tuned on our image-words dataset built from MS COCO captions. vi . The caption S can be represented as a sequence of onehot vector S = {s1 , s2 , ..., sL }. Then we formulate the caption generation problem as minimizing the cost function: J(vi , S) = − log P (S|vi ) =− L X log P (st |vi , s1 , ..., st−1 ) (4) t=0 where P (st |vi , s1 , ..., st−1 ) is the probability of generating the word st given the image representation vi and previous words {s1 , ..., st−1 }. We employ a single-layer LSTM with 512-dimensional hidden states to model this probability. In the testing phase, the image is input to pre-trained image captioning model to generate sentence-level explanation. Sentence Quality Evaluation. Similar to word quality evaluation, we evaluate the quality of the generated sentence from two perspectives: accuracy and relevance. The former one is an average fusion of four widely used metrics: BLEU@N, METEOR, ROUGE-L and CIDEr-D, which try to consider the accuracy of the generated sentence from different perspectives. Detailed explanations about these metrics can be seen in [4]. Note that we normalize all the metrics into [0, 1] before fusion. The latter metric is to measure the relevance between the generated sentence and the question. The binary TF weights are calculated over all words of the sentence to produce an integrated representation of the entire sentence, denoted by s. Likewise, the question can be encoded to q. The relevance is computed as: r= qT s ||q|| · ||s|| (5) 3.3. Answer Reasoning This section we discuss the reasoning module. Suppose we have an image I explained by the predicted words W and the generated sentence S, the question Q and the answer A. As shown in Fig.3, we denote the representations of the predicted words W as vs . The caption S and question Q are encoded by two different LSTMs into vs and vq , respectively. What bears mentioning is that these two LSTMs share a common word-embedding matrix, but not other parameters, because the question and caption have different grammar structures and similar vocabularies. At last, the vw , vs , and vq are concatenated and fed into a fully connected layer with softmax to predict the probability on a set of candidate answers: T v = [vw vsT vqT ]T (6) p = sof tmax(Wv + b) (7) where W, b are the weight matrix and bias vector of the fully connected layer. The optimizing objective for the rea- Table 1: The relationship between word quality and VQA accuracy (%). soning module is to minimize the cross entropy loss as: J(I, Q, A) = J(W, S, Q, A) = − log p(A) (b) W-Q Relevance (a) Word accuracy (8) where p(A) denotes the probability of the ground truth A. Word accuracy VQA accuracy W-Q Relevance VQA accuracy 4. Experiments and Analysis [0.0, 0.2) [0.2, 0.8) [0.8, 1.0) 46.30 55.84 58.52 [0.0, 0.2) [0.2, 0.8) [0.8, 1.0) 54.69 60.23 76.15 4.1. Experiment Setting • Word-based VQA: use the feature concatenation of the predicted words and question in Eq.6. • Sentence-based VQA: use the feature concatenation of the generated sentence and question in Eq.6. • Full VQA: use the feature concatenation of words, sentence, and question in Eq.6. Model Configuration. We explain our model setting and training details here. We build the vocabulary from questions in VQA-real [2]. We convert all sentences to lower case and tokenize them by NLTK tool and discard words which occur less than five times, resulting in the final vocabulary with 6,148 unique words. For the question and caption encoders in answer reasoning module, we utilize singlelayer LSTMs with 512-dimensional hidden states and word embedding size is 512. We select the most frequent 3000 answers in training set as the list of candidate answers. In training, we use Adam solver [15] with a batch size of 128. The initial learning rate is 0.01 and is dropped to 0.001 after first 10 epochs. The training is stopped after another 10 epochs. In addition, dropout [24] and batch normalization [13] are used in the training procedure. 100 W-Q Relevance 90 VQA Accuracy (%) Dataset. We evaluate our framework on VQA-real [2] dataset. For each image in VQA-real, 3 questions are annotated by different workers and each question has 10 answers from different annotators. We follow the official split and report our results on the open-ended task. Metric. We use the accuracy metric provided by [2]: that answer , 1) , i.e., an answer is deemed min( #humans giving 3 100% accurate if at least three workers provided that exact answer. Ablation Models. To analyze the contribution of wordlevel and sentence-level explanations, we ablate the full model and evaluate several variants as: Word Accuracy 80 70 60 50 40 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Figure 5: The comparison of the impact of word accuracy and word-question relevance on VQA performance. shows the relationship between word accuracy and VQA performance. We can learn that the more accurate the predicted words, the better the VQA performance. This indicates that improving the visual detectors to predict more accurate words can benefit VQA performance. Table 1b shows the relationship between word-question relevance and VQA performance. Similar to word accuracy, the more relevant to the question the predicted words, the better the VQA performance. Particularly, when the word-question relevance exceeds 0.8, the predicted words are highly pertinent to the question, boosting the VQA accuracy to 76.15%. Based on the above observations, we conclude that highquality word-level explanations can benefit the VQA performance a lot. Also, as shown in Fig.5, word-question relevance has a bigger impact on the final VQA performance than word accuracy does. 4.3. Sentence-based VQA Table 2: The relationship between sentence quality and VQA accuracy (%). 4.2. Word-based VQA An important characteristics of our framework is that the quality of explanations can influence the final VQA performance. In this section, we analyze the impact of the quality of predicted words on the VQA accuracy. We measure the quality from two sides: word accuracy and word-question relevance, illustrated in Eq.2 and Eq.3, respectively. And we normalize all the measurements into [0, 1]. Table 1a (a) Sentence accuracy (b) S-Q Relevance Sentence accuracy VQA accuracy S-Q Relevance VQA accuracy [0.0, 0.2) [0.2, 0.8) [0.8, 1.0) 51.29 55.53 61.33 [0.0, 0.2) [0.2, 0.8) [0.8, 1.0) 52.79 62.34 89.81 100 S-Q Relevance VQA Accuracy (%) Table 3: Performance comparison on the validation split of VQA-real open-ended task when the sentence-based VQA model uses different sources of captions. (accuray in %) Sentence Accuracy 90 80 validation 70 Caption source All Y/N Num Others null sentence generation relevant groundtruth 46.21 54.85 56.05 73.82 76.31 77.42 34.98 36.64 41.04 25.63 42.23 44.34 60 50 40 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Image and question Figure 6: The comparison of the impact of sentence accuracy and sentence-question relevance on VQA performance. In this section, we evaluate the sentence-based VQA model and analyze the relationship between the quality of the generated sentence and the final VQA performance. Similar to the quality measurements of predicted words, we focus on the accuracy of the generated sentence itself and the relevance between sentence and question. As shown in Table 2a, the more accurate the generated sentence, the higher the VQA accuracy. The results suggest that the VQA performance can be further improved by a better image captioning model. Table 2b shows the impact of sentencequestion relevance on VQA accuracy. We can see that the more relevant to the question the generated sentence, the better the VQA performance. Once the relevance reaches 0.8, the accuracy can significantly increase to 89.81%. This proves that a sentence highly related to the question is more likely to contain the key information for the VQA module to answer the question. Figure 6 illustrates the comparison of the impact of sentence accuracy and sentence-question relevance on the final VQA performance. Sentence-question relevance has a greater influence on VQA performance than sentence accuracy does. To further verify the causal relationship between sentence quality and VQA performance, we conduct the following control experiments. First, we evaluate sentencebased VQA model when feeding different sources of captions with ascending quality: null (only including an “#end” token), sentence generation and relevant groundtruth (selecting from the groundtruth captions the most relevant one to the question). As shown in Table 3, sentence generation performs much better than null. And using relevant groundtruth captions, the accuracy can improve by another 1.2 percent. Figure 7 presents an example to illustrate the effect of the sentence quality on the accuracy. From the above analysis, we can safely reach the conclusion that the VQA performance can be greatly improved by generating sentence-level explanations of high quality, especially of high relevance to the question. Generated Caption Prediction (accuracy) (Good) a group of people playing frisbee in a field. frisbee (1.00) (Wrong) a group of people playing soccer in a field. soccer (0.00) (Empty) NULL tennis (0.00) Q: what sport are they playing? Figure 7: A control case for comparing the accuracy when inputting captions of different quality. When getting a caption of high quality (the first one), the system can answer the question correctly. If we manually change the “frisbee” to “soccer”, a wrong answer is predicted. When using an empty sentence, the system predicts the most popular answer “tennis” for this question. 4.4. Case Study From the above evaluation of word-based and sentencebased VQA model, we conclude that the relevance between explanations (attributes/caption) and the question has a great impact on the final VQA performance. In this section we illustrate this conclusion by studying four possible types of cases: 1). high relevance and correct answer; 2). low relevance and wrong answer; 3). high relevance but wrong answer; 4). low relevance but correct answer. High relevance and correct answer. From the first case in Fig. 8, we can see that the explanations for the image are highly relevant to the question: both the predicted attributes and the generated sentence contain the words “man” and “racket” occurring in the question. And the explanations also has key information that can predict the answer “tennis court.” In this type of case, the system successfully extracts from the image the relevant information that covers the question, facilitating answer generation. Low relevance and wrong answer. In the second case, although the attributes and caption can reflect part of the image content such as “man” and “food”, they neglect the key information about the “glass” that is asked in the question. The absence of “glass” in the explanations produces a low explanation-question relevance score and leads the system to a wrong answer. In this type of case, two lessons can be derived from the low relevance: 1). as the explanations Image Explanations, Question and Answer ① High relevance and correct answer Attributes: tennis, ball, man, racket, hit, court, play, player, swing, hold (0.87, 0.72) Caption: a man holding a tennis racket on a tennis court. (0.88, 0.68) Question: where is the man swinging the racket? Answer: tennis court (tennis court) ② Low relevance and wrong answer Attributes: bicycle, man, sit, eat, bike, look, outside, food, person, table (0.06, 0.48) Caption: a man sitting at a table with a plate of food. (0.00, 0.34) Question: what kind of drink is in the glass? Answer: beer (water) ③ High relevance but wrong answer Attributes: street, bus, cow, city, walk, car, drive, stand, road, white (0.51, 0.77) Caption: a cow that is walking in the street (0.51, 0.55) Question: what is walking next to the bus? Answer: car (cow) ④ Low relevance but correct answer Attributes: woman, bear, teddy, hold, sit, glass, animal, large, lady (0.00, 0.19) Caption: a woman holding a sandwich in her hands (0.00, 0.30) Question: does the man need a haircut? Answer: yes (yes) Figure 8: Four types of cases in our results: 1). high relevance and correct answer; 2). low relevance and wrong answer; 3). high relevance but wrong answer; 4). low relevance but correct answer. “(*,*)” behind the explanations (attributes/caption) denotes the explanation-question relevance score and explanation accuracy, respectively. Gray denotes groundtruth answers. QA:121,512 CA: 66,844 ① RA: 47,070 Y/N: 22,928 O: 24,142 WA: 54,668 ④ GA: 19,774 Y/N: 13,075 O: 6,699 ③ RA: 10,945 Y/N: 1,694 O: 9,251 ② GA: 43,723 Y/N: 7,937 O: 35,786 QA: all questions andtoanswers Figure 9: Dataset dissection according the four types of cases. We define that the answer is guessed when the explanations CA:question questions correct reliable. answers The case numbers in the third row correspond to these in Fig.8. QA: are irrelevant to the andwith otherwise WA: questions with wrong answers all questions and answers. CA: questions with correct answers. WA: questions with wrong answers. GA: questions with GA: questions answers Y/N: answer type “yes/no”. O: answer types other than “yes/no”. guessed answers. RA: questions with guessed reliable answers. RA: questions with reliable answers Y/N: answer type is Yes/No are irrelevant to theO:question, the system predict the can see that although the system fails to predict the correct answer type is othertends thantoYes/No most frequent answer (“beer”) for this question type (“what answer, the explanations for the image are indeed relevant kind of drink ...”), which implies that the answer is actuto the question and the system also recognize the key inally guessed from the dataset bias; 2). the error comes from formation “cow.” This indicates that the error is caused by the image understanding part rather than the question anthe question answering module rather than the explanation swering module, because the system fails to extract from generation part. The system can recognize that “a cow is the image enough information to answer the question in the walking in the street” and “a bus is in the street”, but it fails first place. This error suggests that some improvements are to conclude that “the cow is next to the bus.” This error may needed in word prediction and sentence generation modules lie in the weakness of LSTM which struggles on such comto generate more comprehensive explanations for the image. plex spatial relationship inference. In the following analysis, we would show that such cases only occupy a relatively High relevance but wrong answer. In the third case, we small proportion of the whole dataset. Low relevance but correct answer. In the last example of Fig. 8, we know from the explanations that the system mistakes the “man” in the image for “woman” and neglects the information about his “hair.” The explanations, therefore, have a low relevance score, which indicates that the answer “yes” is guessed by the system. Although the guessed answer is correct, it cannot be credited to the correctness of the system. In fact, for this particular answer type “yes/no”, the system has at least 50% chance to hit the right answer. We dissect all the results in the dataset according to the above four types of cases, as shown in Fig. 9. Among the questions that the system answers correctly, nearly 30% are guessed. This discovery indicates that, buried in the seemingly promising performance, the system actually takes advantage of the dataset bias, rather than truly understands the image content. Over 65% of the answers that are correctly guessed belong to “yes/no”, an answer type easier for the system to hit the right answer than other types. As for the questions to which the system predicts wrong answers, a large proportion (around 80%) has a low explanationquestion relevance, which means that more efforts need to be put into improving the attributes detectors and image captioning model. Questions with other answer types account for more than 80% of the wrongly-guessed answers. This is not surprising because for these questions the system cannot rely on the dataset bias anymore, considering the great variety of the candidate answers. turned by the test server [2]. From Table 4, we can see that sentence-based VQA consistently outperforms word-based VQA, which indicates that sentence-level explanations are superior to word-level ones. This is because the generated captions not only include the objects in the image, but also encode the relationship between these objects, which is important for predicting the correct answer. Moreover, full VQA model obtains a better performance by combining attributes and captions. As the answer reasoning module in our framework is based on explanations, if we can get better attribute detectors and image captioning model, the VQA performance can be further improved. Compared with the state-of-the-art, our framework achieves better performance than LSTM Q+I [2], Concepts [28], and ACK [29], which use CNN features, high-level concepts, and external knowledge, respectively. Both SAN [33] and HieCoAtt [16] use attention mechanism in images or questions and yield comparable performance with ours. MCB-ensemble [8] achieves significantly better performance than ours and other top methods, but it suffers from a high-dimensional feature (16,000 vs 1,280), which poses a limitation on the model’s efficiency. The main advantage of our framework over other methods is that it not only predicts an answer to the question, but also generates human-readable attributes and captions to explain the answer. These explanations can help us understand what the system extracts from an image and their relevance to the question. As explanations improve, so would our system. 4.5. Performance Comparison 5. Discussions and Conclusions Table 4: Performance comparison with the state-of-the-art. We show the performance on both test-dev and test-standard splits of VQA-real open-ended task. The performances are achieved by training the VQA module on both the train and val splits. MCB-ensemble incorporates external training data, which is an extra advantage over other methods. Human is the human performance for reference. In this work, we break up the end-to-end VQA pipeline into explaining and reasoning, and achieve comparable performance with the state-of-the-art. Different from previous work, our method first generates attributes and captions as explanations for an image and then feed these explanations to a question answering module to infer an answer. The merit of our method lies in that these attributes and captions allow a peek into the process of visual question answering. Furthermore, the relevance between these explanations and the question can act as indication whether the system really understands the image content. It is worth noting although we also use the CNN-RNN combination, we generate words and captions as the explanations of images, thus allowing the VQA system to perform reasoning on semantics instead of unexplanable CNN features. Since the effectiveness of CNN for generating attributes and captions is well established, the use of CNN as a component does not contradict our high-level objective for explanable VQA. Our goal is not to immediately make a big gain in performance, but to propose a more powerful framework for VQA. Our current implementation already matches the state of the art, but more importantly, provides to the ability to explain and to improve. test-dev test-standard Method All Y/N Num Others All Y/N Num Others LSTM Q+I [2] Concepts [28] ACK [29] SAN [33] HieCoAtt [16] MCB [8] MCB-ensemble [8] Human [2] 53.74 57.46 59.17 58.70 61.80 60.80 66.70 - 78.94 79.77 81.01 79.30 79.70 81.20 83.40 - 35.24 36.79 38.42 36.60 38.70 35.10 39.80 - 36.42 43.10 45.23 46.10 51.70 49.30 58.50 - 54.06 57.62 59.44 58.90 62.10 66.50 83.30 79.01 79.72 81.07 83.20 95.77 35.55 36.04 37.12 39.50 83.39 36.80 43.44 45.83 58.00 72.67 Word-based VQA Sentence-based VQA Full VQA 56.76 57.91 59.93 77.57 78.03 79.32 35.21 36.73 38.41 43.85 45.52 48.25 60.07 79.09 38.25 48.57 In this section, we present the performance comparison between variants of our framework and the state-of-theart. For a fair comparison, all the results are reported on the test-dev and test-standard splits of which ground-truth answers are not released and all the performances are re- References [1] A. Agrawal, D. Batra, and D. Parikh. Analyzing the behavior of visual question answering models. EMNLP, 2016. 2 [2] S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh. Vqa: Visual question answering. In ICCV, pages 2425–2433, 2015. 1, 2, 5, 8 [3] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. ICLR, 2014. 2 [4] X. Chen, H. Fang, T.-Y. Lin, R. Vedantam, S. Gupta, P. Dollár, and C. L. Zitnick. Microsoft coco captions: Data collection and evaluation server. CoRR, 2015. 3, 4 [5] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. FeiFei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255. IEEE, 2009. 3 [6] J. Donahue, L. Anne Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, K. Saenko, and T. Darrell. Long-term recurrent convolutional networks for visual recognition and description. In CVPR, 2015. 2 [7] H. Fang, S. Gupta, F. Iandola, R. K. Srivastava, L. Deng, P. Dollár, J. Gao, X. He, M. Mitchell, J. C. Platt, et al. From captions to visual concepts and back. In CVPR, 2015. 3 [8] A. Fukui, D. H. Park, D. Yang, A. Rohrbach, T. Darrell, and M. Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. EMNLP, 2016. 3, 8 [9] H. Gao, J. Mao, J. Zhou, Z. Huang, L. Wang, and W. Xu. Are you talking to a machine? dataset and methods for multilingual image question. In NIPS, pages 2296–2304, 2015. 2 [10] Y. Goyal, T. Khot, D. Summers-Stay, D. Batra, and D. Parikh. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. CVPR, 2017. 1 [11] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. 3 [12] I. Ilievski, S. Yan, and J. Feng. A focused dynamic attention model for visual question answering. ECCV, 2016. 2 [13] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456, 2015. 5 [14] A. Jabri, A. Joulin, and L. van der Maaten. Revisiting visual question answering baselines. In ECCV, pages 727–739. Springer, 2016. 2 [15] D. Kingma and J. Ba. Adam: A method for stochastic optimization. ICLR, 2015. 5 [16] J. Lu, J. Yang, D. Batra, and D. Parikh. Hierarchical question-image co-attention for visual question answering. In NIPS, pages 289–297, 2016. 2, 8 [17] M. Malinowski, M. Rohrbach, and M. Fritz. Ask your neurons: A neural-based approach to answering questions about images. In ICCV, 2015. 2 [18] J. Mao, W. Xu, Y. Yang, J. Wang, Z. Huang, and A. Yuille. Deep captioning with multimodal recurrent neural networks (m-rnn). ICLR, 2015. 2 [19] H. Nam, J.-W. Ha, and J. Kim. Dual attention networks for multimodal reasoning and matching. CVPR, 2017. 2, 3 [20] H. Noh, P. Hongsuck Seo, and B. Han. Image question answering using convolutional neural network with dynamic parameter prediction. In CVPR, pages 30–38, 2016. 2 [21] M. Ren, R. Kiros, and R. Zemel. Exploring models and data for image question answering. In NIPS, pages 2953–2961, 2015. 2 [22] K. J. Shih, S. Singh, and D. Hoiem. Where to look: Focus regions for visual question answering. In ICCV, pages 4613– 4621, 2016. 2 [23] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, 2014. 3 [24] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929–1958, 2014. 5 [25] I. Sutskever, J. Martens, and G. E. Hinton. Generating text with recurrent neural networks. In ICML, pages 1017–1024, 2011. 1 [26] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, pages 3156–3164, 2015. 3 [27] J. Weston, A. Bordes, S. Chopra, A. M. Rush, B. van Merriënboer, A. Joulin, and T. Mikolov. Towards aicomplete question answering: A set of prerequisite toy tasks. arXiv:1502.05698, 2015. 1 [28] Q. Wu, C. Shen, L. Liu, A. Dick, and A. van den Hengel. What value do explicit high level concepts have in vision to language problems? In CVPR, 2016. 2, 3, 8 [29] Q. Wu, P. Wang, C. Shen, A. Dick, and A. van den Hengel. Ask me anything: Free-form visual question answering based on knowledge from external sources. CVPR, 2016. 3, 8 [30] C. Xiong, S. Merity, and R. Socher. Dynamic memory networks for visual and textual question answering. In ICML, pages 2397–2406, 2016. 2 [31] H. Xu and K. Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In ECCV, pages 451–466. Springer, 2016. 2 [32] K. Xu, J. Ba, R. Kiros, K. Cho, A. C. Courville, R. Salakhutdinov, R. S. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, volume 14, pages 77–81, 2015. 2 [33] Z. Yang, X. He, J. Gao, L. Deng, and A. Smola. Stacked attention networks for image question answering. In CVPR, pages 21–29, 2016. 2, 8 [34] Q. You, H. Jin, Z. Wang, C. Fang, and J. Luo. Image captioning with semantic attention. In CVPR, 2016. 2, 3 [35] D. Yu, J. Fu, T. Mei, and Y. Rui. Multi-level attention networks for visual question answering. In CVPR, 2017. 2 [36] Y. Zhu, O. Groth, M. Bernstein, and L. Fei-Fei. Visual7w: Grounded question answering in images. In CVPR, pages 4995–5004, 2016. 1
1cs.CV
arXiv: 1706.04059v3 Approximate Optimal Designs for Multivariate Polynomial Regression arXiv:1706.04059v3 [math.ST] 25 Oct 2017 Yohann De Castro? , Fabrice Gamboa◦ , Didier Henrion• , Roxana Hess• and Jean-Bernard Lasserre• . Abstract: We introduce a new approach aiming at computing approximate optimal designs for multivariate polynomial regressions on compact (semi-algebraic) design spaces. We use the moment-sum-of-squares hierarchy of semidefinite programming problems to solve numerically the approximate optimal design problem. The geometry of the design is recovered via semidefinite programming duality theory. This article shows that the hierarchy converges to the approximate optimal design as the order of the hierarchy increases. Furthermore, we provide a dual certificate ensuring finite convergence of the hierarchy and showing that the approximate optimal design can be computed numerically with our method. As a byproduct, we revisit the equivalence theorem of the experimental design theory: it is linked to the Christoffel polynomial and it characterizes finite convergence of the moment-sum-of-square hierarchies. MSC 2010 subject classifications: Primary 62K05, 90C25; secondary 41A10, 49M29, 90C90, 15A15. Keywords and phrases: Experimental Design, Semidefinite Programming, Christoffel Polynomial, Linear Model, Equivalence Theorem. 1. Introduction 1.1. Convex design theory The optimal experimental designs are computational and theoretical objects that aim at minimizing the uncertainty contained in the best linear unbiased estimators in regression problems. In this frame, the experimenter models the responses z1 , . . . , zN of a random experiment whose inputs are represented by a vector ti ∈ Rn with respect to known regression functions f1 , . . . , fp , namely zi = p X θj fj (ti ) + εi , i = 1, . . . , N, j=1 where θ1 , . . . , θp are unknown parameters that the experimenter wants to estimate, εi , i = 1, . . . , N are i.i.d. centered square integrable random variables and the inputs ti are chosen by the experimenter in a design space X ⊆ Rn . In this paper, we consider that the regression functions F are multivariate polynomials of degree at most d. Assume that the inputs ti , for i = 1, . . . , N , are chosen within a set of distinct points x1 , . . . , x` with ` ≤ N , and let nk denote the number of times the particular point xk occurs among t1 , . . . , tN . This would be summarized by defining a design ξ as follows   x1 · · · x` ξ := , (1) n1 · · · nN` N whose first row gives distinct points in the design space X where the inputs parameters have to be taken and the second row indicates the experimenter which proportion of experiments 1 imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 De Castro, Gamboa, Henrion, Hess and Lasserre/1 INTRODUCTION 2 (frequencies) have to be done at these points. We refer to the inspiring book of Dette and Studden [3] and references therein for a complete overview on the subject of the theory of optimal design of experiments. We denote the information matrix of ξ by M(ξ) := ` X wi F(xi ) F>(xi ), (2) i=1 where F := (f1 , . . . , fp ) is the column vector of regression functions and wi := ni /N is the weight corresponding to the point xi . In the following, we will not not distinguish between a design ξ as in (1) and a discrete probability measure on X with finite support given by the points xi and weights wi . Observe that the information matrix belongs to S+ p , the space of symmetric nonnegative definite matrices of size p. For all q ∈ [−∞, 1] define the function  + Sp → R φq := M 7→ φq (M ) where for positive definite matrices M  1 q 1/q if q 6= −∞, 0  ( p trace(M )) φq (M ) := det(M )1/p if q = 0  λmin (M ) if q = −∞ and for nonnegative definite matrices M  1 ( p trace(M q ))1/q if q ∈ (0, 1] φq (M ) := 0 if q ∈ [−∞, 0]. We recall that trace(M ), det(M ) and λmin (M ) denote respectively the trace, determinant and least eigenvalue of the symmetric nonnegative definite matrix M . These criteria are meant to be real valued, positively homogeneous, non constant, upper semi-continuous, isotonic (with respect to the Loewner ordering) and concave functions. Hence, an optimal design is a solution ξ ? to the following problem max φq (M(ξ)) (3) where the maximum is taken over all ξ of the form (1). Standard criteria are given by the parameters q = 0, −1, −∞ and are referred to D, A or E-optimum designs respectively. As detailed in Section 3.2, we restrict our attention to “approximate” optimal designs where, by definition, we replace the set of “feasible” matrices {M(ξ) : ξ of the form (1)} by the larger set of all possible information matrices, namely the convex hull of {F(x) F>(x) : x ∈ X }. To construct approximate optimal designs, we propose a two-step procedure presented in Algorithm 1. This procedure finds the information matrix M? of the approximate optimal design ξ ? and then it computes the support points x?i and the weights wi? of the design ξ ? in a second step. 1.2. Contribution This paper introduces a general method to compute approximate optimal designs—in the sense of Kiefer’s φq -criteria—on a large variety of design spaces that we refer to as semi-algebraic imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 1 INTRODUCTION 3 Algorithm 1: Approximate Optimal Designs on Semi-Algebraic Sets Data: A compact semi-algebraic design space X defined as in (4). Result: An approximate optimal design ξ 1. Choose the two relaxation orders δ and r. 2. Solve the SDP relaxation (7) of order δ for a vector yδ? . 3. Either solve Nie’s SDP relaxation (28) or the Christoffel polynomial SDP relaxation (30) of order r for a vector yr? . 4. If yr? satisfies the rank condition (29), then extract the optimal design ξ from the truncated moment sequence as explained in Section 5. 5. Otherwise, choose larger values of δ and r and go to Step 2. sets, see [8] or Section 2 for a definition. These can be understood as sets given by intersections and complements of superlevel sets of multivariate polynomials. An important distinguishing feature of the method is to not rely on any discretization of the design space which is in contrast to computational methods in previous works, e.g., the algorithms described in [23, 21]. We apply the moment-sum-of-squares hierarchy—referred to as the Lasserre hierarchy—of SDP problems to solve numerically and approximately the optimal design problem. More precisely, we use an outer “approximation” (in the SDP relaxation sense) of the set of moments of order d, see Section 2.2 for more details. Note that these approximations are SDP representable so that they can be efficiently encoded numerically. Since the regressors are polynomials, the information matrix M is a linear function of the moment matrix (of order d). Hence, our approach gives an outer approximation of the set of information matrices, which is SDP representable. As shown by the interesting works [20, 18], the criterion φq is also SDP representable in the case where q is rational. It proves that our procedure (depicted in Algorithm 1) makes use of two semidefinite programs and it can be efficiently used in practice. Note that similar two steps procedures have been presented in the literature, the reader may consult the interesting paper [4] which proposes a way of constructing approximate optimal designs on the hypercube. The theoretical guarantees are given by Theorem 3 (Equivalence theorem revisited for the finite order hierarchy) and Theorem 4 (convergence of the hierarchy as the order increases). These theorems demonstrate the convergence of our procedure towards the approximate optimal designs as the order of the hierarchy increases. Furthermore, they give a characterization of finite order convergence of the hierarchy. In particular, our method recovers the optimal design when finite convergence of this hierarchy occurs. To recover the geometry of the design we use SDP duality theory and Christoffel polynomials involved in the optimality conditions. We have run several numerical experiments for which finite convergence holds leading to a surprisingly fast and reliable method to compute optimal designs. As illustrated by our examples, in polynomial regression model with degree order higher than one we obtain designs with points in the interior of the domain. 1.3. Outline of the paper In Section 2, after introducing necessary notation, we shortly explain some basics on moments and moment matrices, and present the approximation of the moment cone via the Lasserre hierarchy. Section 3 is dedicated to further describing optimal designs and their approximations. De Castro, Gamboa, Henrion, Hess and Lasserre/2 POLYNOMIAL OPTIMAL DESIGNS 4 At the end of the section we propose a two step procedure to solve the approximate design problem, it is described in Algorithm 1. Solving the first step is subject to Section 4. There, we find a sequence of moments y? associated with the optimal design measure. Recovering this measure (step two of the procedure) is discussed in Section 5. We finish the paper with some illustrating examples and a short conclusion. 2. Polynomial optimal designs and moments This section collects preliminary material on semi-algebraic sets, moments and moment matrices, using the notation of [8]. This material will be used to restrict our attention to polynomial optimal design problems with polynomial regression functions and semi-algebraic design spaces. 2.1. Polynomial optimal design Denote by R[x] the vector space of real polynomials in the variables x = (x1 , . . . , xn ), and for d ∈ N define R[x]d := {p ∈ R[x] : deg p ≤ d} where deg p denotes the total degree of p. We assume that the regression functions are multivariate polynomials, namely F = (f1 , . . . , fp ) ∈ (R[x]d )p . Moreover, we consider that the design space X ⊂ Rn is a given closed basic semi-algebraic set (4) X := {x ∈ Rm : gj (x) > 0, j = 1, . . . , m} for given polynomials gj ∈ R[x], j = 1, . . . , m, whose degrees are denoted by dj , j = 1, . . . , m. Assume that X is compact with an algebraic certificate of compactness. For example, one of P the polynomial inequalities gj (x) > 0 should be of the form R2 − ni=1 x2i > 0 for a sufficiently large constant R. Notice that those assumptions cover a large class of problems in optimal design theory, see for instance [3, Chapter 5]. In particular, observe that the design space X defined by (4) is not necessarily convex and note that the polynomial regressors F can handle incomplete m-way dth degree polynomial regression. The monomials xα1 1 · · · xαnn , with α = (α1 , . . . , αn ) ∈ Nn , form a basis of the vector space R[x]. We use the multi-index notation xα := xα1 1 · · · xαnn to denote these monomials. In the  same way, for a given d ∈ N the vector space R[x]d has dimension s(d) := n+d with basis n α (x )|α|≤d , where |α| := α1 + · · · + αn . We write vd (x) := ( |{z} 1 , x1 , . . . , xn , x21 , x1 x2 , . . . , x1 xn , x22 , . . . , x2n , . . . , . . . , xd1 , . . . , xdn )> | {z } | {z } | {z } degree 0 degree 1 degree 2 degree d for the column vector of the monomials ordered according to their degree, and where monomials of the same degree are ordered with respect to the  lexicographic ordering. Note that, by linearity, there exists a unique matrix A of size p × n+d such that n ∀x ∈ X , F(x) = A vd (x) . (5) The cone M+ (X ) of nonnegative Borel measures supported on X is understood as the dual to the cone of nonnegative elements of the space C (X ) of continuous functions on X . imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 5 2 POLYNOMIAL OPTIMAL DESIGNS 2.2. Moments, the moment cone and the moment matrix Given a positive measure µ ∈ M+ (X ) and α ∈ Nn , we call Z xα dµ yα = X the moment of order α of µ. Accordingly, we call the sequence y = (yα )α∈Nn the moment sequence of µ. Conversely, we say that y = (yα )α∈Nn has a representing measure, if there exists a measure µ such that y is its moment sequence. We denote by Md (X ) the convex cone of all truncated sequences y = (yα )|α|≤d which have a representing measure supported on X . We call it the moment cone (of order d) of X . It can be expressed as n n+d Md (X ) := y ∈ R( n ) :∃ µ ∈ M+ (X ) s.t. (6) Z o yα = xα dµ, ∀α ∈ Nn , |α| ≤ d . X Let Pd (X ) denotes the convex cone of all polynomials of degree at most d that are nonnegative on X . Note that we assimilate polynomials p of degree at most d with a vector of dimension s(d), which contains the coefficients of p in the chosen basis. When X is a compact set, then Md (X ) = Pd (X )? and Pd (X ) = Md (X )? , see e.g., [9, Lemma 2.5] or [7]. When the design space is given by the univariate interval X = [a, b], i.e., n = 1, then this cone is representable using positive semidefinite Hankel matrices, which implies that convex optimization on this cone can be carried out with efficient interior point algorithms for semidefinite programming, see e.g., [24]. Unfortunately, in the general case, there is no efficient representation of this cone. It has actually been shown in [22] that the moment cone is not semidefinite representable, i.e., it cannot be expressed as the projection of a linear section of the cone of positive semidefinite matrices. However, we can use semidefinite approximations of this cone as discussed in Section 2.3. n we define the linear functional Ly : R[x] → R Given a real valued sequence Py = (yα )α∈N α which maps a polynomial f = α∈Nn fα x to Ly (f ) = X fα yα . α∈Nn A sequence y = (yα )α∈Nn has a representing measure µ supported on X if and only if Ly (f ) > 0 for all polynomials f ∈ R[x] nonnegative on X [8, Theorem 3.1].   The moment matrix of a truncated sequence y = (yα )|α|≤2d is the n+d × n+d n n -matrix Md (y) with rows and columns respectively indexed by integer n-tuples α ∈ Nn , |α|, |β| ≤ d and whose entries are given by Md (y)(α, β) = Ly (xα xβ ) = yα+β . It is symmetric (Md (y)(α, β) = Md (y)(β, α)), and linear in y. Further, if y has a representing measure, then Md (y) is positive semidefinite (written Md (y) < 0). De Castro, Gamboa, Henrion, Hess and Lasserre/2 POLYNOMIAL OPTIMAL DESIGNS 6 P α Similarly, we define the localizing matrix of a polynomial f = |α|≤r fα x ∈ R[x]r of   degree r and a sequence y = (yα )|α|≤2d+r as the n+d × n+d matrix Md (f y) with rows and n n n columns respectively indexed by α, β ∈ N , |α|, |β| ≤ d and whose entries are given by X fγ yγ+α+β . Md (f y)(α, β) = Ly (f (x) xα xβ ) = γ∈Nn If y has a representing measure µ, then Md (f y) < 0 for f ∈ R[x]d whenever the support of µ is contained in the set {x ∈ Rn : f (x) > 0}. Since X is basic semi-algebraic with a certificate of compactness, by Putinar’s theorem—see for instance the book [8, Theorem 3.8], we also know the converse statement in the infinite case. Namely, it holds that y = (yα )α∈Nn has a representing measure µ ∈ M+ (X ) if and only if for all d ∈ N the matrices Md (y) and Md (gj y), j = 1, . . . , m, are positive semidefinite. 2.3. Approximations of the moment cone Letting vj := ddj /2e, j = 1, . . . , m, denote half the degree of the gj , by Putinar’s theorem, we can approximate the moment cone M2d (X ) by the following semidefinite representable cones for δ ∈ N: n n+2d n+2(d+δ) MSDP (X ) := yd,δ ∈ R( n ) : ∃yδ ∈ R( n ) such that (7) 2(d+δ) yd,δ = (yδ,α )|α|≤2d and o Md+δ (yδ ) < 0, Md+δ−vj (gj yδ ) < 0, j = 1, . . . , m . By semidefinite representable we mean that the cones are projections of linear sections of semidefinite cones. Since M2d (X ) is contained in every (MSDP 2(d+δ) (X ))δ∈N , they are outer approximations of the moment cone. Moreover, they form a nested sequence, so we can build the hierarchy SDP SDP M2d (X ) ⊆ · · · ⊆ MSDP 2(d+2) (X ) ⊆ M2(d+1) (X ) ⊆ M2d (X ). (8) T SDP This hierarchy actually converges, meaning M2d (X ) = ∞ δ=0 M2(d+δ) (X ), where A denotes the topological closure of the set A. Further, let Σ[x]2d ⊆ R[x]2d be the set of all polynomials that are P sums of squares of polynomials (SOS) of degree at most 2d, i.e., Σ[x]2d = {σ ∈ R[x] : σ(x) = ki=1 hi (x)2 for some hi ∈ R[x]d and some k ≥ 1}. The topological dual of MSDP 2(d+δ) (X ) is a quadratic module, which we SOS denote by P2(d+δ) (X ). It is given by SOS P2(d+δ) (X ) m n X := h = σ0 + gj σj : deg(h) ≤ 2d, (9) j=1 o σ0 ∈ Σ[x]2(d+δ) , σj ∈ Σ[x]2(d+δ−νj ) , j = 1, . . . , m . SOS (X ) if and only if h has degree Equivalently, see for instance [8, Proposition 2.1], h ∈ P2(d+δ) less than 2d and there exist real symmetric and positive semidefinite matrices Q0 and Qj , j = imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 3 APPROXIMATE OPTIMAL DESIGN    j 1, . . . , m of size n+d+δ × n+d+δ and n+d+δ−ν × n n n x ∈ Rn h(x) = σ0 (x) + m X 7 n+d+δ−νj n  respectively, such that for any gj (x)σj (x) j=1 m X = vd+δ (x)> Q0 vd+δ (x) + gj (x) vd+δ−νj (x)> Qj vd+δ−νj (x) . j=1 SOS (X ) are polynomials of degree at most 2d which are non-negative on X . The elements of P2(d+δ) Hence, it is a subset of P2d (X ). 3. Approximate Optimal Design 3.1. Problem reformulation in the multivariate polynomial case P For all i = 1, . . . , p and x ∈ X , let fi (x) := |α|≤d ai,α xα with appropriate ai,α ∈ R and note that A = (ai,α ) where A is defined by (5). For µ ∈ M+ (X ) with moment sequence y define the information matrix Z   X  X fi fj dµ Md (y) := = ai,α aj,β yα+β = Aγ yγ , 1≤i,j≤p X where we have set Aγ := P α+β=γ 1≤i,j≤p |α|,|β|≤d ai,α aj,β  1≤i,j≤p |γ|≤2d for |γ| ≤ 2d. Observe that it holds Md (y) = AMd (y)A> . (10) P If y is the moment sequence of µ = `i=1 wi δxi , where δx denotes the Dirac measure at the point x ∈ P X and the wi are again the weights corresponding to the points xi . Observe that Md (y) = `i=1 wi F(xi )F> (xi ) as in (2). Consider the optimization problem (11) max φq (M ) s.t. M = X Aγ yγ < 0, yγ = |γ|≤2d ` X ni i=1 N xγi , ` X ni = N, i=1 xi ∈ X , ni ∈ N, i = 1, . . . , `, where the maximization is with respect to xi and ni , i = 1, . . . , `, subject to the constraint that the information matrix M is positive semidefinite. By construction, it is equivalent to the original design problem (3). In this form, Problem (11) is difficult because of the integrality constraints on the ni and the nonlinear relation between y, xi and ni . We will address these difficulties in the sequel by first relaxing the integrality constraints. De Castro, Gamboa, Henrion, Hess and Lasserre/3 APPROXIMATE OPTIMAL DESIGN 8 3.2. Relaxing the integrality constraints In Problem (11), the set of admissible frequencies wi = ni /N is discrete, which makes it a potentially difficult combinatorial optimization problem. A popular solution is then to consider “approximate” designs defined by   x1 · · · x` ξ := , (12) w1 · · · w` P where the frequencies wi belong to the unit simplex W := {w ∈ R` : 0 ≤ wi ≤ 1, `i=1 wi = 1}. Accordingly, any solution to Problem (3), where the maximum is taken over all matrices of type (12), is called “approximate optimal design”, yielding the following relaxation of Problem (11) (13) max φq (M ) s.t. M = X Aγ yγ < 0, yγ = ` X wi xγi , i=1 |γ|≤2d xi ∈ X , w ∈ W, where the maximization is with respect to xi and wi , i = 1, . . . , `, subject to the constraint that the information matrix M is positive semidefinite. In this problem the nonlinear relation between y, xi and wi is still an issue. 3.3. Moment formulation Let us introduce a two-step-procedure to solve the approximate optimal design Problem (13). For this, we first reformulate our problem again. By Carathéodory’s theorem, the subset of moment sequences in the truncated moment cone M2d (X ) defined in (6) and such that y0 = 1, is exactly the set: Z n o n n+2d y ∈ M2d (X ) : y0 = 1 = y ∈ R( n ) : yα = xα dµ ∀|α| ≤ 2d, X µ= ` X o wi δxi , xi ∈ X , w ∈ W , i=1  where ` ≤ n+2d , see the so-called Tchakaloff theorem [8, Theorem B12]. n Hence, Problem (13) is equivalent to max φq (M ) X s.t. M = Aγ yγ < 0, (14) |γ|≤2d y ∈ M2d (X ), y0 = 1, where the maximization is now with respect to the sequence y. Moment problem (14) is finite-dimensional and convex, yet the constraint y ∈ M2d (X ) is difficult to handle. We will show that by approximating the truncated moment cone M2d (X ) by a nested sequence of imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 9 4 APPROXIMATING THE IDEAL PROBLEM semidefinite representable cones as indicated in (8), we obtain a hierarchy of finite dimensional semidefinite programming problems converging to the optimal solution of Problem (14). Since semidefinite programming problems can be solved efficiently, we can compute a numerical solution to Problem (13). This describes step one of our procedure. The result of it is a sequence y? of moments. Consequently, in a second step, we need to find a representing atomic measure µ? of y? in order to identify the approximate optimal design ξ ? . 4. The ideal problem on moments and its approximation For notational simplicity, let us use the standard monomial basis of  R[x]d for the regression functions, meaning F = (f1 , . . . , fp ) := (xα )|α|≤d with p = n+d n . This case corresponds to A = Id in (5). Note that this is not a restriction, since one can get the results for other choices of F by simply performing a change of basis. Indeed, in view of (10), one shall substitute Md (y) by AMd (y)A> to get the statement of our results in whole generality; see Section 4.5 for a statement of the results in this case. Different polynomial bases can be considered and, for instance, one may consult the standard framework described by the book [3, Chapter 5.8]. For the sake of conciseness, we do not expose the notion of incomplete q-way m-th degree polynomial regression here but the reader may remark that the strategy developed in this paper can handle such a framework. Before stating the main results, we recall the gradients of the Kiefer’s φq criteria in Table 1. Name q D-opt. 0 φq (M ) det(M ) p 1 ∇φq (M ) 1 det(M ) p M 1 −p A-opt −1 E-opt. −∞ p(trace(M −1 ))−1 λmin (M ) p(trace(M −1 )M )−2 Πmin (M ) generic case q 6= 0, −∞ h trace(M q ) i 1 q p h trace(M q ) i 1 −1 M q−1 q p p Table 1 Gradients of the Kiefer’s φq criteria. We recall that Πmin (M ) = uu> /||u||22 is defined only when the least eigenvalue of M has multiplicity one and u denotes a nonzero eigenvector associated to this least eigenvalue. If the least eigenvalue has multiplicity greater than 2, then the sub gradient ∂φq (M ) of λmin (M ) is the set of all projectors on subspaces of the eigenspace associated to λmin (M ), see for example [13]. Notice further that φq is upper semi-continuous and is a positively homogeneous function 4.1. The ideal problem on moments The ideal formulation (14) of our approximate optimal design problem reads ρ = max φq (Md (y)) (15) y s.t. y ∈ M2d (X ), y0 = 1. For this we have the following standard result. Theorem 1 (Equivalence theorem). Let q ∈ (−∞, 1) and X ⊆ Rn be a compact semi-algebraic set as defined in (4) and with nonempty interior. Problem (15) is a convex optimization problem with a unique optimal solution y? ∈ M2d (X ). Denote by p?d the polynomial x 7→ p?d (x) := vd (x)> Md (y? )q−1 vd (x) = ||Md (y? ) q−1 2 vd (x)||22 . (16) De Castro, Gamboa, Henrion, Hess and Lasserre/4 APPROXIMATING THE IDEAL PROBLEM 10 Then y? is the vector of moments—up to order 2d—of a discrete measure µ? supported on at  n+d n+2d least n and at most points in the set n n o Ω := x ∈ X : trace(Md (y? )q ) − p?d (x) = 0 , In particular, the following statements are equivalent: ◦ y? ∈ n M2d (X ) is the unique o solution to Problem (15); ? ◦ y ∈ y ∈ M2d (X ) : y0 = 1 and p? :=trace(Md (y? )q ) − p?d > 0 on X . Proof. A general equivalence theorem for concave functionals of the information matrix is stated and proved in [6, Theorem 1]. The case of φq -criteria is tackled in [19] and [3, Theorem 5.4.7]. In order to be self-contained and because the proof of our Theorem 3 follows the same road map we recall a sketch of the proof in Appendix A. Remark 1 (On the optimal dual polynomial). The polynomial p?d contains concerning the optimal design. Indeed, its level set Ω supports the optimal polynomial is related to the so-called Christoffel function (see Section 4.2). the sequel p?d in (16) will be called a Christoffel polynomial. Notice further n o X ⊂ p?d ≤ trace(Md (y? )q ) . all the information design points. The For this reason, in that Hence, the optimal design problem related to φq is similar to the standard problem of computational geometry consisting in minimizing the volume of a polynomial level set containing X (Löwner-John’s ellipsoid theorem). Here, the volume functional is replaced by φq (M ) for the q−1 polynomial ||M 2 vd (x)||22 . We refer to [9] for a discussion and generalizations of Löwner-John’s ellipsoid theorem for general homogenous polynomials on non convex domains. Remark 2 (Equivalence theorem for E-optimality). Theorem 1 holds also for q = −∞. This is the E-optimal design case, in which the objective function is not differentiable at points for which the least eigenvalue has multiplicity greater than 2. We get that y? is the vector of moments—up to order 2d—of a discrete measure µ? supported on at most n+2d points in the n set n 2 X o Ω := x ∈ X : λmin (Md (y? ))||u||22 − uα xα = 0 , α where u = (uα )|α|≤2d is a nonzero eigenvector of Md (y? ) associated to λmin (Md (y? )). In particular, the following statements are equivalent ◦ y? ∈ M2d (X ) is a solution to Problem (15); ◦ y? ∈ {y ∈ M2d (X ) : y0 = 1} and for all x ∈ X , P α α uα x 2 ≤ λmin (Md (y? ))||u||22 . Furthermore, if the least eigenvalue of Md (y? ) has multiplicity one then y? ∈ M2d (X ) is unique. 4.2. Christoffel polynomials In the case of D-optimality, it turns out that the unique optimal solution y? ∈ M2d (X ) of Problem (14) can be characterized in terms of the Christoffel polynomial of degree 2d associated imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 11 4 APPROXIMATING THE IDEAL PROBLEM with an optimal measure µ whose moments up to order 2d coincide with y? . Notice that in the paradigm of optimal design the Christoffel polynomial is the variance function of the multivariate polynomial regression model. Given a design, it is the variance of the predicted value of the model and so quantifies locally the uncertainty of the estimated response. We refer to [2] for its earlier introduction and the chapter [19, Chapter 15] for an overview of its properties and uses. n+2d Definition 2 (Christoffel polynomial). Let y ∈ R( n ) be such that Md (y)  0. Then there exists a family of orthonormal polynomials (Pα )|α|≤d ⊆ R[x]d satisfying Ly (Pα Pβ ) = δα=β and Ly (xα Pβ ) = 0 ∀α ≺ β, where monomials are ordered with respect to the lexicographical ordering on Nn . We call the polynomial X pd : x 7→ pd (x) := Pα (x)2 , x ∈ Rn , |α|≤d the Christoffel polynomial (of degree d) associated with y. The Christoffel polynomial1 can be expressed in different ways. For instance via the inverse of the moment matrix by pd (x) = vd (x)> Md (y)−1 vd (x), ∀x ∈ Rn , or via its extremal property 1 = pd (t) min P ∈R[x]d nZ o P (x)2 dµ(x) : P (t) = 1 , ∀t ∈ Rn , when y Rhas a representing measure µ—when y does not have a representing measure µ just replace P (x)2 dµ(x) with Ly (P 2 ) (= P > Md (y) P ). For more details the interested reader is referred to [11] and the references therein. Notice also that there is a regain of interest in the asymptotic study of the Christoffel function as it relies on eigenvalue marginal distributions of invariant random matrix ensembles, see for example [12]. Remark 3 (Equivalence theorem for D-optimality). In the case of D-optimal designs, observe that   n+d ? ? t := max pd (x) = trace(Id) = , x∈X n where p?d given by (16) for q = 0. Furthermore, note that p?d is the Christoffel polynomial of degree d of the D-optimal measure µ? . 4.3. The SDP relaxation scheme Let X ⊆ Rn be as defined in (4), assumed to be compact. So with no loss of generality (and possibly after scaling), assume that x 7→ g1 (x) = 1 − kxk2 > 0 is one of the constraints defining X . 1 Actually, what is referred to the Christoffel function in the literature is its reciprocal x 7→ 1/pd (x). In optimal design, the Christoffel function is also called sensitivity function or information surface [19]. De Castro, Gamboa, Henrion, Hess and Lasserre/4 APPROXIMATING THE IDEAL PROBLEM 12 Since the ideal moment Problem (15) involves the moment cone M2d (X ) which is not SDP representable, we use the hierarchy (8) of outer approximations of the moment cone to relax Problem (15) to an SDP problem. So for a fixed integer δ ≥ 1 we consider the problem ρδ = max φq (Md (y)) (17) y s.t. y ∈ MSDP 2(d+δ) (X ), y0 = 1. Since Problem (17) is a relaxation of the ideal Problem (15), necessarily ρδ ≥ ρ for all δ. In analogy with Theorem 1 we have the following result characterizing the solutions of the SDP relaxation (17) by means of Sum-of-Squares (SOS) polynomials. Theorem 3 (Equivalence theorem for SDP relaxations). Let q ∈ (−∞, 1) and let X ⊆ Rn be a compact semi-algebraic set as defined in (4) and be with non-empty interior. Then, n+2d a) SDP Problem (17) has a unique optimal solution y? ∈ R( n ) . b) The moment matrix Md (y? ) is positive definite. Let p?d be as defined in (16), associated with y? . Then p? := trace(Md (y? )q ) − p?d is non-negative on X and Ly? (p? ) = 0. In particular, the following statements are equivalent: ◦ y? ∈ MSDP 2(d+δ) (X ) is the unique solution to Problem (17); ? ? ? q ? SOS ◦ y ∈ {y ∈ MSDP 2(d+δ) (X ) : y0 = 1} and p = trace(Md (y ) ) − pd ∈ P2(d+δ) (X ). Proof. We follow the same roadmap as in the proof of Theorem 1. a) Let us prove that Problem (17) has an optimal solution. The feasible set is nonempty with finite associated value, since we can take as feasible point the vector ỹ associated with the Lebesgue measure on X , scaled to be a probability measure. n+2d n+2(d+δ) Let y ∈ R( n ) be an arbitrary feasible solution and yδ ∈ R( n ) an arbitrary lifting 2 of y—recall the definition of MSDP 2(d+δ) (X ) given in (7). Recall that g1 (x) = 1 − kxk . As 2 Md+δ−1 (g1 y)  0 one deduces that Lyδ (x2t i (1 − kxk )) ≥ 0 for every P i = 1, . . . , n, and all t ≤ d + δ − 1. Expanding and using linearity of Ly yields 1 ≥ nj=1 Lyδ (x2j ) ≥ Lyδ (x2i ) for t = 0 and i = 1, . . . , n. Next for t = 1 and i = 1, . . . , n, 0 ≤ Lyδ (x2i (1 − kxk2 )) = Lyδ (x2i ) −Lyδ (x4i ) − | {z } ≤1 n X Lyδ (x2i x2j ), | {z } j6=i ≥0 yields Lyδ (x4i ) ≤ 1. We may iterate this argumentation until we finally obtain Lyδ (x2d+2δ ) ≤ 1, for all i = 1, . . . , n. Therefore by [10, Lemma 4.3, page 110] (or i [8, Proposition 3.6, page 60]) one has n o 2(d+δ) |yδ,α | ≤ max yδ,0 , max{Lyδ (xi )} ≤ 1 ∀|α| ≤ 2(d + δ). (18) i |{z} =1 This implies that the set of feasible liftings yδ is compact, and therefore, the feasible set of (17) is also compact. As the function φq is upper semi-continuous, the supremum in (17) is attained at some optimal solution y? ∈ Rs(2d) . It is unique due to convexity of the feasible set and strict concavity of the objective function φq , e.g., see [19, Chapter 6.13] for a proof. imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 13 4 APPROXIMATING THE IDEAL PROBLEM b) Let Bα , B̃α and Cjα be real symmetric matrices such that X Bα xα = vd (x) vd (x)> |α|≤2d X B̃α xα = v(x)d+δ vd+δ (x)> |α|≤2(d+δ) X Cjα xα = gj (x) vd+δ−vj (x) vd+δ−vj (x)> , j = 1, . . . , m. |α|≤2(d+δ) Recall that it holds X Bα yα = Md (y) . |α|≤2d First, we notice that there exists a strictly feasible solution to (17) because the cone MSDP 2(d+δ) (X ) has nonempty interior as a supercone of M2d (X ), which has nonempty interior by [9, Lemma 2.6]. Hence, Slater’s condition2 holds for (17). Further, by an argument in [19, Chapter 7.13]) the matrix Md (y? ) is non-singular. Therefore, φq is differentiable at y? . Since additionally Slater’s condition is fulfilled and φq is concave, this implies that the Karush-Kuhn-Tucker (KKT) optimality conditions3 at y? are necessary and sufficient for y? to be an optimal solution. The KKT-optimality conditions at y? read λ? e0 − ∇φq (Md (y? )) = p̂? SOS with p̂? (x) := hp̂? , v2d (x)i ∈ P2(d+δ) (X ), where p̂? ∈ Rs(2d) , e0 = (1, 0, . . . , 0), and λ? is the dual variable associated with the constraint y0 = 1. The complementarity condition reads hy? , p̂? i = 0. SOS (X ), we can express the Recalling the definition (9) of the quadratic module P2(d+δ) SOS (X ) more explicitly in terms of some “dual variables” Λ < 0, membership p̂? (x) ∈ P2(d+δ) j j = 0, . . . , m, m X 1α=0 λ − h∇φq (Md (y )), Bα i = hΛ0 , B̃α i + hΛj , Cjα i, ? ? |α| ≤ 2(d + δ), (19) j=1 n+2(d+δ) n Then, for a lifting yδ? ∈ R( hMd+δ (yδ? ), Λ0 i = 0; ) of y? the complementary condition hy? , p̂? i = 0 reads hMd+δ−vj (yδ? gj ), Λj i = 0, j = 1, . . . , m. (20) ? , summing up and using the complementarity conditions (20) yields Multiplying by yδ,α λ? − h∇φq (Md (y? )), Md (y? )i = hΛ0 , Md+δ (yδ? )i + | {z } =0 m X hΛj , Md+δ−vj (gj yδ? )i . | {z } j=1 (21) =0 2 For the optimization problem max {f (x) : Ax = b; x ∈ C}, where A ∈ Rm×n and C ⊆ Rn is a nonempty closed convex cone, Slater’s condition holds, if there exists a feasible solution x in the interior of C. 3 For the optimization problem max {f (x) : Ax = b; x ∈ C}, where f is differentiable, A ∈ Rm×n and C ⊆ Rn is a nonempty closed convex cone, the KKT-optimality conditions at a feasible point x state that there exist λ? ∈ Rm and u? ∈ C? such that A> λ? − ∇f (x) = u? and hx, u? i = 0. De Castro, Gamboa, Henrion, Hess and Lasserre/4 APPROXIMATING THE IDEAL PROBLEM 14 We deduce that ? ? ? λ? = h∇φq (Md (yd,δ )), Md (yd,δ )i = φq (Md (yd,δ )) (22) by the Euler formula for homogeneous functions. Similarly, multiplying by xα and summing up yields λ? − vd (x)> ∇φq (Md (y? ))vd (x) m D D E X X = Λ0 , B̃α xα + Λj , |α|≤2(d+δ) j=1 X Cjα xα E |α|≤2(d+δ−vj ) m X D E D E gj (x) Λj , vd+δ−vj (x) vd+δ−vj (x)> = Λ0 , v(x)d+δ vd+δ (x)> + | {z } j=1 {z } | σ0 (x) = σ0 (x) + n X σj (x) σj (x) gj (x) j=1 (23) SOS = p̂? (x) ∈ P2(d+δ) (X ). Note that σ0 ∈ Σ[x]2(d+δ) and σj ∈ Σ[x]2(d+δ−dj ) , j = 1, . . . , m, by definition. i1− 1 h n+d−1 q ? )q ) For q 6= 0 let c? := n+d . As Md (y? ) is positive semidefinite trace(M (y d n n and non-singular, we have c? > 0. If q = 0, let c? := 1 and replace φ0 (Md (y? )) by log det Md (y? ), for which the gradient is Md (y? )−1 . Using Table 1 we find that c? ∇φq (Md (y? )) = Md (y? )q−1 . It follows that (22) c? λ? = c? h∇φq (Md (y? )), Md (y? )i = trace(Md (y? )q ) (16) and c? h∇φq (Md (y? )), vd (x)vd (x)> i = p?d (x) SOS (X ). To summarize, Therefore, Eq. (23) is equivalent to p? := c? p̂? = c? λ? − p?d ∈ P2(d+δ) SOS p? (x) = trace(Md (y? )q ) − p?d (x) ∈ P2(d+δ) (X ). SOS (X ) are non-negative on X and that (21) implies We remark that all elements of P2(d+δ) ? Ly? (p ) = 0. Hence, we have shown b). The equivalence follows from the argumentation in b). Remark 4 (Finite convergence). If the optimal solution y? of Problem (17) is coming from a measure µ? on X , that is y? ∈ M2d (X ), then ρδ = ρ and y? is the unique optimal solution of Problem (15). In addition, by the proof of Theorem 1, µ? can be chosen to be atomic and  n+d supported on at least n and at most n+2d “contact points” on the level set Ω := {x ∈ X : n ? q ? trace(Md (y ) ) − pd (x) = 0}. imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 15 4 APPROXIMATING THE IDEAL PROBLEM Remark 5 (SDP relaxation for E-optimality). Theorem 3 holds also for q = −∞. This is the E-optimal design case, in which the objective function is not differentiable at points for which the least eigenvalue has multiplicity greater than 2. We get that y? satisfies λmin (Md (y? )) −   P P α 2) = λ α 2 > 0 for all x ∈ X and L ? ( ? y min (Md (y )), where u = (uα )|α|≤2d α uα x α uα x is a nonzero eigenvector of Md (y? ) associated to λmin (Md (y? )). In particular, the following statements are equivalent ◦ y? ∈ MSDP 2(d+δ) (X ) is a solution to Problem (17); ? ? 2 ◦ y? ∈ {y ∈ MSDP 2(d+δ) (X ) : y0 = 1} and p (x) = λmin (Md (y ))||u||2 − P α α uα x 2 ∈ SOS (X ). P2(d+δ) Furthermore, if the least eigenvalue of Md (y? ) has multiplicity one then y? is unique. 4.4. Asymptotics We now analyze what happens when δ tends to infinity. ? be an optimal Theorem 4. Let q ∈ (−∞, 1) and d ∈ N. For every δ = 0, 1, 2, . . . , let yd,δ ? ? defined in solution to (17) and pd,δ ∈ R[x]2d the Christoffel polynomial associated with yd,δ Theorem 3. Then, a) ρδ → ρ as δ → ∞, where ρ is the supremum in (15). ? b) For every α ∈ Nn with |α| ≤ 2d, we have limδ→∞ yd,δ,α = yα? , where y? = (yα? )|α|≤2d ∈ M2d (X ) is the unique optimal solution to (15). c) p?d,δ → p?d as δ → ∞, where p?d is the Christoffel polynomial associated with y? defined in (16). SOS (X ) d) If the dual polynomial p? := trace(Md (y? )q ) − p?d to Problem (15) belongs to P2(d+δ) ? for some δ, then finite convergence takes place, that is, yd,δ is the unique optimal solution ? has a representing measure, namely the target measure µ? . to Problem (15) and yd,δ Proof. We prove the four claims consecutively. n+2(d+δ) a) For every δ complete the lifted finite sequence yδ? ∈ R( n ) with zeros to make it ? ) ? an infinite sequence yδ? = (yδ,α α∈Nn . Therefore, every such yδ can be identified with an element of `∞ , the Banach space of finite bounded sequences equipped with the supremum norm. Moreover, Inequality (18) holds for every yδ? . Thus, denoting by B the unit ball of `∞ which is compact in the σ(`∞ , `1 ) weak-? topology on `∞ , we have yδ? ∈ B. By Banach-Alaoglu’s theorem, there is an element ŷ ∈ B and a converging subsequence (δk )k∈N such that lim yδ?k ,α = ŷα ∀α ∈ Nn . (24) k→∞ Let s ∈ N be arbitrary, but fixed. By the convergence (24) we also have lim Ms (yδ?k ) = Ms (ŷ) < 0; k→∞ lim Ms (gj yδ?k ) = Ms (gj ŷ) < 0, j = 1, . . . , m. k→∞ ? = (y ? ) Notice that the subvectors yd,δ δ,α |α|≤2d with δ = 0, 1, 2, . . . belong to a compact ? set. Therefore, since φq (Md (yd,δ )) < ∞ for every δ, we also have φq (Md (ŷ)) < ∞. De Castro, Gamboa, Henrion, Hess and Lasserre/4 APPROXIMATING THE IDEAL PROBLEM 16 Next, by Putinar’s theorem [8, Theorem 3.8], ŷ is the sequence of moments of some measure µ̂ ∈ M+ (X ), and so ŷd = (ŷα )|α|≤2d is a feasible solution to (15), meaning ρ ≥ φq (Md (ŷd )). On the other hand, as (17) is a relaxation of (15), we have ρ ≤ ρδk for all δk . So the convergence (24) yields ρ ≤ lim ρδk = φq (Md (ŷd )), k→∞ which proves that ŷ is an optimal solution to (15), and limδ→∞ ρδ = ρ. b) As the optimal solution to (15) is unique, we have y? = ŷd with ŷd defined in the proof ? ) ? n of a) and the whole sequence (yd,δ δ∈N converges to y , that is, for α ∈ N with |α| ≤ 2d fixed ? ? lim yδ,α = lim yδ,α = ŷα = yα? . (25) d,δ→∞ δ→∞ c) It suffices to observe that the coefficients of Christoffel polynomial p?d,δ are continuous ? ? ) functions of the moments (yd,δ,α )|α|≤2d =(yδ,α |α|≤2d . Therefore, by the convergence (25) ? ? ? one has pd,δ → pd where pd ∈ R[x]2d as in Theorem 1. The last point follows directly observing that, in this case, the two Programs (15) and (17) satisfy the same KKT conditions. 4.5. General regression polynomial bases  We return to the general case described by a matrix A of size p × n+d such that the regression n polynomials satisfy F(x) = A vd (x) for all x ∈ X . Without loss of generality, we can assume that the rank of A is p, i.e., the regressors f1 , . . . , fp are linearly independent. Now, the objective function becomes φq (AMd (y)A> ) at point y. Note that the constraints on y are unchanged, i.e., • y ∈ M2d (X ), y0 = 1 in the ideal problem, • y ∈ MSDP 2(d+δ) (X ), y0 = 1 in the SDP relaxation scheme. We recall the notation Md (y) := AMd (y)A> and we get that the KKT conditions are given by ∀x ∈ X , φq (Md (y)) − F(x)> ∇φq (Md (y)) F(x) = p? (x) | {z } proportional to p?d (x) where • p? ∈ M2d (X )? (= P2d (X )) in the ideal problem, ? SOS • p? ∈ MSDP 2(d+δ) (X ) (= P2(d+δ) (X )) in the SDP relaxation scheme. Our analysis leads to the following equivalence results in this case. Proposition 5. Let q ∈ (−∞, 1) and let X ⊆ Rn be a compact semi-algebraic set as defined in (4) and with nonempty interior. Problem (13) is a convex optimization problem with an optimal solution y? ∈ M2d (X ). Denote by p?d the polynomial x 7→ p?d (x) := F(x)> Md (y)q−1 F(x) = ||Md (y) q−1 2 F(x)||22 . (26) Then y? is the vector of moments—up to order 2d—of a discrete measure µ? supported on at least p points and at most s points where    p(p + 1) n + 2d s ≤ min 1 + , 2 n (see Remark 6 ) in the set Ω := {x ∈ X : trace(Md (y)q ) − p?d (x) = 0}. imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 5 RECOVERING THE MEASURE 17 In particular, the following statements are equivalent: ◦ y? ∈ M2d (X ) is the solution to Problem (15); ◦ y? ∈ {y ∈ M2d (X ) : y0 = 1} and p? := trace(Md (y)q ) − p?d (x) > 0 on X . Furthermore, if A has full column rank then y? is unique. The SDP relaxation is given by the program ρδ = max φq (Md (y)) y s.t. y ∈ MSDP 2(d+δ) (X ), y0 = 1, (27) for which it is possible to prove the following result. Proposition 6. Let q ∈ (−∞, 1) and let X ⊆ Rn be a compact semi-algebraic set as defined in (4) and with nonempty interior. Then, n+2d ? ∈ R( n ) . a) SDP Problem (27) has an optimal solution yd,δ ? )q ) − p? (x) > 0 b) Let p?d be as defined in (26), associated with y? . Then p? := trace(Md (yd,δ d ? ? (p ) = 0. on X and Lyd,δ In particular, the following statements are equivalent: ◦ y? ∈ MSDP 2(d+δ) (X ) is a solution to Problem (17); ? ? ? q ? SOS ◦ y ∈ {y ∈ MSDP 2(d+δ) (X ) : y0 = 1} and p = trace(Md (y ) ) − pd ∈P2(d+δ) (X ). Furthermore, if A has full column rank then y? is unique. 5. Recovering the measure By solving step one as explained in Section 4, we obtain a solution y? of SDP Problem (17). As y? ∈MSDP 2(d+δ) (X ), it is likely that it comes from a measure. If this is the case, by Tchakaloff’s theorem, there exists an atomic measure supported on at most s(2d) points having these moments. For computing the atomic measure, we propose two approaches: A first one which follows a procedure by Nie [17], and a second one which uses properties of the Christoffel polynomial associated with y? . These approaches have the benefit that they can numerically certify finite convergence of the hierarchy. 5.1. Via Nie’s method This approach to recover a measure from its moments is based on a formulation proposed by Nie in [17]. Let y? = (yα? )|α|≤2d a finite sequence of moments. For r ∈ N consider the SDP problem min Lyr (fr ) yr s.t. Md+r (yr ) < 0, Md+r−vj (gj yr ) < 0, j = 1, . . . , m, yr,α = yα? , ∀α ∈ Nn , |α| ≤ 2d, (28) De Castro, Gamboa, Henrion, Hess and Lasserre/5 RECOVERING THE MEASURE 18 n+2(d+r) where yr ∈ R( n ) and fr ∈ R[x]2(d+r) is a randomly generated polynomial strictly positive on X , and again vj = ddj /2e, j = 1, . . . , m. We check whether the optimal solution yr? of (28) satisfies the rank condition rank Md+r (yr? ) = rank Md+r−v (yr? ), (29) where v := maxj vj . Indeed if (29) holds then yr? is the sequence of moments (up to order 2r) of a measure supported on X ; see [8, Theorem 3.11, p. 66]. If the test is passed, then we stop, otherwise we increase r by one and repeat the procedure. As y? ∈ M2d (X ), the rank condition (29) is satisfied for a sufficiently large value of r. We extract the support points x1 , . . . , x` ∈ X of the representing atomic measure of yr? , and y? respectively, as described in [8, Section 4.3]. Experience reveals that in most cases it is enough to use the following polynomial X x 7→ fr (x) = x2α = ||vd+r (x)||22 |α|≤d+r instead of using a random positive polynomial on X . In Problem (28) this corresponds to minimizing the trace of Md+r (y)—and so induces an optimal solution y with low rank matrix Md+r (y). 5.2. Via the Christoffel polynomial Another possibility to recover the atomic representing measure of y? is to find the zeros of the polynomial p? (x) = trace(Md (y? )q ) − p?d (x), where p?d is the Christoffel polynomial associated with y? defined in (16), that is, p?d (x) = vd (x)> Md (y? )q−1 vd (x). In other words, we compute the set Ω = {x ∈ X : trace(Md (y? )q ) − p?d (x) = 0}, which due to Theorem 3 is the support of the atomic representing measure. To that end we minimize p? on X . As the polynomial p? is non-negative on X , the minimizers are exactly Ω. For minimizing p? , we use the Lasserre hierarchy of lower bounds, that is, we solve the semidefinite program min Lyr (p? ) yr s.t. Md+r (yr ) < 0, yr,0 = 1, Md+r−vj (gj yr ) < 0, j = 1, . . . , m, (30) n+2(d+r) where yr ∈ R( n ) . Since p?d is associated with the optimal solution to (17) for some given δ ∈ N, by Theorem 3, it satisfies the Putinar certificate (23) of positivity on X . Thus, the value of Problem (30) is zero for all r > δ. Therefore, for every feasible solution yr of (30) one has Lyr (p? ) ≥ 0 (and Lyd? (p? ) = 0 for yd? an optimal solution of (17)). When condition (29) is fulfilled, the optimal solution yr? comes from a measure. We extract the support points x1 , . . . , x` ∈ X of the representing atomic measure of yr? , and y? respectively, as described in [8, Section 4.3]. Alternatively, we can solve the SDP min trace(Md+r (yr )) yr s.t. Lyr (p? ) = 0, Md+r (yr ) < 0, yr,0 = 1, Md+r−vj (gj yr ) < 0, j = 1, . . . , m, (31) imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 19 6 EXAMPLES n+2(d+r) where yr ∈ R( n ) . This problem also searches for a moment sequence of a measure supported on the zero level set of p? . Again, if condition (29) is holds, the finite support can be extracted. 5.3. Calculating the corresponding weights After recovering the support {x1 , . . . , x` } of the atomic representing measure by one of the previously presented methods, we might be interested in also computing the corresponding weights ω1 ,P . . . , ω` . These can be calculated easily R by solving the following linear system of equations: `i=1 ωi xαi = yα? for all |α| ≤ 2d, i.e., X xα µ? (dx) = yα? . 6. Examples We illustrate the procedure on six examples: a univariate one, four examples in the plane and one example on the three-dimensional sphere. We concentrate on D-optimal designs, namely q = 0. All examples are modeled by GloptiPoly 3 [5] and YALMIP [14] and solved by MOSEK 7 [16] or SeDuMi under the MATLAB R2014a environment. We ran the experiments on an HP EliteBook with 16-GB RAM memory and an Intel Core i5-4300U processor. We do not report computation times, since they are negligible for our small examples. 6.1. Univariate unit interval We as design space the interval X = [−1, 1] and on it the polynomial measurements Pd consider j d+1 . To compute the D-optimal design we first j=0 θj x with unknown parameters θ ∈ R solve Problem (17), in other words max log det Md (yδ ) yδ s.t. Md+δ (yδ ) < 0, Md+δ−1 ((1 − kxk2 ) yδ ) < 0, yδ,0 = 1 (32) for yδ ∈ Rs(2(d+δ)) and given regression order d and relaxation order d + δ, and then taking ? ) ? the truncation y? := (yδ,α |α|62d of an optimal solution yδ . For instance, for d = 5 and δ = 0 we obtain the sequence y? ≈ (1, 0, 0.56, 0, 0.45, 0, 0.40, 0, 0.37, 0, 0.36)> . Then, to recover the corresponding atomic measure from the sequence y? we solve the problem min trace Md+r (yr ) y s.t. Md+r (yr ) < 0 Md+r−1 ((1 − x2 )yr ) < 0, ? , yα = yr,α |α| ≤ 2d, (33) and find the points -1, -0.765, -0.285, 0.285, 0.765 and 1 (for d = 5, δ=0, r = 1). As a result, our optimal design is the weighted sum of the Dirac measures supported on these points. The points match with the known analytic solution to the problem, which are the critical points of the Legendre polynomial, see e.g., [3, Theorem 5.5.3, p.162]. In this case, we know explicitly De Castro, Gamboa, Henrion, Hess and Lasserre/6 EXAMPLES 20 the optimal design, its support is located at the roots of the polynomial t → (1 − t2 )Pd0 (t) where Pd0 denotes the derivative of the Legendre polynomial of degree d, and its weights are all equal to 1/(1 + d). Now, observe that the roots of p? have degree 2 in the interior of [−1, 1] (there are d − 1 roots corresponding exactly to the roots of Pd0 ) and degree 1 on the edges (corresponding exactly to the roots of (1 − t2 )). Observe also that p? has degree 2d. We deduce that p? equals t → (1 − t2 )(Pd0 (t))2 up to a multiplicative constant. Calculating the corresponding weights as described in Section 5.3, we find ω1 = · · · = ω6 ≈ 0.166 as prescribed by the theory. Alternatively, we compute the roots of the polynomial x 7→ p? (x) = 6 − p?5 (x), where p?5 is the Christoffel polynomial of degree 2d = 10 on X and find the same points as in the previous approach by solving Problem (31). See Figure 1 for the graph of the Christoffel polynomial of degree 10. y 2.0 1.5 1.0 0.5 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 x Figure 1. Polynomial p? for Example 6.1. We observe that we get less points when using Problem (30) to recover the support for this example. This may occur due to numerical issues. 6.2. Wynn’s polygon As a first two-dimensional example we take the polygon given by the vertices (−1, −1), (−1, 1), (1, −1) and (2, 2), scaled to fit the unit circle, i.e., we consider the design space √ √ √ X = {x ∈ R2 : x1 , x2 > − 14 2, x1 ≤ 13 (x2 + 2), x2 ≤ 31 (x1 + 2), x21 + x22 ≤ 1}. Note that we need the redundant constraint x21 + x22 ≤ 1 in order to have an algebraic certificate of compactness. As before, in order to find the D-optimal measure for the regression, we solve Problems (17) and (28). Let us start by analyzing the results for d = 1 and δ = 3. Solving (17) we obtain y? ∈ R45 which leads to 4 atoms when solving (28) with r = 3. For the latter the moment matrices of order 2 and 3 both have rank 4, so Condition (29) is fulfilled. As expected, the 4 atoms are exactly the vertices of the polygon. imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 21 6 EXAMPLES Again, we could also solve Problem (31) instead of (28) to receive the same atoms. As in the univariate example we get less points when using Problem (30). To be precise, GloptiPoly is not able to extract any solutions for this example. For increasing d, we get an optimal measure with a larger support. For d = 2 we recover 7 points, and 13 for d =3. See Figure 2 for the polygon, the supporting points of the optimal measure and the 2+d p?d for different d. The latter 2 -level set of the Christoffel polynomial  2+d ? demonstrates graphically that the set of zeros of d − pd intersected with X are indeed the atoms of our representing measure. In the picture the size of the support points is chosen with respect to their corresponding weights, i.e., the larger the point, the bigger the respective weight. The numerical values of the support points and their weights computed in the above procedure (and displayed in Figure 2) are listed in Appendix B. To get an idea of how the Christoffel polynomial looks like, we plot in Figure 3 the 3D-plot  of the polynomial −p? = p?d − 2+d . This illustrates very clearly that the zeros of p? on X are 2 the support points of the optimal design. 1 1 0.5 0.5 0.5 x2 x2 x2 1 0 0 0 −0.5 −0.5 0 0.5 −0.5 1 −0.5 0 x1 0.5 −0.5 1 −0.5 0 0.5 1 x1 x1 Figure 2. The polygon (bold black) of Example 6.2, the support of the optimal design measure (red points) where  the size of the points corresponds to the respective weights, and the 2+d -level set of the Christoffel polynomial 2 (thin blue) for d = 1 (left), d = 2 (middle), d = 3 (right) and δ = 3. 0 0 0 -1 -0.5 -1 -2 -1 -3 -2 -1.5 -4 -3 -5 0.8 0.8 0.8 0.6 0.6 0.6 0.4 0.4 x2 0.4 0.2 0.2 0.5 0 -0.2 -0.4 0 -0.5 x1 x2 0.2 0.5 0 -0.2 -0.4 0 -0.5 x1 x2 0.5 0 -0.2 -0.4 0 -0.5 x1  Figure 3. The polynomial p?d − 2+d where p?d denotes the Christoffel polynomial of Example 6.2 for d = 1 (top 2  left), d = 2 (top right), d = 3 (bottom middle). The red points correspond to the 2+d -level set of the Christoffel 2 polynomial. De Castro, Gamboa, Henrion, Hess and Lasserre/6 EXAMPLES 22 6.3. Ring of ellipses As a second example in the plane we consider an ellipsoidal ring, i.e., an ellipse with a hole in the form of a smaller ellipse. More precisely, X = {x ∈ R2 : 9x21 + 13x22 ≤ 7.3, 5x21 + 13x22 ≥ 2}. 1 1 0.5 0.5 0.5 0 −0.5 x2 1 x2 x2 We follow the same procedure as described in the former example. See Figure 4 for the results. The values are again listed in Appendix B. 0 −0.5 −0.5 −1 −1 −1 −1 −0.5 0 x1 0.5 1 0 −1 −0.5 0 x1 0.5 −1 1 −0.5 0 x1 0.5 1 Figure 4. The polygon (bold black) of Example 6.3 and the support of the optimal design measure (red points) where the size of the points corresponds to the respective weights for d = 1 (left), d = 2 (middle), d = 3 (right) and δ = 3. 6.4. Moon To investigate another non-convex example, we apply our method to the moon-shaped semialgebraic set X = {x ∈ R2 : (x1 + 0.2)2 + x22 ≤ 0.36, (x1 − 0.6)2 + x22 ≥ 0.16}. 0.8 0.8 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 0 x2 0.8 x2 x2 The results are represented in Figure 5 and for the numerical values the interested reader is referred to Appendix B. 0 0 −0.2 −0.2 −0.2 −0.4 −0.4 −0.4 −0.6 −0.6 −0.6 −0.8 −0.8 −1 −0.5 0 x1 0.5 −0.8 −1 −0.5 0 x1 0.5 −1 −0.5 0 0.5 x1 Figure 5. The polygon (bold black) of Example 6.4 and the support of the optimal design measure (red points) where the size of the points corresponds to the respective weights for d = 1 (left), d = 2 (middle), d = 3 (right) and δ = 3. imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 23 6 EXAMPLES 6.5. Folium The zero level set of the polynomial f (x) = −x1 (x21 − 2x22 )(x21 + x22 )2 is a curve of genus zero with a triple singular point at the origin. It is called a folium. As a last two-dimensional example we consider the semi-algebraic set defined by f , i.e., X = {x ∈ R2 : f (x) ≥ 0, x21 + x22 ≤ 1}. 0.8 0.8 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 0 x2 0.8 x2 x2 Figure 6 illustrates the results and the values are listed in Appendix B. 0 0 −0.2 −0.2 −0.2 −0.4 −0.4 −0.4 −0.6 −0.6 −0.6 −0.8 −0.8 −1 −0.5 0 0.5 −1 x1 −0.5 0 x1 0.5 −0.8 −1 −0.5 0 0.5 x1 Figure 6. The polygon (bold black) of Example 6.5, the support of the optimal design measure (red points) where  the size of the points corresponds to the respective weights, and the 2+d -level set of the Christoffel polynomial 2 (thin blue) for d = 1 (left), d = 2 (middle), d = 3 (right) and δ = 3. 6.6. The 3-dimensional unit sphere P Last, let us consider the regression for the degree d polynomial measurements |α|≤d θα xα on the unit sphere X = {x ∈ R3 : x21 + x22 + x23 = 1}. Again, we first solve Problem (17). For ? = 1, y ? = y ? = y ? = 0.333 d = 1 and δ ≥ 0 we obtain the sequence y? ∈ R10 with y000 200 020 002 and all other entries zero. In the second step we solve Problem (28) to recover the measure. For r = 2 the moment matrices of order 2 and 3 both have rank 6, meaning the rank condition (29) is fulfilled, and we obtain the six atoms {(±1, 0, 0), (0, ±1, 0), (0, 0, ±1)} ⊆ X on which the optimal measure µ ∈ M+ (X ) is uniformly supported. For quadratic regressions, i.e., d = 2, we obtain an optimal measure supported on 14 atoms evenly distributed on the sphere. Choosing d = 3, meaning cubic regressions, we find a Dirac measure supported on 26 points which again are evenly distributed on the sphere. See Figure 7 for an illustration of the supporting points of the optimal measures for d = 1, d = 2, d = 3 and δ = 0. Using the method via Christoffel polynomials gives again less points. No solution is extracted when solving Problem (31) and we find only two supporting points for Problem (30). 6.7. Fixing some moments Our method has an additional nice feature. Indeed in Problem (17) one may easily include the additional constraint that some moments (yα ), α ∈ Γ ⊂ Nn2d are fixed to some prescribed value. We illustrate this potential on one example. For instance, with Γ = {(020), (002), (110), (101)}, De Castro, Gamboa, Henrion, Hess and Lasserre/7 CONCLUSION 24 Figure 7. The red points illustrate the support of the optimal design measure for d = 1 (left), d = 2 (middle), d = 3 (right) and δ = 0 for Example 6.6. 1 x3 0.5 0 −0.5 −1 −1 −0.5 0 x1 0.5 1 Figure 8. Support points recovered in Example 6.6 for the D-optimal design and d = 1 (red) and the points which are recovered when additionally fixing some moments as described in Subsection 6.7 (blue). let y020 := 2, y002 := 1, y110 := 0.01 and y101 := 0.95. In order to obtain a feasible problem, we scale them with respect to the Gauss distribution. For the D-optimal design case with d = 1 and δ = 0 and after computing the support of the corresponding measure using the Nie method, we get 6 points as we obtain without fixing the moments. However, now four of the six points are shifted and the measure is no longer uniformly supported on these points, but each two opposite points have the same weight. See Figure 8 for an illustration of the position of the points with fixed moments (blue) with respect to the position of the support points without fixing the points (red). 7. Conclusion In this paper, we give a general method to build optimal designs for multidimensional polynomial regression on an algebraic manifold. The method is highly versatile as it can be used for all classical functionals of the information matrix. Furthermore, it can easily be tailored to incorporate prior knowledge on some multidimensional moments of the targeted optimal measure imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 25 A PROOF OF THEOREM 1 (as proposed in [15]). In future works, we will extend the method to multi-response polynomial regression problems and to general smooth parametric regression models by linearization. Acknowledgments We warmly thank three anonymous referees for their valuable comments on early version of this paper. We thank Henry Wynn for communicating the polygon of Example 6.2 to us. Feedback from Pierre Maréchal, Luc Pronzato, Lieven Vandenberghe and Weng Kee Wong was also appreciated. The research of the last three authors is funded by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (grant agreement ERC-ADG 666981 TAMING). Appendix A: Proof of Theorem 1 First, let us prove that Problem (15) has an optimal solution. The feasible set is nonempty with finite associated objective value—take as feasible point the vector y ∈ M2d (X ) associated with the Lebesgue measure on the compact set X , scaled to be a probability measure. Moreover, as X is compact with nonempty interior, it follows that M2d (X ) is closed (as the dual of P2d (X )). In addition, the feasible set {y ∈ RM2d (X ) : y0 = 1} of Problem (15) is compact. Indeed there exists M > 1 such that it holds X xi2d dµ < M for every probability measure µ on X and every i = 1, . . . , n. Hence, max{y0 , maxi {Ly (x2d i )}} < M which by [10] implies that |yα | ≤ M for every |α| ≤ 2d, which in turn implies that the feasible set of (15) is compact. Next, as the function φq is upper semi-continuous, the supremum in (15) is attained at some optimal solution y? ∈ M2d (X ). Moreover, as the feasible set is convex and φq is strictly concave (see, e.g., [19, Chapter 6.13]) then y∗ is the unique optimal solution. Now, we examine the properties of the polynomial p? and show the equivalence statement. For this we notice that there exists a strictly feasible solution because the cone int(M2d (X )) is nonempty by Lemma 2.6 in [9]. Hence, Slater’s condition4 holds for (15). Further, by a an argument in [19, Chapter 7.13], the matrix Md (y? ) is non-singular. Therefore, φq is differentiable at y? . Since additionally Slater’s condition is fulfilled and φq is concave, this implies that the Karush-Kuhn-Tucker (KKT) optimality conditions5 at y? are necessary (and sufficient) for y? to be an optimal solution. The KKT-optimality conditions read λ? e0 − ∇φq (Md (y? )) = p̂? with p̂? = hp̂, v2d (x)i ∈ M2d (X )? (= P2d (X )), n+2d (where p̂ ∈ R( n ) , e0 = (1, 0, . . . , 0), and λ? is the dual variable associated with the constraint y0? = 1). The complementarity condition is hy? , p? i = 0. Writing Bα , α ∈ Nn2d , for the real symmetric matrices satisfying X ∀x ∈ X , Bα xα = vd (x)vd (x)>, |α|≤2d 4 For the optimization problem max {f (x) : Ax = b; x ∈ C}, where A ∈ Rm×n and C ⊆ Rn is a nonempty closed convex cone, Slater’s condition holds, if there exists a feasible solution x in the interior of C. 5 For the optimization problem max {f (x) : Ax = b; x ∈ C}, where f is differentiable, A ∈ Rm×n and C ⊆ Rn is a nonempty closed convex cone, the KKT-optimality conditions at a feasible point x state that there exist λ? ∈ Rm and u? ∈ C ? such that A> λ? − ∇f (x) = u? and hx, u? i = 0. De Castro, Gamboa, Henrion, Hess and Lasserre/A PROOF OF THEOREM 1 26 and hA, Bi = trace(AB) for two real symmetric matrices A and B, this can be expressed as   ? ? = p̂, p̂? ∈ P2d (X ). (34) 1α=0 λ − h∇φq (Md (y )), Bα i |α|≤2d Multiplying (34) term-wise by yα? , summing up and invoking the complementarity condition, yields D E X (34) λ? = λ? y0? = ∇φq (Md (y? )), yα? Bα (35) |α|≤2d D E = ∇φq (Md (y? )), Md (y? ) = φq (Md (y? )) , where the last equality holds by Euler formula for the positively homogeneous function φq . Similarly, multiplying Equation (34) term-wise by xα and summing up yields for all x ∈ X D E X (34) x 7→ p̂? (x) = λ? − ∇φq (Md (y? )), Bα xα (36) |α|≤2d E =λ − ∇φq (Md (y )), vd (x)vd (x)> ≥ 0. ? D ? i1− 1 h n+d−1 q ? )q ) For q 6= 0 let c? := n+d trace(M (y . As Md (y? ) is positive semidefinite d n n and non-singular, we have c? > 0. If q = 0, let c? := 1 and replace φ0 (Md (y? )) by log det Md (y? ), for which the gradient is Md (y? )−1 . Using Table 1 we find that c? ∇φq (Md (y? )) = Md (y? )q−1 . It follows that (35) c? λ? = c? h∇φq (Md (y? )), Md (y? )i = trace(Md (y? )q ) (16) and c? h∇φq (Md (y? )), vd (x)vd (x)> i = p?d (x) Therefore, equation (36) is equivalent to p? := c? p̂? = c? λ? − p?d ∈ P2d (X ). To summarize, p? (x) = trace(Md (y? )q ) − p?d (x) ∈ P2d (X ). Since the KKT-conditions are necessary and sufficient, the equivalence statement follows. Finally, we investigate the measure µ? associated with y? . Multiplying the complementarity condition hy? , p̂? i = 0 with c? , we have Z p? (x) dµ? (x) = 0. X | {z } ≥0 on X Hence, the support of µ? is included in the algebraic set Ω = {x ∈ X : p? (x) = 0}. The measure µ? is an atomic measure supported on at most n+2d points. This follows n from Tchakaloff’s theorem (see [8, Theorem B.12] or [1] for instance), which states that for every finite Borel probability measure on X and every s ∈ N, there exists an atomic measure  µs supported on ` ≤ n+s points such that all moments of µs and µ? agree up to order s. For n    n+d ? s = 2d we get that ` ≤ n+2d . If ` < n+d in contradiction to d (y ) < n n , then rank M n  n+d n+2d ? Md (y ) being non-singular. Therefore, n ≤ ` ≤ n . imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 A PROOF OF THEOREM 1 27 in the general case. Recall that Remark 6. The last paragraph has to be adapted as follows  there exists a full row rank matrix A of size p × n+d such that the regression polynomials n satisfy F(x) = A vd (x). Recall also that we are optimizing over the cone of matrices of the form Md (y) := AMd (y)A> indexed by moment sequences y. First, note that rank Md (y) = min(p, rank Md (y)) and recall that the optimal solution Md (y? ) has full rank, namely it holds that rank Md (y? ) = p. We deduce that rank Md (y? ) ≥ p so that µ? has at least p support points. Then, consider the vector space spanned by the constant function 1 and the polynomials x 7→ fi (x)fj (x) for 1 ≤ i, j ≤ p. Denote by s its dimension and observe that   h p(p + 1) n + 2d i s ≤ min 1 + , . 2 n The first argument in the minimum is the number of quadratic terms fi fj while the second comes from the observation that their span is included in the vector space of multivariate polynomials of n variables of degree at most 2d. Recall that we want to represent the outcome of the linear evaluations Z ? (Md (y ))i,j = fi fj dµ? , 1 ≤ i, j ≤ p , by a discrete probability measure µ? . By Tchakaloff ’s theorem, see for instance [1, Corollary 2 6 ], we get that there exists a representing probability measure µ? of Md (y? ) with at most s support points. 6 In [1, Corollary 2], the reader may consider (φj )j=1,...,s any basis of the vector space spanned by the constant function 1 and the polynomials x 7→ fi (x)fj (x) to get the result. De Castro, Gamboa, Henrion, Hess and Lasserre/B NUMERICAL RESULTS FOR THE EXAMPLES28 Appendix B: Numerical results for the Examples We list in Table 2 details on the results for the two-dimensional examples (Sections 6.2, 6.3, 6.4, and 6.5), namely, the numerical values of the support points and their corresponding weights. Wynn (x1 , x2 ) (-0.35,-0.35) (-0.35, 0.35) ( 0.35,-0.35) ( 0.71, 0.71) ω 0.125 0.281 0.281 0.313 d=2 (-0.35,-0.35) (-0.35, 0.35) ( 0.12, 0.12) ( 0.35,-0.35) ( 0.18, 0.53) ( 0.53, 0.18) ( 0.71, 0.71) 0.163 0.165 0.066 0.165 0.141 0.141 0.159 d=3 (-0.35,-0.35) ( 0.02,-0.35) (-0.35, 0.02) ( 0.35,-0.35) ( 0.14,-0.12) (-0.12, 0.14) (-0.35, 0.35) ( 0.45,-0.06) (-0.06, 0.45) ( 0.39, 0.39) ( 0.61, 0.41) ( 0.41, 0.61) ( 0.71, 0.71) d=1 The numerical values for Ellipses (x1 , x2 ) (-0.00,-0.75) (-0.90,-0.00) ( 0.90, 0.00) ( 0.00, 0.75) (-0.45,-0.65) (-0.90,-0.00) (-0.00,-0.39) ( 0.45,-0.65) (-0.45, 0.65) ( 0.00, 0.39) ( 0.90, 0.00) ( 0.45, 0.65) (-0.64,-0.53) (-0.90, 0.00) (-0.00,-0.75) (-0.36,-0.32) ( 0.00,-0.39) (-0.64, 0.53) (-0.36, 0.32) ( 0.36,-0.32) ( 0.64,-0.53) (-0.00, 0.39) ( 0.36, 0.32) (-0.00, 0.75) ( 0.90,-0.00) ( 0.64, 0.53) ω 0.250 0.250 0.250 0.250 Moon (x1 , x2 ) (-0.80, 0.00) ( 0.07,-0.53) ( 0.07, 0.53) ( 0.33,-0.29) ( 0.33, 0.29) (-0.39,-0.57) (-0.80, 0.00) (-0.20,-0.00) ( 0.29,-0.35) (-0.39, 0.57) ( 0.29, 0.35) 0.134 0.139 0.093 0.134 0.134 0.093 0.139 0.134 0.095 0.085 (-0.57,-0.47) 0.074 0.088 (-0.08,-0.59) 0.074 0.088 (-0.80, 0.00) 0.096 0.075 (-0.45,-0.18) 0.044 0.005 (-0.11,-0.30) 0.044 0.085 (-0.45, 0.18) 0.097 0.075 ( 0.33,-0.29) 0.088 0.075 (-0.57, 0.47) 0.088 0.085 ( 0.11,-0.00) 0.037 0.005 (-0.11, 0.30) 0.084 0.075 (-0.08, 0.59) 0.084 0.088 ( 0.33, 0.29) 0.097 0.088 0.085 Table 2 Examples 6.2, 6.3, 6.4, and 6.5 for the support corresponding weights ωi , i = 1, . . . , `. ω 0.329 0.305 0.305 0.031 0.031 0.167 0.167 0.167 0.167 0.167 0.167 0.099 0.098 0.100 0.061 0.062 0.061 0.099 0.099 0.063 0.062 0.098 0.099 Folium (x1 , x2 ) ω ( 0.29,-0.55) 0.333 (-1.00, 0.00) 0.333 ( 0.29, 0.55) 0.333 (-1.00, 0.00) (-0.60,-0.21) (-0.60, 0.21) ( 0.28,-0.56) ( 0.21,-0.20) ( 0.21, 0.20) ( 0.28, 0.56) 0.167 0.166 0.166 0.162 0.088 0.088 0.162 (-1.00,-0.00) (-0.77,-0.20) (-0.77, 0.20) (-0.45, 0.00) (-0.14,-0.00) ( 0.10,-0.41) ( 0.29,-0.56) ( 0.31,-0.35) ( 0.10, 0.41) ( 0.31, 0.35) ( 0.29, 0.56) 0.100 0.099 0.099 0.077 0.033 0.098 0.099 0.100 0.098 0.100 0.099 points xi = (xi,1 , xi,2 ) and their imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017 REFERENCES 29 References [1] C. Bayer and J. Teichmann. The proof of Tchakaloff’s theorem. Proceedings of the American mathematical society, 134(10):3035–3040, 2006. [2] G. E. Box and J. S. Hunter. Multi-factor experimental designs for exploring response surfaces. The Annals of Mathematical Statistics, pages 195–241, 1957. [3] H. Dette and W. J. Studden. The theory of canonical moments with applications in statistics, probability, and analysis, volume 338. John Wiley & Sons, 1997. [4] N. Gaffke, U. Graßhoff, and R. Schwabe. Algorithms for approximate linear regression design with application to a first order model with heteroscedasticity. Computational Statistics & Data Analysis, 71:1113–1123, 2014. [5] D. Henrion, J.-B. Lasserre, and J. Löfberg. Gloptipoly 3: moments, optimization and semidefinite programming. Optimization Methods & Software, 24(4-5):761–779, 2009. [6] J. Kiefer. General equivalence theory for optimum designs (approximate theory). The annals of Statistics, pages 849–879, 1974. [7] M. Krein and A. Nudelman. The Markov moment problem and extremal problems, volume 50 of Translations of mathematical monographs. American Mathematical Society, Providence, Rhode Island, 1977. [8] J. B. Lasserre. Moments, positive polynomials and their applications, volume 1 of Imperial College Press Optimization Series. Imperial College Press, London, 2010. [9] J.-B. Lasserre. A generalization of Löwner-John’s ellipsoid theorem. Mathematical Programming, 152(1-2):559–591, 2015. [10] J. B. Lasserre and T. Netzer. SOS approximations of nonnegative polynomials via simple high degree perturbations. Mathematische Zeitschrift, 256(1):99–112, 2007. [11] J.-B. Lasserre and É. Pauwels. Sorting out typicality with the inverse moment matrix SOS polynomial. In Advances in Neural Information Processing Systems 29, 2016. [12] M. Ledoux. Differential operators and spectral distributions of invariant ensembles from the classical orthogonal polynomials. the continuous case. Electron. J. Probab, 9(7):177–208, 2004. [13] A. S. Lewis. Convex analysis on the Hermitian matrices. SIAM Journal on Optimization, 6(1):164–177, 1996. [14] J. Lofberg. Yalmip: A toolbox for modeling and optimization in matlab. In Computer Aided Control Systems Design, 2004 IEEE International Symposium on, pages 284–289. IEEE, 2004. [15] I. Molchanov and S. Zuyev. Optimisation in space of measures and optimal design. ESAIM: Probability and Statistics, 8:12–24, 2004. [16] A. Mosek. The MOSEK optimization toolbox for matlab manual. Version 7.1 (Revision 28), 2015. [17] J. Nie. The A-Truncated K-Moment problem. Foundations of Computational Mathematics, 14(6):1243–1276, 2014. [18] D. Papp. Optimal designs for rational function regression. Journal of the American Statistical Association, 107(497):400–411, 2012. [19] F. Pukelsheim. Optimal design of experiments. SIAM, 2006. [20] G. Sagnol. On the semidefinite representation of real functions applied to symmetric matrices. Linear Algebra and its Applications, 439(10):2829–2843, 2013. [21] G. Sagnol and R. Harman. Computing exact D-optimal designs by mixed integer secondorder cone programming. The Annals of Statistics, 43(5):2198–2224, 2015. REFERENCES/REFERENCES 30 [22] C. Scheiderer. Semidefinitely representable convex sets. ArXiv e-prints, Dec. 2016. [23] B. Torsney. W-iterations and ripples therefrom. In Optimal Design and Related Areas in Optimization and Statistics, pages 1–12. Springer, 2009. [24] L. Vandenberghe, S. Boyd, and S.-P. Wu. Determinant maximization with linear matrix inequality constraints. SIAM journal on matrix analysis and applications, 19(2):499–533, 1998. imsart-generic ver. 2014/10/16 file: decastro17a.tex date: October 27, 2017
10math.ST
arXiv:1707.09092v2 [cs.CV] 14 Jan 2018 Benchmarking 6DOF Outdoor Visual Localization in Changing Conditions Torsten Sattler1 Will Maddern2 Carl Toft3 Akihiko Torii4 Lars Hammarstrand3 Erik Stenborg3 Daniel Safari4,5 Masatoshi Okutomi4 Marc Pollefeys1,6 Josef Sivic7,8 Fredrik Kahl3,9 Tomas Pajdla8 1 Department of Computer Science, ETH Zürich 2 Oxford Robotics Institute, University of Oxford 3 Department of Electrical Engineering, Chalmers University of Technology 4 Tokyo Institute of Technology 5 Technical University of Denmark 6 Microsoft 7 Inria∗ 8 Czech Institute of Informatics, Robotics, and Cybernetics, Czech Technical University in Prague 9 Centre for Mathematical Sciences, Lund University Abstract Visual localization enables autonomous vehicles to navigate in their surroundings and augmented reality applications to link virtual to real worlds. Practical visual localization approaches need to be robust to a wide variety of viewing condition, including day-night changes, as well as weather and seasonal variations, while providing highly accurate 6 degree-of-freedom (6DOF) camera pose estimates. In this paper, we introduce the first benchmark datasets specifically designed for analyzing the impact of such factors on visual localization. Using carefully created ground truth poses for query images taken under a wide variety of conditions, we evaluate the impact of various factors on 6DOF camera pose estimation accuracy through extensive experiments with state-of-the-art localization approaches. Based on our results, we draw conclusions about the difficulty of different conditions, showing that long-term localization is far from solved, and propose promising avenues for future work, including sequence-based localization approaches and the need for better local features. We will make our benchmark publicly available. Figure 1. Visual localization in changing urban conditions. We present three new datasets, Aachen Day-Night, RobotCar Seasons (shown) and CMU Seasons for evaluating 6DOF localization against a prior 3D map (top) using registered query images taken from a wide variety of conditions (bottom), including day-night variation, weather, and seasonal changes over long periods of time. 1. Introduction proving scalability and robustness to ambiguous structures [34,54,67,77], reducing memory requirements [13,35, 54], and more flexible scene representations [57]. All these methods utilize local features to establish 2D-3D matches. These correspondences are in turn used to estimate the camera pose. This data association stage is critical as pose estimation fails without sufficiently many correct matches. There is a well-known trade-off between discriminative power and invariance for local descriptors. Thus, existing localization approaches will only find enough matches if both the query images and the images used to construct the Estimating the 6DOF camera pose of an image with respect to a 3D scene model is key for visual navigation of autonomous vehicles and augmented/mixed reality devices. Solutions to this visual localization problem can also be used to “close loops” in the context of SLAM or to register images to Structure-from-Motion (SfM) reconstructions. Work on 3D structure-based visual localization has mainly focused on increasing efficiency [35, 42, 56], im∗ WILLOW project, Departement d’Informatique de l’École Normale Supérieure, ENS/INRIA/CNRS UMR 8548, PSL Research University. 1 3D scene model are taken under similar viewing conditions. Capturing a scene under all viewing conditions is prohibitive. Thus, the assumption that all relevant conditions are covered is too restrictive in practice. It is more realistic to expect that images of a scene are taken under a single or a few conditions. To be practically relevant, e.g., for life-long localization for self-driving cars, visual localization algorithms need to be robust under varying conditions (cf . Fig. 1). Yet, no work in the literature actually measures the impact of varying conditions on 6DOF pose accuracy. One reason for the lack of work on visual localization under varying conditions is a lack of suitable benchmark datasets. The standard approach for obtaining ground truth 6DOF poses for query images is to use SfM. An SfM model containing both the database and query images is built and the resulting poses of the query images are used as ground truth [35, 57, 63]. Yet, this approach again relies on local feature matches and can only succeed if the query and database images are sufficiently similar [53]. The benchmark datasets constructed this way thus tend to only include images that are relatively easy to localize in the first place. In this paper, we construct the first datasets for benchmarking visual localization under changing conditions. To overcome the above mentioned problem, we heavily rely on human work: We manually annotate matches between images captured under different conditions and verify the resulting ground truth poses. We create three complimentary benchmark datasets based on existing data [4, 44, 58]. All consist of a 3D model constructed under one condition and offer query images taken under different conditions: The Aachen Day-Night dataset focuses on localizing highquality night-time images against a day-time 3D model. The RobotCar Seasons and CMU Seasons dataset both consider automotive scenarios and depict the same scene under varying seasonal and weather conditions. One challenge of the RobotCar Seasons dataset is to localize low-quality night-time images. The CMU Seasons dataset focuses on the impact of seasons on vegetation and thus the impact of scene geometry changes on localization. of querying with multiple images, rather than with individual photos, especially under challenging conditions. (iv) We make our benchmark datasets, including 3D models, ground truth poses, and evaluation scripts, publicly available. We hope that releasing our benchmark will stimulate research on long-term visual localization. 2. Related Work Localization benchmarks. Tab. 1 compares our benchmark datasets with existing datasets for both visual localization and place recognition. Datasets for place recognition [17, 46, 65, 69, 72] often provide query images captured under different conditions compared to the database images. However, they neither provide 3D models nor 6DOF ground truth poses. Thus, they cannot be used to analyze the impact of changing conditions on pose estimation accuracy. In contrast, datasets for visual localization [16, 29, 31, 34, 35, 57, 58, 60, 63] often provide ground truth poses. However, they do not exhibit strong changes between query and database images due to relying on feature matching for ground truth generation. A notable exception is the Michigan North Campus Long-Term (NCLT) dataset [14], providing images captured over long period of time and ground truth obtained via GPS and LIDAR-based SLAM. Yet, it does not cover all viewing conditions captured in our datasets, e.g., it does not contain any images taken at night or during rain. To the best of our knowledge, ours are the first datasets providing both a wide range of changing conditions and accurate 6DOF ground truth. Thus, ours is the first benchmark that measures the impact of changing conditions on pose estimation accuracy. Datasets such as KITTI [26], TorontoCity [75], or the Málaga Urban dataset [6] also provide street-level image sequences. Yet, they are less suitable for visual localization as only quite few places are visited multiple times. 3D structure-based localization methods [34, 35, 39, 54, 56, 67, 77] establish correspondences between 2D features in a query image and 3D points in a SfM point cloud via descriptor matching. These 2D-3D matches are then used to estimate the query’s camera pose. Descriptor matching can be accelerated by prioritization [18, 35, 56] and efficient search algorithms [22, 42]. In large or complex scenes, descriptor matches become ambiguous due to locally similar structures found in different parts of the scene [34]. This results in high outlier ratios of up to 99%, which can be handled by exploiting co-visibility information [34, 39, 54] or via geometric outlier filtering [10, 67, 77]. We evaluate Active Search [56] and the City-Scale Localization approach [67], a deterministic geometric outlier filter based on a known gravity direction, as representatives for efficient respectively scalable localization methods. Contributions. This paper makes the following contributions: (i) We create a new outdoor benchmark complete with ground truth and metrics for evaluating 6DOF visual localization under changing conditions such as illumination (day/night), weather (sunny/rain/snow), and seasons (summer/winter). Our benchmark covers multiple scenarios, such as pedestrian and vehicle localization, and localization from single and multiple images as well as sequences. (ii) We provide an extensive experimental evaluation of state-of-the-art algorithms from both the computer vision and robotics communities on our datasets. We show that existing algorithms, including SfM, have severe problems dealing with both day-night changes and seasonal changes in vegetated environments. (iii) We demonstrate the value 2D image-based localization methods approximate the 2 Dataset Alderley Day/Night [46] Nordland [65] Pittsburgh [72] SPED [17] Tokyo 24/7 [69] 7 Scenes [60] Aachen [58] Cambridge [31] Dubrovnik [35] Landmarks [34] Mall [63] NCLT [14] Rome [35] San Francisco [16, 34, 57] Vienna [29] Aachen Day-Night (ours) RobotCar Seasons (ours) CMU Seasons (ours) Setting Suburban Outdoors Urban Outdoors Urban Indoor Historic City Historic City Historic City Landmarks Indoor Outdoors & Indoors Landmarks Urban Landmarks Historic City Urban Suburban Image Capture Trajectory Trajectory Trajectory Static Webcams Free Viewpoint Free Viewpoint Free Viewpoint Free Viewpoint Free Viewpoint Free Viewpoint Free Viewpoint Trajectory Free Viewpoint Free Viewpoint Free Viewpoint Free Viewpoint Trajectory Trajectory 3D SfM Model (# Sub-Models) 1.54M / 7.28M (1) 1.89M / 17.68M (5) 1.89M / 9.61M (1) 38.19M / 177.82M (1k) 4.07M / 21.52M (69) 30M / 149M (1) 1.12M / 4.85M (3) 1.65M / 10.55M (1) 6.77M / 36.15M (49) 1.61M / 6.50M (17) # Images Database Query 14,607 16,960 143k 254k 24k 1.27M 120k 75,984 315 26,000 17,000 3,047 369 6,848 4,081 6,044 800 204,626 10,000 682 2296 about 3.8M 15,179 1000 610,773 442 1,324 266 4,328 922 20,862 11,934 7,159 75,335 Condition Changes Weather Seasons Day-Night X X X X X 6DOF query poses X X X X(SfM) X(SfM) X X X X(SfM) X X X X X X X X X Table 1. Comparison between our and existing benchmarks for place recognition and visual localization. ”Condition Changes” refers to viewing conditions captured by the query images that are not already covered by the database images. For some datasets, all images were captured from similar trajectories of a moving camera (or moving cameras). If one or more SfM 3D models are available, we report the number of sparse 3D points and the number of associated features. Our datasets are the only ones that provide a diverse set of changing conditions, reference 3D models, and most importantly ground truth 6DOF poses for the query images. both loop-closure detection [17, 45, 64, 66] and pose estimation [19, 31, 74]. They learn features with stable appearance over time [17, 47, 49], train classifiers for place recognition [12, 28, 37, 76], and train CNNs to regress 2D-3D matches [8, 9, 60] or camera poses [19, 31, 74]. pose of a query image using the pose of the most similar photo retrieved from an image database. They are often used for place recognition [1, 17, 41, 55, 66, 69] and loop-closure detection [20, 25,48]. They remain effective at scale [3,55,57,71] and can be robust to changing conditions [1, 17, 49, 57, 66, 69]. We evaluate two compact image-level representations: DenseVLAD [69] aggregates densely extracted SIFT descriptors [2, 40] into a compact image-level descriptor [30]. NetVLAD [1] is a learned variant of DenseVLAD. Both are robust against day-night changes [1, 69] and work well at large-scale [57]. We also evaluate the de-facto standard approach for loop-closure detection in robotics [23, 36], where robustness to changing conditions is critical for long-term autonomous navigation [17, 37, 46, 49, 66, 69]: FAB-MAP [20] is an image retrieval approach based on the Bag-ofWords (BoW) paradigm [62] that explicitly models the cooccurrence probability of different visual words. 3. Benchmark Datasets for 6DOF Localization This section describes the creation of our three new benchmark datasets. Each dataset is constructed from publicly available data. We add ground truth poses for all query images and build reference 3D models from images captured under a single condition. All three datasets present different challenges. The Aachen Day-Night dataset focuses on localizing night-time photos against a 3D model built from day-time imagery. The night-time images, taken with a mobile phone using software HDR post-processing, are of high quality. The dataset represents a scenario where images are taken with hand-held cameras, e.g., an augmented reality application. Both the RobotCar Seasons and the CMU Seasons datasets represent automotive scenarios, with images captured from a car. In contrast to the Aachen Day dataset, both datasets exhibit less variability in viewpoints but a larger variance in viewing conditions. The night-time images from the RobotCar dataset were taken from a driving car with a consumer camera with auto-exposure. This results in significantly less well-lit images exhibiting motion blur, i.e., images that are significantly harder to localize (cf . Fig. 2). The RobotCar dataset depicts a mostly urban scene with rather static scene geometry. In contrast, the CMU dataset contains a significant amount of vegetation. The changing appearance and geometry of the vegetation, due to seasonal changes, is the main challenge of this dataset. Fig. 3 shows 3D models of the three datasets (cf . Tab. 2 Sequence-based approaches for image retrieval are used for loop-closure detection in robotics [43, 46, 50]. Requiring a matched sequence of images in the correct order significantly reduces false positive rates compared to singleimage retrieval approaches, producing impressive results including direct day-night matches with SeqSLAM [46]. We evaluate OpenSeqSLAM [65] on our benchmark. Multiple cameras with known relative poses can be modelled as a generalized camera [52], i.e., a camera with multiple centers of projections. Approaches for absolute pose estimation for both multi-camera systems [33] and camera trajectories [11] from 2D-3D matches exist. Yet, they have never been applied for localization in changing conditions. In this paper, we show that using multiple images can significantly improve performance in challenging scenarios. Learning-based localization has been proposed to solve 3 # images reference model # 3D points # features query images conditions (# images) condition Aachen Day-Night RobotCar Seasons 4,328 20,862 1.65M 6.77M 10.55M 36.15M day overcast (November) CMU Seasons 7,159 1.61M 6.50M sun / no foliage (April) day (824), night (98) dawn (1,449), dusk (1,182), night (1,314), night+rain (1,320), overcast summer (1,389), overcast winter (1,170), rain (1,263), snow (1,467), sun (1,380) sun (22,073), low sun (28,045), overcast (11,383), clouds (14,481), foliage (33,897), mixed foliage (27,637), no foliage (13,801) urban (31,250), suburban (13,736), park (30,349) Table 2. Detailed statistics for the three benchmark datasets proposed in this paper. For each dataset, a reference 3D model was constructed using images taken under the same reference condition, e.g., ”overcast” for the RobotCar Seasons dataset. with software HDR enabled. Attempts to include them in the intermediate model resulted in highly inaccurate camera poses due to a lack of sufficient feature matches. In order to obtain ground truth poses for the night-time queries, we thus hand-labelled 2D-3D correspondences. We manually selected a day-time query image taken from a similar viewpoint for each night-time query. For each selected day-time query, we projected its visible 3D points from the intermediate model into it. Given these projections as reference, we manually labelled 10 to 30 corresponding pixel positions in the night-time query. Using the resulting 2D-3D matches and the known intrinsics of the camera, we estimate the camera poses using a 3-point-pose solver [24, 32], followed by non-linear pose optimization. We visually verified the pose by projecting all 3D points visible in its day-time image into the night-time query. 3.2. The RobotCar Seasons Dataset Our RobotCar Seasons dataset is based on a subset of the publicly available Oxford RobotCar Dataset [44]. The original dataset contains over 20M images recorded from an autonomous vehicle platform over 12 months in Oxford, UK. Out of the 100 available traversals of the 10km route, we select one reference traversal in overcast conditions and nine query traversals that cover a wide range of conditions (cf . Tab. 2). All selected images were taken with the three synchronized global shutter Point Grey Grasshopper2 cameras mounted to the left, rear, and right of the car. Both the intrinsics of the cameras and their relative poses are known. The reference traversal contains 26,121 images taken at 8,707 positions, with 1m between successive positions. Building a single consistent 3D model from this data is very challenging, both due to sheer size and the lack of visual overlap between the three cameras. We thus built 49 nonoverlapping local submaps, each covering a 100m trajectory. For each submap, we initialized the database camera poses using vehicle positions reported by the inertial navigation system (INS) mounted on the RobotCar. We then iteratively triangulated 3D points, merged tracks, and refined both structure and poses using bundle adjustment. The scale of the reconstructions was recovered by registering them against the INS poses. The reference model contains all submaps and consists of 20,862 reference images and Figure 2. Example query images for Aachen Day-Night (top), RobotCar Seasons (middle) and CMU Seasons datasets (bottom). for details). Next, we describe their construction in detail. 3.1. The Aachen Day-Night Dataset Our Aachen Day-Night dataset is based on the Aachen localization dataset from [58]. The original dataset contains 4,479 reference and 369 query images taken in the old inner city of Aachen, Germany. It provides a 3D SfM model but does not have ground truth poses for the queries. We augmented the original dataset with day- and night-time queries captured using standard consumer phone cameras.. To obtain ground truth poses for the day-time queries, we used COLMAP [59] to create an intermediate 3D model from the reference and day-time query images. The scale of the reconstruction is recovered by aligning it with the georegistered original Aachen model. As in [35], we obtain the reference model for the Aachen Day-Night dataset by removing the day-time query images. 3D points visible in only a single remaining camera were removed as well [35]. The resulting 3D model has 4,328 reference images and 1.65M 3D points triangulated from 10.55M features. Ground truth for night-time queries. We captured 98 night-time query images using a Google Nexus5X phone 4 Figure 3. The 3D models of the Aachen Day-Night (left), RobotCar Seasons (middle), and CMU Seasons (right) datasets. For Aachen, database, day-time query, and night-time query images are shown in red, green, and blue, respectively. For RobotCar and CMU, the different colors encode the individual submaps. Car dataset, the GPS is not accurate enough and the CMU dataset is also too large to build one 3D model from all the images. The full sequences were split up into 17 shorter sequences, each containing about 250 consecutive vehicle poses. For each short sequence, a 3D model was built using bundle adjustment of SIFT points tracked over several image frames. The resulting submaps of the reference route were merged with the corresponding submaps from the other traversals by using global bundle adjustment and manually annotated image correspondences. Reprojection errors are within a few pixels for all 3D points and the distances between estimated camera positions and expected ones (based on neighbouring cameras) are under 0.10m. The resulting reference model consists of 1.61M 3D points triangulated from 6.50M features in 7,159 database images. We provide 75,335 query images and 187 query sequences. 6.77M 3D points triangulated from 36.15M features. We obtained query images by selecting reference positions inside the 49 submaps and gathering all images from the nine query traversals with INS poses within 10m of one of the positions. This resulted in 11,934 images in total, where triplets of images were captured at 3,978 distinct locations. We also grouped the queries into 460 temporal sequences based on the timestamps of the images. Ground truth poses for the queries. Due to GPS drift, the INS poses cannot be directly used as ground truth. Again, there are not enough feature matches between day- and night-time images for SfM. We thus used the LIDAR scanners mounted to the vehicle to build local 3D point clouds for each of the 49 submaps under each condition. These models were then aligned to the LIDAR point clouds of the reference trajectory using ICP [5]. Many alignments needed to be manually adjusted to account for changes in scene structure over time (often due to building construction and road layout changes). The final median RMS errors between aligned point clouds was under 0.10m in translation and 0.5◦ in rotation across all locations. The alignments provided ground truth poses for the query images. 4. Evaluation Measures We evaluate state-of-the-art localization approaches on our new benchmark datasets to measure the impact of changing conditions on camera pose estimation accuracy and to understand how hard robust long-term localization really is. We measure the pose accuracy of a method by the deviation between the estimated and the ground truth pose. The position error is measured as the Euclidean distance kcest − cgt k2 between the estimated position cest and the ground truth position cgt . The orientation error α, measured as an angle in degrees, is computed from the estimated and ground truth camera rotation matrices Rest and Rgt . More precisely, α is the rotation angle of the axis-angle representation of the relative rotation R−1 est Rgt . Thus, α measures the minimum rotation angle required to align both rotations. To measure the pose estimation performance of a localization algorithm, we define three accuracy intervals by thresholding both the position and orientation error: In the high-precision regime, we report the percentage of query images localized within 0.25m and 2◦ degrees of their ground truth poses. The thresholds were chosen to reflect 3.3. The CMU Seasons Dataset The CMU Seasons Dataset is based on a subset of the CMU Visual Localization Dataset [4], which contains more than 100K images recorded by the Computer Vision Group at Carnegie Mellon University over a period of 12 months in Pittsburgh, PA, USA. The images were collected using a rig of two cameras mounted at 45 degree forward/left and forward/right angles on the roof of an SUV. The vehicle traversed an 8.5 km long route through central and suburban Pittsburgh 16 times with a spacing in time of between 2 weeks up to 2 months. Out of the 16 traversals, we selected the one from April 4 as the reference, and then 11 query traversals were selected such that they cover the range of variations in seasons and weather that the data set contains. Ground truth poses for the queries. As with the Robot5 correctly localized queries 5. Evaluated Localization Algorithms As discussed in Sec. 2, we evaluate a set of state-of-the-art localization algorithms that covers the most common types of localization approaches: From the class of 3D structurebased methods, we use Active Search (AS) [57] and CityScale Localization (CSL) [67]. From the class of 2D image retrieval-based approaches, we use DenseVLAD [69], NetVLAD [1], and FAB-MAP [20]. In order to measure the benefit of using multiple images for pose estimation, we evaluate two approaches: OpenSeqSLAM [65] is based on image retrieval and enforces that the images in the sequence are matched in correct order. Knowing the relative poses between the query images, we can model them as a generalized camera [52]. Given 2D-3D matches per individual image (estimated via Active Search), we estimate the pose via a generalized absolute camera pose solver [33] inside a RANSAC loop. We denote this approach as Active Search+GC (AC+GC). We are using the ground truth query poses to compute the relative poses that define the generalized cameras1 . Thus, Active Search+GC provides an upper bound on the number of images that can be localized via querying with generalized cameras. The methods discussed above all perform localization from scratch without any prior knowledge about the pose of the query. In order to measure how hard our datasets are, we also implemented two optimistic baselines. Both assume that a set of relevant database images is known for each query. Both perform pairwise image matching and use the known ground truth poses for the reference images to triangulate the scene structure. The feature matches between the query and reference images and the known intrinsic calibration are then be used to estimate the query pose. The first optimistic baseline, LocalSfM, uses upright RootSIFT features [2, 40]. The second uses upright CNN features densely extracted on a regular grid. We use the same VGG16 network [61] as NetVLAD. The DenseSfM method uses coarse-to-fine matching with conv4 and conv3 features. We select the relevant reference images for the two baselines as follows: For Aachen, we use the manually selected day-time image (cf . Sec. 3.1) to select up to 20 reference images sharing the most 3D points with the selected daytime photo. For RobotCar and CMU, we use all reference images within 5m and 135◦ of the ground truth query pose. 100% 80% 60% 40% 20% 0% 0 FABMAP AS CSL DenseSfM 5 10 15 20 Distance threshold [m] correctly localized queries NetVLAD DenseVLAD the high accuracy required for autonomous driving. The medium-precision and coarse-precision regimes use thresholds of 0.50m and 5◦ degrees and 5.0m and 10◦ degrees, respectively. Note that all regimes are more accurate than consumer-grade GPS systems. 50% 40% 30% 20% 10% 0% LocalSfM seqSLAM 0 CSL-sub AS+GC(seq) 5 10 15 20 Distance threshold [m] Figure 4. Cumulative distribution of position errors for the nighttime queries of the Aachen (left) and RobotCar (right) datasets. We evaluated PoseNet [31] but were not able to obtain competitive results. We also attempted to train DSAC [8] on KITTI but were not able to train it. Both PoseNet and DSAC were thus excluded from further evaluations. 6. Experimental Evaluation This section presents the second main contribution of this paper, a detailed experimental evaluation on the effect of changing conditions on the pose estimation accuracy of visual localization techniques. In the following, we focus on pose accuracy. Please see the appendix for experiments concerning computation time. 6.1. Evaluation on the Aachen Day-Night Dataset The focus of the Aachen Day-Night dataset is on benchmarking the pose accuracy obtained by state-of-the-art methods when localizing night-time queries against a 3D model constructed from day-time imagery. In order to put the results obtained for the night-time queries into context, we first evaluate a subset of the methods on the 824 daytime queries. The results of this experiment are shown in Tab. 3. As can be seen, the two structure-based methods are able to estimate accurate cameras poses and localize nearly all images within the coarse-precision regime. We conclude that the Aachen dataset is not particularly challenging for the day-time query images. Night-time queries. Tab. 3 also reports the results obtained for the night-time queries. We observe a significant drop in pose accuracy for both Active Search and CSL, down from above 50% in the high-precision regime to less than 50% in the coarse-precision regime. Given that the night-time queries were taken from similar viewpoints as the day-time queries, this reduction in pose accuracy is solely caused by the day-night change. CSL is able to localize more images compared to Active Search. This is not surprising since CSL also uses matches that were rejected by Active Search as too ambiguous. Still, there is a significant difference to LocalSfM. CSL and Active Search both match features against the full 3D model while LocalSfM only considers a small part of the model for each query. This demonstrates that global matching suf- 1 Note that Active Search+GC only uses the relative poses between the query images to define the geometry of a generalized camera. It does not use any information about the absolute poses of the query images. 6 m deg ActiveSearch CSL DenseVLAD NetVLAD FABMAP LocalSfM DenseSfM AS+GC(seq) Aachen day night .25/.50/5.0 .25/.50/5.0 2/5/10 2/5/10 57.3 / 83.7 / 96.6 13.3 / 24.5 / 42.9 52.3 / 80.0 / 94.3 9.2 / 25.5 / 49.0 0.0 / 0.1 / 22.8 0.0 / 0.0 / 12.2 0.0 / 0.2 / 18.9 0.0 / 0.0 / 11.2 0.0 / 0.0 / 4.6 0.0 / 0.0 / 0.0 foliage .25/.50/5.0 2/5/10 28.9 / 32.6 / 35.9 16.4 / 19.2 / 26.0 13.2 / 31.7 / 82.4 10.4 / 26.1 / 80.2 1.1 / 2.7 / 16.6 mixed foliage .25/.50/5.0 2/5/10 25.2 / 29.4 / 34.0 15.2 / 18.8 / 28.6 16.2 / 38.1 / 85.5 11.0 / 26.8 / 78.6 1.0 / 2.6 / 14.8 CMU no foliage Urban .25/.50/5.0 .25/.50/5.0 2/5/10 2/5/10 52.6 / 59.6 / 66.9 38.9 / 43.9 / 48.5 36.6 / 43.4 / 57.6 25.7 / 29.3 / 38.4 17.8 / 42.2 / 91.5 24.9 / 53.3 / 94.6 11.8 / 29.2 / 82.1 19.0 / 42.9 / 92.1 3.6 / 8.0 / 31.0 2.0 / 4.4 / 17.6 Suburban .25/.50/5.0 2/5/10 12.0 / 16.6 / 22.5 7.3 / 10.6 / 22.5 3.0 / 14.8 / 77.0 2.0 / 8.9 / 60.8 0.2 / 1.3 / 15.0 Park .25/.50/5.0 2/5/10 13.9 / 17.0 / 20.2 8.8 / 12.1 / 23.2 18.6 / 36.7 / 87.7 11.9 / 24.6 / 79.3 2.4 / 4.1 / 25.7 13.3 / 37.8 / 72.4 55.6 / 57.2 / 60.1 52.5 / 55.3 / 58.7 70.9 / 72.9 / 76.1 80.1 / 81.6 / 84.4 56.3 / 60.1 / 64.9 67.8 / 71.1 / 79.3 15.3 / 39.8 / 84.7 86.9 / 93.2 / 99.5 76.5 / 88.7 /100.0 77.7 / 87.0 /100.0 85.4 / 96.3 /100.0 88.2 / 93.3 /100.0 55.7 / 69.2 /100.0 Table 3. Evaluation on the Aachen Day-Night dataset and a subset of the conditions of the CMU Seasons dataset. We report the percentage of query images localized within the three thresholds. ficiently often fails to find the correct nearest neighbors, most likely caused by significant differences between daytime and night-time descriptors. Fig. 4(left) shows the cumulative distribution of position errors for the night-time queries and provides interesting insights: LocalSfM, despite knowing relevant reference images for each query, completely fails to localize about 20% of all queries. This is caused by a lack of correct feature matches for these queries, either due to failures of the feature detector or descriptor. DenseSfM skips feature detection and directly matches densely extracted CNN descriptors (which encode higher-level information compared to the gradient histograms used by RootSIFT). This enables DenseSfM to localize more images at a higher accuracy, resulting in the best performance on this dataset. Still, there is significant room for improvement, even in the coarseprecision regime (cf . Tab. 3). Also, extracting and matching dense descriptors is a time-consuming task. for the RobotCar dataset. All methods fail to localize a significant number of queries for both the high-precision and medium-precision regimes. Interestingly, DenseVLAD and NetVLAD outperform all other methods in the coarse-level regime (see also Fig. 4(right)). This shows that their global descriptors still encode distinctive information even if only insufficiently many 2D-3D matches can be found. The better performance of all methods under ”night+rain” compared to ”night” comes from the autoexposure of the RobotCar’s cameras. A longer exposure is used for the ”night” conditions, leading to significant motion blur. Multi-image queries. The RobotCar is equipped with three synchronized cameras and captures sequences of images for each camera. Rather than querying with only a single image, we can thus also query with multiple photos. Tab. 5 shows the results obtained with seqSLAM (which uses temporal sequences of all images captured by the three cameras) and Active Search+GC. For the latter, we query with triplets of images taken at the same time as well as with temporal sequences of triplets. For readability, we only show the results summarized for day- and night-conditions. 6.2. Evaluation on the RobotCar Seasons Dataset The focus of the RobotCar Seasons dataset is to measure the impact of different seasons and illumination conditions on pose estimation accuracy in an urban environment. Tab. 4 shows that changing day-time conditions have only a small impact on pose estimation accuracy for all methods. The reason is that seasonal changes have little impact on the building facades that are dominant in most query images. The exceptions are “dawn” and “sun”. For both, we observed overexposed images caused by direct sunlight (cf . Fig. 1). Thus, fewer features can be found for Active Search and CSL and the global image descriptors used by the image retrieval approaches are affected as well. On the Aachen Day-Night dataset, we observed that image retrieval-based methods (DenseVLAD and NetVLAD) consistently performed worse than structure-based methods (Active Search, CSL, LocalSfM, and DenseSfM). For the RobotCar dataset, NetVLAD and DenseVLAD essentially achieve the same coarse-precision performance as Active Search and CSL. This is caused by the lower variation in viewpoints as the car follows the same road. Compared to the Aachen Day-Night dataset, there is an even stronger drop in pose accuracy between day and night Tab. 5 shows that Active Search+GC consistently outperforms single image methods in terms of pose accuracy. Active Search+GC is able to accumulate correct matches over multiple images. This enables Active Search+GC to succeed even if only a few matches are found for each individual image. Naturally, the largest gain can be observed when using multiple images in a sequence. Location priors. In all previous experiments, we considered the full RobotCar 3D model for localization. However, it is not uncommon in outdoor settings to have a rough prior on the location at which the query image was taken. We simulate such a prior by only considering the sub-model relevant to a query rather than the full model. While we observe only a small improvement for day-time queries, localizing night-time queries significantly benefits from solving an easier matching problem (cf . Tab. 6). For completeness, we also report results for LocalSfM, which also considers only a small part of the model relevant to a query. Active Search+GC outperforms LocalSfM on this easier matching task when querying with sequences. This is due to not rely7 m deg ActiveSearch CSL DenseVLAD NetVLAD FABMAP dawn .25 / .50 / 5.0 2 / 5 / 10 36.2 / 68.7 / 89.4 47.2 /73.3 / 90.1 8.9 / 36.9 / 92.5 6.2 / 22.8 / 82.6 1.2 / 5.6 / 14.9 dusk .25 / .50 / 5.0 2 / 5 / 10 44.7 / 74.6 / 95.9 56.6 / 82.7 / 95.9 10.2 / 38.8 / 94.2 7.4 / 29.7 / 92.9 4.1 / 18.3 / 55.1 OC-summer .25 / .50 / 5.0 2 / 5 / 10 24.8 / 63.9 / 95.5 34.1 / 71.1 / 93.5 6.0 / 29.8 / 92.0 6.5 / 29.6 / 95.2 0.9 / 8.9 / 39.3 day conditions OC-winter .25 / .50 / 5.0 2 / 5 / 10 33.1 / 71.5 / 93.8 39.5 / 75.9 / 92.3 4.4 / 26.7 / 93.3 3.1 / 25.9 / 92.6 2.6 / 13.3 / 44.1 rain .25 / .50 / 5.0 2 / 5 / 10 51.3 / 79.8 / 96.9 59.6 / 83.1 / 97.6 10.2 / 40.6 / 96.9 9.0 / 35.9 / 96.0 8.8 / 32.1 / 86.5 snow .25 / .50 / 5.0 2 / 5 / 10 36.4 / 72.2 / 93.7 53.2 / 83.6 / 92.4 8.6 / 30.1 / 90.2 7.0 / 25.2 / 91.8 2.0 / 8.2 / 28.4 sun .25 / .50 / 5.0 2 / 5 / 10 25.0 / 46.5 / 69.1 28.0 / 47.0 / 70.4 5.7 / 16.3 / 80.2 5.7 / 16.5 / 86.7 0.0 / 0.0 / 2.4 night conditions night night-rain .25 / .50 / 5.0 .25 / .50 / 5.0 2 / 5 / 10 2 / 5 / 10 0.5 / 1.1 / 3.4 1.4 / 3.0 / 5.2 0.2 / 0.9 / 5.3 0.9 / 4.3 / 9.1 0.9 / 3.4 / 19.9 1.1 / 5.5 / 25.5 0.2 / 1.8 / 15.5 0.5 / 2.7 / 16.4 0.0 / 0.0 / 0.0 0.0 / 0.0 / 0.0 Table 4. Evaluation on the RobotCar Seasons dataset. We report the percentage of queries localized within the three thresholds. all day .25 / .50 / 5.0 2 / 5 / 10 35.6 / 67.9 / 90.4 45.3 / 73.5 / 90.1 all night .25 / .50 / 5.0 2 / 5 / 10 0.9 / 2.1 / 4.3 0.6 / 2.6 / 7.2 ActiveSearch+GC (triplet) 45.5 / 77.0 / 94.7 ActiveSearch+GC (sequence) 46.7 / 80.1 / 97.0 seqSLAM 1.3 / 6.1 / 15.3 2.7 / 6.9 / 12.1 5.8 / 21.0 / 43.1 0.2 / 0.7 / 1.5 m deg ActiveSearch CSL reference images that are known to be a relevant for a query image. Again, we notice that DenseVLAD and NetVLAD are able to coarsely localize more queries compared to the feature-based methods. Localizing sequences (Active Search+GC) again drastically helps to improve pose estimation accuracy. Compared to the RobotCar Seasons dataset, where the sequences are rather short (about 20m maximum), the sequences used for the CMU Seasons dataset completely cover their corresponding sub-models. In practical applications, smaller sequences are preferable to avoid problems caused by drift when estimating the relative poses in a sequence. Still, the results from Tab. 3 show the potential of using multiple rather than a single image for camera pose estimation. Table 5. Using multiple images for pose estimation (ActiveSeach+GC) on the RobotCar Seasons dataset significantly improves pose accuracy compared to using single images. m deg full model ActiveSearch sub-model full model CSL sub-model full model ActiveSearch+GC (triplet) sub-model full model ActiveSearch+GC (sequence) sub-model LocalSfM sub-model RobotCar - all night .25 / .50 / 5.0 2 / 5 / 10 0.9 / 2.1 / 4.3 3.2 / 7.9 / 12.0 0.6 / 2.6 / 7.2 0.5 / 2.8 / 13.4 2.7 / 6.9 / 12.1 7.4 / 15.3 / 27.0 5.8 / 21.0 / 43.1 13.3 / 35.9 / 61.8 13.9 / 25.6 / 45.9 7. Conclusion & Lessons Learned In this paper we have introduced three challenging new benchmark datasets for visual localization. Our novel datasets allow us, for the first time, to analyze the impact of changing conditions on the accuracy of 6DOF camera pose estimation. Our experiments clearly show that the problem of long-term visualization is far from solved. We will release our datasets, including the evaluation scripts and our results, to encourage further work in this important area. The extensive experiments performed in this paper lead to multiple interesting conclusions: (i) Structure-based methods such as Active Search and CSL are robust to most viewing conditions in urban environments. Yet, performance in the high-precision regime still needs to be improved significantly. (ii) Localizing night-time images against a database built from day-time photos is a very challenging problem, even when a location prior is given. (iii) Scenes with a significant amount of vegetation are challenging, even when a location prior is given. (iv) SfM, typically used to obtain ground truth for localization benchmarks, does not fully handle problems (ii) and (iii) due to limitations of existing local features. Dense CNN feature matching inside SfM improves pose estimation performance, but does not fully solve the problem and is computationally expensive. Developing novel (dense) features seems to be required to solve these problems. Our datasets readily provide a benchmark for such features through the LocalSfM and DenseSfM pipelines. We will release the code necessary to benchmark local features on our datasets. (v) Image-level descriptors such as DenseVLAD can suc- Table 6. Using location priors to query only submodels rather than the full RobotCar Seasons dataset significantly improves pose estimation accuracy for night-time queries. ing on one single image to provide enough matches. 6.3. Evaluation on the CMU Seasons Dataset Compared to the urban scenes shown in the other datasets, significant parts of the CMU Seasons dataset show suburban or park regions. Seasonal changes can drastically affect the appearance of such regions. In the following, we thus focus on these conditions. For each query image, we only consider its relevant sub-model. Tab. 3 evaluates the impact of changes in foliage and of different regions on pose accuracy. The reference condition for the CMU Seasons dataset does not contain foliage. Thus, other conditions for which foliage is also absent lead to the most accurate poses. Interestingly, DenseVLAD and NetVLAD achieve a better performance than Active Search and CSL for the medium- and coarse-precision regimes under the ”Foliage” and ”Mixed Foliage” conditions. For the coarse-precision regime, they even outperform LocalSfM. This again shows that global image-level descriptors can capture information lost by local features. We observe a significant drop in pose accuracy in both suburban and park regions. This is caused by the dominant presence of vegetation, leading to many locally similar (and thus globally confusing) features. Naturally, LocalSfM still performs well in such a scenario as it only considers a few 8 query feature, it determines how many 3D point descriptors are assigned to the feature’s closest visual word. This determines the number of descriptor comparisons needed for matching this feature. Active Search then matches the features in ascending order of the number of required descriptor comparisons. If a 2D-to-3D match is found, Active Search attempts to find additional 3D-to-2D correspondences for the 3D points surrounding the matching point. Correspondence search terminates once 100 matches have been found. For the Aachen Day-Night dataset, we trained a visual vocabulary containing 100k words using approximate kmeans clustering [51] on all upright RootSIFT [2, 40] descriptors found in 1,000 randomly selected database images contained in the 3D model. Similarly, we trained a vocabulary containing 10k words for the RobotCar Seasons dataset from the descriptors found in 1,000 randomly selected images contained in the reference 3D model. For the CMU Seasons dataset, we also trained a visual vocabulary consisting of 10k words, but used only the SIFT [40] features corresponding to the 3D points in all sub-models. No vocabulary contains any information from the query images. We use calibrated cameras rather than simultaneously estimating each camera’s extrinsic and intrinsic parameters. We thereby exploit the known intrinsic calibrations provided by the intermediate model of the Aachen Day-Night dataset2 and the known intrinsics of the RobotCar Seasons and CMU Seasons datasets. Besides training new vocabularies and using calibrated cameras, we only changed the threshold on the re-projection error used by RANSAC to distinguish between inliers and outliers. For the Aachen Day-Night dataset, we used a threshold of 10 pixels while we used 5 pixels for both the RobotCat Seasons and the CMU Seasons datasets. Otherwise, we used the standard parameters of Active Search. ceed in scenarios where local feature matching fails. They can even provide coarse-level pose estimates in scenarios with small variations in viewpoint, e.g., autonomous driving. Aiming to improve pose accuracy, e.g., by denser view sampling via synthetic images [69] or image-level approaches for relative pose estimation, is an interesting research direction, especially given the compact memory footprint of such descriptors. (vi) There is a clear benefit in using multiple images for pose estimation. Yet, there is little existing work on multi-image localization. Fully exploiting the availability of image sequences and multi-camera systems (rather than continuing the focus on single images) is thus another promising avenue for future research. Acknowledgements. This work was partially supported by ERC grant LEAP (no. 336845), CIFAR Learning in Machines & Brains program, ESIF, OP Research, development and education Project IMPACT No. CZ.02.1.01/0.0/0.0/15 003/0000468 and EU Structural and Investment Funds, Operational Programe Research, Development and Education, JSPS KAKENHI Grant Number 15H05313, EPSRC Programme Grant EP/M019918/1, the Swedish Research Council (grant no. 2016-04445), the Swedish Foundation for Strategic Research (Semantic Mapping and Visual Navigation for Smart Robots), and Vinnova / FFI (Perceptron, grant no. 2017-01942). Appendix This appendix provides additional results, in particular runtime results for the evaluated methods, that could not be included in the paper due to space constraints. In addition, a more detailed description of the state-of-the-art localization approaches evaluated in the paper is provided. This includes details on the parameter settings used in our experiments, which are provided to foster reproducibility. The appendix is structured as follows: Sec. A provides a more detailed description of all evaluated state-of-theart approaches. Sec. B provides additional details for the RobotCar Seasons and CMU Seasons datasets. Sec. C provides timing results for these methods on the different datasets. City-Scale Localization (CSL). The City-Scale Localization algorithm [67] is an outlier rejection algorithm, i.e., it is a robust localization algorithm that can prune guaranteed outlier correspondences from a given set of 2D-3D correspondences. CSL is based on the following central insight: If the gravity direction and an approximate height of the camera above the ground plane are known, it is possible to calculate an upper bound for the maximum number of inliers that any solution containing a given 2D-3D correspondence as an inlier can have. At the same time, CSL also computes a lower bound on the number of inliers for a given correspondence by computing a pose for which this correspondence is an inlier. CSL thus computes this upper bound for each 2D-3D match and, similar to RANSAC, continu- A. Details on the Evaluated Algorithms This section provides a detailed description, including parameter settings, of the state-of-the-art algorithms used for experimental evaluation (cf . Sec. 5 in the paper). These details could not be included in the paper due to space constraints. A.1. 3D Structure-based Localization 2 Some of the day-time queries were taken with the same camera as the night-time queries and we enforced that the images taken with the same camera have consistent intrinsics. Thus, the intermediate model provides the intrinsic calibration of the night-time queries. Active Search (AS). Active Search [56] accelerates 2D-3D descriptor matching via a prioritization scheme. It uses a visual vocabulary to quantize the descriptor space. For each 9 Parameter Feature Type Vocabulary Size (trained on SF) Descriptor Dimension (after PCA & whitening) Value Dense RootSIFT 128 Parameter Feature Type Aachen Vocabulary Size RobotCar Vocabulary Size CMU Vocabulary Size p (zi | ēi ) p (z̄i | ei )  p Lnew | Z k−1 4,096 Table 7. DenseVLAD parameters. Parameter Network model (trained on Pitts30k) Descriptor Dimension Value VGG-16 + NetVLAD + whitening 4,096 Value UprightSURF128 3585 5031 4847 0 0.61 0.9 Table 9. FAB-MAP parameters. els. For DenseVLAD, we used the Dense SIFT implementation, followed by RootSIFT normalization [2], available in VLFeat [73]. The visual vocabulary used consisted of 128 visual words (centroids) pre-computed on the SanFrancisco (SF) dataset [15], i.e., we used a general vocabulary trained on a different yet similiar dataset. For NetVLAD we used the pre-computed network “Pitts30k” trained on the Pittsburgh time-machine street-view image dataset [1]. The network is therefore not fine-tuned on our datasets, i.e., we again used a general network trained on a different city. Given a DenseVLAD or NetVLAD descriptor, we find the most similar reference image by exhaustive nearest neighbor search. While this stage could be accelerated by approximate search, we found this to be unnecessary as the search for a single query descriptor typically takes less than 20ms. Tables 7 and 8 summarize the parameters used for DenseVLAD and NetVLAD in our experiments. Table 8. NetVLAD parameters. ously updates the best pose found so far (which provides a lower bound on the number of inliers that can be found). All correspondences with an upper bound on the maximum number of inliers that is below the number of inliers in the current best solution can be permanently discarded from further consideration. When outliers have been discarded, three-point RANSAC [24, 32] is performed on the remaining correspondences. Notice that, unlike RANSAC, the outlier filter used by CSL is deterministic. The computational complexity of the filter is O(N 2 log N ), where N is the number of available 2D-3D correspondences. In order to obtain an estimate for the gravity direction, we follow [67] and add noise to the gravity direction obtained from the ground truth poses. CSL iterates over a range of plausible height values, similar to [77]. In these experiments, the height values cover an interval five meters high. This interval is centered on the camera height of the ground truth pose, with added noise. In the Aachen experiments, the height interval is divided into nine sections, and for the Oxford and CMU experiments, the height interval is divided into three sections. The 2D-3D correspondences are generated by matching the descriptors of all detected features in the query image to the descriptors of the 3D points using approximate nearest neighbour search. To account for the fact that each 3D point is associated with multiple descriptor, the 3D points are each assigned a single descriptor vector equal to the mean of all its corresponding descriptors. This matching strategy yields the same number of correspondences as the number of detected features. As with Active Search, we use a re-projection error threshold of 10 pixels for the Aachen Day-Night dataset and 5 pixels for both the RobotCat Seasons and the CMU Seasons datasets. FAB-MAP. For FAB-MAP [20], we trained a separate vocabulary for each location using Modified Sequential Clustering [68] on evenly spaced database images, resulting in 3,585 visual words for Aachen Day-Night, 5,031 for RobotCar Seasons and 4,847 for CMU Seasons. A Chow-Liu tree was built for each dataset using the Bag-of-Words generated for each database image using the vocabulary. We used the mean field approximation for the new place likelihood (as additional training images were not available for the sampled approach used in [21]) and the fast lookup-table implementation in [27] to perform image retrieval for each of the query locations. Tab. 9 summarizes the parameters used for the experiments. A.3. Optimistic Baselines As explained in Sec. 5 of the paper, we implemented two optimistic baselines. Whereas all other localization algorithms evaluated in the paper use no prior information on a query image’s pose, both optimistic baselines are given additional knowledge. For each query image, we provide a small set of reference images depicting the same part of the model. The remaining problem is to establish sufficiently many correspondences between the query and the selected reference images to facilitate camera pose estimation. As A.2. 2D Image-based Localization DenseVLAD and NetVLAD. We use the original implementations of DenseVLAD [70] and NetVLAD [1] provided by the authors. Images were processed at their original resolution unless any dimension exceeded 1920 pix10 such, both approaches measure an upper bound on the pose estimation quality that can be achieved with a given type of local feature. time images [70, 78]. We used convolutional layers (conv4 and conv3) from a VGG-16 network [61], which was pretrained as part of the NetVLAD model (Pitts30k), as features. We generated tentative correspondences by matching the extracted features in a coarse-to-fine manner: We first match conv4 features and use the resulting matches to restrict the correspondence search for conv3 features. As for LocalSfM, we performed exhaustive pairwise image matching. The matches are verified by estimating up to two homographies between each image pair via RANSAC [24]. The resulting verified feature matches are then used as input for COLMAP [59]. The reconstruction process is the same as for LocalSfM, i.e., we first triangulate the 3D points and then use them to estimate the pose of the night-time query. DenseSfM uses the same set of reference images for each query photo as LocalSfM. LocalSfM. Given a query image and its relevant set of reference images, LocalSfM first extracts upright RootSIFT [2, 40] features. Next, LocalSfM performs exhaustive feature matching between the relevant reference images as well as between the query and the relevant reference images. While Active Seach and CSL both use Lowe’s ratio test3 , DenseSfM neither uses the ratio test nor a threshold on the maximum descriptor distance. Instead, it only requires matching features to be mutual nearest neighbors. Given the known poses and intrinsics for the reference images, LocalSfM triangulates the 3D structure of the scene using the previously established 2D-2D matches. Notice that the resulting 3D model is automatically constructed in the global coordinate system of the reference 3D model. Finally, we use the known intrinsics of the query image and the feature matches between the query and the reference images to estimate the camera pose of the query. For each query image, the relevant set of reference images is selected as follows: For the RobotCar Seasons and CMU Seasons datasets, we use the ground truth pose of each query image to identify a relevant set of reference images. More precisely, we select all reference images whose camera centers are within 5m of the ground truth position of the query and whose orientations are within 135◦ of the orientation of the query image. As explained in Sec. 3.2 of the paper, we manually select a day-time query image taken from a similar viewpoint for each nigh-time query photo in the Aachen Day-Night dataset. The day-time queries were included when constructing the intermediate model. Thus, their ground truth poses as well as a set of 3D points visible in each of them are obtain from the intermediate Structure-from-Motion model. For each day-time query, we select up to 20 reference images that observe the largest number of the 3D points visible in the day-time query. These reference images then form the set of relevant images for the corresponding night-time query photo. LocalSfM is implemented using COLMAP [59]. It is rather straight-forward to replace upright RootSIFT features with other types of local features. In order to encourage the use of our benchmark for the evaluation of local features, we will make our implementation publicly available. A.4. Localization from Multiple Images Active Search + Generalized Cameras (Active Search+GC). While most existing work on visual localization focuses on estimating the camera pose of an individual single query image, this paper additionally evaluates the benefits of using multiple images simultaneously for pose estimation. To this end, we assume that the relative poses between multiple query images are known and model these multiple images as a generalized camera. Given the matches found via Active Search for each individual image in a generalized camera, we use the 3-point-generalized-pose (GP3P) solver from [33] to estimate the pose of the generalized camera. Together with the known relative poses, this provides us with a pose for each image in the generalized camera. We use these individual poses to evaluate the pose estimation accuracy. An inlier threshold of 12 pixels is used by RANSAC. Active Search+GC is not evaluated on the Aachen DayNight dataset as it only provides individual query images. For the RobotCar Seasons, we evaluate two variants: Active Search+GC (triplet) builds a generalized camera from images captured at the same point in time by the three cameras mounted on the RobotCar (left, rear, right). The resulting generalized cameras thus consist of three images each. Active Search+GC (sequence) uses longer sequences taken with all three cameras. Each sequence consists of images taken consecutively in time under the same condition. More specifically, each sequence consists of a temporal sequence of images taken around the 49 manually selected reference positions (cf . Sec. 3.2 in the paper). For the CMU Seasons dataset, we only evaluate the Active Search+GC (sequence). All query images taken under the same condition for a given sub-model define one sequence. In order to use the GP3P solver, the relative poses between the images in a generalized camera, as well as the scale of the relative translations between the images, need to DenseSfM. DenseSfM modifies the LocalSfM approach by replacing RootSIFT [2] features extracted at DoG extrema [40] with features densely extracted from a regular grid [7, 38]. The goal of this approach is to increase the robustness of feature matching between day- and night3 Active Search uses a ratio test threshold of 0.7 for 2D-to-3D and a threshold of 0.6 for 3D-to-2D matching. 11 Parameter Image Size Patch Size Sequence Length ds Value 48 × 48 (144 × 48) 8×8 10 condition Table 10. SeqSLAM parameters. condition # images triplets sequences recorded individual overcast (reference) 28 Nov 2014 20,862 8,707 - dawn dusk night night+rain overcast (summer) overcast (winter) rain snow sun total query 16 Dec 2014 20 Feb 2015 10 Dec 2014 17 Dec 2014 22 May 2015 13 Nov 2015 25 Nov 2014 3 Feb 2015 10 Mar 2015 - 1,449 1,182 1,314 1,320 1,389 1,170 1,263 1,467 1,380 11,934 483 394 438 440 463 390 421 489 460 3,978 54 48 49 51 52 49 50 56 51 460 # images individual sequences recorded Sunny + No Foliage (reference) 4 Apr 2011 7,159 17 Sunny + Foliage Sunny + Foliage Cloudy + Foliage Sunny + Foliage Overcast + Mixed Foliage Low Sun + Mixed Foliage Low Sun + Mixed Foliage Cloudy + Mixed Foliage Low Sun + No Foliage + Snow Low Sun + No Foliage Overcast + Foliage total query 1 Sep 2010 15 Sep 2010 1 Oct 2010 19 Oct 2010 28 Oct 2010 3 Nov 2010 12 Nov 2010 22 Nov 2010 21 Dec 2010 4 Mar 2011 28 Jul 2011 - 8,076 7,260 7,185 6,737 6,744 6,982 7,262 6,649 6,825 6,976 4,639 75,335 16 17 17 17 17 17 17 17 17 17 17 186 Table 12. Detailed statistics for the CMU Seasons dataset. We used images from the reference traversal to build a 3D scene model. For each of the query sequences, we report the total number of query images taken and the number of temporally continuous query sequences used for Active Search+GC (sequence). Scene Table 11. Detailed statistics for the RobotCar Seasons dataset. We used images from the overcast (reference) traversal to build a 3D scene model. For each of the query sequences, we report the total number of query images taken by all three individual cameras, the resulting number of triplets used for Active Search+GC (triplet), and the number of temporally continuous query sequences used for Active Search+GC (sequence). Urban Suburban Park total query Sub-model # images 1-7 8 - 10 11 - 17 - 31,250 13,736 30,349 75,335 Table 13. The type of scenery (urban, suburban and park) depicted in the different sub-models of the CMU Seasons dataset and the total number of query images for each type. In total there are 31,250 urban, 13,736 suburban and 30,349 park images. be known. In our experiments, we extract the required relative poses directly from the ground truth camera poses. As a consequence, the results obtained with Active Search+GC (sequence) are optimistic in the sense that the method does not need to deal with the drift that normally occurs when estimating a trajectory via SLAM or SfM. However, given that modern SLAM systems typically exhibit only a small amount of drift and our sequences are rather short, we believe that our choice has little impact on the validity of our experiments. Notice that we only use the relative poses. No information about the absolute pose of a generalized camera is used during pose estimation. Also, notice that the results obtained for Active Search+GC (triplet) are realistic: In this case, we are only using the known extrinsic calibration between the three cameras mounted on the RobotCar to define each generalized camera. B. Dataset Details This section provides additional details for the RobotCar Seasons and CMU Seasons dataset. More specifically, Tab. 11 details the time at which the individual traversals were recorded, the number of images per traversal, as well as the number of triplets and sequences used for Active Search+GC. Tab. 12 provides similar details for the CMU Seasons dataset. In addition to listing the conditions for the different recordings, Tab. 13 lists the respective scenery (urban, suburban and park) for the different sub-models. C. Timing Results Tab. 14 provides an overview over the run-times of the various methods used for experimental evaluation on the three benchmark datasets. Timings are given in seconds and do include feature matching and (if applicable) camera pose estimation. However, feature extraction times are not included in the run-times since most algorithms are independent of the underlying feature representation and, in extension thereof, the specific implementation used to extract the features. su We ran the different algorithms on different machines. For all variants of Active Search, a PC with an Intel Core i7-4770 CPU with 3.4GHz, 32GB of RAM, and an NVidia GeForce GTX 780 GPU was used. The same machine was used to run LocalSfM. Notice that due SeqSLAM. We used the OpenSeqSLAM implementation from [65] with default parameters for template learning and trajectory uniqueness. For each set of synchronized Grasshopper2 images, we downscale the original 1024 × 1024 resolution to 48 × 48, then concatenate all three images to form a 144 × 48 pixel composite. The trajectory length parameter ds was set to 10 images; as both the query and database images are evenly spaced this corresponds to a trajectory length of 10 meters. Tab. 10 summarizes the parameters used for the RobotCar experiments. 12 Aachen Day-Night Method Active Search CSL DenseVLAD * NetVLAD  FABMAP RobotCar Seasons Day Night full model sub-models full model sub-models 0.291 0.061 0.973 0.093 32.9 90.3† 66.3 90.3† 0.338 0.338 0.137 0.137 0.039 0.039 - Day 0.102 168.6 0.752 0.105 0.008 Night 0.140 206.2 0.527 0.105 0.008 Active Search+GC (triplet) Active Search+GC (sequence) seqSLAM - - 0.879 1.570 0.251 LocalSfM *, DenseSfM * - 19.591 16.719 - 0.180 0.317 - 2.940 5.267 0.251 - - - CMU Seasons All 0.065 30.7 0.785 0.107 0.013 0.289 0.515 - 26.278 - - 44.577 - 22.486 Table 14. Average run-time per method on our three datasets. All timings are given in seconds. The timings include the time required for matching and (if applicable) spatial verification. Feature extraction times however are excluded. For Active Search+GC, which performs pose estimation using multiple cameras, run-times are typically dominated by the feature matching step (which is performed for each image that is part of a generalized camera). Methods marked with * are parallelized over multiple threads; all other methods utilize only a single CPU thread. Methods marked with a  symbol use the GPU, e.g., for feature matching. The two sub-model query times for the CSL are marked with † since the day and night queries were not timed separately, and the reported time is the average time per query over all queries (both day and night). to their need to match multiple images, most of the runtime of Active Search+GC and LocalSfM is spent on feature matching. The increase in run-time for LocalSfM from the Aachen Day-Night to the RobotCar Seasons and CMU Seasons datasets is caused by the number of reference images considered for each dataset. For Aachen Day-Night, at most 20 reference images are considered per query while more images are used on the other two datasets (where more reference images are used for the CMU dataset due to a higher sampling density of the reference images). CSL was run on a computer cluster using an Intel Xeon E5-2650 v3 with 3.2 GB RAM per CPU core. The fact that CSL is substantially slower on the Aachen Day-Night dataset than on the RobotCar Seasons and CMU Seasons datasets is due to the image resolution of the query images. The query images of the Aachen Day-Night dataset have a higher resolution, which results in more detected local features. More features in turn lead to more matches and thus a significant increase in run-time for CSL due to its computational complexity of O(N 2 log N ) for N matches. Both FAB-MAP and SeqSLAM results were generated using a single core of an Intel Core i7-4790K CPU with 4.0GHz and 32GB of RAM. DenseVLAD, NetVLAD4 , and DenseSfM were run on an Intel Xeon E5-2690 v4 with 2.60GHz with 256GB of RAM and an NVidia GeForce TitanX. [2] R. Arandjelović and A. Zisserman. Three things everyone should know to improve object retrieval. In Proc. CVPR, 2012. [3] R. Arandjelović and A. Zisserman. DisLocation: Scalable descriptor distinctiveness for location recognition. In Proc. ACCV, 2014. [4] H. Badino, D. Huber, and T. Kanade. Visual topometric localization. In Intelligent Vehicles Symposium (IV), 2011. [5] P. J. Besl and N. D. McKay. Method for registration of 3-D shapes. In Robotics-DL tentative, pages 586–606. International Society for Optics and Photonics, 1992. [6] J.-L. Blanco-Claraco, F.-Á. Moreno-Dueñas, and J. González-Jiménez. The Málaga urban dataset: High-rate stereo and LiDAR in a realistic urban scenario. Intl. J. of Robotics Research, 33(2):207–214, 2014. [7] A. Bosch, A. Zisserman, and X. Munoz. Image classification using random forests and ferns. In Proc. ICCV, 2007. [8] E. Brachmann, A. Krull, S. Nowozin, J. Shotton, F. Michel, S. Gumhold, and C. Rother. DSAC - Differentiable RANSAC for Camera Localization. In Proc. CVPR, 2017. [9] E. Brachmann, F. Michel, A. Krull, M. Y. Yang, S. Gumhold, and C. Rother. Uncertainty-driven 6d pose estimation of objects and scenes from a single rgb image. In Proc. CVPR, 2016. [10] F. Camposeco, T. Sattler, A. Cohen, A. Geiger, and M. Pollefeys. Toroidal Constraints for Two-Point Localization under High Outlier Ratios. In Proc. CVPR, 2017. [11] F. Camposeco, T. Sattler, and M. Pollefeys. Minimal Solvers for Generalized Pose and Scale Estimation from Two Rays and One Point. In Proc. ECCV, 2016. [12] S. Cao and N. Snavely. Graph-based discriminative learning for location recognition. In Proc. CVPR, 2013. [13] S. Cao and N. Snavely. Minimal Scene Descriptions from Structure from Motion Models. In Proc. CVPR, 2014. [14] N. Carlevaris-Bianco, A. K. Ushani, and R. M. Eustice. University of Michigan North Campus long-term vision and lidar dataset. Intl. J. of Robotics Research, 35(9):1023–1035, 2016. References [1] R. Arandjelović, P. Gronat, A. Torii, T. Pajdla, and J. Sivic. NetVLAD: CNN architecture for weakly supervised place recognition. In Proc. CVPR, 2016. 4 The run-time for NetVLAD includes the intermediate convolutional layer computation essentially corresponding to feature extraction. 13 [33] G. H. Lee, B. Li, M. Pollefeys, and F. Fraundorfer. Minimal solutions for the multi-camera pose estimation problem. Intl. J. of Robotics Research, 34(7):837–848, 2015. [34] Y. Li, N. Snavely, D. Huttenlocher, and P. Fua. Worldwide Pose Estimation Using 3D Point Clouds. In Proc. ECCV, 2012. [35] Y. Li, N. Snavely, and D. P. Huttenlocher. Location Recognition using Prioritized Feature Matching. In Proc. ECCV, 2010. [36] C. Linegar, W. Churchill, and P. Newman. Work smart, not hard: Recalling relevant experiences for vast-scale but timeconstrained localisation. In Proc. ICRA, 2015. [37] C. Linegar, W. Churchill, and P. Newman. Made to measure: Bespoke landmarks for 24-hour, all-weather localisation with a camera. In Proc. ICRA, 2016. [38] C. Liu, J. Yuen, A. Torralba, J. Sivic, and W. T. Freeman. SIFT Flow: Dense correspondence across different scenes. In Proc. ECCV, pages 28–42, 2008. [39] L. Liu, H. Li, and Y. Dai. Efficient Global 2D-3D Matching for Camera Localization in a Large-Scale 3D Map. In Proc. ICCV, 2017. [40] D. Lowe. Distinctive Image Features from Scale-Invariant Keypoints. IJCV, 60(2), 2004. [41] S. Lowry, N. Sünderhauf, P. Newman, J. J. Leonard, D. Cox, P. Corke, and M. J. Milford. Visual place recognition: A survey. IEEE Transactions on Robotics, 32(1):1–19, 2016. [42] S. Lynen, T. Sattler, M. Bosse, J. Hesch, M. Pollefeys, and R. Siegwart. Get Out of My Lab: Large-scale, Real-Time Visual-Inertial Localization. In RSS, 2015. [43] W. Maddern, M. Milford, and G. Wyeth. CAT-SLAM: probabilistic localisation and mapping using a continuous appearance-based trajectory. Intl. J. of Robotics Research, 31(4):429–451, 2012. [44] W. Maddern, G. Pascoe, C. Linegar, and P. Newman. 1 Year, 1000km: The Oxford RobotCar Dataset. Intl. J. of Robotics Research, 36(1):3–15, 2017. [45] M. Milford, S. Lowry, N. Sunderhauf, S. Shirazi, E. Pepperell, B. Upcroft, C. Shen, G. Lin, F. Liu, C. Cadena, et al. Sequence searching with deep-learnt depth for condition-and viewpoint-invariant route-based place recognition. In Workshop on Computer Vision in Vehicle Technology (CVVT), CVPR, 2015. [46] M. J. Milford and G. F. Wyeth. SeqSLAM: Visual routebased navigation for sunny summer days and stormy winter nights. In Proc. ICRA, 2012. [47] P. Mühlfellner, M. Bürki, M. Bosse, W. Derendarz, R. Philippsen, and P. Furgale. Summary maps for lifelong visual localization. Journal of Field Robotics, 2015. [48] R. Mur-Artal, J. M. M. Montiel, and J. D. Tards. ORBSLAM: A Versatile and Accurate Monocular SLAM System. T-RO, 31(5):1147–1163, 2015. [49] T. Naseer, G. L. Oliveira, T. Brox, and W. Burgard. Semantics-aware visual localization under challenging perceptual conditions. In ICRA, 2017. [50] T. Naseer, L. Spinello, W. Burgard, and C. Stachniss. Robust visual robot localization across seasons using network flows. In AAAI, pages 2564–2570, 2014. [15] D. M. Chen, G. Baatz, K. Koeser, S. S. Tsai, R. Vedantham, T. Pylvanainen, K. Roimela, X. Chen, J. Bach, M. Pollefeys, B. Girod, and R. Grzeszczuk. City-scale landmark identification on mobile devices. In Proc. CVPR, 2011. [16] D. M. Chen, G. Baatz, K. Köser, S. S. Tsai, R. Vedantham, T. Pylvänäinen, K. Roimela, X. Chen, J. Bach, M. Pollefeys, B. Girod, and R. Grzeszczuk. City-Scale Landmark Identification on Mobile Devices. In Proc. CVPR, 2011. [17] Z. Chen, A. Jacobson, N. Sünderhauf, B. Upcroft, L. Liu, C. Shen, I. D. Reid, and M. Milford. Deep learning features at scale for visual place recognition. ICRA, 2017. [18] S. Choudhary and P. J. Narayanan. Visibility probability structure from sfm datasets and applications. In Proc. ECCV, 2012. [19] R. Clark, S. Wang, A. Markham, N. Trigoni, and H. Wen. VidLoc: A Deep Spatio-Temporal Model for 6-DoF VideoClip Relocalization. In Proc. CVPR, 2017. [20] M. Cummins and P. Newman. FAB-MAP: Probabilistic Localization and Mapping in the Space of Appearance. Intl. J. of Robotics Research, 27(6):647–665, 2008. [21] M. Cummins and P. Newman. Appearance-only slam at large scale with fab-map 2.0. The International Journal of Robotics Research, 30(9):1100–1123, 2011. [22] M. Donoser and D. Schmalstieg. Discriminative Featureto-Point Matching in Image-Based Locallization. In Proc. CVPR, 2014. [23] J. Engel, T. Schöps, and D. Cremers. LSD-SLAM: Largescale direct monocular SLAM. In Proc. ECCV, 2014. [24] M. Fischler and R. Bolles. Random Sampling Consensus: A Paradigm for Model Fitting with Application to Image Analysis and Automated Cartography. Commun. ACM, 24:381– 395, 1981. [25] D. Gálvez-López and J. D. Tardos. Bags of binary words for fast place recognition in image sequences. IEEE Transactions on Robotics, 28(5):1188–1197, 2012. [26] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun. Vision meets robotics: The KITTI dataset. Intl. J. of Robotics Research, 32(11):1231–1237, 2013. [27] A. Glover, W. Maddern, M. Warren, S. Reid, M. Milford, and G. Wyeth. openFABMAP: An open source toolbox for appearance-based loop closure detection. In Proc. ICRA, 2012. [28] P. Gronat, J. Sivic, G. Obozinski, and T. Pajdla. Learning and calibrating per-location classifiers for visual place recognition. IJCV, 118(3):319–336, 2016. [29] A. Irschara, C. Zach, J.-M. Frahm, and H. Bischof. From Structure-from-Motion Point Clouds to Fast Location Recognition. In Proc. CVPR, 2009. [30] H. Jégou, M. Douze, C. Schmid, and P. Pérez. Aggregating local descriptors into a compact image representation. In Proc. CVPR, 2010. [31] A. Kendall, M. Grimes, and R. Cipolla. PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization. In Proc. ICCV, 2015. [32] L. Kneip, D. Scaramuzza, and R. Siegwart. A Novel Parametrization of the Perspective-Three-Point Problem for a Direct Computation of Absolute Camera Position and Orientation. In Proc. CVPR, 2011. 14 [51] J. Philbin, O. Chum, M. Isard, J. Sivic, and A. Zisserman. Object retrieval with large vocabularies and fast spatial matching. In Proc. CVPR, 2007. [52] R. Pless. Using Many Cameras as One. In Proc. CVPR, 2003. [53] F. Radenović, J. L. Schönberger, D. Ji, J.-M. Frahm, O. Chum, and J. Matas. From Dusk till Dawn: Modeling in the Dark. In Proc. CVPR, 2016. [54] T. Sattler, M. Havlena, F. Radenovic, K. Schindler, and M. Pollefeys. Hyperpoints and fine vocabularies for largescale location recognition. In Proc. ICCV, 2015. [55] T. Sattler, M. Havlena, K. Schindler, and M. Pollefeys. Large-scale location recognition and the geometric burstiness problem. In Proc. CVPR, June 2016. [56] T. Sattler, B. Leibe, and L. Kobbelt. Efficient & Effective Prioritized Matching for Large-Scale Image-Based Localization. IEEE PAMI, 39(9):1744–1756, 2017. [57] T. Sattler, A. Torii, J. Sivic, M. Pollefeys, H. Taira, M. Okutomi, and T. Pajdla. Are Large-Scale 3D Models Really Necessary for Accurate Visual Localization? In Proc. CVPR, 2017. [58] T. Sattler, T. Weyand, B. Leibe, and L. Kobbelt. Image Retrieval for Image-Based Localization Revisited. In Proc. BMVC., 2012. [59] J. L. Schönberger and J.-M. Frahm. Structure-From-Motion Revisited. In Proc. CVPR, June 2016. [60] J. Shotton, B. Glocker, C. Zach, S. Izadi, A. Criminisi, and A. Fitzgibbon. Scene Coordinate Regression Forests for Camera Relocalization in RGB-D Images. In Proc. CVPR, 2013. [61] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. [62] J. Sivic and A. Zisserman. Video Google: A text retrieval approach to object matching in videos. In Proc. ICCV, 2003. [63] X. Sun, Y. Xie, P. Luo, and L. Wang. A Dataset for Benchmarking Image-Based Localization. In Proc. CVPR, 2017. [64] N. Sünderhauf, F. Dayoub, S. Shirazi, B. Upcroft, and M. Milford. On the Performance of ConvNet Features for Place Recognition. In Proc. IROS, 2015. [65] N. Sünderhauf, P. Neubert, and P. Protzel. Are we there yet? Challenging SeqSLAM on a 3000 km journey across [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] 15 all four seasons. In Proc. of Workshop on Long-Term Autonomy, ICRA, 2013. N. Sünderhauf, S. Shirazi, A. Jacobson, F. Dayoub, E. Pepperell, B. Upcroft, and M. Milford. Place Recognition with ConvNet Landmarks: Viewpoint-Robust, Condition-Robust, Training-Free. In RSS, 2015. L. Svärm, O. Enqvist, F. Kahl, and M. Oskarsson. CityScale Localization for Cameras with Known Vertical Direction. IEEE PAMI, 39(7):1455–1461, 2017. A. Teynor and H. Burkhardt. Fast codebook generation by sequential data analysis for object classification. In International Symposium on Visual Computing, pages 610–620. Springer, 2007. A. Torii, R. Arandjelović, J. Sivic, M. Okutomi, and T. Pajdla. 24/7 Place Recognition by View Synthesis. In Proc. CVPR, 2015. A. Torii, R. Arandjelović, J. Sivic, M. Okutomi, and T. Pajdla. 24/7 place recognition by view synthesis. In Proc. CVPR, 2015. A. Torii, J. Sivic, M. Okutomi, and T. Pajdla. Visual place recognition with repetitive structures. IEEE PAMI, 2015. A. Torii, J. Sivic, T. Pajdla, and M. Okutomi. Visual place recognition with repetitive structures. In Proc. CVPR, 2013. A. Vedaldi and B. Fulkerson. VLFeat - an open and portable library of computer vision algorithms. In Proc. ACMM, 2010. F. Walch, C. Hazirbas, L. Leal-Taixé, T. Sattler, S. Hilsenbeck, and D. Cremers. Image-Based Localization Using LSTMs for Structured Feature Correlation. In Proc. ICCV, 2017. S. Wang, M. Bai, G. Mattyus, H. Chu, W. Luo, B. Yang, J. Liang, J. Cheverie, S. Fidler, and R. Urtasun. TorontoCity: Seeing the World With a Million Eyes. In Proc. ICCV, 2017. T. Weyand, I. Kostrikov, and J. Philbin. Planet - photo geolocation with convolutional neural networks. In Proc. ECCV, 2016. B. Zeisl, T. Sattler, and M. Pollefeys. Camera pose voting for large-scale image-based localization. In Proc. ICCV, 2015. H. Zhou, T. Sattler, and D. W. Jacobs. Evaluating Local Features for Day-Night Matching. In Proc. ECCV Workshops, 2016.
1cs.CV
Network Lifetime Maximization for Cellular-Based M2M Networks arXiv:1802.06759v1 [cs.IT] 19 Feb 2018 Amin Azari and Guowang Miao KTH Royal Institute of Technology Email: {aazari, guowang}@kth.se Abstract—High energy efficiency is critical for enabling massive machine-type communications (MTC) over cellular networks. This work is devoted to energy consumption modeling, battery lifetime analysis, lifetime-aware scheduling and transmit power control for massive MTC over cellular networks. We consider a realistic energy consumption model for MTC and model network battery-lifetime. Analytic expressions are derived to demonstrate the impact of scheduling on both the individual and network battery lifetimes. The derived expressions are subsequently employed in the uplink scheduling and transmit power control for mixed-priority MTC traffic in order to maximize the network lifetime. Besides the main solutions, low-complexity solutions with limited feedback requirement are investigated, and the results are extended to existing LTE networks. Also, the energy efficiency, spectral efficiency, and network lifetime tradeoffs in resource provisioning and scheduling for MTC over cellular networks are investigated. The simulation results show that the proposed solutions can provide substantial network lifetime improvement and network maintenance cost reduction in comparison with the existing scheduling schemes. Index Terms—Internet of Things, Machine to Machine Communications, Scheduling, Energy Efficiency, Resource Allocation. I. I NTRODUCTION NTERNET of Things (IoT) refers to the ever-growing network of uniquely identifiable smart physical objects that are capable of sensing or acting on their environment. Cellular IoT, IoT embedded in cellular network infrastructure, is expected to play a critical role in the success of IoT because cellular networks provide ubiquitous coverage and roaming [1]. Cellular machine-to-machine (M2M) communications, also known as machine-type communications (MTC), means the communications of machine devices in cellular networks without human intervention and serves as the foundation of cellular IoT. The continuing growth in demand from cellularbased M2M communications encourages mobile network operators to investigate evolutionary and revolutionary radio access technologies for accommodating M2M traffic in cellular networks [1]. M2M communications are generally characterized by the massive number of concurrent active devices, small payload size, and vastly diverse quality-of-service (QoS) requirements [2]. Moreover, in many M2M applications smart devices are battery driven and once deployed, their batteries will never be replaced. Then, long battery lifetime is crucial for them, especially when deployed in remote areas. Based on the 5G envision by Nokia [3], bit-per-joule energy efficiency for machine-type communications must be improved by a factor of ten in order to provide battery lifetimes around 10 years. I A. Literature Study 1) MTC over Cellular Networks: Random access channel (RACH) of the LTE-Advanced (LTE-A) is a typical way for machine nodes to directly access the base station (BS). The capacity limit of RACH for serving M2M communications is investigated in [4], and it is shown that RACH is neither a scalable nor an energy-efficient access scheme for massive M2M communications. Clustered-access is investigated in [5] to reduce congestion in an overloaded condition. In [6], access class barring with multiple transmit power levels is introduced in order to reduce congestion using the capture effect at the BS. In [7], energy efficient random access for machine nodes in a multi-cell scenario is investigated, where the choice of serving BS and transmit power level are to be optimized. When a device successfully passes the RACH, it can send scheduling request to the BS through the physical uplink control channel (PUCCH). Then, the BS performs the scheduling and sends back the scheduling grants through the corresponding physical downlink control channel (PDCCH). Now, the granted machine node is able to send data over the granted physical uplink shared channel (PUSCH). This scheduling procedure performs well in existing cellular networks for a limited number of long communications sessions, such as voice and web streaming. However, regarding the fundamental differences in characteristics and QoS requirements of M2M communications, it is evident that the presented scheduling procedure cannot survive with a massive number of short-lived M2M communications sessions. The 3GPP LTE has defined some research projects to support low-cost massive machine-type communications in cellular networks. The development of LTE for low-cost massive MTC has been initiated in release 12, and will be continued in release 13 [8]. The target for LTE release 13 includes LTE category M (LTE-M), and narrow-band LTE-M (NB LTE-M) deployments, which are expected to offer MTC over 1.4 MHz and 200 KHz bandwidths [8]. 2) MTC Scheduling over Cellular Networks: Scheduling is the process performed by the BS to assign radio resources to UEs. In general, scheduling is not part of the standardization work, and is left for vendor implementation. However, signaling is standardized, and hence, any scheduling scheme should comply with the control requirements in the standards. Regarding the limited capacity of PDCCH, the number of UEs that can be served at once are limited. Then, the scheduling problem can be broken into two subproblems: (i) time domain scheduling, in which a subset of devices is chosen to be scheduled; and (ii) frequency domain scheduling, in which the available resource elements are allocated to the selected subset of UEs. A thorough survey on LTE scheduling algorithms for M2M traffic is presented in [9]. This survey indicates that existing scheduling algorithms could be categorized into 4 main categories with regard to the scheduling metric as follows [9]: (i) channel-based schedulers, in which UEs with the highest signal to noise ratio (SNR) have priority in resource allocation in order to minimize the bit error rate and maximize the system throughput [10]; (ii) delay-based schedulers, in which the delay budget prioritize devices for resource allocation [11, 12]; (iii) fairness-based schedulers, which are designed to guarantee a fair distribution of radio resources among UEs [13]; and (iv) hybrid schedulers, which consider a combination of the aforementioned metrics as well as other metrics like power consumption [14], buffer status, and data arrival rates [9]. 3) Energy-Efficient MTC Scheduling: While providing scalable yet energy efficient communications is considered as the key requirement for successful deployment of MTC over existing cellular networks [3, 4], a limited number of research works has been focused on energy efficient uplink MTC scheduling. Energy efficiency of M2M communications over LTE networks is investigated in [15], and it is shown that LTE physical layer is not optimized for small data communications. Power-efficient uplink scheduling for delay-sensitive traffic over LTE systems is investigated in [16], where the considered traffic and delay models are not consistent with the MTC characteristics [2], and hence, the derived results cannot be used here. Power-optimized resource allocation for time, frequency, and code division multiple access (TDMA, FDMA, CDMA) systems has been investigated in [17]. Uplink scheduling for LTE networks with M2M traffic is investigated in [14], where the ratio between the sum data rates and the power consumptions of all users is maximized. In [14], the authors have considered a simple model for energy consumption considering only the transmit power for reliable data transmission and neglected the other energy consumptions by the operation of electronic circuits which are comparable or more dominant than the energy consumption for reliable data transmission [18]. In [19], a clean slate solution for dense machine deployment scenarios is proposed in which, each communications frame is divided into two subframes. The first subframe is dedicated to the contention of machine nodes for access reservation, and the later is dedicated to scheduled data transmission of successful nodes using TDMA scheme. To the best of our knowledge, accurate modeling of energy consumption in machine-type communications, individual and network battery lifetime models, and corresponding scheduling algorithms are absent in literature. As an extension of [5], which investigates clustered-access for massive M2M, in [20] joint energy efficient clustering and scheduling has been investigated, i.e. the cluster-size, selection of clusterheads, and the amount of scheduled resources to clusterheads have been optimized to prolong the battery lifetime. In [21, 22], preliminary studies on feasibility of battery lifetimeaware scheduling for unclustered M2M communications have been presented, and two exhaustive search algorithms for scheduling over frequency domain resources have been de- veloped. Substantial extension to [21, 22] has been made in this paper, where sophisticated scheduling algorithms over time/frequency resources along with low-complexity and limited feedback solutions have been developed under different network lifetime definitions. Furthermore, detailed analytical analysis, derivation of closed-form scheduling expressions, and complexity and fairness analysis have been presented in this paper. B. Contributions The main contributions of this paper include: • • • • • Introduce accurate energy consumption, and individual and network lifetime models for machine-type devices deployed in cellular networks by taking both transmission and circuit energy consumptions into account. Present a battery lifetime aware resource allocation framework. Explore MTC scheduling based on the MaxMin lifetime-fairness, and analyze its contribution in reducing the maintenance costs of M2M networks. Present uplink scheduling solutions for MTC over singlecarrier frequency division multiple access (SC-FDMA) systems. Present low-complexity scheduling solutions with limited feedback requirement. Figure out the energy efficiency, spectral efficiency, and network lifetime tradeoffs in uplink MTC resource provisioning and scheduling. Extend the proposed solutions for existing 3GPP LTE networks. Present lifetime-improvement evidence using simulation results in the context of LTE. The rest of this paper is organized as follows. In the next section, the system model is presented. The battery lifetimeaware scheduling framework, and the coupling between network lifetime and control parameters are presented in section III by investigating M2M scheduling in time domain for narrow band cellular M2M networks. The general scheduling problem with time/frequency domain radio resources is investigated in section IV. Low complexity scheduling solutions with limited feedback requirement are investigated in section V. As an example of lifetime-aware scheduling, in section VI we apply the derived solutions in section IV-V to the 3GPP LTE networks, and provide simulation results in section VII in order to demonstrate the lifetime improvement. Concluding remarks are given in section VIII. II. S YSTEM M ODEL Consider a single cell with one base station and a massive number of machine nodes, which are uniformly distributed in the cell. The machine nodes are battery driven and once deployed, their batteries won’t be replaced, then long batterylifetime is crucial for them. Consider the uplink scheduling problem at time t, where a set of devices, denoted by A, is to be served using a limited set of resources. As we aim at deriving network lifetime maximizing solutions, both individual and network battery-lifetime metrics are defined. A. Lifetime Metric For most reporting MTC applications, the packet generation at each device can be modeled as a Poisson process [23], and hence, the energy consumption of a device can be seen as a semi-regenerative process where the regeneration point is at the end of each successful data transmission. For node i, the remaining energy at time t is denoted by Ei (t), the average payload size by Di , and the power consumption in transmission mode by ξPi + Pc , where Pc is the circuit power consumed by electronic circuits, ξ is the inverse of power amplifier (PA) efficiency, and Pi is the transmit power for reliable data transmission. We define the expected lifetime for node i at the regeneration point as the multiplication of reporting period by the ratio between remaining energy and the average energy consumption per reporting period, as follows: ∆ Li (t) = Ei (t) Ti , Esi + Edi (1) where Edi is the average energy consumption per reporting period for data transmission: Edi = [Pc + ξPi ]Di /Ri , Ri is the average data transmission rate, Ti the expected length of one reporting period, and Esi the average static energy consumption in each reporting period for data gathering, processing, and etc. B. Network Lifetime Definition The network lifetime is the time between the reference time and when a network is considered to be nonfunctional. The instant at which an M2M network is considered to be nonfunctional is application-specific. For example, in safetycritical applications where losing even one node deteriorates the performance or coverage, or in sparse sensor deployments where correlation between gathered data by different nodes is low, the shortest individual lifetime (SIL) may specify the network lifetime. In other cases, e.g. where correlation between gathered data by different nodes is high, the longest individual lifetime (LIL) or the average individual lifetime (AIL) may be defined as the network lifetime. Here, we present our derivations for the case in which, the shortest individual lifetime is considered as the network lifetime, i.e. Lsil net (t) = mini Li (t); however, as we will show in section IV and VII, our proposed lifetime-aware resource allocation framework can be also used with other network lifetime definitions. III. S CHEDULING FOR NARROW-BAND M2M N ETWORKS To facilitate the understanding of the fundamental dependence of network lifetime on the remaining energy, reporting period, channel gain, circuit power, and bandwidth, here we investigate SIL-aware scheduling for a narrow-band M2M system. Examples of such systems are 2G GSM-based M2M networks, LTE networks in which a specific carrier is reserved for an MTC application, and proprietary M2M networks. In these systems, as at most one node occupies the whole bandwidth at each time, the uplink scheduling is equivalent to finding the transmission time for each node. Denote the length of the resource pool in time domain as τ , the bandwidth as w, and the allocated fraction of time for data transmission of node i as τi . Then, the lifetime expression for node i is found from (1), where Edi = τi [Pc +ξPi ]. Denote the signal-tointerference-plus-noise ratio (SINR) for reliable transmission of Di bits in τi seconds to be ηi = S(Di /τi ). For example, using Shannon capacity formula the data rate function is derived as: ηi ), Ri = w log(1 + Γmcs and correspondingly S(x) is derived as:   x S(x) = 2 w − 1 Γmcs . (2) In this expression, Γmcs is the SNR gap between the channel capacity and a practical modulation and coding scheme (MCS), as investigated in [18]. One sees in (2) that S(x) is strictly convex in x and S(0) = 0. Thus, we do not choose a specific MCS, and hence, do not specify the exact form of S(x) in our analysis. Instead, we only assume S(x) to be strictly convex in x and S(0) = 0. Denote the channel gain between node i and the BS as hi . Then, the required transmit power for node i will be Pi = ηi [N0 + I]w/[hi Gtr ], where Gtr is the multiplication of transmit and receive antenna gains, and the power spectral densities (PSDs) of noise and interference at the receiver are denoted by N0 and I, respectively. Then, the scheduling optimization problem that maximizes the network lifetime is formulated as follows: maximizeτi Lsil net (t) X subject to: C.3.1: τi ≤ τ, (3) i∈A C.3.2: τim ≤ τi ∀i ∈ A, where τim is the minimum required transmission time, and is found as a function of maximum allowed transmit power Pmax , by solving the following equation: S( Di Pmax hi Gtr )= . τim [N0 + I]w One can define Z as an auxiliary variable where Z = maxi∈A Li1(t) , and rewrite (3) as: minimizeτi Z subject to: C.3.1, C.3.2, and (4) 1 ≤ Z, Li (t) ∀i ∈ A. Taking the second derivative of the inverse lifetime expression, ξ[N0 + I]w Di2 ∂ 2 1/Li = S̈(Di /τi ), ∂τi2 Ei (t)Ti hi Gtr τi3 one sees that it is a strictly convex function of τi because S̈(x) > 0, where f˙(x) and f¨(x) show the first and second derivatives of function f (x) respectively. Thus, Z is also a strictly convex function of τi because the point-wise maximum operation preserves convexity [24]. Then, the scheduling problem in (4) is a convex optimization problem, and can be solved using convex optimization tools, as has been investigated in appendix A. In the special case that S(x) is found from (2) and Γmcs = 1, the real-valued solution of (31) is found from appendix A as:  τi∗ = max τim , w+ ln(2)Di  1 [hi Gtr ][Pc +Ti Ei (t)µ/λi ] L( e ξ(N0 +I)w ,  − 1 )w (5) where e is the Euler’s number, and L(x) is the LambertW function, i.e. inverse of the function f (x) = x exp(x) [25]. Motivated by the facts that: (i) scheduling is done in the time domain; and (ii) nodes which are more critical from network battery lifetime point of view receive a longer transmission time than the minimum required transmission time in order to decrease their transmission powers; the expression in (34) represents priority of nodes in uplink scheduling when network battery lifetime is to be maximized. From (34), one sees that the priority of nodes in lifetime-aware scheduling: 1 1 ∗ • increases with E (t) and T , because τi increases when i i the remaining energy, i.e. Ei (t), decreases or the packet generation rate, i.e. 1/Ti , increases. 1 ∗ • increases with h , because τi increases for devices dei ployed far from the BS or compensate a large pathloss, in order to reduce the transmit power and save energy. ∗ • increases with Di , because τi increases in the size of buffered data to be transmitted. In the case that there is no constraint on the amount of available radio resources, the optimal transmission time is found as:  ln(2)Di τi∗ = max τim ,  }.  1 Pc [hi Gtr ] w + L( e ξ(N0 +I)w − 1 )w In this case, when the circuit power consumption increases, the optimal transmission time decreases, and hence, the transmit power increases. Then, for nodes in which the circuit power is so high that is comparable with the transmit power, it is more energy efficient to transmit data with a higher transmit power in order to finish data transmission in a shorter time interval, and hence, reduce the circuit energy consumption. Also, the scheduler must provide time-domain scheduling priority for these devices to decrease their waiting time before receiving services, which decreases their energy consumption in the idle listening to the base station. Based on these preliminary insights to the lifetime-aware scheduling problem, in the next section MTC scheduling in both time and frequency domains for SC-FDMA systems is investigated. IV. MTC S CHEDULING OVER SC-FDMA [28]. Consider the scheduling problem at time t, where a set of nodes, i.e. A, with cardinally |A| are to be scheduled for uplink transmission. Denote the set and total number of available chunks as C and |C|, where each chunk consists of M adjacent subcarriers with a time duration of τ . Here, we investigate time- and frequency-domain scheduling, i.e. if the number of resource elements is not sufficient to schedule A at once, a subset of A is selected, and then, the available resources are assigned to this subset using a frequency-domain scheduler. The effective SINR for a SC-FDMA symbol is approximated as the average SINR over the set of allocated subcarriers because each data symbol is spread over the whole bandwidth [16]. Then, the achievable data rate for node i is written as: R(Ci , Pi ) = |Ci |M Sv (ηi ), (6) where Ci represents the set of allocated chunks to node i, |Ci | Pi Gtr hei , S (x) is the inverse of the cardinality of Ci , ηi = |C v i |M S(x) which is a strictly convex and increasing function of x, and hence, Sv (x) is a strictly concave function of x [24]. Also, hei is the effective channel gain-to-interference-plus-noise ratio for node i and is defined as [16]  X [N0 + Ij ]M w  , hei = |Ci |/ hji j∈Ci where hji is the channel gain2 of node i over chunk j, Ij is the PSD of interference on chunk j, and w is the bandwidth of each subcarrier. Thus, using (1) the expected lifetime of node i at time t + τ is formulated as a function of Pi and Ci as follows: Li (t + τ ) = Ei (t + τ ) − [1 − θi ]Edi Ti , Esi + Edi (7) where Ei (t + τ ) = Ei (t) − τ Pc [1 − θi ] −  Di  Pc + ξPi θi , R(Ci , Pi ) (8) θi is 1 if node i is scheduled with |Ci | > 0 and 0 otherwise, and [1 − θi ]Edi is the expected energy consumption from t + τ till the successful transmission, i.e. the regeneration point. Now, one can formulate the scheduling problem as: maximizeCi ,Pi ,θi Lsil net (t + τ ) X subject to: C.9.1: |Ci | ≤ |C|, (9) i∈A C.9.2: Ci : contiguous ∀i ∈ A, C.9.3: Ci ∩ Cj = ∅ ∀i, j ∈ A, i 6= j, C.9.4: θi Di /R(Ci , Pi ) ≤ τ ∀i ∈ A, C.9.5: Pi ≤ Pmax ∀i ∈ A, SC-FDMA is a favorite multiple access scheme for energylimited uplink communications. Using SC-FDMA implies that: (i) only G clusters of adjacent subcarriers can be allocated to each node1; (ii) the transmit power over all assigned subcarriers to a node must be the same [16]; and (iii) subcarriers are grouped into chunks, before being assigned to the nodes where ∅ is the empty set, and Qi ∈ {0, 1} is a binary parameter used for prioritizing traffics from high-priority nodes or traffics with zero remaining delay budgets to be transmitted immediately. The scheduler gives the highest priority to the 1 This is the contiguity constraint [26]. In existing LTE-A networks, G = 1, 2 are used. As PAPR and spectral efficiency increase in G [27], for MTC applications G = 1 is preferred. 2 The channel gain of a user over all subcarriers of one chunk is assumed to be constant in (t, t + τ ) [16]. C.9.6: [1 − θi ]Qi = 0 ∀i ∈ A, traffic from node i if Qi = 1. If Qi = 0, node i will be either scheduled by using the remaining radio resources from scheduling high-priority traffic or will be scheduled in later time slots. In (9), C.9.1 is due to the limited set of available uplink radio resources, C.9.2 is due to the contiguity requirement in SC-FDMA, C.9.3 assures each resource element will be at most allocated to one device, C.9.4-5 assure that the Di bits of data can be transmitted over the assigned set of contiguous resources with a transmit power lower than the maximum allowed transmit power, and C.9.6 assures that high priority traffic will be scheduled ahead of low-priority traffic. One sees that the optimization problem in (9) is not a convex optimization problem due to the contiguity constraint, as discussed in [16]. The straightforward solution for this problem consists in reformulating the problem as a pure binary-integer program. From [28], we know that the complexity of search over all feasible resource allocations for SC-FDMA systems is X|A| |A|  |C|−1  i! i−1 . (10) i i=1 Thus, the straightforward approach is clearly complex, especially for cellular networks with massive machine-type communications. While shifting complexity from device-side to network-side is feasible for enabling massive IoT connectivity in beyond 4G era [29], and quantum-assisted communication for realizing such receivers has been introduced in [30, 31], here we focus on deriving low-complexity scheduling solutions which are applicable even in existing cellular infrastructures. In the following, we present a low-complexity lifetimeaware scheduling solution. A. Low-Complexity Scheduling Solution: The Prerequisites Before presenting our proposed solution, in the sequel a set of prerequisites are investigated. 1) Optimized transmit power for a given scheduling: For a fixed chunk assignment to node i, i.e. Ci , one can use the results presented in [32, section III] to prove that the presented energy consumption expression for time interval [t, t + τ ] in (8) is a strictly quasiconvex function of Pi . Then, one can find the transmit power that minimizes the energy consumption in this interval. Using convex optimization theory, the optimal transmit power is found as the maximum of Pmin and the solution to the following equation: Sv (KPi ) − K[Pc /ξ + Pi ]S̈v (KPi ) = 0, where K = solution to: Gtr hei |Ci |M , and from C.9.4, one can drive Pmin as the Sv (Pmin K) = Di /[τ |Ci |M ]. As an example, when S(x) is found from (2), the optimal transmit power is:     1  KPc /ξ − 1 −1 , P(Ci ) = min Pmax , max Pmin , K L( KPc /ξ−1 ) e (11) h i Di and Pmin is found as: Pmin = 2 τ M |Ci |w − 1 /K. 2) Scheduling metric: Let us consider the scheduling problem at time t, where |C| − 1 chunks are already allocated to the nodes, Ci shows the set of already assigned resources to node i, and one further chunk is available to be allocated to the already scheduled or non-scheduled nodes. Given Ci and θi , the expected lifetime of node i at t + τ is derived from (7)-(8), as follows: ∆ F (Ei (t), Edi , Esi , Ti , Ci , θi ) = Li (t + τ ) = (12)   Di Pc +ξP(Ci )  θi − [1 − θi ]Edi Ei (t) – τ Pc [1 − θi ] − R Ci ,P(Ci ) Ti . Esi + Edi When the SIL network lifetime is to be maximized, the index of node with highest priority to be scheduled is found as follows: sil Lsil net (t + τ )|opt. scheduling > Lnet (t + τ )|any scheduling ∗ ∗ → min{Li (t + τ ) + ∆Lii } > min{Lj (t + τ ) + ∆Ljj }, i∈A j∈A ∗ where i is the index of selected node using optimal scheduler, j ∗ the index of selected nodes using any other scheduler, ∆Lji the change in the lifetime of node i when the extra chunk is allocated to node j, and ∆Lji = 0 for i 6= j. Then, we have: ∗ min{Li∗ + ∆Lii∗ , Lj ∗ , min i∈A\{i∗ ,j ∗ } ∗ min{Li∗ , Lj ∗ + ∆Ljj ∗ , Li } > min j∈A\{i∗ ,j ∗ } Lj }, ∗ ∗ → min{Li∗ + ∆Lii∗ , Lj ∗ } > min{Li∗ , Lj ∗ + ∆Ljj ∗ }, (13) where the time index is dropped for the sake of notational continence. One sees that the only choice of i∗ that satisfies (13) for any choice of j ∗ at time t is i∗ (t) = arg min Li (t + τ ) i∈A = arg min F (Ei (t), Edi , Esi , Ti , Ci , θi ), (14) i∈A ∗ if it satisfies the lifetime improvement constraint: ∆Lii∗ > 0, i.e. its battery lifetime can be improved by assigning the new chunk. If the battery lifetime of i∗ (t) cannot be improved, we remove i∗ from A, and repeat the criterion in (14) in order to find node with the shortest lifetime that can improve its lifetime using more chunks. Denote by VX the expected battery lifetime vector, where X is the scheduling criterion, and the ith element of VX shows the expected battery lifetime of node i under criterion X . Definition A feasible scheduling satisfies the max-min fairness criterion if no other scheduling has a lexicographically s s greater sorted lifetime vector, i.e. Vmax-min ≥lex Vany , where the superscript s shows sorting in non-decreasing order [33]. In other words, this definition means that if we schedule machine nodes under criterion X , derive their expected battery lifetimes after scheduling, and sort the battery lifetimes in vector VX ; the resulting lifetime vector from max-min fairness scheduling is lexicographically greater than the resulting lifetime vector from any other scheduling criterion. Then, the smallest resulting battery lifetime from the max-min fairness criterion will be as large as possible, and the second-smallest resulting battery lifetime will be as large as possible, and so on. Comparing the proposed iterative structure in this subsection for prioritizing nodes in lifetime-aware scheduling with the definition IV-A2 shows that the proposed scheduling procedure achieves the max-min fairness. This is due to the fact that our scheduler first schedules node with the shortest expected lifetime, then schedules node with the second shortest lifetime, and etc. As a result, the increase in battery lifetime of the selected node in each phase will not be at the cost of decrease in the battery lifetime of another node with already shorter battery lifetime. B. Lifetime-Aware Scheduling Solution: The Procedure The basic idea behind our proposed solution is breaking the scheduling problem into two subproblems: (i) satisfying the minimum resource requirement for the set of high-priority nodes which must be scheduled at time t, called Ad ; and (ii) resource allocation for all nodes based on their impacts on the network lifetime. Our proposed solution, presented in Algorithm 1, solves the first and second subproblems in step 1 and 2 respectively. The first subproblem is a frequency-domain scheduling problem, where the scheduler allocates contiguous resource elements to the nodes which must be scheduled immediately to satisfy their minimum resource requirements. The second subproblem is a time/frequency scheduling problem. As the minimum resource requirement of Ad has been already satisfied in step 1, the scheduler in step 2 selects node with the highest impact on the network lifetime among the scheduled and non-scheduled nodes, and allocates contiguous resource elements to it in order to prolong its battery lifetime, and hence, maximizes the network lifetime. In Algorithm 1, we call a resource expansion algorithm named ExpAlg, which is presented in Algorithm 2. Given the set of available resources, i.e. C, the set of already allocated resources to the ith node, i.e. Ci , and the maximum allowed number of allocated resource clusters to a node, i.e. G, this algorithm finds the resource element which satisfies the contiguity constraint, and on which, node i has the best SINR. Algorithm 1: SIL-aware scheduling for SC-FDMA 1 2 i∈A and sum of the logarithms of individual lifetimes (SLIL) defined as: X Lslil log(Li (t)). net (t) = i∈A One sees that AIL-aware scheduling aims at maximizing the average battery lifetime of machine devices without providing fairness among them, while SLIL-aware scheduling Step 2; - Ad ∪ Acd → H; - while C and H are non-empty do - j ∗ = arg minj∈H F (Ei (t), Edi , Esi , Ti , Ci , θi ); - if θj ∗ 6= 1 then - 1 → θj ∗ ;  - while Dj ∗ /R Cj ∗ , Pmax > τ do - ExpAlg(C, Cj ∗ , G) → c∗ , c∗ ∪ Cj ∗ → Cj ∗ , C \ c∗ → C; - If c∗ = ∅, then 0 → θi , Cj ∗ ∪ C → C, H \ j ∗ → H, exit the loop; else Di [Pc +ξP (Cj∗ )] - R(C → B; j ∗ ,P (Cj ∗ )) - ExpAlg(C, Cj ∗ , G) → c∗ ; - if c∗ = ∅ then - H \ j ∗ → H; else - c∗ ∪ Cj ∗ → Cj ∗ , C \ c∗ → C; Di [ξP(Cj∗ )+Pc ] - If R(C > B, then j ∗ ,P(Cj ∗ )) Cj ∗ \ c∗ → Cj ∗ , C ∪ c∗ → C, H \ j ∗ → H; 3 4 C. Extension to Other Network Lifetime Definitions The proposed framework in subsection IV-B can be also used with other network lifetime definitions. When the longest individual lifetime is considered as the network lifetime, the scheduling solution is found from a modified version of Algorithm 1, in which the argmin operator is replaced with the argmax operator. In the sequel, we consider two other network lifetime definitions including: (i) average individual lifetime defined as: X Lail Li (t), net (t) = [1/|A|] Initialization; - Define Ad , where i ∈ Ad if Qi = 1; - Define Acd as A \ Ad ; - 0 → θi and ∅ → Ci , ∀i ∈ A ; Step 1; - A → Atd ; - while Atd is non-empty do - arg minj∈Atd Lj (t) → j ∗ ; - Atd \ j ∗ → Atd , 1 → θi ;  - while Dj ∗ /R Cj ∗ , Pmax ) > τ do - ExpAlg(C, Cj ∗ , G) → c∗ , c∗ ∪ Cj ∗ → Cj ∗ , C \ c∗ → C; - If c∗ = ∅, then 0 → θi , Ad \ j ∗ → Ad , Cj ∗ ∪ C → C, exit the loop; P(Ci ) → Pi , ∀i ∈ A; return Pi , θi , Ci , ∀i ∈ A Algorithm 2: Resource expansion algorithm (ExpAlg) - Inputs: C, Ci , G; - Number of existing resource clusters in Ci → n; - if n < G then mi ; - c∗ = arg maxm∈C Nh0 +I m else - Adjacent resource elements to Ci → C; mi ; - c∗ = arg maxm∈C Nh0 +I m return c∗ aims at maximizing the average battery lifetime of machine devices with providing proportional fairness among them. [34, chapter 4]. In order to modify Algorithm 1 for AIL- and SLIL-aware scheduling, one needs to derive the respective scheduling metrics, which are investigated in the following. 1) Scheduling metric for AIL: Following the discussion in subsection IV-A2, when AIL network lifetime is to be maximized, index of the node with highest priority in scheduling is found as: ail Lail net (t + τ )|opt. scheduling > Lnet (t + τ )|any scheduling X X ∗ ∗ → Li + ∆Lii > Lj + ∆Ljj , i∈A j∈A → Li∗ + ∗ ∆Lii∗ + Lj ∗ + X Li > Li∗ + Lj ∗ i∈A\i∗ ,j ∗ ∗ + ∆Ljj ∗ + X Lj , j∈A\i∗ ,j ∗ ∗ ∗ → ∆Lii∗ > ∆Ljj ∗ , (15) where the time index is dropped for the sake of notational convenience. One sees that the only choice of i∗ that satisfies (15) for any choice of j ∗ at time t is i∗ (t) = arg max ∆Lii , (16) i∈A = arg max F (Ei (t), Edi , Esi , Ti , Ci+ , 1)− i∈A F (Ei (t), Edi , Esi , Ti , Ci , θi ), where Ci+ shows the updated set of assigned chunks to node i, i.e. the set of already assigned chunks plus the new chunk. Then, for each available chunk we need to find the node that its lifetime improvement with the extra chunk is higher than the others. 2) Scheduling metric for SLIL: If SLIL network lifetime is the case, index of the node with highest priority to be scheduled is found as follows: slil Lslil net (t + τ )|opt. scheduling > Lnet (t + τ )|any scheduling X X ∗ ∗ → log(Li (t + τ )+∆Lii ) > log(Lj (t + τ ) + ∆Ljj ), i∈A → Y j∈A Li (t + τ ) + ∗ ∆Lii i∈A > Y ∗ Lj (t + τ ) + ∆Ljj , j∈A ∗ ∆Lii∗ Li∗ (t + τ ) + → Li∗ (t + τ ) ∗ Lj ∗ (t + τ ) + ∆Ljj ∗ > . Lj ∗ (t + τ ) (17) One sees that the only choice of i∗ that satisfies (17) for any choice of j ∗ at time t is ∗ Li∗ (t + τ ) + ∆Lii∗ i∈A Li∗ (t + τ ) F (Ei (t), Edi , Esi , Ti , Ci+ , 1) = arg max . i∈A F (Ei (t), Edi , Esi , Ti , Ci , θi ) i∗ (t) = arg max (18) Comparing (14), (16), and (18), one sees how SIL- and SLILaware scheduling provide max-min and proportional fairness among machine nodes, respectively. D. Performance Analysis In the outer loop of the first step of Algorithm 1, the scheduler iterates over the set of prioritized nodes. In each iteration, it satisfies the minimum resource requirement of a selected node, and hence, the maximum number of iterations in step 1 will be |Cd | ≤ |C|, where Cd is the set of allocated resources to Ad . In the second step, the scheduler iterates over the set of remaining resources, and in each iteration it assigns one resource element to a selected node. Then, the maximum number of iterations in the second step is |C \ Cd |, and hence, the complexity order of Algorithm 1 is O(|C|), which is significantly lower than complexity of optimization problem (9), derived in (10). This complexity reduction comes at the cost of performance degradation in comparison with the non-relaxed problem in (9). The gap in performance is due to the fact that the proposed algorithm 1 works in a sequential manner, i.e. it selects the most energy-critical node, allocates the best resource chunk to it, and continues by allocating neighbor resource chunks to it3 until it becomes satisfied. One can see that while this sequential structure simplifies the solution, it degrades the performance by not selecting a bunch of neighbor chunks at once. In other words, a chunk on which a tagged node has the best SINR may lead to selection of a suboptimal set of neighbor chunks due to the contiguity constraint in SC-FDMA. However, regarding the fact that in recent releases of LTE like LTE-A clusters of chunks can be allocated to the users, i.e. G > 1 is available, the proposed scheduler will not suffer much from the contiguity constraint. On the other hand, the main drawback of this algorithm is seemed to be the need for channel state information (CSI), as the level of consumed energy in CSI exchange with the BS is comparable with, or even higher than, the consumed energy in actual data transmission. We discuss this problem in section V, and tackle it by presenting limited-feedback requiring variants of Algorithm 1. One must note that in algorithm 1 we have used a binary variable for prioritizing different M2M traffic types. In practice, regarding the diverse set of QoS requirements of different M2M applications, scheduler must be able to handle traffic streams with multi-level priorities, e.g. alarms, surveillance cameras, temperature sensors, and etc. Multilevel prioritized scheduling has been recently investigated in [12]. Then, design of a hybrid scheduler combining energy preserving features presented in Algorithm 1 with multi-level prioritized scheduling features presented in [12] makes an interesting research direction for our future research. V. L IFETIME -AWARE MTC S CHEDULING F EEDBACK WITH L IMITED In the previous section, we have presented a lifetime-aware scheduling solution which aims at maximizing the network lifetime. This scheme requires the CSI of machine nodes as well as other communications characteristics to be available at the BS. However optimal scheduling based on these information sets can improve the network lifetime, it requires machine nodes to send several status packets while the actual amount of useful data to be transmitted in many MTC applications is very limited [15]. Thus, in this section we present a low-complexity low-feedback frequency-domain scheduling solution to be used with other time-domain schedulers. This scheduler aims at maximizing the network lifetime while the remaining energy 3 due to the contiguity constraint level, reporting period, average static energy consumption, and average pathloss for each device are required at the BS. For M2M applications with limited device mobility, the average pathloss, reporting period, and static energy consumption are semi-constant during the lifetime of a device, and hence, the BS can save them for future use. Also, the energy consumption of each machine device is expected to be very low, then change in the remaining energy will happen in long time intervals and the BS needs to update it in long time intervals, from days to months. Potential applications of this scheduling solution will be presented in subsection V-A. Denote the subset of devices which are to be scheduled at time t as A. From (1), the expected lifetime of node i at time t, which is scheduled with |Ci | > 0 chunks, is formulated as follows: Li (t) = Ei (t)Ti , Esi + Di [ξPi + Pc ]/R(|Ci |, Pi ) Algorithm 3: SIL-aware scheduling with limited feedback 1 2 - If At is empty, then 0 → Ctn ; (19) 3 where 4 R(|Ci |, Pi ) = |Ci |M Sv ( Pi Gtr ), |Ci |M γi [N0 + I]w maximize|Ci |,Pi subject to: C.21.1: X i∈A (21) |Ci | ≤ |C|, Di ≤ τ ∀i ∈ A, R(|Ci |, Pi ) C.21.3: Pi ≤ Pmax ∀i ∈ A, C.21.4: |Ci | ∈ N0 , C.21.2: where N0 is the set of non-negative integers. Using C.21.2, the minimum resource requirement of node i, i.e. |Ci |min , is found by solving the following equation: |Ci |min M Sv ( Pmax Gtr ) = Di /τ. |Ci |min M γi [N0 + I]w (22) One sees that the optimization problem in (21) is not a convex optimization problem because of the Pi /|Ci | term in (20). To find an efficient solution for this problem, one can pursue a similar approach as in Algorithm 1. The overall solution procedure is presented in Algorithm 3. This algorithm first satisfies the minimum resource requirements of all nodes. Then, if the set of remaining chunks, i.e. Ctn , is non-empty, it finds node with the shortest individual lifetime that its lifetime can be improved by assigning more chunks and assigns it one more chunk. In this algorithm, F (Ei (t), Esi , Ti , |Ci |) = Esi + Ei (t)Ti Di [ξP(|Ci |)+Pc ] R(|Ci |,P(|Ci |)) P(y(i)) → p(i), ∀i ∈ A; return y and p; (20) and γi is the distance-dependent path-loss between node i and the BS. Then, the problem in (9) is rewritten as: Lsil net (t) Initialization; - Derive |Ci |min , ∀i ∈ A, from (22); - |Ci |min → y(i), ∀i ∈ A; - F (Ei (t), Esi , Ti , y(i)) → f (i), ∀i ∈ A; - A → At ; while Ctn do - arg mini∈A f (i) → m; - y(m) + 1 → x; - if F (Em (t), Esm , Tm , x) > f (m) then - Ctn − 1 → Ctn , x → y(m); - F (Em (t), Esm , Tm , y(m)) → f (m); else - At \ m → At , and ∞ → f (m); , where the optimized transmit power for a given number of chunks, i.e. P(|Ci |), is found from (11). The outputs of this algorithm are y and p vectors, where the ith entries of them show the number of allocated chunks and the transmit power for the ith node, respectively. A. Complexity Analysis and Potential Applications Algorithm 3 works over the set of all nodes in the first step, and over the set of remaining chunks in the later steps. Thus, its complexity order is O(|C|). Algorithm 3 can be used along with the specified time-domain schedulers in [9] in order to allocate frequency domain resources to energy-limited nodes and prolong the network lifetime. Another important application of this low complexity scheduler consists in uplink scheduling for time-controlled M2M communications. The 3GPP and IEEE have defined specific service requirements and features for M2M communications where one of the most important ones is the time-controlled feature [2, 35]. Based on this feature, the BS can assign a set of resources, which are repeated in time in regular time intervals, to a node based on its QoS requirements [36]. For M2M applications that support the time-controlled feature, the derived scheduling solutions using Algorithm 3 are valid for a long time interval because the communications characteristics of machine nodes, e.g. reporting periods, are semi-constant during their lifetimes. Then, for a group of machine devices with similar delay requirements, one can use the lifetime-aware scheduler in Algorithm 3, and assign them a set of persistent uplink transmission grants. The interested reader may refer to [36], where persistent resource provisioning for M2M communications has been introduced. VI. MTC S CHEDULING OVER LTE NETWORKS Here, we focus on the air interface of 3GPP LTE Release 13 [26]. In this standard, radio resources for uplink and downlink transmissions are distributed in both time and frequency domains. In the time domain, data transmissions are structured in frames where each frame consists of 10 subframes each with 1 ms length, while in the frequency domain, the available bandwidth is divided into a number of subcarriers each with 15 KHz bandwidth. The minimum allocatable resource element in a frame is a physical resource block pair (PRBP) which consists of 12 subcarriers spanning over one transmission time interval (TTI) [26]. Each TTI consists of two slots and includes 12 (or 14) OFDM symbols if long (or short) cyclic prefix is utilized. Based on the LTE open-loop power control [26], each node determines its uplink transmit power using downlink pathloss estimation as: P owC(|Ci |, δi ) = |Ci |P0 βi γi [2 ks TBS (|Ci |, δi ) |Ci |Ns Nsc − 1]. (23) In this expression, the number of assigned PRBPs to node i is denoted by |Ci |, the estimated downlink pathloss by γi , the compensation factor by βi , the number of symbols in a PRBP by Ns , and the number of subcarriers in a PRBP by Nsc . Also, ks is usually set to 1.25 and the transport block size (TBS) can be found in Table 7.1.7.2.1-1 of [26] as a function of |Ci | and TBS index. The TBS index, δi ∈ {0, · · · , 33}, is a function of modulation and coding scheme as in Table 8.6.1-1 of [26]. Based on the LTE specification in [26], P0 is set based on the required SNR level at the receiver as: P0 = βi [SNRtarget + Pn ] + [1 − βi ]Pmax , where Pn = −209.26 dB is the noise power in each resource block. Based on these specifications, one can rewrite the presented scheduling problems in sections IV and V in the context of LTE. Also, one sees that by tuning G in Algorithm 2, our proposed scheduling solutions can be used for both LTE and LTE-A networks which utilize SC-FDMA and clustered SCFDMA for uplink transmissions, respectively. Let us consider the scheduling problem in section V in the context of LTE. For node i, the expected battery lifetime is found from (1) as: Li (t) = Ei (t)Ti . Esi + T T I[Pc + ξP owC(|Ci |, δi )] (24) Also, the resource allocation problem in (21) reduces to finding the optimal |Ci | and δi values, as follows: δi∗ can be found by referring to the (|Ci |)-th column of the TBS table in [26], and finding the minimum TBS index for which, the constraint in (27) is satisfied. A. Low-Complexity Solution We can also use linear relaxation in order to transform the discrete optimization problem in (25) to a continuous optimization problem. Let us introduce an auxiliary variable Z and rewrite the optimization problems in (25) as follows: minimize|Ci | Z X subject to: C.28.1: C.28.2: |Ci | (28) i∈A min |Ci | ≤ |C|, ≤ |Ci |, C.28.3: Z ≤ Li (t), ∀i ∈ A, ∀i ∈ A, where Z = max Li1(t) . From the TBS table in [26], one sees that the maximum TBS for one PRBP is 968, then |Ci |min = max{|Ci |m , D̄i /968}, in which |Ci |m is found by satisfying C.25.2 and C.25.3 with equality, as follows: ks D̄i |Ci |m P0 βi γi [2 |Ci |m Ns Nsc − 1] = Pmax . The scheduling problem in (28) is a convex optimization problem because the objective function is concave and the constraints make a convex set. Then, one can use the dual Lagrangian scheme and find the desired solution as:  |Ci |∗ = max |Ci |min , ks ln(2)D̄i /[Ns Nsc ] 1+L Ei (t)Ti µ eP0 βγi λi ξT T I − 1 e  , (29) where µ and λi :s are Lagrange multipliers. The derived |Ci |∗ (25) values from (29) are fractional solutions to the relaxed problem maximize|Ci |,δi Lsil net X in (28). Then, we can use randomized rounding to find the s.t.: C.25.1: |Ci | ≤ |C|, number of assigned PRBPs to each node [37]. Given the i∈A assigned number of PRBPs to node i as |Ci |∗ and the queued C.25.2: D̄i ≤ TBS(|Ci |, δi ), ∀i ∈ A, data length as Di , the optimal TBS index is found from (27) C.25.3: P owC(|Ci |, δi ) ≤ Pmax , ∀i ∈ A, as δi∗ = FunD(|Ci |∗ , Di ). Then, the corresponding transmit C.25.4: δi ∈ {0, · · · , 33}; |Ci | ∈ {1, · · · , |C|}, ∀i ∈ A, power for node i is computed by inserting the derived |C |∗ , i ∗ ∗ ∗ where |C| is the total number of available PRBPs, D̄i = Di + δi , and TBS(|Ci | , δi ) in (23). Doh , and Doh is the size of overhead information for User VII. P ERFORMANCE E VALUATION Datagram Protocol (UDP), Internet Protocol (IP), and etc. In order to solve this problem, we can use a modified version of In this section, we apply our proposed scheduling algorithms Algorithm 3. The solution procedure is presented in Algorithm to a 3GPP LTE-A system and provide simulation results to 4. In this algorithm, F (x, y) = Li (t) |Ci |=x,δi =y , and |Ci |min demonstrate lifetime improvements. The testbed for simuis the minimum PRBP requirement for node i found as: lations is based on the uplink of a single cell multi-user 3GPP LTE-A network with 1.4 MHz bandwidth [26]. The (26) |Ci |min = minimizeδi |Ci |, deployment of machine devices and their traffic model follow subject to: TBS(|Ci |, δi ) ≥ D̄i ; P owC(|Ci |, δi ) ≤ Pmax . the proposed models in [27, annex A] for smart metering Also, given the assigned number of PRBPs to node i, i.e. |Ci |, applications, and are reflected in Table I. Upon having data to and the queued data length as Di , Algorithm 4 calls function transmit, machine nodes send scheduling request on PUCCH FunD(|Ci |, Di ) in order to derive the corresponding TBS index to the BS. As per [9, 36], we consider that part of PUSCH radio resources are assigned to M2M communications. Here, δi∗ that minimizes the transmit power as: we assume the first two radio frames in each second, i.e. 20 ∆ δi∗ =FunD(|Ci |, Di ) = minimize δi , (27) subframes each containing 6 PRBPs, have been reserved for uplink transmissions of machine devices. The BS schedules subject to: TBS(|Ci |, δi ) ≥ Di + Doh . machine devices and sends back the scheduling grants on 2 return y and p; TABLE I: Simulation parameters Parameter Value Cell radius Path loss model PSD of noise System bandwidth Transmission time interval, TTI Number of PRBPs in each TTI ks , Ns , Nsc TBS index, δi Transport block size Pathloss compensation factor, βi Number of nodes Data generation at each node Duty cycle, Ti Payload+overhead size, D̄i Circuit power, Pc SNRtarget Maximum transmit power, Pmax Static energy consumption, Esi 500 m r 128 + 38 log10 ( 1000 ) -174 dBm/Hz 1.4 MHz 1 ms 6 1.25, 12, 12 {0, · · · , 26} Tab. 7.1.7.2.1-1 [26] 0.92 18000 Poisson, rate 1/300 300 sec, ∀i ∈ A 600 Bits 7 dBm 1 dB 24 dBm 10 µJ PDCCH to let them transmit their packets in the upcoming reserved resources. Six different MTC scheduling schemes that have been implemented in our simulations are as follows: • • PDF PDF 0.11 0 0.11 scheme 1 scheme 2 0 0.11 0 0.11 scheme 3 scheme 4 0 0.11 0 0.11 scheme 5 scheme 6 0 103 104 105 106 107 108 Time (× Ti) Fig. 1: Empirical PDF of individual lifetimes using different scheduling schemes Scheme 3: This scheme is based on Algorithm 1, and aims at maximizing the LIL network lifetime. • Scheme 4: This scheme consists of two RR schedulers for time- and frequency-domain scheduling, and represents the delay/priority-aware scheduling schemes in literature [11, 16] when the MTC traffic has no strict delay/priority requirement. • Scheme 5: This scheme consists of a channel-aware scheduler for time-domain scheduling, a RR scheduler for frequency domain scheduling, and represents the proposed channel-aware scheduling schemes in [10, 11]. • Scheme 6: This scheme represents the proposed energy efficient MTC scheduling algorithm in [14], where the ratio between the sum data rates and the transmit power consumptions of all devices is maximized. One must note that a fair comparison requires us to compare scheme 1, as a lifetime-aware time/frequency-domain scheduling solution against schemes {3, 4, 6} which either benefit from RR scheduling or lifetime-aware scheduling with full CSI. On the other hand, scheme 2 which benefits from the low-complexity lifetime-aware solution with limited-CSI, can be compared against scheme 4 and 5, which benefit from RR scheduling and channel-aware scheduling with limited CSI, respectively. • - If At is empty, then 0 → Ctn ; 3 PDF Initialization; - Derive |Ci |min , ∀i ∈ A, from (26); - |Ci |min → y(i), ∀i ∈ A; - FunD(y(i), Di ) → δi∗ , ∀i ∈ A; - P owC(y(i), δi∗ ) → p(i), ∀i ∈ A; - F (y(i), δi∗ ) → f (i), ∀i ∈ A; - A → At ; while Ctn do - arg mini∈A f (i) → m; - y(m) + 1 → x; ∗ - FunD(x, Dm ) → δm ; ∗ - P owC(x, δm ) → P; ∗ - if P ≤ Pmax , and F (x, δm ) > f (m) then - Ctn − 1 → Ctn , x → y(m), P → p(m); ∗ - F (x, δm ) → f (m); else - At \ m → At , and ∞ → f (m); PDF PDF 1 PDF Algorithm 4: Scheduling with limited feedback for LTE Scheme 1: This scheme is based on Algorithm 1, and aims at maximizing the SIL network lifetime. Scheme 2: This scheme is based on Algorithm 3 and 4, and provides a low-complexity solution with limited feedback requirement. In this scheme, a round robin (RR) scheduler is used for time-domain scheduling, and Algorithm 4 is used for frequency-domain scheduling. A. Performance Evaluation of the Proposed Schedulers Fig. 1 represents the probability density function (PDF) of battery lifetimes of machine nodes using different scheduling schemes. The x-axis has been depicted in log-scale to highlight the differences in PDFs when the initial energy drains happen. One sees that the first-energy-drain using scheme 1, which aims at maximizing the SIL network lifetime, happens much later than the first energy drain using the benchmarks, i.e. scheme 4, 5, and 6. Also, one sees that the last energy drain using scheme 3, which aims at maximizing the LIL network lifetime, happens much later than the benchmarks. Furthermore, we see that the PDF of scheme 1 has a compact shape, which shows that the individual lifetimes of machine devices are distributed in a limited time interval. The detailed 13 6 3 LIL network lifetime SIL network lifetime 5 2.5 4 2 3 1.5 2 1 1 0.5 0 0 Sch. 1 Sch. 2 Sch. 3 Sch. 4 Sch. 5 Sch. 6 Scheduling Schemes x 10 10 1 Jain index of ind. lifetimes 3.5 Jain index Variance 0.8 8 0.6 6 0.4 4 0.2 2 0 Sch. 1 Sch. 2 Sch. 3 Sch. 4 Sch. 5 Sch. 6 Variance of ind. lifetimes 104 107 SIL network lifetime (  Ti) LIL network lifetime (  Ti) 7 0 Scheduling schemes Fig. 2: Network lifetime comparison SIL network lifetime comparison of the proposed scheduling schemes is presented in Fig. 2. In this figure, it is evident that the achieved SIL network lifetime from scheme 1 is 2.4 times higher than scheme 4, three times higher than scheme 5, and 13.4 times higher than the scheme 6. Also, one sees that scheme 2, which aims at maximizing the SIL network lifetime with limited feedback requirement, outperforms the baseline schemes 4 and 5. The detailed LIL network lifetime comparison is presented in Fig. 2. In this figure, it is evident that the achieved LIL network lifetime from scheme 3 is 1.55 times higher than scheme 4, 1.15 times higher than scheme 5, and 0.02 times higher than scheme 6. Fairness of the proposed scheduling schemes is investigated in Fig. 3. The right axis of Fig. 3 shows the variance of individual lifetimes, while the right axis represents the modified Jain’s fairness index [38], calculated as: P ( i∈A Li )2 P . J = |A| i∈A L2i One sees that scheme 1 achieves the highest fairness index. Recall from Fig. 2, where it was shown that SIL-aware scheduling prolongs the shortest individual lifetime in the network. Comparing Fig. 2 and Fig. 3 indicates that using SIL-aware scheduling, machine nodes will last all together for a long period of time, and will die almost at the same time. Fig. 4 indicates the impact of link budget on the network battery lifetime. Recall the transmit power expression in (23). From this expression, one sees that transmit power is an increasing function of SNRtarget . In Fig. 4, one sees that the battery lifetime significantly decreases in SNRtarget . Also, one sees that the achieved battery lifetime from scheme 2 is approximately 2 times higher than the baseline scheme for different SNRtarget values. Similar results can be seen in Fig. 5 for the impact of D̄i on the network battery lifetime. One sees when the packet size increases the network lifetime decreases. Also, one sees that the achieved network lifetime from scheme 2 is approximately 2 times higher than the baseline scheme for different D̄i values. B. Comparison of Network Lifetime Definitions In Fig. 3, one sees that by SIL-aware scheduling, all nodes are expected to have their batteries drained approximately at the same time. This is due to the fact that SIL scheduler tries to prolong battery lifetimes of low-battery nodes at the cost SIL network lifetime (× Ti ) Fig. 3: Fairness of the proposed schemes 4 ×10 4 3 Lifetime-aware sched. (scheme 2) RR scheduling (scheme 4) 2 1 0 -2 1 4 7 SNRtaget (dB) Fig. 4: Impact of the link budget on lifetime of sacrificing high-battery nodes’ lifetimes. On the other hand, by LIL-aware scheduling, battery lifetimes of all other nodes are sacrificed to prolong battery lifetime of the node with the longest battery lifetime. Then, it is clear that depending on the M2M application, the choice of network lifetime to be used for scheduling and consequently the scheduler design, can be different from one network to the other. For example, for a network in which loosing even a small number of nodes deteriorates the performance like sensors installed in urban trash bins, and hence batteries must be replaced when drained, SIL-aware scheduling may significantly reduce the network maintenance costs by reducing the efforts to monitor the network continuously and replace battery-drained machine nodes one by one. On the other hand, for networks in which correlation between gathered data from different nodes is high like sensors installed in an area for temperature monitoring, LIL-aware scheduling may minimize the maintenance costs by prolonging battery lifetimes of a subset of nodes. C. Lifetime-Aware Resource Provisioning for MTC As discussed above, provisioning uplink resources for MTC can impact the network lifetime. If the amount of reserved resources is larger than required, some resources are wasted, spectral efficiency of the network decreases, and the QoS for other services, e.g. web surfing, may be decreased. If the amount of reserved resources is smaller than required, machine nodes must wait for a longer period of time to get access to the reserved resources, and send data with a higher transmit SIL network lifetime (×Ti ) 8 energy efficiency, i.e. it increases in sending more data in each resource block. Fig. 7 compares the SIL network lifetime. One sees that the network lifetime follows a similar trend to the energy efficiency, i.e. it decreases as the amount of data to be transmitted over a resource block increases. ×10 4 Lifetime-aware sched. (scheme 2) RR scheduling (scheme 4) 6 4 2 0 150 VIII. C ONCLUSIONS 300 450 600 700 Packet size (bits) Fig. 5: Impact of D̄i on lifetime ×10 -7 3 EE of scheme 1 with 1 reserved frame EE of scheme 1 with 2 reserved frames SE of scheme 1 with 1 reserved frame SE of scheme 1 with 2 reserved frames 4 3.5 2.5 2 3 1.5 2.5 1 2 0.5 1.5 150 225 300 375 Spectral efficiency (bit/sec/Hz) Energy efficiency (bit/joule) 4.5 0 450 Packet size (bits) SIL network lifetime (× Ti) Fig. 6: Energy/spectral efficiency tradeoff in MTC resource provisioning 8 In this paper, a lifetime-aware resource allocation framework for cellular-based M2M networks is introduced. Theoretical analyses on the impact of scheduling and power control on the energy consumptions of machine nodes, and hence, network lifetime are presented. Based on these analyses, battery lifetime aware scheduling algorithms are derived. The obtained results show that the optimal scheduling decision depends on the priority class of traffic, remaining battery lifetime of the devices, and the transmission-dependent and -independent sources of energy consumptions. Comparing the lifetimeaware schedulers with the existing scheduling solutions in literature shows that modeling the energy consumption of MTC, and designing respective scheduling schemes can significantly prolong the network lifetime. Furthermore, the energy efficiency, spectral efficiency, and network lifetime tradeoffs in uplink MTC scheduling are investigated. It is also shown that uplink scheduling based on the max-min fairness enables machine nodes to last for a long time and die approximately at the same time, which contributes significantly in network’s maintenance costs reduction. The results of this article can be used to analyze and optimize the lifetime performance of deployed machine-type devices over cellular networks. ×10 4 scheme 1 with 1 reserved frame scheme 1 with 2 reserved frames 6 A PPENDIX A 4 2 0 150 225 300 375 450 Packet size (bits) Fig. 7: Lifetime tradeoffs in MTC resource provisioning power which in turn reduces their battery lifetimes. Then, one sees that there is a tradeoff between energy efficiency and spectral efficiency in uplink transmission. This tradeoff is presented in Fig. 6. In this figure, the solid curves illustrate the energy efficiency of uplink transmissions in Bit-per-Joule for two resource provisioning approaches: (i) when 1 radio frame consisting of 10 subframes is allocated to MTC in each second; and (ii) when 2 radio frames are allocated to MTC in each second. One sees that the energy efficiency decreases when either the amount of reserved resources decreases or the amount of data to be transmitted over a given set of resources increases. The dashed curves illustrate the spectral efficiency of uplink transmissions in Bit/Sec/Hz. One sees that spectral efficiency presents a reverse trend when compared with the To solve the optimization problem in (4), we first relax C.3.2, solve the relaxed problem, and then apply C.3.2. The Lagrangian function for the relaxed problem is written as follows: X X 1 − Z], (30) F = Z + µ[ τi − τ ] + λi [ i∈A i∈A Li (t) where µ and λi :s are Lagrange multipliers. Using convex optimization theory [24], the solution for relaxed problem, i.e. τi∗ , is found by solving: ∂L−1 (t) → µ + λi i = 0, ∂τi  w λi Di Pc + ξ[N0 + I] →µ+ S( ), Ei (t)Ti hi Gtr τ i Di w Di = 0. ξ Ṡ( )[N0 + I] − τi τi hi Gtr ∂F = 0, ∂τi (31) Also, µ and λi :s, i.e. the Lagrange multipliers, are found due to the following Karush Kuhn Tucker (KKT) conditions [24]: X  µ ≥ 0; τi − τ µ = 0; (32) i∈A  1/Li (t) − Z λi = 0; λi ≥ 0; ∀i ∈ A. (33) For example, in the special case that S(x) is found from (2) and Γmcs = 1, the real-valued solution of (31) is found as: τi∗ = 1+ ln(2)Di /w  1 [hi Gtr ][Pc +Ti Ei (t)µ/λi ] L( e ξ(N0 +I)w  , −1 ) (34) where e is the Euler’s number, and L(x) is the LambertW function, i.e. inverse of the function f (x) = x exp(x) [25]. Now, by applying C.3.2 the optimal transmission time is found as the maximum of τim and τi∗ , where τi∗ has been introduced in (3). R EFERENCES [1] Ericsson, Huawei, NSN, and et al., “A choice of future M2M access technologies for mobile network operators,” Tech. Rep., Mar. 2014. [2] 3GPP TS 22.368 V13.1.0, “Service requirements for machinetype communications,” Tech. Rep., 2014. [Online]. Available: http://www.3gpp.org [3] Nokia Networks, “Looking ahead to 5G: Building a virtual zero latency gigabit experience,” Tech. Rep., 2014. [4] A. Laya, L. Alonso, and J. Alonso-Zarate, “Is the random access channel of LTE and LTE-A suitable for M2M communications? A survey of alternatives,” IEEE Commun. Surveys Tuts., vol. 16, no. 1, pp. 4–16, Dec. 2013. [5] G. Miao, A. Azari, and T. Hwang, “E 2 -MAC: Energy efficient medium access for massive M2M communications,” IEEE Trans. Commun., vol. 64, no. 11, pp. 4720 – 4735, Nov. 2016. [6] Z. Alavikia and A. Ghasemi, “A multiple power level random access method for M2M communications in LTE-A network,” Transactions on Emerging Telecommunications Technologies, vol. 28, no. 6, June 2017. [7] Z. Zhou, J. Feng, Y. Jia, S. Mumtaz, K. M. S. Huq, J. Rodriguez, and D. Zhang, “Energy-efficient game-theoretical random access for M2M communications in overlapped cellular networks,” Computer Networks, July 2017. [8] Nokia Networks, “LTE-M – optimizing LTE for the Internet of things,” Tech. Rep., 2015. [9] M. Mehaseb, Y. Gadallah, A. Elhamy, and H. El-Hennawy, “Classification of LTE uplink scheduling techniques: An M2M perspective,” IEEE Commun. Surveys Tuts., no. 99, Nov. 2015. [10] S. Zhenqi, Y. Haifeng, C. Xuefen, and L. Hongxia, “Research on uplink scheduling algorithm of massive M2M and H2H services in LTE,” in IET International Conference on Information and Communications Technologies, Apr. 2013, pp. 365–369. [11] A. S. Lioumpas and A. Alexiou, “Uplink scheduling for machineto-machine communications in LTE-based cellular systems,” in IEEE GLOBECOM Workshops, 2011, pp. 353–357. [12] A. E. Mostafa and Y. Gadallah, “A statistical priority-based scheduling metric for M2M Communications in LTE Networks,” IEEE Access, vol. 5, pp. 8106–8117, May 2017. [13] S. A. Mahmud et al., “Fairness evaluation of scheduling algorithms for dense M2M implementations,” in IEEE Wireless Communications and Networking Conference Workshops, Apr. 2014, pp. 134–139. [14] A. Aijaz et al., “Energy-efficient uplink resource allocation in LTE networks with M2M/H2H co-existence under statistical QoS guarantees,” IEEE Trans. Commun., vol. 62, no. 7, pp. 2353–2365, July 2014. [15] K. Wang, J. Alonso-Zarate, and M. Dohler, “Energy-efficiency of LTE for small data machine-to-machine communications,” in IEEE International Conference on Communications (ICC), June 2013, pp. 4120–4124. [16] M. Kalil et al., “Low-complexity power-efficient schedulers for LTE uplink with delay-sensitive traffic,” IEEE Trans. Veh. Technol., vol. 64, no. 10, pp. 4551–4564, Nov. 2015. [17] H. S. Dhillon et al., “Power-efficient system design for cellular-based machine-to-machine communications,” IEEE Trans. Wireless Commun., vol. 12, no. 11, pp. 5740–5753, Nov. 2013. [18] G. Miao, N. Himayat, G. Li, and S. Talwar, “Low-complexity energyefficient scheduling for uplink OFDMA,” IEEE Trans. Commun., vol. 60, no. 1, pp. 112–120, Jan. 2012. [19] Y. Liu et al., “Design of a scalable hybrid MAC protocol for heterogeneous M2M networks,” IEEE Internet Things J., vol. 1, no. 1, pp. 99–111, Feb. 2014. [20] A. Azari, “Energy-efficient scheduling and grouping for machine-type communications over cellular networks,” Ad Hoc Networks, vol. 43, pp. 16–29, june 2016. [21] A. Azari and G. Miao, “Lifetime-aware scheduling and power control for cellular-based M2M communications,” in IEEE Wireless Communications and Networking Conference (WCNC), 2015. [22] ——, “Lifetime-aware scheduling and power control for M2M communications over LTE networks,” in IEEE Vehicular Technology Conference (VTC), 2015. [23] 3GPP, “USF capacity evaluation for MTC,” Tech. Rep., 2010, TSG GERAN 46 GP-100894. [24] S. Boyd and L. Vandenberghe, Convex optimization. Cambridge university press, 2004. [25] R. Corless, G. Gonnet, D. Hare, D. Jeffrey, and D. Knuth, “On the LambertW function,” vol. 5, no. 1, pp. 329–359, 1996. [26] 3GPP TS 36.213, “Evolved universal terrestrial radio access, physical layer procedures,” Tech. Rep., May 2016, (Rel. 13). [27] 3GPP, “Study on provision of low-cost machine-type communications (MTC) user equipments (UEs),” 3GPP TR 36.888 V12.0.0, 2013. [28] I. C. Wong, O. Oteri, and W. McCoy, “Optimal resource allocation in uplink SC-FDMA systems,” IEEE Trans. Wireless Commun., vol. 8, no. 5, pp. 2161–2165, May 2009. [29] M. R. Palattella, M. Dohler, A. Grieco, G. Rizzo, J. Torsner, T. Engel, and L. Ladid, “Internet of things in the 5G era: Enablers, architecture, and business models,” IEEE J. Sel. Areas Commun, vol. 34, no. 3, pp. 510–527, Mar. 2016. [30] L. Hanzo, H. Haas, S. Imre, D. O’Brien, M. Rupp, and L. Gyongyosi, “Wireless myths, realities, and futures: From 3G/4G to optical and quantum wireless,” Proceedings of the IEEE, vol. 100, no. Special Centennial Issue, pp. 1853–1888, May 2012. [31] S. Imre and L. Gyongyosi, Advanced quantum communications: an engineering approach. John Wiley & Sons, 2012. [32] G. Miao, N. Himayat, and G. Y. Li, “Energy-efficient link adaptation in frequency-selective channels,” IEEE Trans. Commun., vol. 58, no. 2, pp. 545–554, Feb. 2010. [33] H. Luss, Equitable Resource Allocation: Models, algorithms and applications. John Wiley & Sons, 2012, vol. 101. [34] G. Miao, J. Zander, K. W. Sung, and S. B. Slimane, Fundamentals of Mobile Data Networks. Cambridge University Press, 2016. [35] H. Cho, “Machine to machine (M2M) communications technical report,” 2011, IEEE 802.16 Broadband Wireless Access Working Group. [36] S. Y. Lien and K. C. Chen, “Massive access management for QoS guarantees in 3GPP machine-to-machine communications,” IEEE Commun. Lett., vol. 15, no. 3, pp. 311–313, Mar. 2011. [37] P. Raghavan and C. D. Tompson, “Randomized rounding: A technique for provably good algorithms and algorithmic proofs,” Combinatorica, vol. 7, no. 4, pp. 365–374, 1987. [38] R. Jain, D. M. Chiu, and W. Hawe, “A quantitative measure of fairness and discrimination for resource allocation in shared computer systems,” Digital Equipment Corporation Hudson, Sept. 1984.
7cs.IT
1 Deep Feature Consistent Deep Image Transformations: Downscaling, Decolorization and HDR Tone Mapping arXiv:1707.09482v2 [cs.CV] 11 Sep 2017 Xianxu Hou, Jiang Duan, and Guoping Qiu Abstract—Building on crucial insights into the determining factors of the visual integrity of an image and the property of deep convolutional neural network (CNN), we have developed the Deep Feature Consistent Deep Image Transformation (DFC-DIT) framework which unifies challenging one-to-many mapping image processing problems such as image downscaling, decolorization (colour to grayscale conversion) and high dynamic range (HDR) image tone mapping. DFC-DIT uses one CNN as a non-linear mapper to transform an input image to an output image following the deep feature consistency principle which is enforced through another pretrained and fixed deep CNN. Unlike applications in related literature, none of these problems has a known ground truth or target for a supervised learning system. For each problem, we reason about a suitable learning objective function and develop an effective solution under the DFC-DIT framework. This is the first work that uses deep learning to solve and unify these three common image processing tasks. We present experimental results to demonstrate the effectiveness of the DFC-DIT technique and its state of the art performances. Index Terms—Deep Learning, Image Downscaling, Image Decolorization, HDR Image Tone Mapping I. I NTRODUCTION Many classic image processing tasks (Fig. 1) can be framed as image transformation, where an input image is transformed to an output image based on a given criterion. In this paper, we consider three image transformation tasks: image downscaling, image decolorization (color to grayscale conversion), and high dynamic range (HDR) image tone mapping. Downscaling image operations are widely used today to allow users to view a reduced resolution image that preserves perceptually important details of its original megapixel version. Decolorization aims to convert a color image to a grayscale image which will preserve the visual contrasts of the original colour version. Another image processing task is HDR image tone mapping. HDR images contain a much higher bit depth than standard image formats and can represent a dynamic range closer to that of human vision. The goal of HDR tone mapping is trying to faithfully reproduce the appearance of the high dynamic range image in display devices with limited displayable range. X. Hou is with the School of Computer Science, University of Nottingham Ningbo China and a visiting student in the College of Information Engineering, Shenzhen University, China. email: [email protected] J. Duan is with the School of Economic Information Engineering, Southwestern University of Finance and Economics, China. email: duanj [email protected] G. Qiu is with the College of Information Engineering, Shenzhen University, China and with the School of Computer Science, the University of Nottingham, United Kingdom. email: [email protected] and [email protected] These three seemingly disparate image processing tasks have a similar objective of outputting a reduced information version which will maximally convey important perceptual details of the original image. All these tasks face similar technical challenges. The transformations are one-to-many mapping and there are no known targets, an image can be transformed to an arbitrary number of plausible outputs. The transformation criterion, e.g., to preserve the perceptual details and contrasts of the original image, etc., are qualitative and subjective. There is no well-defined mathematical objective function to describe the transformation criterion and this makes it difficult to find a canonical computational solution to these problems. In this paper, we take advantage of recent developments in deep convolutional neural networks (CNNs) and have developed a deep feature consistent deep image transformation (DFC-DIT) framework in which we train a deep CNN to transform an input image to an output image by keeping the deep features of the input and output consistent through another pre-trained (and fixed) deep CNN. We show that common traditional image processing tasks such as downscaling, decolorization and HDR tone mapping can be unified under the DFC-DIT framework and produce state-of-the-art results. To the best knowledge of the authors, this is the first work that successfully uses deep learning to solve downscaling, decolorization and HDR tone mapping problems in a unified framework. The new DFC-DIT framework is built on two crucial insights, one into the visual appearance of an image and the other into the properties of the deep convolutional neural networks. From image quality measurement literature, it is known that the change of spatial correlation is a major factor affecting the visual integrity of an image [6]. Research in deep learning has shown that the hidden layers of a convolutional neural network can capture a variety of spatial correlation properties of the input image [7]. As one of the most important objectives of many image processing tasks such as the three studied in this paper is to maximally preserve the visual integrity of the input, it is therefore crucial to keep the spatial correlations of the output consistent with those of the input. As the deep features (i.e., hidden layers’ outputs) of a CNN capture the spatial correlations of the input image, we can therefore employ a (pre-trained and fixed) CNN and use its deep features to measure the spatial correlations of an image. Therefore, the goal of preserving the visual integrity of the input is equivalent to keeping the spatial correlations of the output consistent 2 Input Subsamping Bicubic SSIM-based Ours Color image Grundland et al. Luminance Ours Larson et al. Tumblin and Turk Raanan Fattal et al. Ours Fig. 1. Examples of classic image transformation tasks. Image downscaling (left) where we show results of our method, two traditional methods (subsampling and bicubic) and a state-of-the-art SSIM-based method [1]. Decolorization (middle) where we show results of our method, the Luminance channel and a state-of-the-art method [2]. HDR image tone mapping (right) where we show results of our method and 3 methods from the literature [3], [4], [5]. with that of the input, which in turn is equivalent to keeping their deep features consistent. Based on these key insights, we have successfully developed the DFC-DIT image processing framework (see Fig. 2). The rest of the paper is organized as follows. We briefly review related literature in section 2. Section 3 presents the DFCDIT framework and its application to three important image processing tasks, i.e., spatial downscaling, decolorization and high dynamic range image tone mapping. Section 4 presents experimental results which show that DFC-DIT stands out as a state-of-the-art technique. Finally we present a discussion to conclude the paper. II. R ELATED W ORK Image downscaling. Classical image downscaling techniques usually involve processing the input images by applying a spatially constant low-pass filter, subsampling, and reconstructing the result to prevent aliasing in the reconstructed signal. Approximations to the theoretically optimum sinc filter such as the Lanczos filter, and other filters (e.g., bilinear and bicubic) have been developed and used in practice. However the filtering kernels of these methods do not adapt to the image content. A recent content-adaptive technique [8] is proposed to overcome the above shortcoming by adapting the shape and location of every kernel to the local image content and demonstrates better downscaling results. A better depiction of the input image was proposed [1] by formulating image downscaling as an optimization problem with the structural similarity (SSIM) [9] as the perceptual image quality metric. In addition convolutional filters [10] are used to preserve visually important details in downscaled images. Decolorization. Decolorization aims to convert color images into grayscale images while preserving structures and contrasts as much as possible. The baseline method is to extract the luminance channel of a given color image from the RGB channels. However it could fail to express salient structures of the color image because of the fixed weights to combine RGB channels. Other more advanced techniques are proposed to obtain better results by either focusing on local contrasts or global contrasts. Local contrasts [11], [12] use different mapping functions in different local regions of the image, while global contrasts [13], [14], [15], [16] are designed to produce one mapping function for the whole image. [17] takes into account multi-scale contrast preservation in both spatial and range domain and uses bilateral filtering to mimic human contrast perception. [18] used a bimodal objective function to alleviate the restrictive order constraint for color mapping. In addition image fusion based strategy [19] is proposed for image and video decolorization. HDR image tone mapping. HDR image tone mapping aims to reproduce high dynamic range radiance maps in low dynamic range reproduction devices. Tone mapping operators can be classified as global operators and local operators. Global operators [20], [21], [22] usually employ the same mapping function for all pixels and can preserve the intensity orders of the original scenes to avoid “halo” artifacts, however the global operators will generally cause loss of details in the mapped image. In contrast, local operators [4], [23], [24] use mapping functions which vary spatially across the image. Most local operators employ a pipeline to decompose an image into different layers or scales and then recompose the mapped results from various scales after contrast reduction. However, the major shortcoming of local operators is the presence of haloing artifacts. In addition, global operator is used in the local regions to reproduce local contrast and ensure better quality [25]. What’s more, an up-to-date, detailed guide on the theory and practice of high dynamic range imaging is included in the book [26], which also provide MATLAB code for common tone mapping operators. In this paper, we use their code to reproduce previous methods. Image quality metrics. The choice of image quality metric is essential for image transformation tasks. Standard pixelby-pixel measurement like mean square error is problematic and the resultant images are often of low quality. This is 3 ! Decolorization conv1_1 ! conv2_1 ! conv3_1 ! conv4_1 ! conv5_1 Downscaling HDR tone mapping TW(x) Transformation network Input Image Pretrained network for feature perceptual loss Transformed Image Fig. 2. The Deep Feature Consistent Deep Image Transformation (DFC-DIT) framework. A convolutional neural network transforms an input to an output. A pretrained deep CNN is used to compute feature perceptual loss for the training of the transformation network. because the measurement is poorly correlated with human perception and can not capture the perceptual difference and spatial correlation between two images. Better metrics have been proposed for image quality assessment in recent years. Structural similarity (SSIM) index [9] is one of the most popular metrics, which computes a matching score between two images by local luminance, contrast, and structure comparisons. It has been successfully used for image downscaling [1], image denoising [9] and super-resolution [27]. Relevant deep learning/CNN literature. Recently, there has been an explosion of publications on deep learning/CNN, we here briefly review the most closely related publications to our current work. A number of papers have successfully generated high-quality images based on the high-level features extracted from pretrained deep convolutional neural networks. By optimizing individual deep features [30], [31], [32], [7], better visual quality images can be generated, which in turn can help understand the learned representations of deep networks. Additionally [33] have achieved style transfer by minimizing content and style reconstruction loss which are also based on features extracted from deep networks. Other works try to train a feed-forward network for real-time style transfer and super-resolution [34]. Different loss functions are compared for image restoration with neural networks [28]. In addition image-to-image translation framework [29] are proposed to generate high quality images based on adversarial training. It is worth noting that the downscaling problem studied in this paper has the opposite goal to super-resolution. Deep CNN based super-resolution training data has a unique corresponding target for a given input image and is a many-to-one mapping. The downscaling operation, however, is a one-tomany mapping; for a given input, there is no known target in the training data. Therefore, existing end to end superresolution learning [35], [36], [34] and other similar CNN based image processing techniques such as colorization [37], [38] cannot be directly applied to the problems studied in this paper. III. M ETHOD We seek to train a convolutional neural network as a nonlinear mapper to transform an input image to an output image following what we call the deep feature consistent principle. The schematic is illustrated in Fig. 2. Our system consists of two components: a transformation network TW (x) and a loss network Φ(x). The transformation network is a convolutional neural network parameterized by weights W , which transforms an input image x to an output image x̂, i.e. x̂ = TW (x). The other component is the loss network Φ which is a pretrained deep convolutional neural network to help define the feature perceptual loss function for training TW (x). We feed both the original image x and the transformed image x̂ to Φ and compute the feature perceptual loss L(x, x̂). Training TW (x) is to find the weights W that minimize L(x, x̂), i.e. W ∗ = arg min Ex [L(x, TW (x))] W (1) Equation (1) can be seen as an extension of the concept of perceptual loss, e.g. [34] and others. However, the three new applications we consider here are very different from those studied by others. These extensions are non-trivial and nonobvious; each requires in-depth understanding of the problem and ingenuity that cannot be readily derived from existing works. Unlike previous applications, none of our problems has a known ground truth or target for a supervised learning network. Instead, we have to reason about the suitable target and develop solutions to construct the perceptual loss for each application accordingly. In downscaling, we created a perceptual loss to match two images with different shapes (sizes). In colour2gray, we constructed a perceptual loss to match two images with different number of colour channels. In HDR tone mapping, we introduced a perceptual loss to match two images with different dynamic ranges. A. Deep Feature based Feature Perceptual Loss As alluded to earlier, the spatial correlation of an image is a major determining factor of the visual integrity of an image. 4 Output Size Layer padding + 64x3x3x1x1 conv + ReLU 64x4x4x2x2Layer conv + Name ReLU padding +3x3x3x1x1 conv + ReLU Layer Output Size 3xNxM input image (x) 3xNxM input image (x) 3xNxM 64Output x N/2 xSize M/2 padding + 64x3x3x1x1 Layer Name conv + ReLU Output 64 x N xSize M padding + 64x3x3x1x1 Layer Name conv + ReLU Output 64 x N xSize M 64 x N/2 x M/2 padding + 64x3x3x1x1 conv + ReLU 64 x N x M padding + 64x3x3x1x1 Layer Name conv + ReLU Output 64 x N xSize M 64Output x N/4 xSize M/4 padding + 64x3x3x1x1 Layer Name conv + ReLU Output 64 x N xSize M padding + 64x3x3x1x1 Layer Name conv + ReLU Output 64 x N xSize M 3 x N/4 x M/4 padding + 3x3x3x1x1 conv 1xNxM padding + 3x3x3x1x1 conv 3xNxM input image (x) 64x4x4x2x2Layer conv + Name ReLU Output Size Layer upsampling, scale 4 3xNxM (a) Image downscaling 3xNxM replicated (b) Image decolorization Scaled Tanh 3xNxM (c) HDR image tone mapping Fig. 3. Transformation neural network architecture for image downscaling, decolorization and HDR image tone mapping. The goal of image transformation in Fig. 2 and the tasks in Fig. 1 is to ensure x̂ preserves the visual integrity of x. This can be alternatively stated as making the spatial correlations in x̂ consistent with those in x. Instead of using handcrafted functions to describe an image’s spatial correlations, we make use of a pretrained deep CNN. The hidden layers outputs, which we call deep features, capture the spatial correlations of the input image. Specifically, let Φi (x) represent the ith hidden activations when feeding the image x to Φ. If the ith is a convolutional or ReLU layer, Φi (x) is a feature map of shape [Ci , Wi , Hi ], where Ci is the number of filter for the ith convolutional layer, Hi and Wi are the height and width of the given feature map respectively. The feature perceptual loss Li (x, x̂) for a given layer of two images x and x̂ = TW (x) is defined as the normalized Euclidean distance between the corresponding 3D feature maps. The final loss Li (x, TW (x)) is the total loss of different layers. Li (x, TW (x)) = Ci X Wi X Hi X 1 (Φi (x)c,w,h −Φi (TW (x))c,w,h )2 Ci Wi Hi c=1 w=1 h=1 (2) L(x, TW (x)) = X Li (x, TW (x)) (3) i It is worth noting that Φ is pre-trained and fixed during the training of TW (x), it is used as convolutional filters to capture the spatial correlations of the images. B. Transformation Networks Architecture The transformation networks are convolutional neural networks based on the architecture guidelines from VGGNet [39] and DCGAN [40], and the details of the architecture vary with different image transformation tasks (Fig. 3). Image downscaling. For image downscaling we use strided convolutions to construct the networks with 4 x 4 kernels. The stride is fixed to be 2 x 2 to achieve in-network downsampling instead of deterministic spatial functions such as max pooling and average pooling. The ReLU layer is used after the first convolutional layer as non-linear activation function. Thus after two strided convolutions, the size of the input image can be downscaled to 1/4. In order to compute the feature perceptual loss we need to make sure that the transformed image and the original image have the same shape. In our experiments we apply a 2D upsampling of a factor of 4 over every channel of the transformed output (see Fig. 4), thus upscaling the downscaled image back to the same size as the original input. The nearest neighbor upsampler is chosen to ensure the upsampled image has the same information as the downscaled image. Thus we can feed the upscaled version and the original image into the loss network to compute the feature perceptual loss. Image decolorization. The image decolorization transformation only affects the color of the input images, and there is no need to incorporate downsampling architecture in the network. We use 3 x 3 kernels with 1 x 1 stride for all the convolutions. In addition, each feature map of a given input is padded by 1 pixel with the replication of the input boundary before the convolution operation. Thus the convolutional layers do not change the size of the input image. Like the image downscaling network we use ReLU layer after the first convolutional layer, but only a single filter for the last convolution to represent the transformed grayscale image. What we desired is the deep feature consistency of the decolorized output and the original image. We replicate the single channel of the decolorized output to a 3 channel color image (3 channels are identical), which is then fed to the loss network Φ(x) to calculate the feature perceptual loss with the original input. This is designed to ensure the replicated 3 channel color image have the same amount of information as the decolorized output. HDR image tone mapping. The network architecture for HDR image tone mapping is similar to the one used in image decolorization above. We use replication to pad the input boundary, and all the convolutions are 3 x 3 kernels with 1 x 1 stride. The difference is that 3 filters are needed for the last convolutional layer for reproducing a color image. The output layer is a scaled Tanh layer, restricting the pixel value of the transformed image to the displayable range [0, 255] from a high dynamic range. During the training we seek the deep feature consistency of the tone mapped and the original high 5 } } d P1 P3 P2 P4 Downscaled image B. Image Downscaling. 2d P1 P3 ➠ P2 P4 Upsampled image Fig. 4. Nearest neighbor upsampling for the transformed image. The upsampled image contains the same amount of information as the downscaled image and is the same size as the original input image. dynamic range image. Specific implementation details of each of the applications are described in the experiments section. IV. E XPERIMENTS We present experimental results on three image transformation tasks: image downscaling, image decolorization and HDR image tone mapping to demonstrate the effectiveness of our method. We also investigate how the feature perceptual loss constructed with different hidden layers of the loss network affects the performances. A. Training Details Our image downscaling and decolorization transformation CNNs are trained offline using Microsoft COCO dataset released in 2014 [41], which is a large-scale dataset containing 82,783 training images. We resize all the image to 256 × 256 as the final training data, and train our models with a batch size of 16 for 10 epochs over all the training images. Once the transformation CNN is trained, it can be used to perform downscaling or decolorization. For HDR image tone mapping, the transformation CNN is trained online, i.e., an HDR image is compressed using the transformation CNN trained with its own data. The practical consideration is that it is difficult to collect large enough training dataset. With large enough collection of training data, the model can also be trained offline. For training, Adam [42] method is used for stochastic optimization with a learning rate of 0.0002. A pretrained 19-layer VGGNet [39] is used as loss CNN Φ to compute feature perceptual loss which is fixed during the training of the transformation CNN. When constructing the feature perceptual loss for a pretrained network, the first step is to decide which layer (layers) should be used. Unlike image generation works [34], [7] using ReLU layers, we use convolution layers for feature extraction. This is because the ReLU activation is just the corresponding convolutions output thresholded at 0, the convolutions could contain more subtle information when compared with ReLU output. Specifically we experiment feature perceptual loss by using convolutional layer conv1 1, conv2 1, conv3 1, conv4 1 and conv5 1 for comparison. Our implementation is built on open source machine learning framework Torch [43]. Image downscaling is trying to transform a high-resolution input image to a low-resolution output image. In our experiments we focus on the × 1/4 image downscaling similar to previous works [1], [8]. This seemingly simple routine image operation is actually a technically challenging task because it is very difficult to define the correct low-resolution image. As already discussed, this is a one-to-many mapping and there are many plausible solutions. Based on our DFC-DIT framework, we ensure that the downsampled image and the original image will have similar deep features which means that the output will maintain the spatial correlations of the original image thus keeping the visual integrity of the original image. Qualitative results Although our network is trained on images of shape 256 × 256, it can be adapted to any image sizes because of its fully convolutional architecture. After training, we evaluate our method on the testing images from [1]. We first show the qualitative examples and compare our results with other state-of-the-art methods. We then evaluate how perceptual losses constructed at different convolutional layers affect the performances. Fig. 5 shows qualitative examples of our results, other common techniques and state-of-the-art methods. We only show results of downscaling by a factor of × 1/4, the original images are resized for better display. We can see that bicubic filter is known to lead to oversmoothing results and cannot preserve fine structures such as the fence area highlighted by the red rectangle (Fig. 5(b)). Other filters such as bilateral filter and Lanczos filter achieve sharper downscaled results, however these filters are also problematic. Bilateral filter can lead to ringing artifacts (the hair in Fig. 5(a)), and Lanczos filter could not preserve small-scale features such as the fence area in Fig. 5(b). More advanced methods such as generalized sampling [44], and content-adaptive downscaling [8] and SSIM-based downscaling [1] could produce better results, but still cannot preserve all perceptually important details. In contrast our method trained by a feature perceptual loss constructed using layer conv1 1, conv2 1 and conv3 1 deep features can capture important fine textures and produce better transformed results, visually closer to the original high-resolution inputs. From Fig. 5(b), the fine textures of the fence area can be seen clearly in the downscaled image. Although simple (nearest neighbor) subsampling can also achieve sharper images, the results are sometimes noisy and suffer from aliasing (see the hair in Fig. 5(a)). Our algorithm avoids both oversmoothing and aliasing problems and produces a crisp and noise-free image. These results demonstrate that by keeping the deep features of the downscaled image consistent with those of the original can indeed preserve the visual integrity of the input. Deep feature consistency at different layers. Fig. 6 shows results of DFC-DIT downscaled images using perceptual losses computed using conv1 1, conv2 1, conv3 1, conv4 1 and conv5 1 layer of the VGGNet individually. We find that keeping the deep feature consistent at these individual layers can in general preserve the original texture or content well. However for the high level layers, the downscaled images could lose detailed pixel information such as pixel color. For 6 Bicubic ⇐ (a) Bicubic Bilateral Lanczos Bilateral Lanczos Subsampling Generalized Content adaptive SSIM-based conv123_1(Ours) Bicubic Bilateral Lanczos Subsampling Generalized Content adaptive SSIM-based conv123_1(Ours) (b) Subsampling Generalized Content adaptive SSIM-based conv123_1(Ours) Fig. 5. A comparison of natural images downscaled by different methods. The results are downscaled by a factor of × 1/4 while the original inputs are resized for better display. For each image, results of common filters such as Bicubic, Bilateral, Lanczos and Subsampling are shown in the first row. Results of recent methods, generalized sampling [44], content-adaptive[8] and SSIM-based downsampling [1] and ours are shown in the second row. Our conv123 1 results are produced by a model trained with a combined loss of convolutional layers conv1 1, conv2 1, and conv3 1. The bottom row of the second image shows a local region of the downscaled image by different methods. All the images are courtesy of [1]. The results are best viewed in native resolution electronically. conv1_1 conv2_1 conv3_1 conv4_1 conv5_1 conv123_1 Fig. 6. A comparison of natural images downscaled with the DFC-DIT framework with different levels of feature perceptual loss. The examples, from left to right, are × 1/4 downscaling results with perceptual losses computed with individual hidden layers of VGGNet (from layer 1 to layer 5). The last column is the results based on a perceptual loss combining the first 3 layers. 7 example, results of conv4 1 and conv5 1 in Fig. 6 have higher color contrasts. We also found that by combining the first three layer deep features in general works very well. C. Image Decolorization. Like in image downscaling we also train a two-layer convolutional network to transform color images into grayscale images using the DFC-DIT framework. One of the major problems in traditional approach to this task is that in iso-luminant areas the color contrasts will disappear in the grayscale image because even though the pixels have different colors their luminance levels are the same. In our neural network based nonlinear mapping framework, we enforce deep feature consistency which means that the spatial correlations of the color images are preserved in the grayscale image. Thus even in iso-luminant regions, the color contrasts will be preserved as grayscale contrasts. Qualitative results. Again, our fully convolutional neural network architecture can be applied to process images of any sizes even though the training images have a fixed size. Fig. 7 shows several comparative results against standard luminance and recent color to grayscale methods [18], [11], [12], [45]. Our training-based approach can preserve the color contrasts of the original images, the grayscale images appear sharp and fine details are well protected. It is interesting to note that unlike previous methods, we did not explicitly compute color contrasts and grayscale contrasts, instead we only enforce deep feature consistency of the color and the decolorized images. From these examples, we have shown convincingly that our DFC-DIT framework is an effective decolorization method. Deep feature consistency at different layers. We also conduct experiments to evaluate how deep feature consistency at different hidden layer of the loss network affects the decolorization results. Results produced by models trained with perceptual loss of different hidden layers are shown in Fig. 8. Again we can see that all the transformed images are able to reconstruct the content of the original color image and preserve the contrasts. Compared to lower layers, the decolorized images from higher layers do a better job at reconstructing fine details, especially the contrast preservation that is desired. Specifically the results from lowest layers, i.e., conv1 1 are similar to the luminance channel (Fig. 7), isoluminant regions are mapped onto the same output intensity and global appearance is not well preserved. Constructing feature perceptual loss from higher layer is better for contrast preserving. However when using the highest conv5 1 layer (Fig. 8), the contrast of the outputs is too high that makes the decolorized images look unnatural. Our best model is trained by using conv4 1 layer. D. HDR Image Tone Mapping. Unlike in image downscaling and decolorization where a single model is trained offline using a large collection of training images and used to process all testing images, we adapt one network to a single HDR image due to the lack of large HDR dataset available for training. This can be seen as an online process where we use an HDR image’s own data to optimize its own transformation function. It is important to note that this approach is realistic in practice as the process only needs the HDR input to produce its tone mapped output and there is no need to use any other extra information. The only slight disadvantage is that it requires online training the neural network using an HDR image’s own data before outputting the final tone mapped image. Comparing with training the model offline using a large collection of training images, this online approach will be slower because it needs to adapt the neural network to the current testing image before producing the output tone mapped image. In our implementation on a machine with an Intel Core i7-4790K CPU and a Nvidia Tesla K40 GPU, it takes around 20 seconds to tone map a 768 x 512 HDR image. It is a common practice to process the HDR radiance map in the logarithmic domain, we feed the logarithm of the radiance signal to the transformation CNN. Dynamic range compression is achieved by a T anh function in the last layer of the transformation network (Fig. 3(c)). In practice, the dynamic range of the input HDR radiance signal is compressed to the displayable range [0, 255]. Following the principle of DFC-DIT, the HDR tone mapping transformation network is optimized by enforcing deep feature consistency between the transformation output image and the original HDR radiance map. Rendering display image. The output of the transformation network will have the correct dynamic range suitable for display, however, its colour may not be correct due to the nonlinear mapping operations of the transformation CNN. We therefore need to render the output of the transformation network to have the correct colour for display. As in other tone mapping method [22], the final tone mapped image is rendered as Rin γ Lout Lin Gin γ = Lout Lin Bin γ = Lout Lin Rout = (4) Gout (5) Bout (6) where Rout , Gout and Bout are the final tone-mapped RGB channels, Rin , Gin and Bin are the original radiance values in the corresponding HDR channels, and γ can be used to render the correct display colour. Lin and Lout are respectively the luminance value of the HDR radiance map and the luminance value of the transformation image by the transformation CNN. According to the literature, γ should be set between 0.4 and 0.6 and we set it to 0.5 in all our results. Qualitative results. Fig. 9 shows examples of tone mapping results of some HDR radiance maps of real scenes that are widely used in the literature, i.e., “Stanford Memorial Church” and “Vine Sunset”. We compare our results with some of the best known and latest methods in the literature including Larson et al. [3], Expoblend [46], Lischinski et al. [47], Reinhard et al. [24], gradient domain [5], fast bilateral filtering [23] and Kim et al. [48]. From Fig. 9 and Fig. 10, we can see 8 Color image Ours Lu et al. Luminance Gooch et al. Smith et al. Kim et al. Fig. 7. A comparison of decolorized images by different methods. We compare our method trained with conv4 1 layer with standard luminance and other recent methods [18], [11], [12], [45]. The results are best viewed electronically. that our method is able to render the images with excellent visual appearances to keep tiny details and contrast of the radiance map, which are at least as good as those produced by the best methods. Deep feature consistency at different layers. In Fig. 11 we show how feature perceptual loss from different hidden layers affect the tone mapped images of the DFC-DIT framework for HDR tone mapping. Overall the tone mapped images based on perceptual losses from the middle level (conv2 1 and conv3 1) have a good balance between local and global contrasts. Combining the perceptual losses of first several layers together tend to produce somewhat better results than using a single layer. The tone mapped outputs based on higher layers (conv4 1 and conv5 1) appear slightly bumpy effect on different regions. The effects of logarithmic compression. As mentioned above, we first compress the HDR radiance map with the logarithmic functions and try to seek the deep feature consistency in the logarithmic domain. We can multiply the compressed radiance map with a factor α to control the logarithmic transformation. The tone mapping results with different α are shown in Fig. 12. It can be seen that a higher α can lead to a more noticeable local contrast and crisp appearance of tone mapped results. This is because the compressed HDR radiance map with a higher α retains a higher dynamic range in logarithmic domain and retain more important details. It is clear that our method can extract exquisite details from highcontrast images. It works well when α is around 0.5 in our experiments. E. Subjective Evaluation of DFC-DIT Framework. We have conducted a subjective evaluation of results of downscaling, decolorization and HDR tone mapping of the new DFC-DIT framework. For each transformation, we evaluate our technique against several best techniques in the literature. For downscaling, we use bicubic, bilateral, lanczos, subsampling, generalized sampling [44], content-adaptive [8] and SSIM based method [1] as the benchmarks. For decolorization, we use luminance the methods of Smith et al. [12], Kim et al. [45], Gooch et al [11] and Lu et al. [18] as benchmarks. For HDR tone mapping we use Larson et al. [3], fast bilateral filtering [23], gradient domain [5], Expoblend [46], Kim et al. [48], Lischinski et al. [47] and Reinhard et al. [24] as benchmarks. For each image, we show the original input image (in the case of HDR tone mapping, the original radiance map cannot be shown), a version produced by our method and a version of one benchmark technique to subjects and ask which version they prefer or indicate no preference. 50 undergraduate science and engineering students from our university evaluated 10 pairs of images for image downscaling and 8 pairs of images for image decolorization and HDR tone mapping. Fig. 13 shows the voting results. We can see that there is an obvious preference for our method against all other methods for all the transformation tasks. These results demonstrate DFC-DIT framework is comparable to or better than stateof-the-art techniques. In image downscaling, subsampling and SSIM-based are two competing methods to produce sharp and crisp downscaled images, however subsampling sometimes suffer strong aliasing artifacts like the hair in Fig. 5. In image decolorization, the method of Lu et al. [18] is the best 9 Color image conv1_1 conv2_1 conv3_1 conv4_1 conv5_1 Fig. 8. A comparison of decolorization by our methods trained with different level feature perceptual loss. The examples are trained from low level to high level layers in VGGNet. The results are best viewed electronically. Larson et al. Expoblend Lischinski et al. Reinhard et al. Gradient domain Fast bilateral filtering Kim et al. Ours Fig. 9. Stanford Memorial Church displayed using different methods. We show those of Larson et al. [3], Expoblend [46], Lischinski et al. [47], Reinhard et al. [24], gradient domain [5], fast bilateral filtering [23] and Kim et al. [48]. Our results are based on feature perceptual loss of 3 layers conv1 1, conv2 1 and conv3 1. 10 Larson et al. Gradient domain Expoblend Lischinski et al. Reinhard et al. Fast bilateral filtering Kim et al. Ours Fig. 10. Sunset image displayed using different methods. We show those of [3], Expoblend [46], Lischinski et al. [47], Reinhard et al. [24], gradient domain [5], fast bilateral filtering [23] and Kim et al. [48]. Our results are based on feature perceptual loss of 3 layers conv1 1, conv2 1 and conv3 1. Our results are based on feature perceptual loss of 3 layers conv1 1, conv2 1 and conv3 1. Conv1_1 Conv2_1 Conv3_1 Conv4_1 Conv5_1 Fig. 11. A comparison of HDR image tone mapping by our methods trained with different level feature perceptual loss. The results are best viewed electronically. !=0 !=0 ! = 1.0 ! = 1.5 ! = 2.0 Fig. 12. A demonstration of the effects of logarithmic compression based on feature perceptual loss of 3 layers conv1 1, conv2 1 and conv3 1. 11 1.00 1.00 1.00 Preference Ours 0.67 0.7 0.76 0.87 0.50 0.17 0.1 0.17 0.72 0.78 0.81 0.48 0.75 0.47 0.75 0.82 0.50 0.22 Percentage 0.5 0.56 Percentage Percentage 0.75 0.46 0.75 0.50 0.23 0.17 0.03 0.1 0.07 0.00 ic ub Bic C te on nt ap ad tive d ze Ge ne rali 0.37 s zo nc La ed g 0.00 mp sa b Su 0.16 0.06 0.06 0.24 0.25 0.05 0.05 0.35 0.37 0.05 0.4 0.22 0.19 0.31 0.05 Others 0.22 0.09 0.00 l. ta he c oo G Downscaling Method 0.13 lin as −b IM SS 0.03 0.25 0.1 0.03 ral ate Bil 0.4 0.27 0.27 0.08 0.73 0.12 0.25 0.25 0.7 Neutral 0.58 0.6 0.68 Kim et 0.09 0.09 d al. Lu et al. ce an in um L Decolorization Method S h mit et al. g n ble po Ex st Fa ral ate bil ain erin filt om td ien ad Gr Kim et al. l. ta rso La ne ki ins ch Lis et al. ard et al. inh Re HDR tone mapping Method Fig. 13. Subjective evaluation results. The red areas represent the percentage that our algorithm is selected, green areas for no preference and the blue ones for the other methods. competing candidate that maximally preserves color contrast. However some participants prefer ours than theirs because the decolorized versions of Lu et al. [18] may show too strong contrast while the corresponding color images in fact have low contrasts. For HDR image tone mapping, fast bilateral filtering [23] is the best comparable tone mapping operator in our study. V. C ONCLUDING REMARKS This paper has successfully introduced the DFC-DIT framework which unifies several common difficult image processing tasks. This is also the first time that deep learning has been successfully applied to image downscaling, decolorization and high dynamic range image tone mapping. Experimental results have demonstrated the effectiveness of the method and its state-of-the-art performances. One fundamental problem for traditional image transformation tasks like image downscaling, image decolorization and HDR image tone mapping is that the problems are inherently ill-posed, because there is no unique correct ground truth, i.e., they are one-to-many mapping problems. For image downscaling fine details should be preserved from visually ambiguous high-resolution inputs; for image decolorization the gray image should be semantically similar to the original color version and preserve the contrast as much as possible in spite of drastic loss of color information; for HDR image tone mapping we want to compress the scene radiance to displayable range while preserving details and color appearance to appreciate the original scene content. Therefore, success in these image transformation tasks requires semantic and perceptual reasoning about the input. It is very difficult to design a numerical image quality metric to measure the perceptual similarity between the transformed outputs and the original input. Based on two crucial insights into the determining factors of visual quality of images and the properties of deep convolutional neural network, we have developed the deep feature consistent deep image transformation (DFC-DIT) framework which unifies common and illposed image processing tasks like downscaling, decolorization and HDR tone mapping. We have shown that the hidden layer outputs of a pretrained deep CNN can be used to compare perceptual similarities between the input and the output images. One possible explanation is that the hidden representations of a pre-trained CNN have captured essential visual quality details such as spatial correlation information and other higher level semantic information. Exactly which hidden layer represents what kind of essential visual quality details is not very clear and we have shown that perceptual losses constructed with different hidden layer features can affect the final results. Future researches are needed to understand better the kinds of visual semantics captured by the hidden features of the pre-trained CNN in the context of the DFC-DIT framework. A better way to combine (e.g. weighting) different level deep features may lead to better and more consistent results. R EFERENCES [1] A. C. Oeztireli and M. Gross, “Perceptually based downscaling of images,” ACM Transactions on Graphics (TOG), vol. 34, no. 4, p. 77, 2015. [2] M. Grundland and N. A. Dodgson, “Decolorize: Fast, contrast enhancing, color to grayscale conversion,” Pattern Recognition, vol. 40, no. 11, pp. 2891–2896, 2007. [3] G. W. Larson, H. Rushmeier, and C. Piatko, “A visibility matching tone reproduction operator for high dynamic range scenes,” IEEE Transactions on Visualization and Computer Graphics, vol. 3, no. 4, pp. 291–306, 1997. [4] J. Tumblin and G. Turk, “Lcis: A boundary hierarchy for detailpreserving contrast reduction,” in Proceedings of the 26th annual conference on Computer graphics and interactive techniques. ACM Press/Addison-Wesley Publishing Co., 1999, pp. 83–90. [5] R. Fattal, D. Lischinski, and M. Werman, “Gradient domain high dynamic range compression,” in ACM Transactions on Graphics (TOG), vol. 21, no. 3. ACM, 2002, pp. 249–256. [6] Z. Wang and A. C. Bovik, “A universal image quality index,” IEEE Signal Processing Letters, vol. 9, no. 3, pp. 81–84, March 2002. [7] X. Hou, L. Shen, K. Sun, and G. Qiu, “Deep feature consistent variational autoencoder,” arXiv preprint arXiv:1610.00291, 2016. [8] J. Kopf, A. Shamir, and P. Peers, “Content-adaptive image downscaling,” ACM Transactions on Graphics (TOG), vol. 32, no. 6, p. 173, 2013. [9] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, “Image quality assessment: from error visibility to structural similarity,” IEEE transactions on image processing, vol. 13, no. 4, pp. 600–612, 2004. [10] N. Weber, M. Waechter, S. C. Amend, S. Guthe, and M. Goesele, “Rapid, detail-preserving image downscaling,” ACM Trans. Graph., vol. 35, no. 6, pp. 205:1–205:6, Nov. 2016. [Online]. Available: http://doi.acm.org/10.1145/2980179.2980239 [11] A. A. Gooch, S. C. Olsen, J. Tumblin, and B. Gooch, “Color2gray: salience-preserving color removal,” ACM Transactions on Graphics (TOG), vol. 24, no. 3, pp. 634–639, 2005. [12] K. Smith, P.-E. Landes, J. Thollot, and K. Myszkowski, “Apparent greyscale: A simple and fast conversion to perceptually accurate images and video,” in Computer Graphics Forum, vol. 27, no. 2. Wiley Online Library, 2008, pp. 193–200. [13] K. Rasche, R. Geist, and J. Westall, “Re-coloring images for gamuts of lower dimension,” in Computer Graphics Forum, vol. 24, no. 3. Wiley Online Library, 2005, pp. 423–432. 12 [14] C. O. Ancuti, C. Ancuti, and P. Bekaert, “Enhancing by saliency-guided decolorization,” in Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on. IEEE, 2011, pp. 257–264. [15] C. Lu, L. Xu, and J. Jia, “Contrast preserving decolorization,” in Computational Photography (ICCP), 2012 IEEE International Conference on. IEEE, 2012, pp. 1–7. [16] M. Qiu, G. D. Finlayson, and G. Qiu, “Contrast maximizing and brightness preserving color to grayscale image conversion,” in Conference on Colour in Graphics, Imaging, and Vision, vol. 2008, no. 1. Society for Imaging Science and Technology, 2008, pp. 347–351. [17] Y. Song, L. Bao, X. Xu, and Q. Yang, “Decolorization: Is rgb2gray () out?” in SIGGRAPH Asia 2013 Technical Briefs. ACM, 2013, p. 15. [18] C. Lu, L. Xu, and J. Jia, “Contrast preserving decolorization with perception-based quality metrics,” International journal of computer vision, vol. 110, no. 2, pp. 222–239, 2014. [19] C. O. Ancuti, C. Ancuti, C. Hermans, and P. Bekaert, “Image and video decolorization by fusion,” in Asian Conference on Computer Vision. Springer, 2010, pp. 79–92. [20] J. Tumblin and H. Rushmeier, “Tone reproduction for realistic images,” IEEE Computer graphics and Applications, vol. 13, no. 6, pp. 42–48, 1993. [21] G. Ward, “A contrast-based scalefactor for luminance display,” Graphics gems IV, pp. 415–421, 1994. [22] G. Qiu, J. Duan, and G. D. Finlayson, “Learning to display high dynamic range images,” Pattern recognition, vol. 40, no. 10, pp. 2641–2655, 2007. [23] F. Durand and J. Dorsey, “Fast bilateral filtering for the display of high-dynamic-range images,” in ACM transactions on graphics (TOG), vol. 21, no. 3. ACM, 2002, pp. 257–266. [24] E. Reinhard, M. Stark, P. Shirley, and J. Ferwerda, “Photographic tone reproduction for digital images,” ACM transactions on graphics (TOG), vol. 21, no. 3, pp. 267–276, 2002. [25] J. Duan, M. Bressan, C. Dance, and G. Qiu, “Tone-mapping high dynamic range images by novel histogram adjustment,” Pattern Recognition, vol. 43, no. 5, pp. 1847–1862, 2010. [26] F. Banterle, A. Artusi, K. Debattista, and A. Chalmers, Advanced High Dynamic Range Imaging: Theory and Practice. Natick, MA, USA: AK Peters (CRC Press), 2011. [27] F. Zhou and Q. Liao, “Single-frame image super-resolution inspired by perceptual criteria,” IET Image Processing, vol. 9, no. 1, pp. 1–11, 2014. [28] H. Zhao, O. Gallo, I. Frosio, and J. Kautz, “Loss functions for image restoration with neural networks,” IEEE Transactions on Computational Imaging, vol. 3, no. 1, pp. 47–57, March 2017. [29] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros, “Image-to-image translation with conditional adversarial networks,” arXiv preprint arXiv:1611.07004, 2016. [30] J. Yosinski, J. Clune, A. Nguyen, T. Fuchs, and H. Lipson, “Understanding neural networks through deep visualization,” arXiv preprint arXiv:1506.06579, 2015. [31] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, “Intriguing properties of neural networks,” arXiv preprint arXiv:1312.6199, 2013. [32] A. Nguyen, J. Yosinski, and J. Clune, “Deep neural networks are easily fooled: High confidence predictions for unrecognizable images,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 427–436. [33] L. A. Gatys, A. S. Ecker, and M. Bethge, “A neural algorithm of artistic style,” arXiv preprint arXiv:1508.06576, 2015. [34] J. Johnson, A. Alahi, and L. Fei-Fei, “Perceptual losses for realtime style transfer and super-resolution,” in European Conference on Computer Vision. Springer, 2016, pp. 694–711. [35] C. Dong, C. C. Loy, K. He, and X. Tang, “Learning a deep convolutional network for image super-resolution,” in European Conference on Computer Vision. Springer, 2014, pp. 184–199. [36] J. Kim, J. Kwon Lee, and K. Mu Lee, “Accurate image super-resolution using very deep convolutional networks,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 1646–1654. [37] R. Zhang, P. Isola, and A. A. Efros, “Colorful image colorization,” in European Conference on Computer Vision. Springer, 2016, pp. 649– 666. [38] G. Larsson, M. Maire, and G. Shakhnarovich, “Learning representations for automatic colorization,” in European Conference on Computer Vision. Springer, 2016, pp. 577–593. [39] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014. [40] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” arXiv preprint arXiv:1511.06434, 2015. [41] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick, “Microsoft coco: Common objects in context,” in European Conference on Computer Vision. Springer, 2014, pp. 740–755. [42] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. [43] R. Collobert, K. Kavukcuoglu, and C. Farabet, “Torch7: A matlab-like environment for machine learning,” in BigLearn, NIPS Workshop, no. EPFL-CONF-192376, 2011. [44] D. Nehab and H. Hoppe, “Generalized sampling in computer graphics,” Tech. rep., feb, Tech. Rep., 2011. [45] Y. Kim, C. Jang, J. Demouth, and S. Lee, “Robust color-to-gray via nonlinear global mapping,” in ACM Transactions on Graphics (TOG), vol. 28, no. 5. ACM, 2009, p. 161. [46] N. D. Bruce, “Expoblend: Information preserving exposure blending based on normalized log-domain entropy,” Computers & Graphics, vol. 39, pp. 12–23, 2014. [47] D. Lischinski, Z. Farbman, M. Uyttendaele, and R. Szeliski, “Interactive local adjustment of tonal values,” ACM Transactions on Graphics (TOG), vol. 25, no. 3, pp. 646–653, 2006. [48] M. H. Kim and J. Kautz, “Consistent tone reproduction,” in Proceedings of the Tenth IASTED International Conference on Computer Graphics and Imaging, ser. CGIM ’08. Anaheim, CA, USA: ACTA Press, 2008, pp. 152–159. [Online]. Available: http://dl.acm.org/citation.cfm?id=1722302.1722332
1cs.CV
Towards dense volumetric pancreas segmentation in CT using 3D fully convolutional networks Holger Rotha , Masahiro Odaa , Natsuki Shimizub , Hirohisa Odab , Yuichiro Hayashia , Takayuki Kitasakac , Michitaka Fujiwarad , Kazunari Misawae , and Kensaku Morif,b a Graduate School of Informatics, Nagoya University, Japan Graduate School of Information Science, Nagoya University, Japan c Faculty of Information Science, Aichi Institute of Technology, Japan d Nagoya University Graduate School of Medicine, Japan e Department of Gastroenterological Surgery, Aichi Cancer Center Hospital, Japan f Information & Communications, Nagoya University, Japan arXiv:1711.06439v2 [cs.CV] 19 Jan 2018 b ABSTRACT Pancreas segmentation in computed tomography imaging has been historically difficult for automated methods because of the large shape and size variations between patients. In this work, we describe a custom-build 3D fully convolutional network (FCN) that can process a 3D image including the whole pancreas and produce an automatic segmentation. We investigate two variations of the 3D FCN architecture; one with concatenation and one with summation skip connections to the decoder part of the network. We evaluate our methods on a dataset from a clinical trial with gastric cancer patients, including 147 contrast enhanced abdominal CT scans acquired in the portal venous phase. Using the summation architecture, we achieve an average Dice score of 89.7 ± 3.8 (range [79.8, 94.8])% in testing, achieving the new state-of-the-art performance in pancreas segmentation on this dataset. Keywords: fully convolutional networks, deep learning, pancreas, segmentation, computed tomography 1. INTRODUCTION Automated segmentation of the pancreas in computed tomography (CT) imaging is challenging because of the larger shape and size variations between patients compared to other organs, and because of the low contrast to surrounding tissues.1 Recent advantages have mainly been due to the application of deep learning based methods that allow the efficient learning of features from the imaging data directly. Especially, the development of fully convolutional neural networks (FCN)2 has further raised the state-of-the-art in semantic segmentation significantly. However, current deep learning methods for pancreas segmentation were still limited to either 2D image processing1, 3 or subvolume processing4 which can introduce discontinuity artifacts, mainly due to the memory restrictions caused by moving to full 3D volume processing. In this work, we describe a 3D FCN that can process a 3D image including the whole pancreas and segment it with the highest accuracy reported in literature to date, making advantage of state-of-the-art FCN architectures and multi-GPU processing. 2. METHODS Recent advances in fully convolutional networks (FCN) have made it feasible to train models for pixel-wise semantic segmentation in an end-to-end fashion.2 Efficient implementations of 3D convolution and growing GPU memory have made it possible to extent these methods to 3D medical imaging and train networks on large amounts of annotated volumes. One such example is the recently proposed 3D U-Net,5 which applies a 3D FCN with skip connections to sparsely annotated biomedical images. In the following, we extent the 3D U-Net architecture to our problem and utilize a random forest based bounding box locator in order to simplify the problem of initial pancreas localization. The main contribution is the dense segmentation of the pancreas using a direct mapping between the input volume and the segmentation via 3D FCNs. Example results of our method can be seen in Fig. 1. Send correspondence to: [email protected] and [email protected] 1 Figure 1: 3D visualization of the resulting pancreas segmentation in CT from three views. The gold standard segmentation of the pancreas is shown in cyan. Our predicted probability score for each voxel in the images is rendered in jet color scale. 2.1 Candidate region generation We utilize a state-of-the-art random forest (RF) regression method to give us an initial bounding box region of the pancreas, while removing vast amounts of the background of the image. In order to guarantee 100% recall, we add a margin to the automatically generated bounding boxes. Our RF repressor was developed in previous work6 and allows robust localization of the pancreas in our dataset. Bounding box detection helps reducing the input candidate space that our FCN needs to process in order to efficiently learn to differentiate pancreas from the surrounding anatomy. 2.2 Fully convolutional networks (3D U-Net) FCNs have the ability to solve challenging classification tasks in a data-driven manner, given a training set of images and labels S = (In , Ln ), n = 1, . . . , N , where In denotes the raw CT images and Ln denotes the ground truth label images. This allows the network to find a direct mapping from the image to segmentation space by learning a very complex non-linear function between the two. A popular recent FCN architecture is 3D U-Net,5 which utilizes transposed convolutions to remap the lower resolution feature maps within the network to the denser space of the input images. The 3D U-Net architecture consists of symmetric analysis and synthesis paths with four resolution levels each. Each resolution level in the analysis path contains two 3 × 3 × 3 convolutional layers, each followed by rectified linear units (ReLu) and a 2 × 2 × 2 max pooling with strides of two in each dimension. In the synthesis path, the convolutional layers are replaced by up-convolutions∗ of 2 × 2 × 2 with strides of two in each dimension. These are followed by two 3 × 3 × 3 convolutions, each of which has a ReLu. Furthermore, 3D U-Net employs shortcut (or skip) connections from layers of equal resolution in the analysis path to provide higher-resolution features to the synthesis path.5 The final convolutional layer employs a sigmoid activation function to compute a probability map for pancreas as output of the network. 2.3 Extended 3D U-Net In this work, we develop a custom-build 3D U-Net type FCN that can be employed on multiple GPUs, allowing mini-batch training, and use of a larger amount of GPU memory. Due to memory constraints, when applying 3D U-Net on one GPU card, the output size of the network had to be significantly smaller than the input size.5 By utilizing multiple GPUs (four in our case), we can define a network that allows a full end-to-end segmentation of the 3D volume covering the whole pancreas, as illustrated in Fig. 2. The next advantage of using multiple GPUs is that we can now fit volume batch sizes >1 into memory at each training iteration in order to use mini-batch updates and batch normalization.7 We investigate two variations of the architecture, one with concatenation (used by the original 3D U-Net) and one simplified version using summation skip connections to the encoder part of the network.8 Using concatenation, our network has 25M parameters; using summation, this reduces to 12M parameters at an input size of 120 × 120 × 120. Our use of summation layers mimics residual learning, which has been shown to improve deep neural network training in practice.9 ∗ We realize the up-convolutional layers as up-sampling layer followed by a convolutional layer. 2 Figure 2: The proposed architecture of our dense network (right) in comparison to 3D U-Net5 (left) with a pancreas sketch for illustration. 3D U-Net has been designed to run efficiently on one 12 GB GPU. It only utilizes valid convolutions and does have to use cropping in order to fit the network into memory, which can cause discontinuities in the segmentation result.4 On the other hand, multi-GPU processing allows us to employ a full end-to-end architecture that projects that segments the full 3D volume directly using same size convolution (via zero padding). This allows us to cover the full pancreas in the predicted subvolume. 2.4 Data augmentation In training, we employ smooth B-spline deformations to both the image and label data, similar to.5 The deformation fields are randomly sampled from a uniform distribution with a maximum displacement of 4 and a grid spacing of 24 voxels. Furthermore, we applied random rotations between −20◦ and +20◦ , and translations of -20 to 20 voxels in each dimension at each iteration in order to generate plausible deformations during training. Some example deformations are shown in Fig. 3. This type of data augmentation can help to artificially increase the training data and encourages convergence to more robust solutions while reducing overfitting to the training data (see Fig. 4). 2.5 Implementation All models are implemented in Keras with the TensorFlow backend, and use Adam optimization10 with an initial learning rate of 1e-2. As optimization function, we utilize the pseudo Dice score proposed in.11 We train all models for 20,000 iterations, which takes about one week. Inference, however, is achieved in less than 10 seconds per case. A DeepLearning BOX (uniV) including four NVIDIA Quadro P6000 GPUs with 24 GB each is used for the multi-GPU experiments. (a) (b) Figure 3: Cross-section through the same patient CT image (a) before and (b) after random deformation with the training ground truth overlaid in red. 3 1.0 0.9 0.8 Dice score 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 0 5000 10000 it erat ion 15000 20000 Figure 4: Comparison between use of concatenation or summation skip connections (with and without data augmentation) during training and testing. We plot the average Dice score of the models at each training iteration. An advantage of using summation skip connections and larger batch sizes can be observed in testing. Without data augmentation (no aug), the model overfits to the training data. 3. EXPERIMENTS & RESULTS 3.1 Data Our dataset originates from a research study with gastric cancer patients. 147 contrast enhanced abdominal CT scans were acquired in the portal venous phase. Each CT volume consists of 2631061 slices of 512 × 512 pixels. Voxel dimensions are [0.55-0.82, 0.55-0.82, 0.4-0.80] mm. The pancreas was delineated by three trained researchers and confirmed by a clinician. After RF regression, the detected bounding box regions are resampled to a fixed size of 120 × 120 × 120 and fed to our 3D FCN models. 3.2 Evaluation We evaluate our models using a hard split of 100 training and 47 testing patients, and achieve a Dice score performance of 88.3 ± 4.0 (range [76.4, 94.1])% (using concatenation layers), and 89.7 ± 3.8 (range [79.8, 94.8])% (using summation layers), respectively in testing (see Fig. 4). To the best of our knowledge, this is the new state-of-the-art performance in pancreas segmentation as can be seen in our comparison to recent literature in Table 1. However, direct comparison to other methods is difficult due to the different datasets and validation schemes employed. A typical test example is shown in Fig. 5 for the different model and training configurations explored in this work. Table 1: Comparison to other methods. We list other recent pancreas segmentation work performed on the same/similar datasets. A previous method using regression forest (RF) and graph cut (GC)6 on the same dataset, a method utilizing the original Caffe implementation of cascaded 3D U-Nets (trained on a larger dataset4 ), and two 2D FCNs methods1, 3 utilizing different data, are shown. Validation of other methods was performed using either leave-one-out-validation (LOOV) or cross-validation (CV). Method Proposed (concat) Proposed (sum) 3D U-Net (original)4 Oda et al. (2016)6 Roth et al. (2017)1 Zhou et al. (2016)3 Subjects 100/47 100/47 280/150 147 82 82 Approach RF + 3D FCN RF + 3D FCN 3D FCN (tiling) RF + GC 2D FCN 2D FCN 4 Validation train/test train/test train/test LOOV 4-fold CV 4-fold CV Dice (mean±std. [min.,max.])% 88.3 ± 4.0 [76.4, 94.1] 89.7 ± 3.8 [79.8, 94.8] 82.2 ± 10.2 [1.8, 92.2] 75.1 ± 15.4 [18.9, 92.7] 81.3 ± 6.3 [50.7, 89.0] 82.4 ± 5.7 [62.4, 90.9] (a) Ground truth (b) sum (no aug) (c) concat (aug) (d) sum (aug) (e) Ground truth (f) sum (no aug) (g) concat (aug) (h) sum (aug) Figure 5: Comparison between ground truth, and the prediction results using the different configurations explored in this work (coronal view). The result of setting (d) sum (aug) runs closest to the ground truth (red). No postprocessing is applied to the network’s output apart from thresholding the probability map at p(x) >= 0.5. 4. CONCLUSIONS Our models achieve the new state-of-the-art performance in automated pancreas segmentation in CT with close to 90% average Dice score. This is one of the first studies employing 3D FCNs in a multi-GPU setting for dense volumetric segmentation of the pancreas. We showed that deep 3D FCNs can benefit from larger amounts of GPU memory which facilitates mini-batch processing across several training volumes. The utilization of summation layers rather than concatenation layers seems to be beneficial for certain applications such as pancreas segmentation. In the future, the availability of even larger amounts of GPU memory and increased datasets will likely further improve the performance for automated organ segmentation in medical imaging. Our methods could easily be extended to the multi organ segmentation tasks by adjusting the loss function. In the future, some anatomical constraints could be included in order to guarantee topologically correct segmentation results.12 ACKNOWLEDGMENTS This paper was supported by MEXT KAKENHI (26108006, 26560255, 25242047, 17H00867, 15H01116) and the JPSP International Bilateral Collaboration Grant. 5 REFERENCES [1] Roth, H. R., Lu, L., Lay, N., Harrison, A. P., Farag, A., Sohn, A., and Summers, R. M., “Spatial aggregation of holistically-nested convolutional neural networks for automated pancreas localization and segmentation,” arXiv preprint arXiv:1702.00045 (2017). [2] Long, J., Shelhamer, E., and Darrell, T., “Fully convolutional networks for semantic segmentation,” in [Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition ], 3431–3440 (2015). [3] Zhou, Y., Xie, L., Shen, W., Fishman, E., and Yuille, A., “Pancreas segmentation in abdominal ct scan: A coarse-to-fine approach,” arXiv preprint arXiv:1612.08230 (2016). [4] Roth, H. R., Oda, H., Hayashi, Y., Oda, M., Shimizu, N., Fujiwara, M., Misawa, K., and Mori, K., “Hierarchical 3D fully convolutional networks for multi-organ segmentation,” arXiv preprint arXiv:1704.06382 (2017). [5] Çiçek, Ö., Abdulkadir, A., Lienkamp, S. S., Brox, T., and Ronneberger, O., “3D u-net: learning dense volumetric segmentation from sparse annotation,” in [International Conference on Medical Image Computing and Computer-Assisted Intervention ], 424–432, Springer (2016). [6] Oda, M., Shimizu, N., Karasawa, K., Nimura, Y., Kitasaka, T., Misawa, K., Fujiwara, M., Rueckert, D., and Mori, K., “Regression forest-based atlas localization and direction specific atlas generation for pancreas segmentation,” in [International Conference on Medical Image Computing and Computer-Assisted Intervention ], 556–563, Springer (2016). [7] Ioffe, S. and Szegedy, C., “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” in [International Conference on Machine Learning ], 448–456 (2015). [8] Drozdzal, M., Vorontsov, E., Chartrand, G., Kadoury, S., and Pal, C., “The importance of skip connections in biomedical image segmentation,” in [International Workshop on Large-Scale Annotation of Biomedical Data and Expert Label Synthesis ], 179–187, Springer (2016). [9] He, K., Zhang, X., Ren, S., and Sun, J., “Deep residual learning for image recognition,” in [Proceedings of the IEEE conference on computer vision and pattern recognition ], 770–778 (2016). [10] Kingma, D. and Ba, J., “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980 (2014). [11] Milletari, F., Navab, N., and Ahmadi, S.-A., “V-net: Fully convolutional neural networks for volumetric medical image segmentation,” in [3D Vision (3DV), 2016 Fourth International Conference on ], 565–571, IEEE (2016). [12] Oktay, O., Ferrante, E., Kamnitsas, K., Heinrich, M., Bai, W., Caballero, J., Guerrero, R., Cook, S., de Marvao, A., O’Regan, D., et al., “Anatomically constrained neural networks (acnn): Application to cardiac image enhancement and segmentation,” arXiv preprint arXiv:1705.08302 (2017). 6
1cs.CV
RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS arXiv:1411.5629v2 [math.AC] 18 Oct 2015 DAVIDE BOLOGNINI Abstract. A natural extension of bipartite graphs are d-partite clutters, where d ≥ 2 is an integer. For a poset P , Ene, Herzog and Mohammadi introduced the d-partite clutter CP,d of multichains of length d in P , showing that it is Cohen-Macaulay. We prove that the cover ideal of CP,d admits an xi -splitting, determining a recursive formula for its Betti numbers and generalizing a result of Francisco, Hà and Van Tuyl on the cover ideal of Cohen-Macaulay bipartite graphs. Moreover we prove a Betti splitting result for the Alexander dual of a Cohen-Macaulay simplicial complex. Keywords: resolution of edge ideals, Cohen-Macaulay clutters, Betti splittings, posets. AMS Mathematics Subject Classification 2010: 13D02, 13A02, 05E40, 05E45. 1. Introduction Edge ideals of graphs have been extensively studied by several authors (see for instance [9], [12], [16], [17], [33]). In recent years the interest focused on a generalization of the notion of graph, the so-called clutter (see [2], [27], [28], [15], [16], [35]). Edge ideals have been introduced by Villarreal in [34]. Let k be a field and G a finite simple graph on n vertices. The edge ideal of G is I(G) := (xi xj : {i, j} is an edge of G) ⊆ S = k[x1 , ..., xn ]. A graph G is called Cohen-Macaulay if S/I(G) is Cohen-Macaulay. Similarly it is possible to define the edge ideal I(C) of a clutter C. A relevant class of graphs consists of bipartite graphs. A finite simple graph G is bipartite if there exists a partition of its vertex set V = V1 tV2 , such that every edge of G is of the form {i, j}, with i ∈ V1 and j ∈ V2 . For every d ≥ 2, d-partite clutters are a natural extension of bipartite graphs. They have been introduced by Stanley in [32]. There are also other possible extensions, see e.g. [2]. In [20], Herzog and Hibi characterized all Cohen-Macaulay bipartite graphs G, showing that a bipartite graph is Cohen-Macaulay if and only if it can be associated to a poset P under a suitable construction. In [7], Ene, Herzog and Mohammadi extended this construction introducing the clutter CP,d , for d ≥ 2, and describing the maps of the resolution of the Alexander dual ideal I(CP,d )∗ of I(CP,d ), the so-called cover ideal. By using Betti splitting techniques introduced in [11], in Theorem 3.1 we prove an explicit recursive formula for the graded Betti numbers of I(CP,d )∗ , extending a result by Francisco, Hà and Van Tuyl [11, Theorem 3.8]. There are several preliminary results to the proof of the main theorem, but we think that Proposition 3.3 and Proposition 3.4 could be results of independent interest. In the case of a poset P with a unique maximal element, the formula can be considerably simplified (see Corollary 3.11). In Corollary 3.12 we give another formulation of [11, Theorem 3.8], on Betti numbers of the cover ideal of a Cohen-Macaulay bipartite graph. ∗ In Example 4.2 we show that Betti splittings could not exist for the Alexander dual ideal I∆ of a simplicial complex ∆. Moreover we point out that there is no relation between the existence of a Betti splitting of the ∗ Stanley-Reisner ideal I∆ and the existence of a Betti splitting of the Alexander dual ideal I∆ . Finally we ∗ give a sufficient condition that ensures the existence of an xi -splitting for I∆ (see Proposition 4.4). Acknowledgements. The last section of this paper was inspired by the summer school Discrete Morse Theory and Commutative Algebra, held at the Institut Mittag-Leffler in Stockholm in 2012. The author is 1 2 DAVIDE BOLOGNINI grateful to the staff of the Institut, to the organizers Bruno Benedetti and Alexander Engström, for their suggestions on Discrete Morse Theory and properties of simplicial complexes. Thanks to Paolo Sentinelli for helpful discussions. 2. Preliminaries Let k be a field. Throughout this paper, S denotes the polynomial ring k[x1 , ..., xnP ]. For a monomial ideal I ⊆ S, let βi,j (I) = dimk Tori (I, k)j be the graded Betti numbers of I and βi (I) = j∈N βi,j (I) be the i-th total Betti numbers of I. If I is generated in degree d, we say that I has a d-linear resolution provided βi,i+j (I) = 0 for every i ∈ N and j 6= d. When the context is clear, we simply say that I has a linear resolution. Denote by supp(m) the set of variables dividing a monomial m and by G(I) the set of minimal monomial generators of I. If I is a square-free monomial ideal, let I ∗ be its Alexander dual ideal (see for instance [21]). The idea of Betti splitting has been introduced in [6], but in this paper we follow the more general setting of [11]. Definition 2.1. ([11, Definition 1.1]) Let I, J and K be monomial ideals such that I = J + K and G(I) be the disjoint union of G(J) and G(K). Then J + K is a Betti splitting of I if βi,j (I) = βi,j (J) + βi,j (K) + βi−1,j (J ∩ K), for every i, j ∈ N. If this is the case βi (I) = βi (J) + βi (K) + βi−1 (J ∩ K), for every i ∈ N. In some cases we focus on a special splitting of a monomial ideal I. Let xi a fixed variable of S. Define M := {m ∈ G(I) : xi divides m}, J := ( xmi : m ∈ M ) and let K be the ideal generated by the remaining monomials of G(I). We call I = xi J + K an xi -partition. If this is a Betti splitting, we say that I = xi J + K is an xi -splitting of I. Francisco, Hà and Van Tuyl, in [11], proved the following splitting results that we use extensively in this paper. Proposition 2.2. ([11, Corollary 2.4],[11, Corollary 2.7]) Let I, J and K be monomial ideals in S such that I = J + K and G(I) be the disjoint union of G(J) and G(K). Let xi be a variable of S. Then (i) If J and K have a linear resolution, then I = J + K is a Betti splitting of I. (ii) If I = xi J + K is an xi -partition and J has a linear resolution, then I = J + K is a Betti splitting of I. Since we are using properties of ideals with linear quotients, we recall here some useful facts. Ideals with linear quotients have been introduced by Herzog and Takayama in [22]. For further details see [21] and [23]. Definition 2.3. Let I ⊆ S be a monomial ideal. We say that the ideal I has linear quotients if there exists an order u1 , ..., um of the monomials of G(I) such that, for every 2 ≤ j ≤ k, the colon ideal (u1 , ..., uj−1 ) : uj are generated by a subset of {x1 , ..., xn }. An ideal with linear quotients is componentwise linear (see [23, Corollary 2.8]) and, if generated in a single degree, it has a linear resolution (see [19]). The following characterization of square-free monomial ideals with linear quotients will be useful later (see for instance [21, Corollary 8.2.4]). Proposition 2.4. Let I ⊆ S be a square-free monomial ideal. Then I has linear quotients with respect to the order u1 , u2 , ..., um of the monomial generators if and only if for each i and for all j < i there exists a variable xh ∈ supp(uj ) \ supp(ui ) and an integer k < i such that supp(uk ) \ supp(ui ) = {xh }. We now recall some definitions about clutters, for further details see [28]. Definition 2.5. A clutter C = (V (C), E(C)) is a pair where V (C) is a finite set, called vertex set, and E(C) is a collection of non-empty subsets of V (C), called edges, such that if e1 and e2 are distint edges of C, then e1 6⊆ e2 . The clutter C is d-uniform if all edges have exactly d vertices. A vertex cover of a clutter C is a RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS3 subset W ⊆ V (C) such that e ∩ W 6= ∅, for every e ∈ E(C). A vertex cover is minimal if none of its proper subsets is a vertex cover. For d = 2 this is the definition of simple graph. In literature clutters are also known as simple hypergraphs. Let C be a clutter on the vertex set V (C) = {1, ..., n}. The edge ideal of the C is defined by ! Y I(C) := xi : e ∈ E(C) ⊆ S. i∈e The edges of a clutter can be seen as the facets of a simplicial complex. Then the edge ideal of a clutter coincides with the facet ideal introduced by Faridi in [10]. The Alexander dual ideal I(C)∗ of I(C) is called the cover ideal of C. Its minimal monomial generators correspond to the vertex covers of C. The clutter C is called Cohen-Macaulay if S/I(C) is Cohen-Macaulay. Example 2.6. Let V = {1, 2, 3, 4}. The collection {{1, 2}, {1, 2, 3}, {3, 4}} is not a clutter. The clutter C whose edge set is E(C) = {{1, 2, 3}, {3, 4}} is not uniform. Its edge ideal in k[x1 , ..., x4 ] is I(C) = (x1 x2 x3 , x3 x4 ). Its cover ideal is I(C)∗ = (x3 , x1 x4 , x2 x4 ) and in fact the minimal vertex covers of C are {3}, {1, 4}, {2, 4}. Definition 2.7. Let C = (V (C), E(C)) be a d-uniform clutter. We say that C is d-partite if there is a partition V (C) = V1 tV2 t...tVd such that all the edges of C have the form {j1 , j2 , ..., jd }, where jr ∈ Vr , for 1 ≤ r ≤ d. For d = 2, this is the definition of bipartite graph. Let P = {p1 , ..., pn } be a finite poset, with partial order ≤. We label each element of P in such a way that if pi < pj , then i < j. A subset C ⊆ P is called a chain if C = pi1 < pi2 < · · · < pid is a totally ordered set with respect to the induced order. A multichain of length d in P is a chain pi1 ≤ pi2 ≤ · · · ≤ pid , in which we allow repetitions. Let Max(P ) := {p ∈ P : there is no q ∈ P such that p < q}. By our labeling convention, we have pn ∈ Max(P ). A poset ideal α in P is a subset of P with the following property: given p ∈ α and q ∈ P such that q ≤ p, then q ∈ α. We may consider each poset ideal as a subposet of P with respect to the induced order. Notice that, given p ∈ Max(α), then α \ {p} is again a poset ideal of P . Given p1 , ..., pk elements of P , denote by hp1 , ..., pk i the smallest poset ideal containing p1 , ..., pk . Let I(P ) be the set of all poset ideals of P . Example 2.8. Let P = {p1 , ..., p6 } be the poset with 6 elements, whose Hasse diagram is given in Figure 1. p2 p5 p6 p3 p4 p1 Figure 1. A poset with 6 elements. Examples of chains in P are p1 < p5 and p1 < p4 < p6 . Examples of multichains of length 4 and 5 are p2 ≤ p2 ≤ p2 ≤ p2 , p1 ≤ p1 ≤ p1 ≤ p6 ≤ p6 . Clearly Max(P ) = {p2 , p5 , p6 }. The subposet {p1 , p4 , p6 , p2 } is a poset ideal of P and it is equal to hp2 , p6 i. The subposet {p2 , p3 , p4 } is not a poset ideal of P , because p1 ≤ p2 but p1 ∈ / {p2 , p3 , p4 }. 4 DAVIDE BOLOGNINI Let P be a poset and d ≥ 2 be an integer. We recall here the construction of the d-partite clutter CP,d . Let V = {xij : 1 ≤ i ≤ d, 1 ≤ j ≤ n} and T = k[xij : 1 ≤ i ≤ d, 1 ≤ j ≤ n] a polynomial ring on nd variables. The clutter CP,d is the clutter with vertex set V = V (CP,d ) whose edges are E(CP,d ) := {{x1j1 , x2j2 , ..., xdjd } : pj1 ≤ pj2 ≤ · · · ≤ pjd is a multichain of length d in P }. Then the edge ideal of CP,d is I(CP,d ) = d Y ! xrjr : pj1 ≤ pj2 ≤ · · · ≤ pjd is a multichain of length d in P ⊆ T. r=1 We give a simple example of this construction. Example 2.9. Let P be the poset of Example 2.8 and d = 3. To avoid double indices, we set xj = x1j , yj = x2j and zj = x3j . Let T = k[x1 , x2 , x3 , y1 , y2 , y3 , z1 , z2 , z3 ]. To each multichain pi ≤ pj ≤ pk of length 3 in P , we associate the monomial xi yj zk . For instance, the multichain p1 ≤ p2 ≤ p2 is associated with the monomial x1 y2 z2 . Then the edge ideal of CP,3 in T is I(CP,3 ) = (x1 y1 z1 , x2 y2 z2 , x3 y3 z3 , x4 y4 z4 , x5 y5 z5 , x6 y6 z6 , x1 y3 z5 , x1 y4 z6 , x1 y1 z2 , x1 y2 z2 , x1 y1 z3 , x1 y3 z3 , x1 y1 z5 , x1 y5 z5 , x3 y3 z5 , x3 y5 z5 , x1 y1 z4 , x1 y4 z4 , x1 y1 z6 , x1 y6 z6 , x4 y4 z6 , x4 y6 z6 ). Let Vi := {xij : 1 ≤ j ≤ n}, for 1 ≤ i ≤ d. Then V (CP,d ) = V1 tV2 t...tVd . By construction, CP,d is d-partite. Note that for d = 2 this is the construction of a bipartite graph starting from a poset P , given by Herzog and Hibi (see [21] and [20]). For d ≥ 3, not all Cohen-Macaulay d-uniform d-partite clutters arise from a poset (see e.g. [27, Example 3.4]). Following [7, Theorem 1.1], we describe explicitly the generators of the ideal I(CP,d )∗ . A poset multideal of degree d in P is a d-tuple α = (αi )1≤i≤d , such that  αi ∈ IP \ i−1 [  αj   and d−1 [ αd = P \  j=1  αj  . j=1 Sd Notice that i=1 αi = P . Let α be a poset multideal of degree d in P. We define the monomial uα := d Y Y xij . i=1 pj ∈αi Each monomial uα has degree n = |P |. Here and in what follows, | · | denotes the cardinality of a finite set. By [7, Theorem 1.1], we have I(CP,d )∗ = (uα )α∈Id (P ) . To simplify the notation, from now on we denote by HP,d the ideal I(CP,d )∗ . Example 2.10. Let P be the poset of Example 2.8. Examples of poset multideal of degree 3 and 4 in P , respectively, are α = ({p1 , p3 }, {p2 , p5 }, {p4 , p6 }) and γ = ({p1 , p2 , p4 }, ∅, {p3 , p6 }, {p5 }). Consider the notation of Example 2.9 to avoid double indices, setting tj = x4 j. We have the monomials uα = x1 x3 y2 y5 z4 z6 and uγ = x1 x2 x4 z3 z6 t5 . In [7, Theorem 2.4], the authors proved that HP,d is a weakly polymatroidal ideal. Weakly polymatroidal ideals have been introduced by Hibi and Kokubo in [14]. From [26, Theorem 1.3], it follows that a weakly polymatroidal ideal has linear quotients. Then the ideal HP,d has linear quotients. In particular it has a linear resolution. Hence S/I(CP,d ) is Cohen-Macaulay, by [5, Theorem 3]. RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS5 3. The recursive formula Our main result is a recursive formula for the Betti numbers of HP,d , extending a recent result due to Francisco, Hà and Van Tuyl, [11, Theorem 3.8]. We recall that the ideal HP,d is generated in a single degree n = |P | and that it has a linear resolution. Theorem 3.1. Let P 6= ∅ be a finite poset, d ≥ 2 be an integer. Then, for i ≥ 0,   X |Max(α)| X |Max(α)|  βi (HP,d ) = βi−h (Hα,d−1 ) . h h=0 α∈I(P ) Before proving the theorem, we explain the situation in some degenerate cases. Remark 3.2. (i) If P = ∅, then H∅,d = 0. (ii) If P = {p1 }, then HP,d = (x11 , x21 , . . . , xd1 ). It is well-known that this ideal has a linear resolution and its Betti numbers are given by   d βi (H{p1 },d ) = , for i ≥ 0. i+1 Qn (iii) If P 6= ∅ is a finite poset and d = 1, then HP,1 is generated by a single monomial m = j=1 x1j . Then β0 (HP,1 ) = 1 and βi (HP,1 ) = 0 for each i ≥ 1. We now prove some technical results, which will be useful later. Proposition 3.3. Let I ⊆ S = k[x1 , ..., xn ] be a square-free monomial ideal with a d-linear resolution and m = (x1 , ..., xn ). Let k be a positive integer and n = (y1 , ..., yk ) ⊆ k[y1 , ..., yk ]. Then the ideal nI ⊆ R = k[x1 , ..., xn , y1 , ..., yk ] has a (d + 1)-linear resolution and k−1 X k  βi−s (I), for every i ≥ 0. βi (nI) = s+1 s=0 Proof. We first prove that the ideal nI has a (d+1)-linear resolution. Notice that y1 , ..., yk is an IR-regular sequence. By [4, Theorem 2.2], nI has a (d + 1)-linear resolution, since I has a d-linear resolution. To prove the formula we proceed by induction on k. If k = 1, we have nothing to show, since βi (nI) = βi (y1 I) = βi (I), for every i ≥ 0. Let k > 1. One has nI = (y1 , ..., yk−1 )I + yk I. Notice that G(nI) is the disjoint union of G((y1 , ..., yk−1 )I) and G(yk I). By Proposition 2.2 (ii), this decomposition is a Betti splitting of nI, because yk I has a (d + 1)-linear resolution. Then βi (nI) = βi ((y1 , ..., yk−1 )I) + βi (yk I) + βi−1 (yk (y1 , ..., yk−1 )I), for every i ≥ 0. Since βi (yk I) = βi (I) and βi−1 (yk (y1 , ..., yk−1 )I) = βi−1 ((y1 , ..., yk−1 )I), for every i ≥ 0, by induction k−2 k−2 k−1 X k − 1 X k − 1 X k  βi (nI) = βi−s (I) + βi (I) + βi−1−s (I) = βi−s (I).  s+1 s+1 s+1 s=0 s=0 s=0 Proposition 3.4. Let d, t ≥ 1 be integers. Let {Ik }1≤k≤t be an ordered collection of monomial ideals Pt with a d-linear resolution in S = k[x1 , ..., xn ]. Set I := k=1 Ik . Assume G(I) is the disjoint union of {G(Ik )}1≤k≤t and that: Pj (i) for every 2 ≤ j ≤ t, the ideal k=1 Ik have a d-linear resolution; (ii) for every 2 ≤ j ≤ t, there exists an ideal nj , generated by a subset of the variables x1 , ..., xn , such Pj−1  that Ij ∩ k=1 Ik = nj Ij . Then βi (I) = βi (I1 ) + t X  |G(nk )|  X  k=2 s=0   |G(nk )| βi−s (Ik ) , for i ≥ 0. s 6 DAVIDE BOLOGNINI Proof. We may assume t > 1, since for t = 1 the formula is clear. Consider the following splitting of I: I= t−1 X Ik + It . k=1 Pt−1 Pt−1 By our assumption, G(I) is the disjoint union of G(It ) and G( k=1 Ik ). Moreover the ideals It and k=1 Ik have a d-linear resolution by (i), with j = t − 1. By Proposition 2.2 (i), the splitting above is a Betti splitting Pt−1 of I. By assumption (ii), we have It ∩ k=1 Ik = nt It . Then ! t−1 X βi (I) = βi (It ) + βi Ik + βi−1 (nt It ), for every i ≥ 0. k=1 By Proposition 3.3, we get βi (I) = βi (It ) + βi t−1 X k=1 |G(nt )|−1  ! Ik + X h=0  |G(nt )| βi−1−h (It ), for every i ≥ 0. h+1 We conclude by setting s = h + 1 and by induction on t.  Let P = {p1 , ..., pn } be a poset and recall that, for our labeling convention, pn ∈ Max(P ). Let ψ = hpn i the smallest poset ideal of P containing pn . Define I(P, pn ) := {α ∈ I(P ) : pn ∈ α}. Let d ≥ 2 be an integer. For every α ∈ I(P, pn ), we define the ideal   Y Jα :=  xdi  Hα,d−1 . pi ∈α / In order to define the ideal Jα , we consider α as a subposet of P with respect to the induced order. Notice that Jα is generated in a single degree n = |P |. Since the ideal Hα,d−1 has a linear resolution, it follows that Jα has a linear resolution. We now give an order of the ideals {Jα }α∈I(P,pn ) . Let α1 , α2 ∈ I(P, pn ), with α1 6= α2 . We set α1 / α2 if one of the following conditions is satisfied: (i) |α1 | < |α2 |; (ii) |α1 | = |α2 | and max{j : pj ∈ α1 \ α2 } < max{j : pj ∈ α2 \ α1 }. Note that, with respect to the above order, ψ / α, for every α ∈ I(P, pn ). Example 3.5. Let P be the poset of Example 2.8. Clearly p6 ∈ Max(P ) and ψ = hp6 i = {p1 , p4 , p6 }. The poset ideals containing p6 are I(P, pn ) := {{p1 , p4 , p6 }, {p1 , p4 , p6 , p2 }, {p1 , p4 , p6 , p3 }, {p1 , p4 , p6 , p2 , p3 }, {p1 , p4 , p6 , p3 , p5 }, P }. Consider α = {p1 , p4 , p6 , p2 }, d = 3 and set of P with respect of the induced order: (∅, P ), ({p1 }, {p2 , p4 , p6 }), ({p1 , p2 }, {p4 , p6 }), ({p1 , p4 }, {p2 , p6 }), ({p1 , p2 , p4 }, {p6 }), ({p1 , p4 , p6 }, {p2 }), (P, ∅). Then Jα = z3 z5 (y1 y2 y4 y6 , x1 y2 y4 y6 , x1 x2 y4 y6 , x1 x4 y2 y6 , x1 x2 x4 y6 , x1 x4 x6 y2 , x1 x2 x4 x6 ). Notice that the given order of the elements of I(P, pn ) is the order / defined above. Proposition 3.6. Let P be a poset, pn ∈ Max(P ) and fix α ∈ I(P, pn ). Then the ideal J := X Jφ φ∈I(P,pn ),φ/α has linear quotients. In particular J has a linear resolution. Proof. Assume α = ψ. Then J = Jψ . This ideal has linear quotients, since Hψ,d−1 has linear quotients. We may assume α 6= ψ. To prove that J has linear quotients, we use Proposition 2.4. We want to define an ordering <J of the monomials in G(J). For each φ ∈ I(P, pn ), Jφ has linear quotients with respect to an ordering <φ of the monomials in G(Jφ ). Let u, v ∈ G(J). Then u ∈ G(Jφ1 ) and v ∈ G(Jφ2 ), for some φ1 , φ2 ∈ I(P, pn ). We set u <J v if one of the following conditions is satisfied: RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS7 (i) φ1 6= φ2 and φ1 / φ2 ; (ii) φ1 = φ2 = φ and u <φ v. With respect to the above notation, let u, v ∈ G(J) such that u <J v. Assume first φ1 = φ2 = φ. Since Jφ has linear quotients, by Proposition 2.4, there exists a variable x ∈ supp(u) \ supp(v) and a monomial w ∈ G(Jφ ), with w <φ v such that supp(w) \ supp(v) = {x}. By definition of <J , we have w <J v and we are done. Assume now φ1 6= φ2 . We have φ1 / φ2 . Then there exist pj ∈ Max(φ2 ) \ φ1 . In fact assume, by contradiction, that Max(φ2 ) ⊆ φ1 . It follows that φ2 ⊆ φ1 , since φ1 is a poset ideal of P . This is a contradiction, since |φ1 | ≤ |φ2 | and φ1 6= φ2 . Then pj 6= pn , because pn ∈ φ1 . Since pj ∈ φ2 \ φ1 , then xdj ∈ supp(u) \ supp(v). of Jφ2 , there exists a poset multideal Q By definition  γ = (γ1 , ..., γd−1 ) of degree d−1 in φ2 such that v = pi ∈φ / 2 xdi uγ . Since pj ∈ φ2 , there exists 1 ≤ k ≤ d−1 such that pj ∈ γk . Consider the monomial   Y w= xdi  uγ\{pj } , pi ∈(P \φ2 )∪{pj } where γ \ {pj } := (γ1 , ..., γk \ {pj }, ..., γd−1 ). Clearly φ2 \ {pj } is a poset ideal of P , because pj ∈ Max(φ2 ) and we have φ2 \ {pj } ∈ I(P, pn ), since φ2 ∈ I(P, pn ). Moreover γ \ {pj } is a poset multideal of degree d − 1 in φ2 \ {pj }. Then w ∈ G(Jφ2 \{pj } ). Since |φ2 \ {pj }| < |φ2 |, one has φ2 \ {pj } / φ2 and w <J v. From the fact that supp(w) \ supp(v) = {xdj }, we conclude by Proposition 2.4.  In the next lemma, we summarize some important properties of the ideals Jα and Hα,d , for α ∈ I(P, pn ). We recall that the intersection J ∩K of two monomial ideals is generated by {lcm(u, v) : u ∈ G(J), v ∈ G(K)}, where lcm(u, v) denotes the least common multiple of the monomials u and v. Clearly supp(lcm(u, v)) = supp(u) ∪ supp(v), see [21]. Lemma 3.7. Let P be a poset, pn ∈ Max(P ), α, γ ∈ I(P, pn ), d ≥ 2 an integer. Then (i) Jα ⊆ HP \{pn },d ; (ii) Hα,d ∩ Hγ,d = Hα∪γ,d and,  in particular, Hα∪γ,d ⊆ Hα,d ; Q (iii) Jα ∩ Jγ = x pi ∈P \(α∩γ) di Hα∪γ,d−1 . Proof. First we prove (i). Let u ∈ G(Jα ). By definition there exists a poset multideal (γ1 , ..., γd−1 ) of degree d − 1 in α, such that u = uγ , where γ = (γ1 , ..., γd−1 , P \ α). Since pn ∈ α, then there exists 1 ≤ i ≤ d − 1 such that pn ∈ γi . Note that γ \ {pn } := (γ1 , ..., γi \ {pn }, ..., γd−1 , P \ α) is a poset multideal of degree d in P \ {pn }, because pn ∈ Max(P ). Hence uγ = xdi uγ\{pn } ∈ HP \{pn },d . Now we prove (ii). We first show the inclusion from left to right. Let m ∈ G(Hα,d ∩ Hγ,d ). There exist α = (α1 , ..., αd ) and γ = (γ1 , ..., γd ) poset multideals of degree d in α and γ, respectively, such that m = lcm(uα , uγ ). Define φi := (αi ∪ γi ) \ i−1 [ (αj ∪ βj ), for 1 ≤ i ≤ d − 1; j=1 and φd := (α ∪ γ) \ d−1 [ φj . j=1 We claim that φ = (φ1 , ..., φd ) is a poset multideal of α ∪ γ. Fix 1 ≤ i ≤ d − 1. Notice that φi ⊆ Si−1 Si−1 Si−1 (α ∪ γ) \ j=1 φj , because j=1 φj = j=1 (αj ∪ βj ). If φi = ∅, we have nothing to prove, then we may Si−1 assume φi 6= ∅. Let p ∈ φi and q ∈ (α ∪ γ) \ j=1 φj , with q ≤ p. We prove that q ∈ φi . Assume first Si−1 p ∈ αi ⊆ α \ j=1 αj . Since α is a poset ideal of P and p ∈ α, we have q ∈ α. On the other hand, Si−1 Si−1 Si−1 q ∈ α \ j=1 φj ⊆ α \ j=1 αj and αi is a poset ideal of α \ j=1 αj , then q ∈ αi . Hence q ∈ φi . The proof is the same if p ∈ γi . From the fact that φi ⊆ αi ∪γi , for every 1 ≤ i ≤ d, we have that supp(uφ ) ⊆ supp(m). Then m ∈ Hα∪γ,d , since uφ and m are square-free monomials. 8 DAVIDE BOLOGNINI We now prove the reverse inclusion. Let uφ ∈ G(Hα∪γ,d ), where φ = (φ1 , ..., φd ) is a poset multideal of γ γ α degree d in α ∪ γ. Let φα i := φi ∩ α and φi := φi ∩ γ, for 1 ≤ i ≤ d. Clearly φi = φi ∪ φi . We prove that i−1 α α α (φ1 , ..., φd ) is a poset multideal of degree d in α, proving that φi is a poset ideal of α \ ∪j=1 (φα j ) for every i−1 α integer 1 ≤ i ≤ d − 1. Let p ∈ φα and q ∈ α \ ∪ (φ ) such that q ≤ p. Since in particular q ∈ α \ ∪i−1 i j=1 j j=1 (φj ), α γ α then q ∈ φi . Since q ∈ α, then q ∈ φi . The proof for γ is the same. Then uφ = lcm(uφi , uφi ) ∈ Hα,d ∩ Hγ,d . Eventually we prove (iii). We have     Y Y Jα ∩ Jγ = lcm  xdi  ,  xdi  Hα,d−1 ∩ Hγ,d−1 . pi ∈P \α pi ∈P \γ By part (ii) and since (P \ α) ∪ (P \ β) = P \ (α ∩ β), the result follows.  Proposition 3.8. Let P = {p1 , ..., pn } be a poset. Then      |Max(α)|−1  X X X |Max(α)| − 1  βi−s (Hα,d−1 ) , for every i ≥ 0. βi  Jα  = s s=0 α∈I(P,pn ) α∈I(P,pn ) Proof. To prove the formula, we use Proposition 3.4. We consider the order / defined above on the ideals {Jα }α∈I(P,pn ) . P We recall that the ideals {Jα }α∈I(P,pn ) have a linear resolution and that G( α∈I(P,pn ) Jα ) is the disjoint P union of {G(Jα )}α∈I(P,pn ) . By Proposition 3.6, the ideals φ/α Jφ have a linear resolution, for every α ∈ I(P, pn ). Then condition (i) of Proposition 3.4 is fulfilled. We verify now condition (ii) of Proposition 3.4. Fix α ∈ I(P, pn ), with α 6= ψ. We define the following set: Rα := {γ ∈ I(P, pn ) : γ ⊆ α and |γ| = |α| − 1}. We claim that     X X (1) Jα ∩  Jφ  = Jα ∩  Jγ  . φ∈I(P,pn ),φ/α γ∈Rα The inclusion from right to left is clear, since for every γ ∈ Rα , we have γ ∈ I(P, pn ), |γ| < |α| and then γ / α. To prove the other inclusion, let φ ∈ I(P, pn ), such that φ / α. Since |φ| ≤ |α| and φ 6= α, then there exists pj ∈ Max(α) \ φ (by the same argument in the proof of Proposition 3.6). Since pn ∈ φ, then pj 6= pn . Then the poset ideal γ := α \ {pj } is an element of I(P, pn ), such that γ ⊆ α and |γ| = |α| − 1, i.e. γ ∈ Rα . Notice that α ∩ φ ⊆ γ, then P \ (α ∩ φ) ⊇ P \ γ. From this and from Lemma 3.7 (ii)-(iii), it follows that     Y Y Jα ∩ Jφ =  xdi  Hα∪φ,d−1 ⊆  xdi  Hα,d−1 = Jα ∩ Jγ . pi ∈P \(α∩φ) pi ∈P \γ So we proved (1). For α ∈ I(P, pn ) and γ ∈ Rα , let pjγ such that γ = α \ {pjγ }. By (1) and Lemma 3.7 (iii) it follows       X X X Y X  Jα ∩  Jφ  = (Jα ∩ Jγ ) = xdi  Hα,d−1 =  xdjγ  Jα . φ∈I(P,pn ),φ/α γ∈Rα γ∈Rα pi ∈(P \α)∪{pjγ } γ∈Rα So we proved that condition (ii) in Proposition 3.4 is fulfilled. One has |Rα | = |Max(α)|−1 by construction. Recall that βi (Jα ) = βi (Hα,d−1 ), for i ≥ 0. Then by Proposition 3.4, for every i ≥ 0      |Max(α)|−1  X X X |Max(α)| − 1  βi  Jα  = βi (Hψ,d−1 ) + βi−s (Hα,d−1 ) . s s=0 α∈I(P,pn ) α∈I(P,pn ),α6=ψ RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS9 Since the poset ideal ψ is such that Max(ψ) = {pn }, the result follows.  Now we are able to prove Theorem 3.1. Proof of Theorem 3.1. We proceed by induction on n = |P | ≥ 1. For n = 1, the formula holds by Remark 3.2. P We may assume n ≥ 2. We prove that HP,d = xdn HP \{pn },d + α∈I(P,pn ) Jα . Let u ∈ G(HP,d ) and φ = (φ1 , ..., φd ) be a poset multideal of degree d in P such that u = uφ . Assume first pn ∈ φd , then xdn divides uφ . Notice that φ \ {pn } = (φ1 , ..., φd−1 , φd \ {pn }) is a poset multideal of degree d in P \ {pn } and u = xdn uφ\{pn } ∈ xdn HP \{pn },d . Sd−1 Assume pn ∈ φi , for 1 ≤ i < d. Let α := j=1 φj , then α ∈ I(P, pn ). Hence (φ1 , ..., φd−1 ) is a poset multideal of degree d − 1 in α and uφ ∈ Jα . Conversely, let u ∈ G(xdn HP \{pn },d ). Let δ = (δ1 , ..., δd ) be a poset multideal of degree d in P \ {pn } such that u = xdn uδ . Since (δ1 , ..., δd ∪ {pn }) is a poset multideal of degree d in P, one has u ∈ HP,d . Let u ∈ G(Jα ), such that α ∈ I(P, pn ). Let γ = (γ1 , ..., γd−1 ) a poset multideal of degree d − 1 in α such that Q  u= pi ∈α / xdi uγ . One has u ∈ G(HP,d ) since (γ1 , ..., γd−1 , P \ α) is a poset multideal of degree d in P. Recall P that the ideal HP \{pn },d has a linear resolution. Clearly G(HP,d ) is the disjoint union of G(xdn HP \{pn },d ) and G( α∈I(P,pn ) Jα ). By Proposition 2.2 (ii), the splitting above is an xdn -splitting. Notice that xdn HP \{pn },d has a linear resolution and βi (xdn HP \{pn },d ) = βi (HP \{pn },d ), for every i ≥ 0. By Lemma 3.7 (i)     X X X X xdn HP \{pn },d ∩  Jα  = xdn (HP \{pn },d ∩ Jα ) = xdn Jα = xdn  Jα  . α∈I(P,pn ) α∈I(P,pn ) α∈I(P,pn ) α∈I(P,pn ) Then  (2)  X βi (HP,d ) = βi (HP \{pn },d ) + βi   Jα  + βi−1  α∈I(P,pn ) By Proposition 3.8 one has, for every i ≥ 0,     X X βi  Jα  + βi−1  Jα  = α∈I(P,pn ) α∈I(P,pn ) |Max(α)|  X  α∈I(P,pn ) Jα  . α∈I(P,pn )  X  X s=0   |Max(α)| βi−s (Hα,d−1 ) . s Notice that I(P ) = I(P \ {pn }) ∪ I(P, pn ). By induction we conclude.  Remark 3.9. For d = 2, it can be easily proved that this result is equivalent to [11, Theorem 3.8] (see equation (2)). Remark 3.10. Notice that the Betti numbers βi (HP,d ) do not depend on the characteristic of the base field k. The splitting formula can be simplified if P has a unique maximal element. Corollary 3.11. Let P be a poset with a unique maximal element pn and let d ≥ 2 be an integer. Then βi (HP,d ) = βi (HP \{pn },d ) + βi (HP,d−1 ) + βi−1 (HP,d−1 ), for each i ≥ 0. Proof. By assumption P = hpn i, where pn is the unique element in I(P, pn ). The splitting formula follows immediately by equation (2) in the proof of Theorem 3.1.  Let G be a Cohen-Macaulay bipartite graph. By [20, Theorem 3.4], there exists a poset P such that CP,2 = G. By using Theorem 3.1, we are able to give another formulation of [11, Theorem 3.8]. Corollary 3.12. Let G be a Cohen-Macaulay bipartite graph and P be the poset such that CP,2 = G. Then X |Max(α)| ∗ βi (I(G) ) = . i α∈I(P ) 10 DAVIDE BOLOGNINI Proof. The formula follows immediately by Theorem 3.1 with d = 2 and Remark 3.2.  4. Betti splitting for Cohen-Macaulay simplicial complexes In this section we present some interesting examples about Betti splittings of Alexander dual ideals of Cohen Macaulay simplicial complexes. By [5, Theorem 3] such ideals have a linear resolution. For more definitions about simplicial complexes, their properties and the Stanley-Reisner correspondence we refer to [21, Chapter 1] and [24, Chapter 3]. Definition 4.1. An abstract simplicial complex ∆ on n vertices is a collection of subsets of {1, . . . , n}, called faces, such that if F ∈ ∆, G ⊆ F , then G ∈ ∆. A facet is a maximal face of ∆ with respect to the inclusion of sets. Denote by F(∆) the collection of facets of ∆. A simplicial complex ∆ is called pure if all its facets have the same cardinality. ∗ The Alexander dual ideal I∆ of ∆ is defined by ∗ I∆ = (xF : F ∈ F(∆)), where F := {1, . . . , n} \ F and xF = We briefly recall the definitions of link and deletion of a vertex i of ∆. Q i∈F xi . link∆ (i) := {F ∈ ∆ : i ∈ / F, F ∪ {i} ∈ ∆}. del∆ (i) := {F ∈ ∆ : i ∈ / F }. In the following example we show an ideal with a linear resolution that does not admit any Betti splitting. ∗ are completely unrelated. In this example we also point out that the existence of Betti splittings of I∆ and I∆ Example 4.2. (Dunce hat) Let ∆ be the two-dimensional simplicial complex in Figure 2. It is a triangulation of the dunce hat introduced by Zeeman [36]. Figure 2. A triangulation of the dunce hat. It is contractible but not collapsible (see [24]). Moreover ∆ is Cohen-Macaulay and the graded Betti ∗ numbers of I∆ are given by the following linear resolution: ∗ 0 → R(−7)11 → R(−6)27 → R(−5)17 → I∆ . ∗ In particular I∆ has 17 minimal generators of degree 5. Using CoCoA [3] or Macaulay 2 [13], it can be shown that for every monomial ideals J, K such that ∗ ∗ ∗ I∆ = J + K, being G(I∆ ) is the disjoint union of G(J) and G(K), the decomposition I∆ = J + K is not a ∗ Betti splitting of I∆ . This example answers [11, Question 4.3], showing that, in general, there is no relation between the existence of Betti splitting for a square-free monomial ideal and the characteristic dependence ∗ of its graded Betti numbers, since in this case the ideal I∆ has characteristic-independent resolution. Nevertheless the Stanley-Reisner ideal of ∆ admits a Betti splitting I∆ = J + K, where RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS 11 J = (x2 x6 , x4 x7 , x2 x4 x8 , x3 x4 x5 , x2 x3 x4 , x2 x7 x8 , x3 x4 x6 , x1 x4 x6 , x3 x5 x6 ) and K = (x5 x7 , x5 x8 , x1 x2 x5 , x1 x4 x5 , x1 x6 x8 , x1 x6 x7 , x1 x3 x8 , x1 x4 x8 , x1 x3 x7 , x3 x6 x8 , x1 x2 x3 , x3 x7 x8 ). In fact the graded Betti numbers of I∆ are given by 0 → R(−7)11 → R(−6)50 → R(−5)86 → R(−3)2 ⊕ R(−4)65 → R(−2)4 ⊕ R(−3)17 → I∆ , and the graded Betti numbers of J, K and J ∩ K are given by 0 → R(−6)3 → R(−5)13 → R(−4)18 → R(−2)2 ⊕ R(−3)7 → J 0 → R(−6)5 → R(−5)19 → R(−3) ⊕ R(−4)24 → R(−2)2 ⊕ R(−3)10 → K 0 → R(−7)11 → R(−6)42 → R(−5)54 → R(−3) ⊕ R(−4)23 → J ∩ K. We finally prove that a condition introduced by Nagel and Römer in [29] ensures the existence of xi splitting for the Alexander dual of a Cohen-Macaulay simplicial complex. Definition 4.3. ([29, Definition 3.1]) A pure non-empty simplicial complex ∆ on n vertices is called weakly vertex decomposable (WVD) if there exists a vertex v of ∆ fulfilling exactly one of the following conditions: (i) del∆ (v) is WVD and ∆ is a cone over del∆ (v) with apex v; (ii) link∆ (v) is WVD and del∆ (v) is Cohen-Macaulay of the same dimension of ∆. Notice that Provan and Billera [30] use the same name for a different class of complexes. Every weakly vertex decomposable simplicial complex is Cohen-Macaulay and every pure vertex decomposable simplicial complex is weakly vertex decomposable, see [29]. ∗ admits Let ∆ be a vertex decomposable complex. By [25, Theorem 2.8, Corollary 2.11], the ideal I∆ xi -splitting, for some xi . Weakly vertex decomposability of ∆ is a sufficient condition for the existence of ∗ an xi -splitting of I∆ , for a suitable xi , generalizing the result cited above. Proposition 4.4. Let ∆ be a weakly vertex decomposable simplicial complex. Then there exists a vertex ∗ admits xi -splitting. i ∈ ∆ such that I∆ ∗ ∗ Proof. If ∆ is a cone over del∆ (i) for some i, then I∆ and Idel have the same graded Betti numbers. Then ∆ (i) we may assume that ∆ is not a cone. Let i be the vertex in the definition of weakly vertex decomposable simplicial complex. Since del∆ (i) is Cohen-Macaulay, then it is pure and i is a shedding vertex (see for ∗ ∗ ∗ = xi Idel + Ilink . Recall again that del∆ (i) is Coheninstance [25]). By [25, Lemma 2.2], we have I∆ ∆ (i) ∆ (i) ∗ Macaulay. Then, by [5, Theorem 3], Idel∆ (i) has a linear resolution and the result follows by Proposition 2.2 (ii).  In the following example we show that the converse of the previous proposition does not hold, even in the Cohen-Macaulay case. Example 4.5. (Hachimori’s example) Let ∆ be the simplicial complex in Figure 3, due to Hachimori [18]. It is shellable, hence Cohen-Macaulay., but not weakly vertex decomposable. In fact ∆ is not a cone and del∆ (i) is not Cohen-Macaulay for 1 ≤ i ≤ 7. ∗ The graded Betti numbers of I∆ are given by ∗ 0 → R(−6)8 → R(−5)20 → R(−4)13 → I∆ . ∗ ∗ The ideal I∆ admits x4 -splitting. In fact I∆ = x4 J + K is a Betti splitting, where x4 J = (x3 x4 x5 x7 , x2 x3 x4 x5 , x3 x4 x5 x6 , x1 x2 x3 x4 , x1 x4 x5 x7 , x1 x2 x4 x7 , x1 x4 x6 x7 , x3 x4 x6 x7 ) and K = (x1 x5 x6 x7 , x1 x3 x5 x6 , x1 x2 x3 x6 , x2 x3 x6 x7 , x2 x5 x6 x7 ). The graded Betti numbers of J, K and J ∩ K are given by 0 → R(−6)4 → R(−5)11 → R(−4)8 → J 0 → R(−6) → R(−5)5 → R(−4)5 → K 0 → R(−6)3 → R(−5)4 → J ∩ K. 12 DAVIDE BOLOGNINI Figure 3. Hachimori’s example. The next definition is important to understand the next example. For further details see [8] and [24]. Definition 4.6. A d-dimensional simplicial complex ∆ is called non evasive if either (i) ∆ is a simplex or (ii) d ≥ 1 and there exists a vertex v of ∆ such that link∆ (v) and del∆ (v) are both non evasive. By [1, Theorem 6.2], every vertex decomposable ball is non evasive. In the next example we present a ∗ does not admits xi -splitting, showing that [25, Theorem 2.8, Corollary 2.11] non evasive ball ∆ such that I∆ does not hold for the Alexander dual ideal of a non evasive simplicial complex. Example 4.7. (Rudin’s ball) Let ∆ be the Rudin’s ball, a non-shellable triangulation of the tetrahedron ∗ has a 10-linear resolution: with 14-vertex introduced in [31]. Since ∆ is a ball, it is Cohen-Macaulay and I∆ ∗ 0 → R(−12)30 → R(−11)70 → R(−10)41 → I∆ . ∗ does not admit i-splitting, for By [1, Theorem 6.3], ∆ is non evasive. It is not difficult to show that I∆ ∗ ∗ ∗ ∗ 1 ≤ xi ≤ 14. Nevertheless I∆ = I∆1 + I∆2 is a Betti splitting of I∆ , where ∆1 and ∆2 are given by the following facets: F(∆1 )={{1,3,7,13},{1,3,9,13},{1,5,7,11},{1,5,9,11},{1,7,11,13},{1,9,11,13},{3,4,7,11}, {3,4,7,12},{3,7,11,14},{3,7,12,13},{3,9,12,13},{4,7,11,12},{4,8,11,12},{5,6,9,13}, {5,6,9,14},{5,7,11,14},{5,9,11,14},{5,9,12,13},{6,9,13,14},{6,10,13,14}, {7,11,12,13},{9,11,13,14},{11,12,13,14}}; F(∆2 )={{2,4,8,14},{2,4,10,14},{2,6,8,12},{2,6,10,12},{2,8,12,14},{2,10,12,14},{3,6,10,11}, {3,6,10,14},{3,10,11,14},{4,5,8,12},{4,5,8,13},{4,8,13,14},{4,10,13,14},{5,8,12,13}, {6,8,11,12},{6,10,11,12},{8,12,13,14},{10,11,12,14}}. ∗ ∗ ∗ ∗ Both I∆ and I∆ are computed in k[x1 , . . . , x14 ]. The minimal graded free resolutions of I∆ , I∆ and 1 2 1 2 ∗ ∩ I∆2 are ∗ 0 → R(−12)13 → R(−11)35 → R(−10)23 → I∆ 1 ∗ I∆ 1 ∗ 0 → R(−12)10 → R(−11)27 → R(−10)18 → I∆ 2 ∗ ∗ 0 → R(−12)7 → R(−11)8 → I∆ ∩ I∆ . 1 2 References [1] B. Benedetti, F. Lutz, Knots in collapsible and non-collapsible balls, Electr. J. Comb. 20, 3, Research Paper P31, 29 (2013). RECURSIVE BETTI NUMBERS FOR COHEN-MACAULAY d-PARTITE CLUTTERS ARISING FROM POSETS 13 [2] M. Caboara, S. Faridi, Odd-cycle-free complexes and the König property, Rock. Mount. J.l of Math., 41, 4 (2011) pp. 1059-1079. [3] CoCoATeam, CoCoA 5: a system for doing Computations in Commutative Algebra, Available at http://cocoa.dima.unige.it. [4] A. Conca, J. Herzog, Castelnuovo-Mumford regularity of products of ideals, Collect. Math. 54, 2 (2003), pp. 137-152. [5] J. A. Eagon, V Reiner, Resolutions of Stanley-Reisner rings and Alexander duality, J.Pure and Applied Algebra 130, 3 (1998), pp. 265-275. [6] S. Eliahou, M. Kervaire, Minimal resolutions of some monomial ideals, J. Algebra 129 (1990), pp. 1-25. [7] V. Ene, J. Herzog, F. Mohammadi, Monomial ideals and toric rings of Hibi type arising from a finite poset, European J. Comb. 2, 3 (2011), pp. 404-421. [8] A. Engström, Discrete Morse functions from Fourier transform, Experimental Mathematics 18 (2009), pp. 45-53. [9] O. Fernandez-Ramos, P. Gimenez, Regularity 3 in edge ideals associated to bipartite graphs, Journal of Algebraic Combinatorics, 39, 4 (2014), pp. 919-937. [10] S. Faridi, The facet ideal of a simplicial complex, Manuscripta Math. 109 (2002), pp. 159-174. [11] C. A. Francisco, H. T. Hà, A. Van Tuyl, Splittings of monomial ideals, Proc. Amer. Math. Soc. 137 (2009), pp. 3271-3282. [12] C. A. Francisco, A. Van Tuyl, Sequentially Cohen-Macaulay edge ideals, Proc. Amer. Math. Soc. 135 (2007), pp. 2327-2337. [13] D. R. Grayson, M. E. Stillman, Macaulay2, a software system for research in algebraic geometry, Available at http://www.math.uiuc.edu/Macaulay2/. [14] M. Kokubo, T. Hibi, Weakly polymatroidal ideals, Alg.Colloq. 13 (2006) pp. 711-720. [15] H. T. Hà, S. Morey, R. H. Villareal, Cohen-Macaulay admissible clutters, J. Comm. Algebra 1, 3 (2009), pp. 463-480. [16] H. T. Hà, A. Van Tuyl, Resolutions of square-free monomial ideals via facet ideals: a survey, Contemporary Mathematics, 448 (2007), pp. 91-117. [17] H. T. Hà, A. Van Tuyl, Monomial ideals, edge ideals of hypergraphs, and their graded Betti numbers, J. Alg. Comb 27, 2 (2008). [18] M. Hachimori, Simplicial Complex Library, http://infoshako.sk.tsukuba.ac.jp/∼hachi/math/library/index eng.html. [19] J. Herzog, T. Hibi, Componentwise linear ideals, Nagoya Math. J 153 (1999), pp. 141-153 . [20] J. Herzog, T. Hibi, Distributive lattices, bipartite graphs and Alexander duality, J. Algebr. Combinatorics, 22 (2005), pp. 289-302. [21] J. Herzog, T. Hibi, Monomials ideals, Graduate Texts in Mathematics, Springer (2011). [22] J. Herzog, Y. Takayama, Resolutions by mapping cones, The Roos Festschrift volume 2, Homology, Homotopy and Applications 4, 2, part 2 (2002) pp. 277-294. [23] A. Soleyman Jahan, X. Zheng, Ideals with linear quotients, J. Comb. Theory, Series A, 117, 1 (2010), pp. 104-110. [24] J. Jonsson, Simplicial Complexes of Graphs, Lecture Notes in Mathematics 1928, Springer-Verlag (2008). [25] S. Moradi, F. Khosh-Ahang, On vertex decomposable simplicial complexes and their Alexander dual, arXiv:1302.5947v4 (to appear in Math.Scand.) (2013). [26] F. Mohammadi, S. Moradi, Weakly polymatroidal ideals ith applications to vertex cover ideals, Osaka J. Math. 47, (2010) pp. 627-636. [27] S. Morey, E. Reyes, R. H. Villareal, Cohen-Macaulay, shellable und unmixed clutters with a perfect matching of König type, J. Pure Appl. Algebra 212 (2008), pp. 1770-1786. [28] S. Morey, R. H. Villarreal, Edge ideals: algebraic and combinatorial properties, Progress in Comm. Alg. Comb. and Homology 1 (2012), pp. 85-126. [29] U. Nagel, T. Römer, Glicci simplicial complexes, Journal of Pure and Applied Algebra 212, 10 (2008), pp. 2250-2258. [30] J. S. Provan, L. J. Billera, Decompositions of simplicial complexes related to diameters of convex polyhedra, Math. Operations Research 5 (1980), pp. 576-594. [31] M. E. Rudin, An unshellable triangulation of a tetrahedron, Bull. Amer. Math. Soc. (1958), pp. 90-91. [32] R. P. Stanley, Balanced Cohen-Macaulay complexes Trans. Amer. Math. Soc. 249 (1979), pp. 139-157. [33] A. Van Tuyl, R. H. Villarreal, Shellable graphs and sequentially Cohen-Macaulay bipartite graphs, J. Comb. Theory, Series A 115, 5 (2008) pp. 799-814. [34] R. H. Villarreal, Cohen-Macaulay graphs, Manuscripta Math. 66 (1990), pp. 277-293. [35] R. Woodroofe, Chordal and sequentially Cohen-Macaulay clutters, Electr. J. Comb. 18, 1 (2011). [36] E. C. Zeeman, On the dunce hat, Topology 2 (1963), pp. 341-358. Davide Bolognini Dipartimento di Matematica Università di Genova Via Dodecaneso 35, 16146 Genova, Italy e-mail: [email protected]
0math.AC
HPX Smart Executors Zahra Khatami Center for Computation and Technology Louisiana State University The STE⋃︀⋃︀AR Group, http://stellar-group.org Baton Rouge, LA, USA [email protected] Lukas Troska Center for Computation and Technology Louisiana State University The STE⋃︀⋃︀AR Group, http://stellar-group.org Baton Rouge, LA, USA [email protected] arXiv:1711.01519v1 [cs.DC] 5 Nov 2017 J. Ramanujam Center for Computation and Technology Louisiana State University The STE⋃︀⋃︀AR Group, http://stellar-group.org Baton Rouge, LA, USA [email protected] Hartmut Kaiser Center for Computation and Technology Louisiana State University The STE⋃︀⋃︀AR Group, http://stellar-group.org Baton Rouge, LA, USA [email protected] Adrian Serio Center for Computation and Technology Louisiana State University The STE⋃︀⋃︀AR Group, http://stellar-group.org Baton Rouge, LA, USA [email protected] ABSTRACT 1 The performance of many parallel applications depends on looplevel parallelism. However, manually parallelizing all loops may result in degrading parallel performance, as some of them cannot scale desirably to a large number of threads. In addition, the overheads of manually tuning loop parameters might prevent an application from reaching its maximum parallel performance. We illustrate how machine learning techniques can be applied to address these challenges. In this research, we develop a framework that is able to automatically capture the static and dynamic information of a loop. Moreover, we advocate a novel method by introducing HPX smart executors for determining the execution policy, chunk size, and prefetching distance of an HPX loop to achieve higher possible performance by feeding static information captured during compilation and runtime-based dynamic information to our learning model. Our evaluated execution results show that using these smart executors can speed up the HPX execution process by around 12% − 35% for the Matrix Multiplication, Stream and 2D Stencil benchmarks compared to setting their HPX loop’s execution policy/parameters manually or using HPX auto-parallelization techniques. Runtime information is often speculative. While runtime adaptive methods have been shown to be very effective – especially for highly dynamic scenarios – solely relying on them doesn’t guarantee maximal parallel performance, since the performance of an application depends on both the values measured at runtime and the related transformations performed at compile time. Collecting the outcome of the static analysis performed by the compiler could significantly improve runtime decisions and therefore application performance [1–4]. There are many existing publications on automatically choosing optimization parameters based on static information extracted at compile time. For example in [5, 6] optimal scheduling for parallel loops is implemented dynamically at runtime by examining data dependencies captured at compile time. However, one of the challenges in these studies is the need to repeat their proposed methods for each new program, which in general is not desirable, as it requires extra execution time for each application for such parameters determination. Moreover, manually tuning parameters becomes ineffective and almost impossible when the parallel performance depends on too many parameters as defined by to the program. Hence, many researches have extensively studied machine learning algorithms which optimize such parameters automatically. For example in [7], a neural network and decision tree are applied on the training data collected from different observations to predict the branch behavior in a new program. In [1] nearest neighbors and support vector machines are used for predicting unroll factors for different nested loops based on the extracted static features. In [8, 9], the logistic regression model is used to derive a learning model, which results in a significant speedup in compilation time of their studied benchmarks. Most of these optimization techniques require users to compile their application twice, first compilation for extracting static information and the second one for recompiling application based on those extracted data. None of these considers both static and dynamic information. The goal of this paper is to optimize an HPX application’s performance by predicting optimum parameters for its parallel algorithms by considering both static and dynamic information and to avoid unnecessary compilation. As all of the HPX parallel algorithms perform based on the dynamic analysis provided at runtime, this KEYWORDS HPX, Logistic Regression Model, ClangTool. ACM Reference format: Zahra Khatami, Lukas Troska, Hartmut Kaiser, J. Ramanujam, and Adrian Serio. 2017. HPX Smart Executors. In Proceedings of ESPM2’17: Third International Workshop on Extreme Scale Programming Models and Middleware, Denver, CO, USA, November 12–17, 2017 (ESPM2’17), 8 pages. https://doi.org/https://doi.org/10.1145/3152041.3152084 Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. ESPM2’17, November 12–17, 2017, Denver, CO, USA © 2017 Association for Computing Machinery. ACM ISBN 978-1-4503-5133-1/17/11. . . $$15.00 https://doi.org/https://doi.org/10.1145/3152041.3152084 INTRODUCTION ESPM2’17, November 12–17, 2017, Denver, CO, USA technique is unable to achieve the maximum possible parallel efficiency in some cases: Z. Khatami et al. performance by around 12% − 35% for the Matrix Multiplication, Stream and 2D Stencil benchmarks compared to setting their HPX loop’s execution policy/parameters manually or using HPX autoparallelization techniques. The remainder of this paper is structured as follows: the machine learning algorithms that are used to study the learning models are discussed in section 2; the proposed model is discussed is more details in section 3, and section 4 provides the experimental results of this proposed technique. Conclusion and future works are explained in section 5. ● In [10, 11] different policies for executing HPX parallel algorithms are studied. However these policies should be manually selected for each algorithm within an application, which may not be an optimum approach, as a user should execute each parallel algorithm of his application with different execution policies to find the efficient one for that algorithm. ● Determining chunk size is another challenge in the existing version of the HPX algorithms. Chunk size is the amount of work performed by each task [12, 13] that is determined 2 LEARNING ALGORITHM by an auto_partitioner exposed by the HPX algorithms or is In this research we use the binary and multinomial logistic regrespassed by using static/dynamic_chunk_size as an execution sion models [16] to select the optimum execution policy, chunk size, policy’s parameter [10]. However, and prefetching distance for certain HPX loops based on both, static (1) the experimental results in [4] and [3] showed that the overheads of determining chunk size by using the auto_partitionerand dynamic information, with the goal of minimizing execution time. Logistic regression model has been used in several previous negatively effected the application’s scalability in some works [8, 17], and it is shown to be able to predict such parameters cases; accurately. We will show later that the performance of these learn(2) the policy written by the user will often not be able to ing models has high accuracy for about 98% and 95% for the binary determine the optimum chunk size either due to the limit and multinomial logistic regression models respectively on the studof runtime information. ied problems. Also, compared to the other learning models such as ● In [14], we proposed the HPX prefetching method which artificial neural networks (ANNs), the implemented logistic regresaids prefetching that not only reduces the memory accesses sion model has lower computational complexity. Moreover, since latency, but also relaxes the global barrier. Although it rethe chunk size values can be seen as a categorical variables, this sults in better parallel performance for the HPX algorithms, makes the logistic regression models well-suited for our problem. however, a distance between each two prefetching operaHere, the static information about the loop body (such as the tions should also be manually chosen by a user for each new number of operations, see Table 1) collected by the compiler and program. the dynamic information (such as the number of cores used to Automating these mentioned parameters selections by considexecute the loop) as provided by the runtime system is used to ering loops characteristics implemented in a learning model can feed a logistic regression model enabling a runtime decision to oboptimize the HPX parallel applications performances. To the best of tain highest possible performance of the loop under consideration. our knowledge, we present the first attempt to implement a learning The presented method relies on a compiler-based source-to-source model for predicting optimum loop parameters at runtime, wherein transformation. The compiler transforms certain loops which were the learning model captures features both from static compile time annotated by the user by providing special executors – discussed information and from runtime introspection. later in section 3.1 – into code controlling runtime behavior. This In this research, we introduce a new ClangTool ForEachCallHantransformed code instructs the runtime system to apply a logistic dler using LibTooling [15] as a custom compiler pass to be executed regression model and to select either an appropriate code path (e.g. by the Clang compiler, which is intended to collect the static feaparallel or sequential loop execution) or certain parameters for the tures at compile time. The logistic regression model is implemented loop execution itself (e.g. chunk size or prefetching distance). We in this paper as a learning model that considers these captured briefly discuss these learning models in the following sections. features for predicting efficient parameters for an HPX loop. For implementing this learning model on a loop, we propose new HPX 2.1 Binary Logistic Regression Model smart executors that – when used on a parallel loop – instructs the In order to select the optimum execution policy (sequential or compiler to apply this ForEachCallHandler tool on that loop. As parallel) for a loop, the binary logistic regression model is ima results, the loop’s features will automatically be included in the plemented to analyze the static information extracted from the prediction process implemented with that learning model. One of loop by the compiler and the dynamic information as provided by the advantages of this approach in utilizing HPX policies is that in the runtime. In this model, the weights parameters having k feapractice it enables us to change the algorithms internal structure at tures W T = (︀ω 1 , ω 2 , ..., ωk ⌋︀ are determined by considering features runtime and therefore we do not have to compile the code again values x r (i) of each experiment X i = (︀1, x 1 (i), ..., x k (i)⌋︀T which after the code transformation step. minimize the log-likelihood of the Bernoulli distribution value as This technique is able to use high-level programming abstracfollow: tions and machine learning to relieve the programmer of difficult T and tedious decisions that can significantly affect program behavµ i = 1⇑(1 + e −W X i ). (1) ior and performance. Our results show that combining machine The values of ω are updated in each step t as follows: learning, compiler optimizations and runtime adaptation helps us to maximally utilize available resources. This improves application ωt +1 = (X T S t X )−1X T (S t Xωt + y − µ t ) (2) HPX Smart Executors ESPM2’17, November 12–17, 2017, Denver, CO, USA , where S is a diagonal matrix with S(i, i) = µ i (1 − µ i ). The output is determined by considering the following decision rule: y(x) = 1 ←→ p(y = 1⋃︀x ) > 0.5 2.2 (3) Multinomial Logistic Regression Model In order to predict the optimum values for the chunk size and the prefetching distance, the multinomial logistic regression model is implemented to analyze the static information extracted from the loop by the compiler and the dynamic information as provided by the runtime. If we have N experiments that are classified in C classes and each has K features, the posterior probabilities are computed by using a softmax transformation of the features variables linear functions for an experiment n with a class c as follow: ync = yc (X n ) = exp(WcT X n ) T ∑C i=1 exp(Wi X n ) (4) The cross entropy error function is defined as follows: N C E(ω1 , ω 2 , ..., ωC ) = − ∑ ∑ tnc lnync n=1 c=1 (5) , where T is a N × C matrix of target variables with tnc elements. The gradient of E is computed as follows: N ∇ωc E(ω1 , ω 2 , ..., ωC ) = ∑ (ync − tnc )X n n=1 (6) In this method, we use the Newton-Raphson method [18] to update the weights values in each step: ωnew = ωold − H −1 ∇E(ω) (7) where H is the Hessian matrix defined as follows: N ∇ωi ∇ω j E(ω 1 , ω 2 , ..., ωC ) = ∑ yni (Ii j − ynj )X n X nT n=1 (8) More details can be found in [19]. 3 PROPOSED MODEL In this section, we propose a new technique for applying the learning models discussed in section 2 to HPX loops. The goal of this technique is to combine machine learning methods, compiler transformations, and runtime introspection in order to maximize the use of available resources and to minimize execution time of the loops. Its design and implementation has several steps categorized as follow∗ : (1) (2) (3) (4) ∗ New HPX Smart Executors Features Extraction Design of Learning Model Learning Model Implementation This technique with its installation instructions are publicly available at https://github. com/STEllAR-GROUP/hpxML. Feel free to join our IRC channel #st e⋃︀⋃︀ar if you need any help. f o r _ e a c h ( p a r _ i f , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; f o r _ e a c h ( p o l i c y . with ( a d a p t i v e _ c h u n k _ s i z e ( ) ) , range . begin ( ) , range . end ( ) , lambda ) ; for_each ( make_prefetcher_policy ( policy , prefetching_distance_factor , container_1 , . . . , container_n ) , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; Figure 1: Loops using the proposed smart executors, which are recognized and instrumented by the compiler to allow HPX to consider the weights produced by the learning models when executing the loops. static/dynamic Information dynamic number of threads∗ dynamic number of iterations∗ static number of total operations per iteration∗ static number of float operations per iteration∗ static number of comparison operations per iteration∗ static deepest loop level∗ static number of integer variables static number of float variables static number of if statements static number of if statements within inner loops static number of function calls static number of function calls within inner loops Table 1: Collected static and dynamic features. First 6 features marked with red* have been selected for our model using the decision tree classification technique [20, 21] to avoid overfitting the model. 3.1 New HPX Smart Executors We introduce two new HPX execution policies and one new HPX execution policy parameter, which we refer to them as the smart executors in this paper, since they enable the weights gathered by the learning model to be applied on the loop. par_if and make_prefetcher_policy as the smart policies instrument executors to be able to consume the weights produced by a binary logistic regression model, which is used to select the execution policy corresponding to the optimal code path to execute (sequential or parallel), and a multinomial logistic regression model, which is used to determine an efficient prefetching distance. adaptive_chunk_size as the smart execution policy parameter uses a multinomial logistic regression model to determine an efficient chunk size. Fig.1 shows three loops defined with these smart execution policies and parameter that apply a lambda function over a range. We have created a new special compiler pass for clang which recognizes these annotated loops and transform them into equivalent code which instructs the runtime to apply the described regression models. 3.2 Features Extraction Initially, we selected 10 static features to be collected at compile time and 2 dynamic features to be determined at runtime to be evaluated by our learning model. These features are listed in Table 1. Although it may not be the best possible set, it is very similar ESPM2’17, November 12–17, 2017, Denver, CO, USA Z. Khatami et al. class ForEachCallHandler : public RecursiveASTVisitor < ForEachCallHandler > { . . . / / V i s i t every c a l l expression bool V i s i t C a l l E x p r ( const CallExpr ∗ c a l l ) { . . . / / c h e c k i f a c a l l i s an HPX a l g o r i t h m i f ( f u n c _ s t r i n g . f i n d ( " hpx : : p a r a l l e l " ) ! = s t r i n g : : npos ) { f o r _ e a c h ( p a r _ i f , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; (a) Before compilation i f ( seq_par ( { f0 , . . fn } ) ) / / e x t r a c t e d s t a t i c i n f o r m a t i o n f o r _ e a c h ( seq , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; else f o r _ e a c h ( par , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; / / C a p t u r i n g lambda f u n c t i o n from a l o o p c o n s t CXXMethodDecl ∗ l a m b d a _ c a l l o p = l a m b d a _ r e c o r d −> g e t L a m b d a C a l l O p e r a t o r ( ) ; Stmt ∗ lambda_body = l a m b d a _ c a l l o p −>g e t B o d y ( ) ; / / Capturing policy S o u r c e R a n g e p o l i c y ( c a l l −>g e t A r g ( 0 ) −> g e t E x p r L o c ( ) , c a l l −>g e t A r g ( 1 ) −> g e t E x p r L o c ( ) . g e t L o c W i t h O f f s e t ( − 2) ) ; / / E x t r a c t i n g s t a t i c / dynamic f e a t u r e s a n a l y z e _ s t a t e m e n t ( lambda_body ) ; / / Determining p o l i c y i f ( p o l i c y _ s t r i n g . f i n d ( " p a r _ i f " ) ! = s t r i n g : : npos ) p o l i c y _ d e t e r m i n a t i o n ( c a l l , SM ) ; / / D e t e r m i n i n g chunk s i z e i f ( p o l i c y _ s t r i n g . f i n d ( " a d a p t i v e _ c h u n k _ s i z e " ) ! = s t r i n g : : npos ) c h u n k _ s i z e _ d e t e r m i n a t i o n ( c a l l , SM ) ; }}} / / Determining p r e f e t c h i n g d i s t a n c e i f ( p o l i c y _ s t r i n g . find ( " make_prefetcher_policy " ) != s t r i n g : : npos ) p r e f e t c h i n g _ d i s t a n c e _ d e t e r m i n a t i o n ( c a l l , SM ) ; ... Figure 2: The proposed ClangTool ForEachCallHandler to collecting static/dynamic information of each loop and implement a learning model based on the current smart executors. to those considered in the other works [1, 2, 8], which in their results indicated that the set is sufficient to design a learning model for this type of problem. To avoid overfitting the model, we chose 6 critical features marked with red∗ color in Table 1 to include in the actual decision tree classification technique[20, 21], which reduces the initial features set in a tree building process based on information gain value. This value is used to decide which feature to be selected for splitting data at each step in a tree building process. More information about this technique can be found in [22, 23]. In order to collect static information at compile time, we introduce a new ClangTool named ForEachCallHandler in the Clang compiler as shown in Fig.2. This tool locates in the user source code instances of loops which use the proposed smart executors. Once identified, the loop body is then extracted from the lambda function by applying getBody() on a lambda operator getLambdaCallOperator(). The value of each of the listed static features is then recorded by passing lambda to analyze_statement. In order to capture dynamic features at runtime, the compiler inserts hooks (HPX API function calls) which are invoked by the runtime. In this instance the compiler will insert the call hpx::get_os_thread_count() and std::distance(range.begin(), range.end()) which will return the number of OS threads as well as the number of iterations that the loop will run over, respectively. 3.3 Designing the Learning Model To design an efficient learning model that could be able to cover various cases, we collected over 300 training data sets by analyzing Matrix multiplication application with different problem sizes that implements par_if, adaptive_chunk_size or make_prefetcher_policy (b) After compilation Figure 3: The proposed function seq_par for a implementing binary logistic regression model at runtime. on its loops. The experimental results evaluated in Section 4 show that these training data∗ are enough to predict the HPX loop’s parameters accurately for the studied applications: Matrix multiplication, Stream and 2D Stencil benchmarks. The regression models are designed based on these collected data, in which the values of ω from eq.2 and eq.7 are determined whenever the sum of square errors reaches its minimum value. Then they are stored in an output file named as weights.dat that will be used for predicting the optimal execution policy, chunk size, and prefetching distance at runtime. This learning step can be done offline, which also doesn’t add any overhead at compile time nor does at runtime. It should be noted that the multinomial logistic regression model must be initialized with the allowed boundaries for the chunk size and prefetching distance in order to choose an efficient value. In this study we selected 0.1%, 1%, 10%, or 50% of the iterations of a loop as chunk size candidates and 1, 5, 10, 100 and 500 cache lines as prefetching distance candidates. These candidates are validated with different tests and based on their results, they are selected. In order to derive the fidelity of the model, we train the algorithm using 80% of the test cases and use the remaining 20% as a trials to see how accurate the predictions are. Our results show that the binary logistic regression model is accurate in 98% of the trials and the multinomial logistic regression model is accurate in 95% of them. 3.4 Learning Model Implementation 3.4.1 Binary Logistic Regression Model (Execution Policy). We propose a new function seq_par that passes the extracted features for a loop that uses par_if as its execution policy. In this technique, a Clang compiler automatically adds extra lines within a user’s code as shown in Fig.3 that allows the runtime system to decide whether execute a loop sequentially or in parallel based on the return value of seq_par from Eq.3. If the output is f alse the loop will execute sequentially and if the output is true the loop will execute in parallel. 3.4.2 Multinomial Logistic Regression Model (Chunk Size). We propose a new function chunk_size_determination that passes the extracted features for a loop that uses adaptive_chunk_size as its execution policy’s parameter. In this technique, a Clang compiler changes a user’s code automatically as shown in Fig.4 that makes runtime system to choose an optimum chunk size based on the ∗ The characteristics of the loops of these training data are available at https://github.com/STEllAR-GROUP/hpxML/blob/master/logisticRegressionModel/ algorithms/inputs. HPX Smart Executors ESPM2’17, November 12–17, 2017, Denver, CO, USA f o r _ e a c h ( p o l i c y . with ( a d a p t i v e _ c h u n k _ s i z e ( ) ) , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; (a) Before compilation f o r _ e a c h ( p o l i c y . with ( c h u n k _ s i z e _ d e t e r m i n a t i o n ( { f0 , . . . fn } ) ) ) , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; (b) After compilation Figure 4: The proposed function chunk_size_determination for implementing a multinomial logistic regression model at runtime. 4 4.1 for_each ( make_prefetcher_policy ( policy , prefetching_distance_factor , container_1 , . . . , container_n ) , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; (a) Before compilation for_each ( make_prefetcher_policy ( policy , p r e f e t c h i n g _ d i s t a n c e _ d e t e r m i n a t i o n ( { f0 , . . . fn } ) , container_1 , . . . , container_n ) , r a n g e . b e g i n ( ) , r a n g e . end ( ) , lambda ) ; EXPERIMENTAL RESULTS In this section, we evaluate the performance of our proposed technique using Clang 4.0.0 and HPX V 0.9.99 on the test machine with two Intel Xeon E5-2630 processors, each with 8 cores clocked at 2.4GHZ and 65GB of main memory. The main goal here is to illustrate that dynamic information obtained at runtime and static information obtained at compile time are both necessary to provide sufficient parallel performance and the proposed techniques are able to predict the optimum parameters for HPX loops based on these information∗ . Artificial Test Cases In this section, we evaluate the performance of the proposed techniques from Section 3 over 5 different artificial test cases shown in Table 2, in which each of them includes 4 loops with different characteristics. Each of these loops of each test cases is a Matrix multiplication computation with different problem sizes included in this table. The main purpose of these evaluations is to show the effectiveness of each proposed method on an HPX parallel performance. 4.1.1 par_if. Parallelizing all loops within an application may not result in a best possible parallelization, as some of the loops canFigure 5: The proposed function prefetchnot scale desirably on more number of threads. For evaluating the ing_distance_determination for implementing a multinomial effectiveness of the proposed seq_par function exposed by a smart logistic regression model at runtime. executor par_if discussed in section 3, we study its implementation on the described 5 test cases. These test cases are selected to show that in case of having several loops within a parallel application, some of these loops should be executed in sequential to achieve output of chunk_size_determination from Eq.4 that is based on the a better parallel performance. Each of these test cases is executed chunk size candidate’s probability and it is computed using the valthree times by setting execution policies of the outer loops to be seq, ues of the studied loop’s features and the learning model’s weights. par, or par_if in each time. The static and dynamic characteristics 3.4.3 Multinomial Logistic Regression Model (Prefetching Disof each loop in each test are listed in Table 2. The execution policies tance). We propose a new function prefetching_distance_determination determined by using par_if policy for each loop are also included that passes the extracted features for a loop that uses make_prefetcher_policyin the column Policy of this Table. as its execution policy. In this technique, a Clang compiler changes Fig.6 shows the execution time for each test case and it illustrates a user’s code automatically as shown in Fig.5 that makes runtime that in most of them using par_if will outperform the basic policy system to choose an optimum prefetching distance based on the par. The main reason of this improvement is that by considering output of prefetching_distance_determination. This function also the determined execution policy included in Table 2, as the execomputes the outputs by implementing Eq.4 using the values of the cution policy seq is determined for some of the loops that cannot studied loop’s features and the learning model’s weights. scale desirably on more number of threads, this technique results As we can see, these proposed techniques consider both, the in outperforming manually parallelized code by around 15% − 20% static and the dynamic information for determining an efficient for these test cases expect the first one. In this test case, however, execution policy, chunk size, and prefetching distance for a loop. the total execution time of the loops took slightly longer when inIn addition, this decision process is performed at runtime by comvoked with par_if. This is due to the overhead generated during the puting outputs of seq_par, chunk_size_determination and prefetchinvocation of the binary logistic regression model’s cost function, ing_distance_determination, which avoids an extra compilation step. manually setting their execution policy as par resulted in having a In other words, static information is collected during compilation better performance. and the decisions aiming at optimum parameters are made at run4.1.2 adaptive_chunk_size. As discussed in Section 3, the protime while taking into account additional runtime information. One posed chunk_size_determination function exposed by a smart execuof the other advantages of this method are that other parameters and tor adaptive_chunk_size enables the runtime system to choose an executors attached to the current executors can be also reattached efficient chunk size for a loop by considering static and dynamic feato the generated execution policy. Moreover, all of these smart extures of that loop. As mentioned in section 3.3, this method selects ecutors can be used together by simply defining a loop policy to between chunk sizes of 0.1%, 1%, 10%, or 50% of the iterations of a be “make_prefetcher_policy(par_if, ...).with(adaptive_chunk_size())". (b) After compilation The experimental results of our proposed learning techniques discussed are presented in the next section. ∗ Applications evaluated in this Section are publicly available at https://github.com/ STEllAR-GROUP/hpxML/tree/master/examples. ESPM2’17, November 12–17, 2017, Denver, CO, USA Test 1 2 3 4 5 Loop l1 l2 l3 l4 l1 l2 l3 l4 l1 l2 l3 l4 l1 l2 l3 l4 l1 l2 l3 l4 Iterations 10000 20000 20000 500 150000 100 100 50000 500 400 2000 2500 20000 30000 300 400 200 700 300 100 Total opr. 400100 450026 502040 550402 350106 10050016 25000000 4000450 4504030 3502020 250033 350400 204002 400000 550000 450000 4502001 400020 302020 50400 Float opr. 200000 250000 250000 200000 101010 5000000 3010204 200000 250000 200000 150000 150000 100000 150102 44000 50400 150000 300000 20000 20000 Z. Khatami et al. Comparison opr. 101010 150503 103051 150102 500 2505013 1500204 100150 150300 100405 103040 100600 10320 10000 20030 10602 101004 150006 14005 10110 Loop level 2 2 2 1 2 3 3 1 2 1 3 3 2 2 3 3 3 3 2 2 Policy (Threads) par (8) par (8) par (8) par (8) par (8) seq seq par (8) par (8) par (8) seq seq par (8) par (8) seq seq par (8) par (8) par (8) seq Chunk size% 0.1 0.1 0.1 10 0.1 10 10 1 1 1 10 10 0.1 0.1 10 10 1 1 1 10 Pref. dist. 5 5 1 5 10 1 1 5 10 10 5 5 1 1 5 10 1 5 5 10 Table 2: Execution policy, chunk size and prefetching distance determined by the proposed techniques based on the static/dynamic information extracted from each loop and the weights provided by the learning models. Figure 6: The execution time comparisons between setting execution policy of the loops to be seq, par, or par_if. loop by comparing their probabilities in the multinomial logistic regression model’s cost function. Fig.7 shows the execution time for each test case in Table 2 by setting optimal chunk size of each loop. The chunk size determined by the algorithm for each loop are also included in the column Chunk size% of the Table 2. The overall performance of these cases show by an average of about 31%, 15%, 17% and 38% improvement over setting chunks to be 0.1%, 1%, 10%, or 50% of the iterations of a loop. The main reason of this improvement is that efficient chunk size helps in having even amount of work on each number of threads that results in reducing total overheads and latencies. These results also illustrate the importance of the chunk size’s effect Figure 7: The execution time comparisons between setting chunk size of the loops to be 0.1%, 1%, 10%, or 50% of the iterations of a loop and the chunk size determined by using adaptive_chunk_size. on an application’s scalability and the capability of this method in improving parallel performance of an application by choosing efficient chunk size for each loop. 4.1.3 make_prefetcher_policy. As discussed in Section 3, the proposed perfecting_distance_determination function exposed by a smart executor make_prefetcher_policy allows the runtime system to choose an efficient prefetching distance for a loop by considering static and dynamic features of that loop. As it mentioned in Section 3.3, this method chooses between prefetching distances of 1, 5, 10, 100 and 500 cache lines by comparing their probabilities in the multinomial logistic regression model’s cost function. HPX Smart Executors ESPM2’17, November 12–17, 2017, Denver, CO, USA Figure 8: The execution time comparisons between setting the prefetching distance of the loops to be 1, 5, 10, 100, or 500 cache lines and the determined prefetching distance using make_prefetcher_policy. Test Stream Stencil Iterations 50000000 45 Total opr. 8 3502 Float opr. 8 2500 Comp. opr. 0 301 Figure 10: HPX Stream benchmark’s strong scaling with/without using the proposed smart executors. level 0 1 Table 3: Dynamic/static features for each benchmark. f o r _ e a c h ( p o l i c y , a _ b e g i n , a_end , [ & ] ( s t d : : s i z e _ t i ) { c [ i ] = a [ i ] ; / / copy s t e p b[ i ] = k ∗ c [ i ] ; // scale step c [ i ] = a [ i ] + b [ i ] ; / / adding step a [ i ] = b[ i ] + k ∗ c [ i ] ; // triad step }) ; Figure 9: Stream Benchmark. Fig.8 shows the execution time for each prefetching size in each test case in Table 2. The prefetching distance determined by the algorithm for each loop are also included in the last column of the Table 2. The overall performance of these cases show by an average of about 25%, 19%, 14%, 33%, 24%, and 47% improvement over setting prefetching distances to be 1, 5, 10, 100, or 500 cache lines. The main reason of this improvement is that using efficient prefetching distance resulted in better cache usage that reduced the total overheads. 4.2 Real Benchmarks In the previous section, we demonstrated the effectiveness of each proposed on an HPX parallel performance on 5 different test cases in which each of them includes 4 different loops for a matrix multiplication computation. In this section, we apply all of the proposed methods together on two different benchmarks: the Stream and 2D Stencil benchmarks. The previous training data is also used in the proposed techniques applied on these applications. 4.2.1 Stream Benchmark. This benchmark [24, 25] has been widely used for evaluating memory bandwidth of a system. In [10], the HPX executors performance were evaluated on this benchmark with 50 million data points over 10 iterations. The other characteristic information of this loop is included in Table 3. As shown in Fig.9, Figure 11: Heat Distribution Benchmark, 2D Stencil. this application includes 4 operations over 3 equally sizes arrays (A, B and C) that are: copy (C = A), scale (B = k ×C), adding (C = A + B) and triad (A = B + K × C). All three proposed smart executors are applied on this loop to make HPX to choose an execution policy, chunk size and prefetching distance efficiently. The speedup comparison results of the data transform measurements with/without using proposed techniques are illustrated in Fig.10. As we can see, using the proposed smart executors together on this benchmark improves HPX performance by an average of about 13% compared to using HPX auto-parallelization techniques without considering static/dynamic information and implementing machine learning technique. 4.2.2 Stencil Benchmark. The performance of different HPX scheduling policies on a 2D Stencil benchmark is studied in [11]. This application is a two dimensional heat distribution shown in Fig.11, in which the temperature of each point is computed based on the temperature of its neighbors. The characteristic information of this loop is included in Table 3. The speedup comparison results of HPX performance with/without using the proposed smart executors are illustrated in Fig.12. It shows HPX performance improvement by an average of about 22% by using the proposed techniques together on this loop compared to using HPX auto-parallelization techniques without considering static/dynamic information and implementing machine learning technique. 5 CONCLUSION AND FUTURE WORKS The main goal of this paper is to illustrate a powerful new set of techniques that can be made available to application developers when compilers, runtime systems, and machine learning algorithms ESPM2’17, November 12–17, 2017, Denver, CO, USA Z. Khatami et al. REFERENCES Figure 12: HPX 2D Stencil benchmark’s strong scaling with/without using the proposed smart executors. work in concert. These techniques developed here not only greatly improve performance, but users are able to reap their benefit with little cost to themselves. Simply by annotating their code with high level executors, users can see their application’s performance increase in a portable way. These results could have broad impact for applications and libraries as well as the maintainers and scientist that use them. The high level annotations increase the usability and therefore accessibility of runtime features that before would have taken a knowledgeable developer to implement. Due to the machine learning element, users will not have to worry about losing performance in different runtime environments that could manifest themselves. Finally, the inclusion of compiler information will allow these performance optimizations to be platform independent. These three features taken together present a notable solution to the challenges presented by an increasingly multi-core and heterogeneous world. As powerful as these techniques may be, more work is needed to be done in order to fully realize the potential of this work. Notably, the breadth of performance characteristics needs to be more carefully studied to understand the core features that relate to performance. Additionally more research is needed to ensure that the characteristics measured here also are relevant for other architectures such as the new Knights Landing chipset. On a shorter time scale we intend to investigate extending the number of features for improving the resulting loop’s parameters prediction. In this paper, we have illustrated that the parallel performance of our test cases were improved by using a machine learning algorithm to determine either an appropriate code path (parallel or sequential loop execution) or certain parameters for the loop execution itself (chunk size or prefetching distance). The speedup results of these test cases and benchmarks showed by around 12% − 35% improvement compared to selecting execution policy, chunk size and prefetching distance of a loop without using static/dynamic information and machine learning technique. These results proved that combining machine learning techniques, compiler information, and runtime methods helps an application maximize the available resources∗ . ∗ This works was supported by NSF awards 1447831 and 1339782. [1] Mark Stephenson and Saman Amarasinghe. Predicting unroll factors using supervised classification. In Code Generation and Optimization, 2005. CGO 2005. International Symposium on, pages 123–134. IEEE, 2005. [2] Keith D Cooper, Devika Subramanian, and Linda Torczon. Adaptive optimizing compilers for the 21st century. The Journal of Supercomputing, 23(1):7–22, 2001. [3] Zahra Khatami, Hartmut Kaiser, Patricia Grubel, Adrian Serio, and J Ramanujam. A massively parallel distributed n-body application implemented with hpx. In Proceedings of the 7th Workshop on Latest Advances in Scalable Algorithms for Large-Scale Systems, pages 57–64. IEEE Press, 2016. [4] Zahra Khatami, Hartmut Kaiser, and J Ramanujam. Using hpx and op2 for improving parallel scaling performance of unstructured grid applications. In Parallel Processing Workshops (ICPPW), 2016 45th International Conference on, pages 190–199. IEEE, 2016. [5] Lawrence Rauchwerger, Nancy M Amato, and David A Padua. A scalable method for run-time loop parallelization. International Journal of Parallel Programming, 23(6):537–576, 1995. [6] Lawrence Rauchwerger, Nancy M Amato, and David A Padua. Run-time methods for parallelizing partially parallel loops. In Proceedings of the 9th international conference on Supercomputing, pages 137–146. ACM, 1995. [7] Brad Calder, Dirk Grunwald, Michael Jones, Donald Lindsay, James Martin, Michael Mozer, and Benjamin Zorn. Evidence-based static branch prediction using machine learning. ACM Transactions on Programming Languages and Systems (TOPLAS), 19(1):188–222, 1997. [8] Gennady Pekhimenko and Angela Demke Brown. Efficient program compilation through machine learning techniques. In Software Automatic Tuning, pages 335–351. Springer, 2011. [9] John Cavazos and Michael FP O’boyle. Method-specific dynamic compilation using logistic regression. ACM SIGPLAN Notices, 41(10):229–240, 2006. [10] Hartmut Kaiser, Thomas Heller, Daniel Bourgeois, and Dietmar Fey. Higher-level parallelization for local and distributed asynchronous task-based programming. In Proceedings of the First International Workshop on Extreme Scale Programming Models and Middleware, pages 29–37. ACM, 2015. [11] Rekha Raj. Performance analysis with hpx. Master’s thesis, Louisiana State University, 2014. [12] Henry C Baker Jr and Carl Hewitt. The incremental garbage collection of processes. In ACM Sigplan Notices, volume 12, pages 55–59. ACM, 1977. [13] Hartmut Kaiser, Thomas Heller, Bryce Adelstein-Lelbach, Adrian Serio, and Dietmar Fey. Hpx: A task based programming model in a global address space. In Proceedings of the 8th International Conference on Partitioned Global Address Space Programming Models, page 6. ACM, 2014. [14] Zahra Khatami, Hartmut Kaiser, and J Ramanujam. Redesigning op2 compiler to use hpx runtime asynchronous techniques. In Parallel and Distributed Scientific and Engineering Computing (IPDPSW), 2017 18th IEEE International Workshop on. IEEE, 2017. [15] The Clang Team. Clang 5 documentation, LibTooling. https://clang.llvm.org/ docs/LibTooling.html, 2017. [Online; accessed 1-Feb-2017]. [16] C Bishop. Pattern recognition and machine learning (information science and statistics), 1st edn. 2006. corr. 2nd printing edn. Springer, New York, 2007. [17] Method-specific dynamic compilation using logistic regression. [18] Tjalling J Ypma. Historical development of the newton–raphson method. SIAM review, 37(4):531–551, 1995. [19] Ian Nabney. NETLAB: algorithms for pattern recognition. Springer Science & Business Media, 2002. [20] Chotirat Ann Ratanamahatana and Dimitrios Gunopulos. Scaling up the naive bayesian classifier: Using decision trees for feature selection. 2002. [21] Wei-Yin Loh. Classification and regression trees. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 1(1):14–23, 2011. [22] Lior Rokach and Oded Maimon. Data mining with decision trees: theory and applications. World scientific, 2014. [23] Wei-Yin Loh. Classification and regression trees. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 1(1):14–23, 2011. [24] JD McCalpin. Stream: Sustainable memory bandwidth in high performance computers (2008), 1991-2007. [25] JD McCalpin. Memory bandwidth and machine balance in current high performance computers. In Committee on Computer Architecture (TCCA) Newsletter, pages 19–25. IEEE, 1995.
2cs.AI
Deep Learning using Rectified Linear Units (ReLU) Abien Fred M. Agarap Department of Computer Science Adamson University Manila, Philippines [email protected] arXiv:1803.08375v1 [cs.NE] 22 Mar 2018 ABSTRACT We introduce the use of rectified linear units (ReLU) as the classification function in a deep neural network (DNN). Conventionally, ReLU is used as an activation function in DNNs, with Softmax function as their classification function. However, there have been several studies on using a classification function other than Softmax, and this study is an addition to those. We accomplish this by taking the activation of the penultimate layer hn−1 in a neural network, then multiply it by weight parameters θ to get the raw scores oi . Afterwards, we threshold the raw scores oi by 0, i.e. f (o) = max(0, oi ), where f (o) is the ReLU function. We provide class predictions ŷ through arg max function, i.e. arg max f (x). CCS CONCEPTS • Computing methodologies → Supervised learning by classification; Neural networks; KEYWORDS artificial intelligence; artificial neural networks; classification; convolutional neural network; deep learning; deep neural networks; feed-forward neural network; machine learning; rectified linear units; softmax; supervised learning 1 INTRODUCTION A number of studies that use deep learning approaches have claimed state-of-the-art performances in a considerable number of tasks such as image classification[9], natural language processing[15], speech recognition[5], and text classification[18]. These deep learning models employ the conventional softmax function as the classification layer. However, there have been several studies[2, 3, 12] on using a classification function other than Softmax, and this study is yet another addition to those. In this paper, we introduce the use of rectified linear units (ReLU) at the classification layer of a deep learning model. This approach is the novelty presented in this study, i.e. ReLU is conventionally used as an activation function for the hidden layers in a deep neural network. We accomplish this by taking the activation of the penultimate layer in a neural network, then use it to learn the weight parameters of the ReLU classification layer through backpropagation. We demonstrate and compare the predictive performance of DL-ReLU models with DL-Softmax models on MNIST[10], FashionMNIST[17], and Wisconsin Diagnostic Breast Cancer (WDBC)[16] classification. We use the Adam[8] optimization algorithm for learning the network weight parameters. 2 METHODOLOGY 2.1 Machine Intelligence Library Keras[4] with Google TensorFlow[1] backend was used to implement the deep learning algorithms in this study, with the aid of other scientific computing libraries: matplotlib[7], numpy[14], and scikit-learn[11]. 2.2 The Datasets In this section, we describe the datasets used for the deep learning models used in the experiments. 2.2.1 MNIST. MNIST[10] is one of the established standard datasets for benchmarking deep learning models. It is a 10-class classification problem having 60,000 training examples, and 10,000 test cases – all in grayscale, with each image having a resolution of 28 × 28. 2.2.2 Fashion-MNIST. Xiao et al. (2017)[17] presented the new Fashion-MNIST dataset as an alternative to the conventional MNIST. The new dataset consists of 28 × 28 grayscale images of 70, 000 fashion products from 10 classes, with 7, 000 images per class. 2.2.3 Wisconsin Diagnostic Breast Cancer (WDBC). The WDBC dataset[16] consists of features which were computed from a digitized image of a fine needle aspirate (FNA) of a breast mass. There are 569 data points in this dataset: (1) 212 – Malignant, and (2) 357 – Benign. 2.3 Data Preprocessing We normalized the dataset features using Eq. 1, z= X −µ σ (1) where X represents the dataset features, µ represents the mean value for each dataset feature x (i) , and σ represents the corresponding standard deviation. This normalization technique was implemented using the StandardScaler[11] of scikit-learn. For the case of MNIST and Fashion-MNIST, we employed Principal Component Analysis (PCA) for dimensionality reduction. That is, to select the representative features of image data. We accomplished this by using the PCA[11] of scikit-learn. 2.4 The Model We implemented a feed-forward neural network (FFNN) and a convolutional neural network (CNN), both of which had two different classification functions, i.e. (1) softmax, and (2) ReLU. ,, Abien Fred M. Agarap 2.4.1 Softmax. Deep learning solutions to classification problems usually employ the softmax function as their classification function (last layer). The softmax function specifies a discrete probÍ ability distribution for K classes, denoted by kK=1 pk . If we take x as the activation at the penultimate layer of a neural network, and θ as its weight parameters at the softmax layer, we have o as the input to the softmax layer, o= n−1 Õ θi xi prediction units (see Eq. 6). The θ parameters are then learned by backpropagating the gradients from the ReLU classifier. To accomplish this, we differentiate the ReLU-based cross-entropy function (see Eq. 7) w.r.t. the activation of the penultimate layer, ℓ(θ ) = − exp(o ) pk = Ín−1 k exp(ok ) k =0 i ∈1, ..., N  θ ·y ∂ℓ(θ )  =− ∂h max 0, θh + b · ln 10 (2) (6) (7) The backpropagation algorithm (see Eq. 8) is the same as the conventional softmax-based deep neural network. (3) Hence, the predicted class would be ŷ ŷ = arg max pi y · loд max(0, θx + b) Let the input x be replaced the penultimate activation output h, i Consequently, we have Õ (4) 2.4.2 Rectified Linear Units (ReLU). ReLU is an activation function introduced by [6], which has strong biological and mathematical underpinning. In 2011, it was demonstrated to further improve training of deep neural networks. It works by thresholding values at 0, i.e. f (x) = max(0, x). Simply put, it outputs 0 when x < 0, and conversely, it outputs a linear function when x ≥ 0 (refer to Figure 1 for visual representation). "  # ∂ℓ(θ ) Õ ∂ℓ(θ ) Õ ∂pi ∂ok = (8) ∂θ ∂pi ∂ok ∂θ i k Algorithm 1 shows the rudimentary gradient-descent algorithm for a DL-ReLU model. Algorithm 1: Mini-batch stochastic gradient descent training of neural network with the rectified linear unit (ReLU) as its classification function. n ,θ Input: {x (i) ∈ Rm }i=1 Output: W for number of training iterations do for i = 1, 2, . . . n do θ ·y  ∇θ = ∇θ − max 0, θh + b · ln 10 θ = θ − α · ∇θ ℓ(θ ; x (i) ) Any standard gradient-based learning algorithm may be used. We used adaptive momentum estimation (Adam) in our experiments. In some experiments, we found the DL-ReLU models perform on par with the softmax-based models. 2.5 Figure 1: The Rectified Linear Unit (ReLU) activation function produces 0 as an output when x < 0, and then produces a linear with slope of 1 when x > 0. We propose to use ReLU not only as an activation function in each hidden layer of a neural network, but also as the classification function at the last layer of a network. Hence, the predicted class for ReLU classifier would be ŷ, ŷ = arg max max(0, o) i ∈1, ..., N (5) 2.4.3 Deep Learning using ReLU. ReLU is conventionally used as an activation function for neural networks, with softmax being their classification function. Then, such networks use the softmax cross-entropy function to learn the weight parameters θ of the neural network. In this paper, we still implemented the mentioned loss function, but with the distinction of using the ReLU for the Data Analysis To evaluate the performance of the DL-ReLU models, we employ the following metrics: (1) Cross Validation Accuracy & Standard Deviation. The result of 10-fold CV experiments. (2) Test Accuracy. The trained model performance on unseen data. (3) Recall, Precision, and F1-score. The classification statistics on class predictions. (4) Confusion Matrix. The table for describing classification performance. 3 EXPERIMENTS All experiments in this study were conducted on a laptop computer with Intel Core(TM) i5-6300HQ CPU @ 2.30GHz x 4, 16GB of DDR3 RAM, and NVIDIA GeForce GTX 960M 4GB DDR5 GPU. Table 1 shows the architecture of the VGG-like CNN (from Deep Learning using Rectified Linear Units (ReLU) ,, Keras[4]) used in the experiments. The last layer, dense_2, used the softmax classifier and ReLU classifier in the experiments. The Softmax- and ReLU-based models had the same hyperparameters, and it may be seen on the Jupyter Notebook found in the project repository: https://github.com/AFAgarap/relu-classifier. Table 1: Architecture of VGG-like CNN from Keras[4]. Layer (type) Output Shape Param # conv2d_1 (Conv2D) conv2d_2 (Conv2D) max_pooling2d_1 (MaxPooling2) dropout_1 (Dropout) conv2d_3 (Conv2D) conv2d_4 (Conv2D) max_pooling2d_2 (MaxPooling2) dropout_2 (Dropout) flatten_1 (Flatten) dense_1 (Dense) dropout_3 (Dropout) dense_2 (Dense) (None, 14, 14, 32) (None, 12, 12, 32) (None, 6, 6, 32) (None, 6, 6, 32) (None, 4, 4, 64) (None, 2, 2, 64) (None, 1, 1, 64) (None, 1, 1, 64) (None, 64) (None, 256) (None, 256) (None, 10) 320 9248 0 0 18496 36928 0 0 0 16640 0 2570 Table 3: MNIST Classification. Comparison of FFNNSoftmax and FFNN-ReLU models in terms of % accuracy. The training cross validation is the average cross validation accuracy over 10 splits. Test accuracy is on unseen data. Precision, recall, and F1-score are on unseen data. Metrics / Models FFNN-Softmax FFNN-ReLU Training cross validation Test accuracy Precision Recall F1-score ≈ 99.29% 97.98% 0.98 0.98 0.98 ≈ 98.22% 97.77% 0.98 0.98 0.98 Table 2 shows the architecture of the feed-forward neural network used in the experiments. The last layer, dense_6, used the softmax classifier and ReLU classifier in the experiments. Table 2: Architecture of FFNN. Layer (type) Output Shape Param # dense_3 (Dense) dropout_4 (Dropout) dense_4 (Dense) dropout_5 (Dropout) dense_5 (Dense) dropout_6 (Dropout) dense_6 (Dense) (None, 512) (None, 512) (None, 512) (None, 512) (None, 512) (None, 512) (None, 10) 131584 0 262656 0 262656 0 5130 All models used Adam[8] optimization algorithm for training, with the default learning rate α = 1 × 10−3 , β 1 = 0.9, β 2 = 0.999, ϵ = 1 × 10−8 , and no decay. 3.1 MNIST We implemented both CNN and FFNN defined in Tables 1 and 2 on a normalized, and PCA-reduced features, i.e. from 28 × 28 (784) dimensions down to 16 × 16 (256) dimensions. In training a FFNN with two hidden layers for MNIST classification, we found the results described in Table 3. Despite the fact that the Softmax-based FFNN had a slightly higher test accuracy than the ReLU-based FFNN, both models had 0.98 for their F1-score. These results imply that the FFNN-ReLU is on par with the conventional FFNN-Softmax. Figures 2 and 3 show the predictive performance of both models for MNIST classification on its 10 classes. Values of correct prediction in the matrices seem to be balanced, as in some classes, Figure 2: Confusion matrix of FFNN-ReLU on MNIST classification. the ReLU-based FFNN outperformed the Softmax-based FFNN, and vice-versa. In training a VGG-like CNN[4] for MNIST classification, we found the results described in Table 4. Table 4: MNIST Classification. Comparison of CNN-Softmax and CNN-ReLU models in terms of % accuracy. The training cross validation is the average cross validation accuracy over 10 splits. Test accuracy is on unseen data. Precision, recall, and F1-score are on unseen data. Metrics / Models CNN-Softmax CNN-ReLU Training cross validation Test accuracy Precision Recall F1-score ≈ 97.23% 95.36% 0.95 0.95 0.95 ≈ 73.53% 91.74% 0.92 0.92 0.92 ,, Abien Fred M. Agarap Figure 3: Confusion matrix of FFNN-Softmax on MNIST classification. Figure 4: Confusion matrix of CNN-ReLU on MNIST classification. The CNN-ReLU was outperformed by the CNN-Softmax since it converged slower, as the training accuracies in cross validation were inspected (see Table 5). However, despite its slower convergence, it was able to achieve a test accuracy higher than 90%. Granted, it is lower than the test accuracy of CNN-Softmax by ≈ 4%, but further optimization may be done on the CNN-ReLU to achieve an on-par performance with the CNN-Softmax. Table 5: Training accuracies and losses per fold in the 10-fold training cross validation for CNN-ReLU on MNIST Classification. Fold # Loss Accuracy (×100%) 1 2 3 4 5 6 7 8 9 10 1.9060128301398311 1.4318902588488513 1.362783239967884 0.8257899198037331 1.222473526516734 0.4512576775334098 0.49083630082824015 0.34528968995411613 0.30161443973038743 0.279967466075669 0.32963837901722315 0.5091768125718277 0.5942213337366827 0.7495911319797827 0.7038720233118376 0.8729090907790444 0.8601818182685158 0.9032199380288064 0.912663755545276 0.9171823807790317 Figures 4 and 5 show the predictive performance of both models for MNIST classification on its 10 classes. Since the CNN-Softmax converged faster than CNN-ReLU, it has the most number of correct predictions per class. 3.2 Fashion-MNIST We implemented both CNN and FFNN defined in Tables 1 and 2 on a normalized, and PCA-reduced features, i.e. from 28 × 28 (784) Figure 5: Confusion matrix of CNN-Softmax on MNIST classification. dimensions down to 16 × 16 (256) dimensions. The dimensionality reduction for MNIST was the same for Fashion-MNIST for fair comparison. Though this discretion may be challenged for further investigation. In training a FFNN with two hidden layers for Fashion-MNIST classification, we found the results described in Table 6. Despite the fact that the Softmax-based FFNN had a slightly higher test accuracy than the ReLU-based FFNN, both models had 0.89 for their F1-score. These results imply that the FFNN-ReLU is on par with the conventional FFNN-Softmax. Deep Learning using Rectified Linear Units (ReLU) ,, Table 6: Fashion-MNIST Classification. Comparison of FFNN-Softmax and FFNN-ReLU models in terms of % accuracy. The training cross validation is the average cross validation accuracy over 10 splits. Test accuracy is on unseen data. Precision, recall, and F1-score are on unseen data. Metrics / Models FFNN-Softmax FFNN-ReLU Training cross validation Test accuracy Precision Recall F1-score ≈ 98.87% 89.35% 0.89 0.89 0.89 ≈ 92.23% 89.06% 0.89 0.89 0.89 Figure 7: Confusion matrix of FFNN-Softmax on Fashion-MNIST classification. Table 7: Fashion-MNIST Classification. Comparison of CNNSoftmax and CNN-ReLU models in terms of % accuracy. The training cross validation is the average cross validation accuracy over 10 splits. Test accuracy is on unseen data. Precision, recall, and F1-score are on unseen data. Figure 6: Confusion matrix of FFNN-ReLU on Fashion-MNIST classification. Figures 6 and 7 show the predictive performance of both models for Fashion-MNIST classification on its 10 classes. Values of correct prediction in the matrices seem to be balanced, as in some classes, the ReLU-based FFNN outperformed the Softmax-based FFNN, and vice-versa. In training a VGG-like CNN[4] for Fashion-MNIST classification, we found the results described in Table 7. Similar to the findings in MNIST classification, the CNN-ReLU was outperformed by the CNN-Softmax since it converged slower, as the training accuracies in cross validation were inspected (see Table 8). Despite its slightly lower test accuracy, the CNN-ReLU had the same F1-score of 0.86 with CNN-Softmax – also similar to the findings in MNIST classification. Figures 8 and 9 show the predictive performance of both models for Fashion-MNIST classification on its 10 classes. Contrary to the findings of MNIST classification, CNN-ReLU had the most number of correct predictions per class. Conversely, with its faster convergence, CNN-Softmax had the higher cumulative correct predictions per class. Metrics / Models CNN-Softmax CNN-ReLU Training cross validation Test accuracy Precision Recall F1-score ≈ 91.96% 86.08% 0.86 0.86 0.86 ≈ 83.24% 85.84% 0.86 0.86 0.86 Table 8: Training accuracies and losses per fold in the 10-fold training cross validation for CNN-ReLU for Fashion-MNIST classification. Fold # Loss Accuracy (×100%) 1 2 3 4 5 6 7 8 9 10 0.7505188028133193 0.6294445606858231 0.5530192871624917 0.468552251288519 0.4499297190579501 0.45004472223195163 0.4096944159454683 0.39893951664539995 0.37760543597664203 0.34610279169377683 0.7309229651162791 0.7821584302325582 0.8128293656488342 0.8391494002614356 0.8409090909090909 0.8499999999566512 0.855610110994295 0.8681098779960613 0.8637190683266308 0.8804367606156083 ,, Abien Fred M. Agarap Table 9: WDBC Classification. Comparison of CNN-Softmax and CNN-ReLU models in terms of % accuracy. The training cross validation is the average cross validation accuracy over 10 splits. Test accuracy is on unseen data. Precision, recall, and F1-score are on unseen data. Figure 8: Confusion matrix of CNN-ReLU on Fashion-MNIST classification. Figure 9: Confusion matrix of CNN-Softmax on Fashion-MNIST classification. 3.3 WDBC We implemented FFNN defined in Table 2, but with hidden layers having 64 neurons followed by 32 neurons instead of two hidden layers both having 512 neurons. For the WDBC classfication, we only normalized the dataset features. PCA dimensionality reduction might not prove to be prolific since WDBC has only 30 features. In training the FFNN with two hidden layers of [64, 32] neurons, we found the results described in Table 9. Metrics / Models FFNN-Softmax FFNN-ReLU Training cross validation Test accuracy Precision Recall F1-score ≈ 91.21% ≈ 92.40% 0.92 0.92 0.92 ≈ 87.96% ≈ 90.64% 0.91 0.91 0.90 Similar to the findings in classification using CNN-based models, the FFNN-ReLU was outperformed by the FFNN-Softmax in WDBC classification. Consistent with the CNN-based models, the FFNNReLU suffered from slower convergence than the FFNN-Softmax. However, there was only 0.2 F1-score difference between them. It stands to reason that the FFNN-ReLU is still comparable with FFNN-Softmax. Figure 10: Confusion matrix of FFNN-ReLU on WDBC classification. Figures 10 and 11 show the predictive performance of both models for WDBC classification on binary classification. The confusion matrices show that the FFNN-Softmax had more false negatives than FFNN-ReLU. Conversely, FFNN-ReLU had more false positives than FFNN-Softmax. 4 CONCLUSION AND RECOMMENDATION The relatively unfavorable findings on DL-ReLU models is most probably due to the dying neurons problem in ReLU. That is, no gradients flow backward through the neurons, and so, the neurons become stuck, then eventually “die”. In effect, this impedes the Deep Learning using Rectified Linear Units (ReLU) Figure 11: Confusion matrix of FFNN-Softmax on WDBC classification. learning progress of a neural network. This problem is addressed in subsequent improvements on ReLU (e.g. [13]). Aside from such drawback, it may be stated that DL-ReLU models are still comparable to, if not better than, the conventional Softmax-based DL models. This is supported by the findings in DNN-ReLU for image classification using MNIST and Fashion-MNIST. Future work may be done on thorough investigation of DL-ReLU models through numerical inspection of gradients during backpropagation, i.e. compare the gradients in DL-ReLU models with the gradients in DL-Softmax models. Furthermore, ReLU variants may be brought into the table for additional comparison. 5 ACKNOWLEDGMENT An appreciation of the VGG-like Convnet source code in Keras[4], as it was the CNN model used in this study. REFERENCES [1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. 2015. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. (2015). http://tensorflow.org/ Software available from tensorflow.org. [2] Abien Fred Agarap. 2017. A Neural Network Architecture Combining Gated Recurrent Unit (GRU) and Support Vector Machine (SVM) for Intrusion Detection in Network Traffic Data. arXiv preprint arXiv:1709.03082 (2017). [3] Abdulrahman Alalshekmubarak and Leslie S Smith. 2013. A novel approach combining recurrent neural network and support vector machines for time series classification. In Innovations in Information Technology (IIT), 2013 9th International Conference on. IEEE, 42–47. [4] François Chollet et al. 2015. Keras. https://github.com/keras-team/keras. (2015). [5] Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. 2015. Attention-based models for speech recognition. In Advances ,, in Neural Information Processing Systems. 577–585. [6] Richard HR Hahnloser, Rahul Sarpeshkar, Misha A Mahowald, Rodney J Douglas, and H Sebastian Seung. 2000. Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit. Nature 405, 6789 (2000), 947. [7] J. D. Hunter. 2007. Matplotlib: A 2D graphics environment. Computing In Science & Engineering 9, 3 (2007), 90–95. https://doi.org/10.1109/MCSE.2007.55 [8] Diederik Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014). [9] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. 2012. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems. 1097–1105. [10] Yann LeCun, Corinna Cortes, and Christopher JC Burges. 2010. MNIST handwritten digit database. AT&T Labs [Online]. Available: http://yann. lecun. com/exdb/mnist 2 (2010). [11] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research 12 (2011), 2825–2830. [12] Yichuan Tang. 2013. Deep learning using linear support vector machines. arXiv preprint arXiv:1306.0239 (2013). [13] Ludovic Trottier, Philippe Gigu, Brahim Chaib-draa, et al. 2017. Parametric exponential linear unit for deep convolutional neural networks. In Machine Learning and Applications (ICMLA), 2017 16th IEEE International Conference on. IEEE, 207–214. [14] Stéfan van der Walt, S Chris Colbert, and Gael Varoquaux. 2011. The NumPy array: a structure for efficient numerical computation. Computing in Science & Engineering 13, 2 (2011), 22–30. [15] Tsung-Hsien Wen, Milica Gasic, Nikola Mrksic, Pei-Hao Su, David Vandyke, and Steve Young. 2015. Semantically conditioned lstm-based natural language generation for spoken dialogue systems. arXiv preprint arXiv:1508.01745 (2015). [16] William H Wolberg, W Nick Street, and Olvi L Mangasarian. 1992. Breast cancer Wisconsin (diagnostic) data set. UCI Machine Learning Repository [http://archive. ics. uci. edu/ml/] (1992). [17] Han Xiao, Kashif Rasul, and Roland Vollgraf. 2017. Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms. (2017). arXiv:cs.LG/1708.07747 [18] Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alexander J Smola, and Eduard H Hovy. 2016. Hierarchical Attention Networks for Document Classification.. In HLT-NAACL. 1480–1489.
9cs.NE
arXiv:1507.07121v3 [cs.DS] 24 Jun 2016 Improved Approximations for Cubic Bipartite and Cubic TSP Anke van Zuylen∗ Department of Mathematics The College of William and Mary, Williamsburg, VA, 23185, USA [email protected] Abstract We show improved approximation guarantees for the traveling salesman problem on cubic bipartite graphs and cubic graphs. For cubic bipartite graphs with n nodes, we improve on recent results of Karp and Ravi by giving a “local improvement” algorithm that finds a tour of length at most 5/4n − 2. For 2-connected cubic graphs, we show that the techniques of Mömke and Svensson can be combined with the techniques of Correa, Larré and Soto, to obtain a tour of length at most (4/3 − 1/8754)n. 1 Introduction The traveling salesman problem (TSP) is one of the most famous and widely studied combinatorial optimization problems. Given a set of cities and pairwise distances, the goal is to find a tour of minimum length that visits every city exactly once. Even if we require the distances to form a metric, the problem remains NP-hard. The classic Christofides’ algorithm [5] finds a tour that has length at most 32 times the length of the optimal tour. Despite much effort in the 35 years following Christofides’s result, we do not know any algorithms that improve on this guarantee. One approach that has often been useful in designing approximation algorithms is the use of linear programming. In this context, a major open question is to determine the integrality gap of the subtour elimination linear program or Held-Karp relaxation [7, 9]; the integrality gap is the worst-case ratio of the length of an optimal tour to the optimal value of the relaxation. ∗ Supported in part by NSF Prime Award: HRD-1107147, Women in Scientific Education (WISE) and by a grant from the Simons Foundation (#359525, Anke Van Zuylen). 1 Examples are known in which the length of the optimal tour is 43 times the value of the Held-Karp relaxation, and a major open question is whether this is tight. Recent years have seen some exciting progress towards answering this question on graph metrics, also called the graph-TSP. In this special case of the metric TSP, we are given an unweighted graph G = (V, E) in which the nodes represent the cities, and the distance between two cities is equal to the shortest path in G between the corresponding nodes. Examples are known in which the ratio between the length of the optimal tour and the Held-Karp relaxation is 43 , where the examples are in fact graph-TSP instances with an underlying graph G that is 2-connected and subcubic (every node has degree at most three). The graph-TSP thus captures many of the obstacles that have prevented us from obtaining improved approximations for general metrics, and much recent research has focused on finding improved algorithms for the graphTSP. The first improvement for graph-TSP metrics is due to Gamarnik, Lewenstein and Sviridenko [8], who show an approximation guarantee strictly less than 32 for cubic, 3-connected graphs. Aggarwal, Garg and Gupta [1] give a 43 -approximation algorithm for this case. Boyd, Sitters, Van der Ster, and Stougie [3] show that there is a 43 -approximation algorithm for any cubic graph, and Mömke and Svensson [11] show this holds also for subcubic graphs. Mömke and Svensson also show a 1.461-approximation algorithm if we make no assumptions on the underlying graph G. Mucha [12] improves their analysis to show an approximation guarantee of 13 9 . Sebő and Vygen [13] combine the techniques of Mömke and Svensson with a clever use of ear decompositions, which yields an approximation ratio of 1.4. As mentioned previously, for subcubic graphs, examples exist that show that we cannot obtain better approximation guarantees than 34 unless we use a stronger lower bound on the optimum than the Held-Karp relaxation or subtour elimination linear program. Correa, Larré and Soto [6] show that this is not the case for cubic graphs. They refine the techniques of Boyd 1 n for et al. [3] and show how to find a tour of length at most 43 − 61236 the graph-TSP on a 2-connected cubic graph G, where n is the number of nodes. Correa, Larré and Soto also consider the graph-TSP on planar cubic 1 )-approximation algorithm. bipartite 3-connected graphs, and give a ( 43 − 18 Planar cubic bipartite 3-connected graphs are known as Barnette graphs, and a long-standing conjecture in graph theory by Barnette [2] states that all planar cubic bipartite 3-connected graphs are Hamiltonian. Recently, Karp and Ravi [10] gave a 97 -approximation algorithm for the graph-TSP on 2 a superset of Barnette graphs, cubic bipartite graphs. In this paper, we give two results that improve on the results for cubic graph-TSP. For the graph-TSP on (non-bipartite) cubic graphs, we show that the techniques of Mömke and Svensson [11] can be combined with those of Correa et al. [6] to find an approximation algorithm with guaran1 ). We note that independent of our work, Candráková and tee ( 43 − 8754 Lukot’ka [4] showed very recently, using different techniques, how to obtain a 1.3-approximation algorithm for the graph-TSP on cubic graphs. For connected bipartite cubic graphs, we give an algorithm that finds a tour of length at most 54 n − 2, where n is the number of nodes. The idea behind our algorithm is the same as that of many previous papers, namely to find a cycle cover (or 2-factor) of the graph with a small number of cycles. Our algorithm is basically a simple “local improvement” algorithm. The key idea for the analysis is to assign the size of each cycle to the nodes contained in it in a clever way; this allows us to give a very simple proof that the algorithm returns a 2-factor with at most n/8 components. We also give an example that shows that the analysis is tight, even if we relax a certain condition in the algorithm that restricts the cases when we allow the algorithm to move to a new solution. The remainder of this paper is organized as follows. In Section 2, we describe and analyze our algorithm for the graph-TSP on cubic bipartite graphs, and in Section 3, we give our improved result for non-bipartite cubic graphs. 2 The Graph-TSP on Cubic Bipartite Graphs In the graph-TSP, we are given a graph G = (V, E), and for any u, v ∈ V , we let the distance between u and v be the number of edges in the shortest path between u and v in G. The goal is to find a tour of the nodes in V that has minimum total length. A 2-factor of G is a subset of edges F ⊆ E, such that each node in V is incident to exactly two edges in F . Note that if F is a 2-factor, then each (connected) component of (V, F ) is a simple cycle. If C is a component of (V, F ), then we will use V (C) to denote the nodes in C and E(C) to denote the edges in C. The size of a cycle C is defined to be |E(C)| (which is of course equal to |V (C)|). Sometimes, we consider a component of (V, F \ E ′ ) for some E ′ ⊂ F . A component of such a graph is either a cycle C or a path P . We define the length of a path P to be the number of edges in P . The main idea behind our algorithm for the graph-TSP in cubic bipartite 3 graphs (and behind many algorithms for variants of the graph-TSP given in the literature) is to find a 2-factor F in G such that (V, F ) has a a small number of cycles, say k. We can then contract each cycle of the 2factor, find a spanning tree on the contracted graph, and add two copies of the corresponding edges to the 2-factor. This yields a spanning Eulerian (multi)graph containing n + 2(k − 1) edges. By finding a Eulerian walk in this graph and shortcutting, we get a tour of length at most n + 2k − 2. In order to get a good algorithm for the graph-TSP, we thus need to show how to find a 2-factor with few cycles, or, equivalently, for which the average size of the cycles is large. In Section 2.2, we give an algorithm for which we prove in Lemma 5 that, given a cubic bipartite graph G = (V, E), it returns a 2-factor with average cycle size at least 8. By the arguments given above, this implies the following result. Theorem 1. There exists a 54 -approximation algorithm for the graph-TSP on cubic bipartite graphs. Before we give the ideas behind our algorithm and its analysis in Section 2.1, we begin with the observation that we may assume without loss of generality that the graph has no “potential 4-cycles”: a set of 4 nodes S will be called a potential 4-cycle if there exists a 2-factor in G that contains a cycle with node set exactly S. The fact that we can modify the graph so that G has no potential 4-cycles was also used by Karp and Ravi [10]. Lemma 1. To show that every simple cubic bipartite graph G = (V, E) has a 2-factor with at most |V |/8 components, it suffices to show that every simple cubic bipartite graph G′ = (V ′ , E ′ ) with no potential 4-cycles has a 2-factor with at most |V ′ |/8 components. Proof. We show how to contract a potential 4-cycle S in G to get a simple cubic bipartite graph G′ with fewer nodes than the original graph, and how, given a 2-factor with average component size 8 in G′ , we can uncontract S to get a 2-factor in G without increasing the number of components. Let S = {v1 , v2 , v3 , v4 } be a potential 4-cycle in G, i.e., E[S] contains 4 edges, say {v1 , v2 }, {v2 , v3 }, {v3 , v4 }, {v1 , v4 }, and there exists no node v5 6∈ S that is incident to two nodes in {v1 , v2 , v3 , v4 } (since in that case a 2-factor containing a cycle with node set S would have v5 as an isolated node, and this cannot be a 2-factor since v5 must have degree 2 in a 2-factor). We contract S, by identifying v1 , v3 to a new node vodd , and identifying v2 , v4 to a new node veven . We keep a single copy of the edge {vodd , veven }. 4 The new graph G′ is simple, cubic and bipartite, and |V ′ | = |V | − 2. See Figure 1 for an illustration. e1 e4 e1 e2 v1 v2 vodd e2 v4 v3 veven e3 e3 e4 Figure 1: The 4-cycle on the left is contracted, by identifying v1 , v3 to a new node vodd , and identifying v2 , v4 to a new node veven , and keeping a single copy of the edge {vodd , veven }, to obtain the simple cubic bipartite graph on the right. Given any 2-factor in G′ , we can “uncontract” S and find a 2-factor in G with at most as many components as the 2-factor in G′ : If the 2-factor on G′ does not contain {vodd , veven } then it must contain the other 4 edges incident to vodd and veven . When uncontracting S, this gives one edge incident to each vi , i = 1, . . . , 4. Since all other node degrees are even, the graph consists of even cycles and two paths with endpoints in {v1 , v2 , v3 , v4 }. We can choose to add the edges {v1 , v2 }, {v3 , v4 }, or the edges {v2 , v3 }, {v1 , v4 }; both of these choices give a 2-factor, and at least one of the two options must give a 2-factor in which all 4 nodes in S are in the same cycle. If the 2-factor on G′ does contain {vodd , veven } then it must contain one other edge incident to vodd and to veven . When uncontracting S, this gives one edge incident to v1 or v3 , and one edge incident to v2 or v4 . Suppose without loss of generality the edges are incident to v1 and v2 . Then, we add edges {v2 , v3 }, {v3 , v4 }, and {v1 , v4 } to get a 2-factor. Note that it is again the case that all 4 nodes in S are in the same cycle in the resulting 2-factor. 2.1 A Local Improvement Heuristic A cubic bipartite graph has a perfect matching (in fact, it is the case that the edge set can be decomposed into three perfect matchings), and given a cubic bipartite graph G = (V, E), we can obtain a 2-factor F by simply finding a perfect matching M and letting F = E\M . Conversely, if F is a 2-factor for G, then E\F is a perfect matching in G. Now, given an arbitrary 2-factor 5 F1 , we can use these observations to build a second 2-factor F2 such that most nodes that are in a small cycle in (V, F1 ) are in a long cycle in (V, F2 ): The 2-factor F2 is constructed by taking the matching E\F1 and adding half of the edges from each cycle in (V, F1 ). Since each cycle is even, its edges can be decomposed into two perfect matchings, and we may choose either one of them to add to F2 . We will say 2-factor F2 is locally optimal with respect to F1 if F2 contains all edges in E \ F1 and for each cycle C in (V, F1 ), replacing F2 by F2 △E(C) does not reduce the number of components of (V, F2 ) (where △ denotes the symmetric difference operator). The essence of our algorithm is to start with an arbitrary 2-factor F1 , find a 2-factor F2 that is locally optimal with respect to F1 , and return the 2-factor among F1 , F2 with the smallest number of components. If we consider a 6-cycle C in (V, F1 ), and a 2-factor F2 that is locally optimal with respect to F1 , then it is not hard to see that at least two edges of C will be part of the same cycle, say D, in (V, F2 ). Moreover, the fact that the graph G has no potential 4-cycles can be shown to imply that D has size at least 10. This observation motivates the condition in Lemma 2 below that for any C in (V, F1 ), there should exist D in (V, F2 ) of size at least 10, such that |V (C) ∩ V (D)| ≥ 4. In Lemma 2 we show that this condition suffices to guarantee that either (V, F1 ) or (V, F2 ) has at most |V |/8 cycles. In Lemma 3 we show the condition holds for F2 that is locally optimal for F1 , provided that all cycles in F1 are chordless: An edge {x, y} is a chord for cycle C in (V, F1 ), if x, y ∈ C, and {x, y} ∈ E \ F1 ; a cycle will be referred to as chorded if it has at least one chord, and chordless otherwise. A few more details are needed to deal with the general case when F1 is not necessarily chordless; these are postponed to Section 2.2. Lemma 2. Let G = (V, E) be a simple cubic bipartite graph that has no potential 4-cycles, let F1 and F2 be 2-factors in G, such that for any cycle C in (V, F1 ), there exists a cycle D in (V, F2 ) of size at least 10 such that |V (C) ∩ V (D)| ≥ 4. Then either (V, F1 ) or (V, F2 ) has at most |V |/8 components. Proof. Let Ki be the number of components of (V, Fi ) for i = 1, 2. Note that it suffices to show that γK1 + (1 − γ)K2 ≤ |V |/8 for some 0 ≤ γ ≤ 1. In order to do this, we introduce a value α(v) for each node. This value is set based on the Psize of the cycle containing v in the second 2-factor, and they will satisfy v∈D α(v) = P 1 for every cycle D in the second 2-factor (V, F2 ). Hence, we have that v∈V α(v) is equal to the number of cycles in 6 (V, F2 ). We will then show that the condition of the lemma guarantees that for a cycle C in (V, F1 ), X v∈C 1 1 α(v) ≤ |V (C)| − . 6 3 (*) P This suffices to prove what we want: we have K2 = v∈V α(v) ≤ 16 |V |− 13 K1 , which is the same as 14 K1 + 43 K2 ≤ 18 |V |. The basic idea to setting the α-values is that if v is in a cycle D in (V, F2 ) of size k, then we have α(v) = k1 . The only exception to this rule is when D 1 has size 10; in this case we set α(v) for v ∈ D to either 16 or 12 . There will 1 be exactly 8 nodes with α(v) = 12 and 2 nodes with α(v) = 16 . The nodes 1 are chosen in such a way that, if there is a cycle C v in D with α(v) = 12 in (V, F1 ) containing at least 4 nodes in D, then at least 4 of the nodes in 1 . It is possible to achieve this, since the V (C) ∩ V (D) will have α(v) = 12 fact that D has 10 nodes implies that (V, F1 ) can contain at most two cycles that intersect D in 4 or more nodes. It is easy to see that (*) holds: by the condition in the lemma, any cycle 1 C contains at least 4 nodes v such that α(v) ≤ 12 . Since we assumed in addition that G has no potential 4-cycles, we also know that α(v) ≤ 61 for all P 1 other v ∈ V (C). Hence v∈C α(v) ≤ 16 (|V (C)|−4)+4· 12 = 61 |V (C)|− 13 . By Lemma 2, it is enough to find a 2-factor F2 that satisfies that every cycle in the first 2-factor, F1 , has at least 4 nodes in some “long” cycle of F2 (where “long” is taken to be size 10 or more). The following lemma states that a locally optimal F2 satisfies this condition, provided that F1 is chordless. Lemma 3. Let G = (V, E) be a simple cubic bipartite graph that has no potential 4-cycles, let F1 be a chordless 2-factor in G, and let F2 be a 2-factor that is locally optimal with respect to F1 . Then for any cycle C in (V, F1 ), there exists a cycle D in (V, F2 ) of size at least 10 such that |V (C)∩V (D)| ≥ 4. Proof. Suppose F2 is locally optimal with respect to F1 , and assume by contradiction that there is some cycle C in (V, F1 ) such that (V, F2 ) contains no cycle of size at least 10 that intersects C in at least 4 nodes. Let F2′ = F2 △E(C); we will show that (V, F2′ ) has fewer components than (V, F2 ), contradicting the fact that F2 is locally optimal with respect to F1 . Consider an arbitrary cycle D in (V, F2 ) that intersects C. We will first show that any node v in D will be in a cycle in (V, F2′ ) that is at least as 7 large as D. This shows that the number of cycles of (V, F2′ ) is at most the number of cycles of (V, F2 ). We then show that it is not possible that for every node, its cycle in (V, F2′ ) is the same size as the cycle containing it in (V, F2 ). If D contains exactly one edge, say e, in C, then in (V, F2′ ), the edge e in D is replaced by an odd-length path. Hence, in this case the nodes in D will be contained in a cycle in (V, F2′ ) that is strictly larger than D. If D contains k > 1 edges in C, then D has size at most 8, since otherwise D contradicts our assumption that no cycle exists in (V, F2 ) of size at least 10 that intersects C in at least 4 nodes. We now show this implies that D has size exactly 8 and k = 2: The size of D is either 6 or 8 since G has no potential 4-cycles. Note that D alternates edges in C and odd-length paths in (V, F2 \ E(C)). Since C is chordless, the paths cannot have length 1 and must thus have length at least 3. We thus have that D must consist of exactly two edges from C, say e1 , e2 , separated by two paths of length 3, say P1 , P2 . Since P1 and P2 do not contain edges in C, (V, F2′ ) also contains the edges in P1 and P2 . Hence, to show that all nodes in D are in cycles of size at least 8 in (V, F2′ ), it now suffices to show that the cycles containing P1 and P2 in (V, F2′ ) have size at least 8. Consider the cycle in (V, F2′ ) containing P1 ; besides P1 , the cycle contains another path, say P1′ , connecting the endpoints of P1 , and this path must have odd length ≥ 3 since G is bipartite and has no potential 4-cycles. Furthermore, P1′ starts and ends with an edge in C, by definition of F2′ = F2 △E(C). Note that P1′ thus cannot have length 3, as this would imply that the middle edge in P1′ is a chord for C. So P1′ has length at least 5, and the cycle in (V, F2′ ) containing P1 thus has size at least 8. Similarly, the cycle containing P2 in (V, F2′ ) has size at least 8. We have thus shown that all nodes in D are in cycles of size at least |V (D)| in (V, F2′ ), and hence, (V, F2′ ) has at most as many cycles as (V, F2 ). Furthermore, it follows from the argument given above that the number of cycles in (V, F2 ) and (V, F2′ ) is the same only if all nodes in C are in cycles of size 8 in both (V, F2 ) and (V, F2′ ) and each such cycle consists of two edges from E(C) and two paths of length 3 in (V, F2 \ E(C)). We now show by contradiction that the latter is impossible. Suppose C is such that both in (V, F2 ) and in (V, F2′ ) every node in V (C) is contained in a cycle containing two edges from C. Then |V (C)| must be a multiple of 4, say |V (C)| = 4k. Let the nodes of C be labeled 1, 2, . . . , 4k ≡ 0, such that {2i + 1, 2i + 2} ∈ F2 and {2i, 2i + 1} ∈ F2′ for i = 0, . . . , 2k − 1. We also define a mapping p(i) for every i = 1, . . . , 4k, such that (V, F2 \ E(C)) contains a path (which, by our assumption has length 3) from i to p(i) for 8 i = 1, . . . , 4k. Observe that by the definition of the mapping, p(p(i)) must be equal to i (mod 4k) for i = 1, . . . , 4k. Let p(1) = ℓ, then the fact that edge {1, 2} is in a cycle with one other edge from C in (V, F2 ) implies that either {ℓ, ℓ + 1} ∈ F2 or {ℓ, ℓ − 1} ∈ F2 , and that either p(2) = ℓ + 1 or p(2) = ℓ − 1. In the first case, edge {2, 3} must be in a cycle with {ℓ + 1, ℓ + 2} in the second 2-factor (V, F2′ ), and thus p(3) = ℓ + 2. In the second case, {2, 3} must be in a cycle with {ℓ − 1, ℓ − 2} in (V, F2′ ), and thus p(3) = ℓ − 2. Repeating the argument shows that either p(i) ≡ ℓ + (i − 1) (mod 4k) for i = 1, . . . , 4k, or p(i) ≡ ℓ − (i − 1) (mod 4k) for i = 1, . . . , 4k. The first case gives a contradiction to the fact that G is bipartite: note that p(p(i)) ≡ 2ℓ + i − 2 (mod 4k) and this must be equal to i. Hence, ℓ ≡ 1 (mod 2k); in other words, ℓ is odd, which cannot be the case since (V, F2 \ E(C)) has a path of length 3 from 1 to ℓ (since p(1) = ℓ) and if ℓ were odd, then C would have a path of even length from 1 to ℓ, and thus G would contain an odd cycle. Now suppose that p(i) ≡ ℓ − (i − 1) (mod 4k) for i = 1, . . . , 4k. From the previous argument we know that ℓ must be even, since otherwise G is not bipartite. But then p(ℓ/2) = ℓ − (ℓ/2 − 1) = ℓ/2 + 1. In other words, node ℓ/2 is connected to node ℓ/2 + 1 in (V, F2 \ E(C)). But since the edge {ℓ/2, ℓ/2 + 1} is either in F2 or in F2′ , {ℓ/2, ℓ/2 + 1} is the only edge from C in its cycle in either (V, F2 ) or (V, F2′ ), contradicting the assumption on C. It may be the case that Lemma 3 also holds for cycles in (V, F1 ) that do have chords, but we have not been able to prove this. Instead, there is a simple alternative operation that ensures that a cycle in (V, F1 ) with a chord intersects at least one “long” cycle of size at least 10 in (V, F2 ) in 4 or more nodes. The algorithm described next will add this operation, and for technical reasons it will only modify F2 with respect to a cycle C in (V, F1 ) if the cycle C does not yet intersect a long cycle in (V, F2 ) in 4 or more nodes. 2.2 A 2-Factor with Average Cycle Size 8 We give our algorithm in Algorithm 1. The algorithm fixes a 2-factor F1 and initializes F2 to be a 2-factor that contains all edges in E \F1 . The algorithm then proceeds to modify F2 ; note that F1 is not changed. Figure 2 illustrates the modification to F2 in the case of a chorded cycle Ci . We need to prove that the set of edges F2 remains a 2-factor throughout 9 Let G = (V, E) be a bipartite cubic graph, with potential 4-cycles contracted using Lemma 1. Let F1 be an arbitrary 2-factor in G, and let C1 , . . . , Ck be the cycles in (V, F1 ). For each cycle Ci in (V, F1 ), let M (Ci ) ⊆ E(Ci ) be a perfect matching on V (Ci ). S Initialize F2 = (E\F1 ) ∪ ki=1 M (Ci ). while there exists a cycle Ci such that |V (Ci ) ∩ V (D)| < 4 for all cycles D in (V, F2 ) of size at least 10 do if Ci is a chordless cycle then F2 ← F2 △E(Ci ). else Let {x, y} be a chord for Ci , let P1 , P2 be the edge disjoint paths in Ci from x to y. Relabel P1 and P2 if necessary so that P1 starts and ends with an edge in F1 \ F2 . F2 ← (F2 △E(P1 )) \ {x, y}. end if end while Uncontract the 4-cycles in (V, Fj ) for j = 1, 2 using Lemma 1. Return the 2-factor among F1 , F2 with the smaller number of components. Algorithm 1: Approximation Algorithm for Cubic Bipartite TSP the course of the algorithm, that the algorithm terminates, and that upon termination, either (V, F1 ) or (V, F2 ) has at most |V |/8 components. The latter is clear: if the algorithm terminates, then the condition of Lemma 2 is satisfied, and therefore one of the two 2-factors has at most |V |/8 components. To show that F2 is a 2-factor and that the algorithm terminates is a little more subtle. In order to show this, it will be helpful to know that each cycle in (V, Fi ) alternates edges in Fi ∩ Fi+1 and edges in Fi \ Fi+1 for i = 1, 2 (where subscripts are modulo 2, so F3 ≡ F1 ). This is true initially, however, it is not the case that this property continues to hold for all cycles. We will show that it does hold in certain cases, which turn out to be exactly the cases “when we need it”. In the following, we will say a cycle or path in (V, Fi ) is alternating (for F1 and F2 ) if it alternates edges in Fi ∩ Fi+1 and Fi \ Fi+1 . We will say that a cycle C in (V, F1 ) is violated if there exists no 10 x x y y Figure 2: The figure on the left shows a chorded cycle C in F1 of size 10 and all edges in G that have both endpoints in C. The dashed edges are in F1 \ F2 , and non-dashed edges are in F2 (where not all edges in F2 that are incident on the nodes are shown). The figure on the right shows how Algorithm 1 would update F2 . D of size at least 10 in (V, F2 ) such that |V (C) ∩ V (D)| ≥ 4. Lemma 4. Algorithm 1 maintains that F2 is a 2-factor that satisfies the following properties: (1) if C in (V, F1 ) is violated, then C is alternating for F1 and F2 ; (2) if D in (V, F2 ) is not alternating for F1 and F2 , then D has size at least 10. Proof. We prove the S lemma by induction on the algorithm. Initially, F2 consists of E\F1 and ki=1 M (Ci ), which are two edge-disjoint perfect matchings on V . Hence, F2 is a 2-factor, and the two properties hold for all cycles in (V, F1 ) and (V, F2 ). Suppose the lemma holds and we modify F2 by considering some violated cycle C. The two properties of the lemma imply the following: Claim 1. If C is violated, then (V, F2 \ E(C)) consists of even cycles and odd-length paths, where paths that are not alternating for F1 and F2 have length at least 9. Proof of Claim: For each path in the graph (V, F2 \E(C)) there exists some cycle D in (V, F2 ) such that the path results when removing E(C) ∩ E(D) from D. If D is alternating for F1 and F2 , then the path must have the same property, and it must start and end with an edge in F2 \ F1 . Hence, the path must have odd length if D is alternating. If D is not alternating 11 then D has size at least 10 by Property (2), so C can have at most one edge in common with D, since otherwise C is not violated. Hence, the path obtained by removing the unique edge in E(C) ∩ E(D) has length at least 9, and its length must be odd, since D is an even cycle. ⋄ If C is chordless, then we modify F2 to F2′ = F2 △E(C). Clearly, F2′ is again a 2-factor, and Property (1) remains satisfied. Furthermore, any cycle in (V, F2′ ) that is not alternating for F1 and F2′ either also existed in (V, F2 ) and hence it has size at least 10, since Property (2) holds for F2 , or the cycle contains a path in (V, F2 \ E(C)) that is not alternating for F1 and F2 , and this path has length at least 9 by the claim. So Property (2) holds for F2′ . Now consider the modification of F2 when considering a chorded cycle C in (V, F1 ). Let P1 be as defined in the algorithm. First consider F2′ = F2 △E(P1 ); every node is incident to two edges in F2′ , except for x and y, which are incident to three edges in F2′ , namely two edges in E(C) plus the edge {x, y}. Hence, removing {x, y} will give a new 2-factor, say F2′′ . The modification from F2 to F2′′ is exactly the modification made to F2 by the algorithm. We now show that the two properties are satisfied. Clearly, C is not alternating for F1 and F2′′ , so in order to maintain Property (1), we need to show that C is no longer violated. To do this, we show that (V, F2′′ ) contains a cycle of size at least 10 that contains x, y and their 4 neighbors in C. First, suppose by contradiction that after removing {x, y}, x and y are not in the same cycle. Consider the component of (V, F2′′ ) containing x: starting from x, it alternates edges in E(C) and paths in F2 \ E(C), starting and ending with an edge in E(C). By Claim 1 the paths in (V, F2 \ E(C)) have odd length, and hence the component containing x must be an odd cycle, contradicting the fact that G is bipartite. So, x and y must be in the same cycle in (V, F2′′ ). This cycle must thus consist of two odd-length paths from x to y, each starting and ending with an edge in F2′′ ∩ F1 . These paths cannot have length 3, because this would imply that the path plus the edge {x, y} would form a potential 4-cycle. Hence, the cycle in (V, F2′′ ) containing x and y has size at least 10. For Property (2), note that any cycle D in (V, F2′′ ) that is not alternating for F1 and F2′′ either (i) existed in (V, F2 ) and therefore has size at least 10, or (ii) contains x and y and we showed above that this cycle has size at least 10, or (iii) it contains a path in (V, F2 \ E(C)) that is not alternating for F1 and F2 , and by the claim this path has length at least 9. Hence, Property (2) is satisfied by F2′′ . 12 Lemma 5. Given a cubic bipartite graph G = (V, E), Algorithm 1 returns a 2-factor in G with at most |V |/8 components. Proof. By Lemma 1 it suffices to show that the current lemma holds if G has no potential 4-cycles. By the termination condition of Algorithm 1 and Lemma 2, the 2-factor returned by the algorithm does indeed have at most |V |/8 components, so it remains to show that the algorithm always returns a 2-factor. By Lemma 4, the algorithm maintains two 2-factors F1 and F2 . Observe that if a cycle C is not violated, then this continues to hold throughout the remainder of the algorithm: Let D be a cycle of size at least 10 in (V, F2 ) such that |V (C) ∩ V (D)| ≥ 4. The only possible changes to D will be caused by a violated cycle C ′ , which necessarily contains at most one edge in D: by Lemma 4 C ′ is alternating for F1 and F2 , so if C ′ contains more than one edge in D, C ′ cannot be violated. The modification of F2 with respect to E(C ′ ) can therefore only cause the cycle D to become a larger cycle D ′ where V (D ′ ) ⊇ V (D). So D ′ will have size at least 10, and |V (C) ∩ V (D ′ )| ≥ 4. It remains to show that if we modify F2 with respect to some violated cycle C, then C is not violated for the new 2-factor F2′ . If C is not chordless, then this holds because C is not alternating for F1 and the new 2-factor F2′ , so by Lemma 4, C is not violated. If C is chordless and violated, then by Claim 1, (V, F2 \ E(C)) consists of even cycles and odd-length paths. The proof of Lemma 3 then shows that taking the symmetric difference of F2 with E(C) (strictly) reduces the number of components. This implies that for F2′ = F2 △E(C), cycle C is not violated: otherwise, we could apply the same arguments to show that (V, F2 △E(C)△E(C)) has strictly fewer cycles than (V, F2 ), but this is a contradiction since F2 △E(C)△E(C) = F2 . In the appendix, we give an example on 48 nodes that shows our analysis of Algorithm 1 is tight. In fact, the example is also tight for the local improvement heuristic from Section 2.1 and for the local improvement heuristic we obtain if we allow Algorithm 1 to modify F2 for cycles C that are chorded and/or do have at least two edges in a cycle of size 10 or more in (V, F2 ). 3 Cubic graphs We now consider cubic graphs, in other words, we drop the requirement that the graph is bipartite. We assume the graph is 2-connected. The best known approximation result for graph-TSP on a 2-connected cubic graphs 13 G = (V, E) is due to Correa, Larré and Soto [6] who  show how to find in 1 polynomial time a tour of length at most 43 − 61236 |V |. One obstacle for their techniques are chorded 4-cycles, i.e., a set of 4 nodes (v1 , v2 , v3 , v4 ) such that the subgraph of G induced by {v1 , v2 , v3 , v4 } contains edges {v1 , v2 }, {v2 , v3 }, {v3 , v4 }, {v4 , v1 } and the “chord” {v2 , v4 }. In fact, Correa et al. prove the following. Lemma 6 (Correa, Larré and Soto [6]). Consider a graph-TSP instance on a 2-connected cubic graph G = (V, E), and let B be the set of nodes in G contained in a chorded 4-cycle. Then, we can find in polynomial time a tour 1 )(|V \B|) + 2. of length at most 43 |B| + ( 34 − 8748 The proof of this lemma is contained in the proof of Theorem 2 in [6]. More precisely,Pit is shown that there exists a distribution over tours of expected size v∈V z(v) + 2, where z(v) is the “average contribution” of P v. In the proof of the Theorem 2 in [6] it is shown that z(v) ≤ v∈V 4 1 4 3 |B| + ( 3 − 8748 )(|V \B|). On the other hand, chorded 4-cycles are “beneficial” for the analysis of the Mömke-Svensson [11] algorithm for the graph-TSP on 2-connected subcubic graphs, as we will show next. Lemma 7. Consider a graph-TSP instance on a 2-connected subcubic graph G = (V, E), and let B be the set of nodes in G contained in a chorded 4-cycle. Then, we can find in polynomial time a tour of length at most 34 |V |− 16 |B|− 32 . Proof. For convenience, we will use the word “tour” to refer to a connected spanning Eulerian multigraph obtained by doubling and deleting some edges of G. Note that the graph-TSP instance on G indeed has a tour (obtained by shortcutting a Eulerian walk on this multigraph) of length at most the number of edges in the multigraph. Mömke and Svensson [11] show that there exists a probability distribution over tours, such that each edge e ∈ E appears an even number of times (zero or twice) with probability 13 , and the expected number of edges in the tour is 43 |V | − 23 . Now, we can simply contract chorded 4-cycles in a cubic graph to obtain a subcubic graph G̃, on which we can apply the Mömke-Svensson algorithm to find a distribution over tours with 43 (|V | − 34 |B|) − 32 = 34 |V | − |B| − 23 edges in expectation. Next, we uncontract the chorded 4-cycles in each of the tours T : For a chorded 4-cycle (v1 , v2 , v3 , v4 ) that is contracted to a node v, note that T contains an even number of edges incident to v. Hence, either both edges incident to v in G̃ appear an odd number of times in T , or both appear an even number of times. In the first case, we uncontract 14 the chorded 4-cycle by adding the edges {v1 , v2 }, {v2 , v4 } and {v3 , v4 }. In the second case, we uncontract the chorded 4-cycle by adding the edges {v1 , v2 }, {v2 , v3 }, {v3 , v4 }, {v4 , v1 }. Since each edge appears an even number of times with probability 13 , the second case happens with probability 13 , and the first case thus happens with probability 23 . Hence, the expected number of edges in T increases by 10 |B| 4 1 2 3 4 , giving a total number of edges of 3 |V | − 6 |B| − 3 in expectation. Note that the bound in Lemma 6 is increasing in |B| and the bound in Lemma 7 is decreasing in |B|. Setting the bound in Lemma 6 equal to the 1 bound in Lemma 7 gives |B| = 1459 |V | and thus shows that there exists  a 1 |V | polynomial time algorithm for finding a tour of length at most 43 − 8754 for a graph-TSP instance on a 2-connected cubic graph G = (V, E). By an  1 observation of Mömke and Svensson [11], this also implies a 34 − 8754 approximation algorithm for cubic graph-TSP, i.e., the graph G does not have to be 2-connected. We have thus shown the following result.  1 -approximation algorithm for GraphTheorem 2. There exists a 43 − 8754 TSP on cubic graphs. Acknowledgements The author would like to thank Marcin Mucha for careful reading and pointing out an omission in a previous version, Frans Schalekamp for helpful discussions, and an anonymous reviewer for suggesting the simplified proof for the result in Section 3 for cubic non-bipartite graphs. Other anonymous reviewers are acknowledged for helpful feedback on the presentation of the algorithm for bipartite cubic graphs. References [1] Nishita Aggarwal, Naveen Garg, and Swati Gupta. A 4/3approximation for TSP on cubic 3-edge-connected graphs. Available at http://arxiv.org/abs/1101.5586, 2011. [2] David W. Barnette. Conjecture 5. Recent progress in combinatorics, 1969. [3] Sylvia Boyd, René Sitters, Suzanne van der Ster, and Leen Stougie. The traveling salesman problem on cubic and subcubic graphs. Math. Program., 144(1-2):227–245, 2014. 15 [4] Barbora Candráková and Robert Lukotka. approximation. CoRR, abs/1506.06369, 2015. Cubic TSP - a 1.3- [5] Nicos Christofides. Worst case analysis of a new heuristic for the traveling salesman problem. Report 388, Graduate School of Industrial Administration, Carnegie-Mellon University, Pittsburgh, PA, 1976. [6] José R. Correa, Omar Larré, and José A. Soto. TSP tours in cubic graphs: Beyond 4/3. SIAM J. Discrete Math., 29(2):915–939, 2015. Preliminary version appeared in ESA 2012: 790-801. [7] George B. Dantzig, Delbert R. Fulkerson, and Selmer M. Johnson. Solution of a large-scale traveling-salesman problem. Operations Research, 2:393–410, 1954. [8] David Gamarnik, Moshe Lewenstein, and Maxim Sviridenko. An improved upper bound for the TSP in cubic 3-edge-connected graphs. Oper. Res. Lett., 33(5):467–474, 2005. [9] Michael Held and Richard M. Karp. The traveling-salesman problem and minimum spanning trees. Operations Res., 18:1138–1162, 1970. [10] Jeremy Karp and R. Ravi. A 9/7 -approximation algorithm for graphic TSP in cubic bipartite graphs. In (APPROX-RANDOM 2014), volume 28 of LIPIcs, pages 284–296, 2014. [11] Tobias Mömke and Ola Svensson. Removing and Adding Edges for the Traveling Salesman Problem. J. ACM 63(1): 2 (2016). Preliminary version appeared in FOCS 2011: pages 560–569, 2011. [12] Marcin Mucha. 13/9 -approximation for graphic TSP. Theory Comput. Syst., 55(4):640–657, 2014. [13] András Sebő and Jens Vygen. Shorter tours by nicer ears: 7/5approximation for the graph-TSP, 3/2 for the path version, and 4/3 for two-edge-connected subgraphs. Combinatorica, 34(5):597–629, 2014. 4 Tightness of the Analysis of Algorithm 1 We give an example of a cubic bipartite graph G = (V, E) for which both the 2-factors F1 and F2 that result from Algorithm 1 have |V |/8 components. The instance has 48 nodes, numbered 1 through 48, and (V, F1 ) contains six cycles, four cycles of size 6, one cycle of size 10 and one cycle of size 14. 16 For brevity, we denote the cycles by only giving an ordered listing of their nodes; an edge between consecutive nodes and between the last and first node is implicit. The cycles in (V, F1 ) are: C1 = (1, 2, 3, 4, 5, 6), C2 = (7, 8, 9, 10, 11, 12), C3 = (13, 14, 15, 16, 17, 18), C4 = (19, 20, 21, 22, 23, 24), C5 = (25, 26, 27, 28, 29, 30, 31, 32, 33, 34), C6 = (35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48). The second 2-factor (V, F2 ) has six cycles as well, namely, three cycles of size 6 and three cycles of size 10. We again denote the cycles by giving an ordered listing of the nodes, but now a semicolon between subsequent nodes indicates that the nodes are connected by an edge in F2 \ F1 , and a comma denotes that they are connected by an edge in F2 ∩ F1 . The cycles in (V, F2 ) are D1 = (6, 1; 30, 31; 42, 43; 28, 29; 40, 41; ), D4 = (18, 13; 38, 39; 44, 45; ), D2 = (48, 35; 10, 11; 4, 5; 8, 9; 2, 3; ), D5 = (24, 19; 26, 27; 32, 33; ), D3 = (34, 25; 16, 17; 22, 23; 14, 15; 20, 21; ), D6 = (12, 7; 36, 37; 46, 47; ). It is straightforward to verify that every node occurs in exactly one cycle in (V, F1 ) and exactly one cycle in (V, F2 ), and that each cycle in (V, F1 ) alternates edges in F1 \F2 and edges in F1 ∩F2 , and that each cycle in (V, F2 ) alternates edges in F2 ∩ F1 and edges in F2 \ F1 . Furthermore, each cycle Ci in (V, F1 ) has exactly two edges in a cycle D in (V, F2 ) of size exactly 10. Local Optimum Figure 3 depicts each of the six cycles Ci in (V, F1 ), together with the cycles Dj in (V, F2 ) that intersect the given cycle Ci . For any of the cycles Ci , replacing F2 by F2 △E(Ci ) does not decrease the number of components of (V, F2 ) for any cycle Ci , nor does the modification of F2 for a chorded cycle described in Algorithm 1. Hence, if, rather than following Algorithm 1, we would execute one of the two possible modifications of F2 suggested by the algorithm, as long as this reduced the number of components of (V, F2 ), then the 2-factor F2 is in fact a local optimum with respect to this process since none of the possible modifications reduces the number of components. 17 We note that the instance does have a Hamilton cycle. This cycle contains subpaths of more than two adjacent edges in E \ F1 , so it can never be found from F1 and F2 using the “moves” we defined, even if we allow “moves” that do not reduce the number of components of (V, F2 ). We give the Hamilton cycle by again giving an ordered listing of the nodes, where a semicolon between subsequent nodes indicates that the nodes are connected by an edge in E \ F1 , and a comma denotes that they are connected by an edge in F1 . (1; 30, 29; 40, 39, 38; 13, 14, 15, 16; 25, 26; 19, 20, 21; 34, 33; 24, 23, 22; 17, 18; 45, 44, 43; 28, 27; 32, 31; 42, 41; 6, 5; 8, 7, 12, 11; 4, 3; 48, 47, 46; 37, 36, 35; 10, 9; 2, 1). 18 42 31 1 30 2 3 36 48 43 7 8 3 5 4 8 28 46 10 40 6 41 5 13 38 4 14 15 48 47 11 20 21 12 11 19 26 39 20 14 34 17 17 16 16 32 25 25 16 24 33 26 27 28 29 23 22 17 40 23 41 19 43 24 42 14 6 15 4 34 25 22 22 21 35 15 44 18 10 27 23 45 2 37 35 9 29 9 11 20 10 21 35 34 36 33 37 32 38 31 39 30 40 1 41 6 5 1 7 13 29 12 18 28 8 30 9 2 3 48 47 46 45 44 43 42 31 Figure 3: Depicted are six figures, one for each cycle Ci in (V, F1 ) for i = 1, . . . , 6. The white nodes are the nodes in the cycle Ci , and the dashed edges are the edges in F1 \ E(Ci ). The non-dashed and thick dashed edges are edges in F2 . For each Ci , the number of components of (V, F2 ) does not decrease by replacing F2 by F2 △E(Ci ). 19
8cs.DS
Optimal power dispatch in networks of high-dimensional models of synchronous machines arXiv:1603.06688v1 [math.OC] 22 Mar 2016 Tjerk Stegink and Claudio De Persis and Arjan van der Schaft Abstract— This paper investigates the problem of optimal frequency regulation of multi-machine power networks where each synchronous machine is described by a sixth order model. By analyzing the physical energy stored in the network and the generators, a port-Hamiltonian representation of the multimachine system is obtained. Moreover, it is shown that the openloop system is passive with respect to its steady states which implies that passive controllers can be used to control the multimachine network. As a special case, a distributed consensus based controller is designed that regulates the frequency and minimizes a global quadratic generation cost in the presence of a constant unknown demand. In addition, the proposed controller allows freedom in choosing any desired connected undirected weighted communication graph. I. INTRODUCTION The control of power networks has become increasingly challenging over the last decades. As renewable energy sources penetrate the grid, the conventional power plants have more difficulty in keeping the frequency around the nominal value, e.g. 50 Hz, leading to an increased chance of a network failure of even a blackout. The current developments require that more advanced models for the power network must be established as the grid is operating more often near its capacity constraints. Considering high-order models of, for example, synchronous machines, that better approximate the reality allows us to establish results on the control and stability of power networks that are more reliable and accurate. At the same time, incorporating economic considerations in the power grid has become more difficult. As the scale of the grid expands, computing the optimal power production allocation in a centralized manner as conventionally is done is computationally expensive, making distributed control far more desirable compared to centralized control. In addition, often exact knowledge of the power demand is required for computing the optimal power dispatch, which is unrealistic in practical applications. As a result, there is an increased desire for distributed real-time controllers which are able to compensate for the uncertainty of the demand. In this paper, we propose an energy-based approach for the modeling, analysis and control of the power grid, both for This work is supported by the NWO (Netherlands Organisation for Scientific Research) programme Uncertainty Reduction in Smart Energy Systems (URSES) under the auspices of the project ENBARK. T.W. Stegink and C. De Persis are with the Engineering and Technology institute Groningen (ENTEG), University of Groningen, the Netherlands. {t.w.stegink, c.de.persis}@rug.nl A.J. van der Schaft is with the Johann Bernoulli Institute for Mathematics and Computer Science, University of Groningen, Nijenborgh 9, 9747 AG Groningen, the Netherlands. [email protected] the physical network as well as for the distributed controller design. Since energy is the main quantity of interest, the portHamiltonian framework is a natural approach to deal with the problem. Moreover, the port-Hamiltonian framework lends itself to deal with complex large-scale nonlinear systems like power networks [5], [12], [13]. The emphasis in the present paper lies on the modeling and control of (networked) synchronous machines as they play an important role in the power network since they are the most flexible and have to compensate for the increased fluctuation of power supply and demand. However, the full-order model of the synchronous machine as derived in many power engineering books like [2], [6], [8] is difficult to analyze, see e.g. [5] for a port-Hamiltonian approach, especially when considering multi-machine networks [4], [9]. Moreover, it is not necessary to consider the full-order model when studying electromechanical dynamics [8]. On the other hand of the spectrum, many of the recent optimal controllers in power grids that deal with optimal power dispatch problems rely on the second-order (non)linear swing equations as the model for the power network [7], [11], [16], [17], or the third-order model as e.g. in [14]. However, the swing equations are inaccurate and only valid on a specific time scale up to the order of a few seconds so that asymptotic stability results are often invalid for the actual system [2], [6], [8]. Hence, it is appropriate to make simplifying assumptions for the full-order model and to focus on multi-machine models with intermediate complexity which provide a more accurate description of the network compared to the secondand third-order models [2], [6], [8]. However, for the resulting intermediate-order multi-machine models the stability analysis is often carried out for the linearized system, see [1], [6], [8]. Consequently, the stability results are only valid around a specific operating point. Our approach is different as the nonlinear nature of the power network is preserved. More specifically, in this paper we consider a nonlinear sixth-order reduced model of the synchronous machine that enables a quite accurate description of the power network while allowing us to perform a rigorous analysis. In particular, we show that the port-Hamiltonian framework is very convenient when representing the dynamics of the multi-machine network and for the stability analysis. Based on the physical energy stored in the generators and the transmission lines, a port-Hamiltonian representation of the multi-machine power network can be derived. More specifically, while the system dynamics is complex, the in- terconnection and damping structure of the port-Hamiltonian system is sparse and, importantly, state-independent. The latter property implies shifted passivity of the system [15] which respect to its steady states which allows the usage of passive controllers that steer the system to a desired steady state. As a specific case, we design a distributed realtime controller that regulates the frequency and minimizes the global generation cost without requiring any information about the unknown demand. In addition, the proposed controller design allows us to choose any desired undirected weighted communication graph as long as the underlying topology is connected. The main contribution of this paper is to combine distributed optimal frequency controllers with a high-order nonlinear model of the power network, which is much more accurate compared to the existing literature, to prove asymptotic stability to the set of optimal points by using Lyapunov function based techniques. The rest of the paper is organized as follows. In Section II the preliminaries are stated and a sixth order model of a single synchronous machine is given. Next, the multimachine model is derived in Section III. Then the energy functions of the system are derived in Section IV, which are used to represent the multi-machine system in portHamiltonian form, see Section V. In Section VI the design of the distributed controller is given and asymptotic stability to the set of optimal points is proven. Finally, the conclusions and possibilities for future research are discussed in Section VII. II. PRELIMINARIES Consider a power grid consisting of n buses. The network is represented by a connected and undirected graph G = (V, E), where the set of nodes, V = {1, ..., n}, is the set of buses and the set of edges, E = {1, ..., m} ⊂ V × V, is the set of transmission lines connecting the buses. The ends of edge l ∈ E are arbitrary labeled with a ‘+’ and a ‘-’, so that the incidence matrix D of the network is given by   +1 if i is the positive end of l Dil = −1 if i is the negative end of l (1)   0 otherwise. Each bus represents a synchronous machine and is assumed to have controllable mechanical power injection and a constant unknown power load. The dynamics of each synchronous machine i ∈ V is assumed to be given by [8] Mi ω̇i = Pmi − Pdi − Vdi Idi − Vqi Iqi δ̇i 0 0 Tdi Ėqi 0 0 Tqi Ėdi 00 00 Tdi Ėqi 00 00 Tqi Ėdi see also Table I. 0 0 = −Edi − (Xqi − Xqi )Iqi 0 00 0 00 = Eqi − Eqi + (Xdi − Xdi )Idi 0 00 0 00 = Edi − Edi − (Xqi − Xqi )Iqi , rotor angle w.r.t. synchronous reference frame frequency deviation mechanical power injection power demand moment of inertia synchronous reactances transient reactances subtransient reactances exciter emf/voltage internal bus transient emfs/voltages internal bus subtransient emfs/voltages external bus voltages generator currents open-loop transient time-scales open-loop subtransient time-scales TABLE I M ODEL PARAMETERS AND VARIABLES . Assumption 1: When using model (2), we make the following simplifying assumptions [8]: • • • • The frequency of each machine is operating around the synchronous frequency. The stator winding resistances are zero. The excitation voltage Ef i is constant for all i ∈ V. 00 The subtransient saliency is negligible, i.e. Xdi = 00 Xqi , ∀i ∈ V. The latter assumption is valid for synchronous machines with damper windings in both the d and q axes, which is the case for most synchronous machines [8]. It is standard in the power system literature to represent the equivalent synchronous machine circuits along the dqaxes as in Figure 1, [6], [8]. Here we use the conventional 00 00 00 00 00 00 +jEdi where E qi := phasor notation E i = E qi +E di = Eqi 00 00 00 Eqi , E di := jEdi , and the phasors I i , V i are defined likewise [8], [10]. Remark that internal voltages Eq0 , Ed0 , Eq00 , Ed00 as depicted in Figure 1 are not necessarily at steady state but are governed by (2), where it should be noted that, by definition, the reactances of a round rotor synchronous machine satisfy 0 00 0 00 Xdi > Xdi > Xdi > 0, Xqi > Xqi > Xqi > 0 for all i ∈ V [6], [8]. By Assumption 1 the stator winding resistances are negligible so that synchronous machine i can be represented by a subtransient emf behind a subtransient reactance, see Figure 2 [6], [8]. As illustrated in this figure, the internal and external voltages are related to each other by [8] 00 00 E i = V i + jXdi I i, i ∈ V. (3) III. MULTI-MACHINE MODEL = ωi 0 0 = Ef i − Eqi + (Xdi − Xdi )Idi δi ωi Pmi Pdi Mi Xqi , Xdi 0 , X0 Xqi di 00 , X 00 Xdi qi Ef i 0 , E0 Eqi di 00 , E 00 Eqi di Vqi , Edi Iqi , Idi 0 ,T0 Tqi di 00 , T 00 Tqi di (2) Consider n synchronous machines which are interconnected by RL-transmission lines and assume that the network is operating at steady state. As the currents and voltages of each synchronous machine is expressed w.r.t. its local dqreference frame, the network equations are written as [10] 00 I = diag(e−jδi )Y diag(ejδi )E . (4) j(Xd − Xd0 ) Td0 Ef j(Xd0 − Xd00 ) 0 Eq jXd00 00 Td00 Id Vq Eq To simplify the analysis further, we assume that the network resistances are negligible so that G = 0. By equating the real and imaginary part of (4) we obtain the following expressions for the dq-currents entering generator i ∈ V: X   00 00 00 Bik (Edk Idi = Bii Eqi − sin δik + Eqk cos δik ) , k∈Ni j(Xq − Xq0 ) Tq0 j(Xq0 − Xq00 ) 0 Ed jXq00 00 Tq00 Ed Iqi = Iq Vd Fig. 1: Generator equivalent circuits for both dq-axes [8]. For aesthetic reasons the subscript i is dropped. 00 jXdi 00 Ei Vi that D is the incidence matrix of the network defined by (1). 00 Ei jXT Vi Il X   00 00 Bik (Eqk sin δik − Edk cos δik ) , k∈Ni IV. ENERGY FUNCTIONS −1 T Here the admittance matrix1 Y := D(R + jX)P D satisfies YP ik = −Gik − jBik and Yii = Gii + jBii = k∈Ni Gik + j k∈Ni Bik where G denotes the conductance and B ∈ Rn×n denotes the susceptance of the network [10]. In ≤0 addition, Ni denotes the set of neighbors of node i. Remark 1: As the electrical circuit depicted in Figure 2 is 00 in steady state (3), the reactance Xdi can also be considered as part of the network (an additional inductive line) and is therefore implicitly included into the network admittance matrix Y, see also Figure 3. 00 jXdi − (5) where δik := δi − δk . By substituting (5) and (3) into (2) we obtain after some rewriting a sixth-order multi-machine model given by equation (6), illustrated at the top of the next page. Remark 2: Since the transmission lines are purely inductive by assumption, there are no energy losses in the transmission lines implying that the following energy conserP ∗ vation law holds: i∈V Pei = 0 where Pei = Re(E i I i ) = 00 00 Edi Idi + Eqi Iqi is the electrical power produced by synchronous machine i. Ii Fig. 2: Subtransient emf behind a subtransient reactance. 1 Recall 00 −Bii Edi 00 jXdk 00 V k Ek Fig. 3: Interconnection of two synchronous machines by a purely inductive transmission line with reactance XT . When analyzing the stability of the multi-machine system one often searches for a suitable Lyapunov function. A natural starting point is to consider the physical energy as a candidate Lyapunov function. Moreover, when we have an expression for the energy, a port-Hamiltonian representation of the associated multi-machine model (6) can be derived, see Section V. Remark 3: It is convenient in the definition of the Hamiltonian to multiply the energy stored in the synchronous machine and the transmission lines by the synchronous frequency ωs since a factor ωs−1 appears in each of the energy functions. As a result, the Hamiltonian has the dimension of power instead of energy. Nevertheless, we still refer to the Hamiltonian as the energy function in the sequel. In the remainder of this section we will first identify the electrical and mechanical energy stored in each synchronous machine. Next, we identify the energy stored in the transmission lines. A. Synchronous Machine 1) Electrical Energy: Note that, at steady state, the energy (see Remark 3) stored in the first two reactances2 of generator i as illustrated in Figure 1 is given by ! 0 0 00 2 − Ef i )2 (Eqi − Eqi ) 1 (Eqi Hedi = + 0 0 − X 00 2 Xdi − Xdi Xdi di ! (7) 0 2 0 00 2 1 (Edi ) (Edi − Edi ) Heqi = . 0 + X 0 − X 00 2 Xqi − Xqi qi qi Remark 4: The energy stored in the third (subtransient) reactance will be considered as part of the energy stored in the transmission lines, see also Remark 1 and Section IV-B. 2 In both the d- and the q-axes. Mi ∆ω̇i = Pmi − Pdi + X k∈Ni h i 00 00 00 00 00 00 00 00 Bik (Edi Edk + Eqi Eqk ) sin δik + (Edi Eqk − Eqi Edk ) cos δik δ̇i = ∆ωi 0 0 0 0 00 Tdi Ėqi = Ef i − Eqi + (Xdi − Xdi )(Bii Eqi − 0 0 Tqi Ėdi = 0 −Edi + (Xqi − 0 00 Xqi )(Bii Edi = 0 Edi − 00 Edi + 0 (Xqi − 00 00 Xqi )(Bii Edi B. Inductive Transmission Lines Consider an interconnection between two SG’s with a purely inductive transmission line (with reactance XT ) at steady state, see Figure 3. When expressed in the local dqreference frame of generator i, we observe from Figure 3 that at steady state one obtains3 00 jXl I l = E i − e−jδik E k , (8) where the total reactance between the internal buses of 00 00 generator i and k is given by Xl := Xdi + XT + Xdk . Note that at steady state the modified energy of the inductive transmission line l between nodes i and k is given by ∗ Hl = 21 Xl I l I l , which by (8) can be rewritten as   1 00 00 00 00 Hl = − Bik 2 Edi Eqk − Edk Eqi sin δik 2  00 00 00 00 (9) −2 Edi Edk + Eqi Eqk cos δik  002 002 002 002 +Edi + Edk + Eqi + Eqk , where the line susceptance satisfies Bik = − X1l < 0 [10]. C. Total Energy The total physical energy of the multi-machine system is equal to the sum of the individual energy functions: X X Hp = (Hdei + Hqei + Hmi ) + Hl . (10) i∈V (6) k∈Ni 2) Mechanical Energy: The kinetic energy of synchronous machine i is given by 1 1 Hmi = Mi ωi2 = Mi−1 p2i , 2 2 where pi = Mi ωi is the angular momentum of synchronous machine i with respect to the synchronous rotating reference frame. 00 k∈N X  i  00 00 Bik (Edk − cos δik − Eqk sin δik ) ) 00 00 0 00 0 00 00 Tdi Ėqi = Eqi − Eqi + (Xdi − Xdi )(Bii Eqi − 00 00 Tqi Ėdi X   00 00 Bik (Edk sin δik + Eqk cos δik ) ) l∈E V. PORT-HAMILTONIAN REPRESENTATION Using the energy functions from the previous section, the multi-machine model (6) can be put into a port-Hamiltonian form. To this end, we derive expressions for the gradient of each energy function. 3 The mapping from dq-reference frame k to dq-reference frame i in the phasor domain is done by multiplication of e−jδik [10]. − X   00 00 Bik (Edk sin δik + Eqk cos δik ) ) k∈Ni X   00 00 Bik (Edk cos δik − Eqk sin δik ) ) k∈Ni A. Transmission Line Energy Recall that the energy stored in transmission line l between internal buses i and k is given by (9). It can P be verified that the gradient of the total energy HL := l∈E Hl stored in the transmission lines takes the form  ∂HL      00 E 00 Idi + Eqi Iqi Pei ∂δi  ∂H00L   di  =  Idi  , Idi  ∂Eqi  = ∂HL Iqi Iqi 00 ∂Edi where Idi , Iqi are given by P (5). Here it is used that the selfsusceptances satisfy Bii = k∈Ni Bik for all i ∈ V. 1) State transformation: In the sequel, it is more convenient to consider a different set of variable describing the voltage angle differences. Define for each edge l ∈ E ηl := δik where i, k are respectively the positive and negative ends of l. In vector form we obtain η = DT δ ∈ Rm , and observe that this implies D ∂HL ∂Hp =D = Pe . ∂η ∂η B. Electrical Energy SG Further, notice that the electrical energy stored in the equivalent circuits along the d- and q-axis of generator i is given by (7) and satisfies  " ∂Hedi #  0   0 0 0 Eqi − Ef i Xdi − Xdi Xdi − Xdi ∂Eqi = 0 00 00 0 ∂Hedi 0 Xdi − Xdi Eqi − Eqi 00 ∂Eqi " #   ∂Heqi   0 0 0 0 Xqi − Xqi Xqi − Xqi Edi ∂Edi . 0 00 00 0 ∂Heqi = 0 Xqi − Xqi Edi − Edi ∂E 00 di By the previous observations, and by aggregating the states, the dynamics of the multi-machine system can now be written in the form (11) where the Hamiltonian is given 0 0 0 00 by (10) and X̂di := Xdi − Xdi , X̂di := Xdi − Xdi , X̂d = 0 0 diagi∈V {X̂di } and X̂d , X̂q , X̂q are defined likewise. In addi0 tion, Td0 = diagi∈V {Tdi } and Td0 , Tq , Tq0 are defined similarly. Observe that the multi-machine system (11) is of the form ẋ = (J − R)∇H(x) + gu y = g T ∇H(x) (12) −D 0 0 0 0 0 0 −(Td0 )−1 X̂d 0 0 0 −(Tq0 )−1 X̂q 0 0 0 0 0 0 0  T g= I 0 0 0 0 0 .   0 ṗ  η̇  DT  0   Ėq   0   ẋp =   Ė 0  =  0  d  Ė 00   0  q Ėd00 y = g T ∇Hp , where J = −J T , R = RT are respectively the antisymmetric and symmetric part of the matrix depicted in (11). Notice that the dissipation matrix of the electrical part is positive definite (which implies R ≥ 0) if   0 X −X 0 Xdi −Xdi 2 diT 0 di 0 Tdi di  ∀i ∈ V, 0 0 00  > 0, Xdi −Xdi Xdi −Xdi 2 T0 T 00 di di which, by invoking the Schur complement, holds if and only if 0 00 0 0 00 4(Xdi − Xdi )Tdi − (Xdi − Xdi )Tdi > 0, ∀i ∈ V. (13) Note that a similar condition holds for the q-axis. Proposition 1: Suppose that for all i ∈ V the following holds: 0 00 0 4(Xdi − Xdi )Tdi − (Xdi 0 00 0 4(Xqi − Xqi )Tqi − (Xqi 0 00 − Xdi )Tdi 0 00 − Xqi )Tqi >0 > 0. (14) Then (11) is a port-Hamiltonian representation of the multimachine network (6). It should be stressed that (14) is not a restrictive assumption 00 0 00 , Tqi   Tdi as it holds for a typical generator since Tdi 0 Tqi , see also Table 4.2 of [6] and Table 4.3 of [8]. Because the interconnection and damping structure J − R of (11) is state-independent, the shifted Hamiltonian H̄(x) = H(x) − (x − x̄)T ∇H(x̄) − H(x̄) (15) acts as a local storage function for proving passivity in a neighborhood of a steady state x̄ of (12), provided that the Hessian of H evaluated at x̄ (denoted as ∇2 H(x̄)) is positive definite4 . Proposition 2: Let ū be a constant input and suppose there exists a corresponding steady state x̄ to (12) such that ∇2 H(x̄) > 0. Then the system (12) is passive in a neighborhood of x̄ with respect to the shifted external portvariables ũ := u − ū, ỹ := y − ȳ where ȳ := g T ∇H(x̄). Proof: Define the shifted Hamiltonian by (15), then we obtain ẋ = (J − R)∇H(x) + gu = (J − R)(∇H̄(x) + ∇H(x̄)) + gu = (J − R)∇H̄(x) + g(u − ū) = (J − R)∇H̄(x) + gũ ỹ = y − ȳ = g T (∇H(x) − ∇H(x̄)) = g T ∇H̄(x). 4 Observe that ∇2 H(x) = ∇2 H̄(x) for all x. (16) 0 0 −(Td0 )−1 X̂d 0 00 −1 0 −(Td ) X̂d 0  0  0   0  ∇Hp + g(Pm − Pd ), −(Tq0 )−1 X̂q    0 00 −1 0 −(Tq ) X̂q (11) As ∇2 H(x̄) > 0 we have that H̄(x̄) = 0 and H̄(x) > 0 for all x 6= x̄ in a sufficiently small neighborhood around x̄. Hence, by (16) the passivity property automatically follows where H̄ acts as a local storage function. VI. MINIMIZING GENERATION COSTS The objective is to minimize the total quadratic generation cost while achieving zero frequency deviation. By analyzing the steady states of (6), it follows that a necessary condition for zero frequency deviation is 1T Pm = 1T Pd , i.e., the total supply must match the total demand. Therefore, consider the following convex minimization problem: 1 T P QPm 2 m s.t. 1T Pm = 1T Pd , min Pm (17) where Q = QT > 0 and Pd is a constant unknown power load. Remark 5: Note that that minimization problem (17) is easily extended to quadratic cost functions of the form 1 T T n 2 Pm QPm + b Pm for some b ∈ R . Due to space limitations, this extension is omitted. As the minimization problem (17) is convex, it follows that Pm is an optimal solution if and only if the KarushKuhn-Tucker conditions are satisfied [3]. Hence, the optimal points of (17) are characterized by ∗ Pm = Q−1 1λ∗ , λ∗ = 1 T Pd T 1 Q−1 1 (18) Next, based on the design of [14], consider a distributed controller of the form T θ̇ = −Lc θ − Q−1 ω Pm = Q−1 θ − Kω (19) where T = diagi∈V {Ti } > 0, K = diagi∈V {ki } > 0 are controller parameters. In addition, Lc is the Laplacian matrix of some connected undirected weighted communication graph. The controller (19) consists of three parts. Firstly, the term −Kω corresponds to a primary controller and adds damping into the system. The term −Q−1 ω corresponds to secondary control for guaranteeing zero frequency deviation on longer time-scales. Finally, the term −Lc θ corresponds to tertiary control for achieving optimal production allocation over the network. Note that (19) admits the port-Hamiltonian representation ϑ̇ = −Lc ∇Hc − Q−1 ω Pm = Q−1 ∇Hc − Kω, Hc = 1 T −1 ϑ T ϑ, 2 (20) where ϑ := T θ. By interconnecting the controller (20) with (11), the closed-loop system amounts to       ẋp g J − R − RK GT = ∇H − P 0 d −G −Lc ϑ̇ (21)  −1  0 0 0 0 0 G= Q where J − R is given as in (11), H := Hp + Hc , and RK = blockdiag(0, K, 0, 0, 0, 0). Define the set of steady states of (21) by Ω and observe that any x := (xp , ϑ) ∈ Ω satisfies the optimality conditions (18) and ω = 0. Assumption 2: Ω 6= ∅ and there exists x̄ ∈ Ω such that ∇2 H(x̄) > 0. Remark 6: While the Hessian condition of Assumption 2 is required for proving local asymptotic stability of (21), guaranteeing that this condition holds can be bothersome. However, while we omit the details, it can be shown that ∇2 H(x̄) > 0 if the generator reactances are small compared to the transmission line reactances. • the subtransient voltage differences are small. • the rotor angle differences are small. Theorem 1: Suppose Pd is constant and there exists x̄ ∈ Ω such that Assumption 2 is satisfied. Then the trajectories of the closed-loop system (21) initialized in a sufficiently small neighborhood around x̄ converge to the set of optimal points Ω. Proof: Observe by (16) that the shifted Hamiltonian defined by (15) satisfies • H̄˙ = −(∇H̄)T blockdiag(R + RK , Lc )∇H̄ ≤ 0 where equality holds if and only if ω = 0, T −1 ϑ = θ = 1θ∗ for some θ∗ ∈ R, and ∇E H̄(x) = ∇E H(x) = 0. Here ∇E H(x) is the gradient of H with respect to the internal voltages Eq0 , Ed0 , Eq00 , Ed00 . By Assumption 2 there exists a compact neighborhood Υ around x̄ which is forward invariant. By invoking LaSalle’s invariance principle, trajectories initialized in Υ converge to the largest invariant set where H̄˙ = 0. On this set ω, η, θ, Eq0 , Ed0 , Eq00 , Ed00 are constant and, T more specifically, ω = 0, θ = 1λ∗ = 1 1T1QP−1d 1 corresponds to an optimal point of (17) as Pm = Q−1 1λ∗ where λ∗ is defined in (18). We conclude that the trajectories of the closed-loop system (21) initialized in a sufficiently small neighborhood around x̄ converge to the set of optimal points Ω. Remark 7: While by Theorem 1 the trajectories of the closed-loop system (21) converge to the set of optimal points, it may not necessarily converge to a unique steady state as the closed-loop system (21) may have multiple (isolated) steady states. VII. CONCLUSIONS We have shown that a much more advanced multi-machine model than conventionally used can be analyzed using the port-Hamiltonian framework. Based on the energy functions of the system, a port-Hamiltonian representation of the model is obtained. Moreover, the system is proven to be incrementally passive which allows the use of a passive controller that regulates the frequency in an optimal manner, even in the presence of an unknown constant demand. The results established in this paper can be extended in many possible ways. Current research has shown that the third, fourth and fifth order model as given in [8] admit a similar port-Hamiltonian structure as (11). It is expected that the same controller as designed in this paper can also be used in these lower order models. While the focus in this paper is about (optimal) frequency regulation, further effort is required to investigate the possibilities of (optimal) voltage control using passive controllers. Another extension is to include transmission line resistances of the network. Finally, one could look at the possibility to extend the results to the case where inverters and frequency dependent loads are included into the network as well. R EFERENCES [1] F. Alvarado, J. Meng, C. DeMarco, and W. Mota. Stability analysis of interconnected power systems coupled with market dynamics. IEEE Transactions on Power Systems, 16(4):695–701, November 2001. [2] P. Anderson and A. Fouad. Power System Control and Stability. The Iowa State Univsersity Press, first edition, 1977. [3] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, first edition, 2004. [4] S. Caliskan and P. Tabuada. Compositional transient stability analysis of multimachine power networks. IEEE Transactions on Control of Network systems, 1(1):4–14, 2014. [5] S. Fiaz, D. Zonetti, R. Ortega, J. Scherpen, and A. van der Schaft. A port-Hamiltonian approach to power network modeling and analysis. European Journal of Control, 19(6):477–485, December 2013. [6] P. Kundur. Power System Stability and Control. Mc-Graw-Hill Engineering, 1993. [7] N. Li, L. Chen, C. Zhao, and S. H. Low. Connecting automatic generation control and economic dispatch from an optimization view. In American Control Conference, pages 735–740. IEEE, 2014. [8] J. Machowski, J. Bialek, and J. Bumby. Power System Dynamics: Stability and Control. John Wiley & Sons, Ltd, second edition, 2008. [9] R. Ortega, M. Galaz, A. Astolfi, Y. Sun, and T. Shen. Transient stabilization of multimachine power systems with nontrivial transfer conductances. Automatic Control, IEEE Transactions on, 50(1):60–75, 2005. [10] J. Schiffer, D. Zonetti, R. Ortega, A. Stankovic, T. Sezi, and J. Raisch. Modeling of microgrids-from fundamental physics to phasors and voltage sources. arXiv preprint arXiv:1505.00136, 2015. [11] Y. Seungil and C. Lijun. Reverse and forward engineering of frequency control in power networks. In Proc. of IEEE Conference on Decision and Control, Los Angeles, CA, USA, 2014. [12] T. Stegink, C. De Persis, and A. van der Schaft. A port-Hamiltonian approach to optimal frequency regulation in power grids. arXiv preprint arXiv:1509.07318, 2015. [13] T. Stegink, C. De Persis, and A. van der Schaft. Port-Hamiltonian formulation of the gradient method applied to smart grids. In 5th IFAC Workshop on Lagrangian and Hamiltonian Methods for Non Linear Control, Lyon, France, July 2015. [14] S. Trip, M. Bürger, and C. De Persis. An internal model approach to (optimal) frequency regulation in power grids with time-varying voltages. Automatica, 64:240–253, 2016. [15] A. van der Schaft and D. Jeltsema. Port-Hamiltonian systems theory: An introductory overview. Foundations and Trends in Systems and Control, 1(2-3):173–378, 2014. [16] X. Zhang and A. Papachristodoulou. A real-time control framework for smart power networks: Design methodology and stability. Automatica, 58:43–50, 2015. [17] C. Zhao, E. Mallada, and S. Low. Distributed generator and loadside secondary frequency control in power networks. In 49th Annual Conference on Information Sciences and Systems (CISS), pages 1–6. IEEE, 2015.
3cs.SY
Neural Domain Adaptation for Biomedical Question Answering Georg Wiese1,2 , Dirk Weissenborn2 and Mariana Neves1 1 Hasso Plattner Institute, August Bebel Strasse 88, Potsdam 14482 Germany 2 Language Technology Lab, DFKI, Alt-Moabit 91c, Berlin, Germany [email protected], [email protected], [email protected] Abstract arXiv:1706.03610v2 [cs.CL] 15 Jun 2017 Factoid question answering (QA) has recently benefited from the development of deep learning (DL) systems. Neural network models outperform traditional approaches in domains where large datasets exist, such as SQuAD (≈ 100, 000 questions) for Wikipedia articles. However, these systems have not yet been applied to QA in more specific domains, such as biomedicine, because datasets are generally too small to train a DL system from scratch. For example, the BioASQ dataset for biomedical QA comprises less then 900 factoid (single answer) and list (multiple answers) QA instances. In this work, we adapt a neural QA system trained on a large open-domain dataset (SQuAD, source) to a biomedical dataset (BioASQ, target) by employing various transfer learning techniques. Our network architecture is based on a state-of-theart QA system, extended with biomedical word embeddings and a novel mechanism to answer list questions. In contrast to existing biomedical QA systems, our system does not rely on domain-specific ontologies, parsers or entity taggers, which are expensive to create. Despite this fact, our systems achieve state-of-the-art results on factoid questions and competitive results on list questions. 1 Introduction Question answering (QA) is the task of retrieving answers to a question given one or more contexts. It has been explored both in the opendomain setting (Voorhees et al., 1999) as well as domain-specific settings, such as BioASQ for the biomedical domain (Tsatsaronis et al., 2015). The BioASQ challenge provides ≈ 900 factoid and list questions, i.e., questions with one and several answers, respectively. This work focuses on answering these questions, for example: Which drugs are included in the FEC-75 regimen? → fluorouracil, epirubicin, and cyclophosphamide. We further restrict our focus to extractive QA, i.e., QA instances where the correct answers can be represented as spans in the contexts. Contexts are relevant documents which are provided by an information retrieval (IR) system. Traditionally, a QA pipeline consists of namedentity recognition, question classification, and answer processing steps (Jurafsky, 2000). These methods have been applied to biomedical datasets, with moderate success (Zi et al., 2016). The creation of large-scale, open-domain datasets such as SQuAD (Rajpurkar et al., 2016) have recently enabled the development of neural QA systems, e.g., Wang and Jiang (2016), Xiong et al. (2016), Seo et al. (2016), Weissenborn et al. (2017), leading to impressive performance gains over more traditional systems. However, creating large-scale QA datasets for more specific domains, such as the biomedical, would be very expensive because of the need for domain experts, and therefore not desirable. The recent success of deep learning based methods on open-domain QA datasets raises the question whether the capabilities of trained models are transferable to another domain via domain adaptation techniques. Although domain adaptation has been studied for traditional QA systems (Blitzer et al., 2007) and deep learning systems (Chen et al., 2012; Ganin et al., 2016; Bousmalis et al., 2016; Riemer et al., 2017; Kirkpatrick et al., 2017), it has to our knowledge not yet been applied for end-to-end neural QA systems. To bridge this gap we employ various do- main adaptation techniques to transfer knowledge from a trained, state-of-the-art neural QA system (FastQA, Weissenborn et al. (2017)) to the biomedical domain using the much smaller BioASQ dataset. In order to answer list questions in addition to factoid questions, we extend FastQA with a novel answering mechanism. We evaluate various transfer learning techniques comprehensively. For factoid questions, we show that mere fine-tuning reaches state-of-the-art results, which can further be improved by a forgetting cost regularization (Riemer et al., 2017). On list questions, the results are competitive to existing systems. Our manual analysis of a subset of the factoid questions suggests that the results are even better than the automatic evaluation states, revealing that many of the ”incorrect” answers are in fact synonyms to the gold-standard answer. 2 Related Work Traditional Question Answering Traditional factoid and list question answering pipelines can be subdivided into named-entity recognition, question classification, and answer processing components (Jurafsky, 2000). Such systems have also been applied to biomedical QA such as the OAQA system by Zi et al. (2016). Besides a number of domain-independent features, they incorporate a rich amount of biomedical resources, including a domain-specific parser, entity tagger and thesaurus to retrieve concepts and synonyms. A logistic regression classifier is used both for question classification and candidate answer scoring. For candidate answer generation, OAQA employs different strategies for general factoid/list questions, choice questions and quantity questions. Neural Question Answering Neural QA systems differ from traditional approaches in that the algorithm is not subdivided into discrete steps. Instead, a single model is trained end-to-end to compute an answer directly for a given question and context. The typical architecture of such systems (Wang and Jiang, 2016; Xiong et al., 2016; Seo et al., 2016) can be summarized as follows: 1. Embedding Layer: Question and context tokens are mapped to a high-dimensional vector space, for example via GloVe embeddings (Pennington et al., 2014) and (optionally) character embeddings (Seo et al., 2016). 2. Encoding Layer: The token vectors are processed independently for question and context, usually by a recurrent neural network (RNN). 3. Interaction Layer: This layer allows for interaction between question and context representations. Examples are Match-LSTM (Wang and Jiang, 2016) and Coattention (Xiong et al., 2016). 4. Answer Layer: This layer assigns start and end scores to all of the context tokens, which can be done either statically (Wang and Jiang, 2016; Seo et al., 2016) or by a dynamic decoding process (Xiong et al., 2016). FastQA FastQA fits into this schema, but reduces the complexity of the architecture by removing the interaction layer, while maintaining state-of-the-art performance (Weissenborn et al., 2017). Instead of one or several interaction layers of RNNs, FastQA computes two simple wordin-question features for each token, which are appended to the embedding vectors before the encoding layer. We chose to base our work on this architecture because of its state-of-the-art performance, faster training time and reduced number of parameters. Unsupervised Domain Adaptation Unsupervised domain adaptation describes the task of learning a predictor in a target domain while labeled training data only exists in a different source domain. In the context of deep learning, a common method is to first train an autoencoder on a large unlabeled corpus from both domains and then use the learned input representations as input features to a network trained on the actual task using the labeled source domain dataset (Glorot et al., 2011; Chen et al., 2012). Another approach is to learn the hidden representations directly on the target task. For example, domain-adversarial training optimizes the network such that it computes hidden representations that both help predictions on the source domain dataset and are indistinguishable from hidden representations of the unlabeled target domain dataset (Ganin et al., 2016). These techniques cannot be straightforwardly applied to the question answering task, because they require a large corpus of biomedical question-context pairs (albeit no answers are required). Supervised Domain Adaptation In contrast to the unsupervised case, supervised domain adaptation assumes access to a small amount of labeled training data in the target domain. The simplest approach to supervised domain adaptation for neural models is to pre-train the network on data from the source domain and then fine-tune its parameters on data from the target domain. The main drawback of this approach is catastrophic forgetting, which describes the phenomenon that neural networks tend to ”forget” knowledge, i.e., its performance in the source domain drops significantly when they are trained on the new dataset. Even though we do not directly aim for good performance in the source domain, measures against catastrophic forgetting can serve as a useful regularizer to prevent over-fitting. Progressive neural networks combat this issue by keeping the original parameters fixed and adding new units that can access previously learned features (Rusu et al., 2016). Because this method adds a significant amount of new parameters which have to be trained from scratch, it is not well-suited if the target domain dataset is small. Riemer et al. (2017) use fine-tuning, but add an additional forgetting cost term that punishes deviations from predictions with the original parameters. Another approach is to add an L2 loss which punishes deviation from the original parameters. Kirkpatrick et al. (2017) apply this loss selectively on parameters which are important in the source domain. 3 Model Our network architecture is based on FastQA (Weissenborn et al., 2017), a state-of-the-art neural QA system. Because the network architecture itself is exchangeable, we treat it as a black box, with subtle changes at the input and output layer as well as to the decoding and training procedure. These changes are described in the following. See Figure 3 for an overview of the system. 3.1 Input Layer In a first step, words are embedded into a highdimensional vector space. We use three sources of embeddings, which are concatenated to form a single embedding vector: • GloVe embeddings: 300-dimensional GloVe vectors (Pennington et al., 2014). These are Start Probabilities pstart End Probabilitiesp(e|s) p(e|s) End End Probabilities Probabilities pend sigmoid softmax EndScores Scoresee(s)(s) End End Scores yend Start Scores ystart Extractive QA System Biomedical Embeddings ... ... GloVe Embeddings Character Embeddings Question Type Features Context Embeddings Question Embeddings Figure 1: Network architecture of our system for biomedical question answering. At its core, it uses an extractive neural QA system as a black box (we use FastQA (Weissenborn et al., 2017)). The embedding layer is modified in order to include biomedical word embeddings and question type features. The output layer is adjusted to add the ability to answer list questions in addition to factoid questions. open-domain word vectors trained on 840 billion tokens from web documents. The vectors are not updated during training. • Character embeddings: As used in FastQA (Weissenborn et al., 2017) and proposed originally by Seo et al. (2016), we employ a 1-dimensional convolutional neural network which computes word embeddings from the characters of the word. • Biomedical Word2Vec embeddings: 200dimensional vectors trained using Word2Vec (Mikolov et al., 2013) on about 10 million PubMed abstracts (Pavlopoulos et al., 2014). These vectors are specific to the biomedical domain and we expect them to help on biomedical QA. As an optional step, we add entity tag features to the token embeddings via concatenation. Entity tags are provided by a dictionary-based entity tagger based on the UMLS Metathesaurus. The entity tag feature vector is a 127-dimensional bit vector that for each of the UMLS semantic types states whether the current token is part of an entity of that type. This step is only applied if explicitly noted. Finally, a one-hot encoding of the question type (factoid or list) is appended to all the input vectors. With these embedding vectors as input, we invoke FastQA to produce start and end scores for each of the n context tokens. We denote start i scores by ystart and end scores conditioned on a i,j predicted start at position i by yend , with start index i ∈ [1, n] and end index j ∈ [i, n]. 3.2 Output Layer In our adapted output layer, we convert the start and end scores to span probabilities. The computation of these probabilities is independent of the question type. The interpretation, however, depends on the question type: While for factoid questions, the list of answer spans is interpreted as a ranked list of answer candidates, for list questions, answers above a certain probability threshold are interpreted as the set of answers to the question. 1 n Given the start scores ystart , ..., ystart and end i,n i,1 scores yend , ..., yend , we compute the start and end probabilities as follows: i pistart = σ(ystart ) i,· pi,· end = softmax(yend ) (1) (2) where σ(x) is the sigmoid function. As a consequence, multiple tokens can be chosen as likely start tokens, but the network is expected to select a single end token for a given start token, hence the softmax function. Finally, the probability that a given span (i, j) answers the question i,j i is pi,j span = pstart · pend . This extension generalizes the FastQA output layer such that multiple answer spans with different start positions can have a high probability, allowing us to retrieve multiple answers for list questions. 3.3 Decoding Given a trained model, start probabilities can be obtained by running a forward pass and computing the start probability as in Equation 1. For the top 20 starts, we compute the end probabilities as given by Eq. 2. From the start and end probabilities, we extract the top 20 answer spans ranked by pi,j span . As a simple post-processing step, we remove duplicate strings and retain only those with the highest probability. For factoid questions, we output the 5 most likely answer spans as our ranked list of answers. For list questions, we learn a probability cutoff threshold t that defines the set of list answers A = {(i, j)|pi,j span ≥ t}. We choose t to be the threshold that optimizes the list F1 score on the respective development set. 3.4 Domain Adaptation Fine-tuning Our training procedure consists of two phases: In the pre-training phase, we train the model on SQuAD, using a token F1 score as the training objective as by Weissenborn et al. (2017). We will refer to the resulting parameters as the base model. In the fine-tuning phase, we initialize the model parameters with the base model and then continue our optimization on the BioASQ dataset with a smaller learning rate. Forgetting Cost Regularization To avoid catastrophic forgetting during fine-tuning as a means to regularize our model, we optionally add an additional forgetting cost term Lf c , as proposed by Riemer et al. (2017). It is defined as the cross-entropy loss between the current predictions and the base model’s predictions. L2 Weight Regularization We also add an L2 loss term Ll2 which penalizes deviations from the base model’s parameters. Note that a more advanced approach would be to apply this loss selectively on weights which are particularly important in the source domain (Kirkpatrick et al., 2017). The final loss is computed as Lf inal = Loriginal + Cf c · Lf c + Cl2 · Ll2 where Cf c and Cl2 are hyperparameters which are set to 0 unless otherwise noted. 4 4.1 Experimental Setup Datasets SQuAD SQuAD (Rajpurkar et al., 2016) is a dataset of ≈ 100, 000 questions with relevant contexts and answers that sparked research interest into the development of neural QA systems recently. The contexts are excerpts of Wikipedia articles for which crowd-source workers generated questions-answer pairs. Because of the large amount of training examples in SQuAD, it lends itself perfectly as our source dataset. BioASQ The BioASQ challenge provides a biomedical QA dataset (Tsatsaronis et al., 2015) consisting of questions, relevant contexts (called snippets) from PubMed abstracts and possible answers to the question. It was carefully created with the help of biomedical experts. In this work, we focus on Task B, Phase B of the BioASQ challenge, in which systems must answer questions from gold-standard snippets. These questions can be either yes/no questions, summary questions, factoid questions, or list questions. Because we employ an extractive QA system, we restrict this study to answering factoid and list questions by extracting answer spans from the provided contexts. The 2017 BioASQ training dataset contains 1, 799 questions, of which 413 are factoid and 486 are list questions. The questions have ≈ 20 snippets on average, each of which are on average ≈ 34 tokens long. We found that around 65% of the factoid questions and around 92% of the list questions have at least one extractable answer. For questions with extractable answers, answers spans are computed via a simple substring search in the provided snippets. All other questions are ignored during training and treated as answered incorrectly during evaluation. 4.2 Training We minimize the cross-entropy loss for the gold standard answer spans. However, for multiple answer spans that refer to the same answer (e.g. synonyms), we only minimize the loss for the span of the lowest loss. We use the ADAM (Kingma and Ba, 2014) for optimization on SQuAD with a learning rate starting at 10−3 which is halved whenever performance drops between checkpoints. During the fine-tuning phase, we continue optimization on the BioASQ dataset with a smaller learning rate starting at 10−4 . During both phases, the model is regularized by variational dropout of rate 0.5 (Gal and Ghahramani, 2015). 4.3 Evaluation The official evaluation measures from BioASQ are mean reciprocal rank (MRR) for factoid questions and F1 score for list questions 1 . For factoid questions, the list of ranked answers can be at most five entries long. The F1 score is measured on the gold standard list elements. For both measures, 1 The details can be found at http:// participants-area.bioasq.org/Tasks/b/ eval_meas/ case-insensitive string matches are used to check the correctness of a given answer. A list of synonyms is provided for all gold-standard answers. If the system’s response matches one of them, the answer counts as correct. For evaluation, we use two different finetuning datasets, depending on the experiment: BioASQ3B, which contains all questions of the first three BioASQ challenges, and BioASQ4B which additionally contains the test questions of the fourth challenge. BioASQ4B is used as the training dataset for the fifth BioASQ challenge whereas BioASQ3B was used for training during the fourth challenge. Because the datasets are small, we perform 5fold cross-validation and report the average performance across the five folds. We use the larger BioASQ4B dataset except when evaluating the ensemble and when comparing to participating systems of previous BioASQ challenges. All models were implemented using TensorFlow (Abadi et al., 2016) with a hidden size of 100. Because the context in BioASQ usually comprises multiple snippets, they are processed independently in parallel for each question. Answers from all snippets belonging to a question are merged and ranked according to their individual probabilities. 5 5.1 Results Domain Adaptation In this section, we evaluate various domain adaptation techniques. The results of the experiments are summarized in Table 1. Baseline As a baseline without transfer learning, Experiment 1 trains the model on BioASQ only. Because the BioASQ dataset by itself is very small, a dropout rate of 0.7 was used, because it worked best in preliminary experiments. We observe a rather low performance, which is expected when applying deep learning to such a small dataset. Fine-tuning Experiments 2 and 3 evaluate the pure fine-tuning approach: Our base model is a system trained on SQuAD only and tested on BioASQ (Experiment 2). For Experiment 3, we fine-tuned the base model on the BioASQ4B training set. We observe that performance increases significantly, especially on list questions. This increase is expected, because the network is trained Experiment Factoid MRR List F1 (1) Training on BioASQ only 17.9% 19.1% (2) Training on SQuAD only (3) Fine-tuning on BioASQ 20.0% 24.6% 8.1% 23.6% (4) Fine-tuning on BioASQ w/o biomedical embeddings (5) Fine-tuning on BioASQ w/ entity features 21.3% 23.3% 22.4% 23.8% (6) Fine-tuning on BioASQ + SQuAD (7) Fine-tuning on BioASQ w/ forgetting cost (Cf c = 100.0) (8) Fine-tuning on BioASQ w/ L2 loss on original parameters (Cl2 = 0.3) 23.9% 26.2% 22.6% 23.8% 21.1% 20.4% Table 1: Comparison of various transfer learning techniques. In Experiment 1, the model was trained on BioASQ only. In Experiment 2, the model was trained on SQuAD and tested on BioASQ. We refer to it as the base model. In Experiment 3, the base model parameters were fine-tuned on the BioASQ training set. Experiments 4-5 evaluate the utility of domain dependent word vectors and features. Experiments 6-8 address the problem of catastrophic forgetting. All experiments have been conducted with the BioASQ4B dataset and 5-fold cross-validation. on biomedical- and list questions, which are not part of the SQuAD dataset, for the first time. Overall, the performance of the fine-tuned model on both question types is much higher than the baseline system without transfer learning. Features In order to evaluate the impact of using biomedical word embeddings, we repeat Experiment 3 without them (Experiment 4). We see a factoid and list performance drop of 3.3 and 1.2 percentage points, respectively, showing that biomedical word embeddings help increase performance. In Experiment 5, we append entity features to the word vector, as described in Section 3.1. Even though these features provide the network with domain-specific knowledge, we found that it actually harms performance on factoid questions. Because most of the entity features are only active during fine-tuning with the small dataset, we conjecture that the performance decrease is due to over-fitting. Catastrophic Forgetting We continue our study with techniques to combat catastrophic forgetting as a means to regularize training during fine-tuning. In Experiment 6 of Table 1 we fine-tune the base model on a half-half mixture of BioASQ and SQuAD questions (BioASQ questions have been upsampled accordingly). This form of joint training yielded no significant performance gains. Experiment 7 regularizes the model via an additional forgetting cost term, as proposed by Riemer et al. (2017) and explained in Section 3.4. We generally found that this technique only increases performance for factoid questions where the performance boost was largest for Cf c = 100.0. The fact that the forgetting loss decreases performance on list questions is not surprising, as predictions are pushed more towards the predictions of the base model, which has very poor performance on list questions. Experiment 8 adds an L2 loss which penalizes deviations from the base model’s parameters. We found that performance decreases as we increase the value of Cl2 which shows that this technique does not help at all. For the sake of completeness we report results for Cl2 = 0.3, the lowest value that yielded a significant drop in performance. 5.2 Ensemble Model ensembles are a common method to tweak the performance of a machine learning system. Ensembles combine multiple model predictions, for example by averaging, in order to improve generalization and prevent over-fitting. We evaluate the utility of an ensemble by training five models on the BioASQ3B dataset using 5-fold crossvalidation. Each of the models is evaluated on the 4B test data, i.e., data which is not included in BioASQ3B. During application, we run an ensemble by averaging the start and end scores of individual models before they are passed to the sigmoid / softmax functions as defined in Eq. 1 and 2. In Table 2 we summarize the average performance of Experiment Factoid MRR List F1 Average Best Ensemble 23.4% 24.3% 27.3% 24.0% 27.7% 28.6% Table 2: Performance of a model ensemble. Five models have been trained on the BioASQ3B dataset and tested on the 4B test questions. We report the average and best single model performances, as well as the ensemble performance. the five models, the best performance across the five models, and the performance of the ensemble. We observe performance gains of 3 percentage points on factoid questions and a less than 1 percentage point on list questions, relative to the best single model. This demonstrates a small performance gain that is consistent with the literature. 5.3 Comparison to competing BioASQ systems Because the final results of the fifth BioASQ challenge are not available at the time of writing, we compare our system to the best systems in last year’s challenge 2 . For comparison, we use the best single model and the model ensemble trained on BioASQ3B (see Section 5.2). We then evaluate the model on the 5 batches of last year’s challenge using the official BioASQ evaluation tool. Each batch contains 100 questions of which only some are factoid and list questions. Note that the results underestimate our system’s performance, because our competing system’s responses have been manually evaluated by humans while our system’s responses are evaluated automatically using string matching against a potentially incomplete list of synonyms. In fact, our qualitative analysis in Section 5.4 shows that many answers are counted as incorrect, but are synonyms of the gold-standard answer. The results are summarized in Table 3 and compared to the best systems in the challenge in each of the batches and question type categories. With our system winning four out of five batches on factoid questions, we consider it stateof-the-art in biomedical factoid question answering, especially when considering that our results might be higher on manual evaluation. The results on list questions are slightly worse, but still very 2 Last year’s results are available at http: //participants-area.bioasq.org/results/ 4b/phaseB/ competitive. This is surprising, given that the network never saw a list question prior to the finetuning phase. Due to small test set sizes, the sampling error in each batch is large, causing the single model to outperform the model ensemble on some batches. 5.4 Qualitative Analysis In order to get a better insight into the quality of the predictions, we manually validated the predictions for the factoid questions of batch 5 of the fourth BioASQ challenge as given by the best single model (see Table 3). There are in total 33 factoid questions, of which 23 have as the gold standard answer a span in one of the contexts. According to the official BioASQ evaluation, only 4 questions are predicted correctly (i.e., the gold standard answer is ranked highest). However, we identified 10 rank-1 answers which are not counted as correct but are synonyms to the gold standard answer. Examples include ”CMT4D disease” instead of ”Charcot-Marie-Tooth (CMT) 4D disease”, ”tafazzin” instead of ”Tafazzin (TAZ) gene”, and ”β-glucocerebrosidase” instead of ”Beta glucocerebrosidase”. In total, we labeled 14 questions as correct and 24 questions as having their correct answer in the top 5 predictions. In the following, we give examples of mistakes made by the system. Questions are presented in italics. In the context, we underline predicted answers and present correct answers in boldface. We identified eight questions for which the semantic type of the top answer differs from the question answer type. Some of these cases are completely wrong predictions. However, this category also includes subtle mistakes like the following: In which yeast chromosome does the rDNA cluster reside? The rDNA cluster in Saccharomyces cerevisiae is located 450 kb from the left end and 610 kb from the right end of chromosome XII... Here, it predicted a yeast species the rDNA cluster is located in, but ignored that the question is asking for a chromosome. Another type of mistakes is that the top answer is somewhat correct, but is missing essential information. We labeled four predictions with this category, like the following example: Batch Factoid MRR Best Participant Single Ensemble Best Participant List F1 Single 1 2 3 4 5 12.2% (fa1) 22.6% (LabZhu-FDU) 24.4% (oaqa-3b-3) 32.5% (oaqa-3b-4) 28.5% (oaqa-3b-5) 25.2% 16.4% 24.7% 34.0% 23.7% 29.2% 24.2% 20.6% 40.3% 23.2% 16.8% (fa1) 15.5% (LabZhu-FDU) 48.3% (oaqa-3b-3) 31.2% (oaqa-3b-4) 29.0% (oaqa-3b-5) 29.1% 25.8% 31.8% 29.0% 23.5% 27.9% 20.8% 33.3% 24.1% 26.1% Avg. 24.0% 24.8% 27.5% 28.1% 27.8% 26.5% Ensemble Table 3: Comparison to systems on last year’s (fourth) BioASQ challenge for factoid and list questions. For each batch and question type, we list the performance of the best competing system, our single model and ensemble. Note that our qualitative analysis (Section 5.4) suggests that our factoid performance on batch 5 would be about twice as high if all synonyms were contained in the gold standard answers. How early during pregnancy does non-invasive cffDNA testing allow sex determination of the fetus? Gold Standard Answer: "6th to 10th week of gestation" or "first trimester of pregnancy" Given Top Answer: "6th-10th" In summary, to our judgment, 14 of 33 questions (42.4%) are answered correctly, and 24 of 33 questions (72.7%) are answered correctly in one of the top 5 answers. These are surprisingly high numbers considering low MRR score of 23.7% of the automatic evaluation (Table 3). poor prior to fine-tuning which is due to the lack of list questions in SQuAD. We believe that large scale open-domain corpora for list questions would enhance performance further. Unsupervised domain adaptation could be an interesting direction for future work, because the biomedical domain offers large amounts of textual data, some of which might even contain questions and their corresponding answers. We believe that leveraging these resources holds potential to further improve biomedical QA. 6 In this paper, we described a deep learning approach to address the task of biomedical question answering by using domain adaptation techniques. Our experiments reveal that mere fine-tuning in combination with biomedical word embeddings yield state-of-the-art performance on biomedical QA, despite the small amount of in-domain training data and the lack of domain-dependent feature engineering. Techniques to overcome catastrophic forgetting, such as a forgetting cost, can further boost performance for factoid questions. Overall, we show that employing domain adaptation on neural QA systems trained on large-scale, open-domain datasets can yield good performance in domains where large datasets are not available. Discussion and future work The most significant result of this work is that state-of-the-art results in biomedical question answering can be achieved even in the absence of domain-specific feature engineering. Most competing systems require structured domain-specific resources, such as biomedical ontologies, parsers, and entity taggers. While these resources are available in the biomedical domain, they are not available in most domains. Our system, on the other hand, requires a large open-domain QA dataset, biomedical word embeddings (which are trained in an unsupervised fashion), and a small biomedical QA dataset. This suggests that our methodology is easily transferable to other domains as well. Furthermore, we explored several supervised domain adaptation techniques. In particular, we demonstrated the usefulness of forgetting cost for factoid questions. The decreased performance on list questions is not surprising, because the model’s performance on those questions is very 7 Conclusion Acknowledgments This research was supported by the German Federal Ministry of Education and Research (BMBF) through Software Campus project GeNIE (01IS12050). References Martı́n Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. 2016. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467 . John Blitzer, Mark Dredze, Fernando Pereira, et al. 2007. Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In ACL. volume 7, pages 440–447. Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. 2016. Domain separation networks. In Advances in Neural Information Processing Systems. pages 343– 351. Minmin Chen, Zhixiang Xu, Kilian Weinberger, and Fei Sha. 2012. Marginalized denoising autoencoders for domain adaptation. arXiv preprint arXiv:1206.4683 . Yarin Gal and Zoubin Ghahramani. 2015. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. arXiv preprint arXiv:1506.02142 2. Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. 2016. Domain-adversarial training of neural networks. Journal of Machine Learning Research 17(59):1–35. Xavier Glorot, Antoine Bordes, and Yoshua Bengio. 2011. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th international conference on machine learning (ICML-11). pages 513–520. Dan Jurafsky. 2000. Speech & language processing. Pearson Education India. Diederik Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 . James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. 2017. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences page 201611835. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems. pages 3111–3119. Ioannis Pavlopoulos, Aris Kosmopoulos, and Ion Androutsopoulos. 2014. Continuous space word vectors obtained by applying word2vec to abstracts of biomedical articles http://bioasq.lip6.fr/info/BioASQword2vec/. Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP). pages 1532– 1543. http://www.aclweb.org/anthology/D14-1162. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250 . Metthew Riemer, Elham Khabiri, and Richard Goodwin. 2017. Representation stability as a regularizer for improved text analytics transfer learning https://openreview.net/pdf?id=HyenWc5gx. Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. 2016. Progressive neural networks. arXiv preprint arXiv:1606.04671 . Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. 2016. Bidirectional attention flow for machine comprehension. arXiv preprint arXiv:1611.01603 . George Tsatsaronis, Georgios Balikas, Prodromos Malakasiotis, Ioannis Partalas, Matthias Zschunke, Michael R Alvers, Dirk Weissenborn, Anastasia Krithara, Sergios Petridis, Dimitris Polychronopoulos, et al. 2015. An overview of the bioasq largescale biomedical semantic indexing and question answering competition. BMC bioinformatics 16(1):1. Ellen M Voorhees et al. 1999. The trec-8 question answering track report. In Trec. volume 99, pages 77– 82. Shuohang Wang and Jing Jiang. 2016. Machine comprehension using match-lstm and answer pointer. arXiv preprint arXiv:1608.07905 . Dirk Weissenborn, Georg Wiese, and Laura Seiffe. 2017. Making neural qa as simple as possible but not simpler. arXiv preprint arXiv:1703.04816 . Caiming Xiong, Victor Zhong, and Richard Socher. 2016. Dynamic coattention networks for question answering. arXiv preprint arXiv:1611.01604 . Yang Zi, Zhou Yue, and Eric Nyberg. 2016. Learning to answer biomedical questions: Oaqa at bioasq 4b. ACL 2016 page 23.
2cs.AI
A Deep Reinforcement Learning-Based Framework for Content Caching arXiv:1712.08132v1 [cs.IT] 21 Dec 2017 Chen Zhong, M. Cenk Gursoy, and Senem Velipasalar Department of Electrical Engineering and Computer Science, Syracuse University, Syracuse, NY 13244 Email: [email protected], [email protected], [email protected] Abstract—Content caching at the edge nodes is a promising technique to reduce the data traffic in next-generation wireless networks. Inspired by the success of Deep Reinforcement Learning (DRL) in solving complicated control problems, this work presents a DRL-based framework with Wolpertinger architecture for content caching at the base station. The proposed framework is aimed at maximizing the long-term cache hit rate, and it requires no knowledge of the content popularity distribution. To evaluate the proposed framework, we compare the performance with other caching algorithms, including Least Recently Used (LRU), Least Frequently Used (LFU), and First-In First-Out (FIFO) caching strategies. Meanwhile, since the Wolpertinger architecture can effectively limit the action space size, we also compare the performance with Deep Q-Network to identify the impact of dropping a portion of the actions. Our results show that the proposed framework can achieve improved short-term cache hit rate and improved and stable long-term cache hit rate in comparison with LRU, LFU, and FIFO schemes. Additionally, the performance is shown to be competitive in comparison to Deep Q-learning, while the proposed framework can provide significant savings in runtime. Index Terms—Deep reinforcement learning, content caching, Wolpertinger architecture. I. I NTRODUCTION Recent years have witnessed rapid developments in rich media-enabled applications on mobile devices, providing users easier access to high-quality multimedia contents. With this, users increasingly demand more multimedia content, which usually has larger data size and requires more resources for transmission. As a consequence, the contents that need to be streamed in real-time have grown rapidly in terms of size and volume, which has led to the congested data traffic at content servers and degradation in user experience. Content caching is a promising technique that enables data offloading and alleviates the data traffic congestion. In particular, this technique is aimed at pre-caching the contents at the end users or the base stations from the content servers. In this way, the time and resources needed to request and transport contents from upper level content servers or original content servers can be effectively saved, and data traffic can be reduced. However, with content caching arises the policy control problem, in which we have to explore and decide which contents to store in caches. Inspired by the success of Deep Reinforcement Learning (DRL) in solving complicated control problems, we in this paper design a DRL agent for content caching decisions at an edge node, e.g., a base station. Endusers keep requesting content from the base station and these requests are the input of the system. We suppose there is a queue of requests to be served. The base station has a fixed storage capacity C, which is the maximum number of contents that can be cached at this base station. The main contributions of this paper are summarized below: • For the first time, we present a deep reinforcement learning framework (that utilizes Wolpertinger architecture) for content caching problem. We define the state and action spaces and the reward function for the DRL agent, and employ this agent to make proper cache replacement decisions to maximize the cache hit rate. • We analyze the performance of this DRL agent in terms of the cache hit rate. And we compare the performance with other caching algorithms, including Least Recently Used (LRU), Least Frequently Used (LFU), and FirstIn First-Out (FIFO) caching strategies. The results show that the DRL agent is able to achieve improved short-term cache hit rate and improved and stable long-term cache hit rate. • We further confirm the effectiveness of the DRL agent through comparisons with deep Q-network. The results show that the DRL agent is able to achieve competitive cache hit rates while having significant advantages in runtime. II. R ELATED W ORK Content caching has attracted much interest recently. For instance, the authors in [1] analyzed proactive content caching from the aspect of big data analytics and demonstrated that with limited cache size, proactive caching can provide 100% user satisfaction while offloading 98% of the backhaul traffic. In [2], three learning-based content replacement algorithms were studied with each leading to different exploitationexploration trade-offs. The study in [3] proposed an age-based threshold policy which caches all contents that have been requested more than a threshold. Furthermore, popularity-based content caching policies named StreamCache and PopCaching were studied in [4] and [5], respectively. More recently, increasing attention has been cast on machine learning based methods. In [6], content popularity is estimated using the multi-armed bandit algorithm. And the authors in [7] proposed an extreme-learning machine framework for content popularity prediction. As seen in previous studies, content popularity distribution is always the key to solve the content caching problem. Considering the large scale of contents and the changing popularities, we note that deep reinforcement learning is a where CT stands for the cache state in this period. Therefore the reward in T requests can be defined as particularly attractive strategy to tackle this problem. In [8], [9] and [10], reinforcement learning methods are addressed. For instance, the proposed reinforcement learning agent in [8] is a typical multi-step return actor-critic architecture. The deep deterministic policy gradient proposed in [9] describes how the network is to be updated. And the Wolpertinger policy proposed in [10] provides a solution for large discrete action spaces. rT = CHRT . (3) For each decision epoch t, we obtain reward rt , which can be a weighted sum of short-term and long-term cache hit rates. We more explicitly introduce the definition of rt for the proposed framework in Section IV below. The objective of the DRL agent is to find a policy, σ ∗ , that maximizes the long-term cache hit rate: III. S YSTEM M ODEL Data traffic is triggered by requests from the rapidly increasing number of end-users, and the volume of requests varies over time. In this setting, we propose a deep reinforcement learning framework acting as an agent. Based on the users’ requests, this DRL agent makes caching decisions to store the frequently requested contents at local storage. If the requested contents are already cached locally, then the base station can serve the user directly with reduced delay. Otherwise, the base station requests these contents from the original server and updates the local cache based on the caching policy. In this work, we consider a single base station with cache size of C. We assume that in a given time slot, the total number of contents that users can request from this base station is fixed and denoted as N . We give every content a unique index, and this index acts as the content ID. We assume that all contents have the same size. The list of users’ requests is denoted as Req = {R1 , R2 , R3 , ...}. Here, Rt denotes the ID of the requested content at time t. For each request, the DRL agent makes a decision on whether or not to store the currently requested content in the cache, and if yes, the agent determines which local content will be replaced. We define A as the action space, and let A = {a1 , a2 , a3 , ..., am }, where aυ denotes a valid action. And in our case, m has a finite but generally a large value, describing the total number of possible actions. For each content, there are two cache states: cached, and not cached. The cache state gets updated based on the caching decision. Here, we define two types of actions: the first one is to find a pair of contents and exchange the cache states of the two contents; the second one is to keep the cache states of the contents unchanged. Theoretically, multiple actions can be executed at one decision epoch. To reduce the computational complexity, we need to limit the action space size m and the number of actions to be executed in one decision epoch, which will discussed in detail in Section IV. The reward should reflect the objective of the framework, which, in our case, is to reduce the data traffic. In our setting, all requests are served by the base station, all contents have the same size, and there are no priorities for users. Therefore, the reduction in data traffic can be evaluated in terms of the cache hit rate. Here, we define the cache hit rate CHR in T requests as PT 1 (Ri ) (1) CHRT = i=1 T where indicator function 1 (Ri ) is defined as ( 1, Ri ∈ CT , 1 (Ri ) = (2) 0 Ri ∈ / CT maximize E[rt |σ ∗ ]. ∗ σ (4) We are interested in developing a model-free learning algorithm to solve problem (4) that can effectively reduce the data traffic with fixed cache capacity at the base station. IV. DRL- BASED C ONTENT C ACHING F RAMEWORK In this section, we present the DRL-based content caching framework, which is aimed at maximizing the cache hit rate in order to reduce the data traffic. To solve the content caching problem with high-dimensional state and action spaces (due to the large number of contents and cache sizes in practical scenarios), we propose a framework based on the Wolpertinger architecture [10] to narrow the size of the action space and avoid missing the optimal policy at the same time. A. Algorithm Overview Based on the Wolpertinger Policy [10], our framework consists of three main parts: actor network, K-nearest neighbors (KNN), and critic network. We train the policy using the Deep Deterministic Policy Gradient (DDPG) [9]. The Wolpertinger architecture is employed for two reasons: 1) as an online algorithm, this framework can adapt to data, and enables us to develop a long-term policy; 2) actor network can avoid the listing and consideration of very large action space, while the critic network can correct the decision made by the actor network, and KNN can help to expand the actions to avoid poor decisions. This algorithm work in three steps. Firstly, the actor network takes cache state and the current content request as its input, and provides a single proto actor â at its output. Then, KNN receives the single actor â as its input, and calculate the l2 distance between every valid action and the proto actor in order to expand the proto actor to an action space, denoted by Ak , with K elements and each element being a possible action aυ ∈ A. And at the last step, the critic network takes the action space Ak as its input, and refines the actor network on the basis of the Q value. The DDPG is applied to update both critic and actor networks. Below we provide a more detailed description of the key components of the algorithm. The actor: We define the actor as a function parameterized by θµ , mapping the state S from the state space Rs to the action space Ra . The mapping provides a proto-actor â in Ra for a given state under the current parameter. Here, we scale the proto-actor to make sure â is a valid action that â ∈ A: µ(s|θµ ) : S → Ra 2 µ(s|θµ ) = â. the requested content is not cached, the DRL agent observes the state st from the environment, and obtains the proto actor and Q value from the actor network and critic network, respectively. Then, an ǫ-greedy policy is applied at selecting the execution action at . This policy can force the agent to explore more possible actions. After the action at is executed, the DRL agent observes the reward rt and next state st from the base station cache, and the transition (si , ai , ri , si+1 ) will be stored to the memory M at the end of each epoch. The DRL agent updates the parameters θQ and θµ with NB transition samples from memory M based on the DDPG. In our implementation, the actor network has two hidden layers of fully-connected units with 256 and 128 neurons, respectively; and the critic network has two hidden layers of fully-connected units with 64 and 32 neurons, respectively. The capacity of memory NM is set as NM = 10000, and the mini batch size is set as NB = 100. The discount factor γ introduced in (7) is set as 0.9. Then, we define the state and action spaces, and the reward function of the DRL agent as follows: State Space: The DRL agent assumes the feature space of the cached contents and the currently requested content as the state. The feature space consists of three components: short-term feature Fs , medium-term feature Fm , and longterm feature Fl , which represent the total number of requests for each content in a specific short-, medium-, long-term, respectively. These features vary as the cache state is updated. For each decision epoch, we assign a temporary index to every content from which we need to extract features. Since we only extract the features from cached contents and the currently requested content, let the index range from 0 to the cache capacity C. The index of the currently requested content is 0, while the index of the cached content varies from 1 to C. This temporary index is different from the content ID and is only used for denoting the feature. Then, we let fxj , for x ∈ {s, m, l} and j ∈ [0, C], denote the feature of a specific content within a specific term. Thus, the observed state is defined as st = {Fs ; Fm ; Fl } where Fs = {fs0 , fs1 , ..., fsC }, Fm = {fm0 , fm1 , ..., fmC }, and Fl = {fl0 , fl1 , ..., flC }. Action Space: In order to limit the action size, we restrict that the DRL agent can only replace one selected cached content by the currently requested content, or keep the cache state the same. With this, we define A as the action space, and let A = {0, 1, 2, ..., C}, where C is again the cache capacity at the base station. And we assume that only one action can be selected in each decision epoch. Let at be the selected action at epoch t. Note that, for each caching decision, there are (C + 1) possible actions. When at = 0, the currently requested content is not stored, and the current caching space is not updated. And when at = υ with υ ∈ {1, 2, ..., C}, the action is to store the currently requested content by replacing the υ th content in the cache space. Reward: As stated in the previous section, we select the cache hit rate as the reward to represent the objective of the proposed framework. The reward for each decision epoch depends on the short and long-term cache hit rate. For example, we set the short-term reward as the number of requests for (5) K-nearest neighbors: The generation of proto-actor can help reduce the computational complexity caused by the large size of the action space. However, reducing the high-dimensional action space to one actor will lead to poor decision making. So, we apply the K-nearest neighbors mapping, gk , to expand the actor â to a set of valid actions in action space A. The set of actions returned by gk is denoted as Ak : Ak = gk (ât ) k gk = arg max |a − â|2 . (6) a∈A The critic: To avoid the actor with low Q-value being occasionally selected, we define a critic network to refine the actor. This deterministic target policy is described below: Q(st , aj |θQ ) = Ert ,st+1 ∼E [r(st , at )+γQ(st+1 , µ(st+1 |θµ )|θQ )] (7) where γ ∈ (0, 1] is the discount factor which weigh the future accumulative reward Q(st+1 , µ(st+1 |θµ )|θQ ). Here, the critic takes both the current state st and the next state st+1 as its input to calculate the Q value for each action in Ak . Then, the action that provides the maximum Q value will be chosen as at , i.e., at = arg max Q(st , aj |θQ ) (8) aj ∈Ak Update: The actor policy is updated using deep deterministic policy gradient, which is given as 1 X ∇a Q(s, a|µQ )|s=si ,a=µ(si ) ∇θµ µ(s|θµ )|si . ∇θµ J ≈ N i (9) The update of critic network parameter θQ and actor network parameter θµ are given as ′ ′ θQ ←− τ θQ + (1 − τ )θQ ′ ′ θµ ←− τ θµ + (1 − τ )θµ (10) (11) where τ ≪ 1. B. Workflow In this part, we introduce the workflow of the proposed framework. The framework consists of two phases, namely offline and online phases. Offline phase: In the offline phase, the actor and critic networks are constructed and pre-trained with historic transition profiles. This process is the same as in the training of a deep neural network. In the offline phase, when we train the networks with sufficient number of samples, the critic and actor will be sufficiently accurate, and the updated parameters θQ and θµ will be stored in order to provide a good initial point for the online phase. Online phase: The online phase is initialized with the parameters determined in the offline phase. The system is dynamically controlled in the online phase. In each epoch t, if 3 local content in the next epoch, i.e., the short-term reward rts can be either 0 or 1. And let the total number of requests for local content within the next 100 requests as the long-term reward rtl ∈ [1, 100]. The total reward for each step is defined as the weighted sum of the short and long-term rewards Algorithm 1 DRL-based Content Caching Algorithm Offline: 1: Randomly initialize critic network Q(s, a|θ Q ) and actor µ(s|θµ ) with weights θQ and θµ . ′ 2: Initialize target network Q′ and µ′ with weights θ Q ←− Q µ′ µ θ , θ ←− θ 3: Initialize replay buffer M with capacity of NM 4: Initialize a random process N for action exploration 5: Initialize features space F 6: Pre-train the actor and critic network with the pairs < s, a > and the corresponding Q(s, a|θQ ). Online: 7: for t = 1, T do 8: The base station receive a request Rt 9: if Requested content is already cached then 10: Update cache hit rate and end epoch; 11: else 12: if Cache storage is not full then 13: Cache the currently requested content 14: Update cache state and cache hit rate 15: End epoch; 16: end if 17: Receive observation state st 18: Actor: 19: Receive proto-ation from actor network aˆt = µ(st |θµ ). 20: KNN: 21: Retrieve k approximately closest actions Ak = gk (aˆt ) 22: Critic: 23: Select action at = arg maxaj ∈Ak Q(st , aj |θQ ) according to the current policy. 24: Execute action at , and observe reward rt and observe new state st+1 25: Store transition (st , at , rt , st+1 ) in M 26: Sample a random mini batch of NB transitions (si , ai , ri , si+1 ) from M ′ ′ 27: Set target yi = ri + γQ′ (si+1 , µ′ (si+1 |θµ )|θQ ) 28: Update critic by minimizing the loss: L = 1 P Q 2 (y i i − Q(si , ai |θ )) N 29: Update the actor policy using the sampled policy gradient: rt = rts + w ∗ rtl where w is the weight to balance the short and long-term rewards, so that we can give more priority to the short-term reward to maximize the cache hit rate at every step given the chosen action. The major notations are listed in Table I below. TABLE I N OTATIONS Notation C i N Rt A at rt st F Fs , Fm , Fl fsi , fmi , fli k Description Cache capacity at base station ID, or index of contents Total number of contents Content requested at epoch t Action space The chosen action in the epoch t The reward obtained in the epoch t The observation state in the epoch t Feature space Short/ mid/ long term features Short/ mid/ long term feature of content i The number of nearest neighbors V. S IMULATION R ESULTS A. Simulation Setup Data Generation: In our simulations, the raw data of users’ requests is generated according to the Zipf distribution. We set the total number of files as 5000, and we have collected 10000 requests as the testing data. We generate two types of data sets. Initially, we analyze the performance with fixed content popularity distribution, and the data set was generated with unchanged popularity distribution with Zipf parameter set as 1.3. Subsequently, we study how long-term cache hit rate varies over time as the content popularity distribution changes. In this case, the data set was generated with a varying Zipf parameter, and changing content popularity rank. Note that, although we generate the data using the Zipf distribution, the proposed framework is applicable to arbitrarily distributed popularities, and indeed requires no knowledge regarding the popularity distribution. Feature Extraction: From the raw data of content requests we extract the feature F and use it as the input state of the network. Here, as features, we consider the number of requests for a file within the most recent 10, 100, 1000 requests. 30: 31: 32: 33: 34: 35: 36: 37: 38: B. Performance Comparison To analyze the performance of our algorithm, we evaluate the cache hit rate and provide comparisons with other caching strategies. 4 ∇θµ J ≈ 1 N P i ∇a Q(s, a|µQ )|s=si ,a=µ(si ) ∇θµ µ(s|θµ )|si Update the target networks: ′ ′ θQ ←− τ θQ + (1 − τ )θQ ′ ′ θµ ←− τ θµ + (1 − τ )θµ Update the cache state Update features space F Update cache hit rate end if end for a) Cache Hit Rate: In this part, comparisons are made between our proposed frame work and the following caching algorithms: • • 0.8 0.7 Least Recently Used (LRU) [11]: In this policy, the system keeps track of the most recent requests for every cached content. And when the cache storage is full, the cached content, which is least requested recently, will be replaced by the new content. Least Frequently Used (LFU) [12]: In this policy, the system keeps track of the number of requests for every cached content. And when the cache storage is full, the cached content, which is requested the least many times, will be replaced by the new content. First In First Out (FIFO) [13]: In this policy, the system, for each cached content, records the time when the content is cached. And when the cache storage is full, the cached content, which was stored earliest, will be replaced by the new content. Cache hit rate • 0.9 0.6 0.5 0.4 0.3 Proposed framework LRU FIFO LFU 0.2 0.1 0 0 10 10 1 10 2 10 3 Cache capacity Fig. 1. Cache hit rate vs. cache capacity. We vary the cache capacity as C = 1, 5, 25, 50, 150, 300, 500. 0.55 0.5 Here, we consider both short-term and long-term performance. For the short-term analysis, we study the relationship between the cache capacity and cache hit rate. Regarding the long-term performance, we are interested in the stability and robustness of the proposed DRL framework, i.e., we seek to characterize how the cache hit rate changes over time with the changing popularity distribution of contents. Figure 1 shows the overall cache hit rate achieved by the proposed framework and the other caching algorithms introduced above. In this study, we set the Zipf distribution parameter as 1.3. We can see that our proposed framework provides a higher cache hit rate for all cache capacity values. When the cache capacity is small, the performance of LFU is very close to our proposed framework. As the cache capacity increases, the gap between proposed framework and other three caching algorithms increases at first, and then gradually decreases. At cache capacity C = 500, the cache hit rate of all four algorithms are close to each other at around 0.8. And at this point, the cache hit rates achieved by different policies tend to converge because the cache capacity is high enough to store all popular contents. From this point on, increasing the cache capacity will not improve the cache hit rate effectively any more, and the cache hit rate is now limited by the distribution of the content popularity. In Fig. 2, we address the long-term cache hit rate, and based on the long-term performance we evaluate the capability that the policy can maintain the good performance as content popularities vary over time. Specifically, we design a data set with a changing popularity distribution based on the Zipf distribution. In addition to the parameter of the Zipf distribution, the rank of the contents also vary over time. All the Zipf distribution parameter values and the ranks of contents are generated randomly. From the figure, we can observe that the proposed DRL framework doesn’t show advantage initially, but soon the cache hit rate increases. This is because the proposed framework needs to update the deep neural network to adapt to the changing content popularity distribution. After that, the hit rate curve of proposed framework reaches the peak and then deceases only slightly, maintaining a relatively stable cache Cache hit rate 0.45 0.4 0.35 Proposed framework LRU FIFO LFU 0.3 0.25 0.2 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 Time frame Fig. 2. Cache hit rate as the content popularity distribution changes over time, with cache capacity fixed at C = 300. hit rate. Meanwhile, the LFU curve starts at a relative high cache hit rate and then drops rapidly. This poor performance is caused by the frequency pollution, which is an inevitable drawback of the LFU policy. Because the number of requests are accumulative, when the popularity distribution changes, the previous record will mislead the system. For LRU and FIFO, the performance are relatively stable but the performance is not competitive with respect to our DRL agent. Based on the analysis, our proposed framework will be more suitable for applications that require robustness and a long-term high performance. b) Efficiency: In this part, we compare our proposed framework with the Deep Q-learning based caching algorithm. The most significant difference between these two algorithms is that our proposed algorithm only considers a set of valid actions expanded from the actor, but the Deep Q-learning based algorithm calculates the value for all valid actions. Intuitively, our proposed framework will reduce the computational complexity, but since the Deep Q-learning algorithm receives more possible actions, it may lead to better performance. To address this key tradeoff, we compare the cache hit rates and the corresponding runtimes of these two deep learning schemes. In Fig. 3, the cache capacity values vary as {1, 5, 25, 50, 150, 300, 500}, and the cache hit rates are 5 rates achieved with LRU, LFU, and FIFO policies. The results show that the proposed framework provides improvements on both short-term and long-term performance. Additionally, we have further confirmed the effectiveness of the proposed framework by comparing the cache hit rate and runtime with those achieved with the deep Q-learning based policy. This comparison has demonstrated that the proposed framework can achieve competitive cache hit rates while effectively reducing the runtime. This makes the proposed framework efficient in handling large-scale data. This work opens up several directions for future research. First, this current study only considers a scenario involving a single base-station or an access-point. It would be interesting to investigate how to develop a suitable DRL agent for scenarios in which multiple base stations can collaborate with each other. Second, in this work, we assume all contents have the same size, and individual user preferences are not explicitly addressed. It would be practically more appealing to take these factors into consideration. Finally, if both goals can be achieved, we can further develop this framework to address the caching problem in device-to-device communications. 0.9 0.8 Cache hit rate 0.7 0.6 0.5 DQN K 0.4 1 K 0.3 0.2 0 10 10 1 10 2 2 10 3 Cache capacity Fig. 3. Cache hit rate vs. cache capacity. plotted when the content requests are generated using the Zipf distribution parameter 1.3. The curve labeled DQN represents the performance of the deep Q-network. K1 and K2 denote two different settings of proposed framework. In the case of K1 , the KNN returns k1 = ⌈0.15C⌉ actions to the expanded action space Ak . For K2 , the KNN returns k2 = ⌈0.05C⌉ actions to the expanded action space Ak . As we can see in the figure, when cache capacity is C = 1, all three curves intersect at the same point, because all three policies are trained to find the one most popular content. Then, as cache capacity increases, the gap between this three policies become obvious. Especially when the cache capacity is C = 5, DQN consider all possible actions, while both K1 and K2 only take the proto actor. The gap between K1 and K2 reflects the randomness that might be introduced by the proto action. And then, the gap between K1 and DQN gradually decreases. These results demonstrate that the proposed framework can achieve competitive cache hit rates compared to DQN. Moreover, the proposed framework can achieve this competitive performance with significantly lower runtimes. With cache capacity fixed at C = 300, we record the time needed for 1000 decision epochs, and show the average runtime results in Table II below. As can be seen, the DQN needs much more time at each epoch. In practice, this increased computational cost often leads to storage problems, which makes the deep Q network less competitive in solving large scale problems than the proposed framework. R EFERENCES [1] M. A. Kader, E. Bastug, M. Bennis, E. Zeydan, A. Karatepe, A. S. Er, and M. Debbah, “Leveraging big data analytics for cache-enabled wireless networks,” in Globecom Workshops (GC Wkshps), 2015 IEEE, pp. 1–6, IEEE, 2015. [2] P. Blasco and D. Gunduz, “Learning-based optimization of cache content in a small cell base station,” in Communications (ICC), 2014 IEEE International Conference on, pp. 1897–1903, IEEE, 2014. [3] M. Leconte, G. Paschos, L. Gkatzikis, M. Draief, S. Vassilaras, and S. Chouvardas, “Placing dynamic content in caches with small population,” in Computer Communications, IEEE INFOCOM 2016-The 35th Annual IEEE International Conference on, pp. 1–9, IEEE, 2016. [4] W. Li, S. M. Oteafy, and H. S. Hassanein, “Streamcache: popularitybased caching for adaptive streaming over information-centric networks,” in Communications (ICC), 2016 IEEE International Conference on, pp. 1–6, IEEE, 2016. [5] S. Li, J. Xu, M. Van Der Schaar, and W. Li, “Popularity-driven content caching,” in Computer Communications, IEEE INFOCOM 2016-The 35th Annual IEEE International Conference on, pp. 1–9, IEEE, 2016. [6] J. Song, M. Sheng, T. Q. Quek, C. Xu, and X. Wang, “Learning based content caching and sharing for wireless networks,” IEEE Transactions on Communications, 2017. [7] S. S. Tanzil, W. Hoiles, and V. Krishnamurthy, “Adaptive scheme for caching youtube content in a cellular network: Machine learning approach,” IEEE Access, vol. 5, pp. 5870–5881, 2017. [8] A. Gruslys, M. G. Azar, M. G. Bellemare, and R. Munos, “The reactor: A sample-efficient actor-critic architecture,” arXiv preprint arXiv:1704.04651, 2017. [9] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra, “Continuous control with deep reinforcement learning,” arXiv preprint arXiv:1509.02971, 2015. [10] G. Dulac-Arnold, R. Evans, H. van Hasselt, P. Sunehag, T. Lillicrap, J. Hunt, T. Mann, T. Weber, T. Degris, and B. Coppin, “Deep reinforcement learning in large discrete action spaces,” arXiv preprint arXiv:1512.07679, 2015. [11] M. Ahmed, S. Traverso, P. Giaccone, E. Leonardi, and S. Niccolini, “Analyzing the performance of LRU caches under non-stationary traffic patterns,” arXiv preprint arXiv:1301.4909, 2013. [12] A. Jaleel, K. B. Theobald, S. C. Steely Jr, and J. Emer, “High performance cache replacement using re-reference interval prediction (rrip),” in ACM SIGARCH Computer Architecture News, vol. 38, pp. 60–71, ACM, 2010. [13] D. Rossi and G. Rossini, “Caching performance of content centric networks under multi-path routing (and more),” Relatório técnico, Telecom ParisTech, pp. 1–6, 2011. TABLE II RUNTIME / DECISION EPOCH Runtime (s) DQN 1.2225 K1 0.3224 K2 0.1163 VI. C ONCLUSION In this paper, we have proposed and developed a deep reinforcement learning based content caching policy. We built the framework based on the Wolpertinger architecture and trained it using the deep deterministic policy gradient. We have evaluated the performance of the proposed framework and compared it with both short-term and long-term cache hit 6
7cs.IT
A Fast Approximation Scheme for Low-Dimensional k-Means arXiv:1708.07381v2 [cs.DS] 29 Aug 2017 Vincent Cohen-Addad University of Copenhagen Abstract We consider the popular k-means problem in d-dimensional Euclidean space. Recently Friggstad, Rezapour, Salavatipour [FOCS’16] and Cohen-Addad, Klein, Mathieu [FOCS’16] showed that the stanOpdq dard local search algorithm yields a p1`εq-approximation in time pn¨kq1{ε , giving the first polynomialtime approximation scheme for the problem in low-dimensional Euclidean space. While local search achieves optimal approximation guarantees, it is not competitive with the state-of-the-art heuristics such as the famous k-means++ and D2 -sampling algorithms. In this paper, we aim at bridging the gap between theory and practice by giving a p1`εq-approximation ´1 Opdq , and so matching the running algorithm for low-dimensional k-means running in time n¨k¨plog nqpdε q 2 time of the k-means++ and D -sampling heuristics up to polylogarithmic factors. We speed-up the local search approach by making a non-standard use of randomized dissections that allows to find the best local move efficiently using a quite simple dynamic program. We hope that our techniques could help design better local search heuristics for geometric problems. 1 Introduction The k-means objective is arguably the most popular clustering objective among practitioners. While originally motivated by applications in image compression, the k-means problem has proven to be a successful objective to optimize in order to pre-process and extract information from datasets. Its most successful applications are now stemming from machine learning problems like for example learning mixture of Gaussians, Bregman clustering, or DP-means [33, 51, 16]. Thus, it has become a classic problem in both machine learning and theoretical computer science. Given a set of points in a metric space, the k-means problem asks for a set of k points, called centers, that minimizes the sum of the squares of the distances of the points to their closest center. The most famous algorithm for k-means is arguably the Lloyd1 heuristic introduced in the 80s [50] and sometimes referred to as “the k-means algorithm”. While this algorithm is very competitive in practice and yields empirically good approximate solutions to real-world inputs, it is known that its running time can be exponential in the input size and that it can return arbitrarily bad solutions in the worst-case (see [8]). This induces a gap between theory and practice. Thus, to fix this unsatisfactory situation, Arthur and Vassilvitskii [9] have designed a variant of the Lloyd heuristic, called k-means++, and proved that it achieves an Oplog kq approximation. The k-means++ algorithm has now become a standard routine that is part of several machine learning libraries (e.g., [59]) and is widely-used in practice. While this has been a major step for reducing the gap between theory and practice, it has remained an important problem as to conceive algorithms with nearly-optimal approximation guarantee. Unfortunately, the k-means problem is known to be APX-Hard even for (high dimensional) Euclidean inputs [14]. Hence, to design competitive approximation schemes it is needed to restrict our attention to classes of “more structured” inputs that are important in practice. The low-dimensional Euclidean inputs form a class of inputs that naturally arise in image processing and machine learning (see examples of [59] or in [43]). Thus, finding a polynomial time approximation scheme (PTAS) for Op1q-dimensional Euclidean inputs of k-means has been an important research problem for the last 20 years since the seminal work of [42]. Recently, Friggstad et al. [35] and Cohen-Addad et al. [26] both showed that the classic local search 1 Also referred to as Lloyd-Forgy 1 heuristic with neighborhood of magnitude pd{εqOpdq achieves a p1`εq-approximation. While this has been an important result for the theory community, it has a much weaker impact for practitioners since the running Opdq time of the algorithm is npd{εq . Therefore, to reduce the gap between theory and practice, it is natural to ask for near-optimal approximation algorithms with competitive running time. This is the goal of this paper. Fast local search techniques are important. The result of Friggstad et al. and Cohen-Addad et al. has been preceded by several result showing that local search achieves good approximation bound or even exact algorithms for various problems (see e.g., [56, 45, 19, 54, 25]). Furthermore, there is a close relationship between local search and clustering showing that the standard local search heuristics achieve very good approximation guarantees in various settings (in addition to the two aforementioned papers, see [12, 43, 28, 27, 19, 53]). Moreover local search approaches are extremely popular in practice because they are easy to tune, easy to implement, and easy to run in parallel. Thus, it has become part of the research agenda of the theory community to develop fast local search approaches while preserving the guarantees on the quality of the output (see e.g., [30, 57]). 1.1 Our Results We show that our fast local search algorithm (Algorithm 1) yields a PTAS for the slightly more general variants of the k-means problem where centers can have an opening cost (a.k.a. weight). Theorem 1.1. There exists a randomized algorithm (Algorithm 1) that returns a p1 ` εq approximation to ´1 Opdq the center-weighted d-dimensional Euclidean k-means problem in time n ¨ k ¨ plog nqpdε q with probability at least 1{2. We would like to remark that the doubly exponential dependency in d is needed: Awasthi et al. [14] showed that the Euclidean k-means is APX-Hard when d “ Ωplog nq. Note that it is possible to obtain an arbitrarily small probability of failure p ą 0 by repeating the algorithm log 1{p times. As far as we know, this is the first occurrence of a local search algorithm whose neighborhood size only impacts the running time by polylogarithmic factors. 1.2 Other Related Work The k-means problem is known to be NP-Hard, even when restricted to inputs lying in the Euclidean plane (Mahajan et al. [52], and Dasgupta and Freud [31]) and was recently shown to be APX-hard in Euclidean space of dimension Ωplog nq ([14]). There has been a large body of work on approximation algorithms for the Euclidean k-means problem (see e.g., [43]), very recently Ahmadian et al. [2] gave a 6.357-approximation improving over the 9-approximation of Kanungo et al. [43]. Given the hardness results, researchers have focused on different scenarios. There have been various p1 ` εq-approximation algorithms when k is considered a fixed-parameter (see e.g., [34, 48]). Another successful approach has been through the definition of “stable instances” to characterize the real-world instances stemming from machine learning and data analysis (see for example [15, 13, 18, 17, 21, 46, 58, 28, 3]) or in the context of smoothed analysis (see for example [10, 7]). In the case of low-dimensional inputs, Bandyapadhyay and Varadarajan showed that local search with neighborhood of size ε´Opdq achieves a p1 ` εq-approximation [19] when allowed to open Opεkq extra centers. As mentioned before, this results has been improved by Friggstad et al. [35] and Cohen-Addad et al. [26] who showed that even when constrained to open exactly k centers, local search achieves a p1 ` εq-approximation. Related work on local search Local Search heuristics belong to the toolbox of all practitioners, (see Aarts and Lenstra [1] for a general introduction). As mentioned before, there is a tight connection between local search and clustering: Arya et al. [12] proved that local search with a neighborhood size of 1{ε yields a 3 ` 2ε approximation to k-median. For the k-means problem, Kanungo et al. [43] showed a similar result by proving that the approximation guarantee of local search for Euclidean k-means is 9 ` ε. For more applied 2 examples of local search an clustering see [20, 22, 38, 60, 37, 4, 41]. For other theoretical example of local search for clustering, we refer to [29, 32, 36, 40, 61]. Related work on k-median. The k-median problem has been widely studied. For the best known results in terms of approximation for general metric spaces inputs we refer to Li and Svensson [49] and Byrka et al. [24]. More related to our results are the approximation schemes for k-median in low-dimensional Euclidean ´Opdq space given by Arora et al. [6] who gave a p1 ` εq-approximation algorithm running in time nε . This ´Opdq was later improved by Kolliopoulos and Rao [44] who obtained a running time of 2ε n ¨ polylog n. Quite surprisingly, it is pretty unclear whether the techniques used by Arora et al. and Kolliopoulos and Rao could be used to obtain a p1 ` εq-approximation for the k-means problem; this has induced a 20-year gap between the first PTAS for k-median and the first PTAS for k-means in low-dimensional Euclidean space. See Section 1.3 for more details. 1.3 Overview of the Algorithm and the Techniques Our proof is rather simple. Given a solution L, our goal is to identify – in near-linear time – a minimum cost solution L1 such that |L ´ L1 | ` |L1 ´ L| ď δ for some (constant) parameter δ. If costpLq ´ costpL1 q “ OpεcostpOPTq{kq, then we can immediately apply the result of Friggstad et al. [35] or Cohen-Addad et al. [26]: the solution L is locally optimal and its cost is at most p1 ` OpεqqcostpOPTq. Finding L has to be done in near-linear time since we could repeat this process up to Θpkq times until reaching a local optimum. Hence, the crux of the algorithm is to efficiently identify L1 , it proceeds as follows (see Algorithm 1 for a full description): 1. Compute a random recursive decomposition of L (see Section 2); 2. Apply dynamic programming on the recursive decomposition; we show that there exists a near-optimal solution whose interface between different regions has small complexity. To obtain our recursive decomposition we make a quite non-standard use of the classic quadtree dissection techniques (see Section 2). Indeed, the k-means problem is famous for being “resilient” to random quadtree approaches – this is partly why a PTAS for the low-dimensional k-median problem was obtained 20 years ago but the first PTAS for the k-means was only found last year. More precisely, the classic quadtree approach (which works well for k-median) defines portals on the boundary of the regions of the dissection and forces the clients of a given region that are served by a center that is in a different region (in the optimal solution) to make a detour through the closest portal. This is a key property as it allows to bound the complexity of OPT between regions. Unfortunately, when dealing with squared distances, making a detour could result in a dramatic cost increase and it is not clear that it could be compensated by the fact that the event of separating a client form its center happens with small probability (applying the analysis of Arora et al. [6] or Kolliopoulos et al. [44]). This problem comes from the fact that some facilities of OPT and L might be too close from the boundary of the dissection (and so, their clients might have to make too important detour (relative to their cost in OPT) through the portals). We call these facility the “moat” facilities (as they fall in a bounded-size “moat” around the boundaries). We overcome this barrier by defining a more structured near-optimal solution as follows: (1) when a facility of OPT is too close from the boundary of our dissection we simply remove it and (2) if a facility of the current solution L is too close from a boundary of our dissection we add it to OPT. Of course, this induces two problems: first we have to bound the cost of removing the facilities of OPT and second we have to show that adding the facilities of L does not result in a solution containing more than k centers. This is done through some technical lemmas and using the concept of isolated facilities inherited from Cohen-Addad et al. [26]. Section 3 shows the existence of near-optimal solution S ˚ whose set of moat facilities (i.e., facilities that are too close from the boundaries) is exactly the set of moat facilities of L (and so, we already know their location and so the exact cost of assigning a given client to such a facility). We now aim at using the result of Friggstad et al. [35] and Cohen-Addad et al. [26]: if for any sets ∆1 Ď L and ∆2 Ď S ˚ , we have costpLq ´ costpL ´ ∆1 Y ∆2 q “ OpεcostpOPTq{kq, then we have costpLq ď p1 ` OpεqcostpS ˚ q. Thus, we provide a dynamic program (in Section 5) that allows to find the best solution S that is such that (1) its set of moat facilities is exactly the set of moat facilities of L and (2) |S´L|`|L´S| ď δ 3 for some fixed constant δ. The dynamic program simply “guess” the approximate location of the centers of pL ´ Sq Y pS ´ Lq, we show that since each such center is far from the boundary, its location can be approximated. 1.4 Preliminaries In this article, we consider the k-means problem in a d-dimensional Euclidean space: Given a set A of points (also referred to ř as clients) and candidate centers C in Rd , the goal is to output a set S Ď C of size k that minimizes: aPA distpa, Cq2 , where distpa, Cq “ mincPC distpa, cq. We refer ř to S as a set of centers or facilities. Our results naturally extends to any objective function of the form aPA distpa, Cqp for constant p. For ease of exposition, we focus on the k-means problem. As Friggstad et al [35], we also consider the more general version called weighted k-means for which,řin addition ř of the sets A and C, we are given a weight function w : C ÞÑ R` and the goal is to minimize cPC wpcq ` aPA distpa, Cq2 . A classic result of Matousek [55] shows that, if C “ Rd , it is possible to compute in linear time a set C 1 of linear size (and polynomial dependency in d and ε) such that the optimal solution using the centers in C 1 cost at most p1 ` εq times the cost of the optimal solution using C. Hence, we assume without loss of generality that |C| has size linear in |A| and we let n “ |A| ` |C|. Isolated Facilities. We make use of the notion of isolated facilities introduced by Cohen-Addad et al. [26] defined as follows. Let ε0 ă 1{2 be a positive constant and L and G be two solutions for the Euclidean k-means problem. Definition 1.2. Let ε0 ă 1{2 be a positive number and let L and G be two solutions for the k-clustering problem with parameter p. Given a facility f0 P G and a facility ℓ P L, we say that the pair pf0 , ℓq is 1-1 ε0 -isolated if most of the clients served by ℓ in L are served by f0 in G, and most of the clients served by f0 in G are served by ℓ in L; formally, if " * p1 ´ ε0 q|VL pℓq|, |VL pℓq X VOPT pf0 q| ě max p1 ´ ε0 q|VOPT pf0 q| When ε0 is clear from the context we refer to 1-1 ε0 -isolated pairs as 1-1 isolated pairs. Theorem 1.3 (Theorem III.7 in [26]). Let ε0 ă 1{2 be a positive number and let L and G be two solutions for the k-clustering problem with exponent p. Let k̄ denote the number of facilities f of G that are not in a 1-1 ε0 -isolated region. There exists a constant c and a set S0 of facilities of G of size at least ε30 k̄{6 that can be removed from G at low cost: costpG ´ S0 q ď p1 ` c ¨ ε0 qcostpGq ` c ¨ ε0 costpLq. Observe that since ε0 ă 1{2, each facility of L belongs to at most one isolated region. Let G̃ denote the facilities of G that are not in an isolated region. In the rest of the paper, we will use it with ε0 “ ε3 . 1.5 Fast Local Search This section is dedicated to our the description of the fast local search algorithm for the k-means problem. It relies on a dynamic program called FindImprovement that allows to find the best improvement of the current solution in time n ¨ polyε,d plog nq. We then show that total number of iterations of the do-while loop is Opkq. 2 Dissection Procedure In this section, we recall the classic definition of quadtree dissection. For simplicity we give the definition for R2 , the definition directly generalizes to any fixed dimension d, see Arora [5] and Arora et al. [6] for a complete description. Our definition of quadtree is standard and follows the definition of [5, 6], our contribution in the structural properties we extract from the dissection and is summarized by Lemma 2.3. Let L be the length of the bounding box of the client set A (i.e., the smallest square containing all the points in A). Applying standard preprocessing techniques, see in [44] and [6], it is possible to assume that 4 Algorithm 1 Fast Local Search for k-Means 1: Input: An n-element client set A, an m-element candidate center set C, a positive integer parameter k, an opening cost function w : C ÞÑ R` , and an error parameter 0 ă ε ă 1{2, 2: L Ð Op1q-approximation. 3: Round up the weights of the candidate centers to the closest p1 ` εqi ¨ ε ¨ costpLq{n for some integer i. 4: do 5: Improv Ð 0 6: L˚ Ð L 7: repeat log k times (to boost the success probability) 8: Compute a random decomposition D of L (as in Sec. 2). Let M be the moat centers of L. 9: L1 Ð output of FindImprovement(L, D, M, dOpdq ε´Opdq ) 10: if Improv ď costpLq ´ costpL1 q then 11: Improv Ð costpLq ´ costpL1 q 12: L˚ Ð L1 13: end if 14: L Ð L˚ 15: while Improv ą εcostpLq{k 16: Output: L the points lie on a unit grid of size polynomial in the number of input points. This incurs an addititive error of OpOPT{nc q for some constant c and yields L “ n ¨ polypε´d q. We define a quadtree dissection D of a set of points P as follows. A dissection of (the bounding box of) L is a recursive partitioning into smaller squares. We view it as a 4-ary tree whose root is the bounding box of the input points. Each square in the tree is partitioned into 4 equal squares, which are its children. We stop partitioning a square if it has size ă 1 (and therefore at most one input point). It follows that the depth of the tree is log L “ Oplog nq. Standard techniques show that such a quadtree can be computed in n ¨ log n ¨ polypε´d q, see [44] for more details. The total number of nodes of the quadtree is n ¨ log n ¨ polypε´d q. Given two integers a, b P r0, Lq, the pa, bq-shifted dissection consists in shifting the x- and y- coordinates of all the vertical and horizontal lines by a mod L and b mod L respectively. For a shifted dissection, we naturally define the level of a bounding box to be its depth in the quadtree. From this, we define the level of a line to be the level of the square it bounds. For a given square of the decomposition, each boundary of the square defines a subline of one of the 2L lines of the grid. It follows that each line at level i consists of 2i sublines of length L{2i . Given an pa, bq-shifted quadtree dissection of a set of n points, and given a set of points U , we say that a point p of U is an i, γ-moat point if it is at distance less than γ ¨ L{2i of a line of the dissection that is at level i. We say that a point p of U is a γ-moat point if there exists an i such that p is a i, γ-moat point. When γ is clear from the context, we simply call such a point a moat point. We have: Lemma 2.1. For any p P U , the probability that p is a γ-moat point is at most γ log L “ Opγ log nq. Proof. Let i be an integer in r0, . . . , log Ls and consider the horizontal lines at level i (an analogous reasonning applies to the vertical lines). By definition, the number of dissection lines that are at distance at most γL{2i from p is γL{2i . We now bound the probability that one of them is at level i (and so the probability i of p being at distance less than γL{2i of a horizontal line of length ř L{2 ). For any such line l, we have: i P ra rl is at level is “ 2 {L. Hence, P ra rp is a i, γ-moat points ď l:distpl,pqďγL{2i P ra rl is at level is ď γ. The lemma follows by taking a union bound over all i. We now consider an optimal solution OPT and any solution L. In the following, we will focus on γ-moat centers of L and OPT for γ “ ε13 { log n. In the rest of the paper, γ is fixed to that value and so γ-moat centers are simply called moat centers. Let ι the facilities of OPT that are not 1-1 isolated. We define a weigth function w̃ : LYOPTYOPT ÞÑ R` as follows. For each facility s P ι we define w̃psq as the sum of wpsq and the cost of serving all the clients served by s in OPT by the closest facility ℓ in L plus wpℓq. For each facility s ř P L we define w̃psq “ wpsq ` ř distpc, sq. Similarly, for each s P OPT´ι, we let w̃psq “ wpsq` c served by s in L c served by s in OPT distpc, sq. 5 We show: Lemma 2.2. There exists a constant c0 such that ř sPι w̃psq ď c0 pcostpOPTq ` costpLqq. Proof. Consider a facility s P ι and the closest facility l in L that (1) serves in L at least one client that is served by s in OPT and that (2) minimizes the following quantity: η “ minc distpc, lq2 ` distpc, sq2 . Let c˚ be a client that minimizes theř quantity distpc, lq2 ` distpc, sq2 . Let N psq be the set of all clients served by s in OPT. We have: |N psq|η ď cPN psq distpc, Lq2 ` distpc, OPTq2 . of sending all the clients in N psq is at most (by triangle inequality): ř ř We have that the total cost 2 sq ` distps, cq ` distpc, lqq2 . Note that there exists a concPN psq pdistpc, cPN psq pdistpc, sq ` distps, lqq ď ř stant c0 such that the above sum is at most c0 cPN psq distpc, sq2 ` distps, c˚ q2 ` distpc˚ , lq2 and so at most ř c0 p|N psq|η ` cPN psq distpc, OPTq2 q. The lemma follows by combining with the above bound on |N psq|η. In the following we denote by φ : ι ÞÑ L the mapping from each non-isolated facility of OPT to its closest facility in L. We define ιL to be the set of non-isolated facilities of L. We define Event EpL Y OPT, w̃q as follows: ř ř 1. The set of moat centers S1 of L Y ι is such that w̃pS1 q “ cPS1 w̃pcq ď ε9 cPLYι w̃pcq “ ε9 w̃pL Y ιq, and 2. The set of moat centers S1 of ιL Y ι is such that |S0 | ď ε9 |ιL Y ι| “ ε9 k̄ (recall that k̄ is the number of non 1-1-isolated facilities of OPT (and so of L as well)). The following lemma follows from Lemma 2.1, applying Markov’s inequality and taking a union bound over the probability of failures of property (1) and (2). Lemma 2.3. The probability that Event EpL Y OPT, w̃q happens is at least 1{2. Proof. We apply Lemma 2.1 and obtain that any element of L Y OPT is a moat center with probability Opρ´1 log nq. Since ρ´1 “ pcε´12 log nq´1 , we obtain that this probability is at most ε12 . Thus, taking linearity of expectation we have that the expected size of S0 is at most ε12 |S Y ι| and that the expected value of w̃pS0 q is at most ε12 w̃pS Y ιq. Applying Markov’s inequality to obtain concentration bounds on both quantities and then taking a union bound over the probabilities of failure yields the lemma. We finally conclude this section with some additional definitions that are used in the following sections. We define a basic region of a decomposition of a to be a region of the dissection that contains exactly 1 points of L. The other squares of the decomposition are simply called regions. 3 A Structured Near-Optimal Solution This section is dedicated to the following proposition. Proposition 3.1. Let L be any solution. Let DL be a random quadtree dissection of L as per Sec. 2. Suppose Event EpL Y OPT, w̃q happens. Then there exists a constant c and a solution S ˚ of cost at most p1 ` c ¨ εqcostpOPTq ` c ¨ εcostpLq and such that the set of moat centers of S ˚ is equal to the set of moat centers of L. We prove Propositon 3.1 by explicitly constructing S ˚ . We iteratively modify OPT in four main steps: 1. Modify OPT by replacing f0 by ℓ0 for for each 1-1 isolated pair pf0 , ℓ0 q where ℓ0 or f0 is a moat center. This yields a near-optimal solution S0 (Lemma 3.2). 2. Replace in OPT each moat center s that is in ι by φpsq (as per Section 2). This yields a near-optimal solution S1 (Lemma 3.3). 3. Apply Theorem 1.3 (i.e., Theorem III.7 in [26]) to obtain a near-optimal solution S2 that has at most k ´ c2 ε 9 ¨ s k where s k is the number of facilities of OPT that are not 1-1 isolated (Lemma 3.4). 4. Add the moat centers of L that are non 1-1 isolated to S2 . This yields a near-optimal solution S3 that has at most k centers. See Section 3.4 for a detailed proof. 6 3.1 1-1 Isolated Pairs We start from OPT and for each 1-1 isolated facility pf0 , ℓ0 q, f0 P OPT, ℓ0 P L, where ℓ0 or f0 is a moat center, we replace f0 by ℓ0 in OPT. This results in a solution S0 whose structural properties are captured by the following lemma. For any f0 P OPT (resp. ℓ0 P OPT), let VOPT pf0 q (resp. VL pℓ0 q) be the set of clients served by f0 in OPT (resp. the set of clients served by ℓ0 in L). Lemma 3.2. Assuming Event EpL Y OPT, w̃q happens, there exists a constant c0 such that costpS0 q ď p1 ` c0 ¨ εqcostpOPTq ` c0 ¨ εcostpLq. Proof. Since Event EpL Y OPT, w̃q happens, we have by Lemma 2.3 that the total opening cost of the moat centers plus the total service cost induced by the clients served by the moat centers is bounded by c1 ¨ ε ¨ pcostpLq ` costpOPTqq for some constant c1 . More formally, we can write: ÿ ÿ pwpℓ0 q ` distpa, ℓ0 qq ď c1 ¨ ε ¨ pcostpLq ` costpOPTqq pf0 ,ℓ0 q: 1-1 isolated pair and ℓ0 or f0 is a moat center aPVL pℓ0 q Thus, we need to bound the cost for the clients that are in VOPT pf0 q ´ VL pℓ0 q, for each 1-1 isolated pair f0 , ℓ0 where ℓ0 or f0 is a moat center. Consider such a pair f0 , ℓ0 . We bound the cost of the clients served by f0 in OPT by the cost of rerouting them toward ℓ0 . We can thus write for each such client c: distpc, ℓ0 q2 ď pdistpc, f0 q ` distpℓ0 , f0 qq2 . Also, distpc, ℓ0 q2 ď p1 ` εq2 distpc, f0 q2 ` p1 ` ε´1 q2 distpℓ0 , f0 qq2 . Note that distpc, f0 q2 is the cost paid by c in OPT. Thus we aim at bounding distpℓ0 , f0 q. Applying the triangle inequality, we obtain distpℓ0 , f0 q2 ď pdistpℓ0 , c1 q ` distpc1 , f0 qq2 , for any c1 in VOPT pf0 q X VL pℓ0 q. Hence, distpℓ0 , f0 q2 ď 1 |VOPT pf0 q X VL pℓ0 q| ÿ pdistpℓ0 , c1 q ` distpc1 , f0 qq2 . c1 PVOPT pf0 qXVL pℓ0 q Now, ÿ pdistpℓ0 , c1 q ` distpc1 , f0 qq2 ď 3 c1 PVOPT pf0 qXVL pℓ0 q ÿ distpc1 , ℓ0 q2 ` distpc1 , f0 q2 . c1 PVOPT pf0 qXVL pℓ0 q Combining, we obtain that the total cost for the clients in VOPT pf0 q ´ VL pℓ0 q is at most ¨ ˛ ÿ ÿ distpc, ℓ0 q2 ď p1 ` εq2 ˝ distpc, f0 q2 ‚` |VOPT pf0 q ´ VL pℓ0 q|p1 ` ε´1 q2 distpℓ0 , f0 q2 cPVOPT pf0 q´VL pℓ0 q ¨ ď p1 ` εq2 ˝ ` p1 ` ε´1 q2 cPVOPT pf0 q´VL pℓ0 q ÿ cPN pf0 q´N pℓ0 q ˛ distpc, f0 q2 ‚ |VOPT pf0 q ´ VL pℓ0 q| ¨3 |VOPT pf0 q Y VL pℓ0 q| ÿ distpc1 , f0 q2 ` distpc1 , ℓ0 q2 c1 PVOPT pf0 qXVL pℓ0 q The lemma follows from applying the definition of 1-1 isolation: |VOPT pf0 q´VL pℓ0 q|{|VOPT pf0 qYVL pℓ0 q| ď ε3 , and summing over all 1-1 isolated pair. 3.2 Replacing the Moat Centers of OPT In this section, we consider the solution S0 and define a solution S1 whose set of moat centers is a subset of the moat centers of L. Namely: Lemma 3.3. There exists a constant c1 and a solution S1 such that the moat centers of S1 are a subset of the moat centers of L and costpS1 q ď p1 ` c1 εqcostpS0 q ` c1 εcostpLq. 7 Proof. Note that by Lemma 3.2, all the 1-1 isolated facilities of S0 that are moat centers are also in L. Thus, we focus on the moat centers of S0 that are not 1 ´ 1-isolated (and so, by definition, in ι). We replace each center s P ι by the center φpsq P L (as per Section 2): the bound on the cost follows immediately from the definition of w̃ and by combining Lemma 2.3 and Lemma 2.2. 3.3 Making Room for Non-Isolated Moat Facilities We now consider the solution S1 described in the previous section that satisfies the condition of Lemma 3.2. The following lemma is a direct corollary of Theorem 1.3 (from [26]). Lemma 3.4. Given S1 and L, there exists a solution S2 Ď S1 and constants c2 , c3 such that k, where s k is the number of facilities that are not 1-1 isolated in OPT (or in L it is 1. |S2 | ď k ´ c2 ¨ ε9 s the same number), and 2. costpS2 q ď p1 ` c3 ¨ εqcostpOPTq ` c3 ¨ ε ¨ costpLq. 3.4 Adding the Non-Isolated Moat Facilities and Proof of Proposition 3.1 We now consider the set of centers S3 consisting of the centers in S2 and the non-1-1-isolated moat centers of L. Proof of Proposition 3.1. Combining Lemmas 3.2, 3.3, and 3.4 yields the bound on the cost of S3 . By definition of S3 and applying Lemmas 3.2 and 3.3, we have that the set of moat centers of S3 is exactly the set of moat centers of L. By Lemma 3.4 (and because Event EpL Y OPT, w̃q happens), we have that the total number of centers in S3 is at most k. 4 Proof of Theorem 1.1 We summarize: By Proposition 3.1, we have that there exists a near-optimal solution S ˚ whose set of moat centers is the set of moat centers of L. By Proposition 5.3, we have that, FindImprovement identifies a solution S 1 that is δ-close w.r.t. L, whose set of moat centers is the set of moat centers of L, and such that costpLq ´ costpS 1 q ě p1 ´ εqpcostpLq ´ costpOPTδ qq, where OPTδ is the minimum cost solution S such that |S ´ L| ` |L ´ S| ď δ. We now argue that: If FindImprovement outputs a solution S4 such that costpLq ´ costpS4 q ď εcostpOPTq{k then there exists a constant c˚ such that costpLq ď p1 ` c˚ ¨ εqcostpOPTq. Assuming costpLq ´ costpS4 q ď εcostpOPTq{k implies by Proposition 5.3 that costpLq ´ costpOPTδ q ď 2εcostpOPTq{k, since ε ă 1{2. Now, consider the solution S ˚ defined in Section 3. By Theorem 1 in [35] (see also [26] for a slightly better dependency in ε in the unweighted case), if for any pair of sets ∆1 Ď L, ∆2 Ď S2 such that |∆2 | ď |∆1 | “ pdε´1 qOpdq , we have costpLq ´ costpL ´ ∆1 Y ∆2 q ď εOPT{k, then there exists a constant c6 such that costpLq ď p1 ` c6 ¨ εqcostpS2 q. To obtain such a bound we want to apply Proposition 5.3, and so we need to show that any such solution M “ L ´ ∆1 Y ∆2 is such that its moat centers are the moat centers of L. This follows immediately from Proposition 3.1: the moat centers of S ˚ are the moat centers of L. Therefore, we can apply Proposition 5.3 and we have costpLq ď p1 ` c˚ ¨ εqcostpOPTq, for some constant ˚ c . We now bound the running time of Algorithm 1. ´1 Opdq Lemma 4.1. The running time of Algorithm 1 is at most n ¨ k ¨ plog nqpdε q . Proof. By Proposition 5.3, we only need to bound the number of iterations of the do-while loop (lines 4 to 15) of Algorithm 1. Let costpS0 q denotes the cost of the initial solution. The number of iterations of the do-while loop is logpcostpS0 q{costpOPTqq . 1 q logp 1´1{k 8 Assuming costpS0 q ď OpOPTq, we have that the total number of iterations is at most Opkq. To obtain costpS0 q ď OpOPTq it is possible to use the algorithm of Guha et al. [39] which outputs an Op1qapproximation in time n ¨ k ¨ polylogpnq, as a preprocessing step (i.e., for the computations at line 2), without increasing the overall running time. We conclude by bounding the probability of failure: By lemma 2.3, Event E happens with probability at least 1/2. Since the random dissection is repeated independently c ¨ logpkq times, the probability of failure of Event E for a given iteration of the while loop is at most 2´c¨log k “ k ´c . Now, by Lemma 4.1, the do-while loop is repeated a total of at most Opkq times, thus the probability of failure is at most Opk ´c`1 q. 5 A Dynamic Program to Find the Best Improvement For a given solution L, we define a solution L1 to be δ-close from L if |L ´ L1 | ` |L1 ´ L| ď δ. Let OPTδ denote the cost of the best solution that is δ-close from L and whose set of moat centers is the set of moat centers of L. In the following we refer to this solution by the best δ-close solution. As a preprocessing step, we round the weights of the centers to the closest p1 ` εqi OPT{n, for some integer i. It is easy to see that this only modify the total value by a factor p1 ` εq. For each region R, we define the center of the region cR to be the center of the square R. For each point p that is outside of R and at distance at least εBR{ log n of R, we define the coordinates of p w.r.t. cR as i 14 Ñ follows. Consider the coordinates of the vector Ý cÝ R p, rounded to the closest p1 ` ε{ log nq ε BR{ log n, for ÝÝÑ some integer i. Let cĄ R p be the resulting list of coordinates. Let s the point such that the coordinates of the ÝÝÑ Ñ vector Ý cÝ R s are equal to the coordinates of cĄ R p. We define the coordinates of p rounded w.r.t. R to be the coordinates of s. For each region R we also define the grid GR of R as the d-dimensional grid of size 2 log n{ε14 ˆ ... ˆ 2 log n{ε14 on R. Note that the distance between two consecutive points of the grid is ε14 BR{2 log n. For each point p that is inside of R, we define the coordinates of p rounded w.r.t. R to be the coordinates of the closest grid point. The following fact follows from the definition and recalling that the region sizes are in the interval r1, polypnqs. Fact 1. For any region R, the number of different coordinates rounded w.r.t. to R is at most Opplog n{ε14 q2d . We now describe the dynamic program. Each entry of the table is defined by the following parameters: • a region R, • a list of the rounded coordinates w.r.t. R of the centers of L ´ OPTδ and OPTδ ´ L, • a list of the (rounded) weights of the centers of L ´ OPTδ and OPTδ ´ L. • a boolean vector of length δ indicating whether ith center in the above lists is in L ´ OPTδ (value 0)or in OPTδ ´ L (value 1). The following fact follows from the definition and Fact 1. Fact 2. The total number of entries that are parameterized by region R is at most plog n{ε14 qOpd¨δq . We now explain how to fill-up the table. We maintain the following constraint when we compute a (possibly partial) solution L1 : there is no center of pL1 ´ Lq Y pL ´ L1 q that is moat. Under this constraint, we proceeds as follows, starting with the basic regions which define the base-case of our DP. The base-case regions contains only one single candidate center. Hence, the algorithm proceeds as follows: it fills up table entries that are parameterized by: • any boolean vector of length δ. • the rounded coordinates of the unique candidate center inside R and a set of δ ´ 1 rounded coordinates for the centers of pL ´ OPTδ q Y pOPTδ ´ Lq outside R, or 9 • a set of δ rounded coordinates for the centers of pL ´ OPTδ q Y pOPTδ ´ Lq outside R. Additionally, we require that the boolean vector is consistent with the rounded coordinates: the candidate center inside R is already in L if and only if its corresponding boolean entry is 0. It iterates over all possible rounded coordinates for the at most δ centers of pL ´ OPTδ q Y pOPTδ ´ Lq outside R and for each of possibility, it computes the cost. Note that this can be done in time n ¨ δ. We now consider the general case which consists in merging table entries of child regions. Fix a table entry parameterized by a region R, and the rounded coordinates of the centers of pL ´ OPTδ q Y pOPTδ ´ Lq. We define which tables entries of the child regions are compatible given the rounded coordinates. For a table entry of a child region R1 , with the rounded coordinates of the centers of pL ´ OPTδ q Y pOPTδ ´ Lq, we require the following for all center c0 P pL ´ OPTδ q Y pOPTδ ´ Lq. Denote by c̃10 the coordinates of c0 P pL ´ OPTδ q Y pOPTδ ´ Lq rounded w.r.t. cR1 , namely its values in the table entry for R1 . Let c̃R 0 denote its rounded coordinate w.r.t. R, namely its values in the table entry for R. We require: • If c̃R 0 is outside R, we say that the table entries are compatible for c0 if the coordinates of the vector ÝÝÝÑ ÝÝÑ cR c̃10 and cR c̃R 0 are all within a p1 ˘ ε{ log nq factor. • If c0 is inside R, we say that the table entries are compatible for c0 if the point of the grid GR that is the closest to c̃10 is c̃R 0. • the entries corresponding to c0 in the boolean vectors are the same. The following lemma follows immediately from the above facts and the definition. Lemma 5.1. The running time of the dynamic program is nplog n{εqOpdδq . We now turn to the proof of correctness. For a given region R, and a δ-close solution S we define the table entry of R induced by S to be the table entry parameterized by R and the coordinates of the centers of pL ´ Sq Y pS ´ Lq rounded w.r.t. R. Lemma 5.2. Consider the best δ-close solution OPTδ . For any level i of the quadtree dissection, for any reř gion R at level i, we have that the table entry induced by OPTδ has cost at most cPR pp1`ε{ log nqi distpc, OPTδ qq2 . Proof. Observe that we consider a δ-close solution that has the same set of moat centers than L. Hence, if a client is served by a moat center in OPTδ , we know exactly the position of this center (as it is also in L and so cannot be removed). Thus, for any region R, the set of clients in R is served by either a center in R or a center at distance at least ε13 BR{ log n from the boundary of R or a center of L that is a moat center. We now proceed by induction. We consider the base case: let R be a region at the maximum level. Consider the table entry induced by OPTδ . We claim that for each client c in R, the cost induced by the solution for this table entry is at most p1 ` ε{ log nqdistpc, OPTδ q. Indeed, since OPTδ has the same set of moat centers each client that is served by a center outside of R that is at distance at most ε13 BR{ log n from the boundary is served by a moat center of L and so there is no approximation in its service cost. Each client that is served by a center of OPTδ ´ L is at distance at least ε13 BR{ log n and so, the error induced by the rounding is at most εdistpc, OPTδ q{ log n. Finally, the cost for the clients in R served by the unique center of R (if there is one) is exact. Thus, assume that this holds up to level i ´ 1. Consider a region R at level i and the table entry induced by OPTδ . The inductive hypothesis implies that for each of the table entries of the child ř regions that are induced by OPTδ , the cost for the clients in each subregion is at most p1 ` ε{ log nqi´1 cPR distpc, OPTδ q2 . By definition, we have that each client of R that is served in OPTδ by a center that is outside R is at distance at least ε13 BR{ log n or a moat center of L (and so the distance is known exactly). Thus the rounding error incurred for the cost of the clients of R served by a center outside R is at most p1`ε{ log nqi distpc, OPTδ q. We now turn to the rounding error introduced for the centers that are inside R. Let c be such a center. We have that the error introduced is at most the distance between two consecutive grid points and so at most ε14 BR{2 log n. Now, observe that again because OPTδ shares the same moat centers than L, each client a pf a child region R1 that suffers some rounding error and that is served by c, is at distance at least ε13 BR1 { log n from c and so, combining with the inductive hypothesis the error incurred is at most p1 ` ε{ log nqi distpa, cq. 10 Proposition 5.3 follows from combining Lemmas 5.1 and 5.2. Proposition 5.3. Let ε ą 0 be a small enough constant. Let L be a solution and D be a decomposition and M be the moat centers of L. The dynamic program FindImprovement output a solution OPTδ such that costpLq´costpOPTδ q ě p1´εqpcostpLq´costpOPTδ qq, where OPTδ is a minimum-cost solution that is δ-close from L and whose set of moat centers is the set of moat centers of L. Its running time is n ¨ plog n{ε14 qOpdδq . References [1] E. Aarts and J. K. Lenstra, editors. Local Search in Combinatorial Optimization. John Wiley & Sons, Inc., New York, NY, USA, 1st edition, 1997. [2] S. Ahmadian, A. Norouzi-Fard, O. Svensson, and J. Ward. Better guarantees for k-means and euclidean k-median by primal-dual algorithms. arXiv preprint arXiv:1612.07925, 2016. [3] H. Angelidakis, K. Makarychev, and Y. Makarychev. Algorithms for stable and perturbation-resilient problems. In H. Hatami, P. McKenzie, and V. King, editors, Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, June 19-23, 2017, pages 438–451. ACM, 2017. [4] E. Ardjmand, N. Park, G. Weckman, and M. R. Amin-Naseri. The discrete unconscious search and its application to uncapacitated facility location problem. Computers & Industrial Engineering, 73:32 – 40, 2014. [5] S. Arora. Nearly linear time approximation schemes for euclidean TSP and other geometric problems. In 38th Annual Symposium on Foundations of Computer Science, FOCS ’97, Miami Beach, Florida, USA, October 19-22, 1997, pages 554–563, 1997. [6] S. Arora, P. Raghavan, and S. Rao. Approximation schemes for Euclidean k -medians and related problems. In Proceedings of the Thirtieth Annual ACM Symposium on the Theory of Computing, Dallas, Texas, USA, May 23-26, 1998, pages 106–113, 1998. [7] D. Arthur, B. Manthey, and H. Röglin. Smoothed analysis of the k-means method. J. ACM, 58(5):19, 2011. [8] D. Arthur and S. Vassilvitskii. How slow is the k-means method? In SoCG, pages 144–153, 2006. [9] D. Arthur and S. Vassilvitskii. k-means++: the advantages of careful seeding. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2007, New Orleans, Louisiana, USA, January 7-9, 2007, pages 1027–1035, 2007. [10] D. Arthur and S. Vassilvitskii. Worst-case and smoothed analysis of the ICP algorithm, with an application to the k-means method. SIAM J. Comput., 39(2):766–782, 2009. [11] S. Arya, D. M. Mount, N. S. Netanyahu, R. Silverman, and A. Y. Wu. An optimal algorithm for approximate nearest neighbor searching fixed dimensions. Journal of the ACM (JACM), 45(6):891–923, 1998. [12] V. Arya, N. Garg, R. Khandekar, A. Meyerson, K. Munagala, and V. Pandit. Local search heuristics for k-median and facility location problems. SIAM J. Comput., 33(3):544–562, 2004. [13] P. Awasthi, A. Blum, and O. Sheffet. Stability yields a PTAS for k-median and k-means clustering. In 51th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2010, October 23-26, 2010, Las Vegas, Nevada, USA, pages 309–318, 2010. [14] P. Awasthi, M. Charikar, R. Krishnaswamy, and A. K. Sinop. The hardness of approximation of Euclidean k-means. In 31st International Symposium on Computational Geometry, SoCG 2015, June 22-25, 2015, Eindhoven, The Netherlands, pages 754–767, 2015. 11 [15] P. Awasthi and O. Sheffet. Improved spectral-norm bounds for clustering. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques - 15th International Workshop, APPROX 2012, and 16th International Workshop, RANDOM 2012, Cambridge, MA, USA, August 15-17, 2012. Proceedings, pages 37–49, 2012. [16] O. Bachem, M. Lucic, and A. Krause. Coresets for nonparametric estimation: The case of dp-means. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pages 209–217. JMLR.org, 2015. [17] M. Balcan, A. Blum, and A. Gupta. Approximate clustering without the approximation. In Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2009, New York, NY, USA, January 4-6, 2009, pages 1068–1077, 2009. [18] M. Balcan and Y. Liang. Clustering under perturbation resilience. SIAM J. Comput., 45(1):102–155, 2016. [19] S. Bandyapadhyay and K. R. Varadarajan. On variants of k-means clustering. CoRR, abs/1512.02985, 2015. [20] M. Bateni, A. Bhaskara, S. Lattanzi, and V. S. Mirrokni. Distributed balanced clustering via mapping coresets. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 2591– 2599, 2014. [21] Y. Bilu and N. Linial. Are stable instances easy? Combinatorics, Probability & Computing, 21(5):643– 660, 2012. [22] G. E. Blelloch and K. Tangwongsan. Parallel approximation algorithms for facility-location problems. In SPAA 2010: Proceedings of the 22nd Annual ACM Symposium on Parallelism in Algorithms and Architectures, Thira, Santorini, Greece, June 13-15, 2010, pages 315–324, 2010. [23] V. Braverman, D. Feldman, and H. Lang. New frameworks for offline and streaming coreset constructions. CoRR, abs/1612.00889, 2016. [24] J. Byrka, T. Pensyl, B. Rybicki, A. Srinivasan, and K. Trinh. An improved approximation for k -median, and positive correlation in budgeted optimization. In Proceedings of the Twenty-Sixth Annual ACMSIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, pages 737–756, 2015. [25] T. M. Chan and S. Har-Peled. Approximation algorithms for maximum independent set of pseudodisks. In Proceedings of the Twenty-fifth Annual Symposium on Computational Geometry, SCG ’09, pages 333–340, New York, NY, USA, 2009. ACM. [26] V. Cohen-Addad, P. N. Klein, and C. Mathieu. Local search yields approximation schemes for k-means and k-median in euclidean and minor-free metrics. In IEEE 57th Annual Symposium on Foundations of Computer Science, FOCS 2016, 9-11 October 2016, Hyatt Regency, New Brunswick, New Jersey, USA, pages 353–364, 2016. [27] V. Cohen-Addad and C. Mathieu. Effectiveness of local search for geometric optimization. In 31st International Symposium on Computational Geometry, SoCG 2015, June 22-25, 2015, Eindhoven, The Netherlands, pages 329–343, 2015. [28] V. Cohen-Addad and C. Schwiegelshohn. On the local structure of stable clustering instances. To appear in the Proceedings of FOCS 2017, abs/1701.08423, 2017. [29] D. Cohen-Steiner, P. Alliez, and M. Desbrun. Variational shape approximation. ACM Trans. Graph., 23(3):905–914, 2004. 12 [30] M. Cygan. Improved approximation for 3-dimensional matching via bounded pathwidth local search. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA, pages 509–518. IEEE Computer Society, 2013. [31] S. Dasgupta and Y. Freund. Random projection trees for vector quantization. IEEE Trans. Information Theory, 55(7):3229–3242, 2009. [32] I. S. Dhillon, Y. Guan, and J. Kogan. Iterative clustering of high dimensional text data augmented by local search. In Proceedings of the 2002 IEEE International Conference on Data Mining (ICDM 2002), 9-12 December 2002, Maebashi City, Japan, pages 131–138, 2002. [33] D. Feldman, M. Faulkner, and A. Krause. Scalable training of mixture models via coresets. In Proceedings of the 24th International Conference on Neural Information Processing Systems, NIPS’11, pages 2142–2150, USA, 2011. Curran Associates Inc. [34] D. Feldman and M. Langberg. A unified framework for approximating and clustering data. In Proceedings of the 43rd ACM Symposium on Theory of Computing, STOC 2011, San Jose, CA, USA, 6-8 June 2011, pages 569–578, 2011. [35] Z. Friggstad, M. Rezapour, and M. R. Salavatipour. Local search yields a PTAS for k-means in doubling metrics. In IEEE 57th Annual Symposium on Foundations of Computer Science, FOCS 2016, 9-11 October 2016, Hyatt Regency, New Brunswick, New Jersey, USA, pages 365–374, 2016. [36] Z. Friggstad and Y. Zhang. Tight analysis of a multiple-swap heurstic for budgeted red-blue median. In 43rd International Colloquium on Automata, Languages, and Programming, ICALP 2016, July 11-15, 2016, Rome, Italy, pages 75:1–75:13, 2016. [37] D. Ghosh. Neighborhood search heuristics for the uncapacitated facility location problem. European Journal of Operational Research, 150(1):150 – 162, 2003. O.R. Applied to Health Services. [38] S. Guha, A. Meyerson, N. Mishra, R. Motwani, and L. O’Callaghan. Clustering data streams: Theory and practice. IEEE Trans. Knowl. Data Eng., 15(3):515–528, 2003. [39] S. Guha, N. Mishra, R. Motwani, and L. O’Callaghan. Clustering data streams. In Foundations of computer science, 2000. proceedings. 41st annual symposium on, pages 359–366. IEEE, 2000. [40] P. Hansen and N. Mladenovic. J-means : a new local search heuristic for minimum sum of squares clustering. Pattern Recognition, 34(2):405–413, 2001. [41] P. Hansen and N. Mladenović. Variable neighborhood search: Principles and applications. European journal of operational research, 130(3):449–467, 2001. [42] M. Inaba, N. Katoh, and H. Imai. Applications of weighted voronoi diagrams and randomization to variance-based k -clustering (extended abstract). In Proceedings of the Tenth Annual Symposium on Computational Geometry, Stony Brook, New York, USA, June 6-8, 1994, pages 332–339, 1994. [43] T. Kanungo, D. Mount, N. Netanyahu, C. Piatko, R. Silverman, and A. Wu. A local search approximation algorithm for k-means clustering. Comput. Geom., 28(2-3):89–112, 2004. [44] S. G. Kolliopoulos and S. Rao. A nearly linear-time approximation scheme for the euclidean k-median problem. SIAM J. Comput., 37(3):757–782, June 2007. [45] E. Krohn, M. Gibson, G. Kanade, and K. R. Varadarajan. Guarding terrains via local search. JoCG, 5(1):168–178, 2014. [46] A. Kumar and R. Kannan. Clustering with spectral norm and the k-means algorithm. In 51th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2010, October 23-26, 2010, Las Vegas, Nevada, USA, pages 299–308, 2010. 13 [47] A. Kumar, Y. Sabharwal, and S. Sen. A simple linear time (1+ ”) -approximation algorithm for k-means clustering in any dimensions. In Proceedings of the 45th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’04, pages 454–462, Washington, DC, USA, 2004. IEEE Computer Society. [48] A. Kumar, Y. Sabharwal, and S. Sen. Linear-time approximation schemes for clustering problems in any dimensions. J. ACM, 57(2), 2010. [49] S. Li and O. Svensson. Approximating k-median via pseudo-approximation. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 901–910, 2013. [50] S. Lloyd. Least squares quantization in PCM. IEEE Trans. on Inform. Theory, 28(2):129 – 137, 1982. [51] M. Lucic, O. Bachem, and A. Krause. Strong coresets for hard and soft bregman clustering with applications to exponential family mixtures. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, AISTATS 2016, Cadiz, Spain, May 9-11, 2016, pages 1–9, 2016. [52] M. Mahajan, P. Nimbhorkar, and K. R. Varadarajan. The planar k-means problem is NP-hard. Theor. Comput. Sci., 442:13–21, 2012. [53] K. Makarychev, Y. Makarychev, M. Sviridenko, and J. Ward. A bi-criteria approximation algorithm for k-means. In K. Jansen, C. Mathieu, J. D. P. Rolim, and C. Umans, editors, Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2016, September 7-9, 2016, Paris, France, volume 60 of LIPIcs, pages 14:1–14:20. Schloss Dagstuhl - LeibnizZentrum fuer Informatik, 2016. [54] D. Marx and M. Pilipczuk. Optimal parameterized algorithms for planar facility location problems using voronoi diagrams. In Algorithms - ESA 2015 - 23rd Annual European Symposium, Patras, Greece, September 14-16, 2015, Proceedings, pages 865–877, 2015. [55] J. Matousek. On approximate geometric k-clustering. Discrete & Computational Geometry, 24(1):61–84, 2000. [56] N. H. Mustafa and S. Ray. Ptas for geometric hitting set problems via local search. In Proceedings of the twenty-fifth annual symposium on Computational geometry, pages 17–22. ACM, 2009. [57] N. H. Mustafa and S. Ray. Improved results on geometric hitting set problems. Discrete & Computational Geometry, 44(4):883–895, 2010. [58] R. Ostrovsky, Y. Rabani, L. J. Schulman, and C. Swamy. The effectiveness of Lloyd-type methods for the k-means problem. J. ACM, 59(6):28, 2012. [59] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in python. J. Mach. Learn. Res., 12:2825–2830, Nov. 2011. [60] D. Tuzun and L. I. Burke. A two-phase tabu search approach to the location routing problem. European journal of operational research, 116(1):87–99, 1999. [61] Y. Yang, M. Shao, S. Zhu, B. Urgaonkar, and G. Cao. Towards event source unobservability with minimum network traffic in sensor networks. In Proceedings of the First ACM Conference on Wireless Network Security, WISEC 2008, Alexandria, VA, USA, March 31 - April 02, 2008, pages 77–88, 2008. 14
8cs.DS
Input-to-state Stability of Impulsive Systems with Different Jump Maps ? Sergey Dashkovskiy ∗ Petro Feketa ∗∗ arXiv:1605.08632v1 [cs.SY] 27 May 2016 ∗ University of Würzburg, Würzburg, Germany (e-mail: [email protected]) ∗∗ University of Applied Sciences Erfurt, Erfurt, Germany (e-mail: [email protected]) Abstract: The paper introduces sufficient conditions for input-to-state stability (ISS) of a class of impulsive systems with jump maps that depend on time. Such systems can naturally represent an interconnection of several impulsive systems with different impulse time sequences. Using a concept of ISS-Lyapunov function for subsystems a small-gain type theorem equipped with a new dwell-time condition to verify ISS of an interconnection has been proven. Keywords: impulsive system, input-to-state stability, interconnection, Lyapunov function, dwell-time condition, small-gain condition. 1. INTRODUCTION infinite-dimensional impulsive systems were developed by Dashkovskiy and Mironchenko (2013). Impulsive systems describe processes that combine continuous and discontinuous behavior. A variety of examples can be found in mathematical modelling of applications in logistics, robotics, population dynamics, etc. A basic mathematical theory of impulsive systems as well as fundamental results on existence and stability of solutions can be found in Samoilenko and Perestyuk (1987) and Lakshmikantham et al. (1989) and references therein. The latest developments in the area of interconnections and systems of a large scale were made in a strongly related class of hybrid systems. We refer the reader to papers of Liberzon et al. (2014); Mironchenko et al. (2014); Sanfelice (2014) with the most recent small-gain theorems on ISS of hybrid systems. However, solutions to hybrid systems are defined on hybrid time domains, as opposed to the usual time defined on the real line. As it was mentioned in Hespanha et al. (2008), this leads to a distinct notion of ISS, and some systems that are ISS in impulsive framework are not ISS in the hybrid framework. This motivates an importance of investigation of explicitly impulsive systems apart from hybrid ones. Nearly at the same time the concept of input-to-state stability (ISS) for systems of ordinary differential equations has been introduced by Sontag (1989). ISS characterizes a behavior of solutions with respect to external inputs. Later it was also studied for discrete-time systems by Jiang and Wang (2001), switched systems by Mancilla-Aguilar and Garcıa (2001) and hybrid systems by Cai and Teel (2005). ISS properties of impulsive systems were firstly studied by Hespanha et al. (2005). Authors provided a set of Lyapunov-based sufficient conditions for establishing ISS with respect to suitable classes of impulsive time sequences. The same approach was used in Hespanha et al. (2008) to justify integral ISS property of impulsive system. An important question of ISS theory is establishing sufficient conditions for ISS of interconnected systems. The first results on the ISS property were given for two coupled continuous systems by Jiang et al. (1994) and for an arbitrarily large number (n ∈ N) of coupled continuous systems by Dashkovskiy et al. (2007). Lyapunov versions of these so-called ISS small-gain theorems were proved by Jiang et al. (1996) (two systems) and by Dashkovskiy et al. (2010) (n systems). Small-gain theorems for impulsive systems with and without time-delay were established by Dashkovskiy et al. (2012). A complementary result for ? This work was supported by the German Federal Ministry of Education and Research (BMBF) as a part of the research project ”LadeRamProdukt”. A significant lack of the previously developed results on interconnections of impulsive systems is that impulsive time sequences of each subsystem must coincide in order to apply known results. The reason for this is trivial: a composition of two impulsive systems with different impulsive time sequences falls out of a class of impulsive systems. Such interconnection requires a jump map to be different depending on time. Moreover, even simple realprocesses (for instance in logistics, see Example 1) require for a jump map that varies from time to time. The aim of this paper is to extend the notion of ISS to impulsive systems with jump maps that depend on time. The novelty of our results is twofold. First, such approach enables modelling of a wider class of processes with continuous and discontinuous dynamics. Second, an interconnection of two impulsive systems will become an impulsive system again. This enables a comprehensive stability analysis of interconnections which subsystems have different impulse time sequences. The rest of the paper is organized as follows. Section 2 contains a short motivation for the framework extension. An extension of impulsive systems to the case of multiple jump sets is proposed in Section 3. A Lyapunov-like sufficient conditions for ISS of impulsive system along with an appropriate dwell-time condition are presented in Section 4. A small-gain type theorem for a network of two impulsive systems with different impulse time sequences is presented in Section 5. A discussion and a short conclusion complete the paper. 2. MOTIVATION Well-known ISS results (Hespanha et al. (2008); Dashkovskiy et al. (2012); Dashkovskiy and Mironchenko (2013)) for impulsive systems were developed for a system of the type  t 6= tk , k ∈ {1, 2, . . .}, ẋ(t) = f (x(t), u(t)), (1) t = tk , k ∈ {1, 2, . . .} x(t) = g(x− (t), u− (t)), where {t1 , t2 , t3 , . . .} is a strictly increasing sequence of impulse times in (t0 , ∞) for some initial time t0 ; the state x(t) ∈ RN is absolutely continuous between impulses; input u(t) ∈ RM is locally bounded and Lebesguemeasurable function; f and g are functions from RN × RM to RN , with f locally Lipschitz. The state x and the input u are assumed to be right-continuous, and to have left limits at all times. We denote by (·)− the left-limit operator, i.e., x− (t) = lims%t x(s). However system (1) does not cover a variety of many real processes. Consider the following Example 1. Let the number x ∈ R≥0 of goods in a storage be continuously decreasing proportionally to the number of items with rate coefficient 0.2. But every odd day (T1 = {1, 3, 5, . . .}) a delivery truck doubles the number of items, and every even day (T2 = {2, 4, 6, . . .}) a delivery truck takes out 40% of items. The evolution of this process can be modelled as  t 6∈ T1 ∪ T2 , −0.2x(t), ẋ(t) =  − t ∈ T1 , (2) 2x (t), x(t) = − t ∈ T2 , 0.6x (t), System (2) does not fit into the class of systems (1) because its jump map depends on time. Numerical simulations show that a trivial solution to this system is likely to be globally asymptotically stable (see Figure 1). Moreover, if one adds inputs to the right-hand side of the equations the resulting system becomes ISS, however currently there are no theoretical result to verify this.  Another motivation to consider impulsive systems with jump map that depends on time appears while interconnecting several impulsive systems of a type (1) but with different impulse time sequences. Consider two systems of the type (1) with the states xi , inputs ui , flow and jump maps fi and gi respectively and impulse time sequences Ti = {ti1 , ti2 , ti3 , . . .}, i = 1, 2. Let us interconnect these two systems in the following way u1 = h2 (u2 ), u2 = h1 (u1 ) with some functions h1 and h2 . Then the entire interconnection will have the form  t 6∈ T1 ∪ T2 , ẋ(t) = f (x(t)),     − t ∈ T1 , t 6∈ T2 , g̃1 (x (t)), (3) − t 6∈ T1 , t ∈ T2 ,  x(t) = g̃ (x (t)), 2    t ∈ T1 , t ∈ T2 , g̃3 (x− (t)), where x(t) = (x1 (t), x2 (t))T is the new state, f (x(t)) = T (f1 (x1 (t), h2 (x2 (t))), f2 (x2 (t), h1 (x1 (t)))) is the flow map and functions   − g1 (x− 1 (t), h2 (x2 (t))) g̃1 (x− (t)) = , x− 2   x− 1 g̃2 (x− (t)) = , − g2 (x− 2 (t), h1 (x1 (t)))   − g1 (x− 1 (t), h2 (x2 (t))) g̃3 (x− (t)) = − g2 (x2 (t), h1 (x− 1 (t))) define jump maps in different situations (with respect to impulse time sequence). From (3) it is clear that interconnection of two impulsive systems is a system with three different jump maps depending on impulse time sequence. This simple interconnection cannot be written in the form of (1). In the following sections we will develop sufficient conditions of ISS for systems of types (2), (3). This enables a comprehensive stability analysis of a wide class of processes that combine continuous and discontinuous dynamics as well as their interconnections. 3. EXTENDED IMPULSIVE SYSTEM For every i = 1, . . . , p, p ∈ N let Ti = {ti1 , ti2 , ti3 , . . .} be a strictly increasing sequence of impulse times in (t0 , ∞) for some initial time t0 and [ \ T= Ti , Ti = ∅. i=1,...,p i=1,...,p We consider impulsive system with external inputs  t 6∈ T, ẋ(t) = f (x(t), u(t)), t ∈ Ti , i = 1, . . . , p, x(t) = gi (x− (t), u− (t)), (4) where the state x(t) ∈ RN is absolutely continuous between impulses; input u(t) ∈ RM is locally bounded and Lebesgue-measurable function; f and gi , i = 1, . . . , p are functions from RN × RM to RN , with f locally Lipschitz. Given a sequence Ti , i = 1, . . . , p and a pair of times s, t satisfying t > s ≥ t0 , let Ni (t, s) denote the number of impulsive times tik ∈ Ti in the semi-open interval (s, t]. Fig. 1. Numerical simulation of solution to system (2) with initial condition x(0) = 1. As one may see, system (4) coincides with the system (1) when p = 1. Also, similarly to Samoilenko and Perestyuk (1987) and Lakshmikantham et al. (1989), system (4) allows for jump maps gi to be different for every moment of impulsive jump (p = ∞). As it was shown previously, a natural representation of interconnection of two systems of the type (1) requires three sets of impulsive jumps T1 , T2 and T3 with the corresponding jump maps g1 , g2 and g3 (p = 3). To introduce appropriate notion of ISS, we recall the following standard definition: a function α : [0, ∞) → [0, ∞) is of class K, and we write α ∈ K, when α is continuous, strictly increasing, and α(0) = 0. If α is also unbounded, then we say it is of class K∞ , and we write α ∈ K∞ . A continuous function β : [0, ∞) × [0, ∞) → [0, ∞) is of class KL, and we write β ∈ KL, when β(·, t) is of class K for each fixed t ≥ 0, and β(r, t) decreases to 0 as t → ∞ for each fixed r ≥ 0. Definition 1. For a given set of time sequences Ti , i = 1, . . . , p of impulse times we call system (4) input-to-state stable (ISS) if there exist functions β ∈ KL and γ ∈ K∞ , such that for every initial condition and every input u, the corresponding solution to (4) exists globally and satisfies |x(t)| ≤ max{β(|x(t0 )|, t − t0 ), γ(kuk[t0 ,t] )} ∀t ≥ t0 , where k·kJ denotes the supremum norm on an interval J. Definition 2. System (4) is called uniformly ISS over a given set S of admissible sequences of impulse times if it is ISS for every sequence in S, with β and γ independent of the choice of the sequence from the class S. 4. SUFFICIENT CONDITIONS FOR ISS For analysis of ISS of impulsive systems we adopt the concept of a candidate exponential ISS-Lyapunov function from Hespanha et al. (2008) and state it in the implication form. Definition 3. Function V : Rn → R is called a candidate exponential ISS-Lyapunov function for (4) with rate coefficients c, d1 , d2 , . . . , dp ∈ R if V is locally Lipschitz, positive definite, radially unbounded, and whenever V (x) ≥ γ(|u|) holds it follows that ∇V (x) · f (x, u) ≤ −cV (x) ∀x a.e., ∀u, (5) V (gi (x, u)) ≤ e−di V (x) ∀x, u, i = 1, . . . , p (6) for some function γ ∈ K∞ . In (5), ”∀x a.e.” should be interpreted as ”for every x ∈ Rn except, possibly, on a set of zero Lebesgue-measure in Rn ”. Theorem 1. (Uniform ISS). Let V be a candidate exponential ISS-Lyapunov function for (4) with rate coefficients c, d1 , . . . , dp ∈ R with di 6= 0, i = 1, . . . , p. For arbitrary constants µ, λ > 0, let S[µ, λ] denote the class of impulse time sequences satisfying p X − di Ni (t, s) − (c − λ)(t − s) ≤ µ ∀t ≥ s ≥ t0 . (7) i=1 Then the system (4) is uniformly ISS over S[µ, λ]. Proof. The technique of the proof is based on the proof of Theorems 3.3 and 3.7 from Dashkovskiy et al. (2012). The difference is that by iteration Pp over N (t0 , t) impulses on interval (t0 , t] we obtain i=1 di Ni (t0 , t) instead of dN (t0 , t). Remark 1. In the case of a distinct jump map for every moment of impulsive jumps (the case of p = ∞), dwelltime condition (7) can be presented in the form X di − (c − λ)(t − s) ≤ µ ∀t ≥ s ≥ t0 . − ti1 ∈(s,t] Example 1 (revisited). Consider system with external input  t 6∈ T1 ∪ T2 , + u(t), ẋ(t) = −0.2x(t)  − t ∈ T1 , (8) 2x (t) + u− (t), x(t) = − − t ∈ T 0.6x (t) + u (t), 2 with T1 = {1, 3, 5, . . .} and T2 = {2, 4, 6, . . .}. System (8) possesses candidate exponential ISS-Lyapunov function V = |x| with c = 0.2, d1 = − ln 2 and d2 = − ln 0.6. It satisfies the dwell-time condition (7) with, for instance, µ = −d1 = ln 2 and λ = 0.1. So system (8) is ISS. Moreover, it means that system with zero input (2) is globally asymptotically stable.  The dwell-time condition (7) firstly appears in this paper. It generalises the corresponding dwell-time condition from Hespanha et al. (2008) for the case of multiple jump maps. ISS property of system (8) cannot be verified using previously known results. Using the framework of measure differential equations with discontinuous inputs, a similar sufficient condition for asymptotic stability in terms of vectors fields were derived in Tanwani et al. (2015). 5. INTERCONNECTED IMPULSIVE SYSTEMS Let two strictly increasing sequences of impulse times b i = {ti , ti , ti , . . .}, i = 1, 2 be given and T := T b1 ∪ T b2. T 1 2 3 We consider an interconnection of two impulsive systems with inputs of the form  t 6∈ T, ẋi (t) = fi (x1 (t), x2 (t), ui (t)), (9) − − − bi, xi (t) = ĝi (x1 (t), x2 (t), ui (t)), t ∈ T i = 1, 2, where the state xi (t) ∈ RNi of the ith subsystem is absolutely continuous between impulses; ui (t) ∈ RMi is a locally bounded Lebesgue-measurable input, and xj (t) ∈ RNj , j 6= i can be interpreted as internal inputs of the ith subsystem. Furthermore, fi : RN1 ×RN2 ×RMi → RNi and ĝi : RN1 × RN2 × RMi → RNi , and we assume that the fi are locally Lipschitz for i = 1, 2. All signals (x1 , x2 , u1 , u2 ) are assumed to be right continuous and to have left limits at all times. We define N := N1 + N2 , M := M1 + M2 , x := (x1 , x2 )T , u := (u1 , u2 )T , f := (f1 , f2 )T , and  T t ∈ T1 , g1 (x, u) := (ĝ1 (x, u1 ), x2 ) , t ∈ T2 , g(x, u) = g2 (x, u) := (x1 , ĝ2 (x, u2 ))T ,  t ∈ T3 g3 (x, u) := (ĝ1 (x, u1 ), ĝ2 (x, u2 ))T , such that the interconnected system (9) is of the form (4) b1 \T b 2 , T2 := T b2 \T b 1 , and T3 := T b1 ∩T b2. with p = 3, T1 := T To describe stability properties of the system (9) we adopt the definitions of ISS and ISS-Lyapunov function for subsystem from Dashkovskiy et al. (2012). Definition 4. For given time sequences T1 and T2 of impulse times we call the ith subsystem of (9) input-tostate stable (ISS) if there exist functions βi ∈ KL and γij , γi ∈ K∞ ∪ {0}, such that for every initial condition xi (t0 ) and every input ui , the corresponding solution to (9) exists globally and satisfies for all t ≥ t0 |xi (t)| ≤ max{βi (|x(t0 )|, t − t0 ), max γij (kxj k[t0 ,t] ), γi (kuk[t0 ,t] )}, j,j6=i where i, j = 1, 2. Functions γij are called gains. Similarly, a Lyapunov function for a system with several inputs is defined as follows. Assume that for each subsystem of the interconnected system (9) there is a given function Vi : RNi → R+ , which is continuous, proper, positive, and locally Lipschitz continuous on RNi \ {0}. Definition 5. For i = 1, 2, the function Vi is called an exponential ISS-Lyapunov function for the ith subsystem of (9) with rate coefficients ci , di ∈ R if, whenever Vi (xi ) ≥ max{maxj,j6=i γij (Vj (xj )), γi (|ui |)} holds, it follows that ∇Vi (xi ) · fi (x, ui ) ≤ −ci Vi (xi ) ∀x a.e., ∀ui (10) and for all x and ui it holds that ˆ Vi (ĝi (x, ui )) ≤ max{e−di Vi (xi ), max γij (Vj (xj )), γi (|ui |)}, j,j6=i where γij , γi are some functions from K∞ . In general, even if all subsystems of (9) are ISS, the whole system may be not ISS. Moreover, since the moments of impulse jumps of each subsystem differ we are unable to employ known small-gain type theorems from Dashkovskiy et al. (2012) and Dashkovskiy and Mironchenko (2013). These theorems consider only one constant d that characterizes the influence of impulses for a given Lyapunov function. In our settings we have a distinct constant for each jump map. The only case to use previously developed results is to majorize system and consider the worst case approach assuming that the state of every subsystem updates at the moments of impulse jumps. This leads to d := mini=1,...,p dˆi . However, such approach is too rough, which means that the ISS of interconnected system may not be verified, although the system possesses ISS property. In the following we prove less conservative Theorem 2. However this theorem also has a limited field of use. It will be discussed in more details in Section 6. In this paper, to simplify relations and readability, we are concerned with an interconnection of impulsive systems that have exponential ISS-Lyapunov functions Vi with linear gains γij (r) := γij · r, γij , r > 0. However the proposed results can be extended to the case of nonexponential Lyapunov functions with nonlinear gains. Theorem 2. Assume that each subsystem of (9) has an exponential ISS-Lyapunov function Vi , i = 1, 2 with corresponding linear gains γ12 and γ21 and rate coefficients c1 , c2 , dˆ1 6= 0, dˆ2 6= 0. Let (9) be written as (4). If γ12 · γ21 < 1, (11) then there exists a constant s1 > 0 such that the candidate exponential ISS-Lyapunov function for the whole system (4) can be chosen as   1 V (x) := max V1 (x1 ), V2 (x2 ) . (12) s1 Its gain is given by    d1 d2 d3 1 γ(r) := max e , e , e , 1 max γ1 (r), γ2 (r) , s1 and the rate coefficients are c := min{c1 , c2 }, d1 := min{dˆ1 , − ln s11 γ12 , −ε}, d2 := min{dˆ2 , − ln γ21 , −ε}, and d3 := min{dˆ1 , dˆ2 , − ln 1 γ12 , − ln γ21 }, where ε > 0 is an s1 arbitrary small constant. In particular, for all µ, λ > 0 such that the dwell-time condition (7) holds, system (4) is uniformly ISS over S[µ, λ]. Proof. Since small-gain condition (11) is satisfied, it follows from Jiang et al. (1996) that there exists a constant −1 σ > 0 such that γ12 < σ < γ21 . Let us define V as in (12) 1 with s1 := σ and show that this function is a candidate exponential ISS-Lyapunov function for system (4). It can be easily checked that this function is locally Lipschitz, positive definite, and radially unbounded. Consider open domains M1 , M2 ⊂ RN \ {0} defined by   1 T N M1 := (x1 , x2 ) ∈ R \ {0} : V1 (x1 ) > V2 (x2 ) , s1   1 M2 := (x1 , x2 )T ∈ RN \ {0} : V2 (x2 ) > V1 (x1 ) . s1 Take an arbitrary x̂ = (x̂1 , x̂2 )T ∈ M1 . It follows that there exists a neighborhood U of x̂ such that V (x) = s11 V1 (x1 ) is differentiable for almost all x ∈ U . We define γ̄1 (r) := 1 s1 γ1 (r), r > 0, and assume that V (x) ≥ γ̄1 (|u|). From the small-gain condition (11) it follows that V1 (x1 ) = s1 V (x) ≥ max{γ12 V (x), s1 γ̄1 (|u|)} ≥ max{γ12 V2 (x2 ), γ1 (|u1 |)}. Then, from (10), we obtain that for almost all x 1 1 V̇ (x) = ∇V1 (x1 ) · f1 (x, u1 ) ≤ − c1 V1 (x1 ) = −c1 V (x). s1 s1 Now take an arbitrary x̂ ∈ M2 . Analogously, there exists a neighborhood U of x̂ such that V (x) = V2 (x2 ) is differentiable for almost all x ∈ U . Assume that V (x) ≥ γ2 (|u|). From the small-gain condition it follows that V2 (x2 ) = V (x) ≥ max{γ21 s1 V (x), γ2 (|u|)} ≥ max{γ21 V1 (x1 ), γ2 (|u2 |)}. Then, from (10), we obtain that for almost all x V̇ (x) = ∇V2 (x2 ) · f2 (x, u2 ) ≤ −c2 V2 (x2 ) = −c2 V (x). We have shown that for c = min{c1 , c2 } the function V satisfies (5) with γ̄(r) = max{ s11 γ1 (r), γ2 (r)}, r > 0 for all x̂ ∈ M1 ∪ M2 . To treat the points x̂ ∈ RN \{M1 ∪M2 } we need to consider three different cases corresponding to the jump maps g1 , g2 , and g3 :   ĝ1 (x, u1 ) V (g1 (x, u)) = V x2   1 = max V1 (ĝ1 (x, u1 )), V2 (x2 ) s  1  1 −dˆ1 ≤ max max{e V1 (x1 ), γ12 V2 (x2 ), γ1 (|u1 |)}, V2 (x2 ) s  1  1 ˆ ≤ max max{e−d1 s1 V (x), γ12 V (x), γ1 (|u1 |)}, V (x) s   1 1 ln s1 γ12 −dˆ1 0 ≤ max e V (x), e 1 V (x), e V (x), γ1 (|u1 |) s1 ≤ max{e−d1 V (x), γ̄1 (|u|)}, where d1 := min{dˆ1 , − ln s11 γ12 , −ε} with an arbitrary small constant ε > 0. Define γ̃1 (r) := ed1 γ̄1 (r). If it holds that V (x) ≥ γ̃1 (r), it follows that V (g1 (x, u)) ≤ max{ed1 V (x), γ̄1 (|u|)} = max{ed1 V (x), ed1 γ̃1 (|u|)} ≤ ed1 V (x) for all x and u, and V satisfies (6) with d1 and γ̃1 . Now consider V (g2 (x, u)). In the analogues way one can prove that if it holds that V (x) ≥ γ̃2 (|u|), it follows that V (g2 (x, u)) ≤ ed2 V (x) for all x and u, and V satisfies (6) with d2 min{dˆ2 , − ln γ21 , −ε} and γ̃2 (r) := ed2 γ2 (r). := Finally, if it holds that V (x) ≥ γ̃3 (|u|), it follows that V (g3 (x, u)) ≤ ed3 V (x), for all x and u, and V satisfies (6) with   1 ˆ ˆ d3 := min d1 , d2 , − ln γ12 , − ln γ21 s1 and γ̃3 (r) := ed3 max{γ̄(r), γ2 (r)}. o n  Define γ(r) := max ed1 , ed2 , ed3 , 1 max s11 γ1 (r), γ2 (r) . Then we conclude that V is a candidate exponential ISSLyapunov function with rate coefficients c, d1 , d2 , d3 and gain γ. Hence, from Theorem 1 it follows that system (9) is uniformly ISS over S[µ, λ] if the dwell-time condition (7) holds. Note that if system (9) does not posses external inputs ui , i = 1, 2 then Theorem 2 provides sufficient conditions for global asymptotic stability. Example 2. Consider the interconnection of two impulsive systems   ẋ(t) = −(1 + δ)x(1 + e(1+δ)|x| ) + |y|e|y|   , t 6= k,  ẏ(t) = −y(1 + e|y| ) + |x|e|x| −  t = 2k − 1,  x(t) = 3x (t),   y(t) = 2y − (t), t = 2k (13) where k ∈ N, δ > 0, the state (x, y) ∈ R × R. Consider functions V1 (x) = |x| and V2 (y) = |y|. Then     V̇1 (x) = sign x −(1 + δ)x 1 + e(1+δ)|x| + |y|e|y|   ≤ −(1 + δ)|x| 1 + e(1+δ)|x| + |y|e|y|   ≤ −(1 + δ)V1 (x) 1 + e(1+δ)V1 (x) + V2 (y)eV2 (y) ≤ −(1 + δ)V1 (x) if only −(1 + δ)V1 (x)e(1+δ)V1 (x) + V2 (y)eV2 (y) ≤ 0. (14) Consider function ξ(s) = ses ∈ K∞ . Since for any constant α ∈ R+ : ξ(αs) = αseαs from (14) we get ξ ((1 + δ)V1 (x)) ≥ ξ (V2 (y)) . 1 Since ξ ∈ K∞ V̇1 (x) ≤ −(1 + δ)V1 (x) if V1 (x) ≥ 1+δ V2 (y). We have proven that for the first subsystem there exists an exponential ISS-Lyapunov function with rate coefficient c1 = 1 + δ and linear gain function with coefficient 1 γ12 = 1+δ . Similarly, one can show that V2 (y) = |y| is an exponential ISS-Lyapunov function for the second subsystem with rate coefficient c2 = 1 and linear gain function with coefficient γ21 = 1. It is obvious that the 1 small-gain condition γ12 γ21 = 1+δ < 1 holds. Hence the continuous part of system (13) has an ISS dynamics and the corresponding candidate exponential ISS-Lyapunov function has the rate coefficient c := min{c1 , c2 } = 1. For the discrete part, the corresponding rate coefficients of the exponential ISS-Lyapunov functions for subsystems are dˆ1 = − ln 3 < 0 and dˆ2 = − ln 2 < 0. So the discrete dynamics play against stability of the network. Constant s1 from (12) can be chosen in such a way that the rate coefficients of the candidate exponential ISS-Lyapunov function for the entire interconnection are d1 := dˆ1 = − ln 3 and d2 := dˆ2 = − ln 2. Since the moments of impulsive perturbations do not coincide, from Theorem 2 system (13) is GAS if there exist constants µ, λ > 0 such that the dwell-time condition ln 3N1 (t, s) + ln 2N2 (t, s) − (1 − λ)(t − s) ≤ µ (15) holds for all t ≥ s ≥ t0 . It is easy to verify that there exists a sufficiently small constant λ > 0 such that the dwell-time condition (15) holds for µ = ln 3. So system (13) is GAS.  Note that previously known theorems are not applicable to the system (13). There is the only possibility to majorize system (13) assuming y(t) = 3y − (t), so the jump maps of subsystems coincide. Let us denote this system by (13’) and show that this approach is unsuccessful for verifying GAS. From Dashkovskiy et al. (2012), the majorant system (13’) is GAS if ln 3 (N1 (t, s) + N2 (t, s)) − (1 − λ)(t − s) ≤ µ (16) holds for some µ, λ > 0. However even for an arbitrary small λ > 0 there does not exist µ to satisfy (16) for all t ≥ s ≥ t0 . Consider semi-open intervals (s, t] := (k, k + 2i], i ∈ N and the corresponding sequence of µi -th that satisfy (16): µi ≥ ln 3 + 2i ln 3 − 2i(1 − λ) = ln 3 + 2i (ln 3 − 1 + λ) . Since for any λ > 0 the expression ln 3 − 1 + λ is positive, the sequence {µi } is strictly increasing and unbounded. So (16) does not hold and we cannot verify GAS of the majorant system (13’) and consequently of the original system (13). 6. DISCUSSION AND CONCLUSION Theorem 2 firstly proposes a small-gain type approach for stability analysis of interconnection of two impulsive systems with different impulse time sequences. A previously known theorems (Dashkovskiy et al. (2012); Dashkovskiy and Mironchenko (2013)) cannot be directly applied to such interconnection. In some cases a majorizing system with more frequent impulsive jumps of the state of each subsystem can be constructed. Additionally, these jumps should be of the worst nature towards stability: the resulting rate coefficient of the corresponding candidate exponential ISS-Lyapunov function will be estimated as d ≤ mini=1,...,p dˆi . This leads to an excessive conservativeness of the resulting conditions. In this paper we have developed a more flexible tool for the study of such systems. It is worth to mention that in the case of two different time sequences, the resulting rate coefficient d1 does not depend explicitly on dˆ2 and d2 does not depend explicitly on dˆ1 . In some particular cases, new theorem provides fairly accurate sufficient conditions for ISS of the interconnection. It is the case of ISS continuous dynamics (c1 , c2 > 0) and ”bad” discrete ones (dˆ1 , dˆ2 < 0). We would like also to mention that if the times of impulse jumps of subsystems coincide, Theorem 2 reduces to the previously known propositions. The main weakness of Theorem 2 is that it ignores a positive contribution of impulsive jumps towards ISS of the system. For example, let dˆ1 > 0. In the case of t ∈ T1 \ T2 the second part of the state remains unchanged since it is updated according to the rule x2 (t) = x− 2 (t). Using the worst-case approach, it leads to a conclusion that this impulse does not contribute to stability. That is why the conditions of the Theorem 2 for the case of di s of different signs are more conservative, but it is still valid. Theorem 4.2 from Dashkovskiy et al. (2012) and Theorem 4 from Mironchenko et al. (2014) face a similar problem even to a greater extent since the resulting rate coefficient d ≤ mini=1,...,p dˆi in theirs setting. It means that even a single jump map with ”bad” dynamics (dˆi < 0) leads to the ignorance of positive contribution of all other jump maps. The ignorance of contribution of ”good” impulses (dˆ1 , dˆ2 > 0) makes Theorem 2 inapplicable to study the case of unstable continuous dynamics of some subsystem (ci < 0) in most cases (excluding completely ”good” discrete dynamics (dˆ1 , dˆ2 > 0) and coincidence of impulsive jumps of subsystems), due to inability to satisfy dwell-time condition (7). One of the potential way to overcome this limitation is to construct a new exponential ISS-Lyapunov function for the subsystems with new rate coefficients c̃i , d˜i such that c̃i > 0 for all i as it is suggested in Mironchenko et al. (2014). However such approach leads to substantial increase of internal gains. It is out of the scope of current paper, but it is a good way to prolong this research. The question of how to account and estimate different types of influences caused by different parts of system in a flexible and precise manner still remains open. ACKNOWLEDGEMENTS This work was supported by the German Federal Ministry of Education and Research (BMBF) as a part of the research project ”LadeRamProdukt”. REFERENCES Cai, C. and Teel, A.R. (2005). Results on input-to-state stability for hybrid systems. In Proceedings of the 44th IEEE Conference on Decision and Control and 2005 European Control Conference (CDC-ECC’05), 5403– 5408. Dashkovskiy, S., Kosmykov, M., Mironchenko, A., and Naujok, L. (2012). Stability of interconnected impulsive systems with and without time delays, using Lyapunov methods. Nonlinear Analysis: Hybrid Systems, 6(3), 899–915. Dashkovskiy, S. and Mironchenko, A. (2013). Input-tostate stability of nonlinear impulsive systems. SIAM Journal on Control and Optimization, 51(3), 1962–1987. Dashkovskiy, S., Rüffer, B.S., and Wirth, F.R. (2007). An ISS small gain theorem for general networks. Mathematics of Control, Signals, and Systems, 19(2), 93–122. Dashkovskiy, S.N., Rüffer, B.S., and Wirth, F.R. (2010). Small gain theorems for large scale systems and construction of ISS Lyapunov functions. SIAM Journal on Control and Optimization, 48(6), 4089–4118. Hespanha, J.P., Liberzon, D., and Teel, A.R. (2005). On input-to-state stability of impulsive systems. In Proceedings of the 44th IEEE Conference on Decision and Control and 2005 European Control Conference (CDC-ECC’05), 3992–3997. Hespanha, J.P., Liberzon, D., and Teel, A.R. (2008). Lyapunov conditions for input-to-state stability of impulsive systems. Automatica, 44(11), 2735–2744. Jiang, Z.P., Teel, A.R., and Praly, L. (1994). Small-gain theorem for ISS systems and applications. Mathematics of Control, Signals and Systems, 7(2), 95–120. Jiang, Z.P., Mareels, I.M., and Wang, Y. (1996). A Lyapunov formulation of the nonlinear small-gain theorem for interconnected ISS systems. Automatica, 32(8), 1211–1215. Jiang, Z.P. and Wang, Y. (2001). Input-to-state stability for discrete-time nonlinear systems. Automatica, 37(6), 857–869. Lakshmikantham, V., Bainov, D., and Simeonov, P.S. (1989). Theory of impulsive differential equations. World Scientific. Liberzon, D., Nesic, D., and Teel, A.R. (2014). Lyapunovbased small-gain theorems for hybrid systems. IEEE Transactions on Automatic Control, 59(6), 1395–1410. Mancilla-Aguilar, J. and Garcıa, R. (2001). On converse Lyapunov theorems for ISS and iISS switched nonlinear systems. Systems & Control Letters, 42(1), 47–53. Mironchenko, A., Yang, G., and Liberzon, D. (2014). Lyapunov small-gain theorems for not necessarily ISS hybrid systems. In Proceedings of the 21th International Symposium on Mathematical Theory of Systems and Networks (MTNS 2014), 1001–1008. Samoilenko, A. and Perestyuk, N. (1987). Differential equations with impulse effect. Visca Skola, Kiev. Sanfelice, R. (2014). Input-output-to-state stability tools for hybrid systems and their interconnections. IEEE Transactions on Automatic Control, 59(5), 1360–1366. Sontag, E.D. (1989). Smooth stabilization implies coprime factorization. IEEE Transactions on Automatic Control, 34(4), 435–443. Tanwani, A., Brogliato, B., and Prieur, C. (2015). Stability notions for a class of nonlinear systems with measure controls. Mathematics of Control, Signals, and Systems, 27(2), 245–275.
3cs.SY
arXiv:1706.04857v1 [math.ST] 15 Jun 2017 New bounds for the Probability of Causation in Mediation Analysis Rossella Murtas∗ Alexander Philip Dawid† Monica Musio‡ November 1, 2016 Abstract An individual has been subjected to some exposure and has developed some outcome. Using data on similar individuals, we wish to evaluate, for this case, the probability that the outcome was in fact caused by the exposure. Even with the best possible experimental data on exposure and outcome, we typically can not identify this “probability of causation” exactly, but we can provide information in the form of bounds for it. Under appropriate assumptions, these bounds can be tightened if we can make other observations (e.g., on non-experimental cases), measure additional variables (e.g., covariates) or measure complete mediators. In this work we propose new bounds for the case that a third variable mediates partially the effect of the exposure on the outcome. Keywords: Probability of Causation, Mediation, Causes of effects, Bounds 1 Introduction Causality is a concept very common in real life situations. Is lung cancer caused by smoking? Was contaminated water causing cholera in London in 1854? Can the court infer sex discrimination in a hiring process? However, statisticians have been very cautious in formalizing this concept. One reason may be the complex definitions and methods implemented to study causality. Another explanation may be the difficulty of translating real life problems into mathematical notations and formulas. The first step should be to identify the causal question of interest. This can be assigned to one of two main classes: questions concerning the causes of observed effects, and questions concerning the effects of applied causes. This basic distinction, all too often neglected in the causal inference literature, is fundamental to identifying the correct definition of causation. To clarify this distinction, consider the following example. An individual, Ann, might be subjected to some exposure, X, and might develop some outcome, Y . For simplicity we take X to be a binary decision variable, denoting whether or not an individual is given the drug, and take the outcome variable Y also to be binary, coded 1 if the individual dies, and 0 if not. We denote by XA ∈ {0, 1} the value of Ann’s exposure, and by YA ∈ {0, 1} the value of Ann’s outcome. Questions about the effects of applied causes, “EoC”, are widely studied. For example, in medicine, randomized clinical trials are one of the most rigorous ways to assess the effect of a treatment in a population. In the EoC framework, at an individual level we would be interested in asking: “What would happen to Ann were she to be given the drug?” or “What would happen to Ann were she not to be given the drug?”. At the population level, a typical EoC query would be: “Is death caused by the drug?” In this framework, a straightforward way to assess the strenght of causality is by comparing P1 = P(Y = 1 | X ← 1) and P0 = P(Y = 1 | X ← 0), the two outcome probabilities under the two different interventions [4]. This can be seen as a decision problem: we can compare ∗ University of Cagliari Emeritus Fellow, University of Cambridge ‡ University of Cagliari † Leverhulme 1 these two different distributions for Y , decide which one we prefer, and take the associated decision (give or withhold the drug). The difference P1 − P0 is known as the “Average Causal Effect”. In contrast to EoC queries, that are mostly adopted to infer knowledge in the population, CoE questions invariably require an individual investigation. For example, suppose that Ann died after being given the drug. A typical CoE question might be phrased as: “Knowing that Ann did take the drug, and died, how likely is it that she would not have died if she had not had the drug?”. In this paper we will embed such causal queries in the counterfactual framework [7]. This is based on the idea that there exist potential variables. If X is the exposure and Y the outcome, the potential variable Y (x) is conceived as the value of Y that would arise if, actually or hypothetically, X were to be set to x (X ← x). We denote the pair (Y (0), Y (1)) by Y. For an actual assignment X ← x, we observe Y = Y (x). The potential variable Y (x′ ), with x′ 6= x, is then not observable, but is supposed to describe what would have happened to the outcome Y , if, counterfactually, we had assigned the different value x′ to the exposure X. Note particularly that it is never possible to observe fully the pair Y. The definition of a CoE causal effect is completely different from the EoC definition. It is typically framed in terms of the probability of causation (PC), also called probability of necessity [6]. Given that Ann took the drug and died, the probability of causation in Ann’s case is defined as: PCA = PA (YA (0) = 0 | XA = 1, YA (1) = 1) (1) where PA denotes the probability distribution over attributes of Ann. For example, suppose that Ann’s children filed a criminal lawsuit against a pharmaceutical manufacturer claiming that their drug was the cause of her death. Using data on similar individuals, we would wish to evaluate, for this case, the probability that the outcome was in fact caused by the exposure. In such a civil case, the required standard of proof is typically “preponderance of the evidence,” or “ balance of probabilities,” meaning that the case would succeed if it can be shown that causation is “more probable than not,” i.e., PCA > 50%. However, simplistic or ad hoc definitions and rules are widely and often wrongly applied in many courthouse. Given the possibly serious implications of the probability of causation, it is important to studying methods capable of producing accurate information. From a statistical point of view, definition (1) involves the bivariate distribution of the two potential variables associated with the same subject. However, only one of these can ever be observed, the other then becoming counterfactual. For this reason, PCA is generally not fully identifiable. We can however provide useful information as bounds between which PCA must lie. Under appropriate assumptions, these bounds can be tightened if we can measure additional variables, e.g., covariates [1], or—in the case that unobserved variables confound the exposureoutcome relationship—gather data on other, nonexperimental, cases (Tian and Pearl [8].) In this paper we propose a novel approach to bound the probability of causation in mediation analysis. Mediation aims to disentangle the extent to which the effect of X on Y is mediated through other pathways from the extent to which that effect is due to X acting directly on Y . In § 2 we revisit the basic framework where we have information only on exposure and outcome. In § 3 we focus on two different mechanisms: complete and partial mediation. In the former, the exposure is supposed to act on the outcome only through the mediator, i.e., no direct effect is present. In the latter, both direct and indirect effects are considered. In § 4 we compare the bounds obtained in § 3 with those reviewed in § 2, and in § 5 we present our conclusions. 2 Starting Point: Simple Analysis In this Section we discuss the simple situation in which we have information, as in Table 1, from a randomized experimental study that tested the same drug taken by Ann. P(Y = 1 | X ← 1) = P(Y = 1 | X ← 0) = 2 0.30 0.12. (2) (3) Exposed Unexposed Die Live Total 30 12 70 88 100 100 Table 1: Deaths in individuals exposed and unexposed to the same drug taken by Ann. We see that, in the experimental population, individuals exposed to the drug (X ← 1) were more likely to die than those unexposed (X ← 0), by 18 percentage points. So can the court infer that it was Ann’s taking the drug that caused her death? More generally: Is it correct to use such experimental results, concerning a population, to say something about a single individual? This “Group-to-individual” (G2i) issue is discussed by Dawid [2]. The simple difference between (2) and (3) is not sufficient to infer causation for a single external individual. To make progress we add a further assumption that the event of Ann’s exposure, XA , is independent of her potential response pair YA : XA ⊥⊥ YA . (4) Property (4) parallels the “no-confounding” property Xi ⊥⊥ Yi that holds for individuals i in the experimental study on account of randomization. We further suppose that Ann is exchangeable with the individuals in the experiment, i.e., she could be considered as a subject in the experimental population. On account of (4) and exchangeability, PCA in (1) reduces to PCA = P(Y (0) = 0 | Y (1) = 1)—but we can not fully identify this from the data. In fact we can never observe the joint event (Y (0) = 0; Y (1) = 1), since at least one of Y (0) and Y (1) must be counterfactual. In particular, we can never learn anything about the dependence between Y (0) and Y (1). However, even without making any assumptions about this dependence, we can derive the following inequalities (Dawid et al. [4]):   1 min{P(Y = 0 | X ← 0), P(Y = 1 | X ← 1)} max 0, 1 − ≤ PCA ≤ , (5) RR P(Y = 1 | X ← 1) where RR = P(Y = 1 | X ← 1) P(Y = 1 | X ← 0) (6) is the experimental risk ratio between exposed and unexposed. These bounds can be estimated from the experimental data using the population death rates in equations (2) and (3). In many cases of interest (such as Table 1), we have P(Y = 1 | X ← 0) < P(Y = 1 | X ← 1) < P(Y = 0 | X ← 0). Then the lower bound in (5) will be non-trivial, while the upper bound will be 1, so vacuous. Since, in Table 1, the exposed are 2.5 times as likely to die as the unexposed (RR = 30/12 = 2.5), we have enough confidence to infer causality in Ann’s case, since 0.60 ≤ PCA ≤ 1. 3 Bounds in Mediation In this Section we bound the probability of causation for a case where a third variable, M , is involved in the causal pathway between the exposure X and the outcome Y . We first review the results of Dawid et al. [3] for the case of complete mediation, where no direct effect is present between exposure and outcome but all the effect is mediated by M . In addition we derive new bounds for PCA in mediation analysis when a partial mediation mechanism is in operation. 3 3.1 Complete mediation (Dawid et al. [3]) The case of no direct effect is intuitively described by Figure 1. Applications where this assumption might be plausible is in the treatment of ovarian cancer (Silber et al. [5]), where X represents management either by a medical oncologist or by a gynaecological oncologist, M is the intensity of chemotherapy prescribed, and Y is death within 5 years. We shall be interested in the case that M is observed in the experimental data but is not observed for Ann, and see how this additional experimental evidence can be used to refine the bounds on PCA . X M Y Figure 1: Graph representing a mediator M , responding to exposure X and affecting response Y . There is no direct effect, unmediated by M , of X on Y . We now introduce M (x) to denote the potential value of M when X ← x, and Y ∗ (m) to denote the potential value of Y when M ← m. Then Y (x) := Y ∗ {M (x)}. We define M := (M (0), M (1)) and Y∗ := (Y ∗ (0), Y ∗ (1)). We suppose that none of the causal mechanisms depicted in Figure 1 are confounded–expressed mathematically by assuming mutual independence between X, M and Y∗ (both for experimental individuals, and for Ann). These assumptions imply no overall confounding (as in (4)), the Markov property Y ⊥⊥ X | M , and the following bounds in this case of complete mediation:   Num 1 ≤ PCA ≤ , (7) max 0, 1 − RR P(Y = 1 | X ← 1) where the numerator, Num, is given in Table 2. We see from (7) that knowing a mediator does not improve the lower bound. For the upper bound, one has to consider various scenarios according to different choices of the estimable marginal probabilities in Table 2. c≤d c>d a≤b a>b a · c + (1 − d)(1 − b) a · d + (1 − c)(1 − b) b · c + (1 − d)(1 − a) b · d + (1 − a)(1 − c) Table 2: Numerator of upper bound for PCA in complete mediation anlaysis. Here a = P(M (0) = 0), b = P(M (1) = 1), c = P(Y ∗ (0) = 0) and d = P (Y ∗ (1) = 1). Note that, given the no-confounding assumptions, the entries in Table 2 are all estimable from the experimental data: 3.2 a b = = P(M = 0 | X ← 0) P(M = 1 | X ← 1) c = P(Y = 0 | M ← 0) d = P(Y = 1 | M ← 1). Partial mediation The situation described by Figure 1 is unlikely to hold in many real life situations. Situations such as that represented informally by Figure 2, that allow both direct and indirect effects, are more plausible. In this Section we derive new bounds for the probability of causation when a partial mediator is involved in the causal pathway. We now define Y ∗ (x, m) as the potential value of the outcome Y after setting both exposure, X ← x, and mediator, M ← m. Then Y (x) = Y ∗ (x, M (x)). We make the following assumptions, both for Ann and for the individuals in the experiment: 4 M X Y Figure 2: Graph illustrating a partial mediation mechanism between an exposure X, an outcome Y , and a mediator M A1: Y ∗ (x, m) ⊥⊥ M | X (no M –Y confounding) A2: Y ∗ (x, m) ⊥⊥ X (no X–Y confounding) A3: M (x) ⊥⊥ X (no X–M confounding). Assumption A1 expresses independence, given X, between a potential value Y ∗ (x, m), that would arise on setting exposure and mediator to particular values, and the pair of potential outcomes (M (0), M (1)). It can be seen as a strengthening of the univariate hypothesis Y ∗ (x, m) ⊥⊥ M (x) | X. Note that A1 and A2 are together equivalent to the single requirement: A12: Y ∗ (x, m) ⊥⊥ (M, X). Because we have supposed that Ann is exchangeable with the individuals in the experiment, we have PCA = P(Y (0) = 0 | X ← 1, Y (1) = 1) = P(Y (0) = 0, Y (1) = 1 | X ← 1) . P(Y (1) = 1 | X ← 1) (8) Given the no-confounding assumptions, the denominator of (8) is P(Y = 1 | X ← 1), which is estimable. However, the numerator of (8) involves the joint distribution of the pair Y of potential outcomes, and this is not estimable from the data, in view of the fact that it is never possible to observe both Y (0) and Y (1) simultaneously. We can however bound this numerator in terms of estimable quantities, using the fact that, for any events A and B, and any probability distribution P, max{P(A) + P(B) − 1, 0} ≤ P(A ∩ B) ≤ min{P(A), P(B)}. (9) Using (9), we can obtain an upper bound for the numerator as: P(Y (0) = 0, Y (1) = 1 | X ← 1) = P(Y ∗ (0, M(0)) = 0, Y ∗ (1, M(1)) = 1 | X ← 1) XX = P(Y ∗ (0, m0 ) = 0, Y ∗ (1, m1 ) = 1 | M(0) = m0 , M(1) = m1 , X ← 1) (10) m0 m1 ≤ XX × P(M(0) = m0 , M(1) = m1 | X ← 1) ∗ min{P(Y (0, m0 ) = 0 | M(0) = m0 , M(1) = m1 , X ← 1), m0 m1 P(Y ∗ (1, m1 ) = 1 | M(0) = m0 , M(1) = m1 , X ← 1)} = XX × min{P(M(0) = m0 | X ← 1), P(M(1) = m1 | X ← 1)} ∗ ∗ min{P(Y (0, m0 ) = 0), P(Y (1, m1 ) = 1)} m0 m1 × min{P(M(0) = m0 ), P(M(1) = m1 }, (11) on using assumptions A12 and A3. That is, P(Y (0) = 0, Y (1) = 1 | X ← 1) ≤ min{P(Y ∗ (0, 0) = 0), P(Y ∗ (1, 0) = 1)} × min{P(M (0) = 0), P(M (1) = 0)} (12) + min{P(Y ∗ (0, 0) = 0), P(Y ∗ (1, 1) = 1)} × min{P(M (0) = 0), P(M (1) = 1)} (13) + min{P(Y ∗ (0, 1) = 0), P(Y ∗ (1, 0) = 1)} × min{P(M (0) = 1), P(M (1) = 0)} (14) + min{P(Y ∗ (0, 1) = 0), P(Y ∗ (1, 1) = 1)} × min{P(M (0) = 1), P(M (1) = 1)}. (15) 5 It can be shown that similarly applying the lower bound of (9) to (10) yields the same lower bound as obtained in § 2 and § 3.1, so that the lower bound is not improved by knowledge of a mediation mechanism. Assumptions A12 and A3 allow us to estimate the terms (12)–(15) in the above upper bound from the data: P(Y ∗ (x, m) = y) = P(M (x) = m) = 4 P(Y = y | X ← x, M ← m) P(M = m | X ← x). Comparisons In this Section we compare the bounds found in the simple analysis framework of § 2 with those obtained by considering a complete mediation mechanism, as in § 3.1, and those obtained by considering a partial mediation mechanism, as in § 3. We focus on comparing these bounds to obtain the best information from the data. The numerator of the upper bound for PCA in (5), which ignores the mediator, may be written as min{α + β, γ + δ}, (16) where α = P(Y ∗ (0, 0) = 0) P(M (0) = 0) β γ = P(Y ∗ (0, 1) = 0) P(M (0) = 1) = P(Y ∗ (1, 0) = 1) P(M (1) = 0) δ = P(Y ∗ (1, 1) = 1) P(M (1) = 1). We see that both (12) and (13) are smaller than or equal to α, while both (14) and (15) are smaller than or equal to β. So the upper bound allowing for partial mediation, which is the sum of (12), (13), (14) and (15), cannot exceed 2 (α + β) = 2 P(Y (0) = 0) = 2 P(Y = 0 | X ← 0); and similarly cannot exceed 2 P(Y = 1 | X ← 1). Thus, the upper bound for the numerator, when accounting for the mediator, can not exceed twice that obtained by ignoring it, as given by (5). However, as we will see in § 4.1, it could be larger or smaller than that simpler bound. On the other hand, we do not obtain a different lower bound. In the special case of complete mediation, Y ∗ (0, m) = Y ∗ (1, m), = Y ∗ (m), say. Thus the terms with m0 6= m1 in (10) must be 0. This leads to the following upper bound: P(Y (0) = 0, Y (1) = 1 | X ← 1) ≤ min{P(Y ∗ (0) = 0), P(Y ∗ (1) = 1)} × min{P(M (0) = 0), P(M (1) = 1)}+ + min{P(Y ∗ (1) = 0), P(Y ∗ (0) = 1)} × min{P(M (0) = 1), P(M (1) = 0)}, in agreement with Table 2. Since we have eliminated the terms (12) and (15) appearing in the general case, the upper bound obtained in this case of complete mediation is never bigger than that obtained from the general expression (12)+(13)+(14)+(15); nor, since (13) ≤ α while (14) ≤ β, can it be bigger than the bound (5) obtained on ignoring the knowledge of the complete mediation mechanism. 4.1 Examples To show that, in the case of partial mediation, taking account of information about the mediator may, but need not, yield a tighter upper bound, we consider two cases with different experimental data as given respectively by Table 3 and Table 4. Suppose now we can also observe a partial mediator M . We might then observe the following probabilities, consistent with Table 3: 6 Exposed Unexposed Die Live Total 69 24 31 76 100 100 Table 3: Experimental data 1 Exposed Unexposed Die Live Total 78 32 22 68 100 100 Table 4: Experimental data 2 P(Y ∗ (0, 0) = 0) = 0.98 P(Y ∗ (1, 0) = 0) = 0.315 P(Y ∗ (0, 1) = 0) = 0.165 P(Y ∗ (1, 1) = 0) = 0.143 P(M (0) = 0) = 0.73 P(M (1) = 0) = 0.981 We then obtain: 0.65 ≤ PCA ≤ 0.81 when accounting for the mediator, and 0.65 ≤ PCA ≤ 1 when ignoring it. In this case, knowledge of the partial mediation mechanism is helpful in improving the upper bound. On the other hand, suppose we observe the following probabilities, consistent with Table 4: P(Y ∗ (0, 0) = 0) = 0.98 P(Y ∗ (1, 0) = 0) = 0.09 P(Y ∗ (0, 1) = 0) = 0.67 P(Y ∗ (1, 1) = 0) = 0.27 P(M (0) = 0) = 0.04 P(M (1) = 0) = 0.26 We now obtain: 0.59 ≤ PCA ≤ 0.95 when accounting for the mediator, but 0.59 ≤ PCA ≤ 0.88 when ignoring it. So in this case knowledge of mediation has not been helpful. 5 Conclusions Bounding the probability of causation in mediation analysis is an important problem for applications. By taking account of a complete mediation mechanism we can never do worse than by ignoring it. However, complete mediation is not always reasonable. In the case of partial mediation, the upper bound obtained by taking account of it may be greater or smaller than that obtained by ignoring it. We can thus compute both upper bounds and take the smaller. This work has several possible extensions. It would be interesting to extend our theoretical formulas to cases combining information on both covariates and mediators. Another promising extension arises on making connections with copula theory, where PC can be obtained as a function of the estimable quantities P(Y (0) = 0) and P(Y (1) = 1) together with an appropriate copula. References [1] Dawid AP (2011) The role of scientific and statistical evidence in assessing causality. In: Goldberg R (ed) Perspectives on Causation. Oxford, Hart Publishing, pp 133–147 [2] Dawid AP, Faigman DL, Fienberg SE (2014) Fitting science into legal contexts: Assessing effects of causes or causes of effects? Sociological Methods & Research 43:359–390 7 [3] Dawid AP, Murtas R, Musio M (2016) Bounding the probability of causation in mediation analysis. In: Di Battista T, Moreno E, Racugno W (ed) Topics on Methodological and Applied Statistical Inference. Cham Switzerland, Springer International Publishing, pp 75–84 [4] Dawid AP, Musio M, Fienberg SE (2016) From statistical evidence to evidence of causality. Bayesian Analysis, 11(3):725–752 [5] Markman M (2007) Does ovarian cancer treatment and survival differ by the specialty providing chemotherapy? Journal of Clinical Oncology, 25(23):3554–3554 [6] Pearl J (1999) Probabilities of causation: Three counterfactual interpretations and their identification. Synthèse, 121(1–2):93–149 [7] Rubin DB (1974) Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of Educational Psychology, 66(5):688 [8] Tian J, Pearl J (2000) Probabilities of causation: Bounds and identification. Annals of Mathematics and Artificial Intelligence, 28(1–4):287–313 8
10math.ST
Fronthaul-Aware Group Sparse Precoding and Signal Splitting in SWIPT C-RAN Yanjie Dong, Student Member, IEEE‡ , Md. Jahangir Hossain, Member, IEEE† , Julian Cheng, Senior Member, IEEE† , and Victor C. M. Leung, Fellow, IEEE‡ arXiv:1711.05818v1 [cs.IT] 15 Nov 2017 ‡ Department of Electrical and Computer Engineering, The University of British Columbia, Vancouver, BC, Canada † School of Engineering, The University of British Columbia, Kelowna, BC, Canada Emails: {ydong16, vleung}@ece.ubc.ca, {julian.cheng, jahangir.hossain}@ubc.ca Abstract—We investigate the precoding, remote radio head (RRH) selection and signal splitting in the simultaneous wireless information and power transferring (SWIPT) cloud radio access networks (C-RANs). The objective is to minimize the power consumption of the SWIPT C-RAN. Different from the existing literature, we consider the nonlinear fronthaul power consumption and the multiple antenna RRHs. By switching off the unnecessary RRHs, the group sparsity of the precoding coefficients is introduced, which indicates that the precoding process and the RRH selection are coupled. In order to overcome these issues, a group sparse precoding and signal splitting algorithm is proposed based on the majorization-minimization framework, and the convergence behavior is established. Numerical results are used to verify our proposed studies. I. I NTRODUCTION Recently, it has been demonstrated that the 1 and 11 Mbps wireless transmissions consume, respectively, 14.5 and 59.2 μW in the passive Wi-Fi [1]. Therefore, with the development of the energy harvesting (EH) chipsets (e.g., Powercastco1 ), the radio frequency (RF) energy harvesting technology becomes an attractive solution to provide ubiquitous low power communications with a sustainable energy supply [2]. As an important use case of the RF-EH technology, the simultaneous wireless information and power transferring (SWIPT) technique has acquired recent attention due to the capability of feeding the receivers with information and energy simultaneously [3]. However, the current circuits do not allow a receiver to detect information and scavenge energy from a single signal stream. This fact leads to several research efforts in the design of reception schemes for the systems with SWIPT capability, and two practical receiver schemes are proposed, namely, the time switching (TS) scheme and the signal splitting (SS) scheme. It has been shown that the SS scheme is a general case of the TS scheme [3]; therefore, we investigate the SS scheme based SWIPT technique in this work. Meanwhile, cloud radio access network (C-RAN) has become one of the candidate architectures for the 5-th generation (5G) wireless networks due to its cost effectiveness and deployment flexibility [4]. A typical C-RAN consists of a baseband unit (BBU) pool and a set of low-power and lowcost remote radio heads (RRHs). All the RRHs are connected to the BBU pool via optical fiber links. The BBU pool performs the processor-heavy ciphering functions, and the RRHs perform basic radio frequency processing functions [5]. As a result, a significant performance improvement can be achieved via joint 1 http://www.powercastco.com/products/powerharvester-receivers/ scheduling and information processing such as coordinated transmission [6]. It has also been reported that the coordinated transmission can transmit significantly more energy to the energy receivers compared with the single-antenna transmitter [7]. Due to an efficient interference mitigation scheme, the RRHs can be ultra-densely deployed in the coverage area of the C-RAN such that the distance between transceivers is reduced. Hence, the spectrum efficiency is enhanced. In order to avoid the energy depletion of the lower power devices, the SWIPT technique will become a key component of the C-RAN architecture. The integration of the SWIPT technique into the C-RAN also introduces many interesting and new challenges to the resource allocation, which needs to be solved carefully to bridge the gap between theory and practice [5]. For example, the power consumption of the SWIPT CRAN consists of the transmission power cost, the circuit power cost and the fronthaul power cost. To minimize the transmission power cost, the precoding vector should be carefully designed. To reduce the circuit power cost and the fronthaul power cost, the RRH selection mechanism should be considered. As a result, a joint precoding, RRH selection and signal splitting algorithm is required in the SWIPT C-RAN architecture. A. Related Work and Contributions The SWIPT technique finds the applications in various wireless networks, such as point-to-point networks [8], pointto-multipoint networks [9], [10], multipoint-to-multipoint networks [11]–[14] and wireless cooperative networks [15]– [18]. In particular, the resource allocation in the multipointto-multipoint networks with SWIPT capability has focused on the power minimization [11], energy efficiency [12], the joint uplink-and-downlink design [13] and the robust design [14]. However, the impact of capacity-limited fronthaul links, which may cause a mismatch between the resource allocation and the fronthaul capacity, is ignored in previous works [11]–[14]. Assuming that each receiver shares a capacitylimited backhaul2 link with a fixed data rate, the authors in [19] developed a beamforming algorithm to minimize the power consumption of the distributed antenna systems while constrains the received signal-to-interference-plus-noise ratio (SINR) of the eavesdropper. However, the assumption made in [19] can cause some backhaul links under utilization when the acquired data rate of the associated information receivers is lower than the obtained fixed data from the backhaul links. 2 The backhaul in the distributed antenna systems has the similar function with the fronthaul in the C-RAN architecture. On the other hand, the objective of the proposed algorithms in [20] is to minimize the power consumption of the C-RANs without SWIPT capability via joint beamforming and RRH selection. The power consumption in [20] is the summation of the transmission power, the circuit power and the fronthaul links power consumption. A linear model is used in [20] to obtain the fronthaul links power consumption, which ignores the nonlinearity of the media of the fronthaul links. Besides, each RRH of the C-RAN is assumed to be equipped with a single antenna in [20]. As a result, the proposed beamforming and RRH selection algorithm in [20] cannot be used for the multiple antenna RRHs in the SWIPT C-RANs. Motivated by the previous works [19], [20], we investigate the power consumption minimization problem by jointly considering the precoding, the RRH selection and the signal splitting in the SWIPT C-RANs. In particular, the RRHs coordinately deliver the wireless signals to the information detection module (IDM) and energy harvesting module (EHM) of each user equipment (UE). Different from [20], the fronthaul links power consumption increases nonlinearly with the data rate on the fronthaul links, where the slope of the power cost-data rate curve increases with the increasing data rate. Considering the RRH selection, an RRH is allowed to be switched off when all the precoding coefficients associated with the RRH are set to zeros, which refers to group sparsity for the precoding coefficients [21]. Hence, the precoding process and the RRH selection are tightly coupled. Inspired by [22], we leverage the majorization-minimization (MM) framework to decouple the precoding and the RRH selection. As a result, we propose a group sparse precoding and signal splitting (GsPSs) algorithm to minimize the power consumption, and study the convergence of the proposed algorithm. B. Organization and Notations The remainder of this paper is organized as follows. Section II introduces the system model and problem formulation. The feasibility of the formulated problem, the proposed GsPSs algorithm and the convergence are discussed in Section III. Numerical results are presented in Section IV, and conclusions are drawn in Section V. Notations: Vectors and matrices are shown in bold lowercase letters and bold uppercase letters, respectively. C denotes the set of complex values. ·F and ·0 refer to Frobenius norm and 0 -norm, respectively. ∼ stands for “distributed as”. IN and 0N ×M denote, respectively, an N dimensional identity matrix and a zero matrix with N rows and M columns. The expectation of a random variable is denoted as E [·]. vec [W ] obtains a vector by stacking the columns of W under the other. {wn }n∈N represents the set made of wn , n ∈ N . For a square matrix W , W H and Tr (W ) denote its conjugate transpose and trace, respectively. W  0 and W  0 denote that W is a positive semidefinite and a positive definite matrix. II. S YSTEM M ODEL AND P ROBLEM F ORMULATION A. Overall Description We consider the downlink transmission scenario of the SWIPT C-RAN, which consists of a BBU pool, a set of RRHs and a set of UEs. Let M = {1, 2, . . . , M } and N = {1, 2, . . . , N } denote the set of RRHs and UEs, respectively. The m-th RRH is equipped with im antennas, and each UE is equipped with a single antenna. As a result, the access link from all RRHs to each UE is a MISO channel with the number M of transmission antennas as NT = m=1 im . We assume that SWIPT C-RAN operates in the time division duplex mode such that each RRH can obtain the channel state information (CSI) perfectly via exploiting the uplink reciprocity and reports the obtained CSI to the BBU pool via the common public radio interface. Each RRH connects to the BBU pool via a capacity-limited optical fiber fronthaul link. We consider the frame-based frequency-nonselective fading channels with unit duration for each frame; therefore, the words “power” and “energy” can be used interchangeably. Via a signal splitter, each UE can split the incoming signal stream into two substreams for the IDM and the EHM. Specifically, the power splitting ratio for the IDM and EHM are, respectively, denoted by ρ2n ≥ 0 and 2n ≥ 0 with ρ2n + 2n ≤ 1. At the BBU pool, the information-bearing signal sn for the n-th UE is processed by the central encoder via two procedures: precoding and compression. Generally, the precoding procedure controls the multi-user interference, and the precoded signal vector for link Nthe m-th BBU-RRH fronthaul 2 is denoted by x̃m = n=1 wm,n sn where E[|sn | ] = 1; wm,n ∈ Cim ×1 is the precoding vector used for the transmission from the m-th RRH to the n-th UE. Each precoded signal vector x̃m is compressed in order to be delivered over the m-th BBU-RRH fronthaul link. The compressed signal vector  for the m-th BBU-RRH fronthaul link is denoted by N xm = n=1 wm,n sn + qm , where qm ∈ Cim ×1 denotes the quantization noise and is modeled as a circularly-symmetric complex Gaussian random vector CN (0im ×1 , Qm ) with coH . In this work, we assume variance matrix Qm  E qm qm that the encoder can compress the precoded signal for each antenna independently. In other words, the covariance matrix Qm is a diagonal matrix, m ∈ M.  By defining wn  vec ([w1,n , w2,n  , . . . , wM,n ]) and Bm  0im ×m−1 ik , Iim , 0im ×M , the compact form of the k=m+1 ik k=1 compressed signal vector for the m-th BBU-RRH fronthaul link is denoted as xm = N  B m w n s n + qm (1) n=1   N H H with covariance matrix E xm xH m = n=1 Bm wn wn Bm + 1 2 , m ∈ M. Λ2m , where Λm = Qm According to the rate-distortion theory, there exists at least one compression codebook under a Gaussian test channel such that the achievable information transmission rate of the m-th BBU-RRH fronthaul link is denoted by [23]  (2) gm {wn }n∈N , Λm = log det N  n=1 H Bm wn wnH Bm + Λ2m − 2 log det (Λm ) . where Λm  0 when the m-th RRH is on. The channel coefficient vector from the m-th RRH to the  n-th UE is denoted as hm,n ∼ CN 0im ×1 , d−χ m,n Iim [24, and references therein]. Here, dm,n and χ are, respectively, the distance between the m-th RRH and the n-th UE, and the pathloss exponent. By defining hn  vec ([h1,n , h2,n , . . . , hM,n ]), the received baseband signal of the n-th UE in the compact form is obtained as N  ỹn = hH n wk s k + M  hH n qm + zn,c (3) m=1 k=1  2 is the additive white Gaussian noise where zn,c ∼ CN 0, σn,c (AWGN) at the n-th UE. As a result, the received signal of the IDM and the received SINR of the n-th UE are, respectively, expressed as yn = ρn N  hH n wk s k hH n qm hH n wn SINRn = N  + zn,c + zn,p (4) m=1 k=1 and + M  k=1,k=n 2 |hH n wk | 2 Compress + Pn + 2 σn,c 2 σn,p ρ2n + (5)  M 2 H 2 where PnCompress  m=1 hH n Bm Λm F ; zn,p ∼ CN 0, σn,p denotes the additional signal processing noise during the baseband conversion [8]–[19]. On the other hand, the input signal power at the EHM of the n-th UE is given by Input Pn = 2n N  2 hH n wk Compress + Pn + 2 σn,c . B. Power Consumption Model When a specific RRH is on, a certain amount of circuit power is consumed for signal processing [25]. Some circuit power consumption is still required for fast wake up for the RRH in sleep mode. Hence, the power consumption of the m-th RRH is denoted by ⎧ N   ⎪ 2 2 1 ⎪ ⎪ φm Bm wn F + Λm F ⎪ ⎪ ⎨ n=1 N RRH  2 (7) = Pm Active +Pm , Bm wn F = 0 ⎪ ⎪ ⎪ n=1 ⎪ ⎪ ⎩ P Sleep , otherwise m where the constant φm denotes the power amplifier efficiency of the m-th RRH; the circuit power consumption of an active  Active SP 0.87 + 0.1im + 0.03i2m with  Pm RRH is given as Pm N  + n=1 M  m=1 where ζm can be obtained via curve fitting techniques. The nonlinear model of the power consumption can be justified as follows. The higher data rate via the fronthaul fiber links results in a higher transmission voltage of the signals under the same bit error rate. Therefore, according to the Ohm’s law, more power is consumed on the same fronthaul fiber links with unchanged resistance3 . C. Problem Formulation Our objective is to minimize the power consumption of the SWIPT C-RAN while guarantee the data rate and the delivered power for the UEs via joint precoding, RRH selection and signal splitting. Considering the power consumption on transmission, circuit and fronthaul links, we formulate the power consumption optimization problem as  (9a) P Total {wn }n∈N , {Λm }m∈M min {wn ,ρn ,n }n∈N {Λm }m∈M n=1 ρ2n 2 + 2n ≤ 1, ∀n (9b) (9c) (9d) (9e)  Total {wn }n∈N , {Λm }m∈M where the power consumption P max is defined in (10); Pm in constraints (9b) denotes the maxand Pnreq imum transmission power of the m-th RRH; Γreq n are, respectively, the data rate requirement for the IDM and the required input power for the EHM of the n-th UE. Remark 1: With the energy harvester model in [16], harvesting the quantity of P̂nreq power   requires the input power Mn +P̂nreq exp(an bn ) 1 req Pn = an ln , where Mn , an and bn are req Mn −P̂n the shaping parameters of the nonlinear energy harvester. III. J OINT RRH S ELECTION AND B EAMFORMER D ESIGN We observe that the optimization problem (9) is non-convex due to the non-convex feasible region and the non-convex objective function. Adding (9c) to (9d) and performing some 3 In practice, several impact factors influence resistance. We assume the resistance unchanged when the same fronthaul fiber link is used. 2 1− 2 max Bm wn F + Λm F ≤ Pm , ∀m SINRn ≥ Γreq n , ∀n Input req Pn ≥ Pn , ∀n 2 Bm wn F + Λm F Sleep Pm N  s.t. (6) k=1 M   1 P Total {wn }n∈N , {Λm }m∈M  φ m=1 m SP Sleep is the [25]; Pm the signal processing power consumption Pm circuit power consumption in sleep mode. Different from [20], we consider the nonlinear power consumption of the m-th BBU-RRH fronthaul link as  BH 2 {wn }n∈N , Λm (8) = ζm g m Pm N  n=1 + M  m=1 2 Bm wn F Active Pm N  n=1 + P BBU + 0 2 Bm wn F M  m=1 0  2 {wn }n∈N , Λm ζm g m (10) algebraic manipulations, we relax the feasible region of the optimization problem (9) as F ={ N  n=1 2 hH n wn Γreq n  ρ2n 2 max Bm wn F + Λm F ≤ Pm , ∀m 2 ≥ N  hH n wk k=1,k=n 2 + (11a) B. Majorization Procedures 2 σn,p ρ2n 2 + PnCompress + σn,c , ∀n  2 σn,p 1 + Γreq Pnreq n H + , ∀n req hn wn ≥ Γn ρ2n 2n + 2n  (11b) (11c) (11d) Imag hH n wn = 0, ∀n} (11e) where the operator Imag (·) in constraints (11e) represents the imaginary part of a complex value. As a result, the relaxation of the optimization problem (9) is denoted as  min P Total {wn }n∈N , {Λm }m∈M {wn ,ρn ,n }n∈N ,{Λm }m∈M (12) s.t. (11a) − (11e). It has been proved in [11, Proposition 3.1] that a solution to (12) is also a solution to (9) when a certain relationship of 2 2 the system parameters σn,c , σn,p , Γreq and Pnreq is satisfied. n Without loss of generality, we assume that this relationship in [11, Proposition 3.1] is satisfied. A. Feasibility Analysis The problem (12) can be infeasible under certain channel req conditions when the values of Γreq are too high. In n and Pn order to check the feasibility of the region in (11), we first reformulate the region as the intersection of a set of convex cones. Introducing a set of auxiliary variables {θn }n∈N , the constraints in (11b) can be reformulated as the intersection of a second-order cone and positive semidefinite cone as  θn 1 2 σn,p F We observe that the objective function in (17) is still nonconvex due to the existence of 0 -norm and the non-convex  fronthaul data rate gm {wn }n∈N , Λm , m ∈ M. 1) Majorization of 0 -norm: As proposed in [22], the N 2 0 -norm, , can be approximated as n=1 Bm wn F 0 ≤ 1, ∀n   wn hH H √n req ≥ hH n W−k , hn Σ, σn,c , θn Γn  1 2 σn,p  0, ∀n ρn We note that the feasible region of (17) is convex; therefore, we can perform the feasibility check via existing toolbox, e.g., CVX [26]. Without loss of generality, we assume that the optimization problem (12) is feasible. , ∀n (13) (14) W−k  [w1 , . . . , wk−1  , wk+1 , . . . , wN ] and Σ  where H ΛM . B1H Λ1 , B2H Λ2 , . . . , BM Using another set of auxiliary variables {ϑn }n∈N , the constraints in (11c) can be reformulated as the intersection of a second-order cone and two positive semidefinite cones as  1 + Γreq n hH (15) n wn ≥ [θn , ϑn ]F , ∀n Γreq n  1  ϑn (Pnreq ) 4  0 and (14), ∀n. (16) 1 (Pnreq ) 4 n As a result, we can check the feasibility of the optimization problem (11) via solving the following problem Find {wn , ρn , n , θn , ϑn }n∈N and {Λm }m∈M s.t. (11a), (11d) − (11e), (13) − (16). (17) N  2 n=1 Bm wn F = lim →0   N  (τ ) 2 log 1 + n=1 Bm wn F/ log (1 + 1/) 0 (18) where is a small positive forming factor. We observe that numerator of (18) is a log-concave function; therefore, we can obtain the upper bound of the numerator of (18) via the first order approximation in the τ -th iteration as −1 log 1 + N  n=1 2 Bm wn F N  ≤ + (τ ) Bm w n N  + (19) F (τ ) Bm w n n=1 − log 1 + (τ ) −ψm 2 (τ ) Bm wn n=1 N  2 F n=1 where (τ ) = ψm 2 Bm wn F n=1 N  −1 2 F N  Bm wn(τ ) n=1 2 F (20) . 2) Majorization of the Fronthaul Data Rate: We observe  that the fronthaul data rate, gm {wn }n∈N , Λm , is the difference of two concave terms. In order to convexify the fronthaul data rate, we surrogate the first concave term via the following procedures log det N  H Bm wn wnH Bm + Λ2m n=1 ≤  + (τ ) Um H 2 Λm + F (τ ) log det Xm N  n=1 − im  −1 H (τ ) wnH Bm Bm wn Xm (21) where (τ ) Xm  and N n=1  H 2  H ) Bm wn(τ ) wn(τ ) Bm + Λ(τ m  1 (τ ) (τ ) 2 Um  Vm(τ ) Dm . (τ ) (22) (23) (τ ) and the diagonal of are,  Dm−1 (τ ) . respectively, the eigenvectors and eigenvalues of Xm Here, the columns of Vm C. Minimization Procedures Using the surrogate functions in (19) and (21) and introducing a set of auxiliary variables {cm }m∈M , the optimization problem in the minimization procedure is obtained as a convex optimization problem in the τ -th iteration by dropping the constant terms as shown in (26) on top of next page, where (τ ) Δ(τ ) and δm are, respectively, denoted as Δ (τ ) P BBU + M  Sleep Pm + m=1 (τ ) δm  (τ ) (Pm − Pm ) ψm log (1 + −1 ) Active Sleep Active Sleep − Pm Pm  N  (τ ) Bm wn log (1 + −1 ) + n=1 2 F . (24) (25) As a result, we propose a GsPSs algorithm whose procedures are summarized in Algorithm 1. Algorithm 1 GsPSs Algorithm 1: The BBU pool initializes the iteration index τ = 0, the stop threshold ξ and the maximum number of iteration Tmax (0) (0) 2: The BBU pool obtains the a feasible {Λm }m∈M and {wn }n∈N via (17) 3: repeat (τ ) (τ ) 4: The BBU pool updates δm and Xm via (20) and (22) (τ ) (τ ) (τ ) (τ ) 5: With {Λm , δm , Xm }m∈M and {wn }n∈N , the BBU pool (τ +1) solves the optimization problem (26) and obtains the {Λm }m∈M (τ +1) and {wn }n∈N 6: τ := τ + 1 τ τ −1 2 −wn w n Λτm −Λτm−1 2F    F ≤ ξ and   7: until ≤ ξ or τ > Tmax  τ −1 2  τ −1 2 wn  F Λm  F Proposition 1: The proposed GsPSs algorithm converges to the sub-optimal solution of the optimization problem (12); therefore, a sub-optimal solution to (9) is obtained. Proof: We denote the optimal solution of the optimization problem (26) in the τ -th iteration as (τ ) (τ ) (τ ) (τ ) (τ ) (τ ) (τ ) and {Λm , cm }m∈M . {wn , ρn , n , θn , ϑn }n∈N (τ ) (τ ) (τ ) (τ ) (τ ) The optimal solution {wn , ρn , n , θn , ϑn }n∈N and (τ ) (τ ) {Λm , cm }m∈M lie in the feasible region of the (τ + 1)-th iteration. As a result, the objective value decreases after each iteration. The objective value is lower bounded due to the constraints in (11b) and (11c). Hence, the proposed Algorithm 1 converges. With the similar arguments in [27], we can prove (∞) (∞) (∞) (∞) (∞) the convergent solution {wn , ρn , n , θn , ϑn }n∈N (∞) (∞) and {Λm , cm }m∈M satisfies the Karush-Kuhn-Tucker conditions of (12). Based on [11, Proposition 3.1], the Algorithm 1 converges to the sub-optimal solution of (9). IV. N UMERICAL R ESULTS In this section, we present the numerical results to demonstrate the effectiveness of the proposed GsPSs algorithm. Unless otherwise specified, the simulation parameters are specified in Table I. Figure 1 shows the convergence behavior with different values of the forming factor . We observe that the system power consumption decreases monotonically and converges to the suboptimal objective values after a certain number of iterations (less than 10 iterations) under different forming factors, i.e., = 10−1 , = 10−2 , = 10−3 and = 10−4 . TABLE I S IMULATION PARAMETERS S ETTING Parameters Values Number of RRHs, M 5 Number of UEs, N 3 Number of Antenna per RRH 3 2 Gaussian noise power, σn,c −30 dBm 2 Signal processing noise power, σn,p −30 dBm Circuit power consumption SP Pm = 27 dBm Sleep Pm = 13 dBm P BBU = 23 dBm max Maximum TX power of RRH, Pm 20 dBm Minimum required input power, Pnreq 0 dBm SINR requirement, Γreq n 10 dB Fronthaul power cost factor, ζm 7 dBm/ (nat/sec/Hz)2 Amplifier efficiency, φm 0.8 Pathloss factor, χ 2.3 We also observe that a smaller value of results in a smaller objective value of (26). This is due to the fact that the surrogate function can perform a better approximation of the 0 -norm with a smaller value of . Thus, we use = 10−4 in the following numerical results. Figure 2 illustrates the performance variation against the maximum transmission power of each RRH. In Fig. 2(a), we max observe that the total power consumption decreases when Pm is smaller than 24 dBm. The reasons can be explained as max of follows. The larger maximum transmission power Pm each RRH leads to a smaller number of active RRHs as shown in Fig. 2(b). The smaller number of active RRHs indicates a smaller amount of circuit power consumption. Therefore, the total power consumption is decreased. As the maximum max transmission power Pm continues to increase, the total power consumption saturates. This observation can be justified as follows. When the number of active RRHs can satisfy the data rate requirements of the IDMs and the input power demands of the EHMs, switching off more RRHs causes excessive consumed power for those active RRHs. V. C ONCLUSIONS We investigated the power consumption minimization problem in the SWIPT C-RANs. In this paper, the power consumption is defined as the summation of the transmission power, the circuit power and the fronthaul power consumption. We proposed a more practical nonlinear model for the fronthaul links power consumption. Based on the nonlinear model and the MM framework, an algorithm based on group sparse precoding and signal splitting was proposed to obtain the suboptimal solution of the precoding coefficients, the set of active RRHs and the signal splitting ratios. Numerical results show that the proposed algorithm converges after a certain number of iterations. Our results unveil that increasing the power budget of each RRH does not necessarily reduce power consumption. ACKNOWLEDGE This work was supported in part by the University of British Columbia Four-Year Fellowship and in part by a Canadian National Sciences and Engineering Research Council Strategic Partnership Grant. min {wn ,ρn ,n ,θn ,ϑn }n∈N {Λm ,cm }m∈M s.t.  M M N  M     1 1 2 2 (τ ) + δm Bm wn F + Λm F + ζm c2m + Δ(τ ) φ φ m m n=1 m=1 m=1 m=1 N  n=1   −1 H H (τ ) (τ ) Xm wnH Bm Bm w n + Um Λm 2 F (τ ) − 2 log det Λm ≤ cm + im − log det Xm , ∀m (11a), (11d) − (11e), (13) − (16) 4500 4 −1 11000 Power Consumption (mW) ε = 10 −2 ε = 10 −3 10000 ε = 10 −4 ε = 10 9000 8000 7000 6000 req n req Γ n req Γ n Γ 4000 = 10 dB Number of Active RRHs 12000 Total Power Consumption (mW) (26) = 14 dB = 18 dB 3500 req n req Γ n req Γ n Γ 3.5 = 10 dB = 14 dB = 18 dB 3 5000 4000 3000 20 1 3 5 7 9 11 13 15 17 19 21 Number of Iterations 23 25 27 29 Fig. 1. The convergence behavior versus the forming factor . 22 24 26 28 30 The Maximum TX power of RRH (dBm), Pmax m max . (a) Total transmission power v.s. Pm 2.5 20 22 24 26 28 30 The Maximum TX power of RRH (dBm), Pmax m max . (b) The number of active RRHs v.s. Pm max . Fig. 2. The performance variation against the maximum transmission power of each RRH, Pm R EFERENCES [1] B. Kellogg, V. Talla, J. R. Smith, and S. Gollakot, “PASSIVE WI-FI: Bringing low power to Wi-Fi transmissions,” GetMobile: Mobile Comput. and Commun., vol. 20, no. 3, pp. 38–41, Jan. 2017. [2] X. Lu, P. Wang, D. Niyato, D. I. Kim, and Z. Han, “Wireless networks with RF energy harvesting: A contemporary survey,” IEEE Commun. Surveys Tuts., vol. 17, no. 2, pp. 757–789, Second quarter 2015. [3] X. Zhou, R. Zhang, and C. K. Ho, “Wireless information and power transfer: Architecture design and rate-energy tradeoff,” IEEE Trans. Commun., vol. 61, no. 11, pp. 4754–4767, Nov. 2013. [4] A. Checko, H. L. Christiansen, Y. Yan, L. Scolari, G. Kardaras, M. S. Berger, and L. Dittmann, “Cloud RAN for mobile networks – a technology overview,” IEEE Commun. Surveys Tuts., vol. 17, no. 1, pp. 405–426, First quarter 2015. [5] H. Zhang, Y. Dong, J. Cheng, M. J. Hossain, and V. C. M. Leung, “Fronthauling for 5G LTE-U ultra dense cloud small cell networks,” IEEE Wireless Commun., vol. 23, no. 6, pp. 48–53, Dec. 2016. [6] M. Peng, Y. Li, Z. Zhao, and C. Wang, “System architecture and key technologies for 5G heterogeneous cloud radio access networks,” IEEE Netw., vol. 29, no. 2, pp. 6–14, Mar. 2015. [7] Z. Ding, C. Zhong, D. W. K. Ng, M. Peng, H. A. Suraweera, R. Schober, and H. V. Poor, “Application of smart antenna technologies in simultaneous wireless information and power transfer,” IEEE Commun. Mag., vol. 53, no. 4, pp. 86–93, Apr. 2015. [8] L. Liu, R. Zhang, and K. C. Chua, “Wireless information and power transfer: A dynamic power splitting approach,” IEEE Trans. Commun., vol. 61, no. 9, pp. 3990–4001, Sept. 2013. [9] G. Pan, C. Tang, T. Li, and Y. Chen, “Secrecy performance analysis for SIMO simultaneous wireless information and power transfer systems,” IEEE Trans. Commun., vol. 63, no. 9, pp. 3423–3433, Sept. 2015. [10] L. Chen, F. R. Yu, H. Ji, B. Rong, X. Li, and V. C. M. Leung, “Green full-duplex self-backhaul and energy harvesting small cell networks with massive MIMO,” IEEE J. Sel. Areas Commun., vol. 34, no. 12, pp. 3709– 3724, Dec. 2016. [11] Q. Shi, W. Xu, T. H. Chang, Y. Wang, and E. Song, “Joint beamforming and power splitting for MISO interference channel with SWIPT: An SOCP relaxation and decentralized algorithm,” IEEE Trans. Signal Process., vol. 62, no. 23, pp. 6194–6208, Dec. 2014. [12] Y. Dong, H. Zhang, M. J. Hossain, J. Cheng, and V. C. M. Leung, “Energy efficient resource allocation for OFDMA full duplex distributed antenna systems with energy recycling,” in Proc. of IEEE Globecom, Dec. 2015, pp. 1–6. [13] D. W. K. Ng, Y. Wu, and R. Schober, “Power efficient resource allocation for full-duplex radio distributed antenna networks,” IEEE Trans. Wireless Commun., vol. 15, no. 4, pp. 2896–2911, Apr. 2016. [14] H. Zhang, J. Du, J. Cheng, and V. C. M. Leung, “Resource allocation in SWIPT enabled heterogeneous cloud small cell networks with incomplete CSI,” in Proc. of IEEE Globecom, Dec. 2016, pp. 1–5. [15] Y. Gu and S. Aı̈ssa, “RF-based energy harvesting in decode-and-forward relaying systems: Ergodic and outage capacities,” IEEE Trans. Wireless Commun., vol. 14, no. 11, pp. 6425–6434, Nov. 2015. [16] E. Boshkovska, D. W. K. Ng, N. Zlatanov, and R. Schober, “Practical non-linear energy harvesting model and resource allocation for SWIPT systems,” IEEE Commun. Lett., vol. 19, no. 12, pp. 2082–2085, Dec. 2015. [17] Y. Dong, M. J. Hossain, and J. Cheng, “Performance of wireless powered amplify and forward relaying over Nakagami-m fading channels with nonlinear energy harvester,” IEEE Commun. Lett., vol. 20, no. 4, pp. 672–675, Apr. 2016. [18] A. E. Shafie, D. Niyato, and N. Al-Dhahir, “Security of an ordered-based distributive jamming scheme,” IEEE Commun. Lett., vol. 21, no. 1, pp. 72–75, Jan. 2017. [19] D. W. K. Ng and R. Schober, “Secure and green SWIPT in distributed antenna networks with limited backhaul capacity,” IEEE Trans. Wireless Commun., vol. 14, no. 9, pp. 5082–5097, Sept. 2015. [20] B. Dai and W. Yu, “Energy efficiency of downlink transmission strategies for cloud radio access networks,” IEEE J. Sel. Areas Commun., vol. 34, no. 4, pp. 1037–1050, Apr. 2016. [21] D. L. Donoho, “Compressed sensing,” IEEE Trans. Inf. Theory, vol. 52, no. 4, pp. 1289–1306, Apr. 2006. [22] B. K. Sriperumbudur, D. A. Torres, and G. R. G. Lanckriet, “A majorization-minimization approach to the sparse generalized eigenvalue problem,” Mach. Learn., vol. 85, no. 1, pp. 3–39, Oct. 2011. [23] T. M. Cover and J. A. Thomas, Elements of Information Theory. New York, NY, USA: John Wiley & Sons, 2012. [24] Y. Dong, X. Ge, M. J. Hossain, J. Cheng, and V. C. M. Leung, “Proportional fairness based beamforming and signal splitting for MISOSWIPT systems,” IEEE Commun. Lett., to be published. [25] A. Attar, H. Li, and V. C. M. Leung, “Green last mile: How fiberconnected massively distributed antenna systems can save energy,” IEEE Wireless Commun., vol. 18, no. 5, pp. 66–74, Oct. 2011. [26] M. Grant and S. P. Boyd, “CVX: Matlab software for disciplined convex programming, version 2.1,” http://cvxr.com/cvx, Mar. 2014. [27] A. Beck, A. Ben-Tal, and L. Tetruashvili, “A sequential parametric convex approximation method with applications to nonconvex truss topology design problems,” J. Glob. Optim., vol. 47, no. 1, pp. 29–51, 2009.
7cs.IT
The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 Modeling the Behavior of Reinforced Concrete Walls under Fire, Considering the Impact of the Span on Firewalls * Nadia Otmani-Benmehidi Meriem Arar Imene Chine Civil engineering, Laboratory: LMGE, University Badji Mokhtar Annaba, Algeria [email protected] Civil engineering, Laboratory: LMGE, University Badji Mokhtar Annaba, Algeria [email protected] Civil engineering, Laboratory: LMGE, University Badji Mokhtar Annaba, Algeria [email protected] Abstract — Numerical modeling using computers is known to a fire; which has developed fire rules. Regarding the fire behavior of bearing walls, among the authors working in this field, we mention Nadjai A [1], who performed a numerical study validated by an experimental investigation on masonry walls. Also, Cheer-Germ Go and Jun-Ren Tang [12] presented an experimental investigation. Our work presents a contribution to the study of the behavior of reinforced concrete walls, cast in place, exposed to fire, belonging to a residential building. These walls were studied under the rules of wind and earthquake, by engineers in preparation for their final project in study. The building is composed of a ground floor + 9 floors, located in the Prefecture of Annaba (Algeria) [2]. In a fire situation the temperature building rises as a function of the material combustibility and the present oxygen. The fire causes degradation in characteristics of the material, a deformation in structural elements, and cracks will appear; finally, the structure is in ruin. In order to prevent those phenomena and to minimize the spread of the disaster with controlling it as quickly as possible, we can use the firewall in buildings. In this paper we will study four concrete walls; two walls with a section 20470 cm2 reinforced with bars of Ø10 and two other walls having a section of 20350 cm 2 (reinforced with Ø12). We consider a strip of 20 cm to reduce the work. The thermal loading is defined by the standard fire ISO 834[3]. Three walls are exposed to fire on one side; the fourth wall is exposed on two of its sides. The mechanical loading (i.e. compressive load and moment) exerted on the walls in question was taken from a study conducted at cold. The thermal analysis gives the temperatures at every moment and at every point of the walls. These temperatures were used in the mechanical analysis. For the thermal analysis and the mechanical analysis we used the software Safir[4]. This software was developed by Franssen J M [4] in Belgium at the University of Liege, performed for the thermal and mechanical present several advantages compared to experimental testing. The high cost and the amount of time required to prepare and to perform a test were among the main problems on the table when the first tools for modeling structures in fire were developed. The discipline structures-in-fire modeling is still currently the subject of important research efforts around the word, those research efforts led to develop many software. In this paper, our task is oriented to the study of fire behavior and the impact of the span reinforced concrete walls with different sections belonging to a residential building braced by a system composed of porticoes and sails. Regarding the design and mechanical loading (compression forces and moments) exerted on the walls in question, we are based on the results of a study conducted at cold. We use on this subject the software Safir witch obeys to the Eurocode laws, to realize this study. It was found that loading, heating, and sizing play a capital role in the state of failed walls. Our results justify well the use of reinforced concrete walls, acting as a firewall. Their role is to limit the spread of fire from one structure to another structure nearby, since we get fire resistance reaching more than 10 hours depending on the loading considered. Keywords-fire; resistance; flame; behavior; walls I. INTRODUCTION A structure must be designed and calculated so that it remains fit for use as planned. It must resist to different degrees of reliability during execution as well as that during service. Finally, the structure must have adequate durability regarding the maintenance costs. To meet the requirements outlined above, we must: choose the materials appropriately, define a design and appropriate dimensioning. For this purpose, it is imperative to provide rules specific to each country. Various researches were performed by experts in the field of fire, to find out the behavior of the structures; as examples the separations and the bearer elements (concrete column, steel column…) of a building during 600 The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 study of structures subjected to fire, taking into account the material and geometrical nonlinearity and large displacements. Rules Relating to concrete Firewalls in Table I. These rules concern the walls with mechanical slenderness at most equal to 50 and are valid for a wall exposed to fire on one or two sides. The concrete cast in place can be used to make firewalls. Implementation of these structures must respond to rules and code of calculation which concerned them ( DTU fire concrete) [6]. A. Mechanical behavior relating to concrete: the Eurocode 2 model The division of the macroscopically measurable strains in heated concrete into individual strain components is done in the EC2 according to Eq (1)[7][14]: ε tot = ε th +ε  + ε tr + ε cr TABLE I. DEGREE FIREWALLS (1) Bearing wall Separating wall where ε th is the free thermal strain, ε  is the instantaneous stress-related strain, ε tr is the transient creep strain and ε cr is the basic creep strain. The mechanical strain is the sum of the instantaneous stressrelated strain and the transient creep strain. ε tot = ε th +ε m +ε cr Degree CF Depth (cm) Depth (cm) 1/2h 1h 1h30 2h 3h 4h 10 11 12 15 20 25 6 7 9 11 15 17.5 C. Fire walls according to Eurocode2 In section 5.4.3 of Eurocode 2[6], it is recommended that the minimum thickness for normal weight concrete, should not be less than: 200mm for unreinforced wall 140 mm for reinforced load-bearing wall 120 mm for reinforced non load bearing wall (2) where ε m is the mechanical strain. In implicit models, the stress is directly related to the mechanical strain, without calculation of the transient creep strain. In the EC2 model, the relationship at a given Temperature T between the stress and the mechanical strain is given for the ascending branch by Eq (3). D. Fire walls according to our numerical study (3) For more details we invite the lector to see [7]. B. Firewalls with elements in cellular concrete We take as an example, a firewall [5] composed of concrete columns of 45×45 cm and panels of 600×60×15 cm (Posed in front or between the columns) presents a degree firewall equal to 4 hours. We must also note that the PV CSTB n° 87-25851 dated 11 /07 /95 precise that : “an experimental wall of element with reinforced cellular concrete of 15 cm thickness with a nominal density of 450 KG / m3 mounted on flexible joints, has a degree firewall of 4 hours”. Depending on the thickness, the limit height of wall is: Wall thickness 15 cm corresponds to height: H = 17 m Wall thickness 20 cm corresponds to height: H = 22 m Wall thickness 25 cm corresponds to height: H = 28 m As a first approximation, the degree of a firewall composed of solid panels with pre-cast concrete can be deduced from simplified rules, coming from the norm P 92-701 [6] expressed (a) Length of wall superior to 3.5 m (b) The span wall must be reduced with forecast column According to results of numerical study; we recommend to add column, when length of the fire wall exceed 3.5 m, to reduce the span wall. 601 The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 20470cm2. Concerning the mechanical loading each wall is submitted to its ultimate moment (M-ult) and its ultimate compressive load (N-ult). 1 ,5 ≤ L1 ≤3,5 Kr = L1/L , → Kr=3,5/L (4) L1= Kr. L (5) K r: factor of reduction L1: reduced length of wall [m] L: initial length of wall [m] This recommendation should be added in the Eurocode. II. Figure 1. Discretization of walls The two other walls, "Mu (12) 20" and "MuCH (12) 20" have a section of 20350 cm2. They are armed with steel of diameter Ø 12 spaced with 20 cm. Mu (12) 20 is submitted to its ultimate loading (moment and load). The Wall "MuCH (12) 20" has the same mechanical loading (ultimate moment and ultimate compressive load) that Mu 20. For the thermal loading, "Mu (12) 20" and "MuCH (12) 20" are exposed to a fire ISO834 [3] on one side. The floor height (H) is equal to 2.86 m for the four walls. MODELING OF WALLS To begin the numerical study, it is necessary to model the walls considered. The Table II defines the geometrical characteristics and the loads. The reinforcement of each type of wall was calculated according to [2]. Walls: "Mu 20" and "MuF 2O" don’t have the same thermal load. The first is subjected to normalized fire ISO834 [3] on one side, for the second one, we apply the fire on two sides. They contain reinforcements Ø 10 spaced with 20 cm “Fig. 1”. They have the same section of TABLE II. GEOMETRICAL CHARACTERISTICS AND LOADING OF CONSIDERED WALLS Walls H(m) L (cm) e (cm) Ø (mm) thermal loading mechanical loading Mu 20 2,86 470 20 10 ISO834 on one side N-ult,M-ult of (Mu20) MuF 20 2,86 470 20 10 ISO834 on two sides N-ult,M-ult of (MuF20) Mu (12)20 2,86 350 20 12 ISO834 on one side N-ult,M-ult of (Mu (12)20) MuCH (12)20 2,86 350 20 12 ISO834 on one side N-ult,M-ult of (Mu 20) III. h : coefficient of convection, w/m2-K Tg : temperature of the gas, given in the data as a function of time, K Ts: temperature on the boundary of the structure, K THERMAL ANALYSIS A. Basic equation In the software Safir, the heat flux exchanged between a boundary and the hot gas in a fire compartment can be modeled according to the recommendation of Eurocode 1 with a linear convective term and radiation term, see Equation5. B. Temperatures in the wall « MuF20 » In this numerical study, the thermal analysis is a prerequisite for any result, so we start firstly by determining the temperatures at each point of the walls by using code "SAFIR". This code is based on norms [7] and [8]. We cite two cases of walls exposed to fire (MuF 20 and Mu (12) 20). In the case of the wall "MuF 20" which is exposed to fire(in red) in two faces “Fig. 2”, at failed time t = 8940sec or 149min (2.43 h), we get a temperature between 900.78 and 1048.50 ° C (6)  : Stefan-Boltzman coefficient, 5.67 10-8 ε* : relative emissivity of the material 602 The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 at the surfaces in contact with the fire. Away from both faces exposed to fire, temperature decreases to 457.60 ° C. failed time. Of course after a long period, the temperature rises considerably. IV. MECHANICAL ANALYSIS Figure 2. Temperatures of wall « MuF 20 » at failed time Units C. Temperatures in the wall« Mu (12)20 » Figure 4. Appearance of Mu (12) 20 at the failed time The mechanical data file is dependent on thermal analysis for the use of the elements temperatures in function of time. The file in question contains the dimensions of the wall (height and width), the number of nodes is equal to 21. The number of the beam element according to the discretization is taken equal to 10, each element contains 3 nodes. Mechanical loading is represented by a normal force and moment for each wall, the calculation is performed for a strip of 20 cm. Figure 4 shows the appearance of the wall Mu (12) 20 at failed time (t = 25664 sec). Figure 3. Temperatures of wall « Mu (12)20 » at failed time We note from Table III, that Mu (12) 20 has a better fire behavior compared to other walls, because of its good rigidity. MuF20 is identical to Mu 20; however MuF20 is exposed to fire at two sides which explains the good fire behavior of Mu 20 compared to the behavior of MuF 20. The results obtained from the numerical study concerning variations in temperature at the ruin time in the concrete section are in “Fig. 3”. For the failed time (25680s) or 7h 13min, observed temperature of the face exposed to fire (number 1) varies between 970,08 and 1222.20 ° C. In the side who is not exposed to fire (number 2), the temperature is 213,70 ° C at the TABLE III. FIRE RESISTANCE OF CONSIDERED WALLS 603 The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 Wall coating (cm) Height (m) Ø (mm) span Depth M-ult N-ult Rf (m) (m) (t.m) (t) (min) Mu 20 2,4 2,86 Ø 10 4,7 0,2 2,26 41,2 179,78 MuCH (12)20 3 2,86 Ø 12 3,5 0,2 2,26 41,2 278,93 Mu (12)20 3 2,86 Ø 12 3,5 0,2 0,14 26,32 427,75 MuF 20 2,4 2,86 Ø 10 4,7 0,2 2,26 41,2 148,76 A. Displacement and strain of Mu (12)20 In Figure 5, the curve represents the horizontal displacement of the wall "Mu (12) 20." There is a positive evolution (dilatation) during the exposition to fire. The maximum displacement of the node 11 (middle of the wall) at the collapse is 10 cm after a period of t = 25500sec (7h), which is representing 50% of the wall thickness. This displacement is the largest (buckling phenomenon). Given that Mu (12) 20 with section (20x 350) is exposed to fire on one side and mechanically loaded with an ultimate load of 15,040 N and an ultimate moment of 80 N.m according to [2] [9]. We can say that this wall has a good fire resistance. Figure 6. Vertical displacement of Mu (12)20 at the upper end In the case of the node 21 “Fig. 6” located at the upper extremity, the node 21 presents the maximum vertical displacement in sight of the boundary conditions. The vertical displacement is positive and equal to 1, 4 cm (there is an expansion due to thermal loading). This displacement is followed by the collapse of the wall at 25500sec (7h). B. Displacement and strain of Mu20 The mechanical analysis shows that Mu20 deforms with increasing temperature and with time. Curve of node 11“Fig. 7” represents a positive evolution throughout the time of exposition to fire. Figure5. Horizontal displacement of Mu (12)20 at half height Figure 7. Horizontal displacements of nodes 3 and 11 604 The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 The maximum displacement at the collapse is 9cm, given that Mu20 (20x470) is exposed to fire on one side and mechanically loaded with a force (17532 N) and a moment (961,7 N.m). But the node 3 has a small displacement, equal to 3cm. C. Displacement and strain of MuF 20 Figure 9. Vertical displacement of wall MuF20 at the upper end The Wall "MuF20" at its upper end (node 21), underwent dilatation (vertical displacement) of 2,5 cm after an estimated ruin time of 8900sec (148 min)“Fig. 9”. We note that this displacement is important compared to vertical displacements of previous walls, because MuF 20 is exposed to fire according two sides, its dilatation is considerable. In addition, loading has a considerable effect on the walls in case of fire. The fire acts indirectly on the structures (reinforced concrete walls), it destroys the mechanical properties of materials (concrete, steel), so that they become incapable of supporting the loads. Figure 8. Horizontal displacement of the nodes 3 and 11 “Fig.8” shows the horizontal displacements of nodes 3 and 11. MuF20 (20x470) is exposed to fire on both sides, in the case of node 11, whose curve has a greater displacement reaching 4,5cm in an estimated time of 8925sec (149 min). but node 3 has a small displacement equal to 1, 5 cm. The curves obtained in “Fig.11”; show the fire resistances of two walls exposed to fire on one side, and submitted identically to different rates of mechanical loading. These two walls does not have the same dimensions, but are subject to the same mechanical loading and to the same thermal loading (ISO834), as it was mentioned previously. Their sections are respectively, for Mu 20: 20470cm2 and for MuCH (12) 20: 20350 cm2. We note that the fire resistances of these two types of walls are considerably higher than preceding walls (Figure 10). We observe that MuCH (12) acts better than Mu 20. The section of MuCH (12)20 is lower than to that of Mu 20, thus his stress resistance (=N/S) is greater than the stress resistance of Mu 20. Otherwise the section of reinforcement (Ø12) of MuCH (12) 20 is greater than the section of reinforcement (Ø10) of Mu 20. 18000 16000 14000 12000 Load(N/20cm) 20000 N(Mu 20) N(MuF 20) 10000 8000 6000 4000 100 150 200 250 300 350 Rf(min) 400 Figure 10. Fire resistance of walls « Mu 20 » and « MuF 20 » depending on the load 605 The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 V. COMPARISON OF CONSIDERED WALLS Load(N/20cm) 20000 18000 16000 14000 In “Fig.10” the curves show the fire resistance of two walls exposed at fire; the first on two sides (grey curve) and the second (black curve) on one side, considering four rates of loading (100%, 70%, 50% and 30%). We find that the resistance of Mu 20 who was exposed on one side is larger than the resistance of MuF 20 which was exposed to fire on both sides. We also find that mechanical N(Mu 20) N(MuCH(12)20) 12000 10000 8000 The Analysis of these results shows that the increasing of the span wall causes a reduction in the fire resistance. In addition, this analysis justifies well the use of reinforced concrete walls, to limit the spread of fire from one structure to another structure nearby, since the resistances obtained are considerable (10 hours). Finally, we deduce that MuCH(12) 20 has a better fire behavior (stop fire) because it has a good fire resistance which reaches 10 hours. observed that the fire resistance of the wall with the little span is considerably higher than that fire resistance wall with the great span. We conclude that a significant span, more than 3 m is unfavorable for the firewall, since it leads to a reduction in fire resistance.  Walls studied have appreciable fire resistances, which justifies well the use of reinforced concrete walls (firewall), to limit the spread of fire from one structure to another structure nearby. Particularly “Mu (12) 20» has an appropriate size, allowing it to play the role of a firewall, because it has better fire resistance and good rigidity.  Furthermore, it would be interesting to carry out an experimental study on the walls considered to complete this work. 6000 Rf(min) 4000 100 200 300 400 500 600 700 Figure 11. Fire resistance of walls « Mu 20» and «MuCH (12)20 » depending on the load VI.       CONCLSIONS Mu 20 has a better fire behavior than MuF20 (exposed to fire at two sides) despite of their similarities “Fig.12”. The walls "Mu (12) 20 and" MuCH (12) 20 " are similar but the mechanical loading of the first is smaller than the second which gives that the resistance of Mu (12) 20 is equal to the double of the resistance of MuCH (12) 20. We note that the sizing has a significant effect on fire resistance, as well, Mu 20 with a section of 20x470 cm 2 is less resistant than Mu (12) 20 having a section : 20x350 cm2. It is recommended to forecast column, when length of the firewall exceed 3.5 m, to reduce the span wall. The fire resistances of walls considered are close to the fire resistances given by the norms [table1] [5] [6]. On the other hand the displacements of walls are in accordance with the appearance of the curves founded by (A Nadjai, 2006). We note that mechanical loading has a considerable effect on the walls in case of fire, experimental results of numerous researches of structures studied (for example, in university of Liege in BELGIUM), have previously demonstrated that the fire acts indirectly on the structures (in our case the reinforced concrete walls). The fire destroys the mechanical properties of materials (concrete, steel), so that they become unable to bearer the mechanical load. ACKNOWLEDGMENT The work presented was possible with the assistance of Professor Jean Marc Franssen and Mr. Thomas Gernay which we thank gratefully. REFERENCES [1] [2] In order to know the impact of dimensioning, more precisely of the span wall in case of fire we considered two walls (Mu 20 and MuCH (12) 20) not having the same dimensions exposed every two, to the same mechanical loading and to the same thermal loading. We 606 Nadjai A∗, O’Gara M, F. Ali and Jurgen R, Compartment Masonry Walls in Fire Situations, Belfast, 2006. Hacène chaouch A, Etude d’un bâtiment à usage d’habitation, RDC + 9 étages , 2010, [3] ENV 1991 1-2, Eurocode 1, Actions sur les structures – Partie 1-2 : Actions générales - Actions sur les structures exposées au feu, 2002. [4] Franssen J-M. SAFIR, A Thermal/Structural Program Modeling Structures under Fire, Engineering Journal, A.I.S.C., Vol 42, No. 3, 2005,143-158. The International Journal of Soft Computing and Software Engineering [JSCSE], Vol. 3, No. 3, Special Issue: The Proceeding of International Conference on Soft Computing and Software Engineering 2013 [SCSE’13], San Francisco State University, CA, U.S.A., March 2013 Doi: 10.7321/jscse.v3.n3.91 e-ISSN: 2251-7545 [5] 8.5 Les murs coupe-feu en béton, ( DTU feu béton, Eurocode 2, DAN partie 1-2, 1997)iut-tice.ujf-grenoble.fr/ticeespaces/GC/materiaux/mtx3/.../8.5.pdf [6] DTU feu béton, Eurocode 2, DAN partie 1-2, DTU23.1, la norme P 92-701 ), fascicule 62 du CCTG, 1997. [7] Eurocode 2. Calcul des structures en béton et Document d'Application Nationale Partie 1-2 : Règles générales, Calcul du comportement au feu, 2005 [8] NBN EN 1993-1-2, EUROCODE 3 : Calcul des structures en acier – Partie 1-2 : Règles générales – Calcul du comportement au feu, 2004. [9] Autodesk Robot Structural Analysis, 2009 [10] Otmani N, modélisation multi physique du comportement au feu des colonnes en acier et en béton armé, thèse de doctorat, Université d’ Annaba, Algérie, 2010. [11] Dotreppe J.C, Brüls A, Cycle de formation, Résistance au feu des constructions, application des Eurocodes dans le cadre de la formation, Fire Safety Engineering, 2000. [12] Cheer-Germ Go, Jun-Ren Tang, Jen-Hao Chi , Cheng-Tung Chen, Yue-Lin Huang, “Fire-resistance property of reinforced lightweight aggregate concrete wall” Construction and Building Materials 30 (2012) 725–733 [13] G.A. Khoury, B.N. Gringer, and P.J.E. Sullivan, “Transient thermal strain of concrete: Literature review, conditions within specimen and behaviour of individual constituents,” Magazine of Concrete Research, vol. 37, 1985, pp. 131–144. [14] Gernay T, A multiaxial constitutive model for concrete in the fire situation including transient creep and cooling down phases, thesis, University of Liege, Belgium, 2011/2012. [15] Dimia M .S, Guenfoud M, Gernay T, Franssen J-M, Collapse of concrete columns during and after the cooling phase of a fire, Journal of Fire Protection Engineering, (2011) 21(4) 245–263 TABLE IV. NOMENCLATURE Mu 20: MuF 20: Mu (12) 20: MuCH (12) 20: Firewall N-ult: M-ult: : Rf: H: h: L: e: N: S: Ø: Reinforced concrete wall with a thickness equal to 20cm and a span equal to 470cm (reinforcement :Ø10), this wall was exposed to fire on one side. Reinforced concrete wall with a thickness equal to 20cm and a span equal to 470cm (reinforcement :Ø10), this wall was exposed to fire on two sides. Reinforced concrete wall with a thickness equal to 20cm and a span equal to 350cm (reinforcement :Ø12), this wall was exposed to fire on one side. Reinforced concrete wall with a thickness equal to 20cm and a span equal to 350cm (reinforcement: Ø12), this wall was exposed to fire on one side. In this case, we use the ultimate mechanical loading of wall Mu 20. Reinforced concrete wall intended to limit the spread of fire from a structure to another nearby. Ultimate compressive load. Ultimate moment. Stress. Fire resistance. Height. Hour. Span of wall. Thickness of wall. Compressive load. Area of section. Diameter of used steel. 607
5cs.CE
Exemplar or Matching: Modeling DCJ Problems with Unequal Content Genome Data Zhaoming Yin2 , Jijun Tang1,3∗ , Stephen W. Schaeffer4 and David A. Bader2? arXiv:1705.06559v1 [cs.DS] 18 May 2017 1 3 School of Computer Science and Technology, Tianjin University, China 2 School of Computational Science and Engineering, Georgia Institute of Technology, USA Dept. of Computer Science and Engineering, University of South Carolina, USA 4 The Huck Institutes of Life Sciences, Pennsylvania State University, USA Abstract. The edit distance under the DCJ model can be computed in linear time for genomes with equal content or with Indels. But it becomes NP-Hard in the presence of duplications, a problem largely unsolved especially when Indels are considered. In this paper, we compare two mainstream methods to deal with duplications and associate them with Indels: one by deletion, namely DCJ-Indel-Exemplar distance; versus the other by gene matching, namely DCJ-Indel-Matching distance. We design branch-and-bound algorithms with set of optimization methods to compute exact distances for both. Furthermore, median problems are discussed in alignment with both of these distance methods, which are to find a median genome that minimizes distances between itself and three given genomes. Lin-Kernighan (LK ) heuristic is leveraged and powered up by sub-graph decomposition and search space reduction technologies to handle median computation. A wide range of experiments are conducted on synthetic data sets and real data sets to show pros and cons of these two distance metrics per se, as well as putting them in the median computation scenario. Keywords: Genome Rearrangement, Double-cut and Join (DCJ ), LinKernighan Heuristic. 1 Introduction Over the last years, many distance metrics have been introduced to calculate the dissimilarity between two genomes by genome rearrangement [2,3,5,30]. Among them, DCJ distance is largely studied in recent years due to its capability to model various forms of rearrangement events, with a cheap cost of linear time computation. However, when consiering duplications, the distance computation becomes NP-hard [10] and APX-hard [1,12] for various distance models. There are two approaches to treat duplications, both are targeted at removing duplicated genes, so that existing linear algorithms can be utilized subsequently. ? Corresponding Authors 2 The first approach identifies the so called exemplar genes [23] in order to retain one copy gene in each duplicated gene family, while the other assigns one-toone matching to every duplicated genes in each gene family [24, 25]. Situated in the context of duplications, gene insertion and deletion (Indels) are also important rearrangement events that results in unequal contents [8]. Pioneer works were conducted to study the sorting and distance computation by reversals with Indels [17]. Later on, the DCJ-Indel distance metric was introduced to take advantages of the DCJ model. Braga et al [7] proposed the first framework to compute the DCJ-Indel distance; Compeau later simplified the problem with a much more elegant distance formula [13]. In this paper, we adapt the previous research results to design algorithms that procure the ability to handle both duplications and Indels when computing DCJ distance. As evolutionary analysis generally involves more than two species, it is necessary to extend the above distances to deal with multiple genomes. Since three species form the smallest evoliutionary tree, it is critical to study the median problem, which is to construct a genome that minimizes the sum of distances from itself to the three input genomes [6, 18]. The median problem is NP-hard under most distance metrics [4, 9, 21, 27]. Several exact algorithms have been implemented to solve the DCJ median problems on both circular [27, 29] and linear chromosomes [26,28]. Some heuristics are brought forth to improve the speed of median computation, such as linear programming (LP) [9], local search [16], evolutionary programming [14], or simply searching on one promising direction [22]. All these algorithms are intended for solving median problems with equal content genomes, which are highly unrealistic in practice. In this paper, we implement a Lin-Kernighan heuristic leveraging the aforementioned two distance metrics to compute DCJ median when duplications and Indels are considered. 2 2.1 Background Genome Rearrangement Events and their Graph Representations Genome Rearrangement Events The ordering of a genome can be changed through rearrangement events such as reversals and transpositions. Fig 1 shows examples of different events of a single chromosome (1 -2 3 4 -5 6 7). In the examples, we use signed numbers to represent different genes and their orientations. Genome rearrangement events involve with multiple combinatorial optimization problems and graph representation is common to abstract these problems. In this part, we will address the foundations of using the breakpoint graph to abstract genome rearrangement events. Breakpoint Graph Given an alphabet A, two genomes Γ and Π are represented by two strings of signed (+ or −) numbers (representing genes) from A. Each gene a ∈ A is represented by a pair of vertices head ah and tail at ; If a is positive 3 Fig. 1. Example of different rearrangement events. (a) Example of BPG (b) Example of DCJ Fig. 2. Examples of BPG; and DCJ operations. ah is putted in front of at , otherwise at is putted in front of ah . For a, b ∈ A, if a, b ∈ Γ and are adjacent to each other, their adjacent vertices will be connected by an edge. For a telomere genes, if it exists in a circular chromosome, two end vertices will be connected by an edge; if it exists in a linear chromosome, two end vertices will be connected to a special vertex called CAP vertex. If we use one type of edges to represent adjacencies of gene order Γ and another type of edges to represent adjacencies of gene order Π, the resulting graph with two types of edges is called breakpoint graph (BPG). Fig 2(a) shows the BPG for gene order Γ (1,-2,3,-6,5) (edge type: solid edges) which has one circular chromosome and Π (1,2,3,7,4) (edge type: dashed edges) which has one linear chromosome. DCJ operation Double-cut and join (DCJ ) operations are able to simulate all rearrangement events. In a BPG, these operations cut two edges (within one genome) and rejoin them using two possible combinations of end vertices (shown in Fig 2(b)). 2.2 Distance computation DCJ distance DCJ distance of genomes with the same content can be easily calculated by enumerating the number of cycles/paths in the BPG [30], which is of linear complexity. DCJ-Indel distance When Indels are introduced in BPG, with two genomes Γ and Π, the vertices and edges of a closed walk form a cycle. In Fig 2(a), the 4 walk (1t , (1t ; 2h ), 2h , (2h ; 3h ), 3h , (3h ; 2t ), 2t , (2t ; 1t ), 1t ) is a cycle. A vertex v is π-open (γ-open) if v 6∈ Γ (v 6∈ Π). An unclosed walk in BPG is a path. Based on different kinds of ends points of paths, we can classify paths into different types. If the two ends of a path are CAP vertices, we simply denote this path as p0 . If a path is ended by one open vertex and one CAP, we denote it as pπ (pγ ). If a path is ended by two open vertices, we denote it by the types of its two open vertices: for instance, pπ,γ represents a path that ends with a π-open vertex and a γ-open vertex. In Fig 2(a), the walk (5t , (5t ; 1h ), 1h , (1h ; CAP ), CAP ) is a pγ path and the walk (6t , (6t ; 3t ), 3t , (3t ; 7h ), 7h ) is a pγ,π path. A path is even (odd), if it contains even (odd) number of edges. In [13], if |A|= N the DCJ distance between two genomes with Indels but without duplications is calculated by equation (1). We call this distance DCJ-Indel distance. From this equation, we can easily get the DCJ-Indel distance between Γ and Π in Fig 2(a) as 4. dindel (Γ, Π) = N − [|c|+|pπ,π |+|pγ,γ |+bpπ,γ c] (1) 1 0 γ π π γ + (|peven |+min(|podd |, |peven |) + min(|podd |, |peven |) + δ) 2 Where δ = 1 only if pπ,γ is odd and either |pπodd |> |pγeven |, |pγodd |> |pγeven | or |pπodd |< |pγeven |, |pγodd |< |pγeven |; Otherwise, δ = 0. DCJ-Exemplar(Matching) distance There are in general two approaches to cope with duplicated genes. One is by removing all but keeping one copy in a gene family to generate an exemplar pair [23] and the other is by relabeling duplicated genes to ensure that every duplicated gene has unique number [24, 25]. Both of these two distances can be computed with BPG using branch-andbound methods. For both of the distance metrics, the upper bound can be easily derived by assigning an arbitrary mapping to two genomes then computing their mutual distance. In paper [23] regarding exemplar distance, it’s proved that by removing all occurrences of unfixed duplicated gene families, the resulting distance is monotony decreasing, hence the resulting distance can be served as a lower bound. In paper [11] regarding matching distance, the authors proposed a way for computing lower bounds by measuring the number of breakpoints between two genomes, which might not directly imply the lower bound between genomes with Indels. However, it is still possible to use this method to find a ‘relaxed’ lower bound. Distance Estimation Note that mathematically optimized distance might not reflect the true number of biological events, thus several estimation methods such as EDE or IEBP are used to rescale these computed distances [19] to better fit true evolutionary history. 2.3 Median Computation If there are three given genomes, the graph constructed by pre-defined BPG rule is called a Multiple Breakpoint Graph (MBG). Figure 3(a) shows an ex- 5 (a) MBG (b) 0-matching (c) Adequate subgraph and edge shrinking Fig. 3. (top) Examples of MBG with three input genomes: (1,2,3,4) (solid edges); (1,2,-3,4) (dashed edges) and (2,3,1,-4) (dotted edges).; (middle) 0-matching operation; (bottom) edge shrinking operations. ample of MBG with three input genomes. When there are only equal content genomes, the DCJ median problem can be briefly described by finding a maximum matching (which is called 0-matching) in MBG. Figure 3(b) shows an example of 0-matching which is represented by gray edges. In [29], it is proven that a type of sub-graph called adequate sub-graph (AS) could be used to decompose the graph with edge shrinking operations, which are shown in Figure 3(c). Unfortunately, there is no branch-and-bound based median algorithm that deals with unequal content genomes. In the following section, we will show that it is actually difficult to design such algorithm. 3 3.1 Approaches Proposed Distance Metrics We have discussed DCJ, DCJ-Indel and DCJ-Exemplar(Matching) distances, here we formally define the DCJ-Indel-Exemplar(Matching) distances as follows: Definition 1. An exemplar string is constructed by deleting all but one occurrence of each gene family. Among all possible exemplar strings, the minimum distance that one exemplar string returns is the DCJ-Indel-Exemplar distance. Definition 2. A matching string is constructed by assigning a one-to-one mapping to each occurrence of genes in a gene family and relabel them to distinct markers. Among all possible matching strings, the minimum distance that one matching string returns is the DCJ-Indel-Matching distance. 6 Fig. 4. Examples of exemplar and matching distance in the form of BPG representation. Figure 4 shows examples of BPG representation of exemplar mapping from genome Γ (1, -2, 3, 2, -6, 5) and genome Π (1, 2, 3, 7, 2, 4) to Γ (1, 3, 2, 6, 5) and genome Π (1, 3, 7, 2, 4), and a matching that mapping from genome Γ (1, -2, 3, 2, -6, 5) and genome Π (1, 2, 3, 7, 2, 4) to Γ (1, -2, 3, 2’, -6, 5) and genome Π (1, 2’, 3, 7, 2, 4). We can use branch-and-bound methods which are applied in DCJ-Exemplar (Matching) distances to solve these two distances. 3.2 Optimization Methods Optimal Assignments Although branch-and-bound algorithms are based on enumerating the number of cycles/path in BPG, it is not necessary to enumerate every component in the graph, as both [11, 25] indicated that there are some specific patterns in BPG which can be fixed before the distance computation. In this paper, we will extend their result in our optimization methods for DCJIndel-Exemplar(Matching) distances. To begin with, we define some terms for future explanation. There are two categories of vertices in a BPG: one connects exactly one edge of each edge type (in this paper edge types are expressed by such as dotted, dashed edges etc.), they are called regular vertices; the other connects fewer or more than one edges of each edge type, they are called irregular vertices. A subgraph in a BPG that only 7 contains regular vertices is defined as regular subgraph, while one that contains irregular vertices is defined as irregular subgraph. In BPG with two genomes Γ and Π, vertices and edges of a closed walk form a cycle. Theorem 1. In a BPG, an irregular subgraph which is a cycle of length 2 can be fixed before computation without losing accuracy. Proof. Without loss of generality, the proof is sound for both DCJ-Indel-Exemplar and DCJ-Indel-Matching distances. We prove the theorem under two cases: 1. for the subgraph in the component which only contains cycles, this is a case that is exactly the same as mentioned in [25], proof. 2. for the subgraph in the component which contains paths, since no type of the paths has count more than one (which is the count of a cycle), following the similar proof strategy in [25], we can get the same conclusion.  Adopting Morph Graph Methods to Condense BPG If a gene family has multiple copies of the gene, its corresponding two vertices (head and tail) in the BPG will have degree of more than one. In contrary, vertex representations of those singleton genes always have degree of one or zero. Once an ‘exemplar’ or ‘matching’ is fixed, only edges incident to vertices that have degree of more than one have been changed. We can view the computation of exemplar or matching distance as the process of morphing (or streaming) [32] the BPG in order to find an ad hoc shape of the BPG that achieves optimality. Following this hint, we can bridge out all vertices that are stable and just investigate these dynamically changing vertices without lossing accuracy. Suppose there are V vertices in the BPG, where Vs are stable and Vd are dynamic, the asymptotic speedup for this morph BPG strategy will be O( VVd ). Harness the Power of Divide-and-Conquer Approach to Reduce the Problem Space In the paper by Nguyen et al [20], the authors proposed a divide and conquer method to quickly calculate the exemplar distance. Inspired by their idea, we propose the following divide-and-conquer method to compute the above two distances based on the BPG. We have the follow observation: Theorem 2. The DCJ-Indel-Exemplar (Matching) distance is optimal iff the choices of exemplar edges (cycle decomposition) in each connected components of BPG are optimal. Proof. Since it’s obvious that for regular connected component of BPG, there is only one choice of edges, the proof under this case is trivial. For irregular connected component of BPG, we prove by contrary: suppose there is another edge selection that can result in a better distance, based on the corresponding BPG, there must be at least one connected component that has a better edge selection, replacing it with a better edge selection will result in a better distance, which violates the assumption.  8 22 Algorithm 1: DCJIndelExem(Matc)Distance Input: G1 and G2 Output: Minimum distance d optimization methods on G1 , G2 ; 0 0 G1 , G2 ←randomly init exemplar(matching) of all duplicated genes of G1 , G2 ; G∗1 , G∗2 ←remove all duplicated genes of G1 , G2 ; 0 0 min_ub ← DCJIndel(G1 , G2 ) ; ∗ ∗ min_lb ← DCJIndel(G1 , G2 ) ; Init search list L of size min_ub − min_lb and insert G1 , G2 ; while min_ub > min_lb do + G+ 1 , G2 ← pop from L[min_lb]; for pair ∈ all mappings of next available duplicated gene do + + + G+ 1 , G2 ← G1 , G2 fix the exemplar(matching) of pair ; 0 0 + G+ 1 , G2 ←randomly init exemplar(matching) of rest duplicated genes + G1 , G+ 2; +∗ +∗ + G1 , G2 ←remove rest duplicated genes G+ 1 , G2 ; +0 +0 ub ← DCJIndel(G1 , G2 ) ; +∗ lb ← DCJIndel(G+∗ 1 , G2 ) ; if lb > min_ub then + discard G+ 1 , G2 if ub < min_ub then min_ub = ub; else if ub = max_lb then return d = ub ; else + insert G+ 1 , G2 into L[lb] 23 return d = min_lb; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Combining three optimization methods in tandem with the branch-and-bound framework, we can summarize our algorithm to compute DCJ-Indel-Exemplar (Matching) distance as outlined in Algorithm 1. 3.3 Adapting Lin-Kernighan Heuristic to Find the Median Genome Problem Statement Not surprisingly, finding the median genome that minimizes the DCJ-Indel-Exemplar(Matching) distance is challenging. To begin with, given three input genomes, there are multiple choices of possible gene content selections for the median; however, since identifying gene content is simpler and there exists very accurate and fast methods to fulfil the task [15], we are more interested on a relaxed version of the median problem that assumes known gene content on the median genome. Which is formally defined as: 9 Definition: Given the gene content of a median genome, and gene orders of three input genomes. Find an adjacency of the genes of the median genome that minimize the DCJ-Indel-Exemplar(Matching) distance between the median genome and the three input genomes. The DCJ-Indel-Exemplar(Matching) median problem is not even in the class of NP because there is no polynomial time algorithm to verify the results. It is hard to design an exact branch-and-bound algorithm for the DCJ-IndelExemplar(Matching) median problem mainly because the DCJ-Indel distance violates the property of triangular inqueality which is required for a distance metrics [31]. Furthermore, when there are duplicated genes in a genome, it is possible that there are multiple edges of the same type connecting to the same vertex of a 0-matching, which leads to ambiguity in the edge shrinking step and makes the followed branch-and-bound search process very complicated and extremely hard to implement. To overcome these problems, we provide an adaption of Lin-Kernighan (LK ) heuristic to help solving this challenging problem. Design of the Lin-Kernighan Heuristic The LK heuristic can generally be divided into two steps: initialize the 0-matching for the median genome, and LK search to get the result. The initialization problem can be described as: given the gene contents of three input genomes, find the gene content of the median genome that minimizes the sum of the number of Indels and duplications operations required to transfer the median gene content to the gene contents of the other three genomes. In this paper, we design a very simple rule to initialize the median gene content: given the counts of each gene family occurred in the three genomes, if two or three counts are the same, we simply select this count as the number of occurrence of the gene family in the median genome; if all three counts are different, we select the median count as the number of occurrence of the gene family in the median genome. After fixing the gene content for the median genome, we randomly set up the 0-matching in the MBG. The followed LK heuristic selects two 0-matching edges on the MBG of a given search node and performs a DCJ operation, obtaining the MBG of a neighboring search node. We expand the search frontier by keeping all neighboring search nodes to up until the search level L1. Then we only examine and add the most promising neighbors to the search list until level L2. The search is continued when there is a neighbor solution yielding a better median score. This solution is then accepted and a new search is initialized from the scratch. The search will be terminated if there are no improvement on the result as the search level limits have been reached and all possible neighbors have been enumerated. If L1 = L2 = K, the algorithm is called K-OPT algorithm. Adopting Adequate Sub-graphs to Simplify Problem Space By using the adequate subgraphs [26, 29], we can prove that they are still applicable for decomposing the graph in the DCJ-Indel-Exemplar(Matching) median problem. 10 Algorithm 2: DCJIndelExem(Matc)Median 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Input: MBG G, Search Level L1 and L2 Output: 0-matching of G Init search list L of size L1; Init 0-matching of G; currentLevel ← 0 and Improved ← true; while Improved = true do currentLevel ← 0 and Improved ← f alse; Insert G into L[0]; while currentLevel < L2 do G0 ← pop from list L[currentLevel]; if G0 improves the median score then G ← G0 ; Improved ← true and break ; if currentLevel < L1 then for x ∈ ∀ 0-matching pairs of G do G0 ← perform DCJ on G0 using x; if num_pair(x) > δ then Insert G0 into L[currentLevel + 1] ; else G0 ← perform DCJ on G0 using x = argmax num_pair(x) ; x 18 19 20 if num_pair(x) > δ then Insert G0 into L[currentLevel + 1] ; currentLevel ← currentLevel + 1 ; return 0-matching of G; Lemma 1. As long as the irregular vertices do not involve, regular subgraphs are applicable to decompose MBG. Proof. If there are d number of vertices that contain duplicated edges in MBG, we can disambiguate the MBG by generating different subgraphs that contain only one of the duplicateQ edge. We call these subgraphs disambiguate MBG, (dMBG), and there are O( i<d deg(i)) number of d-MBGs. If a regular adequate subgraph exists in the MBG, it must also exists in every d-MBG. Based on the 0-matching solution, we can transform every d-MBG into completed d-MBG (cdMBG) by constructing the optimal completion [13] between 0-matching and all the other three types of edges. After this step, the adequate subgraphs in every d-MBG still exist in every cd-MBG, thus we can use these adequate subgraphs to decompose cd-MBG for each median problem without losing accuracy.  Search Space Reduction Methods The performance bottleneck with the median computation is in the exhaustive search step, because for each search level we need to consider O(|E|2 ) possible number of edge pairs, which is O(|E|2L1 ) in total. Unlike the well-studied traveling salesman problem (TSP) where it is cheap to find the best neighbor, here we need to compute the DCJ-Indel- 11 Exemplar(Matching) problem,NP-hard distance, which makes this step extremely expensive to conclude. Noticing that if we search neighbors on edges that are on the same 0-i color altered connected component (0-i-comp), the DCJ-IndelExemplar(Matching) distance for genome 0 and genome i is more likely to reduce [32], thus we can sort each edge pair by how many 0-i-comp they share. Suppose the number of 0-i-comp that an edge pair x share is num_pair(x), when the algorithm is in the exhaustive search step (currentLevel < L1), we set a threshold δ and select the edge pairs that satisfy num_pair(x) > δ to add into the search list. When it comes to the recursive deepening step, we select the edge pair that satisfy argmax num_pair(x) to add into the search list. This strategy x has two merits: 1) some of the non-promising neighbor solution is eliminated to reduce the search space; 2) the expensive evaluation step which make a function call to DCJ-Indel-Exemplar(Matching) distance is postponed to the time when a solution is retrieved from the search list. The LK based median computation algorithm is as Algorithm 2 shows. 4 Experimental Results We implement our code with python and C++: the python code realized the optimization methods while the C++ code is implemented on a parallel branchand-bound framework OPTKit. We conduct extensive experiments to evaluate the accuracy and speed of our distance and median algorithms using both simulated and real biological data. Experimental tests ran on a machine with linux operating system configured with 16 Gb of memory and an Intel(R) Xeon(R) CPU E5530 16 core processor, each core has 2.4GHz of speed. All of the experiments ran with a single thread. We choose to use g++-4.8.1 as our compiler. 4.1 Distance Computation To the best of our knowlege, there is no software package that can handle both duplications and Indels. We compare our DCJ-Indel-Exemplar (Matching) distances with GREDO [25], a software package based on linear programming that can handle duplications. Simulated Data The simulated data sets are generated with genomes containing 1000 genes. The Indels rate is set (γ) as 5%, inline with the duplication rate (φ) as 10%. Considering GREDO can not process Indel data, all Indels for GREDO are removed. We compare the change of distance estimation with the variation of mutation rate (θ, which grows from 10% to 100%. The experimental results for simulated data are displayed in Figure 5. 1. For computational time, since the results of time spans over a range of thousands of seconds, we display the time with log scale to construe results clearly. 12 (a) Time result for simulated data. (b) Distance result for simulated data. Fig. 5. Experimental results for distance computation using simulated data. (a) γ = φ = 0% and θ varies from 10% to 100%. (b) γ = φ = 5% and θ varies from 10% to 60%. Fig. 6. Experimental results for median computation applying DCJ-Indel-Exemplar distance. When the mutation rate is less than 50%, all three methods perform similarly, with the fact that GREDO is faster than both of our branch-and-bound methods. However, GREDO slows down dramatically when the mutation 13 Distance Results Data Time Results GREDO Exem Matc GREDO Exem Matc brownrat_chicken 1678 24546 24704 3604.28 172.73 7.45 brownrat_gorilla 1274 17922 17966 5707.13 12.64 12.10 brownrat_human 1083 17858 17900 3725.76 12.14 12.19 brownrat_mouse 790 15433 15445 3725.66 14.51 15.06 chicken_gorilla 1491 16379 16421 3725.62 7.54 7.57 chicken_human 1521 16231 16276 3725.65 7.74 7.47 chicken_mouse 1528 15712 15745 3726.03 9.82 8.16 gorilla_human 486 17798 17798 3607.63 13.94 13.81 gorilla_mouse 860 18914 18935 4816.31 12.60 12.13 human_mouse 749 18126 18144 94.64 12.45 12.61 Table 1. Experimental results for disntance computation with real data set. (a) γ = φ = 5% and θ varies from 10% to 100%. (b) γ = φ = 10% and θ varies from 10% to 100%. Fig. 7. Experimental results for median computation applying DCJ-Indel-Matching distance. rate is increased, while our branch-and-bound based method takes less increased time to finish. 14 2. For computational accuracy, we show the distance results corrected by EDE approach which is one of the best true distance estimator. As for simulated data, we can see that when the mutation rate is small (< 50%) GREDO under estimate the distance as opposed to our two branch-and-bound methods; but it will over estimate the distance with the growth of mutation rate. Real data We prepare the real data sets using genomes downloaded from Ensenble and processed them following the instructions in [25]. The real data set contains 5 species: brown-rat, chicken, human, mouse and gorilla. For DCJ-IndelExemplar (Matching) distance, we only convert the Ensenmble format to adapt the data to our program. Meanwhile, just as the simulated data, all Indels in real data set for GREDO are removed. The results for real data are shown in Table 1. 1. For computational time, the branch-and-bound method shows orders of magnitudes of speed up compared with GREDO. We analyze the data, the reason can be construed as the existance of multiple connected comonent in BPG. So that our method can divide the graph into much smaller size, versus GREDO which doesn’t have this mechanism. 2. For computational accuracy, the distance results of the real data gives us a taste of how frequently Indels happend in the genome evolution. We can see orders of magnitude of difference between our distance results and GREDO, which is mainly due to the large amount of Indels in the real data set. Note that we did not change the way GREDO compute its distance as in paper [25], in the real distance computation, we should consider Indels in alignment with duplications. 4.2 Median Computation Median Computation We simulate the median data of three genomes using the same strategy as in the distance simulation. In our experiments, each genome is “evolved” from a seed genome, which is identity, and they all evolve with the same evolution rate (θ, γ and φ). The sequence length in the median experiments are reduced to 50, due to performance issues. DCJ-Indel-Exemplar median We analyze the result of using LK algorithm with L1 = 2 and L2 = 3, and the K-OPT algorithm of K = 2. Search space reduction methods are used, with δ = 2 and δ = 3 respectively. 1. To begin with, we compare our result along with equal content data, since there are already benchmark programs to help us performing analysis. We run the exact DCJ median solver (we use the one in [32]) to compare our heuristic with the exact median results. In Fig 6(a), it shows the accuracy of our heuristic versus the exact result. It is shown that when θ ≤ 60%, all results of the LK and K-OPT methods are quite close to the exact solver. 15 For parameter of δ = 2, both LK and K-OPT methods can generate exactly the same results for most of the cases. 2. As for the median results for unequal contents, we set both γ and φ to 5% and increase the mutation (inversion) rate θ from 10% to 60%. We compare our results with the accumulated distance of the three genomes to their simulation seed. Although it can not show the accuracy of our method (since we do not have an exact solver), it can be used as an indicator of how close that our method is to the real evolution. Fig 6(b) shows that when δ = 3, both the LK and K-OPT algorithms get results quite close to the real evolutionary distance. DCJ-Indel-Matching median Since DCJ-Indel-Exemplar median has already given us the result of how LK performs against exact solver, and how different parameters of LK performs. With these things in mind, we choose to use LK with L1 = 2 and L2 = 3 having δ = 2 as the configuration for our DCJ-IndelMatching median solver. We use the same data as in the previous experiments, and the experimental results are shown in Figure 7(a) and Figure 7(b). We can see that in general, the new implementation is quite close to the real result when γ = 5% and φ = 5% and slightly worse than real result when γ = 10% and φ = 10%. 5 Conclusion In this paper, we proposed a new way to compute the distance and median between genomes with unequal contents (with Indels and duplications). Our distance method can handle Indels which is ubiquitous in the real data set, and is proved to be more efficient as opposed to GREDO. We designed a LinKernighan based method to compute median, which can get close to optimal results in alignment with the exact median solver, and our methods can handle duplications and Indels as well. 6 Acknowledgements This Research was sponsored in part by the NSF OCI-0904461 (Bader), OCI0904179, IIS-1161586 (Tang) and OCI- 0904166 (Schaeffer). References 1. Angibaud, S., Fertin, G., Rusu, I., Thévenin, A., Vialette, S.: On the approximability of comparing genomes with duplicates. J. Graph Algorithms Appl. 13(1), 19–53 (2009) 16 2. Bader, D.A., Moret, B.M.E., Yan, M.: A linear-time algorithm for computing inversion distance between signed permutations with an experimental study. Journal of Computational Biology 8, 483–491 (2001) 3. Bafna, V., Pevzner, P.A.: Sorting by transpositions. SIAM J. Discrete Math. 11(2), 224–240 (1998) 4. Bergeron, A., Mixtacki, J., Stoye, J.: On sorting by translocations. In: Journal of Computational Biology. pp. 615–629. Springer (2005) 5. Blin, G., Chauve, C., Fertin, G.: The breakpoint distance for signed sequences. In: Proc. CompBioNets 2004. vol. Text in Algorithms, Volume 3, pp. 3–16. King’s College London (2004) 6. Bourque, G., Pevzner, P.A.: Genome-Scale Evolution: Reconstructing Gene Orders in the Ancestral Species. Genome Res. 12(1), 26–36 (2002) 7. Braga, M.D.V., Willing, E., Stoye, J.: Genomic distance with dcj and indels. In: Proceedings of the 10th international conference on Algorithms in bioinformatics. pp. 90–101. WABI’10, Springer-Verlag, Berlin, Heidelberg (2010) 8. Brewer, C., Holloway, S., Zawalnyski, P., Schinzel, A., FitzPatrick, D.: A chromosomal duplication map of malformations: Regions of suspected haplo and triplolethality and tolerance of segmental aneuploidy in humans. The American Journal of Human Genetics 64(6), 1702 – 1708 (1999) 9. Caprara, A.: The Reversal Median Problem. INFORMS Journal on Computing 15(1), 93–113 (2003) 10. Chauve, C., Fertin, G., Rizzi, R., Vialette, S.: Genomes containing duplicates are hard to compare. In: Proc Int. Workshop on Bioinformatics Research and Applications (IWBRA). LNCS, vol. 3992, pp. 783–790. Springer-Verlag, Reading, UK (2006) 11. Chen, X., Zheng, J., Fu, Z., Nan, P., Zhong, Y., Lonardi, S., Jiang, T.: Assignment of orthologous genes via genome rearrangement. IEEE/ACM Trans. Comput. Biology Bioinform. 2(4), 302–315 (2005) 12. Chen, Z., Fu, B., Zhu, B.: Erratum: The approximability of the exemplar breakpoint distance problem. In: FAW-AAIM. p. 368 (2012) 13. Compeau, P.E.C.: A simplified view of dcj-indel distance. In: Proceedings of the 12th international conference on Algorithms in Bioinformatics. pp. 365–377. WABI’12, Springer-Verlag, Berlin, Heidelberg (2012) 14. Gao, N., Yang, N., Tang, J.: Ancestral genome inference using a genetic algorithm approach. PLoS ONE 8(5) (2013) 15. Hu, F., Zhou, J., Zhou, L., Tang, J.: Probabilistic reconstruction of ancestral gene orders with insertions and deletions. IEEE/ACM Trans. Comput. Biology Bioinform. 11(4), 667–672 (2014), http://doi.ieeecomputersociety.org/10.1109/ TCBB.2014.2309602 16. Lenne, R., Solnon, C., Stutzle, T., Tannier, E., Birattari, M.: Reactive Stochastic Local Search Algorithms for the Genomic Median Problem. In: Carlos Cotta, J.v.H. (ed.) Eighth European Conference on Evolutionary Computation in Combinatorial Optimisation (EvoCOP). pp. 266–276. LNCS, Springer (Mar 2008) 17. Mabrouk, N.E.: Sorting Signed Permutations by Reversals and Insertions/Deletions of Contiguous Segments. Journal of Discrete Algorithms 1(1), 105– 122 (2001) 18. Moret, B.M.E., Tang, J., san Wang, L., Warnow, Y.: Steps toward accurate reconstructions of phylogenies from gene-order data. J. Comput. Syst. Sci 65, 508–525 (2002) 17 19. Moret, B.M.E., Wang, L.S., Warnow, T., Wyman, S.K.: New approaches for reconstructing phylogenies from gene order data. In: ISMB (Supplement of Bioinformatics). pp. 165–173 (2001) 20. Nguyen, C.T., Tay, Y.C., Zhang, L.: Divide-and-conquer approach for the exemplar breakpoint distance. Bioinformatics 21(10), 2171–2176 (May 2005) 21. Pe’er, I., Shamir, R.: The median problems for breakpoints are np-complete. Elec. Colloq. on Comput. Complexity 71 (1998) 22. Rajan, V., Xu, A.W., Lin, Y., Swenson, K.M., Moret, B.M.E.: Heuristics for the inversion median problem. BMC Bioinformatics 11(S-1), 30 (2010) 23. Sankoff, D.: Genome rearrangement with gene families. Bioinformatics 15(11), 909– 917 (1999) 24. Shao, M., Lin, Y.: Approximating the edit distance for genomes with duplicate genes under dcj, insertion and deletion. BMC Bioinformatics 13(S-19), S13 (2012) 25. Shao, M., Lin, Y., Moret, B.M.E.: An exact algorithm to compute the dcj distance for genomes with duplicate genes. In: RECOMB. pp. 280–292 (2014) 26. Xu, A.W.: Dcj median problems on linear multichromosomal genomes: Graph representation and fast exact solutions. In: RECOMB-CG. pp. 70–83 (2009) 27. Xu, A.W.: A fast and exact algorithm for the median of three problem: A graph decomposition approach. Journal of Computational Biology 16(10), 1369–1381 (2009) 28. Xu, A.W., Moret, B.M.E.: Gasts: Parsimony scoring under rearrangements. In: WABI. pp. 351–363 (2011) 29. Xu, A.W., Sankoff, D.: Decompositions of multiple breakpoint graphs and rapid exact solutions to the median problem. In: Proceedings of the 8th international workshop on Algorithms in Bioinformatics. pp. 25–37. WABI ’08, Springer-Verlag, Berlin, Heidelberg (2008) 30. Yancopoulos, S., Attie, O., Friedberg, R.: Efficient sorting of genomic permutations by translocation, inversion and block interchange. Bioinformatics 21(16), 3340– 3346 (2005) 31. Yancopoulos, S., Friedberg, R.: Sorting genomes with insertions, deletions and duplications by dcj. In: Nelson, C.E., Vialette, S. (eds.) RECOMB-CG. Lecture Notes in Computer Science, vol. 5267, pp. 170–183. Springer (2008) 32. Yin, Z., Tang, J., Schaeffer, S.W., Bader, D.A.: Streaming breakpoint graph analytics for accelerating and parallelizing the computation of dcj median of three genomes. In: ICCS. pp. 561–570 (2013)
8cs.DS
Efficient Convolutional Auto-Encoding via Random Convexification and Frequency-Domain Minimization arXiv:1611.09232v1 [stat.ML] 28 Nov 2016 Meshia C. Oveneke1 , Mitchel Aliosha-Perez1 , Yong Zhao12 , Dongmei Jiang2 , Hichem Sahli13 1 VUB-NPU Joint AVSP Research Lab Vrije Universiteit Brussel (VUB) Deptartment of Electronics & Informatics (ETRO) Pleinlaan 2, Brussels, Belgium {mcovenek,maperezg,yzhao,hsahli}@etrovub.be 2 VUB-NPU Joint AVSP Research Lab Northwestern Polytechnical University (NPU) Shaanxi Key Lab on Speech and Image Information Processing Youyo Xilu 127, Xi’an 710072, China [email protected] 3 Interuniversity Microelectronics Centre (IMEC) Kapeldreef 75, 3001 Heverlee, Belgium Abstract The omnipresence of deep learning architectures such as deep convolutional neural networks (CNN)s is fueled by the synergistic combination of ever-increasing labeled datasets and specialized hardware. Despite the indisputable success, the reliance on huge amounts of labeled data and specialized hardware can be a limiting factor when approaching new applications. To help alleviating these limitations, we propose an efficient learning strategy for layer-wise unsupervised training of deep CNNs on conventional hardware in acceptable time. Our proposed strategy consists of randomly convexifying the reconstruction contractive auto-encoding (RCAE) learning objective and solving the resulting large-scale convex minimization problem in the frequency domain via coordinate descent (CD). The main advantages of our proposed learning strategy are: (1) single tunable optimization parameter; (2) fast and guaranteed convergence; (3) possibilities for full parallelization. Numerical experiments show that our proposed learning strategy scales (in the worst case) linearly with image size, number of filters and filter size. 1 Introduction At the heart of the recent success of deep convolutional neural networks (CNN)s in several application domains such as computer vision, speech recognition and natural language processing, is the synergistic combination of ever-increasing labeled datasets and specialized hardware in the form of graphical processing units (GPU)s [16], field programmable gate arrays (FPGA)s [10] or computer clusters [18]. Despite this indisputable success, relying on huge amounts of labeled data and specialized hardware can be a limiting factor when approaching new applications. Furthermore, for applying deep learning techniques locally on platforms with limited resources, one cannot rely on huge amounts of labeled data and specialized hardware. We therefore argue that there is a growing need for resource-efficient unsupervised learning strategies capable of training deep CNNs on conventional hardware in acceptable time. The main purpose of unsupervised learning is to leverage the wealth of unlabeled data for disentangling the causal (generative) factors [2, 7]. In the context of supervised pattern classification, empirical evidence shows that: unsupervised pre-training (generative) helps in disentangling the class 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. manifolds in the lower layers of a deep CNNs, the upper layers are better disentangled when they are subject to supervised training (discriminative) and a combination of the two boosts the overall performance when the ratio of unlabeled to labeled samples is high [3, 4, 14]. In this work, we propose to train deep CNNs in a greedy layer-wise manner, using the reconstruction contractive auto-encoding (RCAE) learning objective [1]. The RCAE learning objective has been proven (theoretically and empirically) to capture the local shape of the data-generating distribution [2, 1], hence capturing the manifold structure of the data. Meanwhile, minimizing the RCAE learning objective involves solving a non-convex minimization problem, often addressed using stochastic gradient descent (SGD) methods [13]. Despite their empirical success when applied to deep CNNs, their key disadvantage is the computationally expensive manual tuning of optimization parameters such as learning rates and convergence criteria. Moreover, their inherently sequential nature makes them very difficult to parallelize using GPUs or distribute them using computer clusters [13]. To overcome the above-mentioned difficulties, we propose to convexify the RCAE learning objective. To this end, inspired by recent work such as [15, 8, 11], we propose to adopt a random convexification strategy by fixing the (non-linear) encoding parameters and only learning the (linear) decoding parameters. By further transforming the randomly convexified RCAE objective into the frequency domain using the discrete Fourier transform (DFT), we obtain a learning objective which we propose to minimize using coordinate descent (CD) [12, 17]. The main advantages of our proposed learning strategy are: (1) single tunable optimization parameter; (2) fast and guaranteed convergence; (3) possibilities for full parallelization. 2 Efficient Convolutional Auto-Encoding The main motivation of this work is efficient unsupervised training of deep CNNs. To this end, we adopt a greedy layer-wise learning strategy and consider deep CNNs as a stack of single-layer CNNs with K filtersand input space X ⊂ Rd×d×C , i.e. the space of C-channel d × d images 1 x = x(1) , . . . , x(C) . We further propose to train each single-layer CNN using the reconstruction contractive auto-encoding (RCAE) learning objective [1]. The RCAE learning objective has been proven to capture the high-density regions of the (layer-wise) data-generating distribution for any twice-differential reconstruction (encoding-decoding) function and regularization parameter approaching 0 asymptotically. To this end, we consider the following parametric reconstruction function: r(x; θ) , K X C X w(k) ∗ g( a(k) ∗ x(c) + b(k) ) c=1 k=1 | {z } | {z decoding = K X encoding } (1) w(k) ∗ h(k) k=1 with g(·) denoting the entry-wise application of a twice-differentiable activation function g : R → R. (k) K The model parameters θ consist of w×w encoding filters {a(k) }K }k=1 k=1 , h×h encoding biases {b (k) K and w × w decoding filters {w }k=1 . We consider a valid convolution for the encoding function, yielding a dimension h = d − w + 1, and a full convolution for the decoding function. The core idea behind our proposed layer-wise learning strategy is to sample each entry of the (non(k) K linear) encoding parameters {a(k) }K }k=1 i.i.d. from pre-determined density functions k=1 and {b p(a) and p(b) respectively, and keeping them fixed while learning the (linear) decoding parameters {w(k) }K k=1 in the frequency domain. To this end, we define the complex-valued decoding parameters (k) K associated to {w(k) }K }k=1 , with W(k) = F{w(k) } ∈ Cd×d being the discrete Fourier k=1 as {W transform (DFT). Given a set of N training images DN = {xn }N n=1 sampled i.i.d. from the data1 Although we consider d × d images, the remaining calculations also hold for rectangular images. 2 generating distribution p(x), we define the following frequency-domain RCAE objective: # " Z 2 ∂r(x; θ) 2 dx LRCAE = p(x) kr(x; θ) − xkF + λ ∂x X F   2 N ∂r(x; θ) 1 X 2  ≈ kr(xn ; θ) − xn kF + λ N n=1 ∂x x=xn F  ( ) 2 N 1 X ∂r(x; θ) 2  ∝ kF{r(xn ; θ) − xn }kF + λ F N n=1 ∂x x=xn F   2 2 K N K X 1 X  X (k)  = W H(k) +λ W(k) D(k) n − Xn n N n=1 k=1 F k=1 (2) F (k) where k • kF is the Frobenius norm, denotes the Hadamard (entry-wise)product [5], Hn = PC (k) (c) (k) (k) (k) F{hn }, Xn = = Gn A(k) with Gn = F ∂g(v) and c=1 F{xn }, Dn (k) ∂v v=vn PC (k) (c) vn = c=1 a(k) ∗ xn + b(k) . We used Parseval’s theorem in conjunction with the convolution theorem [9] for transforming the randomly convexified RCAE objective from spatial to frequency domain. As a direct consequence, minimizing the transformed RCAE objective (2) reduces to solving d2 independent K-dimensional regularized linear least-squares problems, which offers full parallelization possibilities. We propose to solve each of the independent K-dimensional problems using coordinate descent (CD) [17], which has recently witnessed a resurgence of interest in largescale optimization problems due to its simplicity and fast convergence [12]. In the context of RCAE, the CD method consists of iteratively minimizing (2) along the k-th coordinate (filter), while keeping the remaining K − 1 coordinates (filters) fixed, yielding the following strategy for updating the filters in the frequency domain:   P (k) (i) (k) (i) (k) H̄N XN − i6=k Ŵ(i) HN H̄N + λDN D̄N (3) Ŵ(k) = (k) (k) (k) (k) HN H̄N + λDN D̄N PN (k) (k) where the bold fraction sign ( ·· ) denotes the Hadamard (entry-wise) division and HN = n=1 Hn , PN PN (k) (k) XN = n=1 Xn and DN = n=1 Dn . The main advantages of the derived filter update strategy (3) are: single tunable optimization parameter λ, fast and guaranteed convergence of Ŵ(k) ; possibilities for parallelization offered by the frequency-domain transformation of LRCAE . It is (k) (k) important to note that the incremental data acquisition involved in HN , XN and DN can also be computed in parallel. Once the decoding filters are learned in the frequency domain, they are transformed back to the spatial domain using the inverse DFT: ŵ(k) = F −1 {Ŵ(k) } At inference stage, we use the transpose of the learned decoding filters ŵ PC maps as follows: ĥ(k) , g( c=1 ŵ(k)T ∗ x(c) ). 3 (4) (k) for computing k feature Numerical Experiments As a sanity check for the overall computational efficiency of our proposed learning strategy, we’ve implemented the CD-based frequency-domain RCAE minimization in MATLAB R2014a. We’ve used the built-in fast Fourier transform (FFT) for transforming the RCAE objective into the frequency domain. The hyperbolic tangent was used as activation function. The encoding filters and biases were randomly fixed by sampling their entries independently from a zero-mean normal distribution with standard deviations 0.1 and 0.01 respectively. For learning the decoding filters, we’ve implemented a fairly naive version of frequency-domain CD (3) by initializing each complex-valued filter as Ŵ(k) = 0 + i0 and only performing a single CD cycle trough the filter coordinates k ∈ [1, K]. For all the experiments, we used of the Caltech-256 Object Category dataset [6] and whitened the images. 3 60 40 20 0 0 0.5 1 1.5 Image size (pixels) 2 20 CPU−time (ms) 150 CPU−time (ms) CPU−time (ms) 80 100 50 2.5 5 x 10 0 0 20 40 60 #Filters 80 100 15 10 5 0 10 20 30 Filter size (pixels) 40 Figure 1: Time-complexity of CD-based RCAE minimization on Caltech-256 dataset. Left: CPU-time (in milliseconds) in function of image size (in pixels). Middle: CPU-time (in milliseconds) in function of number of filters. Right: CPU-time (in milliseconds) in function of filter size (in pixels). −3 −3 3 x 10 convergence rate reconstruction error 8 x 10 7 6 5 14 15 16 17 18 19 20 regularization parameter 21 2 1 0 0 22 200 400 600 800 #Training images 1000 Figure 2: Reconstruction error and convergence rate of CD-based RCAE minimization on Caltech256 dataset. Left: Reconstruction error in function of regularization parameter λ. Right: Convergence rate of the learned decoding filters in function of number of training images N . The convergence rate is computed using the average squared difference between consecutive filter updates. The original curve (blue) is noisy due to the average involved in the computation of the convergence rate. A smoothed curve (red) is therefore plotted on top, in order to highlight the general trend. Figure 3: Visualization of learned decoding filters and reconstruction result on Caltech-256 dataset (after training with 400 images). Left: Previously unseen 244 × 244 testing image. Middle: 300 learned decoding filters. Right: Reconstruction result on previously unseen 244 × 244 testing image (left) using 300 learned decoding filters (middle). As first experiment, we’ve measured the computational time-complexity in terms of CPU-time on an Intel® Core™ i7-2600 CPU @ 3.40 GHz machine. Figure (1) shows that our proposed method has a (worst-case) linear time-complexity w.r.t. image size, number of filters and filter size. Knowing that our naive implementation does not involve any particular form of parallelism, linear time is the best possible complexity we can achieve in situations where the algorithm has to read its entire input sequentially. In a second experiment, we study the influence of the regularization parameter λ on the reconstruction error and analyze the convergence rate of the learned decoding filters in function of the number training samples N . For robust estimation, the reconstruction error was averaged over a batch of 500 images that were not used during training. Figure (2), left, illustrates that the reconstruction error reaches a (global) minimum when the regularization parameter approaches λ = 16.5. Figure (2), right, illustrates that after roughly 400 training images, the learned decoding filters {ŵ(k) }K k=1 already settle. This clearly highlights the advantages of random convexification and frequency-domain minimization using CD. Figure (3) depicts the decoding filters and reconstruction result on a previously unseen testing image, obtained after CD-based minimization of the RCAE objective (2) using only 400 training images. 4 50 4 Conclusions We’ve proposed an efficient learning strategy for layer-wise unsupervised training of deep CNNs. The main contributions of our proposed learning strategy are random convexification and frequencydomain transformation of the reconstruction contractive auto-encoding (RCAE) objective, which yields a relatively easy-to-solve large-scale regularized linear least-squares problem. We’ve proposed to solve this problem using coordinate descent (CD), with as main advantages: (1) single tunable optimization parameter; (2) fast and guaranteed convergence; (3) possibilities for full parallelization. Numerical experiments show that, with a fairly naive implementation, our proposed learning strategy scales (in the worst case) linearly with image size, number of filters and filter size. We also observe that, using relatively few training images, the learned filters already settle and yield decent reconstruction results on unseen testing images. We believe that the inherently parallel nature of our proposed learning strategy offers very interesting possibilities for further increasing the computational efficiency using more sophisticated implementation strategies. Acknowledgments This work is supported by the Agency for Innovation by Science and Technology in Flanders (IWT) – PhD grant nr. 131814, the VUB Interdisciplinary Research Program through the EMO-App project and the National Natural Science Foundation of China (grant 61273265). References [1] Guillaume Alain and Yoshua Bengio. What regularized auto-encoders learn from the datagenerating distribution. The Journal of Machine Learning Research, 15(1):3563–3593, 2014. [2] Yoshua Bengio, Aaron Courville, and Pierre Vincent. Representation learning: A review and new perspectives. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 35(8):1798–1828, 2013. [3] P. P. Brahma, D. Wu, and Y. She. Why deep learning works: A manifold disentanglement perspective. IEEE Transactions on Neural Networks and Learning Systems, 27(10):1997–2008, Oct 2016. [4] Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11(Feb):625–660, 2010. [5] Gene H Golub and Charles F Van Loan. Matrix computations, volume 3. JHU Press, 2012. [6] Gregory Griffin, Alex Holub, and Pietro Perona. Caltech-256 object category dataset. 2007. [7] Irina Higgins, Loic Matthey, Xavier Glorot, Arka Pal, Benigno Uria, Charles Blundell, Shakir Mohamed, and Alexander Lerchner. Early visual concept learning with unsupervised deep learning. arXiv preprint arXiv:1606.05579, 2016. [8] Guang-Bin Huang. What are extreme learning machines? filling the gap between frank rosenblatts dream and john von neumanns puzzle. Cognitive Computation, 7(3):263–278, 2015. [9] David W Kammler. A first course in Fourier analysis. Cambridge University Press, 2007. [10] Griffin Lacey, Graham W Taylor, and Shawki Areibi. Deep learning on fpgas: Past, present, and future. arXiv preprint arXiv:1602.04283, 2016. [11] Xia Liu, Shaobo Lin, Jian Fang, and Zongben Xu. Is extreme learning machine feasible? a theoretical assessment (part i). Neural Networks and Learning Systems, IEEE Transactions on, 26(1):7–20, 2015. [12] Yu Nesterov. Efficiency of coordinate descent methods on huge-scale optimization problems. SIAM Journal on Optimization, 22(2):341–362, 2012. [13] Jiquan Ngiam, Adam Coates, Ahbik Lahiri, Bobby Prochnow, Quoc V Le, and Andrew Y Ng. On optimization methods for deep learning. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 265–272, 2011. [14] Tom Le Paine, Pooya Khorrami, Wei Han, and Thomas S Huang. An analysis of unsupervised pre-training in light of recent advances. arXiv preprint arXiv:1412.6597, 2014. 5 [15] Ali Rahimi and Benjamin Recht. Weighted sums of random kitchen sinks: Replacing minimization with randomization in learning. In Advances in neural information processing systems, pages 1313–1320, 2009. [16] Rajat Raina, Anand Madhavan, and Andrew Y Ng. Large-scale deep unsupervised learning using graphics processors. In Proceedings of the 26th annual international conference on machine learning, pages 873–880. ACM, 2009. [17] Stephen J Wright. Coordinate descent algorithms. Mathematical Programming, 151(1):3–34, 2015. [18] Ren Wu, Shengen Yan, Yi Shan, Qingqing Dang, and Gang Sun. Deep image: Scaling up image recognition. 6
9cs.NE
Irrelevant Vertices for the Planar Disjoint Paths Problema Isolde Adlerb Stavros G. Kolliopouloscd arXiv:1310.2378v4 [math.CO] 20 Jun 2016 Daniel Lokshtanovf g Saket Saurabhh f g Philipp Klaus Krauseb e Dimitrios M. Thilikosi j d Abstract The Disjoint Paths Problem asks, given a graph G and a set of pairs of terminals (s1 , t1 ), . . . , (sk , tk ), whether there is a collection of k pairwise vertex-disjoint paths linking si and ti , for i = 1, . . . , k. In their f (k) · n3 algorithm for this problem, Robertson and Seymour introduced the irrelevant vertex technique according to which in every instance of treewidth greater than g(k) there is an “irrelevant” vertex whose removal creates an equivalent instance of the problem. This fact is based on the celebrated Unique Linkage Theorem, whose – very technical – proof gives a function g(k) that is responsible for an immense parameter dependence in the running time of the algorithm. In this paper we give a new and self-contained proof of this result that strongly exploits the combinatorial properties of planar graphs and achieves g(k) = O(k 3/2 · 2k ). Our bound is radically better than the bounds known for general graphs. Keywords: Graph Minors, Treewidth, Disjoint Paths Problem a Emails: Isolde Adler: [email protected], Stavros Kolliopoulos: [email protected], Philipp Klaus Krause: [email protected], Daniel Lokshtanov: [email protected], Saket Saurabh: [email protected], Dimitrios M. Thilikos: [email protected] . b School of Computing. University of Leeds, UK. c Department of Informatics and Telecommunications, National and Kapodistrian University of Athens, Athens, Greece. d Co-financed by the European Union (European Social Fund – ESF) and Greek national funds through the Operational Program “Education and Lifelong Learning” of the National Strategic Reference Framework (NSRF) - Research Funding Program: “Thalis. Investing in knowledge society through the European Social Fund”. e Supported by a fellowship within the FIT-Programme of the German Academic Exchange Service (DAAD) at NII, Tokyo and by DFG-Projekt GalA, grant number AD 411/1-1. f Department of Informatics, University of Bergen, Norway. g Supported by “Rigorous Theory of Preprocessing, ERC Advanced Investigator Grant 267959” and “Parameterized Approximation, ERC Starting Grant 306992”. h The Institute of Mathematical Sciences, CIT Campus, Chennai, India. i Department of Mathematics, National and Kapodistrian University of Athens, Athens, Greece. j AlGCo project-team, CNRS, LIRMM, France. 1 1 Introduction One of the most studied problems in graph theory is the Disjoint Paths Problem (DPP): Given a graph G and a set P of k pairs of terminals, (s1 , t1 ), . . . , (sk , tk ), decide whether G contains k vertex-disjoint paths P1 , . . . , Pk where Pi has endpoints si and ti , i = 1, . . . , k. In addition to its numerous applications in areas such as network routing and VLSI layout, this problem has been the catalyst for extensive research in algorithms and combinatorics [27]. DPP is NP-complete, along with its edge-disjoint or directed variants, even when the input graph is planar [16–18, 28]. The celebrated algorithm of Roberson and Seymour solves it however in f (k) · n3 steps, where f is some computable function [22]. This implies that, when we parameterize DPP by the number k of pairs of terminals, the problem is fixed-parameter tractable. The Robertson-Seymour algorithm is the central algorithmic result of the Graph Minors series of papers, one of the deepest and most influential bodies of work in graph theory. The basis of the algorithm in [22] is the so-called irrelevant-vertex technique which can be summarized very roughly as follows. As long as the input graph G violates certain structural conditions, it is possible to find a vertex v that is solution-irrelevant: every collection of paths certifying a solution to the problem can be rerouted to an equivalent one, that links the same pairs of terminals, but in which the new paths avoid v. One then iteratively removes such irrelevant vertices until the structural conditions are met. By that point the graph has been simplified enough so that the problem can be attacked via dynamic programming. The following two structural conditions are used by the algorithm in [22]: (i) G excludes a clique, whose size depends on k, as a minor and (ii) G has treewidth bounded by some function of k. When it comes to enforcing Condition (ii), the aim is to prove that in graphs without big clique-minors and with treewidth at least g(k) there is always a solution-irrelevant vertex. This is the most complicated part of the proof and it was postponed until the later papers in the series [23, 24]. The bad news is that the complicated proofs also imply an immense parametric dependence, as expressed by the function f, of the running time on the parameter k. This puts the algorithm outside the realm of feasibility even for elementary values of k. The ideas above were powerful enough to be applicable also to problems outside the context of the Graph Minors series. During the last decade, they have been applied to many other combinatorial problems and now they constitute a basic paradigm in parameterized algorithm design (see, e.g., [6, 7, 9, 12, 13, 15]). However, in most applications, the need for overcoming the high parameter dependence emerging from the structural theorems of the Graph Minors series, especially those in [23, 24], remains imperative. Hence two natural directions of research are: simplify parts of the original proof for the general case or focus on specific graph classes that may admit proofs with better parameter dependence. An important step in the first direction was taken recently by Kawarabayashi and Wollan in [14] who gave an easier and shorter proof of the results 2 in [23, 24]. While the parameter dependence of the new proof is certainly much better than the previous, immense, function, it is still huge: a rough estimation from [14] gives 2Ω(k) a lower bound for g(k) of magnitude 22 which in turn implies a lower bound for f (k) Ω(k) 22 of magnitude 22 . In this paper we offer a solid advance in the second direction, focusing on planar graphs (see also [20,26] for previous results on planar graphs). We show that, for planar graphs, g(k) is single exponential. In particular we prove the following result. Theorem 1. Every instance of DPP consisting of a planar graph G with treewidth at least 82 · k 3/2 · 2k and k pairs of terminals contains a vertex v such that every solution to DPP can be replaced by an equivalent one whose paths avoid v. The proof of Theorem 1 is presented in Section 3 and deviates significantly from those in [14, 23, 24]. It is self-contained and exploits extensively the combinatorics of planar graphs. Given a DPP instance defined on a planar graph G, we prove that if G contains as a subgraph a subdivision of a sufficiently large (exponential in k) grid, whose “perimeter” does not enclose any terminal, then the “central” vertex v of the grid is solution-irrelevant for this instance. It follows that the “area” provided by the grid is big enough so that every solution that uses v can be rerouted to an equivalent one that does not go so deep in the grid and therefore avoids the vertex v. Combining Theorem 1 with known algorithmic results, it is possible to reduce, in O(k) 22 ·n2 steps, a planar instance of DPP to an equivalent one whose graph has treewidth 2O(k) . Then, using standard dynamic programming on tree decompositions, a solution, if O(k) one exists, can be found in 22 · n steps. The parametric dependence of this algorithm is a step forward in the study of the parameterized complexity of DPP on planar graphs. This algorithm is abstracted in the following theorem, whose proof is in Section 4. Theorem 2. There exists an algorithm that, given an instance (G, P) of DPP, where G is a planar n-vertex graph and |P| = k, either reports that (G, P) is a NO-instance O(k) or outputs a solution of DPP for (G, P). This algorithm runs in 22 · n2 steps. An extended abstract of this work, without any proofs, appeared in [2]. Some of our ideas have proved useful in the recent breakthrough result of Cygan et al. that establishes fixed-parameter tractability for k-disjoint paths on planar directed graphs [5]. 2 Basic definitions Throughout this paper, given a collection of sets C we denote by ∪ C the set ∪x∈C x, i.e., the union of all sets in C. All graphs that we consider are finite, undirected, and simple. We denote the vertex set of a graph G by V (G) and the edge set by E(G). Every edge is a two-element subset of V (G). A graph H is a subgraph of a graph G, denoted by H ⊆ G, if V (H) ⊆ V (G) and 3 E(H) ⊆ E(G). Given two graphs G and H, we define G ∩ H = (V (G) ∩ V (H), E(G) ∩ V (H)) and G ∪ H = (V (G) ∪ V (H), E(G) ∪ V (H)). Given a S ⊆ V (G), we also denote by G[S] the subgraph of G induced by S. A path in a graph G is a connected acyclic subgraph with at least one vertex whose vertices have degree at most 2. The length of a path P is equal to the number of its edges. The endpoints of a path P are its vertices of degree 1 (in the trivial case where there is only one endpoint x, we say that the endpoints of P are x and x). An (x, y)-path of G is any path of G whose endpoints are x and y. A cycle of a graph G is a connected subgraph of G whose vertices have degree 2. For graphs G and H the cartesian product is the graph whose vertex set is V (G) × V (H) and whose edge set is {{(v, v 0 ), (w, w0 )} | ({v, w} ∈ E(G) ∧ v 0 = w0 ) ∨ (v = w ∧ {v 0 , w0 } ∈ E(H))}. The Disjoint Paths problem. following. The problem that we examine in this paper is the Disjoint Paths (DPP) Input: A graph G, and a collection P = {(si , ti ) ∈ V (G)2 , i ∈ {1, . . . , k}} of pairs of 2k terminals of G. Question: Are there k pairwise vertex-disjoint paths P1 , . . . , Pk in G such that for i ∈ {1, . . . , k}, Pi has endpoints si and ti ? We call the k-pairwise vertex-disjoint paths certifying a YES-instance of DPP a solution of DPP for the input (G, P). Given an instance (G, P) of DPP, we say that a nonterminal vertex v ∈ V (G) is irrelevant for (G, P), if (G, P) is a YES-instance if and only if (G \ v, P) is a YES-instance. We denote by PDPP the restriction of DPP on instances (G, P) where G is a planar graph. Minors. A graph H is a minor of a graph G, if there is a function φ : V (H) → 2V (G) , such that i. For every two distinct vertices x and y of H, G[φ(x)] and G[φ(y)] are two vertexdisjoint connected subgraphs of G and ii. for every two adjacent vertex x and y of H, G[φ(x) ∪ φ(y)] is a connected subgraph of G. We call the function φ minor model of H in G. Grids. Let m, n ≥ 1. The (m × n)-grid is the Cartesian product of a path of length m − 1 and a path of length n − 1. In the case of a square grid where m = n, we say that n is the size of the grid. Given that n, m ≥ 2, the corners of an (m × n)-grid are 4 its vertices of degree 2. When we refer to a (m × n)-grid we will always assume an orthogonal orientation of it that classifies its corners to the upper left, upper right, down right, and down left corner of it. Given that Γ is an (m × n)-grid, we say that a vertex of G is one of its centers if its distance from the set of its corners is the maximum possible. Observe that a square grid of even size has exactly 4 centers. We also consider an (m × n)-grid embedded in the plane so that, if it has more than 2 faces then the infinite one is incident to more than 4 vertices. The outer cycle of an embedding of an (m × n)-grid is the one that is the boundary of its infinite face. We also refer to the horizontal and the vertical lines of an (m × n)-grid as its paths between vertices of degree smaller than 4 that are traversing it either “horizontally” or “vertically” respectively. We make the convention that an (m × n)-grid contains m vertical lines and n horizontal lines. The lower horizontal line and the higher horizontal line of Γ are defined in the obvious way (see Figure 1 for an example). Figure 1: A drawing of the (6 × 6)-grid. The four white round vertices are its corners and the four grey square vertices are its centers. The cycle formed by the “fat” edges is the outer cycle. Plane graphs Whenever we refer to a planar graph G we consider an embedding of G in the plane Σ = R2 . To simplify notation, we do not distinguish between a vertex of G and the point of Σ used in the drawing to represent the vertex or between an edge 5 and the arc representing it. We also consider a plane graph G as the union of the points corresponding to its vertices and edges. That way, edges and faces are considered to be open sets of Σ. Moreover, a subgraph H of G can be seen as a graph H, where the points corresponding to H are a subset of the points corresponding to G. Recall that ∆ ⊆ Σ is an open (resp. closed) disc if it is homeomorphic to {(x, y) : x2 + y 2 < 1} (resp. {(x, y) : x2 + y 2 ≤ 1}). Given a cycle C of G we define its openinterior (resp. open-exterior) as the connected component of Σ \ C that is disjoint from (resp. contains) the infinite face of G. The closed-interior (resp. closed-exterior) of C is the closure of its open-interior (resp. open-exterior). Given a set A ⊆ Σ, we denote its interior (resp. closure) by int(A) (resp. clos(A)). An open (resp. closed) arc I in R2 is any set homeomorphic to the set {(x, 0) | x ∈ (0, 1)} (resp. {(x, 0) | x ∈ [0, 1]}) and the endpoints of I are defined in the obvious way. We also define trim(I) as the set of all points of the arc I except for its endpoints. Outerplanar graphs. An outerplanar graph is a plane graph whose vertices are all incident to the infinite face. If an edge of an outerplanar graph is incident to its infinite face then we call it external, otherwise we call it internal. The weak dual of an outerplanar graph G is the graph obtained from the dual of G after removing the vertex corresponding to the infinite face of the embedding. Notice that if the outerplanar graph G is biconnected, then its weak dual is a tree. We call a face of an outerplanar graph simplicial if it corresponds to a leaf of the graph’s weak dual. Treewidth. A tree decomposition of a graph G is a pair (T, χ), consisting of a rooted tree T and a mapping χ : V (T ) → 2V (G) , such that for each v ∈ V (G) there exists t ∈ V (T ) with v ∈ χ(t), for each edge e ∈ E(G) there exists a node t ∈ V (T ) with e ⊆ χ(t), and for each v ∈ V (G) the set {t ∈ V (T ) | v ∈ χ(t)} is connected in T.  The width of (T, χ) is defined as w(T, χ) := max |χ(t)| − 1 t ∈ V (T ) . The tree-width of G is defined as  tw(G) := min w(T, χ) (T, χ) is a tree decomposition of G . We need the next proposition that follows directly by combining the main result of [10] and (5.1) from [21]. Proposition 1. If G is a planar graph and tw(G) ≥ 4.5 · k + 1, then G contains a (k × k)-grid as a mimor. Our algorithmic results require the following proposition. It follows from the main result of [19] (see also Algorithm (3.3) in [22]). The parametric dependence of k in the running time follows because the algorithm in [19] uses as a subroutine the algorithm O(1) in [4] that runs in 2k · n steps. 6 Proposition 2. There exists an algorithm that, given an n-vertex graph G and a positive integer k, either outputs a tree decomposition of G of width at most k or outputs a subgraph G0 of G with treewidth greater than k and a tree decomposition of G0 of width O(1) at most 2k, in 2k · n steps. 3 Irrelevant vertices in graphs of large treewidth In this section we prove our main result, namely Theorem 1. We introduce the notion of cheap linkages and explore their structural properties in Subsections 3.1 and 3.4. In Subsection 3.7 we bring together the structural results to show the existence of an irrelevant vertex in a graph of large treewidth. 3.1 Configurations and cheap linkages In this subsection we introduce some basic definitions on planar graphs that are necessary for our proof. Tight concentric cycles. Let G be a plane graph and let D be a disk that is the closed interior of some cycle C of G. We say that D is internally chordless if there is no path in G whose endpoints are vertices of C and whose edges belong to the open interior of C. Let C = {C0 , . . . , Cr }, be a sequence of cycles in G. We denote by Di the closedinterior of Ci , i ∈ {0, . . . , r}, and we say that D = {D0 , . . . , Dr } is the disc sequence of C. We call C concentric, if for all i ∈ {0, . . . , r − 1}, the cycle Ci is contained in the open-interior of Di+1 . The sequence C of concentric cycles is tight in G, if, in addition, • D0 is internally chordless. • For every i ∈ {0, . . . , r − 1}, there is no cycle of G that is contained in Di+1 \ Di and whose closed-interior D has the property Di ( D ( Di+1 . Lemma 1. There exists an algorithm that given a positive integer r, an n-vertex plane graph G, and pa T ⊆ V (G), either outputs a tree decomposition of G of width at most 9 · (r + 1) · d |T | + 1 e) or an internally chordless cycle C of G such that there exists a tight sequence of cycles C0 , . . . , Cr in G where • C0 = C and • all vertices of T are in the open exterior of Cr . √ O(1) · n steps. Moreover, this algorithm runs in 2(r· |T |) 7 Figure 2: An example of a plane graph G and a tight sequence of 3 concentric cycles in it. Notice that the addition to G of any of the dashed edges makes this collection of cycles non-tight. √ Proof. Let x = |T |+1 and y = 2(r +1)·d x e. From Proposition 1, if tw(G) ≥ 4.5·y +1, then G contains as a minor a (y × y)-grid Γ. We now observe that the grid Γ contains as subgraphs x pairwise disjoint (2(r + 1) × 2(r + 1))-grids Γ1 , . . . , Γx . Note that each Γi , i ∈ {1, . . . , x} contains a sequence of r +1 concentric cycles that, given a minor model φ of Γ in G, can be used to construct, in linear time, a sequence of r + 1 concentric cycles Ci = {C0i , C1i , . . . , Cri } in G such that for every i, j ∈ {1, . . . , x}, where i 6= j, all cycles in Cj are in the open exterior of Cri . Note that at least one, say Cri , of the cycles in {Cr1 , . . . , Crx } should contain all the vertices of T in its open exterior. Let e be any edge of C0i . Let also f be the face of G that is contained in the open interior of C0i and is incident to e. Let Jf be the graph consisting of the vertices and the edges that are incident to f . It is easy to verify that, Jf contains an internally chordless cycle C that contains the edge e. Given C0i , the cycle C can be found in linear time. Notice now that G contains a tight sequence of cycles C0 , C1 , . . . , Cr such that C0 = C and where, for h ∈ {0, . . . , r}, Ch is in the closed interior of Chi . The result follows as the open exterior of Cr contains the open exterior of Cri and therefore contains all vertices in T . The algorithm runs as follows: it first uses the algorithm of Proposition 2 for k = 4.5 · y. If the algorithm outputs a tree decomposition of G of width at most k, then we are done. Otherwise it outputs a subgraph G0 of G where tw(G0 ) > k and a tree decomposition of G0 of width ≤ 2k. We use this tree decomposition in order √ to find a O(1) (r· |T |)O(1) 0 k minor model φ of the (y × y)-grid Γ in G . This can be done in 2 =2 ·n steps using the algorithm in [1] (or, alternatively, the algorithm in [11]). Clearly, φ is also 8 a minor model of Γ in G. We may now use φ, as explained above, in order to identify, in linear time, the required internally chordless cycle C in G. Linkages. A linkage in a graph G is a non-empty subgraph L of G whose connected components are all paths. The paths of a linkage are its connected components and we denote them by P(L). The terminals of a linkage L are the endpoints of the paths in  P(L), and the pattern of L is the set {s, t} | P(L) contains a path from s to t in G . Two linkages are equivalent if they have the same pattern. Segments. Let G be a plane graph and let C be a cycle in G whose closed-interior is D. Given a path P in G we say that a subpath P0 of P is a D-segment of P , if P0 is a non-empty (possibly edgeless) path obtained by intersecting P with D. For a linkage L of G we say that a path P0 is a D-segment of L, if P0 is a D-segment of some path P in P(L). Figure 3: An example of a CL-configuration Q = (C, L) where C contains 5 cycles and L has 7 paths. Q has 13 segments. Linkage paths A, B, C, D, E, F , and G, contain 2, 2, 2, 1, 1, 2, 3 of these segments respectively. Also the eccentricities of the segments of A, are 0 and 2, of B are 3 and 4. Notice that one of the two segments of A has two 3-chords, each having 2 semi 3-chords. 9 CL-configurations. Given a plane graph G, we say that a pair Q = (C, L) is a CLconfiguration of G of depth r if C = {C0 , . . . , Cr } is a sequence of concentric cycles in G, L is a linkage of G, and Dr does not contain any terminals of L. A segment of Q is any Dr -segment of L. The eccentricity of a segment P of Q is the minimum i such that V (Ci ∩ P ) 6= ∅. A segment of Q is extremal if it is has eccentricity r. Observe that if C is tight then any extremal segment is a subpath of Cr . Given a cycle Ci ∈ C and a segment P of Q we define the i-chords of P as the connected components of P ∩ int(Di ) (notice that i-chords are open arcs). For every i-chord X of P , we define the i-semichords of P as the connected components of the set X \ Di−1 (notice that i-semichords are open arcs). Given a segment P that does not have any 0-chord, we define its zone as the connected component of Dr \ P that does not contain the open-interior of D0 (a zone is an open set). Figure 4: An example of a CL-configuration (C, L) where the linkage L is C-cheap. Only the 5 concentric cycles of C and a cropped part of the linkage L are depicted. Notice that the collection of concentric cycles C is not tight. A CL-configuration Q = (C, L) is called reduced if the graph L ∩ ∪ C is edgeless. Let Q = (C, L) be a CL-configuration of G and let E • be the set of all edges of the graph L ∩ ∪ C. We then define G∗ as the graph obtained if we contract in G all edges in E • . We also define Q∗ as the pair (C ∗ , L∗ ) obtained if in L and in the cycles of C we contract all edges of E • . Notice that Q∗ is a reduced CL-configuration of G∗ . We call (Q∗ , G∗ ) the reduced pair of G and Q. 10 Cheap linkages. Let G be a plane graph and Q = (C, L) be a CL-configuration of G of depth r. We define the function c : {L | L is a linkage of G} → N so that [ c(L) = |E(L) \ E(Ci )|. i∈{0,...,r} A linkage L of G is C-cheap, if there is no other CL-configuration Q0 = (C, L0 ) such that L0 has the same pattern as L and c(L) > c(L0 ). Intuitively, the function c defined above penalizes every edge of the linkage that does not lie on some cycle Ci . Observation 1. Let Q = (C, L) be a CL-configuration and let (G∗ , Q∗ = (C ∗ , L∗ )) be the reduced pair of G and Q. Then • If L is C-cheap, then L∗ is C ∗ -cheap. • If C is tight in G, then C ∗ is tight in G∗ . Figure 5: An example of a convex CL-configuration (C, L). In the picture, only the 5 cycles in C and a cropped portion of L is depicted. 3.2 Convex configurations We introduce CL-configurations with particular characteristics that will be useful for the subsequent proofs. We then show that these characteristics are implied by tightness and cheapness. Convex CL-configurations. A segment P of Q is convex if the following three conditions are satisfied: (i) it has no 0-chord and 11 (ii) for every i ∈ {1, . . . , r}, the following hold: a. P has at most one i-chord b. if P has an i-chord, then P ∩ Ci−1 6= ∅. c. Each i-chord of P has exactly two i-semichords. (iii) If P has eccentricity i < r, there is another segment inside the zone of P with eccentricity i + 1. We say Q is convex if all its segments are convex. Observation 2. Let Q = (C, L) be a CL-configuration and let (G∗ , Q∗ = (C ∗ , L∗ )) be the reduced pair of G and Q. Then Q is convex if and only Q∗ is convex. Figure 6: A visualization of the conditions of Lemma 2. The proof of the following lemma uses elementary topological arguments. Lemma 2. Let ∆1 , ∆2 be closed disks of R2 where int(∆1 ) ∩ int(∆2 ) = ∅ and such that ∆1 ∪ ∆2 is also a closed disk. Let ∆3 = R2 \ int(∆1 ∪ ∆2 ) and let Y = bnd(∆3 ) ∩ ∆2 and Q = trim(∆1 ∩ ∆2 ). Let P be a closed arc of R2 whose endpoints are not in ∆1 ∪ ∆2 and such that Y ∩ P = ∅ and Q ∩ P 6= ∅. Then int(∆1 ) ∩ P has at least two connected components. Proof. Let q be some point in Q ∩ P . Let Q0 be an open arc that is a subset of int(∆1 ) and has the same endpoints as Y . Notice that q and x belong to different open disks defined by the cycle Q0 ∪ Y . Therefore P should intersect Q0 or Y . As Y ∩ P = ∅, P intersects Q0 . As Q0 ⊆ int(∆1 ), int(∆1 ) ∩ P has at least one connected component. Assume now that int(∆1 ) ∩ P has exactly one connected component. Clearly, this connected component will be an open arc I such that at least one of the endpoints of I, say q, belongs to Q. Moreover, there is a subset P 0 of P that is a closed arc where P 0 ∩ I = ∅ and whose endpoints are q and one of x and y, say y. As int(∆1 ) ∩ P has 12 exactly one connected component, it holds that P 0 ∩ int(∆1 ) = ∅. Let Q0 be an open arc that is a subset of int(∆1 ) and has the same endpoints as Y . Notice that q and y belong to different open disks defined by the cycle Q0 ∪ Y . Therefore P 0 should intersect int(∆1 ) or Y , a contradiction as P 0 ⊆ P and Y ∩ P = ∅. Lemma 3. Let G be a plane graph and Q = (C, L) be a CL-configuration of G where C is tight in G and L is C-cheap. Then Q is convex. Proof. By Observations 1 and 2, we may assume that Q is reduced. Consider any segment of Q. We show that it satisfies the three conditions of convexity. Conditions (i) and (ii).b follow directly from the tightness of C. Condition (iii) follows from the fact that L is C-cheap. In the rest of the proof we show Conditions (ii).a. and (ii).c. For this, we consider the minimum i ∈ {0, . . . , r} such that one of these two conditions is violated. From Condition (i), i ≥ 1. Let W be a segment of Q containing an i-chord X for which one of Conditions (ii).a, (ii).c is violated. We now define the set Q according to which of the two conditions is violated. We distinguish two cases: Case 1. Condition (ii).c is violated. From Condition (ii).b, X \ Di−1 contains more than two i-semichords of X. Let J1 be the biconnected outerplanar graph defined by the union of Ci−1 and the i-semichords of X that do not have an endpoint on Ci . As there are at least three i-semichords in X, J1 has at least one internal edge and therefore at least two simplicial faces. Moreover there are exactly two i-semichords of X, say K1 , K2 , that have an endpoint in Ci and K1 and K2 belong to the same, say F 0 , face of J1 . Let ∆2 be the closure of a simplicial face of J1 that is not F 0 . Case 2. Condition (ii).c holds while Condition (ii).a is violated. Let J2 be the biconnected outerplanar graph defined by the union of Ci−1 and the connected components of W \ Di−1 that do not contain endpoints of W in their boundary. Notice that the rest of the connected components of W \ Di−1 are exactly two, say K1 and K2 . Notice that K1 and K2 are subsets of the same face, say F 0 , of J2 . As there are at least two i-chords in W , J2 contains at least one internal edge and therefore at least two simplicial faces. Let ∆2 be the closure of a simplicial face of J2 that is not F 0 . In both of the above cases, we set ∆1 = Di−1 , ∆3 = R2 \ int(∆1 ∪ ∆2 ), Y = bnd(∆3 ) ∩ ∆2 , and Q = trim(∆1 ∩ ∆2 ). Notice that Y = bnd(∆2 ) \ Q, therefore Y ⊆ W. We claim that L ∩ Q 6= ∅. Suppose not. We consider W 0 as the path in W ∪ Q that contains Q as a subset and has the same endpoints as W . Then, L0 = (L \ W ) ∪ W 0 is a linkage, equivalent to L, where c(L0 ) < c(L), a contradiction to the fact that L is C-cheap. We just proved that L∩Q 6= ∅ which in turn implies that L contains a segment P for which P ∩ Q 6= ∅. We distinguish two cases: Case A. W 6= P . This implies that W ∩ P = ∅. As Y ⊆ W , it follows that Y ∩ P = ∅. Therefore, by Lemma 2, int(∆1 )∩P has at least two connected components, therefore P 13 Figure 7: The two cases of the proof of Lemma 3. In the left part is depicted an i-chord X that has 6 i-semichords and in the right part is depicted a segment W and the way it crosses the cycles Di and Di−1 . In the figure on the right the segment W has 7 i-chords and 14 i-semichords. has at least two (i − 1)-chords. If i > 1, then Condition (ii).a is violated for i − 1, which contradicts the choice of i. If i = 1, then P has at least one 0-chord, which violates Condition (i), that, as explained at the beginning of the proof, holds for every segment of Q. Case B. W = P . Recall that Y ⊆ W therefore Y ⊆ P . Let p1 and p2 be the endpoints of Q. As Q is reduced there exists two disjoint closed arcs Z1 and Z2 with endpoints p1 , p01 and p2 , p02 respectively, such that • pi is an endpoint of Zi , i ∈ {1, 2}. • Zi ⊆ clos(Q), i ∈ {1, 2}, and • P ∩ Zi = {pi }, i ∈ {1, 2}. Consider also a closed arc Y 0 that is a subset of int(∆2 ) ∪ {p01 , p02 } that does not intersect L and whose endpoints are p01 and p02 . Let now ∆01 = ∆1 , let ∆02 be the closed disk defined by the cycle clos(Q \ (Z1 ∪ Z2 )) ∪ Y 0 that is a subset of ∆2 . Let also ∆03 = R2 \ int(∆01 ∪ ∆02 ) and Q0 = trim(∆01 ∩ ∆02 ). As Y 0 does not intersect L, we obtain Y 0 ∩ P = ∅. Observe that Z1 , Q0 , Z2 form a partition of Q. As Q ∩ P 6= ∅ and (Zi \ {pi }) ∩ P = ∅, i ∈ {1, 2}, we conclude that Q0 ∩ P 6= ∅. By applying Lemma 2, int(∆01 )∩P has at least two connected components. Therefore P has at least two (i − 1)-chords. This yields a contradiction, as in Case A. 14 3.3 Bounding the number of extremal segments In this subsection we prove that the number of extremal segments is bounded by a linear function of the number of linkage paths. Out-segments, hairs, and flying hairs. Let G be a plane graph and Q = (C, L) be a CL-configuration of G of depth r. An out-segment of L is a subpath P 0 of a path in P(L) such that the endpoints of P 0 are in Cr and the internal vertices of P 0 are not in Dr . A hair of L is a subpath P 0 of a path in P(L) such that one endpoint of P 0 is in Cr , the other is a terminal of L, and the internal vertices of P 0 are not in Dr . A flying hair of L is a path in P(L) that does not intersect Cr . Given a linkage L of G and a closed disk D of R2 whose boundary is a cycle of G, we define outD (L) to be the graph obtained from the graph (L ∪ bnd(D)) \ int(D) after dissolving all vertices of degree 2. For example outDr (L) is a plane graph consisting of the out-segments, the hairs, the flying hairs of L, and what results from Cr after dissolving its vertices of degree 2 that do not belong in L. Let f be a face of outDr (L) that is different from int(Dr ). We say that f is a cave of outDr (L) if the union of the out-segments and extremal segments in the boundary of f is a connected set. Recall that a segment of Q is extremal if it is has eccentricity r, i.e., it is a subpath of Cr . Given a plane graph G, we say that two edges e1 and e1 are cyclically adjacent if they have a common endpoint x and appear consecutively in the cyclic ordering of the edges incident to x, as defined by the embedding of G. A subset E of E(G) is cyclically connected if for every two edges e and e0 in E there exists a sequence of edges e1 , . . . , er ∈ E where e1 = e, er = e0 and for each i ∈ {1, . . . , r − 1} ei and ei+1 are cyclically adjacent. Let Q = (C, L) be a CL-configuration. We say that Q is touch-free if for every path P of L, the number of the connected components of P ∩ Cr is not 1. Lemma 4. Let G be a plane graph and Q = (C, L) be a touch-free CL-configuration of G where C is tight in G and L is C-cheap. The number of extremal segments of Q is at most 2 · |P(L)| − 2. Proof. Let (G∗ , Q∗ = (C ∗ , L∗ )) be the reduced pair of G and Q. Notice that, by Observation 1, C ∗ is tight in G and L∗ is C ∗ -cheap. Moreover, it is easy to see that Q∗ is touch-free and Q and Q∗ have the same number of extremal segments which are all trivial paths (i.e., paths consisting of only one vertex). Therefore, it is sufficient to prove that the lemma holds for Q∗ . Let ρ be the number of extremal segments of Q∗ . Let J = outDr∗ (L∗ ) and k = |P(L∗ )|. Notice that the number of extremal segments of Q∗ is equal to the number of vertices of degree 4 in J. The terminals of L∗ are partitioned in three families • flying terminals, T0 : endpoints of flying hairs. 15 • invading terminals T1 : these are endpoints of hairs whose non terminal endpoint has degree 3 in J. • bouncing terminals T2 : these are endpoints of hairs whose non terminal endpoint has degree 4 in J. A hair containing an invading and bouncing terminal is called invading and bouncing hair respectively. Recall that |T0 | + |T1 | + |T2 | = 2k. Claim 1. The number of caves of J is at most the number of invading terminals. Proof of claim 1. Clearly, a hair cannot be in the common boundary of two caves. Therefore it is enough to prove that the set obtained by the union of a cave f and its boundary contains at least one invading hair. Suppose this is not true. Consider the open arc R obtained if we remove from bnd(f ) all the points that belong to outsegments. Clearly, R results from a subpath R+ of Cr∗ after removing its endpoints, i.e., R = trim(R+ ). Notice that because f is a cave, R is a non-empty connected subset of Cr∗ . Moreover, R ∩ L∗ is non-empty, otherwise L∗0 = (L∗ \ (bnd(f )) ∪ R is also a linkage with the same pattern as L∗ where c(L∗0 ) < c(L∗ ), a contradiction to the fact that L∗ is C ∗ -cheap. Let Y be a connected component of R ∩ L∗ . As Q∗ is reduced, Y consists of a single vertex y in the open set R. Notice that Y is a subpath of a segment Y 0 of Q∗ . We claim that Y 0 is not extremal. Suppose to the contrary that Y 0 is extremal. Then Y 0 = Y and there should be two distinct out-segments that have y as a common endpoint. This contradicts the fact that y ∈ R. By Lemma 3, Q∗ is convex, therefore one of the endpoints of the non-extremal segment Y 0 is y and thus is in R as well. This means that y is the endpoint of one out-segment which again contradicts the fact that y ∈ R. This completes the proof of Claim 1. Let J − be the graph obtained from J by removing all hairs and notice that J − is a biconnected outerplanar graph. Let S be the set of vertices of J − that have degree 4. Notice that, because Q∗ is touch-free, |S| is equal to the number of vertices of J that have degree 4 minus the number of bouncing terminals. Therefore, ρ = |T2 | + |S|. (1) Notice that if we remove from J − all the edges of Cr∗ , the resulting graph is a forest Ψ whose connected components are paths. Observe that none of these paths is a trivial path because Q∗ is touch-free. We denote by κ(Ψ) the number of connected components of Ψ. Let F be the set of faces of J − that are different from Dr∗ . F is partitioned into the faces that are caves, namely F1 and the non-cave faces, namely F0 . By the Claim 1, |F1 | ≤ |T1 |. 16 Figure 8: Examples of the graphs J and J − in the proof of Lemma 4 (the outer face in the picture corresponds to the interior of Dr ). The faces that are caves contain the word cave. FH: flying hair, BH: bouncing hair, IH: invading hair. The forest Ψ = J − \E(Cr ) has 6 edges and 4 connected components. The weak dual T of J − is depicted with dashed lines. The large white square vertices are the rich vertices of T . To complete the proof, it is enough to show that |S| ≤ |T1 | − 2 (2) Indeed the truth of (2) along with (1), would imply that ρ is at most |T2 | + |S| ≤ |T2 | + |T1 | − 2 ≤ |T | − 2 = 2k − 2. We now return to the proof of (2). For this, we need two more claims. Claim 2: |F0 | ≤ κ(Ψ) − 1. Proof. We use induction on κ(Ψ). Let K1 , . . . , Kκ(Ψ) be the connected components of Ψ. If κ(Ψ) = 1 then all faces in F are caves, therefore |F0 | = 0 and we are done. Assume now that Ψ contains at least two connected components. We assert that there exists at least one connected component Kh of Ψ with the property that only one non-cave face of J − contains edges of Kh in its boundary. To see this, consider the weak dual T of J − . Recall that, as J − is biconnected, T is a tree. Let Ki∗ be the subtree of T containing the duals of the edges in E(Ki ), i ∈ ∗ {1, . . . , κ(Ψ)}, and observe that E(K1∗ ), . . . , E(Kκ(Ψ) ) is a partition of E(T ) into κ(Ψ) cyclically connected sets. We say that a vertex of T is rich if it is incident with edges in ∗ more than one members of {K1∗ , . . . , Kκ(Ψ) }, otherwise it is called poor (see Figure 8). Notice that a vertex of T is rich if and only if its dual face in J − is a non-cave. We call a subtree Ki∗ peripheral if V (Ki∗ ) contains at most one rich vertex of T . Notice that the claimed property for a component in {K1 , . . . , Kκ(Ψ) } is equivalent to the existence of a ∗ peripheral subtree in {K1∗ , . . . , Kκ(Ψ) }. To prove that such a peripheral subtree exists, consider a path P in T intersecting the vertex sets of a maximum number of members of 17 ∗ {K1∗ , . . . , Kκ(Ψ) }. Let e∗ be the first edge of P and let Kh∗ be the unique subtree whose edge set contains e∗ . Because of the maximality of the choice of P , V (Kh∗ ) contains exactly one rich vertex vh , therefore Kh∗ is peripheral and the assertion follows. We denote by fh the non-cave face of J − that is the dual of vh . Let H − be the outerplanar graph obtained from J − after removing the edges of Kh . Notice that this removal results in the unification of all faces that are incident to the edges of Kh , including fh , to a single face f + . By the inductive hypothesis the number of non-cave faces of H − is at most κ(Ψ) − 2. Adding back the edges of Kh in J − restores fh as a distinct non-cave face of J − . If f + was a non-cave of H − then |F0 | is equal to the number of non-cave faces of H − , else |F0 | is one more than this number. In any case, |F0 | ≤ κ(Ψ) − 1, and the claim follows. Claim 3: |V (Ψ)| ≤ |T1 | + 2 · κ(Ψ) − 2. Proof. Let T be the weak dual of J − . Observe that |F0 | + |F1 | = |F | = |V (T )| = |E(T )| + 1 = |E(Ψ)| + 1 = |V (Ψ)| − κ(Ψ) + 1. Therefore |V (Ψ)| = |F0 | + |F1 | + κ(Ψ) − 1. Recall that, by Claim 1, |F1 | ≤ |T1 | and, taking into account Claim 2, we conclude that |V (Ψ)| ≤ |T1 | + 2 · κ(Ψ) − 2. Claim 3 follows. Notice now that a vertex of J − has degree 4 iff it is an internal vertex of some path in Ψ. Therefore, as all connected components of Ψ are non-trivial paths, it holds that |V (Ψ)| = |S| + |L(Ψ)| = |S| + 2 · κ(Ψ), where L(Ψ) is the set of leaves of Ψ. By Claim 3, |S| + 2 · κ(Ψ) = |V (Ψ)| ≤ |T1 | + 2 · κ(Ψ) − 2 ⇒ |S| ≤ |T1 | − 2. Therefore, (2) holds and this completes the proof of the lemma. 3.4 Bounding the number and size of segment types In this section we introduce the notion of segment type that partitions the segments into classes of mutually “parallel” segments. We next prove that, in the light of the results of the previous section, the number of these classes is bounded by a linear function of the number k of linkage paths. In Subsections 3.5 and 3.6 we show that if one of these equivalence classes has size more than 2k , then an equivalent cheaper linkage can be found. All these facts will be employed in the culminating Subsection 3.7 in order to prove that a cheap linkage cannot go very “deep” into the cycles of a cheap CLconfiguration. That way we will be able to quantify the depth at which an irrelevant vertex is guaranteed to exist. Types of segments. Let G be a plane graph and let Q = (C, L) be a convex CLconfiguration of G. Let S1 , S2 be two segments of Q and let P and P 0 be the two paths on Cr connecting an endpoint of S1 with an endpoint of S2 and passing through no other endpoint of S1 or S2 . We say that S1 and S2 are parallel, and we write S1 k S2 , if 18 (1) no segment of Q has both endpoints on P. (2) no segment of Q has both endpoints on P 0 . (3) the closed-interior of the cycle P ∪ S1 ∪ P 0 ∪ S2 does not contain the disk D0 . A type of segment is an equivalence class of segments of Q under the relation k . Given a linkage L of G and a closed disk D of R2 whose boundary is a cycle of G, we define inD (L) to be the graph obtained from (L ∪ bnd(D)) ∩ D after dissolving all vertices of degree 2. Notice that inDr (L) is the biconnected outerplanar graph formed if we dissolve all vertices of degree 2 in the graph that is formed by the union of Cr and the segments of Q. As Q is convex, one of the faces of inDr (L) contains the interior of D0 and we call this face central face. We define the segment tree of Q, denoted by T (Q), as follows. • Let T − be the weak dual of inDr (L) rooted at the vertex that is the dual of the central face. • Let Q be the set of leaves of T − . For each vertex l ∈ Q do the following: Notice first that l is the dual of a face l∗ of inDr (L). Let W1 , . . . , Wρl be the extremal segments in the boundary of l∗ (notice that, by the convexity of Q, for every l, ρl ≥ 1). Then, for each i ∈ {1, . . . , ρl }, create a new leaf wi corresponding to the extremal segment Wi and make it adjacent to l. The height of T (Q) is the maximum distance from its root to its leaves. The real height of T (Q) is the maximum number of internal vertices of degree at least 3 in a path from its root to its leaves plus one. The dilation of T (Q) is the maximum length of a path all whose internal vertices have degree 2 and are different from the root. Observation 3. Let G be a plane graph and let Q = (C, L) be a convex CL-configuration of G. Then the dilation of T (Q) is equal to the maximum cardinality of an equivalence class of ||. Observation 4. Let G be a plane graph and let Q = (C, L) be a convex CL-configuration of G. Then the height of T (Q) is upper bounded by the dilation of T (Q) multiplied by the real height of T (Q). The following lemma is an immediate consequence of Lemma 4 and the definition of a segment tree. The condition that L ∩ Cr 6= ∅ simply requires that the CL-configuration that we consider is non-trivial in the sense that the linkage L enters the closed disk Dr . Lemma 5. Let G be a plane graph and Q = (C, L) be a touch-free CL-configuration of G where C is tight in G, L is C-cheap, and L ∩ Cr 6= ∅. Then Q is convex and the real height of the segment tree T (Q) is at most 2 · |P(L)| − 3. 19 Figure 9: The graph inDr (L) for some convex CL-configuration Q = (C, L) and the tree T (Q). Internal edges in inDr (L) of the same type are drawn as lines of the same type. Q has 11 extremal segments, as many as the leaves of T (Q). The relation k has 19 equivalent classes. The dilation of T (Q) is 4, its height is 8 and its real height is 4. Proof. Certainly, the convexity of Q follows directly from Lemma 3. We examine the non-trivial case where T (Q) contains at least one edge. We first claim that |P(L)| ≥ 2. Assume to the contrary that L consists of a single path P . As Q is convex and L∩Cr 6= ∅, Q has at least one extremal segment. Suppose now that Q has more than one extremal segment all of which are connected components of Cr ∩ P . Let P1 and P2 be the closures of the connected components of L \ Dr that contain the terminals of P . Let pi ∈ V (Cr ) be the endpoint of Pi that is not a terminal, i ∈ {1, 2}. Let also P 0 be any path in Cr between p1 and p2 . Notice now that P1 ∪ P 0 ∪ P2 is a cheaper linkage with the same pattern as L, a contradiction to the fact that L is C-cheap. Therefore we conclude that Q has exactly one extremal segment, which contradicts the fact that Q is touch-free. This completes the proof that |P(L)| ≥ 2. Recall that, by the construction of T (Q) there is a 1–1 correspondence between the leaves of T (Q) and the extremal segments of Q. From Lemma 4, T (Q) has at most 2 · |P(L)| − 2 leaves. Also T (Q) has at least 2 leaves, because Q is touch-free. It is known that the number of internal vertices of degree ≥ 3 in a tree with r ≥ 2 leaves is at most r − 2. Therefore, T (Q) has at most 2 · |P(L)| − 4 internal vertices of degree ≥ 3. Therefore the real height of T (Q) is at most 2 · |P(L)| − 3. 3.5 Tidy grids in convex configurations In this subsection we prove that the existence of many “parallel” segments implies the existence of a big enough grid-like structure. 20 Topological minors. We say that a graph H is a topological minor of a graph G if there exists an injective function φ0 : V (H) → V (G) and a function φ1 mapping the edges of H to paths of G such that • for every edge {x, y} ∈ E(H), φ1 ({x, y}) is a path between φ0 (x) and φ0 (y). • if two paths in φ1 (E(H)) have a common vertex, then this vertex should be an endpoint of both paths. Given the pair (φ0 , φ1 ), we say that H is a topological minor of G via (φ0 , φ1 ). Tilted grids and L-tidy grids. Let G be a graph. A tilted grid of G is a pair U = (X , Z) where X = {X1 , . . . , Xr } and Z = {Z1 , . . . , Zr } are both collections of r vertex-disjoint paths of G such that • for each i, j ∈ {1, . . . , r} Ii,j = Xi ∩ Zj is a (possibly edgeless) path of G, • for i ∈ {1, . . . , r} the subpaths Ii,1 , Ii,2 , . . . , Ii,r appear in this order in Xi . • for j ∈ {1, . . . , r} the subpaths I1,j , I2,j , . . . , Ir,j appear in this order in Zj . • E(I1,1 ) = E(I1,r ) = E(Ir,r ) = E(Ir,1 ) = ∅, • Let GU = ( [ Xi ) ∪ ( i∈{1,...,r} and let S [ Zi ) i∈{1,...,r} G∗U be the graph taken from the graph after contracting all edges in ∗ (i,j)∈{1,...,r}2 Ii,j . Then GU contains the (r × r)-grid Γ as a topological minor via a pair (χ0 , χ1 ) such that A. the upper left (resp. upper right, down right, down left) corner of Γ is mapped via χ0 to the (single) endpoint of I1,1 (resp. I1,r , Ir,r , and Ir,1 ). S B. e∈E(Γ) χ1 (e) = G∗U (this makes G∗U to be a subdivision of Γ). We call the subgraph GU of G realization of the tilted grid U and the graph G∗U representation of U. We treat both GU and G∗U as plane graphs. We also refer to the cardinality r of X (or Z) as the capacity of U. The perimeter of GU is the cycle X1 ∪ Z1 ∪ Xr ∪ Zr . Given a graph G and a linkage L of G we say that a tilted grid U = (X , Z) of G is an L-tidy tilted grid of G if DU ∩ L = ∪ Z where DU is the closed-interior of the perimeter of GU . Lemma 6. Let G be a plane graph and let Q = (C, L) be a convex CL-configuration of G. Let also S be an equivalence class of the relation k. Then G contains a tilted grid U = (X , Z) of capacity d|S|/2e that is an L-tidy tilted grid of G. 21 Figure 10: A visualisation of the proof of Lemma 6. It holds that σ1 = 0 and σ5 = 4, m = 5, m0 = 3. The two shadowed regions indicate the two connencted components of D S ∩ AC . Proof. Let C = {C0 , . . . , Cr } and let S = {S1 , . . . , Sm }. For each i ∈ {1, . . . , m}, let σi be the eccentricity of Si and let σ max = max{σi | i ∈ {1, . . . , m}} and σ min = min{σi | i ∈ {1, . . . , m}}. Convexity allows us to assume that S1 , . . . , Sm are ordered in a way that • σ1 = σ min , • σm = σ max , and • for all i ∈ {1, . . . , m − 1}, σi+1 = σi + 1. • for all i ∈ {1, . . . , m}, Ii,σi = Si ∩ Cσi is a subpath of Cσi . 0 0 0 Let m0 = d m 2 e and let x, x (resp. y, y ) be the endpoints of the path S1 (resp. Sm ) such 0 0 0 that the one of the two (x, y)-paths (resp. (x , y )-paths) in Cr contains both x , y 0 (x, y) and the other, say P (resp. P 0 ), contains none of them. Let DS be the closed-interior of the cycle S1 ∪ P 0 ∪ Sm0 ∪ P . Let also AC be the closed annulus defined by the cycles 22 Cσmax −(m0 −1) and Cσmax . Let ∆ be any of the two connected components of DS ∩ AC . We now consider the graph (L ∪ ∪ C) ∩ ∆. It is now easy to verify that the above graph is the realization GU of a tilted grid U = (X , Z) of capacity m0 , where the paths in X are the portions of the cycles Cσmax −(m0 −1) , . . . , Cσmax cropped by ∆, while the paths in Z are the portions of the paths in {S1 , . . . , Sm0 } cropped by ∆ (see Figure 10). As S is an equivalence class of k, it follows that U is L-tidy, as required. 3.6 Replacing linkages by cheaper ones In this section we prove that a linkage L of k paths can be rerouted to a cheaper one, given the existence of an L-tidy tilted grid of capacity greater than 2k . Given that L is a cheap linkage, this will imply an exponential upper bound on the capacity of an L-tidy tilted grid. Let G be a plane graph and let L be a linkage in G. Let also D be a closed disk in the surface where G is embedded. We say that L crosses vertically D if the outerplanar graph defined by the boundary of D and L ∩ D has exactly two simplicial faces. This naturally partitions the vertices of bnd(D)∩L into the up and down ones. The following proposition is implicit in the proof of Theorem 2 in [3] (see the derivation of the unique claim in the proof of the former theorem). See also [8] for related results. Proposition 3. Let G be a plane graph and let D be a closed disk and a linkage L of G of order k that crosses D vertically. Let also L ∩ D consist of r > 2k lines. Then there is a collection N of strictly less than r mutually non-crossing lines in D each connecting two points of bnd(D) ∩ L, such that there exists some linkage R that is a subgraph of L \ int(D) such that R ∪ ∪ N is a linkage of the graph (G \ D) ∪ ∪ N that is equivalent to L. Lemma 7. Let k, k 0 , ρ be integers such that 0 ≤ ρ ≤ k 0 ≤ k. Let Γ be a (k × k 0 )-grid up down , . . . , pdown }) be vertices of the higher (resp. lower) and let {pup ρ 1 , . . . , pρ } (resp. {p1 horizontal line arranged as they appear in it from left to right. Then the grid Γ contains ρ pairwise disjoint paths P1 , . . . , Pρ such that, for every h ∈ [ρ], the endpoints of Ph are down . pup h and ph Proof. We use induction on ρ. Clearly the lemma is obvious when ρ = 0. Let (i, j) ∈ [k]2 down ) is the i-th (resp. j-th) vertex of the higher (lower) horizontal such that pup ρ (resp. pρ line counting from left to right. We examine first the case where i ≥ j. Let Pρ be the 0 path created by starting from pup ρ , moving k − 1 edges down, and then i − j edges to (down)0 the left. For h ∈ [ρ − 1] let Ph be the path created by starting from pdown and h (down)0 moving one edge up (clearly, Ph consists of a single edge). We also denote by 23 Figure 11: An example of the proof of Lemma 7, where k = 16, k 0 = 11, and ρ = 5. The up white vertices of the higher (resp. lower) horizontal line are the vertices in {pup 1 , . . . , p5 } (resp. {pdown , . . . , pdown }). 1 5 (down)0 (down)0 pi the other endpoint of Pi . We now define Γ0 as the subgrid of Γ that occurs from Γ after removing its lower horizontal line and, for every h ∈ [i, k], its h-th vertical line. By construction, none of the edges or vertices of Pρ belongs in Γ0 . Notice also up that the higher (resp. lower) horizontal line of Γ0 contains all vertices in {pup 1 , . . . , pρ−1 } (down)0 (down)0 (resp. {p1 , . . . , pρ−1 }). From the induction hypothesis, Γ0 contains ρ − 1 pairwise 0 such that for every h ∈ [ρ − 1], the endpoints of Ph are pup disjoint paths P10 , . . . , Pρ−1 h (down)0 (down)0 (down)0 0 and ph . It is now easy to verify that P10 ∪ P1 , . . . , Pρ−1 ∪ Pρ−1 , Pρ is the required collection of pairwise disjoint paths. For the case where i < j, just reverse the same grid upside down and the proof is identical (see Figure 11). Lemma 8. Let Γ be a (k × k)-grid embedded in the plane and assume that the vertices of its outer cycle, arranged in clockwise order, are: right down left , . . . , v2left , v1up }. , vk , . . . , v1down , vk−1 {v1up , . . . , vkup , v2right , . . . , vk−1 Let also H be a graph whose vertices have degree 0 or 1 and they can be cyclically arranged in clockwise order as up down {xup , . . . , xdown , xup 1 1 , . . . , xk , xk 1 } such that if we add to H the edges formed by pairs of consecutive vertices in this cyclic ordering, the resulting graph H + is outerplanar. Let V 1 be the vertices of H that have degree 1 and let H 1 = H[V 1 ]. Then H 1 is a topological minor of Γ via some pair (φ0 , φ1 ), satisfying the following properties: up 1 1. φ0 (xup i ) = vi , i ∈ {1, . . . , k} ∩ V 24 2. φ0 (xdown ) = vidown , i ∈ {1, . . . , k} ∩ V 1 . i up 1 down , . . . , xdown } ∪ V 1 . We define φ as Proof. Let U = {xup 0 1 , . . . , xk } ∩ V and D = {x1 k in the statement of the lemma. In the rest of the proof we provide the definition of φ1 . We partition the edges of H 1 into three sets: the upper edges EU that connect vertices in U , the down edges EL that connect vertices in D, and the crosssing edges EC that have one endpoint in U and one in D. As |V (H 1 )| ≤ 2k we obtain that |E(H 1 )| ≤ k and therefore |EU | + |ED | + |EC | = |E(H 1 )| ≤ k. We set ρ = |EC |. up We recursively define the depth of an edge {xup i , xj } in EU as follows: it is 0 if there up is no edge of EU with an endpoint in {xup i+1 , . . . , xj−1 } and is i > 0 if the maximum up up depth of an edge with an endpoint in {xi+1 , . . . , xj−1 } is i − 1. The depth of an edge {xdown , xdown } is defined analogously. It directly follows, by the definition of depth that: i j q up = max{depth(e) | e ∈ EU } + 1 ≤ |EU | (3) q down = max{depth(e) | e ∈ ED } + 1 ≤ |ED | (4) We now continue with the definition of φ1 as follows: Figure 12: An example of the proof of Lemma 8. On the left, the (16 × 16)-grid G is depicted along with the way the graph H (depicted on the right) is (partially) routed in it. In the figure q up = 3, q down = 2, k 0 = 11, and ρ = 5. up • for every edge e = {xup i , xj } in EU , of depth l and such that i < j, let φ1 (e) be the path defined if we start in the grid G from viup , move l steps down, then j − i steps to the right, and finally move l steps up to the vertex vjup (by “number of steps” we mean number of edges traversed). 25 • for every edge e = {xdown , xdown } in ED , of depth l and such that i < j, let φ1 (e) i j be the path defined if we start in the grid G from vidown , move l steps up, then j − i steps to the right, and finally move l steps down to the vertex vjdown . Notice that the above two steps define the values of φ1 for all the upper and down edges. The construction guarantees that all paths in φ1 (EU ∪ ED ) are mutually non-crossing. Also, the distance between φ0 (U ) and some horizontal line of Γ that contains edges of the images of the upper edges is max{depth(e) | e ∈ EU } that, from (3), is equal to q up − 1. Symmetrically, using (4) instead of (3), the distance between φ0 (D) and the horizontal lines of Γ that contain edges of the images of the down edges is equal to q down − 1. As a consequence, the graph Γ0 = Γ \ {x ∈ V (Γ) | distΓ (x, φ0 (U )) < q up ∨ distΓ (x, φ0 (D)) < q down } is a (k × k 0 )-grid Γ0 , where k 0 = k − (q up + q down ), whose vertices do not appear in any of down } ∈ E , we define the the paths in φ1 (EU ∪ ED ). Given a crossing edge e = {xup C i , xj path Peup as the subpath of Γ created if we start from xup and then go q up steps down. i down down as the subpath of Γ created if we start from xj and then go Similarly, we define Pe up down down q steps up. Notice that each of the paths Pe (resp. Pe ) share only one vertex, up down 0 say pe (resp. pe ), with Γ that is one of their endpoints (these endpoints are depicted up as white vertices in the example of Figure 12). We use the notation {pup 1 , . . . , pρ } (resp. down | e ∈ E }) {pdown , . . . , pdown }) for the vertices of the set {pup e | e ∈ EC } (resp. {pe C ρ 1 up such that, for every h ∈ [ρ], there exists an e ∈ EC such that ph is an endpoint of Peup up and pdown is an endpoint of Pedown . We also agree that the vertices in {pup 1 , . . . , pρ } h }) are ordered as they appear from left to right in the upper (resp. {pdown , . . . , pdown ρ 1 (lower) horizontal line of Γ0 (this is possible because of the outeplanarity of H + ). Notice that ρ = |E(H 1 )| − (|EU | + |ED |) ≤ k − (|EU | + |ED |) which by (3) and (4) implies that ρ ≤ k 0 . up As ρ ≤ k 0 ≤ k, we can now apply Lemma 7 on Γ0 , {pup 1 , . . . , pρ } and {pdown , . . . , pdown } and obtain a collection {Pe | e ∈ EC } of ρ pairwise disjoint paths ρ 1 0 down | e ∈ E }. It is in Γ between the vertices of {pup e | e ∈ EC } and the vertices of {pe C up now easy to verify that {Pe ∪ Pe ∪ Pedown | e ∈ EC } is a collection of ρ vertex disjoint paths between U and D. We can now complete the definition of φ1 for the crossing edges of H by setting, for each e ∈ EC , φ(e) = Peup ∪ Pe ∪ Pedown . By the above construction it is clear that (φ1 , φ2 ) provides the claimed topological isomorphism. Lemma 9. Let G be a graph with a linkage L consisting of k paths. Let also U = (X , Z) be an L-tidy tilted grid of G with capacity m. Let also ∆ be the closed-interior of the perimeter of GU . If m > 2k , then G contains a linkage L0 such that 1. L and L0 are equivalent, 2. L0 \ ∆ ⊆ L \ ∆, and 26 ∪ Z ∩ L0 )| < |E(∪ ∪ Z ∩ L)|. 3. |E(∪ Proof. We use the notation X = {X1 , . . . , Xm } and Z = {Z1 , . . . , Zm }. Let GU be the realization of U in G and let G∗ (resp. L∗ ) be the graph (resp. linkage) obtained from G S (resp. L) if we contract all edges in the paths of (i,j)∈{1,...,r}2 Ii,j , where Ii,j = Xi ∩ Zj , i, j ∈ {1, . . . , m}. We also define X ∗ and Z ∗ by applying the same contractions to their paths. Notice that U ∗ = (X ∗ , Z ∗ ) is an L∗ -tidy tilted grid of G∗ with capacity m and that the lemma follows if we find a linkage L0∗ such that the above three conditions are true for ∆∗ , L∗ , L0∗ , and Z ∗ , where ∆∗ is the closed-interior of the perimeter of G∗U (recall that G∗U is the representation of U that is isomorphic to GU ∗ ). Let G∗− = (G∗ \ ∆∗ ) ∪ ∪ Z and apply Proposition 3 on G∗− , ∆∗ , and L∗ . Let N be a collection of strictly less than m mutually non-crossing lines in D each connecting two ∪ N is a linkage points of bnd(∆∗ )∩L∗ and a linkage R ⊆ L∗ \int(∆∗ ) such that L0 = R∪∪ ∗ ∗ ∗ ∗ ∪ N that is equivalent to L . Let H = (L0 ∩∆ )∪(L∗ ∩bnd(∆∗ )). of the graph (G \∆ )∪∪ Notice that in H, the set V (L0 ∩ ∆∗ ) contains the vertices of H of degree 1 while the rest of the vertices of H have degree 0 and all edges of H have their endpoints in V (L0 ∩ ∆∗ ). Recall that the (m × m)-grid Γ is a topological minor of G∗U via some pair (χ0 , χ1 ) satisfying the conditions A and B in the definition of tilted grid. We are now in position to apply Lemma 8 for the (m × m)-grid Γ and H. We obtain that H 1 = L0 ∩ ∆∗ is a topological minor of Γ via some pair (φ0 , φ1 ). We now define the graph [ L= E(φ1 (e)). e∈E(H 1 ) Notice that L is a subgraph of Γ. We also define the graph [ Q= χ1 (e) e∈E(L) which, in turn, is a subgraph of G∗U . Observe that L0∗ = R ∪ Q is a linkage of G∗ that is equivalent to L∗ . This proves Condition 1. Condition 2 follows from the fact that ∪ Z ∗ ∩ Q) is a proper subset of R ⊆ L∗ \ int(∆∗ ). Notice now that, as |N | < m, E(∪ ∪ Z ∗ ). By construction of L0∗ , it holds that E(∪ ∪ Z ∩ L0∗ ) = E(∪ ∪ Z ∩ Q). Moreover, as E(∪ ∗ ∗ ∗ ∗ ∗ ∪ Z ∗ ) = E(∪ ∪ Z ∗ ∩ L∗ ). U = (X , Z ) is an L -tidy tilted grid of G , it follows that E(∪ Therefore, Condition 3 follows. 3.7 Existence of an irrelevant vertex We now bring together all results from the previous subsections in order to prove Theorem 1. Lemma 10. There exists an algorithm that, given an instance (G, P = {(si , ti ) ∈ V (G)2 , i ∈ {1, . . . , k}}) of PDPP, either outputs a tree-decomposition of G of width √ at most 9 · (k · 2k+2 + 1) · d 2k + 1 e or outputs an irrelevant vertex x ∈ V (G) for (G, P). O(k) This algorithm runs in 22 · n steps. 27 Proof. Let T = {s1 , . . . , sk , t1 , . . . , tk }. By applying the algorithm of Lemma 1, for r = √ k ·2k+2 either we output a tree-decomposition of G of width at most 9(r +1)·d 2k + 1 e) or we find an internally chordless cycle C of G such that G contains a tight sequence of cycles C = {C0 , . . . , Cr } in G where C0 = C and√all vertices of T are in the open exterior O(1) O(k) of Cr . From Lemma 1, this can be done in 2(r· |T |) · n = 22 · n steps. Assume that G has a linkage whose pattern is P and, among all such linkages, let L be a C-cheap one. Our aim is to prove that V (L ∩ C0 ) = ∅, i.e., we may pick x to be any of the vertices in D0 . First, we can assume that k ≥ 2. Otherwise, if k = 1, the fact that L is C-cheap, implies that L ∩ Dr−1 = ∅ ⇒ L ∩ D0 = ∅ and we are done. For every i ∈ {0, . . . , r}, we define Q(i) = (C (i) , L(i) ) where C (i) = {C0 , . . . , Ci } and (i) L is the subgraph of L consisting of the union of the connected components of L that have common points with Di . As r + 1 > k, at least one of Q(i) , i ∈ {0, . . . , r} is touch-free. Let Q0 = (C 0 , L0 ) be the touch-free CL-configuration in {Q(1) , . . . , Q(r) } of the highest index, say h. In other words, C 0 = C (h) and L0 = L(h) . Moreover, C 0 is tight in G and L0 is C 0 -cheap. Let k 0 be the number of connected components of L0 . We set d = r − h and observe that k 0 ≤ k − d, while C 0 has r0 = r + 1 − d > 0 concentric cycles. Again, we assume that k 0 ≥ 2 as, otherwise, the fact that L0 is C 0 -cheap implies that L0 ∩ Dr0 −1 = ∅ ⇒ L0 ∩ D0 = ∅ and we are done. Therefore 0 ≤ d ≤ k − 2. As C 0 is tight in G and L0 is C 0 -cheap, by Lemma 3, Q0 is convex. To prove that V (L ∩ C0 ) = ∅ it is enough to show that all segments of Q have positive eccentricity and for this it is sufficient to prove that all segments of Q0 have positive eccentricity. Assume to the contrary that some segment P0 of Q0 has eccentricity 0. Then, from the third condition in the definition of convexity we can derive the existence of a sequence P0 , . . . , Pr0 −1 of segments such that for each i ∈ {0, . . . , r0 − 1}, Pi+1 is inside the zone of Pi . This implies the existence in the segment tree T (Q0 ) of a path of length r0 from its root to one of its leaves, therefore T (Q0 ) has height r0 . By Lemma 5, the real height of T (Q0 ) is at most 2k 0 − 3. By Observation 4, the dilation of T (Q0 ) is at least k+2 k·2k+2 −d r0 > k·22k = 2k+1 . By Observation 3 and Lemma 6, G contains an 2k0 −3 ≥ 2k−2d L0 -tidy tilted grid U = (X , Z) of capacity > 2k . From Lemma 9, G contains another linkage L00 with the same pattern as L0 and such that c(L00 ) < c(L0 ), a contradiction to the fact that L0 is C 0 -cheap. Since V (L ∩ C0 ) = ∅, any vertex of G in the closed-interior of C0 is irrelevant. Proof of Theorem 1. The proof follows from Lemma 10, taking into account that, for every k ≥ 1, √ 82 · k 3/2 · 2k > 9 · (k · 2k+2 + 1) · d 2k + 1 e) 28 4 An algorithm for PDPP In this section we prove Theorem 2. In particular, we briefly describe an algorithm that, given an instance (G, P) of DPP where G is planar, provides a solution to PDPP, if O(k) one exists, in 22 · nO(1) steps. Our algorithm is based on the following proposition. Proposition 4 ( [25]). There exists an algorithm that, given an instance (G, P) of PDPP and a tree decomposition of G of width at most w, either reports that (G, P) is a NO-instance or outputs a solution of PDPP for (G, P) in 2O(w log w) · n steps. Proof of Theorem 2. By applying the algorithm of Lemma 10, we either find an irrelevant vertex v for (G, P) or we obtain a tree-decomposition of G of width 2O(k) . In the first case, we again look for an irrelevant vertex in the equivalent instance (G, P) ← (G\v, P). This loop breaks if the second case appears, namely when a tree decomposition of G of width 2O(k) is found. Then we apply the algorithm of Proposition 4, that solves the O(k) problem in 22 · n steps. As, unavoidably, the loop will break in less than n steps, the claimed running time follows. Acknowledgment. We thank Ken-ichi Kawarabayashi and Paul Wollan for providing details on the bounds in [14]. We are particularly thankful to the two anonymous referees for their detailed and insightful reviews that helped us to considerably improve the paper. References [1] Isolde Adler, Frederic Dorn, Fedor V. Fomin, Ignasi Sau, and Dimtrios M. Thilikos. Faster parameterized algorithms for minor containment. In 12th Scandinavian Workshop on Algorithm Theory—SWAT 2010 (Bergen), volume 6139 of Lecture Notes in Computer Science, pages 322 – 333. Springer, Berlin, 2010. [2] Isolde Adler, Stavros G. Kolliopoulos, Philipp Klaus Krause, Daniel Lokshtanov, Saket Saurabh, and Dimitrios M. Thilikos. Tight bounds for linkages in planar graphs. In Automata, Languages and Programming - 38th International Colloquium, ICALP 2011, volume 6755 of Lecture Notes in Computer Science, pages 110–121. Springer, Berlin, 2011. [3] Isolde Adler, Stavros G. Kolliopoulos, and Dimitrios M. Thilikos. Planar disjointpaths completion. Algorithmica, pages 1–25, 2015. [4] Hans L. Bodlaender. A linear time algorithm for finding tree-decompositions of small treewidth. SIAM Journal on Computing, 25:1305–1317, 1996. 29 [5] Marek Cygan, Dániel Marx, Marcin Pilipczuk, and Michal Pilipczuk. The planar directed k-vertex-disjoint paths problem is fixed-parameter tractable. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA, pages 197–206, 2013. [6] Anuj Dawar, Martin Grohe, and Stephan Kreutzer. Locally excluding a minor. In LICS’07, pages 270–279. IEEE Computer Society, 2007. [7] Anuj Dawar and Stephan Kreutzer. Domination problems in nowhere-dense classes. In IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, FSTTCS 2009, December 15-17, 2009, IIT Kanpur, India, pages 157–168, 2009. [8] Jeff Erickson and Amir Nayyeri. Shortest non-crossing walks in the plane. In 22nd Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2011, 2011, pages 297–208. ACM-SIAM, 2011. [9] Petr A. Golovach, M. Kamiński, D. Paulusma, and D. M. Thilikos. Induced packing of odd cycles in a planar graph. In 20th International Symposium on Algorithms and Computation, ISAAC 2009, volume 5878 of LNCS, pages 514–523. Springer, Berlin, 2009. [10] Qian-Ping Gu and Hisao Tamaki. Improved bounds on the planar branchwidth with respect to the largest grid minor size. Algorithmica, 64(3):416–453, 2012. [11] Illya V. Hicks. Branch decompositions and minor containment. Networks, 43(1):1–9, 2004. [12] Ken-ichi Kawarabayashi and Yusuke Kobayashi. The induced disjoint path problem. In 13th Conference on Integer Programming and Combinatorial Optimization, IPCO 2008, volume 5035 of Lecture Notes in Computer Science, pages 47–61. Springer, Berlin, 2008. [13] Ken-ichi Kawarabayashi and Bruce Reed. Odd cycle packing. In 42nd ACM Symposium on Theory of Computing, STOC 2010, pages 695–704. ACM, 2010. [14] Ken-ichi Kawarabayashi and Paul Wollan. A shorter proof of the graph minor algorithm: the unique linkage theorem. In 42nd ACM Symposium on Theory of Computing, STOC 2010, pages 687–694. ACM, 2010. [15] Yusuke Kobayashi and Ken-ichi Kawarabayashi. Algorithms for finding an induced cycle in planar graphs and bounded genus graphs. In 20th ACM-SIAM Symposium on Discrete Algorithms, SODA 2009, pages 1146–1155. ACM-SIAM, 2009. 30 [16] Mark R. Kramer and Jan van Leeuwen. The complexity of wire-routing and finding minimum area layouts for arbitrary VLSI circuits. Advances in Comp. Research, 2:129–146, 1984. [17] James F. Lynch. The equivalence of theorem proving and the interconnection problem. ACM SIGDA Newsletter, 5:31–36, 1975. [18] Matthias Middendorf and Frank Pfeiffer. On the complexity of the disjoint paths problem. Combinatorica, 13(1):97–107, 1993. [19] Ljubomir Perković and Bruce Reed. An improved algorithm for finding tree decompositions of small width. In Peter Widmayer, Gabriele Neyer, and Stephan Eidenbenz, editors, Graph-Theoretic Concepts in Computer Science, volume 1665 of Lecture Notes in Computer Science, pages 148–154. Springer, Berlin, 1999. [20] Bruce A. Reed, Neil Robertson, Alexander Schrijver, and Paul D. Seymour. Finding disjoint trees in planar graphs in linear time. In Graph Structure Theory, Proceedings of a AMS-IMS-SIAM Joint Summer Research Conference on Graph Minors held June 22 to July 5, 1991, at the University of Washington, Seattle, pages 295–301. AMS-IMS-SIAM, 1991. [21] Neil Robertson and Paul D. Seymour. Graph Minors. X. Obstructions to Treedecomposition. J. Comb. Theory Ser. B, 52(2):153–190, 1991. [22] Neil Robertson and Paul D. Seymour. Graph Minors. XIII. The disjoint paths problem. J. Comb. Theory Ser. B, 63(1):65–110, 1995. [23] Neil Robertson and Paul D. Seymour. Graph Minors. XXI. Graphs with unique linkages. J. Comb. Theory Ser. B, 99(3):583–616, 2009. [24] Neil Robertson and Paul D. Seymour. Graph Minors. XXII. Irrelevant vertices in linkage problems. J. Comb. Theory, Ser. B, 102(2):530–563, 2012. [25] Petra Scheffler. A practical linear time algorithm for disjoint paths in graphs with bounded tree-width. Technical Report 396/1994, FU Berlin, Fachbereich 3 Mathematik, 1994. [26] Alexander Schrijver. Finding k disjoint paths in a directed planar graph. SIAM J. Comput., 23(4):780–788, 1994. [27] Alexander Schrijver. Combinatorial optimization. Polyhedra and efficiency. Vol. A. Springer-Verlag, Berlin, 2003. [28] Jens Vygen. NP-completeness of some edge-disjoint paths problems. Discrete Appl. Math., 61(1):83–90, 1995. 31
8cs.DS
Resource Allocation Strategies for Secure WPCN Multiantenna Multicasting Systems arXiv:1706.01936v1 [cs.IT] 6 Jun 2017 Zheng Chu, Huan X. Nguyen, Senior Member, IEEE, Giuseppe Caire, Fellow, IEEE Abstract This paper investigates a secure wireless-powered multiantenna multicasting system, where multiple power beacons (PBs) supply power to a transmitter in order to establish a reliable communication link with multiple legitimate users in the presence of multiple eavesdroppers. The transmitter has to harvest radio frequency (RF) energy from multiple PBs due to the shortage of embedded power supply before establishing its secure communication. We consider two different scenarios. In the first, the PBs and the transmitter belong to the same operator, where we formulate the resource allocation problem as the minimization of the total transmit power subject to the target secure rate constraint. The solution of this problem yields both the optimal power and energy transfer time allocation. Due to the non-convexity of this problem, we propose a two-level approach, where the inner level problem can be recast as a convex optimization framework via conic convex reformulation, while the outer level problem can be handled by using one-dimensional (1D) search. The second scenario considers the case where the transmitter and the PBs belong to different service suppliers. Hence, we formulate the resource allocation problem where we consider incentives for the PBs to assist the transmitter. This leads to the formulation of a Stackelberg game for the secure wireless-powered multiantenna multicasting system. The transmitter has to pay for the energy services from these multiple PBs in order to facilitate secure communications. In this game, the transmitter and the PB are modelled as leader and follower, respectively, in which both of them try to maximize their own utility function. The closed-form Stackelberg equilibrium of the formulated game is then derived. Finally, numerical results are provided to validate our proposed schemes. Index Terms Wireless powered communication networks (WPCN), Physical layer security, SWIPT, Multicasting, Stackelberg game Z. Chu and H. Nguyen are with the School of Science and Technology, Middlesex University, The Burroughs, London NW4 4BT, U.K. (Email: [email protected]) Giuseppe Caire is with the Communications and Information Theory Group, Technical University of Berlin, 10587 Berlin, Germany, and also with the Department of Electrical Engineering, University of Southern California, Los Angeles, CA 90089 USA. I. I NTRODUCTION Wireless multicast media streaming is anticipated to be a significant component of the forthcoming 5G systems, motivated by the consumers’ desire to take advantage of high quality multimedia wireless devices (e.g., 4k hand-held devices, 3D augmented reality) [1]–[3]. Energy efficiency and security are major critical issues that must be addressed in the design of such systems. Radio frequency (RF) energy harvesting and transfer techniques have recently been considered as a promising solution to the energy-constrained wireless networks [4]–[6]. As a recent application of RF energy harvesting and transfer techniques, wireless powered communication networks (WPCNs) have become a novel technology in wireless networking and attracted more and more attention [7]. A “harvestthen-transmit” protocol was proposed for WPCNs in [8], where the wireless users harvest power from the RF signals broadcast by an access point in the downlink (DL), and then send information to the AP in the uplink (UL) by employing the harvested energy. Cooperative protocols for WPCNs were developed based on different models [9]–[11]. A different approach consists of deploying a dedicated wireless energy transfer (WET) network with multiple power beacons (PBs) to provide wireless charging services to the wireless terminals via the RF energy transfer technique [12], [13]. Since the PBs do not require any backhaul link, the associated cost of PBs deployment is much lower, hence, it is feasible to deploy the PBs densely to guarantee network coverage for a wide range of mobile devices [14]. Security in data transmission can be addressed either by traditional crypto methods, or more fundamentally, in terms of information theoretic secure rates. The latter approach, commonly referred to as “physical-layer security,” was initially developed for the wiretap channel [15], [16], i.e., a broadcast channel with one transmitter and two sets of receivers: legitimate users and eavesdroppers. Multiantenna wiretap channels have been widely investigated in terms of secure rate region [17]–[21]. Some state-of-art techniques, such as artificial noise (AN) and cooperative jammer (CJ), have been designed for multiantenna transceivers, in order to introduce more interference at the eavesdroppers [22]–[27]. In [22], rank-one solution properties were exploited with semidefinite programming (SDP) relaxation for secure transmit beamforming. AN-assisted transmit optimization has been presented in [23], where the spatially selective AN embedded with secure transmit beamforming was designed to obtain the optimal power allocation. In [24], CJ from an external node is exploited in order to create interference at the eavesdroppers and achieve the desired target secure rate. However, it is not always possible to have an own CJ to improve the secrecy rates. Another option could be to employ a private CJ by paying a price for the jamming services. This strategy was investigated in [24], [25], where a CJ releases its jamming service depending interference caused to the eavesdropper, while the transmitter pays a certain amount to guarantee its secure communication. In this strategy, a Stackelberg game can be formulated to obtain the optimal power allocation. In addition, cooperative cognitive radio (CR) combined with secure communications could also be modelled as a Stackelberg game to determine the optimal resource allocations [28]. In [26], [27], the secrecy rate optimization problem was posed in terms of outage secrecy rates, due to the fact that the channels are not perfectly known and are subject to random fading with known statistics. Physicallayer security techniques have also been recently developed in radio frequency identification (RFID). The design of RFID systems is a challenge due to the broadcast nature of backscatter communication, which is vulnerable to eavesdropping [29]. Simultaneous wireless information and power transfer (SWIPT) has emerged as one of most promising approaches to provide power for communication devices. SWIPT has been considered in combination with physical-layer security in a number of recent works (e.g., [30]–[33]). It is worth pointing out that the transmit power is constant in the above secure communication systems. However, the use of WET effectively makes the available transmit power a system variable in order to achieve secure communications. Thus, this research gap motivates the work in this paper. We investigate a WPCN-assisted multiantenna secure multicasting system in which a multicast service provider (i.e., the transmitter) guarantees secure communication with legitimate users in the presence of multiple eavesdroppers by utilizing the harvested energy from the PBs. In particular, we consider two different but complementary scenarios. In the first scenario, the transmitter and the PBs are considered to belong to the same service provider. In the second, they belong to different service providers with different objectives. Accordingly, we formulate and solve the two different problems as follows: 1) Power minimization for WPCN-aided multiantenna secure multicasting system: This problem is formulated for the first scenario, where there is no energy trading between the transmitter and the PBs. They cooperate to minimize the transmit power for a given target secure multicast rate. The optimization problem is not jointly convex in terms of PBs’ transmit power, the fraction of time dedicated to WET, and the transmit beamforming vector. To circumvent this non-convexity issue, we consider a two-level approach. The outer level can be recast as a single-variable optimization problem with respect to the energy time allocation, in which the optimal solution can be achieved via numerical search, while the inner level remains a non-convex power minimization problem. There are different approaches for the inner level problem. In [22], semidefinite programming (SDP) relaxation was employed to solve the power minimization for the case of single legitimate user only. However, this approach will not guarantee a rank-1 solution when extending to the case of multiple users. Therefore, a rank-1 feasible solution for the original beamforming problem must be obtained from the solution of the relaxed problem, with no optimality guarantee (see, e.g., [34], [35]) Differently, we first propose a novel reformulation based on matrix transformations and convex conic optimization techniques, yielding a second-order cone programming (SOCP) solution which is optimal when the SDP relaxed solution satisfies the rank-one condition. Then, we propose a successive convex approximation (SCA) based SOCP scheme, which is performed iteratively to obtain the optimal transmit beamformer directly for any general case. Numerical results confirm that our proposed SCA based SOCP scheme outperforms the SDP relaxed scheme, and the proposed SOCP scheme has more computationally efficient than the SDP relaxed scheme that uses Guided Randomization method. 2) Game theory based WPCN-aided multiantenna secure multicasting system: In this problem, we investigate the case where the transmitter and the PBs belong to different service operators, both of which want to maximize their own benefit. Thus, an energy price must be paid by the transmitter in order to induce the PBs to provide enough WET to guarantee secure communications. In particular, we develop an energy trading framework for wireless powered secure multiantenna multicasting systems, where the strategic behavior of the transmitter and the PBs is modeled as a Stackelberg game. The transmitter acts a leader that buys energy from the PBs to achieve a desired secure multicast rate to the users. The transmitter optimizes the energy price and energy transfer time to maximize its utility function, defined as the weighted difference between revenues (proportional to the achieved secure rate) and costs of the purchased energy. The PBs are the followers, that determine their optimal transmit powers based on the energy price released from the transmitter to maximize their own profits, defined as the difference between the payment received from the transmitter and its energy cost. We obtain a closed-form solution for the Stackelberg equilibrium, in which both the PBs and the transmitter come to an agreement on the energy price, transmit power and energy time allocation. Related works: Considering the first scenario, unlike [28] where an intermediate self-sustainable relay was employed to enable cooperation between a WET network and a wireless information transfer (WIT) network to guarantee secure communications subject to outage probability constraints, our work is to exploit direct energy interactions between the multicasting service provider and the PBs to facilitate secure communications of the legitimate users. Moreover, we also consider a special case with a single legitimate user and a single eavesdropper. In [36], the authors aimed to maximize the secrecy rate subject to the transmit power budget, and the optimal beamforming vector was designed based on Rayleigh quotient approach; whereas our work for this special case presents the closed-form solution of the joint design of the optimal time allocation and the optimal transmit beamforming vector to achieve the target of minimizing the transmitter’s transmit power, via the dual problem and the Karush-Kuhn-Tucker (KKT) condition. The rest of the paper is organized as follows. Section II presents our system model. Section III solves the power minimization problem for the secure WPCN multiantenna multicasting system, whereas the game theory based secure WPCN multiantenna multicasting system is investigated in Section IV. Section V provides simulation results to validate the theoretical derivations. Finally, Section VI concludes the paper. A. Notations We use the upper case boldface letters for matrices and lower case boldface letters for vectors. (·)T and (·)H denote the transpose and conjugate transpose respectively. Tr(·) and E{·} stand for trace of a matrix and the statistical expectation for random variables. ̺max (∗) represents the maximum eigenvalue, whereas vmax (∗) denotes the eigenvector associated with the maximum eigenvalue. A  0 indicates that A is a positive semidefinite matrix. k ∗ k denotes the Euclidean norm of a vector. I and (·)−1 denote the identity matrix with appropriate size and the inverse of a matrix respectively. [x]+ represents max{x, 0}. The notation Kn denotes the following generalized inequality:   a   Kn 0 ⇔ kbk ≤ a, b where b ∈ Cn−1 and Kn ⊆ Rn is called a proper cone. II. S YSTEM M ODEL In this section, we consider the secure wireless powered multiantenna multicasting system as shown in Fig. 1, where a transmitter broadcasts the same information to all legitimate users in the presence of multiple eavesdroppers. Due to energy limitation at the transmitter, it is assumed that there is not enough power supply for information transfer, and thus the transmitter must harvest energy from the PBs. This system consists M single antenna PBs, one multiantenna transmitter equipped with NT transmit antennas, K single antenna legitimate users and L single antenna eavesdroppers. This secrecy model has some potential applications, such as on-demand video broadcasting, wireless sensor networks and device to device (D2D) communication systems. In our paper, a harvest-then-transmit protocol is considered. Specifically, time is divided in periods of duration T . Each period is split into a WET phase of duration θT, and a WIT phase of duration (1 −θ)T, where θ ∈ (0, 1) is a system parameter that must be optimized. Let hs,k ∈ CNT ×1 denote the channel coefficients between the transmitter and the k-th legitimate user, while he,l ∈ CNT ×1 denotes the channel coefficients between the transmitter and the l-th eavesdropper. Also, gm ∈ C1×NT denotes the channel coefficients between the m-th PB and the transmitter. First, each Fig. 1: WPCN for multiantenna secure multicasting system. PB transfers the energy to the transmitter, the harvested energy during the WET phase of θT at the transmitter can be written as EB = ξ M X m=1 pm kgm k2 θT, (1) where pm denotes the transmit power of the m-th PB, and 0 < ξ ≤ 1 is the efficiency for converting the harvested energy to the electrical energy to be stored, which is assumed to be ξ = 1 in this paper. During the WIT phase of (1 − θ)T , the received signal at the k-th legitimate user and the l-th eavesdropper are given by ys,k = s ye,l = s EB hH vs + ns,k , k = 1, ..., K, (1 − θ)T s,k EB hH vs + ne,l , l = 1, ..., L, (1 − θ)T e,l where s denotes the Gaussian distributed transmit signal with unit norm, v ∈ CNT ×1 is the normalized transmit beamformer with E{kvk2 } = 1, ns,k and ne,l are additive white Gaussian noises (AWGNs) at the k-th legitimate user and the l-th eavesdropper with variance σs2 and σe2 . Hence, the channel capacity of the k-th legitimate user and the l-th eavesdropper can be expressed as [37] ! P 2 H 2 p kg k |h θ M v| m m s,k m=1 , ∀k, Rs,k = (1 − θ) log 1 + (1 − θ)σs2 (2) and Re,l = (1 − θ) log 1 + θ PM 2 H 2 m=1 pm kgm k |he,l v| (1 − θ)σe2 ! , ∀l, (3) respectively. For this secure multicasting system, we have the following definition: Definition 1: Multicast secrecy rate of a multicasting system with K users is defined as [35] RK = min [Rs,k − max Re,l ]+ . k∈[1,K] l∈[1,L] (4) In the following, we develop two resource allocation schemes depending on whether the transmitter and the PBs belong to the same service supplier. III. P OWER M INIMIZATION FOR WPCN M ULTIANTENNA S ECURE M ULTICASTING S YSTEM In this section, we consider the scenario that the transmitter and the PBs belong to the same service provider in a multicasting network. We will formulate a power minimization problem where the total transmit power at the transmitter is minimized to satisfy the target secrecy rate for all the legitimate users in the presence of multiple eavesdroppers by using the harvested energy from the PBs. We assume that the channel state information (CSI) between the transmitter and k-th user as well as l-th eavesdropper (i.e., hs,k , ∀k and he,l , ∀l) is available at the transmitter. This can be achieved through different methods such as the local oscillator power leakage from the eavesdropper receivers’ RF frontend [38] or even the CSI feedback method [39]. For example, in a video broadcasting system there may be legitimate users that are entitled to receive the content and other users who have not subscribed to this content, but are still part of the system. These users obey the basic physical-layer protocol rules, which includes feeding back CSI to enable beamforming. Hence, in this case, it is practical to assume that the CSI of the eavesdroppers is known at the transmitter. A. Power Minimization The minimization of the total transmit power1 subject to a given secure multicast rate constraint can be written as: min pm ,v,θ PM pm kgm k2 θ kvk2 , (1 − θ) m=1 s.t. RK ≥ R̄, 0 ≤ pm ≤ P, 0 < θ < 1, (5) where P is the maximum power constraint at each PB, and R̄ denotes the target secure multicast rate. The problem (5) is not convex in terms of v and θ, and cannot be solved directly. It is obvious that from 1 The objective function in (5) consists of three variables: the transmit power of the PBs (i.e., pm , ∀m), energy transfer time allocation (i.e., θ) and normalized transmit beamforming vector (i.e., v). problem (5), the optimal solution of pm is pm = P, which is the maximum transmit power at each PB. Thus, the problem (5) reduces to min w,θ PM kgm k2 θ kwk2, (1 − θ) m=1 s.t. RK (θ, w) ≥ R̄, 0 < θ < 1, (6) where RK (θ, w) can be written as P P    2 H 2 + 2 H 2 θ M θ M m=1 kgm k |he,l w| m=1 kgm k |hs,k w| − max log 1 + , RK (θ, w) = min (1 − θ) log 1 + l∈[1,L] k∈[1,K] (1 − θ)σs2 (1 − θ)σe2 √ and w = P v. Remark 1: Problem (6) may be infeasible, depending on the value of R̄ and on the channel vectors hs,k and he,l . However, the feasibility can be ensured with probability of 1 for the case where the users’ and eavesdroppers’ channels are drawn randomly and independently from a continuous distribution with fullrank covariance matrix (e.g., a proper Gaussian non-degenerate NT -variate distribution) and the number of antennas NT is not smaller than K + L (e.g., in the massive multiantenna systems)2. It can be observed that even when problem (6) is feasible, it still still nonconvex. In order to solve this problem, we considered a two-level approach, where the inner level can be handled by employing the convex conic reformulation for a given energy transfer time allocation factor θ, whereas the outer level consists of a line search over the parameter θ in (0,1). Now, we rewrite the problem (6) into the following two levels: 1) Inner level: f (θ) = min w θ( PM kgm k2 ) kwk2, s.t. RK (w) ≥ R̄, 1−θ m=1 (7) 2) Outer level: min f (θ), s.t. 0 < θ < 1. (8) θ We first solve the inner problem (7) for a given θ, which can be equivalently modified as min kwk2 w 2 |hH s,k w| s.t. log 1 + σ̄s2 2 ! 2 |hH e,l w| − log 1 + σ̄e2 ! ¯ , ∀ (k, l) ≥ R̄ (9) In this case, it is always possible to use zero-forcing beamforming to all eavesdroppers, such that for sufficiently large P any target secrecy rate R̄ can be achieved. The condition of sufficient transmit power P can be guaranteed because of the fact that the PBs and the transmitter belong to the same service provider and they can work together on an adaptive power transfer policy (i.e., P is adjusted according to the required solution w such that P = kwk2 ). where σ̄s2 = θ (1−θ)σs2 PM , 2 m=1 kgm k σ̄e2 = θ (1−θ)σe2 PM , 2 m=1 kgm k ¯ = and R̄ R̄ . 1−θ The problem (9) is not convex in terms of w, and still cannot be solved efficiently. In order to circumvent this non-convex issue, we can introduce a new semi-definite matrix Qs = wwH , and the problem (9) can be relaxed as min Tr(Qs ), Qs 0 ¯ 2R̄ ¯ 1 H R̄ s.t. 2 Tr(hs,k hs,k Qs ) − 2 Tr(he,l hH e,l Qs ) ≥ 2 − 1, ∀(k, l). σs σe (10) The above problem is a convex optimization framework, which can be solved by using interior-point methods [40]. It is not always possible to expect that the optimal solution of (10) attains the optimum of the original problem (9). However, the SDP relaxation will be tight if the optimal solution of (10) is of rank-one. Therefore, we characterize the rank property of the SDP relaxed solution via the following proposition: Proposition 1: [34, Theorem 1] Provided the problem (10) is feasible, the optimal solution of (10) must satisfy the following rank inequality: √ rank(Qs ) ≤ min(K, KL) (11) With Proposition 1, we are able to identify the tightness of SDP relaxed solution via the following lemma Lemma 1: [34, Corollary 1] Provided the problem (10) feasible, it is guaranteed that (10) can yield a rank-one solution which exactly solves the problem (9) when either of the following conditions is satisfied: 1) K = 1 and L ≥ 1. 2) 1 < K ≤ 3, and L = 1. By exploiting Proposition 1 and Lemma 1, if rank(Qs ) satisfies the rank-one condition in Lemma 1, we can employ the eigen-decomposition for Qs to obtain the optimal transmit beamformer w. Otherwise, we need to use a rank reduction algorithm to tackle this problem [41]. However, when rank-one condition in Lemma 1 is satisfied, we can also consider the following theorem to directly solve the problem (9). Theorem 1: The problem (9) can be reformulated into the following convex optimization framework when the rank-one condition in Lemma 1 is satisfied. min t, t≥0,w  s.t.  t w   K (NT +1) Proof: Please refer to Appendix A.    0,   1 wH hs,k σ̄s ¯ 2R̄ H w he,l σ̄e 1 ¯ R̄ (2 − 1) 2     K3 0,  ∀ (k, l). (12) By exploiting Theorem 1, it is easily verified that (12) is a convex optimization problem, which can be solved by using interior-point methods [40]. Thus, the optimal transmit power of each PB can be adaptively updated as P opt = kwk2 , and the optimal transmit beamforming vector vopt can also be easily achieved. Now, we consider the computation complexity of solving problem (12). According to the analysis of the basic complexity elements in [42], problem (12) includes one second-order cone (SOC) constraint with dimension NT + 1, KL SOC constraints Thus, its  with dimension NT , and one linear constraint.  √ computation complexity can be given by O 2KL + 3n[KLNT2 + (NT + 1)2 + 1 + n2 ] ln( 1ǫ ), where n = O(NT + 1), and ǫ > 0 denotes the accuracy requirement. A special case: Consider the case with a single legitimate user and a single eavesdropper only. The closedform solution can be derived by exploiting Lagrange dual problem and KKT conditions. For notational convenience, we replace the channel notations hs,k and he,l by hs and he , respectively. The following lemma is introduced: Lemma 2: The optimal solution to (7) with only single legitimate user and single eavesdropper is given by w opt P opt √ ¯ w̄ 2R̄ 1 H v = , w̄ = vmax ( 2 hs hH = s − 2 he he ), kw̄k2 σ̄s σ̄e 1 ¯ . = αopt (2R̄ − 1), αopt = ¯ 2R̄ H) − h h ̺max ( σ̄12 hs hH s σ̄2 e e P opt vopt , opt s (13) e Proof: See Appendix B. Now, it is natural that a question may arise with regard how to tackle with the problem (9) when the rank-one condition in Lemma 1 is not satisfied. Hence, we consider a SCA based scheme to reformulate the problem (9) for any general case, yielding an SOCP. We equivalently rewrite the problem (9) by introducing a new set of variables (xs,k , ys,k , bs,k ), ∀k as min kwk2, w,bs,k 2 s.t. x2s,k + ys,k ≥ bs,k , ¯ (2R̄ − 1)σs2 + (14a) ¯ 2R̄ σs2 H |w he,l |2 σe2 ≤ bs,k , (14b)   xs,k = ℜ wH hs,k , ys,k = ℑ wH hs,k , (14c) where (xs,k , ys,k , bs,k ) ∈ R, ∀k In the above reformulation, it is observed that both constraint (14a) and (14b) are still not convex while (14c) are linear constraints. In order to further process these non-convex constraints, we first introduce iterative successive approximation methods to tackle with (14a). Specifically, (n) set qs,k = [xs,k ys,k ]T , and denote the value of this vector at the n-th iteration as qs,k , we consider the first-order Taylor series to approximate the left hand side of (14a) as x2s,k + 2 ys,k = qTs,k qs,k ≈ (n) kus,k k2 +2 2 X i=1 (n) (n) us,k [qs,k (i) − us,k (i)], (15) (n) (n+1) where the parameter vector us,k (i) can be updated us,k (n) (n) = qs,k , ∀k at the (n + 1)-th iteration. From (n−1) this update, it is easily verified that us,k can be determined by qs,k (n) kus,k k2 + 2 2 X i=1 (n) . Thus, (15) can be given by (n) us,k [qs,k (i) − us,k (i)] ≥ bs,k . To proceed, the constraint (14b) can be equivalently reformulated into the following SOC   1 ¯ R̄   2 2σ − 1) (2 s 1 ¯  R̄¯  (2R̄ − 1) 2 σs (bs,k + 1)   R̄¯  ≤ bs,k ⇒  2 2 σs wH h  ≤  e,l 2 2 σs H  σe 2  w h σe e,l (16) (17) (bs,k −1) 2 Remark 2: The convexity of the term qTs,k qs,k and the first-order Taylor approximation ensures that the right hand side in (15) bounds the left side in each iterative procedure. In other words, the optimal solution of the problem with the approximate constraint in (16) definitely belongs to the feasible set of the original optimization problem at each iteration. Also, due to the above update, in the (n + 1) step, the approximation in (16) holds with equality. In addition, the gradients of both sides with respect to the optimization variables in (16) are also the same at the (n + 1)-th iteration, which can prove that the solution of the iterative procedure satisfies the KKT conditions of the original problem (9). This fact has been proved in [43]. By exploiting Remark 2, the problem (9) takes the following form at the n-th iteration min kwk2, w,bs,k s.t. (16), (17), (14c), ∀(k, l). (18) Based on the above discussion, an iterative algorithm to approximately solve the problem in (9) is summarized as in Algorithm 1. Algorithm 1: Successive convex approximation to solve (9) (0) 1) Initialization: Randomly generate us,k , ∀k to make (18) feasible 2) Repeat a) Solve (18). (n+1) b) Set us,k (n) = qs,k , ∀k. c) Set n := n + 1. 3) Until required accuracy is achieved or the maximum number of iterations is reached. From Algorithm 1, the initialized vector us,k is given by random generation to guarantee the feasibility (n+1) of (18), which can be updated at each iteration until us,k (n) = qs,k holds when the algorithm converges. In addition, it is guaranteed that Algorithm 1 converges to a locally optimal solution (quite close to the globally optimal solution) [44], [45]. Next, we focus on the outer level problem in (8). This is a single-variable optimization problem with respect to θ, which is rewritten as follows: min f (θ), s.t. 0 < θ < 1. θ (19) We can show that f (θ) is a convex optimization problem with respect to θ via the following lemma: Lemma 3: (19) is a convex problem with respect to θ. Proof: See Appendix C. By exploiting Lemma 3, the optimal energy transfer time allocation factor (i.e., θopt ) can be obtained by using one-dimensional (1D) single-variable search (e.g., golden search) in the interval θ ∈ [0, 1]. Then, the optimal power allocation policy can be achieved. IV. G AME THEORY BASED S ECURE WPCN M ULTIANTENNA M ULTICASTING S YSTEM In the previous section, we considered that the transmitter and the PBs belong to the same service provider, in which they try to work together to achieve their common target. However, this is not always the case so that, in this section, we consider the opposite scenario where the transmitter and the PBs are from two different service providers. Both parties want to maximize their own benefit. To model this scenario, we assume that the transmitter will have to pay for the energy services from the PBs, whereas the PBs will consider this payment as incentives to provide wireless energy transfer service. Obviously, being able to decide what price to pay for the energy service, the transmitter can take a leading role in dictating the energy trading interaction. This fits very well the model of a Stackelberg game, which motivates us to use this game theory to optimize both parties’ benefit. In this game model, the transmitter (leader) first pays for the harvested energy with an energy price to maximize its utility function. Then, the PBs (followers) optimize their transmit powers based on their released energy price to maximize their individual utility function. A. Stackelberg Game Formulation Let λ denote the energy price that the transmitter will pay to the PBs. The total payment of the transmitter to the M PBs, donoted by QM , is written as QM = λθT M X m=1 pm kgm k2 , (20) where pm denotes the transmit power of the mth PB. Without loss of generality, we can assume T = 1. We now define the utility function of the transmitter as follows: UM = µRK − QM , (21) where µ > 0 is the weight per a unit of secrecy throughput, by which the transmitter uses to convert the achievable secrecy rate RK into the equivalent revenue. Therefore, the leader game for the transmitter can be formulated as max UM , s.t. 0 < θ < 1, λ ≥ 0. λ,θ,v (22) At the same time, each PB can be modelled as a follower that wants to maximize its own revenue function, which is defined as follows: UP B,m = θ(λpm kgm k2 − Fm (pm )), (23) where Fm (pm ) is used to model the cost of the m-th PB per unit time for wirelessly charging the transmitter with the transmit power pm . In this paper, we consider the following quadratic model1 for the cost function of the PBs: Fm (x) = Am x2 + Bm x (24) where Am > 0 and Bm > 0 are the constants that can be different for each PB. Thus, the follower game of m-th PB is given by max UP B,m , s.t. pm ≥ 0. pm (25) Both (22) and (25) form a Stackelberg game for this secure WPCN multiantenna multicasting system, where the transmitter (leader) announces an energy price, and then the PBs (followers) optimize the transmit power based on the released energy price to maximize their individual revenue functions. The solution of this Stackelberg game can be obtained by investigating the Stackelberg equilibrium, where the transmitter and the PBs come to an agreement on the energy price, the transmit power of each PB and the time fraction of energy transfer duration. Note that the deviation of either the transmitter or the PBs from the Stackelberg equilibrium will introduce a loss in their revenue functions. B. Solution of The Proposed Stackelberg Game In order to derive the solution of this game, the well-known Stackelberg equilibrium concept can be defined as follows: Definition 2: Let (θopt , λopt ) denote the solutions of problem (22) while {popt m } represents the solution of problem (25) (here, the brackets {} indicate a vector that include all pm ’s with ∀m). Then, the triple1 The quadratic model has been commonly used in the energy market to model the energy cost [46]. variable set (θopt , λopt , popt m ) is a Stackelberg equilibrium of the formulated game provided that the following conditions are satisfied opt UM (θopt , λopt , {popt m }) ≥ UM (θ, λ, {pm }), (26) opt opt UP B,m (θopt , λopt , popt m ) ≥ UP B,m (θ , λ , pm ), ∀m. (27) for 0 < θ < 1, λ ≥ 0, and pm ≥ 0, ∀m. First, it can be observed that problem (25) is convex with respect with pm for given values of λ and θ. Thus, the optimal solution is obtained as in the following theorem: Theorem 2: For given λ and θ, the optimal solution to (25) is given by    λkgm k2 −Bm , λ > Bm 2 2Am kgm k opt pm =  0, λ ≤ kgBmmk2 . (28) Proof: The proof of this theorem is achieved by equating the first derivative of (23) to zero. From Theorem 2, we can deduce the following remark: Remark 3: The optimal power allocation popt m can only be obtained under the condition that the energy price λ is greater than threshold Bm . kgm k2 Thus, we divide the PBs into two sets, namely, the active and non-active PBs. The PBs who can transfer the power to the transmitter and help determine the achievable secrecy rate by using the harvested energy are called active PBs. The remaining ones are non-active PBs. Generally, according to (28), we can determine these active PBs and re-index them for the total power computation. In our paper, for convenience, we assume that all PBs are active and considered to be involved in the WET phase of θT. By exploiting Theorem 2 and Remark 3, we replace pm in (22) with (28), problem (22) now becomes "     X M M kgm k4 X Bm kgm k2 ts − max µ(1 − θ) log 1 + λ λ,θ 2Am 2Am m=1 m=1   X  # M M kgm k4 X Bm kgm k2 − log 1 + λ te − 2Am 2Am m=1 m=1 M M X X Bm kgm k2 kgm k4 + θλ − θλ 2Am 2Am m=1 m=1 2 s.t. 0 < θ < 1, λ ≥ 0 (29) where ts = min ts,k = min k k 2 2 θ|hH θ|hH e,l v| s,k v| , ∀k, t = max t = min , ∀l. e e,l l l (1 − θ)σe2 (1 − θ)σs2 Note that before solving problem (29), the normalized transmit beamfoming vector v can be obtained by employing a similar approach as in Section III Thus, we solve for the optimal solution to the energy price λ and the energy transfer time allocation θ only in leader level game (29). The problem (29) is not jointly convex in terms of θ and λ. It is extremely hard to find their optimal solutions simultaneously due to the complexity of the objective function in (29). In order to address this issue, we first derive the closed-form solution for the optimal λ with a given value θ. Then, the optimal value for θ can be achieved P kgm k4 through numerical analysis. In order to derive the closed-form solution of λ, we set CM = M m=1 2Am , P Bm kgm k2 , and the objective function to (29) can be expressed as DM = M m=1 4Am          UM (θ, λ) = µ(1 − θ) log 1 + λCM − 2DM ts − log 1 + λCM − 2DM te − θλ2 CM + 2θλDM . (30) Lemma 4: (30) is a concave function with respect to λ. Proof: See Appendix D. By exploiting Lemma 4, we can claim that (29) is a convex problem. Now, we derive the closed-form solution of λ. In order to obtain the optimal solution to λ, let the first order derivative of (30) equate to zero, we have µ(1 − θ)te CM µ(1 − θ)ts CM − − 2θCM λ + 2θDM = 0. 1 + (λCM − DM )ts − DM ts 1 + (λCM − DM )te − DM te (31) Set x = λCM − DM , and after a few of mathematical simplifications, we arrive at x3 + ax2 + bx + c = 0, (32) where a= (ts + te ) − 2DM ts te (DM ts − 1)(DM te − 1) , b= , c = −µ(1 − θ)CM (ts − te ). ts te ts te It is easily observed that (32) is a cubic equation, which can be solved in terms of closed-form solution of x by using Cardano’s formula [47], xopt = ej∠x1 p 3 |x1 | + ej∠x2 p 3 |x2 | − a/3, (33) where ∠ denotes the phase angle of an complex random variable, and q √ q √ x1 = − + ∆, x2 = − − ∆, 2 2 3 2 2 p q a 2a3 ab ∆= + , p = − + b, q = − + c. 27 4 3 27 3 Thus, we obtain the optimal energy price as λopt = xopt + DM . CM (34) We have already obtained the optimal energy price of the transmitter for a given θ. Now, the optimal energy transfer time allocation is derived in the following. We substitute the closed-form expression (34) into (30), thus, the following optimization problem can be written with respect to θ, max UM (θ, λopt ), s.t. 0 < θ < 1. θ (35) The problem (35) can be efficiently handled by using 1D search to obtain the optimal energy transfer time solution θopt as follows: θopt = arg max UM (θ, λopt ). θ∈(0,1) (36) opt opt We have completed the derivation of the Stackelberg equilibrium (popt m , λ , θ ) for the formulated Stackelberg game, which are shown in (28), (33) and (36). V. N UMERICAL R ESULTS In this section, we provide the simulation results to validate the proposed schemes. We consider the secure multiantenna multicasting system that consists of three legitimate receivers (i.e., K = 3) and two eavesdroppers (L = 5), where the transmitter is wirelessly powered by five PBs (M = 5). It is assumed that the transmitter is equipped with eight transmit antennas (i.e., NT = 8), whereas the others consist of p −3 single antenna. We employ the path loss channel model Ad−α x , where A = 10 . The path loss exponent is set to α = 3. Distance variable dx can be replaced with ds , de , and dP B according to different channel coefficients, representing the distance between the transmitter and the legitimate users, the eavesdroppers as well as the PBs, respectively. In our simulation, we choose ds = de = 2 m, and dP B = 5 m unless specified. The target secrecy rate is set to be R̄ = 2 bps/Hz. The noise powers at the legitimate users and the eavesdroppers are set as σs2 = σe2 = 10−8 mW. First, we evaluate the minimized transmit power obtained from our proposed scheme in Section III against the distance between PBs and the transmitter (i.e., dP B ). Fig. 2 shows the result with general case when the rank-one condition in Lemma 1 is not satisfied. From this result, one can observe that our proposed SCA scheme outperforms the SDP scheme in [35]. This is owing to a fact that our proposed scheme can achieve a optimal solution via Algorithm 1, whereas the SDP scheme cannot satisfy the rank-one condition such that the relaxed solution cannot achieve optimality. Fig. 3 evaluates the results of Theorem 1, where it is observed that the SOCP yields the same performance with the proposed SCA scheme and SDP scheme, which confirms that the correctness and accuracy of Theorem 1. Fig. 4 shows the impact of the energy time allocation. From this figure, we observe that the proposed SOCP scheme with the fixed time allocation based scheme (i.e., θ = 0.5) that obviously requires more transmit power than the proposed SOCP scheme with optimal energy time allocation, this is owing to a fact that our 2.5 Proposed scheme (M = 3, K = 5, L = 5) SDP scheme (M = 3, K = 5, L = 5) Proposed schem (M = 5, K = 5, L = 5) SDP scheme (M = 5, K = 5, L = 5) Transmit power (W) 2 1.5 1 0.5 0 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 Distance between PBs and transmitter d PB (m) Fig. 2: Comparison of transmit power between the proposed scheme and SDP scheme versus distance between PBs and transmitter. proposed scheme can achieve a optimal energy time allocation by numerical search (i.e., θ = θopt ). Similar behaviours are observed in Fig. 5 which is obtained for the special case of single user and single eavesdropper. This figure shows that the derived closed-form solution in Lemma 2 matches well with the numerical results obtained from a convex optimization tool, which validates the accuracy of this closedform solution. In Fig. 6, we compare the run time of our proposed scheme and the SDP relaxation with Guided Randomzation3 [48] versus the number of transmit antenna NT . From this result, one can observe that our proposed scheme consume less time than SDP with Guided Randomization, which implies that proposed algorithm has a lower computational complexity. Next, we validate the equilibrium of the proposed Stackelberg game. In order to support the derived Stackelberg equilibrium, we first evaluate the utility function of the transmitter versus the energy transfer price λ with a fixed energy transfer time allocation θ in Fig. 7. From this figure, it is observed that the revenue function is concave, which validates the proof of convexity shown in Lemma 4. In this figure, it also can be shown that the optimal utility function of the transmitter can be obtained via optimal energy transfer price λopt in (34) and it matches the numerical search with different given θ, which confirms the 3 Guided Randomization is employed to tackle with the scenario that the SDP relaxed solution is not rank-one. 0.35 Proposed scheme (K = 1, L = 5, M = 3) SDP scheme (K = 1, L = 5, M = 3) 0.3 SOCP schem (K = 1, L = 5, M =3) Proposed scheme (K = 1, L = 5, M = 5) Transmit power (W) 0.25 SDP scheme (K = 1, L = 5, M = 5) SOCP scheme (K = 1, L = 5, M = 5) 0.2 0.15 0.1 0.05 0 1 1.5 2 2.5 3 3.5 4 4.5 Distance between PBs and transmitter d 5 PB 5.5 6 (m) Fig. 3: Comparison of transmit power between the SOCP and SDP schemes versus distance between PBs and transmitter. optimal closed-form solution of the energy transfer price λ. Also, as θ increases, the utility function of the legitimate transmitter is decreasing, and the optimal value λ shifts to the left.In addition, the revenue function of the transmitter versus energy transfer time allocation (i.e., θ) with optimal energy price λopt is shown in Fig. 8. From this figure, it is shown that the revenue function is concave with respect to θ, which validates (36). Moreover, there exists a optimal utility transfer time (i.e., θopt ) via numerical search with the optimal energy price. As µ increases, the optimal value slightly shifts to the left. Then, we evaluate the transmitter revenue function performance of the proposed Stackelberg game. Fig. 9 and Fig. 10 show the revenue function of the transmitter versus the number of PBs. From both figures, we can observe that this utility is improved with increasing of the number of PBs and µ. From Fig. 9, increasing the number of the eavesdroppers can have more significant impact on the revenue than increasing the number of the legitimate users. In Fig. 10, the revenue is decreased when the distance between the source and PBs is increased from 5m to 6.5m. This is because the nearer the PBs to the transmitter, the higher the transferred energy efficiency between them, which reduces the transmitter’s payments to the PBs for their wireless energy services. Fig. 11 shows the optimal energy transfer time θ versus the number of PBs. It is observed that θ decreases as either the number of the PBs or µ increase. The same behavior is observed when the distance between the source and PBs (i.e., dP B ) decreases. Fig. 1.2 M = 3, Proposed scheme M = 5, Proposed scheme M = 3, = 0.5 M = 5, = 0.5 Transmit power (W) 1 0.8 0.6 0.4 0.2 0 1 2 3 4 Distance between PBs and transmitter d 5 PB 6 (m) Fig. 4: Comparison of transmit power between the proposed scheme with optimal θ and fixed θ versus distance between PBs and transmitter. 0.12 M = 3, Convex optimization M = 3, Closed-form solution M = 5, Convex optimization M = 5, Closed-form solution Transmit power (W) 0.1 0.08 0.06 0.04 0.02 0 1 2 3 4 Distance between PBs and transmitter d 5 PB 6 (m) Fig. 5: Transmit power versus distance between PBs and transmitter with special case. 9.5 Our proposed scheme SDP + Guided Randomization 9 8.5 Run time (Sec) 8 7.5 7 6.5 6 5.5 5 4.5 4 4.5 5 5.5 6 6.5 7 7.5 8 NT Fig. 6: Run time versus the number of transmit antenna NT . 25 Numerical Search Closed-form solution opt 20 = 0.1, 0.3, 0.5, 0.7 UM 15 10 5 0 0 1 2 3 4 5 6 7 10 Fig. 7: The utility function of transmitter UM versus energy transfer price λ 4 15 UM Optimal value UM 10 5 = 5,10,15,20 0 0 0.2 0.4 0.6 0.8 1 Fig. 8: The utility function of transmitter UM versus energy transfer time allocation θ 22 20 18 UM 16 14 K = 1, L = 1 K = 1, L = 3 K = 3, L = 1 = 10 12 =5 10 8 6 1 1.5 2 2.5 3 3.5 4 4.5 5 Number of PBs Fig. 9: The utility function of transmitter UM versus No. of PBs with different number of legitimate users and eavesdroppers 13 12 11 10 UM 9 = 10 d PB = 5m 8 d PB = 6.5m 7 6 =5 5 4 3 1 1.5 2 2.5 3 3.5 4 4.5 5 Number of PBs Fig. 10: The utility function of transmitter UM versus No. of PBs with different dP B 0.55 d PB = 5 m d PB = 6.5 m Optimal energy transfer time 0.5 =5 0.45 0.4 0.35 0.3 = 10 0.25 0.2 1 1.5 2 2.5 3 3.5 4 4.5 Number of PBs Fig. 11: Optimal energy transfer time allocation θ versus No. of PBs 5 12 shows the optimal energy price versus the number of PBs. The price decreases as the number of PBs increases. Besides, the larger µ, the higher optimal energy price needs to be paid. It can also be seen from this figure that the decrease of the distance between the transmitter and PBs can also reduce the optimal energy price. This is because the shorter the distance between the source and PBs, the more energy harvested by the transmitter for the same power transmitted by the PBs, such that a lower energy price can be paid by the transmitter. 800 = 5, d PB = 5 m = 10, d PB = 5 m 700 = 5, d PB = 6.5 m Optimal energy price 600 = 10, d PB = 6.5 m 500 400 300 200 100 0 1 1.5 2 2.5 3 3.5 4 4.5 5 Number of PBs Fig. 12: The optimal energy price versus No. of PBs. VI. C ONCLUSION AND F UTURE WORK In this paper, we investigated the secure wireless-powered multiantenna multicasting system, which consists of a dedicated wireless powered networks with multiple PBs and a multiantenna secure multicasting system. We first investigated the power minimization problem to obtain the optimal power and energy transfer time allocation when both wireless power and secure information networks belong to the same service supplier. As this problem is not convex, we proposed a two-level approach, where the inner level problem can be relaxed as a convex optimization framework via iterative conic convex reformulation (i.e., SCA based SOCP scheme), while the outer level problem can be handled by using an 1D search. Next, we formulate a Stackelberg game for the case when the WET and secure WIT networks belong to different service suppliers. We formulated the energy trading process between the transmitter and the PBs as a Stackelberg game, in which the transmitter plays a leader role and pays a price for the energy services from the PBs to guarantee the required security, and optimizes the energy price and the energy transfer time to maximize its utility function. Meanwhile, the PBs are modelled as the followers that determine their optimal transmit powers based on the released energy price to maximize their own utility function. The Stackelberg equilibrium have been derived in terms of closed-form solution, where both the transmitter and the PBs come to an agreement on the energy price, transmit power and energy transfer time. Simulation results have been provided to validate the proposed schemes. For future works, we can consider a more challenging scenario such that the PBs will not stay silent during the WIT phase but rather transmit artificial noise to interfere with the eavesdroppers. This would change the dynamic of the optimization problems and may require different design/solutions. A PPENDIX A. Proof of Theorem 1 When the solution Qs satisfies rank-one conditions in Lemma 1, the SDP relaxed problem (10) can be equivalently modified as min kwk2 , w ¯ ¯ 1 2R̄ s.t. ¯2 |wH he,l |2 + (2R̄ − 1) ≤ 2 |wH hs,k |2 , ∀(k, l). σ̄s σe (37) The problem (37) is still not convex in terms of the beamforming vector w. Thus, we propose a novel reformulation method by applying the following inequality relations in (37),   a   Kn 0 ⇔ kbk ≤ a, b (38) such that (37) can be reformulated into the following SOCP: min t, t,w  s.t.  t1 w   KN T +1 Thus, this completes the proof of Theorem 1.    0,   1 wH hs,k σ̄s ¯ 2R̄ H w he,l σ̄e 1 ¯ R̄ (2 − 1) 2     K3 0, ∀k, ∀l.  (39) B. Proof of Lemma 2 The power minimization problem (9) with only single legitimate user and eavesdropper can be rewritten as min wH w w     2 2 |hH |hH e w| s w| ¯. − log 1 + ≥ R̄ s.t. log 1 + σ̄s2 σ̄e2 (40) Now we equivalently modify (40) as min P vH v v,P s.t. vH (I + vH (I + P h hH )v σ̄s2 s s P h hH )v σ̄e2 e e ¯ ≥ 2R̄ , vH v = 1, P ≥ 0. (41) In order to achieve the optimal solution (P opt , vopt ), we consider the Lagrange dual problem to (40), which can be expressed as      1 H ¯ 1 H R̄ H H L(w, µ) = w w + α 2 1 + 2 w he he w − 1 + 2 w hs hs w , σ̄s σ̄e H (42) where α ≥ 0 is the Lagrange multiplier associated with the secrecy rate constraint. The corresponding dual problem can be given by  1 1 H max α(2 − 1), s.t. Y = I − α 2 hs hH s − 2 he he α≥0 σ̄s σ̄e ¯ R̄   0. (43) The constraint in (43) implies that the matrix Y have at least one zero eigenvalue. On the other hand, the solution of α can be the maximum value that satisfies the positive semidefinite constraint in (43), which leads to αopt = 1 ̺max ( σ̄12 hs hH s − s ¯ 2R̄ h hH ) σ̄e2 e e . (44) The problem (40) can be formulated as a convex optimization problem. Hence, the strong duality holds between the original problem (40) and the corresponding dual problem (43). The required minimum power to achieve the secrecy rate constraint is ¯ P opt = αopt (2R̄ − 1). On the other hand, it is easily verified that the optimal w lies in the null space of Y   ¯ 2R̄ w̄ 1 H H . w̄ = vmax 2 hs hs − 2 he he , vopt = σ̄s σ̄e kw̄k2 (45) (46) Hence, the optimal solution to (40) can be expressed as wopt = √ P opt vopt . (47) C. Proof of Lemma 3 In order to show that f (θ) is a convex problem, there are two conditions to be satisfied: convex objective function and convex constraints [40]. First, we rewrite f (θ) as follows: P 2 θ( M m=1 kgm k ) kwk2, f (θ) = min θ 1 − θ  1 − θ + θts,k ≥ R̄, 0 < θ < 1, ∀k, ∀l. s.t. (1 − θ) log 1 − θ + θte,l (48) It is easily verified that the objective function in (48) is convex with respect to θ. Then, we show that   |hH w|2 1−θ+θts,k the secrecy constraint in (48) is convex. Let fk,l (θ) = (1 − θ) log 1−θ+θte,l , where ts,k = s,k and σ2 s te,l = 2 |hH e,l w| . σe2 Hence, the remaining part we only show that fk,l (θ) is a concave function with respect to θ, which can be equivalently written as fk,l (θ) = (1 − = log 1−θ+θts,k 1−θ θ) log 1−θ+θt = e,l 1−θ ! (1−ts,k )(1−θ)+ts,k 1−θ . (1−te,l )(1−θ)+te,l 1−θ ! (1 − θ) log θ(ts,k −1)+(1−ts,k )+ts,k 1−θ θ(te,l −1)+(1−te,l )+te,l 1−θ ! (49) Let z = 1 − θ, (0 ≤ θ ≤ 1), fk,l (z) can be rewritten as fk,l (z) = z log (1 − te,l )z + te,l (1 − ts,k )z + ts,k − z log . z z (50) Then, we consider the first derivative of fk,l (z),     ∂fk,l (z) (1 − ts,k )z + ts,k (1 − te,l )z + te,l 1 −ts,k −te,l ln − ln . = + + z ln 2 z (1 − ts,k )z + ts,k z (1 − te,l )z + te,l (51) Furthermore, the second derivative of fk,l (z) is given by   −t2s,k −t2e,l 1 ∂ 2 fk,l (z) . = − z2 ln 2 [(1 − ts,k )z + ts,k ]2 z [(1 − te,l )z + te,l ]2 z Let g(t) = −t2 , [(1−t)z+t]2 z (52) the first derivative of g(t) is given by ∂g(t) −2t[(1 − t)z + t] + 2(1 − z)t2 −2zt = = < 0. t [(1 − t)z + t]3 z [(1 − t)z + t]3 z (53) It is easily verified that (53) holds since z = 1 − θ ∈ (0, 1), thus, g(t) is a monotonically decreasing function of t. Due to ts,k > te,l , it is easily obtained that function with respect to θ. ∂ 2 fk,l (z) z2 < 0. In other words, fk,l (θ) is a concave D. Proof of Lemma 4 We first derive the first-order derivatives of (30), which is written as   ∂UM (λ) µ(1 − θ)ts CM µ(1 − θ)te CM 1 − − 2CM λ + 2DM . = ∂λ ln 2 1 + (λCM − 2DM )ts 1 + (λCM − 2DM )te Then, the second-order derivatives of (30) is given by   2 µ(1 − θ)CM (t2e − t2s ) 1 ∂ 2 UM (λ) − 2CM < 0. = ∂2λ ln 2 [1 − (λCM − 2DM )ts ]2 [1 − (λCM − 2DM )te ]2 (54) (55) The above inequality holds since ts − te > 0 to guarantee the minimum achievable secrecy rate is greater than zero. Thus, (30) is a concave function. R EFERENCES [1] N. D. Sidiropoulos, T. N. Davidson, and Z.-Q. Luo, “Transmit beamforming for physical-layer multicasting,” IEEE Transactions on Signal Processing, vol. 54, no. 6, pp. 2239–2251, Jun. 2006. [2] Z. Xiang, M. Tao, and X. Wang, “Coordinated multicast beamforming in multicell networks,” IEEE Trans. Wireless Commun., vol. 12, no. 1, pp. 12–21, Jan. 2013. [3] Z. Xiang, M. Tao, and X. Wang, “Massive mimo multicasting in noncooperative cellular networks,” IEEE J. Sel. Area. Comm., vol. 32, no. 6, pp. 1180–1193, Jun. 2014. [4] L. Varshney, “Transporting information and energy simultaneously,” in Proc. 2008 IEEE Int. Symp. Inf. Theory, pp. 1612–1616, July, 2008. [5] P. Grover and A. Sahai, “Shannon meets tesla: Wireless information and power transfer,” in Proc. 2010 IEEE Int. Symp. Inf. Theory, pp. 2363–2367, Jun., 2010. [6] R. Zhang and C. K. Ho, “MIMO broadcasting for simultaneous wireless information and power transfer,” IEEE Trans. Wireless Commun., vol. 12, pp. 1989–2001, May 2013. [7] S. Bi, Y. Zeng, and R. Zhang, “Wireless powered communication networks: an overview,” IEEE Wireless Commun., vol. 23, no. 2, pp. 10–18, Apr. 2016. [8] H. Ju and R. Zhang, “Throughput maximization in wireless powered communication networks,” IEEE Trans. Wireless Commun., vol. 13, no. 1, pp. 418–428, Jan. 2014. [9] H. Ju and R. Zhang, “User cooperation in wireless powered communication networks,” in Proc. IEEE GLOBECOM, pp. 1430–1435, Dec. 2014. [10] H. Chen, X. Zhou, Y. Li, P. Wang, and B. Vucetic, “Wireless-powered cooperative communications via a hybrid relay,” in Proc. IEEE Information Theory Workshop (ITW), pp. 666–670, Nov. 2014. [11] H. Chen, Y. Li, J. L. Rebelatto, B. F. Ucha-Filho, and B. Vucetic, “Harvest-then-cooperate: Wireless-powered cooperative communications,” IEEE Trans. Signal Process., vol. 63, no. 7, pp. 1700–1711, Apr. 2015. [12] K. Huang and X. Zhou, “Cutting the last wires for mobile communications by microwave power transfer,” IEEE Commun. Mag., vol. 53, no. 6, pp. 86–93, Jun. 2015. [13] K. Huang and V. K. N. Lau, “Enabling wireless power transfer in cellular networks: Architecture, modeling and deployment,” IEEE Trans. Wireless Commun., vol. 13, no. 2, pp. 902–912, Feb. 2014. [14] C. Zhong, G. Zheng, Z. Zhang, and G. K. Karagiannidis, “Optimum wirelessly powered relaying,” IEEE Signal Process. Lett., vol. 22, no. 10, pp. 1728–1732, Oct. 2015. [15] A. D. Wyner, “The wire-tap channel,” Bell Syst. Tech. Journ., vol. 54, pp. 1355–1387, Jan. 1975. [16] I. Csiszár and J. Körner, “Broadcast channels with confidential messages,” IEEE Trans. Inform. Theory, vol. 24, pp. 339–348, May 1978. [17] T. Liu and S. Shamai, “A note on the secrecy capacity of the multiple-antenna wiretap channel,” IEEE Trans. Inform. Theory, vol. 55, no. 6, pp. 2547–2553, Jun. 2009. [18] A. Khisti and G. W. Wornell, “Secure transmission with multiple antennas I: The MISOME wiretap channel,” IEEE Trans. Inform. Theory, vol. 56, no. 7, pp. 3088–3104, Jul. 2010. [19] A. Khisti and G. W. Wornell, “Secure transmission with multiple antennas II: The MIMOME wiretap channel,” IEEE Trans. Inform. Theory, vol. 56, no. 11, pp. 5515–5532, Nov. 2010. [20] J. Li and A. P. Petropulu, “On ergodic secrecy rate for gaussian MISO wiretap channels,” IEEE Trans. Wireless Commun., vol. 10, pp. 1176–1187, April Apr. 2011. [21] S. A. A. Fakoorian and A. L. Swindlehurst, “Full rank solutions for the MIMO gaussian wiretap channel with an average power constraint,” IEEE Trans on Signal Process., vol. 61, no. 10, pp. 2620–2631, May. 2013. [22] Q. Li and W.-K. Ma, “Optimal and robust transmit designs for MISO channel secrecy by semidefinite programming,” IEEE Trans. Signal Process., vol. 59, no. 8, pp. 3799–3812, Aug. 2011. [23] Q. Li and W.-K. Ma, “Spatially selective artificial-noise aided transmit optimization for MISO multi-eves secrecy rate maximization,” IEEE Trans. Signal Process., vol. 61, no. 10, pp. 2704–2717, May 2013. [24] Z. Chu, K. Cumanan, Z. Ding, M. Johnston, and S. Le Goff, “Secrecy rate optimizations for a MIMO secrecy channel with a cooperative jammer,” IEEE Trans. Vehicular Technol., vol. 64, no. 5, pp. 1833–1847, May 2015. [25] Z. Chu, K. Cumanan, Z. Ding, M. Johnston, and S. L. Goff, “Secrecy rate optimization for a MIMO secrecy channel based on stackelberg game,” in Proc. European Signal Processing Conference (EUSIPCO), Lisbon, Portugal, pp. 126–130, Sept. 2014. [26] Z. Chu, K. Cumanan, Z. Ding, M. Johnston, and S. Le Goff, “Robust outage secrecy rate optimizations for a MIMO secrecy channel,” IEEE, Wireless Commun. Lett., vol. 4, no. 1, pp. 86–89, Feb. 2015. [27] Z. Chu, H. Xing, M. Johnston, and S. L. Goff, “Secrecy rate optimizations for a MISO secrecy channel with multiple multiantenna eavesdroppers,” IEEE Trans. Wireles Commun., vol. 15, no. 1, pp. 283–297, Jan. 2016. [28] A. Al-Talabani, Y. Deng, A. Nallanathan, and H. X. Nguyen, “Enhancing secrecy rate in cognitive radio networks via stackelberg game,” IEEE Trans. Commun., vol. 64, no. 11, pp. 4764–4775, Nov. 2016. [29] Q. Yang, H. M. Wang, Y. Zhang, and Z. Han, “Physical layer security in MIMO backscatter wireless systems,” IEEE Trans. Wireless Commun., vol. 15, no. 11, pp. 7547–7560, Nov. 2016. [30] L. Liu, R. Zhang, and K.-C. Chua, “Secrecy wireless information and power transfer with MISO beamforming,” IEEE Trans. Signal Process., vol. 62, no. 7, pp. 1850–1863, Apr. 2014. [31] D. W. K. Ng, E. S. Lo, and R. Schober, “Robust beamforming for secure communication in systems with wireless information and power transfer,” IEEE Trans. Wireless Commun., vol. 13, no. 8, pp. 4599–4615, Aug. 2014. [32] M. Khandaker and K. Wong, “Masked beamforming in the presence of energy-harvesting eavesdroppers,” IEEE Trans. Inf. Forensics Security, vol. 10, pp. 40–54, Jan 2015. [33] Z. Chu, Z. Zhu, M. Johnston, and S. Y. L. Goff, “Simultaneous wireless information power transfer for MISO secrecy channel,” IEEE Trans. Vehicular Technol., vol. 65, no. 9, pp. 6913–6925, Sept. 2016. [34] Q. Li and W. K. Ma, “Multicast secrecy rate maximization for MISO channels with multiple multi-antenna eavesdroppers,” in Proc. IEEE, ICC, Tokyo, Japan, pp. 1–5, Jun. 2011. [35] K. Cumanan, Z. Ding, M. Xu, and H. V. Poor, “Secrecy rate optimization for secure multicast communications,” IEEE J. Sel. Topics Signal Process., vol. 10, no. 8, pp. 1417–1432, Dec. 2016. [36] S. Shafiee and S. Ulukus, “Achievable rates in gaussian MISO channels with secrecy constraints,” in Proc. IEEE ISIT, Nice, France, pp. 2466–2470, Jun. 2007. [37] Y. Wu, X. Chen, C. Yuen, and C. Zhong, “Robust resource allocation for secrecy wireless powered communication networks,” IEEE Commun. Lett., vol. 20, no. 12, pp. 2430–2433, Dec. 2016. [38] A. Mukherjee and A. L. Swindlehurst, “Detecting passive eavesdroppers in the MIMO wiretap channel,” in IEEE ICASSP, Tokyo, Japan, Mar. 2012. [39] G. Geraci, M. Egan, J. Yuan, A. Razi, and I. B. Collings, “Secrecy sum-rates for multi-user MIMO regularized channel inversion precoding,” IEEE Trans. Commun., vol. 60, no. 11, pp. 3472–3482, Nov. 2012. [40] S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge, UK: Cambridge University Press, 2004. [41] Y. Huang and D. P. Palomar, “Rank-constrained separable semidefinite programming with applications to optimal beamforming,” IEEE Trans. Signal Process., vol. 58, no. 2, pp. 664–678, Feb. 2010. [42] K. Y. Wang, A. M. C. So, T. H. Chang, W. K. Ma, and C. Y. Chi, “Outage constrained robust transmit optimization for multiuser MISO downlinks: Tractable approximations by conic optimization,” IEEE Trans. Signal Process., vol. 62, no. 21, pp. 5690–5705, Nov. 2014. [43] B. R. Marks and G. P. Wright, “A general inner approximation algorithm for nonconvex mathematical programs,” Oper Res., vol. 26, no. 4, pp. 681–683, 1978. [44] L. N. Tran, M. F. Hanif, A. Tolli, and M. Juntti, “Fast converging algorithm for weighted sum rate maximization in multicell MISO downlink,” IEEE Signal Process. Lett., vol. 19, no. 12, pp. 872–875, Dec. 2012. [45] L. N. Tran, M. F. Hanif, and M. Juntti, “A conic quadratic programming approach to physical layer multicasting for large-scale antenna arrays,” IEEE Signal Process. Lett., vol. 21, no. 1, pp. 114–117, Jan. 2014. [46] A. H. Mohsenian-Rad, V. W. S. Wong, J. Jatskevich, R. Schober, and A. Leon-Garcia, “Autonomous demand-side management based on game-theoretic energy consumption scheduling for the future smart grid,” IEEE Trans. Smart Grid, vol. 1, no. 3, pp. 320–331, Dec. 2010. [47] X. Huang, J. He, Q. Li, Q. Zhang, and J. Qin, “Optimal power allocation for multicarrier secure communications in full-duplex decode-and-forward relay networks,” IEEE Commun. Lett., vol. 18, no. 12, pp. 2169–2172, Dec. 2014. [48] J. Liao, M. R. A. Khandaker, and K. K. Wong, “Robust power-splitting SWIPT beamforming for broadcast channels,” IEEE Commun. Lett., vol. 20, no. 1, pp. 181–184, Jan. 2016.
7cs.IT
Under consideration for publication in Theory and Practice of Logic Programming 1 arXiv:cs/0309003v1 [cs.PL] 1 Sep 2003 Model Checking Linear Logic Specifications MARCO BOZZANO1,2 , GIORGIO DELZANNO2 and MAURIZIO MARTELLI2 1 ITC-IRST Via Sommarive 18, Povo, 38050 Trento, Italy (e-mail: [email protected]) 2 Dipartimento di Informatica e Scienze dell’Informazione Università di Genova Via Dodecaneso 35, 16146 Genova - Italy (e-mail: {giorgio,martelli}@disi.unige.it) submitted 1 January 2003; revised 1 January 2003; accepted 1 January 2003 Abstract The overall goal of this paper is to investigate the theoretical foundations of algorithmic verification techniques for first order linear logic specifications. The fragment of linear logic we consider in this paper is based on the linear logic programming language called LO (Andreoli and Pareschi 1990) enriched with universally quantified goal formulas. Although LO was originally introduced as a theoretical foundation for extensions of logic programming languages, it can also be viewed as a very general language to specify a wide range of infinite-state concurrent systems (Andreoli 1992; Cervesato 1995). Our approach is based on the relation between backward reachability and provability highlighted in our previous work on propositional LO programs (Bozzano et al. 2002). Following this line of research, we define here a general framework for the bottom-up evaluation of first order linear logic specifications. The evaluation procedure is based on an effective fixpoint operator working on a symbolic representation of infinite collections of first order linear logic formulas. The theory of well quasi-orderings (Abdulla et al. 1996; Finkel and Schnoebelen 2001) can be used to provide sufficient conditions for the termination of the evaluation of non trivial fragments of first order linear logic. KEYWORDS: Linear logic, fixpoint semantics, bottom-up evaluation 1 Introduction The algorithmic techniques for the analysis of Petri Nets are based on very well consolidated theoretical foundations (Esparza and Melzer 2000; Karp and Miller 1969; Mayr 1984; Esparza et al. 1999; Finkel 1993; Silva et al. 1998). However, several interesting problems, e.g., the coverability problem, become undecidable when considering specification languages more expressive than basic Petri Nets. In this setting, validation of complex specifications is often performed through simulation and testing, i.e., by “executing” the specification looking for design errors, e.g., as in the methodology based on the construction of the reachability graph of Colored Petri Nets (Jensen 1997). In order to study algorithmic techniques for the analysis of a 2 M. Bozzano, G. Delzanno and M. Martelli vast range of concurrency models it is important to find a uniform framework to reason about their characteristic features. In our approach we will adopt linear logic (Girard 1987) as a unified logical framework for concurrency. Linear logic provides a logical characterization of concepts and mechanisms peculiar of concurrency like locality, recursion, and non determinism in the definition of a process (Andreoli and Pareschi 1990; Kobayashi and Yonezawa 1995; Martı́-Oliet and Meseguer 1991); communication via synchronization and value passing (Cervesato 1995; Miller 1993); internal state and updates to its current value (Andreoli and Pareschi 1990; Miller 1996); and generation of fresh names (Cervesato et al. 1999; Miller 1993). Provability in fragments of linear logic can be used as a formal tool to reason about behavioral aspects of the concurrent systems (Bozzano et al. 2002; McDowell et al. 1996). The overall goal of this paper is to investigate the theoretical foundations of algorithmic verification techniques for specifications based on first order linear logic. The fragment we consider in this paper is based on the linear logic programming language called LO (Andreoli and Pareschi 1990) enriched with universally quantified goal formulas. Apart from being a logic programming language, the appealing feature of LO is that it can also be viewed as a rich specification language for concurrent systems: • Specification languages like Petri Nets and multiset rewriting over first order atomic formulas can be naturally embedded into propositional LO (see, e.g., (Cervesato 1995; Bozzano et al. 2002)). • First order LO specifications can be used to specify the internal state of processes with structured data represented as terms, thus enlarging the class of systems that can be formally specified in the logic. In this context universal quantification in goal formulas has several interesting interpretations: it can be viewed either as a sort of hiding operator in the style of π-calculus (Miller 1993), or as a mechanism to generate fresh names as in (Cervesato et al. 1999). Before discussing in more details the technical contributions of our work, we will briefly illustrate the connection between Petri Nets and linear logic, and between reachability and provability in the corresponding formal settings. The bridge between the two paradigms is the proofs as computations interpretation of linear logic proposed in (Andreoli 1992) and in (Miller 1996). Linear Logic and Concurrency A Petri Net can be represented by means of a multiset-rewriting system over a finite alphabet, say p, q, r , . . ., of place names. One possible way of expressing multiset rewrite rules in linear logic is based on the (multiplicative disjunction) is interpreted as a following idea. The connective multiset constructor, whereas the connective ◦− (reversed linear implication) is interpreted as the rewrite relation. Both connectives are allowed in the LO fragment. For instance, as shown in (Cervesato 1995) the LO clause & q ◦− p & & & & p p q t Model Checking Linear Logic Specifications 3 can be viewed as a Petri Net transition that removes a token from places p and q and puts two tokens in place p, one in q, and one in t . According to the proofs as computations interpretation (Andreoli 1992), a top-down derivation in linear logic consists of a goal-directed sequence of rule applications. If we look at the initial goal as a multiset of atomic formulas (places) representing the initial marking of a Petri Net, then each application of an LO clause like the one illustrated above (backchaining in the terminology of (Andreoli 1992)) simulates the firing of a Petri Net transition at the corresponding marking. Furthermore, the overall top-down derivation corresponds to one of the possible executions of the net, leading from the initial marking to one of the target states. Thanks to the presence of other connectives, LO supports more sophisticated mechanisms than the ones available in simple Petri Nets. For instance, in (Andreoli and Pareschi 1990) and & (additive conAndreoli and Pareschi use LO clauses with occurrences of junction) in their body to express what they called external and internal concurrency. Additive conjunction can be used, in fact, to simulate independent threads of execution running in parallel. In our previous work (Bozzano et al. 2002), we made a first attempt to connect techniques used for the validation of Petri Nets with evaluation strategies of LO programs. Specifically, in (Bozzano et al. 2002) we defined an effective procedure to compute the set of linear logic goals (multisets of atomic formulas) that are consequences of a given propositional program, i.e., a “bottom-up” evaluation procedure for propositional LO programs. Our construction is based on the backward reachability algorithm of (Abdulla et al. 1996) used to decide the so called control state reachability problem of Petri Nets (i.e., the problem of deciding if a given set of upward closed configurations are reachable from an initial one). The algorithm works as follows. Starting from a set of target states, the algorithm computes symbolically the transitive closure of the predecessor relation (i.e., the transition relation read backwards) of the Petri Net taken into consideration. The algorithm is used to check safety properties: if the algorithm is executed starting from the set of unsafe states, then the corresponding safety property holds if and only if the initial marking is not in the resulting fixpoint. In order to illustrate the connection between backward reachability for Petri Nets and provability in LO, we first observe that LO program clauses of the form & & & p q q ◦− ⊤ succeed in any context containing at least one occurrence of p and two occurrences of q. In other words they can be used to symbolically represent sets of markings that are closed upwards with respect to the multiset inclusion relation. Now, suppose we represent a Petri Net via an LO program P and the set of target states using a collection T of LO program clauses with ⊤ in the body. Then, the set of facts (i.e., multisets of atomic formulas) that are logical consequences of the LO program P ∪ T will represent the set of markings that are backward reachable from the target states. The algorithm we presented in (Bozzano et al. 2002) is based on this idea, and it extends the backward reachability algorithm for Petri Nets of (Abdulla et al. 1996) 4 M. Bozzano, G. Delzanno and M. Martelli to the more general case of propositional LO programs (i.e., with nested conjunctive and disjunctive goals). First Order Linear Logic By lifting the logic language to first order, the resulting specification language becomes much more interesting and flexible than basic Petri Nets. In the extended setting, the logic representation of processes can be enriched with a notion of internal state and with communication mechanisms in which values can be passed between different processes. As an example, the following LO clause & idle(Y ) p(alice, wait , stored (Y )) ◦− p(alice, use, stored (Y )) can be interpreted as a transaction of a protocol during which the process named Alice (currently knowing Y ) synchronizes with a monitor controlling the resource Y , checks that the monitor is idle and then enters the critical section in which she uses the resource Y . By instantiating the free variables occurring in such a rule, we obtain a family of transition rules that depend on the domain used to define the content of messages. In this setting the universal quantification in goal formulas can be used to generate fresh values, as in the following rule: & init ◦− ∀x· idle(x ) init Intuitively, the demon process init creates new resources labeled with fresh identifiers. The above illustrated connection between provability and reachability immediately gives us a well-founded manner of extending the algorithmic techniques used for the analysis of Petri Nets to the general case of first order linear logic specifications. Our Contribution The conceptual and technical contributions of our work can be summarized as follows. (1) Combining ideas coming from the semantics of logic programming (Bossi et al. 1994; Falaschi et al. 1993) and from symbolic model checking for infinite state systems (Abdulla et al. 1996; Finkel and Schnoebelen 2001), in this paper we present the theoretical foundations for the definition of a procedure for the bottom-up evaluation of first order LO programs with universally quantified goals. By working in the general setting of linear logic, we obtain a framework that can be applied to other specification languages for concurrent systems like multiset rewriting over first order atomic formulas (Cervesato et al. 1999). The bottom-up evaluation procedure can also be viewed as a fixpoint semantics that allows us to compute the set of all goals that are linear logical consequences of a given (extended) LO program. The fixpoint semantics is based on an effective fixpoint operator and on a symbolic and finite representation of an infinite collection of first order provable LO goals. As previously mentioned, the possible infiniteness of the set of provable goals is due to LO program clauses with the constant ⊤, which represent sets of goals which are upward-closed with respect to the multiset inclusion relation. The symbolic Model Checking Linear Logic Specifications 5 representation is therefore crucial when trying to prove properties of infinite systems like parameterized systems, i.e., systems in which the number of individual processes is left as a parameter of the specification (e.g., mutual exclusion protocols for multi-agent systems (Bozzano 2002)). Intuitively, such a representation is obtained by restricting our attention to logical consequences represented via multisets of first order atomic formulas. As an example, the formula & p(A, use, stored (X )) p(B , use, stored (X )) ◦− ⊤ can be used to denote all multisets of ground atomic formulas containing an instance of the clause head. As the constant ⊤ is provable in any context, in the previous example we obtain a symbolic representation of the infinite set of unsafe states generated by the following minimal violation of mutual exclusion for a generic resource represented via the shared variable X : at least two different processes are in their critical section using a shared resource. (2) Besides the connection with verification of concurrent systems, the new fixpoint semantics for first order LO programs represents an alternative to the traditional top-down execution of linear logic programs studied in the literature (Andreoli 1992). Thus, also from the point-of-view of logic programming, we extend the applicability of our previous work (Bozzano et al. 2002) (that was restricted to the propositional case) towards more interesting classes of linear logic programs. (3) The termination of the fixpoint computation cannot be guaranteed in general; first order LO programs are in fact Turing complete. However, we present here sufficient conditions under which we can compute a symbolic representation of all logical consequences of a non trivial first order fragment of LO with universal quantification in goal formulas. As a direct consequence of this result, we obtain that provability is decidable in the considered fragment. To our knowledge, this result uncovers a new decidable fragment of first order linear logic. The fragment taken into consideration is not only interesting from a theoretical point of view, but also as a possible abstract model for “processes” with identifiers or local values. Though the emphasis of this work is on the theoretical grounds of our method, we will illustrate the practical use of our framework with the help of a verification problem for a mutual exclusion protocol defined for a concurrent system which is parametric in the number of clients, resources, and related monitors. Other practical applications of this method are currently under investigation. Preliminary results in this direction are shown in the PhD thesis of Marco Bozzano (Bozzano 2002). Finally, we remark that a very preliminary version of this work appeared in the proceedings of FLOPS 2001 (Bozzano et al. 2001). 1.1 Outline of the Paper The terminology and some notations used in the paper are presented in Appendix Appendix A. To improve the readability of the paper, the proofs of some lem- 6 M. Bozzano, G. Delzanno and M. Martelli mas are given in Appendix Appendix B. In Section 2, we will discuss related works. In Section 3 we will recall the main definitions of the fragment LO of (Andreoli and Pareschi 1990), presented here with universal quantification in goal formulas. In order to illustrate the use of LO as a specification logic for concurrent systems, in the same section we will briefly describe how multiset rewriting (extended with quantification) can be embedded into LO. This connection represents a natural entry point into the world of concurrency. In fact, the relationship between multiset rewriting, (Colored) Petri Nets, and process calculi has been extensively studied in the literature (see e.g., (Cervesato 1995; Farwer 1999; Farwer 2000; Meseguer 1992; Martı́-Oliet and Meseguer 1991)). Finally, we will present an example of use of LO as a specification language for concurrent systems, and discuss the relationships between (bottom-up) LO provability and verification techniques based on (infinite-state) model checking. In Section 4, we will introduce a non effective fixpoint semantics for linear logic programs. To simplify the manipulation of non ground terms, we will first lift the top-down (proof theoretical) semantics of LO to the non ground level, by introducing a new proof system in which sequents may have formulas with free variables. In Section 5, we will introduce a general framework for the bottom-up evaluation of LO programs. The bottom-up procedure is based on a finite representation of infinite sets of logical consequences, and on an effective fixpoint operator working on sets of symbolic representations. The bottom-up procedure can be seen as a symbolic version of the semantics presented in Section 4. The reason for introducing two different semantic definitions is to ease the proof of soundness and completeness, which is split into the proof of equivalence of the effective semantics with respect to the non-effective one, and the proof of equivalence of the non-effective semantics with respect to the operational one. In Section 6, we will investigate sufficient conditions for the termination of the bottom-up evaluation. In Section 7, we will discuss the possible application of the resulting method as a verification procedure for infinite-state parameterized systems. In Section 8, we will address possible future directions of research. In Section 9, we will address some conclusions. 2 Related Works To our knowledge, our work is the first attempt to connect algorithmic techniques used in symbolic model checking with declarative and operational aspects of first order linear logic programming. In (Bozzano et al. 2002), we have considered the relation between propositional LO and Petri Nets. Specifically, in (Bozzano et al. 2002) we have shown that the bottom-up semantics is computable for propositional LO programs (because of the relationship of this problem with the coverability problem of Petri Nets). Furthermore, in (Bozzano et al. 2002) we have shown that the bottom-up evaluation of propositional LO programs enriched with the constant 1 is not computable in a finite number of steps (otherwise one could decide the equivalence problem for Petri Nets). We point out here that an original contribution of the paper consists in extending the construction we used for proving the computability of the bottom-up construc- Model Checking Linear Logic Specifications 7 tion of propositional LO programs to first order LO specifications. This way, we have established a link with more complex models of concurrency. Clearly, in the first order case provability becomes undecidable. In the paper we present a non trivial special case of first order LO programs in which the bottom-up semantics is still computable. Extending the bottom-up evaluation to LO programs enriched with the constant 1 is a possible future direction of research (see Section 8 for a discussion). In (Harland and Winikoff 1998), Harland and Winikoff present an abstract deductive system for bottom-up evaluation of linear logic programs. The left introduction plus weakening and cut rules are used to compute the logical consequences of a given formula. Though the framework is given for a more general fragment than LO, it does not provide an effective procedure to evaluate programs. In (Andreoli et al. 1997), Andreoli, Pareschi and Castagnetti define an improved top-down strategy for propositional LO based on the Karp-Miller’s covering graph of Petri Nets, i.e., a forward exploration with accelerations. The relation between Rewriting, (Colored) Petri Nets and Linear Logic has been investigated in previous works like (Cervesato 1994; Cervesato 1995; Engberg and Winskel 1990; Meseguer 1992; Martı́-Oliet and Meseguer 1991). Our point-of-view is based on the proofs as computations metaphor proposed in (Andreoli and Pareschi 1990; Andreoli 1992; Miller 1996), whereas our connection with models for concurrency is inspired to works in this field like (Cervesato 1994; Cervesato 1995; Delzanno and Martelli 2001; Kobayashi and Yonezawa 1994; Miller 1993; Miller 1996). As an example, in (Cervesato 1994; Cervesato 1995), Cervesato shows how to encode Petri Nets in different fragments of linear logic like LO, Lolli (Hodas and Miller 1990), and Forum (Miller 1996) exploiting the different features of these languages. Algorithmic aspects for verification of properties of the resulting linear logic specifications are not considered in the works mentioned above. In (Farwer 1999; Farwer 2000), Farwer presents a possible encoding of Colored Petri Nets in Linear Logic and proposes a combination of the two formalisms that could be used to model object systems. The problem of the decidability of provability in fragments of linear logic has been investigated in several works in recent years (Lincoln 1995; Lincoln et al. 1992; Lincoln and Scedrov 1994). Specifically, in (Kopylov 1995), Kopylov has shown that the full propositional linear affine logic containing all the multiplicatives, additives, exponentials, and constants is decidable. Affine logic can be viewed as linear logic with the weakening rule. Propositional LO belongs to such a sub-structural logic. Provability in full first order linear logic is undecidable as shown by Girard’s translation of first order logic into first order linear logic (Girard 1987). The same holds for first order affine logic (Girard’s encoding can also be viewed as an encoding into affine logic (Lincoln 1995)). First order linear logic without modalities, i.e., without the possibility of re-using formulas, is decidable (Lincoln and Scedrov 1994). In (Cervesato et al. 1999), Cervesato et al. use a formalism based on multiset-rewriting and existential quantification that can be embedded into our fragment of linear logic to specify protocol rules and actions of intruders. In (Durgin et al. 1999), it is shown that reachability in multiset rewriting with existential quantification is undecidable by a reduction from Datalog with quantification in goal formulas. The 8 M. Bozzano, G. Delzanno and M. Martelli fragment they consider however is much more general than the monadic fragment of LO∀ . Monadic LO∀ can be viewed as a fragment of first order linear affine logic with restricted occurrences of the exponentials (program clauses are re-usable) and severe restrictions on the form of atomic formulas. We are not aware of previous results on similar fragments. 3 The Logic Programming Language LO LO (Andreoli and Pareschi 1991) is a logic programming language based on a fragment of LinLog (Andreoli 1992). Its mathematical foundations lie on a prooftheoretical presentation of a fragment of linear logic defined over the linear connectives −◦ (linear implication, we use the reversed notation H ◦− G for G −◦ H ), & (multiplicative disjunction), and the constant ⊤ (additive (additive conjunction), identity). In this section we present the proof-theoretical semantics, corresponding to the usual top-down operational semantics for traditional logic programming languages, for an extension of LO. First of all, we consider a slight extension of LO which admits the constant ⊥ in goals and clause heads. More importantly, we allow the universal quantifier to appear, possibly nested, in goals. This extension is inspired by multiset rewriting with universal quantification (Cervesato et al. 1999). The resulting language will be called LO∀ hereafter. Following (Andreoli and Pareschi 1991), we give the following definitions. & Definition 3.1 (Atomic Formulas) Let Σ be a signature with predicates including a set of constant and function symbols L and a set of predicate symbols P, and let V be a denumerable set of variables. An atomic formula over Σ and V has the form p(t1 , . . . , tn ) (with n ≥ 0), where p ∈ P and t1 , . . . , tn are (non ground) terms in TΣV . We denote the set of such atomic formulas as AV Σ. We are now ready to define LO∀ programs. The class of D-formulas correspond to multiple-headed program clauses, whereas G-formulas correspond to goals to be evaluated in a given program. Definition 3.2 (LO∀ programs) Let Σ be a signature with predicates and V a denumerable set of variables. The classes of G-formulas (goal formulas), H-formulas (head formulas), and D-formulas (program clauses) over Σ and V are defined by the following grammar: G | G & G | ∀x· G | A | ⊤ | ⊥ ... & & H ::= A & G ::= G A | ⊥ D ::= H ◦− G | D & D | ∀x· D where A stands for an atomic formula over Σ and V. An LO∀ program over Σ and V is a D-formula over Σ and V. A multiset of goal formulas will be called a context hereafter. Model Checking Linear Logic Specifications 9 Remark 3.3 Given an LO∀ program P , in the rest of the paper we often find it convenient to view P as the set of clauses D1 , . . . , Dn . Every program clause Di has the form ∀ (H ◦− G) standing for ∀x1 . . . xk . (H ◦− G), where F V (H ◦− G) = {x1 , . . . , xk }. Formally, this is justified by the following logical equivalences (Girard 1987): !(D1 & D2 ) ≡ !D1 ⊗ !D2 ∀x· (D1 & D2 ) ≡ ∀x· D1 & ∀x· D2 For the sake of simplicity, in the following we usually omit the universal quantifier in D-formulas, i.e., we consider free variables as being implicitly universally quantified. Definition 3.4 (LO∀ Sequents) Let Σ be a signature with predicates and V a denumerable set of variables. An LO∀ sequent has the form P ⊢ Σ′ G1 , . . . , Gk , where P is an LO∀ program over Σ and V, G1 , . . . , Gk is a context (i.e., a multiset of goals) over Σ and V, and Σ′ is a signature such that Σ ⊆ Σ′ . According to Remark 3.3, structural rules (exchange, weakening and contraction) are allowed on the left-hand side, while on the right-hand side only the rule of exchange is allowed (for the fragment under consideration, it turns out that the rule of weakening is admissible, while contraction is forbidden). We now define provability in LO∀ . Definition 3.5 (Ground Instances) Let Σ be a signature with predicates and V a denumerable set of variables. Given an LO∀ program P over Σ and V, the set of ground instances of P , denoted Gnd(P ), is def defined as follows: Gnd(P ) = {(H ◦−G) θ | ∀ (H ◦−G) ∈ P }, where θ is a grounding substitution for H ◦− G (i.e., it maps variables in F V (H ◦− G) to ground terms in TΣ ). The execution of a multiset of G-formulas G1 , . . . , Gk in P corresponds to a goaldriven proof for the sequent P ⊢ Σ G1 , . . . , Gk . According to this view, the operational semantics of LO∀ is given via the uniform (focusing) (Andreoli 1992) proof system presented in Figure 1, where P is a set of clauses, A is a multiset of atomic b , where formulas, and ∆ is a multiset of G-formulas. We have used the notation H H is a linear disjunction of atomic formulas A1 . . . An , to denote the multiset b = ǫ, where ǫ is the empty multiset). A1 , . . . , An (by convention, ⊥ & & Definition 3.6 (LO∀ provability) Let Σ be a signature with predicates and V a denumerable set of variables. Given an LO∀ program P and a goal G, over Σ and V, we say that G is provable from P if there exists a proof tree, built over the proof system of Figure 1, with root P ⊢Σ G, and such that every branch is terminated with an instance of the ⊤r axiom. & The concept of uniformity applied to LO requires that the right rules ⊤r , r, & r , ⊥r , ∀r have priority over bc, i.e., bc is applied only when the right-hand side of a sequent is a multiset of atomic formulas (as suggested by the notation A in M. Bozzano, G. Delzanno and M. Martelli P ⊢Σ G1 , G2 , ∆ P ⊢Σ ∆ P ⊢Σ ⊥, ∆ P ⊢Σ G1 & P ⊢Σ ⊤, ∆ ⊤r & 10 G2 , ∆ P ⊢Σ G1 , ∆ r P ⊢Σ G1 & G2 , ∆ &r P ⊢Σ G, A P ⊢Σ,c G[c/x ], ∆ ⊥r P ⊢Σ G2 , ∆ bc (H ◦− G ∈ Gnd(P )) ∀r (c 6∈ Σ) b,A P ⊢Σ H P ⊢Σ ∀x· G, ∆ Fig. 1. A proof system for LO∀ Figure 1). The proof system of Figure 1 is a specialization of more general uniform proof systems for linear logic like Andreoli’s focusing proofs (Andreoli 1992) and Forum (Miller 1996). Rule bc is analogous to a backchaining (resolution) step in traditional logic programming languages. Note that according to the concept of resolution explained above, bc can be executed only if the right-hand side of the current LO∀ sequent consists of atomic formulas. As an instance of rule bc, we get the following proof fragment, which deals with the case of clauses with empty head: .. .. P ⊢Σ A, G P ⊢Σ A bc provided ⊥ ◦− G ∈ Gnd(P ) Given that clauses with empty head are always applicable in atomic contexts, the degree of non-determinism they introduce in proof search is usually considered unacceptable (Miller 1996) and in particular they are forbidden in the original presentation of LO (Andreoli and Pareschi 1991). However, the computational model we are interested in, i.e., bottom-up evaluation, does not suffer this drawback. Clauses with empty head often allow more flexible specifications. LO clauses having the form H ◦− ⊥ simply remove the resources associated with H from the right-hand side of the current sequent (H is rewritten into the empty multiset). On the contrary, LO clauses having the form H ◦− ⊤ can be viewed as termination rules. In fact, when a backchaining step over such a clause is possible, we get a successful (branch of a) computation, independently of the current context A, as shown in the following proof scheme: P ⊢Σ ⊤, A b,A P ⊢Σ H ⊤r bc provided H ◦− ⊤ ∈ Gnd(P ) This observation is formally stated in the following proposition (we recall that 4 is the multiset inclusion relation). Proposition 1 (Admissibility of the Weakening Rule) Given an LO∀ program P and two multisets of goals ∆, ∆′ such that ∆ 4 ∆′ , if P ⊢Σ ∆ then P ⊢Σ ∆′ . Model Checking Linear Logic Specifications 11 Proof By simple induction on the structure of LO∀ proofs. Admissibility of the weakening rule makes LO∀ an affine fragment of linear logic (Kopylov 1995). Note that all structural rules are admissible on the left hand side (i.e., on the program part) of LO∀ sequents. Finally, rule ∀r can be used to dynamically introduce new names during the computation. The initial signature Σ must contain at least the constant, function, and predicate symbols of a given program P , and it can dynamically grow thanks to rule ∀r . Remark 3.7 Particular attention must be paid to the constants introduced in a derivation. They cannot be extruded from the scope of the corresponding universal quantifier. For this reason, every time rule ∀r is applied, a new constant c is added to the current signature, and the resulting goal is proved in the new signature. The idea is that all terms appearing on the right-hand side of a sequent are implicitly assumed to range over the relevant signature. This behavior is standard in logic programming languages (Miller et al. 1991). Example 3.8 Let Σ be a signature with a constant symbol a, a function symbol f and predicate symbols p, q, r , s. Let V be a denumerable set of variables, and u, v , w , . . . ∈ V. Let P be the program 1. r (w ) ◦− q(f (w )) s(w ) & 2. s(z ) ◦− ∀x· p(f (x )) 3. ⊥ ◦− q(u) & r (v ) & 4. p(x ) q(x ) ◦− ⊤ The goal s(a) is provable from P . The corresponding proof is shown in Figure 2 (where we have denoted by bc (i) the application of the backchaining rule over clause number i of P ). Note that the notion of ground instance is now relative to the current signature. For instance, backchaining over clause 3 is possible because the corresponding signature contains the constant c (generated one level below by the ∀r rule), and therefore ⊥ ◦− q(f (c)) & r (c) is a valid instance of clause 3.  3.1 Simulating Multiset Rewriting over First Order Atoms In this section we will focus our attention on the relationship between multiset rewriting over first order atoms and first order LO theories. We will conclude by showing how enriching logic theories with universal quantification can provide a way to generate new values. The connection between multiset rewriting systems over (first order) atomic formulas and (first order) LO theories has been studied, e.g., in (Cervesato 1994; Cervesato et al. 1999). In (Cervesato 1994) Cervesato presents different possible 12 M. Bozzano, G. Delzanno and M. Martelli ⊤r P ⊢Σ,c ⊤, s(c) ⊤r P ⊢Σ,c p(f (c)), q(f (c)) P ⊢Σ,c p(f (c)), q(f (c)) bc (4) & P ⊢Σ,c ⊤ bc (4) & P ⊢Σ,c p(f (c)), q(f (c)), s(c) r s(c) bc (1) P ⊢Σ,c p(f (c)), r (c) &r P ⊢Σ,c p(f (c)), q(f (c)) & r (c) bc (3) P ⊢Σ,c p(f (c)) ∀r P ⊢Σ ∀x· p(f (x )) P ⊢Σ s(a) bc (2) Fig. 2. An example of LO∀ proof encodings of multiset rewriting (without function symbols) in linear logic. Specifically, he first presents an encoding in the multiplicative fragment of intuitionistic linear logic (MILL), where multiplicative conjunction ⊗ (“tensor”) and linear implication are used as multiset constructor and rewrite relation, respectively. As an example, the formula p ⊗ q −◦ r ⊗ s represents a rewrite rule in which p and q are rewritten into r and s (⊗ denotes the “tensor”). As highlighted in Remark 5.12 of (Cervesato 1994) an equivalent encoding can be given by choosing a fragment of classical linear logic contained in LO in which multiplicative disjunction and reverse linear implication are used as multiset constructor and rewrite relation, respectively. As an example, the formula p q ◦−r s represents a rewrite rule in which p and q are rewritten into r and s. This is the encoding we will adopt in our work. The duality of the two encodings is a consequence of the following property: (p ⊗ q −◦ r ⊗ s)⊥ ≡ p ⊥ q ⊥ ◦− r ⊥ s ⊥ , where a ⊥ is the linear logic negation of a. Furthermore, it depends on the way proofs are interpreted as computations, i.e., on whether “rewrite rules” are encoded as formulas that occur on the left- or on the right-hand side of a sequent. In Section 5.2.2 of (Cervesato 1994) Cervesato also presents an encoding of Petri Nets in LO that allows one to simulate the execution of a net using an LO topdown derivation of the resulting program. In Section 5 of (Cervesato et al. 1999) the encoding of multiset rewriting over first order atomic formulas (MSR) is extended to first order MILL with existential quantifiers. Thanks to its logical nature, the duality with the first order fragment of LO still holds. To illustrate the main ideas behind the interpretation of LO as multiset rewriting, let us first define the following class of LO formulas. & & & An ◦− B1 & & ... ... & & ∀(A1 Bm ) & Definition 3.9 We call LO rewrite rule any LO formula having the following form Model Checking Linear Logic Specifications P ⊢Σ p(a), p(f (f (b))), q(b), q(b), q(f (f (b))) .. .. r P ⊢Σ p(a) p(f (f (b))) q(b) q(b) q(f (f (b))) 13 & & {p(a), p(f (f (b))), q(b), q(b), q(f (f (b)))} & & & bc ↑ P ⊢Σ p(a), p(f (b)), q(b), q(f (b)) . .. r . & & p(f (b)) q(b) & & P ⊢Σ p(a) {p(a), p(f (b)), q(b), q(f (b))} q(f (b)) ↑ bc P ⊢Σ p(a), p(b), q(f (b)) . .. r . {p(a), p(b), q(f (b))} & p(b) & & P ⊢Σ p(a) q(f (b)) Derivation Rewriting Fig. 3. Multiset rewriting over first order atomic formulas as LO proof construction where A1 , . . . , An and B1 , . . . , Bm are atomic formulas over Σ and V. As usual, the notation ∀ (H ◦− G) stands for the universal quantification of clause H ◦− G over its free variables. LO formulas having the form depicted above can be interpreted as multiset rewriting rules in which rewriting can be performed only at the level of atomic formulas as in the MSR framework defined in (Cervesato et al. 1999). Specifically, let P be a set of LO rewrite rules (as in Def. 3.9). Now, consider a goal formula G having the form C1 . . . Ck where C1 , . . . , Ck are ground atomic formulas over Σ. It is easy to verify that any derivation starting from P ⊢Σ G and built using LO proof rules amounts to a sequence of multisets rewriting steps, where is interpreted as multiset constructor. & & & Example 3.10 Let Σ be a signature with two constant symbols a and b, one function symbol f and two predicate symbols p, q. Let V be a denumerable set of variables and x , y ∈ V. Let P consists of the LO clause & q(f (y)) ◦− p(f (x )) q(y) & & ∀x , y. p(x ) q(f (x )) & & and G = p(a) p(b) q(f (b)). Figure 3 shows one possible sequence of applications of the above clause that starts from the sequent P ⊢Σ G (we have underlined atomic formulas selected in the application of the bc rule).  From the previous example, we can observe the following properties. All derivations built using LO rewrite rules of Def. 3.9 consist of applications of r and bc. Thus, they have no branching (all derivations form a single line). The combination of a sequence of applications of the r rule and of the backchaining rule has the following effect: the head of a ground instance of a rule in P is matched against a sub-multiset in the current goal; the selected multiset is replaced by the body of the rule. Clearly, this property allows us to simulate multiset rewriting over first order atomic formulas by using LO rewrite rules. & & 14 M. Bozzano, G. Delzanno and M. Martelli Now, let F1 be the clause q(b) & & p(f (f (b))) q(b) & & p(a) q(f (f (b))) ◦− ⊤ If we enrich P with F1 , then we can transform the partial derivation of Figure 3 into an LO proof as shown below (where δ stands for the derivation fragment of Figure 3): P ⊢Σ ⊤ δ ⊤r bc It is important to note that the same effect can be achieved by adding any formula with ⊤ that contains a sub-multiset of the right-hand side of the last sequent in the derivation of Figure 3. As an example, let F2 be the formula & p(a) q(b) ◦− ⊤ If we enrich P with F2 , then we can transform the partial derivation of Figure 3 into an LO proof as shown below (again, δ stands for the derivation fragment of Figure 3): P ⊢Σ ⊤, p(f (f (b))), q(b), q(f (f (b))) δ ⊤r bc More in general, let P be a set of LO rewrite rules over Σ and V, and M, M′ two multisets of ground atomic formulas (two configurations). Furthermore, let H , G the b = M′ and (possibly empty) -disjunctions of ground atomic formulas such that H b G = M. Then, the provability of the sequent P , H ◦− ⊤ ⊢ G precisely characterizes the problem of coverability for the multiset (configuration) M′ , namely P , H ◦− ⊤ ⊢ G is provable if and only if there exists a sequence of multiset rewriting steps defined over the theory P that, starting from M, reaches a configuration N that covers M′ , i.e., such that M′ 4 N . This is a straightforward consequence of the properties of clauses like H ◦− ⊤ (it succeeds only if a sub-multiset of the right-hand side of the current sequent matches b ) and of the fact that, when working with LO rewrite rules, derivations have no H branching. In other words the only way we can transform a partial derivation like the one in Figure 3 into a proof is to apply (once and only once since derivations form a single line) the clause with ⊤ (i.e., the target configuration is reached). Coverability is strictly related to the verification problem of safety properties for concurrent systems (Abdulla et al. 1996; Finkel and Schnoebelen 2001). For instance, as shown in (Bozzano et al. 2002), this property allows one to describe properties like coverability for a marking of a Petri Net. In Section 3.3, we will show how to exploit this property in the more general case of first order specifications. In Section 8 we will discuss a possible characterization of reachability for two configurations using derivability in an extension of LO. We conclude this section by discussing how universal quantification can be used in order to enrich the expressiveness of LO rewrite rules. & Model Checking Linear Logic Specifications 15 The Role of Universal Quantification In the proofs as computations interpretation of logic programs, universal quantification is a logical operator which provides a way to generate new values. From a logical perspective, this view of universal quantification is based on its proof-theoretical semantics in intuitionistic logic (Miller et al. 1991). We will define first order rewrite rules with universal quantification taking inspiration from (Cervesato et al. 1999), where a similar logic fragment, called MSR, is defined. In (Cervesato et al. 1999), MSR is used for the specification and analysis of security protocols. Given the direct relationship between (first order) multiset rewriting and (first order) linear logic, it should be evident that multiset rewriting with universal quantification is the counterpart of LO with universal quantification. Having this idea in mind, we extend the notion of LO rewrite rule as follows. Definition 3.11 We call LO quantified rewrite rule any LO formula having the following form An ◦− ∀x1 , . . . , xn · (B1 & & ... ... & & ∀(A1 Bm )) where A1 , . . . , An and B1 , . . . , Bm are atomic formulas over Σ and V. The operational semantics of LO theories consisting of LO quantified rewrite rules should be clear by looking at the LO proof rule for universally quantified goal formulas: they are eliminated by introducing new constants. This operational behavior naturally corresponds to the extension of multiset rewriting with fresh name generation defined in (Cervesato et al. 1999). Remark 3.12 As mentioned at the beginning of this section, we remark that in (Cervesato et al. 1999) the logic MSR is compared with a fragment of linear logic which turns out to be dual with respect to ours, and therefore existential quantification is used in place of universal quantification. Specifically, an MSR rule is defined as A −◦ ∃x . B , meaning that A evolves into B by creating a new name for x . In LO with universal quantification the same effect is obtained via the clause A ◦− ∀x . B . In fact, in the goal driven proof system of LO a computation step is obtained by resolution (i.e., reducing the conclusion of a clause to its premise). The reader may refer to (Cervesato 1994; Cervesato 1995; Cervesato et al. 1999; Cervesato et al. 2000) for a more formal treatment of the relationship between multiset rewriting and LO. 3.2 Specification of Concurrent Systems The connection with multiset rewriting allows us to think about LO as a specification language for concurrent systems. We will illustrate this idea with the help of the following example. We consider here a distributed test-and-lock protocol for a net with multiple resources, each of which is controlled by a monitor. The protocol is as follows. A set of resources, distinguished by means of resource identifiers, and an arbitrary set of processes are given. Processes can nondeterministically request access to any resource. Access to a given resource must be 16 M. Bozzano, G. Delzanno and M. Martelli exclusive (only one process at a time). Mutual exclusion is enforced by providing each resource with a semaphore. Given a propositional symbol init , we can encode the initial states of the system as follows: 1. init ◦− init think & & 2. init ◦− init m(x , unlocked ) 3. init ◦− ⊥ The atom think represents a thinking (idle) process, while the first order atom m(x , s) represents a monitor for the resource with identifier x and associated semaphore s. The semaphore s can assume one of the two values locked or unlocked . Clause 1 and clause 2 can modify the initial state by adding, respectively, an arbitrary number of thinking processes and an arbitrary number of resources (with an initially unlocked semaphore). Finally, using clause 3 the atom init can be removed after the initialization phase. The core of the protocol works as follows: 4. think ◦− wait (x ) 5. wait (x ) ◦− think m(x , locked ) ◦− think & & & 7. use(x ) m(x , unlocked ) ◦− use(x ) & 6. wait (x ) m(x , locked ) m(x , unlocked ) Using clause 4, a process can non-deterministically request access to any resource with identifier x , moving to a waiting state represented by the atom wait (x ). Clause 5 allows a process to go back to thinking from a waiting state. By clause 6, a waiting process can synchronize with the relevant monitor and is granted access provided the corresponding semaphore is unlocked. As a result, the semaphore is locked. The atom use(x ) represents a process which is currently using the resource with identifier x . Clause 7 allows a process to release a resource and go back to thinking, unlocking the corresponding semaphore. Remark 3.13 In the previous specification we have intentionally introduced a flaw which we will disclose later (see Section 7). Uncovering of this flaw will allow us to explain and better motivate the use of the universal quantifier for the generation of new names. 3.3 Linear Logic and Model Checking One of the properties we would like to establish for the specification given in the previous example is that it ensures mutual exclusion for any resource used in the system. One of the difficulties for proving this kind of properties is that the specification taken into consideration has an infinite number of possible configurations (all possible rewritings of the goal init ). In this paper we will define techniques that can be used to attack this kind of verification problems by exploiting an interesting connection between verification and bottom-up evaluation of LO programs. Model Checking Linear Logic Specifications Infinite State Concurrent Systems Linear Logic Specification transition system transition current state initial state upward-closed set of states forward reachability backward reachability LO program and proof system rule instance goal formula initial goal LO clause with ⊤ top-down provability bottom-up provability 17 Fig. 4. Reachability versus provability Let us consider again the protocol specification given in Example 3.2. The mutual exclusion property can be formulated as the following property over reachable configurations. Let S be the set of multiset of atomic formulas (i.e., a configuration) reachable in any derivation from the goal init . The protocol ensures mutual exclusion for resource x if and only if for any A ∈ S , i.e., any reachable configuration, {use(x ), use(x )} is not a sub-multiset of A. In other words, all goal formulas containing two occurrences of the formula use(x ) represent possible violations of mutual exclusion for resource x . Following from the previous observation, a possible way of proving mutual exclusion for our sample protocol is to show that no configurations having the form {use(x ), use(x ), . . .} can be reached starting from the initial states. This verification methodology can be made effective using a backward exploration of a protocol specification as described in (Abdulla et al. 1996). Specifically, the idea is to saturate the set of predecessor configurations (i.e., compute all possible predecessor configurations of the potential violations) and then check that no initial state occurs in the resulting set. This verification strategy can be reformulated in a natural way in our fragment of linear logic. First of all, LO formulas with the ⊤ constant can be used to finitely represent all possible violations as follows: & def U = ∀x· use(x ) use(x ) ◦− ⊤ Backward reachability amounts then to compute all possible logical consequences of the LO specification of the protocol and of the formula U . In logic programming this strategy is called bottom-up provability. If the goal init is in the resulting set, then there exists an execution (derivation) terminated by an instance of the axiom ⊤ that leads from init to a multiset of the form use(x ), use(x ), A for some x and some multiset of atomic formulas A. Thus, the use of clauses with ⊤ to represent violations (and admissibility of weakening) allows us to reason independently of the number of processes in the initial states. Following (Abdulla et al. 1996), formulas like ∀x . use(x ) use(x ) ◦− ⊤ can be viewed as a symbolic representation of upwardclosed sets of configurations. On the basis of these observations, the relationship between reachability and derivability sketched in the previous sections can be extended as shown in Figure 4. & 18 M. Bozzano, G. Delzanno and M. Martelli In order to exploit this connection and extend the backward reachability strategy in the rest of the paper we will define a bottom-up semantics for first order LO programs. We will define our semantics via a fixpoint operator similar to the TP operator used for logic programs. The fixpoint semantics will give us an effective way to evaluate bottom-up an LO program, and thus solve verification problems for infinite-state concurrent systems as the one described in this section. 4 A Bottom-up Semantics for LO∀ The proof-theoretical semantics for LO∀ corresponds to the top-down operational semantics based on resolution for traditional logic programming languages like Prolog. In this paper we are interested in finding a suitable definition of bottom-up semantics that can be used as an alternative operational semantics for LO∀ programs. More precisely, we will define an effective and goal-independent procedure to compute all goal formulas which are provable from a given program P . This semantics extends the one described in (Bozzano et al. 2002), which was limited to propositional LO programs. In the following, given an LO∀ program P , we denote by ΣP the signature comprising the set of constant, function, and predicate symbols in P . 4.1 Non-ground Semantics for LO∀ Before discussing the bottom-up semantics, we lift the definition of operational semantics to LO∀ programs. Following (Bozzano et al. 2002), we would like to define the operational semantics of a program P as the set of multisets of atoms which are provable from P . This could be done by considering the ground instances of LO∀ program clauses (see Definition 3.5). However, in presence of universal quantification in goals, this solution is not completely satisfactory. Consider, in fact, the following example. Take a signature with a predicate symbol p and two constants a and b, and consider the LO∀ program consisting of the axiom ∀x· p(x ) ◦− ⊤ and the program consisting of the two clauses p(a) ◦− ⊤ and p(b) ◦− ⊤. The two programs would have the same ground semantics (i.e., consisting of the two singleton multisets {p(a)} and {p(b)}). However, the LO∀ goal ∀x· p(x ) succeeds only in the first program, as the reader can verify. In order to distinguish the two programs, we need to consider the non ground semantics. In particular, our aim in this section will be to extend the so-called C-semantics of (Falaschi et al. 1993) to first order LO. First of all, we give the following definition. Definition 4.1 (Clause Variants) Given an LO∀ program P , the set of variants of clauses in P , denoted V rn(P ), is defined as follows: def V rn(P ) = {(H ◦− G) θ | ∀ (H ◦− G) ∈ P and θ is a renaming of the variables in F V (H ◦− G) with new variables}. Now, we need to reformulate the proof-theoretical semantics of Section 3 (see Model Checking Linear Logic Specifications 19 P ⊢Σ Gθ, A bc (H ◦− G) ∈ V rn(P ) b θ, A P ⊢Σ H Fig. 5. Backchaining rule working over non ground goals Figure 1). According to the C-semantics of (Falaschi et al. 1993), our goal is to define the set of non ground goals which are provable from a given program P with an empty answer substitution. Slightly departing from (Falaschi et al. 1993), we modify the proof system of Figure 1 as follows. Sequents are defined now over non ground goals. The backchaining rule of Figure 1 is replaced by the new rule shown in Figure 5 (where, as usual, A denotes a multiset of atomic formulas). The rightintroduction rules and the axioms are as in Figure 1. This proof system is based on the idea of considering a first order program as the (generally infinite) collection of (non ground) instances of its clauses. By instance of a clause H ◦− G, we mean a clause H θ ◦− Gθ, where θ is any substitution. The reader can see that, with this intuition, the set of goals provable from the system modified with the backchaining rule shown in Figure 5 corresponds to the set of non ground goals which are provable with an empty answer substitution according to (Falaschi et al. 1993). This formulation of the proof system is the proof-theoretical counterpart of the bottom-up semantics we will define in the following. All formulas (and also substitutions) on the right-hand side of the sequents in the proof system obtained from Figure 1 by replacing the backchaining rule with the rule of Figure 5 are implicitly assumed to range over the set of non ground terms over Σ. Every time rule ∀r is fired, a new constant c is added to the current signature, and the resulting goal is proved in the new signature (see Remark 3.7). Rule bc denotes a backchaining (resolution) step, where θ indicates any substitution. For our purposes, we can assume Dom(θ) ⊆ F V (H ) ∪ F V (G) (we remind that F V (F ) denotes the free variables of F ). Note that H ◦− G is assumed to be a variant, therefore it has no variables in common with A. According to the usual concept of uniformity, bc can be executed only if the right-hand side of the current sequent consists of atomic formulas. Rules ⊤r , r , & r and ⊥r are the same as in propositional LO. A sequent is provable if all branches of its proof tree terminate with instances of the ⊤r axiom. Clearly, the proof system obtained by considering the rule of Figure 5 is not effective, however it will be sufficient for our purposes. An effective way to compute the set of goals which are provable from the above proof system will be discussed in Section 5. We give the following definition, where ⊢Σ denotes the provability relation defined by the proof system of Figure 1 in which the backchaining rule has been replaced by the rule of Figure 5. & Definition 4.2 (Operational Semantics) Given an LO∀ program P , its operational semantics, denoted O(P ), is given by def O(P ) = {A | A is a multiset of (non ground) atoms in AV ΣP and P ⊢ΣP A}. 20 M. Bozzano, G. Delzanno and M. Martelli Intuitively, the set O(P ) is closed by instantiation, i.e., Aθ ∈ O(P ) for any substitution θ, provided A ∈ O(P ). Note that the operational semantics only include multisets of (non ground) atoms, therefore no connective (including the universal quantifier) can appear in the set O(P ). However, the intuition will be that the variables appearing in a multiset in O(P ) must be implicitly considered universally quantified (e.g., {p(x ), q(x )} ∈ O(P ) implies that the goal ∀x· (p(x ) q(x )) is provable from P ). Also note that the information on provable facts from a given program P is all we need to decide whether a general goal (possibly with nesting of connectives) is provable from P or not. In fact, according to LO∀ proof-theoretical semantics, provability of a compound goal can always be reduced to provability of a finite set of atomic multisets. & 4.2 Fixpoint Semantics for LO∀ We will now discuss the bottom-up semantics. In order to deal with universal quantification (and therefore signature augmentation), we extend the definitions of Herbrand base and (concrete) interpretations given in (Bozzano et al. 2002) as follows. Let SigP be the set of all possible extensions of the signature ΣP associated to a program P with new constants. The definition of Herbrand base now depends explicitly on the signature, and interpretations can be thought of as infinite tuples, with one element for every signature Σ ∈ SigP . From here on the powerset of a given set D will be indicated as ℘(D ). We give then the following definitions. Definition 4.3 (Herbrand Base) Given an LO∀ program P and a signature Σ ∈ SigP , the Herbrand base of P over Σ, denoted HB Σ (P ), is given by def V HB Σ (P ) = MS(AV Σ ) = {A | A is a multiset of (non ground) atoms in AΣ }. Definition 4.4 (Interpretations) Given an LO∀ program P , a (concrete) interpretation is a family of sets {IΣ }Σ∈Sig P , where IΣ ∈ ℘(HB Σ (P )) for every Σ ∈ SigP . In the following we often use the notation I for an interpretation to denote the family {IΣ }Σ∈Sig P . Interpretations form a complete lattice where inclusion and least upper bound are defined like (component-wise) set inclusion and union. In the following definition we therefore overload the symbols ⊆ and ∪ for sets. Definition 4.5 (Interpretation Domain) Interpretations form a complete lattice hD, ⊆i, where: • • • • D = {I | I is an interpretation}; I ⊆ J if and only if IΣ ⊆ JΣ for every Σ ∈ SigP ; the least upper bound of I and J is {IΣ ∪ JΣ }Σ∈SigP ; the bottom and top elements are ∅ = {∅Σ }Σ∈Sig P and {HB Σ (P )}Σ∈Sig P , respectively. Model Checking Linear Logic Specifications 21 Before introducing the definition of fixpoint operator, we need to define the notion of satisfiability of a context ∆ (a multiset of goal formulas) in a given interpretation I . For this purpose, we introduce the judgment I |=Σ ∆ ◮ C, where I is an input interpretation, ∆ is an input context, and C is an output fact (a multiset of atomic formulas). The judgment is also parametric with respect to a given signature Σ. The need for this judgment, with respect to the familiar logic programming setting (Gabbrielli et al. 1995), is motivated by the arbitrary nesting of connectives in LO∀ clause bodies. The satisfiability judgment is modeled according to the rightintroduction rules of the connectives. In other words, the computation performed by the satisfiability judgment corresponds to top-down steps inside our bottom-up semantics. Intuitively, the parameter C must be thought of as an output fact such that C + ∆ is valid in I . The notion of output fact will simplify the presentation of the algorithmic version of the judgment which we will present in Section 5. The notion of satisfiability is modeled according to the right-introduction (decomposition) rules of the proof system, as follows (we remind that ’+’ denotes multiset union). Definition 4.6 (Satisfiability Judgment ) Let P be an LO∀ program, Σ ∈ SigP , and I = {IΣ }Σ∈Sig P an interpretation. The satisfiability judgment |=Σ is defined as follows: I |=Σ ⊤, ∆ ◮ C for any fact C in AV Σ; I |=Σ A ◮ C if A + C ∈ IΣ ; I |=Σ ∀x· G, ∆ ◮ C if I |=Σ,c G[c/x ], ∆ ◮ C, with c 6∈ Σ (see remark 4.7); I |=Σ G1 & G2 , ∆ ◮ C if I |=Σ G1 , ∆ ◮ C and I |=Σ G2 , ∆ ◮ C; & I |=Σ G1 G2 , ∆ ◮ C if I |=Σ G1 , G2 , ∆ ◮ C; I |=Σ ⊥, ∆ ◮ C if I |=Σ ∆ ◮ C. Remark 4.7 When using the notation I |=Σ ∆ ◮ C we always make the implicit assumption that ∆ is a context defined over Σ (i.e., term constructors in ∆ must belong to Σ). As a result, also the output fact C must be defined over Σ. This assumption, which is the counterpart (see Remark 3.7) of an analogous assumption for proof systems like the one in Figure 1, i.e., with explicit signature notation, will always and tacitly hold in the following. For example, note that in the ∀-case of the |=Σ definition below, the newly introduced constant c cannot be exported through the output fact C. This is crucial to capture the operational semantics of the universal quantifier. The satisfiability judgment |=Σ satisfies the following properties. Lemma 1 For every interpretation I = {IΣ }Σ∈Sig P , context ∆, and fact C, I |=Σ ∆ ◮ C if and only if I |=Σ ∆, C ◮ ǫ. Proof See Appendix Appendix B. 22 M. Bozzano, G. Delzanno and M. Martelli Lemma 2 For any interpretations I1 = {(I1 )Σ }Σ∈Sig P , I2 = {(I2 )Σ }Σ∈SigP , . . . , context ∆, and fact C, i . if I1 ⊆ I2 and I1 |=Σ ∆ ◮ C then I2 |=Σ ∆ ◮ C; S∞ ii . if I1 ⊆ I2 ⊆ . . . and i=1 Ii |=Σ ∆ ◮ C then there exists k ∈ N s.t. Ik |=Σ ∆ ◮ C. Proof See Appendix Appendix B. We are now ready to define the fixpoint operator TP . Definition 4.8 (Fixpoint Operator TP ) Given an LO∀ program P and an interpretation I = {IΣ }Σ∈SigP , the fixpoint operator TP is defined as follows: def TP (I ) = {(TP (I ))Σ }Σ∈Sig P ; b θ + C | (H ◦− G) ∈ V rn(P ), θ is (TP (I ))Σ = {H any substitution, and I |=Σ Gθ ◮ C}. def Remark 4.9 In the previous definition, θ is implicitly assumed to be defined over Σ, i.e., θ can only map variables in Dom(θ) to terms in TΣV . The following property holds. Proposition 2 (Monotonicity and Continuity) For every LO∀ program P , the fixpoint operator TP is monotonic and continuous over the lattice hD, ⊆i. Proof Monotonicity. Immediate from the definition of TP and item i of Lemma 2. Continuity. We prove that TP is finitary, i.e., for any sequence of interpretations I1 ⊆ I2 ⊆ . . . S∞ S∞ S∞ we have that TP ( i=1 Ii ) ⊆ i=1 TP (Ii ), i.e., for every Σ ∈ ΣP , (TP ( i=1 Ii ))Σ ⊆ S∞ S∞ ( i=1 TP (Ii ))Σ . Let A ∈ (TP ( i=1 Ii ))Σ . By definition of TP , there exist a variant b θ + C and H ◦− G of a clause in P , a substitution θ, and a fact C s.t. A = H S∞ ◮ C. By item ii of Lemma 2, we have that there exists k ∈ N s.t. I |= Gθ Σ i=1 i b θ + C ∈ (TP (Ik ))Σ ⊆ Ik |=Σ Gθ ◮ C. Again by definition of TP , we get A = H S∞ ( i=1 TP (Ii ))Σ . Monotonicity and continuity of the TP operator imply, by Tarski’s Theorem, that lfp(TP ) = TP ↑ω . The fixpoint semantics of a program P is then defined as follows. Model Checking Linear Logic Specifications 23 Definition 4.10 (Fixpoint Semantics) Given an LO∀ program P , its fixpoint semantics, denoted F (P ), is defined as follows: def F (P ) = (lfp(TP ))ΣP = (TP ↑ω({∅Σ }Σ∈SigP ))ΣP . We conclude this section by proving the following fundamental result, which states that the fixpoint semantics is sound and complete with respect to the operational semantics (see Definition 4.2). Theorem 1 (Soundness and Completeness) For every LO∀ program P , F (P ) = O(P ). Proof F (P ) ⊆ O(P ). We prove that for every k ∈ N, for every signature Σ ∈ SigP , and for every context ∆, TP ↑k |=Σ ∆ ◮ ǫ implies P ⊢ Σ ∆. The proof is by lexicographic induction on (k , h), where h is the length of the derivation of TP ↑k |=Σ ∆ ◮ ǫ. - If ∆ = ⊤, ∆′ , obvious; - if ∆ = A and A ∈ (TP ↑k )Σ , then there exist a variant H ◦− G of a clause in P , a b θ + C and TP ↑k −1 |=Σ Gθ ◮ C. By Lemma fact C and a substitution θ s.t. A = H ◮ 1, this implies TP ↑k −1 |=Σ Gθ, C ǫ. Then by the inductive hypothesis we have b θ, C, i.e., P ⊢Σ A follows by bc rule; P ⊢Σ Gθ, C, from which P ⊢Σ H - if ∆ = ∀x· G, ∆′ and TP ↑k |=Σ,c G[c/x ], ∆′ ◮ ǫ, with c 6∈ Σ, then by the inductive hypothesis we have P ⊢Σ,c G[c/x ], ∆′ from which P ⊢Σ ∀x· G, ∆′ follows by ∀r rule; - if ∆ = G1 & G2 , ∆′ , TP ↑k |=Σ G1 , ∆′ ◮ ǫ, and TP ↑k |=Σ G2 , ∆′ ◮ ǫ, then by the inductive hypothesis we have P ⊢ Σ G1 , ∆′ and P ⊢ Σ G2 , ∆′ , from which P ⊢ ′ Σ G1 & G2 , ∆ follows by & r rule; - if ∆ = G1 G2 , ∆′ and TP ↑k |=Σ G1 , G2 , ∆′ ◮ ǫ, then by the inductive hypothesis we have P ⊢Σ G1 , G2 , ∆′ , from which P ⊢Σ G1 G2 , ∆′ follows by r rule; - if ∆ = ⊥, ∆′ and TP ↑k |=Σ ∆′ ◮ ǫ, then by the inductive hypothesis we have P ⊢Σ ∆′ , from which P ⊢Σ ⊥, ∆′ follows by ⊥r rule. & & & O(P ) ⊆ F (P ). We prove that for every signature Σ ∈ SigP and for every context ∆, if P ⊢Σ ∆ then there exists k ∈ N s.t. TP ↑k |=Σ ∆ ◮ ǫ. The proof is by induction on the derivation of P ⊢Σ ∆. - If ∆ = ⊤, ∆′ , then for every k ∈ N, TP ↑k |=Σ ∆ ◮ ǫ; b θ, A, with H ◦− G a variant of a clause in P , θ substitution, and P ⊢ - if ∆ = H Σ Gθ, A, then by the inductive hypothesis we have that there exists k ∈ N s.t. TP ↑k |=Σ Gθ, A ◮ ǫ. Then, by Lemma 1, TP ↑k |=Σ Gθ ◮ A. By definition of TP , b θ + A ◮ ǫ; b θ + A ∈ (TP ↑k +1 )Σ , which implies TP ↑k +1 |=Σ H H - if ∆ = ∀x· G, ∆′ and P ⊢Σ,c G[c/x ], ∆′ , with c 6∈ Σ, then by the inductive hypothesis we have that there exist k ∈ N s.t. TP ↑k |=Σ,c G[c/x ], ∆′ ◮ ǫ, from which TP ↑k |=Σ ∀x· G, ∆′ ◮ ǫ follows; 24 M. Bozzano, G. Delzanno and M. Martelli - if ∆ = G1 & G2 , ∆′ , P ⊢Σ G1 , ∆′ and P ⊢Σ G2 , ∆′ , then by the inductive hypothesis we have that there exist k1 , k2 ∈ N s.t. TP ↑k1 |=Σ G1 , ∆′ ◮ ǫ and TP ↑k2 |=Σ G2 , ∆′ ◮ ǫ. By taking k = max {k1 , k2 }, by item i of Lemma 2 and monotonicity of TP (Proposition 2) we get TP ↑k |=Σ G1 , ∆′ ◮ ǫ and TP ↑k |=Σ G2 , ∆′ ◮ ǫ, from which TP ↑k |=Σ G1 & G2 , ∆′ ◮ ǫ follows; - if ∆ = G1 G2 , ∆′ or ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. & Example 4.11 Let Σ be a signature including the constant symbols a and b, a function symbol f , and the predicate symbols p, q, r , let V be a denumerable set of variables and x , y ∈ V, and let P be the following LO∀ program: & 1. r (f (b)) p(a) ◦− ⊤ 2. p(x ) ◦− ⊤ 3. q(y) ◦− (∀x· p(x )) & r (y) Let I0 = {∅Σ }Σ∈Sig P , and let us compute I1 = TP (I0 ). Using clauses 1 and 2, we get that (see Definitions 4.6 and 4.8) (I1 )Σ contains the multisets of atoms of the form {r (f (b)), p(a)} + A, and {p(t )} + A, where A is any multiset of (possibly nonV ground) atoms in AV Σ , while t is any (possibly non ground) term in TΣ . Similarly (I1 )Σ′ , for a generic signature Σ′ such that Σ ⊆ Σ′ , contains all multisets of the V above form where A and t are taken from, respectively, AV Σ′ and TΣ′ . For instance, let c be a new constant not appearing in Σ. The set (I1 )Σ′ will contain, e.g., the multisets {p(c)}, {p(f (c)), q(b)}, and so on. Now, consider the substitution θ = [y 7→ f (b)] and the following corresponding instance of clause 3: q(f (b)) ◦− (∀x· p(x )) & r (f (b)). Assume we want to compute an output fact C for the judgment I1 |=Σ (∀x· p(x )) & r (f (b)) ◮ C. By definition of |=, we have to compute I1 |=Σ (∀x· p(x )) ◮ C and I1 |=Σ r (f (b)) ◮ C. For the latter judgment we have that, e.g., I1 |=Σ r (f (b)) ◮ p(a). For the first judgment, by definition of |=, we must compute I1 |=Σ,c p(c) ◮ C, where c is a new constant not in Σ. As {p(c)} is contained in (I1 )Σ,c , we can get that I1 |=Σ,c p(c) ◮ ǫ. We can also get I1 |=Σ,c p(c) ◮ p(a) (in fact {p(c), p(a)} is also contained in (I1 )Σ,c . By applying the & -rule for |=, we get that I1 |=Σ (∀x· p(x )) & r (f (b)) ◮ p(a). Therefore, by applying clause 3 we get that, e.g., the multiset {q(b), p(a)} is in (I2 )Σ = (TP (I1 ))Σ .  5 An Effective Semantics for LO∀ The fixpoint operator TP defined in the previous section does not enjoy one of the crucial properties we required for our bottom-up semantics, namely its definition is not effective. This is a result of both the definition of the satisfiability judgment Model Checking Linear Logic Specifications 25 (whose clause for ⊤ is clearly not effective) and the definition of interpretations as infinite tuples. In order to solve these problems, we first define the (abstract) Herbrand base and (abstract) interpretations as follows. Definition 5.1 (Abstract Herbrand Base) Given an LO∀ program P , the Herbrand base of P , denoted HB(P ), is given by def HB(P ) = HB ΣP (P ). Definition 5.2 (Abstract Interpretations) Given an LO∀ program P , an interpretation I is any subset of HB(P ), i.e., I ∈ ℘(HB(P )). In order to define the abstract domain of interpretations, we need the following definitions. Definition 5.3 (Instance Operator ) Given an interpretation I and a signature Σ ∈ SigP , we define the operator InstΣ as follows: InstΣ (I ) = {Aθ | A ∈ I , θ substitution over Σ}. Definition 5.4 (Upward-closure Operator ) Given an interpretation I and a signature Σ ∈ SigP , we define the operator U pΣ as follows: U pΣ (I ) = {A + C | A ∈ I , C fact over Σ}. Remark 5.5 Note that, as usual, in the previous definitions we assume the substitution θ and the fact C to be defined over the signature Σ. The following definition provides the connection between the (abstract) interpretations defined in Definition 5.2 and the (concrete) interpretations of Definition 4.4. The idea behind the definition is that an interpretation implicitly denotes the set of elements which can be obtained by either instantiating or closing upwards elements in the interpretation itself (where the concepts of instantiation and upward-closure are made precise by the above definitions). The operation of instantiation is related to the notion of C-semantics (Falaschi et al. 1993) (see Definition 4.2), while the operation of upward-closure is justified by Proposition 1. Note that the operations of instantiation and upward-closure are performed for every possible signature Σ ∈ SigP . Definition 5.6 (Denotation of an Interpretation) Given an (abstract) interpretation I , its denotation [[I ]] is the (concrete) interpretation {[[I ]]Σ }Σ∈SigP defined as follows: def [[I ]]Σ = InstΣ (U pΣ (I )) def (or, equivalently, [[I ]]Σ = U pΣ (InstΣ (I )))· Two interpretations I and J are said to be equivalent, written I ≃ J , if and only if [[I ]] = [[J ]]. The equivalence of the two different equations in Definition 5.6 is stated in the following proposition. 26 M. Bozzano, G. Delzanno and M. Martelli Proposition 3 For every interpretation I , and signature Σ ∈ SigP , InstΣ (U pΣ (I )) = U pΣ (InstΣ (I ))· Proof Let (A + C)θ ∈ InstΣ (U pΣ (I )), with A ∈ I . Then (A + C)θ = (Aθ) + Cθ ∈ U pΣ (InstΣ (I )). Conversely, let Aθ + C ∈ U pΣ (InstΣ (I )), with A ∈ I . Let B be a variant of C with new variables (not appearing in A, θ, and C) and θ′ be the substitution with domain Dom(θ) ∪ F V (B) and s.t. θ′ |Dom(θ) = θ and θ′ maps B to C. Then Aθ + C = Aθ′ + Bθ′ = (A + B)θ′ ∈ InstΣ (U pΣ (I )). We are now ready to define the symbolic interpretation domain. In the following we will use the word abstract to stress the connection between our symbolic semantics and the theory of abstract interpretation. Our abstraction does not loose precision but it allows us to finitely represent infinite collections of formulas. As previously mentioned, the idea is that of considering interpretations as implicitly defining the sets of elements contained in their denotations. Therefore, differently from Definition 4.5, now we need to check containment between denotations. Furthermore, as we do not need to distinguish between interpretations having the same denotation, we simply identify them using equivalence classes with respect to the corresponding equivalence relation ≃. Definition 5.7 (Abstract Interpretation Domain) Abstract interpretations form a complete lattice hI, ⊑i, where • • • • I = {[I ]≃ | I is an interpretation}; [I ]≃ ⊑ [J ]≃ if and only if [[I ]] ⊆ [[J ]]; F the least upper bound of [I ]≃ and [J ]≃ , written [I ]≃ [J ]≃ , is [I ∪ J ]≃ ; the bottom and top elements are [∅]≃ and [ǫ]≃ , respectively. The following proposition provides an effective and equivalent condition for testing the ⊑ relation (which we call entailment relation) over interpretations. We will need this result later on. Proposition 4 (Entailment between Interpretations) Given two interpretations I and J , [[I ]] ⊆ [[J ]] if and only if for every A ∈ I , there exist B ∈ J , a substitution θ, and a fact C (defined over ΣP ) s.t. A = Bθ + C. Proof If part. We prove that for every Σ ∈ SigP , [[I ]]Σ ⊆ [[J ]]Σ . Let A′ = Aθ′ + C ′ ∈ U pΣ (InstΣ (I )) = [[I ]]Σ , with A ∈ I and θ′ , C ′ defined over Σ. By hypothesis, there exist B ∈ J , a substitution θ, and a fact C (defined over ΣP ) s.t. A = Bθ + C. Therefore, A′ = Aθ′ + C ′ = (Bθ + C)θ′ + C ′ = Bθθ′ + (Cθ′ + C ′ ) ∈ U pΣ (InstΣ (J )) = [[J ]]Σ (note that θθ′ and Cθ′ + C ′ are both defined over Σ because ΣP ⊆ Σ). Only if part. Let A ∈ I , then A ∈ [[I ]]ΣP (note that A is defined over ΣP by definition of interpretation). Then, by the hypothesis we have that A ∈ [[J ]]ΣP = U pΣP (InstΣP (J )), i.e., there exist B ∈ J , a substitution θ, and a fact C (defined over ΣP ) s.t. A = Bθ + C. Model Checking Linear Logic Specifications 27 We now define the abstract satisfiability judgment I Σ ∆ ◮ C ◮ θ, where I is an input interpretation, ∆ is an input context, C is an output fact, and θ is an output substitution. Remark 5.8 As usual, the notation I Σ ∆ ◮ C ◮ θ requires that ∆, C, and θ are defined over the signature Σ. As a consequence, the newly introduced constant c in the ∀-case of the Σ definition below cannot be exported through the output parameters C or θ. The judgment Σ can be thought of as an abstract version of the judgment |=Σ (compare Definition 4.6). We now need one more parameter, namely an output substitution. The idea behind the definition is that the output fact C and the output substitution θ are minimal (in a sense to be clarified) so that they can be computed effectively given a program P , an interpretation I , and a signature Σ. The output substitution θ is needed in order to deal with clause instantiation, and its minimality is ensured by using most general unifiers in the definition. As the reader can note, the sources of non-effectiveness which are present in Definition 4.6 (e.g., in the rule for ⊤)) are removed in Definition 5.9 below. We recall that the notation θ1 ↑ θ2 denotes the least upper bound of substitutions (see Appendix Appendix A). Definition 5.9 (Abstract Satisfiability Judgment ) Let P be an LO∀ program, I an interpretation, and Σ ∈ SigP . The abstract satisfiability judgment Σ is defined as follows: ⊤, ∆ ◮ ǫ ◮ nil ; I Σ I Σ I Σ I Σ I Σ G1 I Σ ⊥, ∆ ◮ C ◮ θ if I A ◮ C ◮ θ if there exist B ∈ I (variant), B ′ 4 B, A′ 4 A, |B ′ | = |A′ |, C = B\B ′, and θ = mgu(B ′ , A′ )|F V (A,C) ; ∀x· G, ∆ ◮ C ◮ θ if I Σ,c G[c/x ], ∆ ◮ C ◮ θ, with c 6∈ Σ (see Remark 5.8); G1 & G2 , ∆ ◮ C ◮ θ if I Σ G1 , ∆ ◮ C1 ◮ θ1 , I Σ G2 , ∆ ◮ C2 ◮ θ2 , D1 4 C1 , D2 4 C2 , |D1 | = |D2 |, θ3 = mgu(D1 , D2 ), C = C1 + (C2 \D2 ), and θ = (θ1 ↑ θ2 ↑ θ3 )|F V (G1 ,G2 ,∆,C) ; G2 , ∆ ◮ C ◮ θ if I Σ Σ G1 , G2 , ∆ ◮ C ◮ θ; ∆ ◮ C ◮ θ. & We recall that two multisets in general may have more than one (not necessarily equivalent) most general unifier and that using the notation mgu(B ′ , A′ ) we mean any unifier which is non-deterministically picked from the set of most general unifiers of B ′ and A′ (see Appendix Appendix A). Example 5.10 Let us consider a signature with a function symbol f and predicate symbols p, q, r , s. Let V be a denumerable set of variables, and u, v , w , . . . ∈ V. Let I be the interpretation consisting of the two multisets {p(x ), q(x )} and {r (y), p(f (y))} (for simplicity, 28 M. Bozzano, G. Delzanno and M. Martelli hereafter we omit brackets in multiset notation), and P the program 1. r (w ) ◦− q(f (w )) 2. s(z ) ◦− ∀x· p(f (x )) 3. ⊥ ◦− q(u) & r (v ) Let us consider (a renaming of) the body of the first clause, q(f (w ′ )), and (a renaming of) the first element in I , p(x ′ ), q(x ′ ). Using the second case for the ΣP judgment, with A = A′ = q(f (w ′ )), B = p(x ′ ), q(x ′ ), B ′ = q(x ′ ), we get I ΣP q(f (w ′ )) ◮ p(x ′ ) ◮ [x ′ 7→ f (w ′ )]. Let us consider now (a renaming of) the body of the second case, ∀x· p(f (x )), and another renaming of the first element, p(x ′′ ), q(x ′′ ). From the ∀-case of the definition of ΣP , I ΣP ∀x· p(f (x )) ◮ C ◮ θ if I ΣP ,c p(f (c)) ◮ C ◮ θ, with c 6∈ ΣP . Now, we can apply the second case for ΣP ,c . Unfortunately, we can’t choose A′ to be p(f (c)) and B ′ to be p(x ′′ ). In fact, by unifying p(f (c)) with p(x ′′ ), we should get the substitution θ = [x ′′ 7→ f (c)] and the output fact q(x ′′ ) (note that x ′′ is a free variable in the output fact) and this is not allowed because the substitution θ must be defined on ΣP , in order for I ΣP ∀x· p(f (x )) ◮ C ◮ θ to be meaningful. It turns out that the only way to use the second clause for ΣP ,c is to choose A′ = B ′ = ǫ, which is useless in the fixpoint computation (see Example 5.13). Finally, let us consider (a renaming of) the body of the third clause, ⊥ ◦− q(u ′ ) & r (v ′ ). According to the & -rule for the ΣP judgment, we must first compute C1 , C2 , θ1 and θ2 such that I ΣP q(u ′ ) ◮ C1 ◮ θ1 and I ΣP r (v ′ ) ◮ C2 ◮ θ2 . To this aim, take two variants of the multisets in I , p(x ′′′ ), q(x ′′′ ) and r (y ′ ), p(f (y ′ )). Proceeding as above, we get that I ΣP q(u ′ ) ◮ p(x ′′′ ) ◮ [u ′ 7→ x ′′′ ] and I ΣP r (v ′ ) ◮ p(f (y ′ )) ◮ [v ′ 7→ y ′ ]. Now, we can apply the & -rule for the ΣP judgment, with D1 = p(x ′′′ ), D2 = p(f (y ′ )), and θ3 = [x ′′′ 7→ f (y ′ )]. We have that θ1 ↑ θ2 ↑ θ3 = [u ′ 7→ f (y ′ ), v ′ 7→ y ′ , x ′′′ 7→ f (y ′ )]. Therefore, we get that I ΣP q(u ′ ) & r (v ′ ) ◮ p(x ′′′ ) ◮ [u ′ 7→ f (y ′ ), v ′ 7→ y ′ , x ′′′ 7→ f (y ′ )].  The following lemma states a simple property of the substitution domain, which we will need in the following. Lemma 3 For every interpretation I , context ∆, fact C, and substitution θ, if I then Dom(θ) ⊆ F V (∆) ∪ F V (C). Proof Immediate by induction on the definition of Σ ∆◮C ◮θ Σ. The connection between the satisfiability judgments |=Σ and Σ is clarified by the following lemma (in the following we denote by < the converse of the sub-multiset relation, i.e., A < B if and only if B 4 A). Model Checking Linear Logic Specifications 29 Lemma 4 For every interpretation I , context ∆, fact C, and substitution θ, i . if I Σ ∆ ◮ C ◮ θ then [[I ]] |=Σ ∆θθ′ ◮ C ′ θ′ for every substitution θ′ and fact C ′ < Cθ; ii . if [[I ]] |=Σ ∆θ ◮ C then there exist a fact C ′ , and substitutions θ′ and σ s.t. I Σ ∆ ◮ C ′ ◮ θ′ , θ|F V (∆) = (θ′ ◦ σ)|F V (∆) , C ′ θ′ σ 4 C. Proof See Appendix Appendix B. The satisfiability judgment Σ also satisfies the following properties. Lemma 5 For any interpretations I1 , I2 , . . . , context ∆, fact C, and substitution θ, i . if I1 ⊑ I2 and I1 Σ ∆ ◮ C ◮ θ then there exist a fact C ′ , and substitutions θ′ and σ s.t. I2 Σ ∆ ◮ C ′ ◮ θ′ , θ|F V (∆) = (θ′ ◦ σ)|F V (∆) , C ′ θ′ σ 4 Cθ; F ′ ii . if I1 ⊑ I2 ⊑ . . . and ∞ Σ ∆ ◮ C ◮ θ then there exist k ∈ N, a fact C , i=1 Ii ′ ′ ′ ′ and substitutions θ and σ s.t. Ik Σ ∆ ◮ C ◮ θ , θ|F V (∆) = (θ ◦ σ)|F V (∆) , C ′ θ′ σ 4 Cθ. Proof See Appendix Appendix B. We are now ready to define the abstract fixpoint operator SP : I → I. We will proceed in two steps. We will first define an operator working over interpretations (i.e., elements of ℘(HB(P ))). With a little bit of overloading, we will call the operator with the same name, i.e., SP . This operator should satisfy the equation [[SP (I )]] = TP ([[I ]]) for every interpretation I . This property ensures soundness and completeness of the symbolic representation. After defining the operator over ℘(HB(P )), we will lift it to our abstract domain I consisting of the equivalence classes of elements of ℘(HB(P )) w.r.t. the relation ≃ defined in Definition 5.6. Formally, we first introduce the following definition. Definition 5.11 (Symbolic Fixpoint Operator SP ) Given an LO∀ program P and an interpretation I , the symbolic fixpoint operator SP is defined as follows: b + C) θ | (H ◦− G) ∈ V rn(P ), I SP (I ) = {(H def ΣP G ◮ C ◮ θ}. Note that the SP operator is defined using the judgment ΣP . Proposition 5 states that SP is sound and complete w.r.t TP . In order to prove this, we need to formulate Lemma 6 below. 30 M. Bozzano, G. Delzanno and M. Martelli Notation Let P be an LO∀ program, and Σ, Σ1 ∈ SigP be two signatures such that Σ1 ⊆ Σ. Given a fact C, defined on Σ, we use ⌈C⌉Σ→Σ1 to denote any fact which is obtained in the following way. For every constant (eigenvariable) c ∈ (Σ \ Σ1 ), pick a new variable in V (not appearing in C), let it be xc (distinct variables must be chosen for distinct eigenvariables). Now, ⌈C⌉Σ→Σ1 is obtained by C by replacing every c ∈ (Σ\Σ1 ) with xc . For instance, if C = {p(x , f (c)), q(y, d )}, with c ∈ (Σ\Σ1 ) and d ∈ Σ1 , we have that ⌈C⌉Σ→Σ1 = {p(x , f (xc )), q(y, d )}. Given a context (multiset of goals) ∆, defined on Σ, we define ⌈∆⌉Σ→Σ1 in the same way. Similarly, given a substitution θ, defined on Σ, we use the notation ⌈θ⌉Σ→Σ1 to denote the substitution obtained from θ by replacing every c ∈ (Σ \ Σ1 ) with a new variable xc in every binding of θ. For instance, if θ = [u 7→ p(x , f (c)), v 7→ q(y, d )], with c ∈ (Σ \ Σ1 ) and d ∈ Σ1 , we have that ⌈θ⌉Σ→Σ1 = [u 7→ p(x , f (xc )), v 7→ q(y, d )]. Using the notation [[I ]] |=Σ1 ⌈∆⌉Σ→Σ1 ◮ ⌈C⌉Σ→Σ1 we mean the judgment obtained by replacing every c ∈ (Σ\Σ1 ) with xc simultaneously in ∆ and C. Newly introduced variables must not appear in ∆, C, or I . When Σ and Σ1 are clear from the context, we simply write ⌈C⌉, ⌈∆⌉, and ⌈θ⌉ for ⌈C⌉Σ→Σ1 , ⌈∆⌉Σ→Σ1 , and ⌈θ⌉Σ→Σ1 . Finally, we use ξΣ1 →Σ (or simply ξ if it is not ambiguous) to denote the substitution which maps every variable xc back to c (for every c ∈ (Σ\Σ1 )), i.e., consisting of all bindings of the form xc 7→ c for every c ∈ Σ \ Σ1 . Clearly, we have that ⌈F ⌉ξ = F , for any fact or context F , and ⌈θ⌉ ◦ ξ = θ for any substitution θ. Note that, by definition, ⌈C⌉Σ→Σ1 and ⌈∆⌉Σ→Σ1 are defined on Σ1 , while ξΣ1 →Σ is defined on Σ. Lemma 6 Let P be an LO∀ program, I an interpretation, and Σ, Σ1 ∈ SigP two signatures, with Σ1 ⊆ Σ. i . If I Σ1 ∆ ◮ C ◮ θ then I Σ ∆ ◮ C ◮ θ; ii . If [[I ]] |=Σ ∆ ◮ C then [[I ]] |=Σ1 ⌈∆⌉Σ→Σ1 ◮ ⌈C⌉Σ→Σ1 . Proof See Appendix Appendix B. Proposition 5 For every LO∀ program P and interpretation I , [[SP (I )]] = TP ([[I ]]). Proof [[SP (I )]] ⊆ TP ([[I ]]). b +C)θ ∈ SP (I ), We prove that for every Σ ∈ SigP , [[SP (I )]]Σ ⊆ TP ([[I ]])Σ . Assume (H with H ◦− G a variant of a clause in P and I ΣP G ◮ C ◮ θ. Assume also that A = b + C)θ + D)θ′ ∈ InstΣ (U pΣ (SP (I ))) = [[Sp(I )]]Σ . We have that I ΣP G ◮ C ◮ θ ((H implies I Σ G ◮ C ◮ θ by item i of Lemma 6 (remember that ΣP ⊆ Σ). Therefore, by item i of Lemma 4, we get [[I ]] |=Σ Gθθ′ ◮ C ′ θ′ for any fact C ′ < Cθ. Taking Model Checking Linear Logic Specifications 31 C ′ = Cθ + D, it follows that [[I ]] |=Σ Gθθ′ ◮ Cθθ′ + Dθ′ . Therefore, by definition of b θθ′ + Cθθ′ + Dθ′ ∈ (TP ([[I ]]))Σ , i.e., A ∈ (TP ([[I ]]))Σ . TP , we have H TP ([[I ]]) ⊆ [[SP (I )]]. We prove that for every Σ ∈ SigP , Tp([[I ]])Σ ⊆ [[SP (I )]]Σ . Assume A ∈ (TP ([[I ]]))Σ . By definition of TP , there exist a variant of a clause H ◦− G in P , a fact C and a b θ + C and [[I ]] |=Σ Gθ ◮ C. substitution θ (defined over Σ) s.t. A = H By item ii of Lemma 6 we have that [[I ]] |=Σ Gθ ◮ C implies [[I ]] |=ΣP ⌈Gθ⌉ ◮ ⌈C⌉ (hereafter, we use the notation ⌈·⌉ for ⌈·⌉Σ→ΣP ). From H ◦− G in P , we know that G is defined on ΣP . It follows easily that ⌈Gθ⌉ = G⌈θ⌉, so that [[I ]] |=ΣP G⌈θ⌉ ◮ ⌈C⌉. By item ii of Lemma 4, there exist a fact C ′ , and substitutions θ′ and σ (defined over ΣP ) s.t. I ΣP G ◮ C ′ ◮ θ′ , ⌈θ⌉|F V (G) = (θ′ ◦ σ)|F V (G) , and C ′ θ′ σ 4 ⌈C⌉. b + C ′ )θ′ ∈ SP (I ). By definition of SP , we have (H b θ +C = H b ⌈θ⌉ξ +⌈C⌉ξ = (note that by hypothesis θ′ ◦σ and ⌈θ⌉ coincide Now, A = H for variables in G, and are not defined on variables in H which do not appear in G b θ′ σξ + ⌈C⌉ξ < H b θ′ σξ + C ′ θ′ σξ = ((H b + C ′ )θ′ )σξ ∈ because H ◦− G is a variant) H ′ ′ b [[(H + C )θ ]]Σ ⊆ [[SP (I )]]Σ . The following corollary holds. Corollary 1 For every LO∀ program P and interpretations I and J , if I ≃ J then SP (I ) ≃ SP (J ). Proof If I ≃ J , i.e., [[I ]] = [[J ]], we have that TP ([[I ]]) = TP ([[J ]]). By Proposition 5, it follows that [[SP (I )]] = [[SP (J )]], i.e., SP (I ) ≃ SP (J ). Corollary 1 allows us to safely lift the definition of SP from the lattice h℘(HB (P )), ⊆i to hI, ⊑i. Formally, we define the abstract fixpoint operator as follows. Definition 5.12 (Abstract Fixpoint Operator SP ) Given an LO∀ program P and an equivalence class [I ]≃ of I, the abstract fixpoint operator SP is defined as follows: def SP ([I ]≃ ) = [SP (I )]≃ where SP (I ) is defined in Definition 5.11. For the sake of simplicity, in the following we will often use I to denote its class [I ]≃ , and we will simply use the term (abstract) interpretation to refer to an equivalence class, i.e., an element of I. The abstract fixpoint operator SP satisfies the following property. Proposition 6 (Monotonicity and Continuity) For every LO∀ program P , the abstract fixpoint operator SP is monotonic and continuous over the lattice hI, ⊑i. 32 M. Bozzano, G. Delzanno and M. Martelli Proof Monotonicity. We prove that if I ⊑ J , then SP (I ) ⊑ SP (J ), i.e., [[SP (I )]] ⊆ [[SP (J )]]. To prove the latter condition, we will use the characterization given by Proposition 4. Assume b + C)θ ∈ SP (I ), with H ◦− G a variant of a clause in P and I ΣP G ◮ C ◮ θ. A = (H By item i of Lemma 5, there exist a fact C ′ , and substitutions θ′ and σ (note that they are defined over ΣP ) s.t. J ΣP G ◮ C ′ ◮ θ′ , θ|F V (G) = (θ′ ◦ σ)|F V (G) , C ′ θ′ σ 4 Cθ. Let Cθ = C ′ θ′ σ + D, with D a fact defined over ΣP . By definition of b + C ′ )θ′ ∈ SP (J ). SP , B = (H b + C)θ = H b θ + Cθ = H b θ′ σ + C ′ θ′ σ + D (note in fact that by hypothesis Now, A = (H ′ θ σ and θ coincide for variables in G, and are not defined on variables in H which do not appear in G because H ◦− G is a variant). Therefore, we have that A = b θ′ σ + C ′ θ′ σ + D = Bσ + D. H Continuity. F∞ F∞ We show that SP is finitary, i.e., if I1 ⊑ I2 ⊑ . . ., then SP ( i=1 Ii ) ⊑ i=1 SP (Ii ), F∞ F∞ i.e., [[SP ( i=1 Ii )]] ⊆ [[ i=1 SP (Ii )]]. Again, we will use the characterization given b + C)θ ∈ SP (F∞ Ii ), with H ◦− G a variant of by Proposition 4. Assume A = (H i=1 F∞ a clause in P and i=1 I1 ΣP G ◮ C ◮ θ. By item ii of Lemma 5, there exist k ∈ N, a fact C ′ , and substitutions θ′ and σ (note that they are defined over ΣP ) s.t. Ik ΣP G ◮ C ′ ◮ θ′ , θ|F V (G) = (θ′ ◦ σ)|F V (G) , C ′ θ′ σ 4 Cθ. Let Cθ = C ′ θ′ σ + D, with D a fact defined over ΣP . By definition of b + C ′ )θ′ ∈ SP (Ik ). SP , B = (H b + C)θ = H b θ′ σ + C ′ θ′ σ + D = Bσ + D. Exactly as above, we prove that A = (H Corollary 2 For every LO∀ program P , [[lfp(SP )]] = lfp(TP ). Let Fsym (P ) = lfp(SP ), then we have the following main theorem. Theorem 2 (Soundness and Completeness) For every LO∀ program P , O(P ) = F (P ) = [[Fsym (P )]]ΣP . Proof From Theorem 1 and Corollary 2. The previous results give us an algorithm to compute the operational and fixpoint semantics of a program P via the fixpoint operator SP . Example 5.13 Let us consider a signature with a constant symbol a, a function symbol f and predicate symbols p, q, r , s. Let V be a denumerable set of variables, and u, v , w , . . . ∈ V. Model Checking Linear Logic Specifications 33 Let us consider the program P given below. 1. r (w ) ◦− q(f (w )) 2. s(z ) ◦− ∀x· p(f (x )) 3. ⊥ ◦− q(u) & r (v ) & 4. p(x ) q(x ) ◦− ⊤ From clause 4, and using the first rule for ΣP , we get SP (∅) = [{{p(x ), q(x )}}]≃ . For simplicity, we omit the class notation, and we write SP ↑1 = SP (∅) = {{p(x ), q(x )}}. We can now apply the remaining clauses to the element I = {p(x ), q(x )} (remember that SP ([I ]≃ ) = [SP (I )]≃ ). From the first clause (see Example 5.10) we have I ΣP q(f (w ′ )) ◮ p(x ′ ) ◮ [x ′ 7→ f (w ′ )]. It follows that (r (w ′ ), p(x ′ ))[x ′ 7→ f (w ′ )] = r (w ′ ), p(f (w ′ )) ∈ SP ↑2 . As the reader can verify (see discussion in Example 5.10), clause 2 does not yield any further element, and the same holds for clause 3, therefore (changing w ′ into y for convenience) SP ↑2 = {{p(x ), q(x )}, {r (y), p(f (y))}}. Now, we can apply clause 3 to the elements in SP ↑2 . According to Example 5.10, we have that I ΣP q(u ′ ) & r (v ′ ) ◮ p(x ′′′ ) ◮ [u ′ 7→ f (y ′ ), v ′ 7→ y ′ , x ′′′ 7→ f (y ′ )]· Therefore we get that (p(x ′′′ ))[u ′ 7→ f (y ′ ), v ′ 7→ y ′ , x ′′′ 7→ f (y ′ )] = p(f (y ′ )) ∈ SP ↑3 . Clause 2 cannot be applied yet, for the same reasons as above. Also, note that the element r (y), p(f (y)) is now subsumed by p(f (y ′ )). Therefore we can assume SP ↑3 = {{p(x ), q(x )}, {p(f (y ′ ))}}. Finally, we can apply clause 2 to SP ↑3 , using the ∀-rule for the ΣP judgment. Take c 6∈ ΣP , and consider a renaming of the last element in SP ↑3 , p(f (y ′′ )). Consider (a renaming of) clause 2, s(z ′ ) ◦− ∀x· p(f (x )). We have that I ΣP ,c p(f (c)) ◮ ǫ ◮ nil , with nil being the empty substitution. Therefore we get that I ΣP ∀x· p(f (x )) ◮ ǫ ◮ nil , from which s(z ′ ) ∈ SP ↑4 . The reader can verify that no further clauses can be applied and that SP ↑4 is indeed the fixpoint of SP , therefore we have that SP ↑4 = SP ↑ω = {{p(x ), q(x )}, {p(f (y ′ ))}, {s(z ′ )}}. Note that F (P ) is defined to be [[lfp(SP )]]ΣP , therefore it includes, e.g., the elements s(a) (see Example 3.8), p(f (f (y ′′ ))) and p(f (f (y ′′ ))), q(x ′′ ).  6 Ensuring Termination In general the symbolic fixpoint semantics of first order LO programs is not computable (see also the results in (Cervesato et al. 1999)). In fact, the use of first order terms can easily lead to LO programs that encode operations over natural numbers. In this section, however, we will isolate a fragment of LO∀ for which termination of the bottom-up evaluation algorithm presented in Section 5 is guaranteed. An application of these results will be presented in Section 7. First of all, we will introduce 34 M. Bozzano, G. Delzanno and M. Martelli some preliminary notions that we will use later on to prove the decidability of our fragment. 6.1 The Theory of Well Quasi-Orderings In the following we summarize some basic definitions and results on the theory of well quasi-orderings (Higman 1952; Milner 1985; Abdulla et al. 1996). A quasiorder ⊑ on a set A is a binary relation over A which is reflexive and transitive. In the following it will be denoted (A, ⊑). Definition 6.1 (Well Quasi-Ordering) A quasi-order (A, ⊑) is a well quasi-ordering (wqo) if for each infinite sequence a0 a1 a2 . . . of elements in A there exist indices i < j such that aj ⊑ ai .1 We have the following results, according to which a hierarchy of well quasi-orderings can be built starting from known ones. In the following b r will denote the set {1, . . . , r }, r being a natural number, and |w | the length of a string w . Proposition 7 (From (Higman 1952)) i . If A is a finite set, then (A, =) is a wqo; ii . let (A, ⊑) be a wqo, and let As denote the set of finite multisets over A. Then, (As , ⊑s ) is a wqo, where ⊑s is the quasi-order on As defined as follows: given S = {a1 , . . . , an } and S ′ = {b1 , . . . , br }, S ′ ⊑s S if and only if there exists an injection h : n b→b r such that bh(j ) ⊑ aj for 1 ≤ j ≤ n; iii . let (A, ⊑) be a wqo, and let A∗ denote the set of finite strings over A. Then, (A∗ , ⊑∗ ) is a wqo, where ⊑∗ is the quasi-order on A∗ defined in the following way: w ′ ⊑∗ w if and only if there exists a strictly monotone (meaning that c| → |w d′ | such that j1 < j2 if and only if h(j1 ) < h(j2 )) injection h : |w ′ w (h(j )) ⊑ w (j ) for 1 ≤ j ≤ |w |. We are ready now to study the class of monadic LO∀ specifications. 6.2 Monadic LO∀ Specifications The class of specifications we are interested in consists of monadic predicates without function symbols. Intuitively, in this class we can represent process that carry along a single information taken from a possibly infinite domain (universal quantification introduces fresh names during a derivation). Definition 6.2 (Monadic LO∀ Specifications) The class of monadic LO∀ specifications consists of LO∀ programs built over a signature Σ including a finite set of constant symbols L, no function symbols, and a finite set of predicate symbols P with arity at most one. 1 Note that our ⊑ operator corresponds to the ⊒ operator of (Abdulla and Jonsson 2001). Here we adhere to the classical logic programming convention. Model Checking Linear Logic Specifications 35 Definition 6.3 (Monadic Multisets and Interpretations) The class of monadic multisets consists of multisets of (non ground) atomic formulas over a signature Σ including a finite set of constant symbols L, no function symbols, and a finite set of predicate symbols P with arity at most one. An interpretation consisting of monadic multisets is called a monadic interpretation. Example 6.4 Let Σ be a signature including a constant symbols a, no function symbols, and predicate symbols p, q and r (with arity one), and s (with arity zero). Let V be a denumerable set of variables, and x , y, . . . ∈ V. Then the clause r (x ) & & q(x ) s ◦− (p(x ) & & p(x ) p(a)) & ∀v· r (v ) is a monadic LO∀ specification, and the multiset {p(x ), q(y), q(x ), s} is a monadic multiset.  We have the following result. Proposition 8 The class of monadic multisets is closed under applications of SP , i.e., for every interpretation I , if I is monadic then SP (I ) is monadic. Proof Immediate by Definition 5.11 and Definition 5.9. Following Proposition 4, we define the entailment relation between multisets of (non ground) atomic formulas, denoted ⊑m , as follows. For the sake of simplicity, in the rest of this section we will apply the following convention. Consider a monadic multiset. First of all, we can eliminate constant symbols by performing the following transformation (note that there are no other ground terms other than constants in this class). For every atom p(a), where p is a predicate symbol with arity one and a is a constant symbol in Σ, we introduce a new predicate symbol with arity zero, let it be pa , and we transform the original multiset by substituting pa in place of p(a). The resulting set of predicate symbols is still finite (note that the set of constant and predicate symbols of the program is finite). It is easy to see that entailment between multisets transformed in the above way is a sufficient condition for entailment of the original multisets (note that the condition is not necessary, e.g., I cannot recognize that p(a) entails p(x )). Without loss of generality, we assume hereafter to deal with a set of predicate symbols with arity one (if it is not the case, we can complete predicate with arity less than one with dummy variables) and without constant symbols (otherwise, we operate the transformation previously described). Definition 6.5 Given two multisets A and B, A ⊑m B if and only if there exist a substitution θ and a multiset C such that A = Bθ + C. Then, we have the following property. 36 M. Bozzano, G. Delzanno and M. Martelli Proposition 9 If A ⊑m B then [[A]] ⊆ [[B]]. Proof It follows from Definition 5.6 and Proposition 4. Let M be a monadic multiset with variables x1 , . . . , xk . We define Mi as the multiset of predicate symbols having xi as argument in M, and S (M) as the multiset {M1 , . . . , Mk }. For instance, given the monadic multiset M defined as {p(x1 ), q(x1 ), p(x1 ), q(x2 ), r (x2 ), q(x3 ), r (x3 )}, S (M) is the multiset consisting of the elements M1 = ppq, M2 = qr , and M3 = qr , i.e., S (M) = {ppq, qr , qr } (where ppq denotes the multiset with two occurrences of p and one of q, and so on). Given two multisets of multisets of predicate symbols S = {M1 , M2 , . . . Mk } and T = {N1 , N2 , . . . , Nr }, let S ⊑s T if and only if there exists an injective mapping h from {1, . . . , r } to {1, . . . , k } such that Ni 4 Mh(i) for i : 1, . . . , r . As an example, {ppp, tt , qq, rrr } ⊑s {pp, q, rr } by mapping: pp into ppp (pp 4 ppp), q into qq (q 4 qq), and rr into rrr (rr 4 rrr ). On the contrary, {ppp, rr , t , qq} 6⊑s {pq, q, rr }, in fact there is no multiset in the set on the left hand side of the previous relation of which pq is a sub-multiset. The following property relates the quasi order ⊑s and the entailment relation ⊑m . Lemma 7 Let M and N be two monadic multisets. Then S (M) ⊑s S (N ) implies M ⊑m N . Proof Let S (M) = {M1 , M2 , . . . Mk } and S (N ) = {N1 , N2 , . . . , Nr }. Furthermore, let h be the injective mapping from {1, . . . , r } to {1, . . . , k } such that Ni 4 Mh(i) . By construction of M and N , it is easy to see that for every i ∈ {1, . . . , r } we can isolate atomic formulas Ai1 , . . . , Aiz in N (corresponding to the cluster of variables Ni ), where z is the cardinality of Ni , and atomic formulas Bi1 , . . . , Biz in M (corresponding to the cluster of variables Mh(i) ), such that the conditions required by Definition 6.5 are satisfied. As an immediate consequence of this lemma, we obtain the following property. Proposition 10 The entailment relation ⊑m between monadic multisets is a well-quasi-ordering. Proof The conclusion follows from the observations below (in the following we denote by < the converse of the sub-multiset relation, i.e., A < B if and only if B 4 A): - the < relation is a well quasi-ordering by Dickson’s Lemma (which is a consequence of Proposition 7, see also (Dickson 1913)). Intuitively, multiset inclusion is equivalent to the component-wise ordering of tuples of integers denoting the occurrences of the finite set of predicate symbols in a multiset; Model Checking Linear Logic Specifications 37 - since ⊑s is built over elements ordered with respect to the well quasi-ordering <, ⊑s is in turn a well quasi-ordering by item ii of Proposition 7; - as a consequence of Lemma 7, ⊑s being a well quasi-ordering implies that ⊑m is a well quasi-ordering. We can now formulate the following proposition, which states that the bottomup fixpoint semantics is computable in finite time for monadic LO∀ specifications. This results relies on the following facts: in the case of monadic specifications, each interpretation computed via bottom-up evaluation consists of monadic multisets, and the entailment relation between monadic multisets is a well quasi-ordering (therefore eventually the fixpoint computation stabilizes). Proposition 11 Let P be a monadic LO∀ specification. Then there exists k ∈ N such that Fsym (P ) F = ki=0 SP ↑k (∅). Proof We first note that the denotation of a monadic interpretation I is defined in terms of the denotation of its elements (monadic multisets). Thus, a monadic interpretation I represents an upward closed set w.r.t. to the ordering ⊑m . Furthermore, the sequence of interpretations computed during a fixpoint computation forms an increasing sequence with respect to their denotation. The result follows then from Propositions 8, 9, 10, and known results on well quasi-orderings which guarantee that any infinite increasing sequence of upward-closed sets eventually stabilizes (see (Finkel and Schnoebelen 2001)). 7 An Example In this section we show how the bottom-up semantics of Section 5 can be applied for verifying the test-and-lock protocol given in Section 3.2. In order to run the experiments described hereafter, we have built a prototypical verification tool implementing the bottom-up fixpoint procedure (backward reachability algorithm) described in Section 5. Following the guidelines and programming style described in (Elliott and Pfenning 1991), we have implemented an interpreter for the relevant first order fragment of LO, enriched with the bottom-up evaluation procedure described in Section 5. The verification tool has been implemented in Standard ML. Let us consider again the test-and-lock protocol given in Section 3.2. Using our verification tool, we can now automatically verify the mutual exclusion property for the protocol. The specification of unsafe states is simply as follows: & 8. use(x ) use(x ) ◦− ⊤ Note that the test-and-lock specification can be transformed into a monadic one. In fact, the second argument can be embedded into the predicate m so as to define the two predicates munlocked and mlocked . In some sense, the specification is implicitly 38 M. Bozzano, G. Delzanno and M. Martelli ⊤r P ⊢Σ init, ⊤, m(a, locked ), m(a, locked ) P ⊢Σ init, use(a), use(a), m(a, locked ), m(a, locked ) bc (8) ∗ bc (6 P ⊢Σ init, wait(a), wait(a), m(a, unlocked ), m(a, unlocked ) ) ∗) bc (4 P ⊢Σ init, think , think , m(a, unlocked ), m(a, unlocked ) ∗) P ⊢Σ init, think , think P ⊢Σ init bc (2 ∗ bc (1 ) Fig. 6. Incorrect test-and-lock protocol: a trace violating mutual exclusion {init} {use(x ), use(x )} {m(x , unlocked ), use(x ), wait(y)} {m(x , unlocked ), use(x ), use(y), m(y, locked )} {m(x , locked ), use(x ), m(y, unlocked ), m(y, unlocked ), think } {m(x , unlocked ), m(x , unlocked ), wait(y), think } {m(x , unlocked ), m(x , unlocked ), use(y), m(y, locked ), use(z ), m(z , locked )} {m(x , unlocked ), m(x , unlocked ), use(y), m(y, locked ), wait(z )} {wait(x ), m(y, unlocked ), m(y, unlocked ), wait(z )} {m(x , unlocked ), m(x , unlocked ), think , think } {use(x ), m(x , unlocked ), think } Fig. 7. Fixpoint computed for the incorrect test-and-lock protocol monadic since the second argument is defined over a finite set of states. Therefore termination of the fixpoint computation is guaranteed by Proposition 11. Running the verification algorithm, we actually find a mutual exclusion violation. The cor∗ responding trace is shown in Figure 6, where bc (i ) denotes multiple applications of clause number i. The problem of the above specification lies in clause 2: & 2. init ◦− init m(x , unlocked ) In fact, using an (externally quantified) variable x does not prevent the creation of multiple monitors for the same resource. This causes a violation of mutual exclusion when different processes are allowed to concurrently access a given resource by different monitors. Figure 7 (where, for readability, we re-use the same variables in different multisets) also shows the fixpoint computed for the incorrect version of the protocol: note that the singleton multiset containing the atom init is in the fixpoint (this amounts to saying that there exists a state violating mutual exclusion which is reachable from the initial configuration of the protocol). Luckily, we can fix the above problem in a very simple way. As we do not care about what resource identifiers actually are, we can elegantly encode them using universal quantification in the body of clause 2, as follows: & 2′ . init ◦− init ∀x· m(x , unlocked ) Model Checking Linear Logic Specifications 39 .. .. P ⊢Σ,c,d use(c), wait(d ), think , m(c, locked ), m(d , unlocked ) P ⊢Σ,c,d wait(c), wait(d ), think , m(c, unlocked ), m(d , unlocked ) P ⊢Σ,c,d wait(c), wait(d ), use(c), m(c, locked ), m(d , unlocked ) bc (6) bc (7) bc (6) P ⊢Σ,c,d wait(c), wait(d ), wait(c), m(c, unlocked ), m(d , unlocked ) bc (4) P ⊢Σ,c,d think , wait(d ), wait(c), m(c, unlocked ), m(d , unlocked ) P ⊢Σ,c,d think , think , wait(c), m(c, unlocked ), m(d , unlocked ) P ⊢Σ,c,d think , think , think , m(c, unlocked ), m(d , unlocked ) P ⊢Σ,c,d init, think , think , think , m(c, unlocked ), m(d , unlocked ) bc (4) bc (4) bc (3) ′∗ P ⊢Σ init, think , think , think P ⊢Σ init bc (2 ∗ bc (1 ) ) Fig. 8. A correct version of the test-and-lock protocol: example trace {use(x ), use(x )} {m(x , unlocked ), use(x ), init} {m(x , unlocked ), use(x ), wait(y)} {m(x , unlocked ), use(x ), use(y), m(y, locked )} {m(x , locked ), use(x ), m(y, unlocked ), m(y, unlocked ), think } {m(x , unlocked ), m(x , unlocked ), wait(y), think } {m(x , unlocked ), m(x , unlocked ), use(y), m(y, locked ), use(z ), m(z , locked )} {m(x , unlocked ), m(x , unlocked ), use(y), m(y, locked ), wait(z )} {wait(x ), m(y, unlocked ), m(y, unlocked ), wait(z )} {m(x , unlocked ), m(x , unlocked ), init} {m(x , unlocked ), m(x , unlocked ), think , think } {use(x ), m(x , unlocked ), think } Fig. 9. Fixpoint computed for the correct test-and-lock protocol Every time a resource is created, a new constant, acting as the corresponding identifier, is created as well. Note that by the operational semantics of universal quantification, different resources are assigned different identifiers. This clearly prevents the creation of multiple monitors for the same resource. An example trace for the modified specification is shown in Figure 8 (where P is the program consisting of clauses 1, 2’, 3 through 8 (see Section 3.2)). Now, running again our verification tool on the corrected specification (termination is still guaranteed by Proposition 11), with the same set of unsafe states, we get the fixpoint shown in Figure 9. The fixpoint contains 12 elements and is reached in 7 steps. As the fixpoint does not contain init , mutual exclusion is verified, for any number of processes and any number of resources. We conclude by showing how it is possible to optimize the fixpoint computation. 40 M. Bozzano, G. Delzanno and M. Martelli {use(x ) , use(x )} {m(x , y) , m(x , z )} {m(x , unlocked ) , use(x ) {m(x , unlocked ) , use(x ) {m(x , unlocked ) , use(x ) {use(x ) , m(x , unlocked ) , use(y) , m(y, z )} , wait(y)} , init} , think } Fig. 10. Fixpoint computed using invariant strengthening for the test-and-lock protocol Specifically, we show that it is possible to use the so called invariant strengthening technique in order to reduce the dimension of the sets computed during the fixpoint evaluation. Invariant strengthening consists of enlarging the theory under consideration with new clauses (e.g., additional clauses representing further unsafe states). We remark that this technique is perfectly sound, in the sense that if no property violations are found in the extended theory, then no violations can be found in the original one (i.e., proofs in the original theory are still proofs in the extended one). One possibility might be to apply the so-called counting abstraction, i.e., turn the above LO∀ specification into a propositional program (i.e., a Petri net) by abstracting first order atoms into propositional symbols (e.g., wait (x ) into wait , and so on), and compute the structural invariants of the corresponding Petri net. However, this strategy is not helpful in this case (no meaningful invariant is found). We can still try some invariants using some ingenuity. For instance, consider the following invariant: & 9 · m(x , y) m(x , z ) ◦− ⊤ For what we said previously (different resources are assigned different identifiers) this invariant must hold for our specification. Running the verification tool on this extended specification we get the fixpoint in Figure 10, containing only 6 elements and converging in 4 steps. A further optimization could be obtained by adding the invariant use(x ) m(x , unlocked ) ◦− ⊤ (intuitively, if someone is using a given resource, the corresponding semaphore cannot be unlocked). In this case the computation converges immediately at the first step. & 8 Reachability and Extensions of LO In this paper we have focused our attention on the relationship between provability in LO and coverability for the configuration of a concurrent system. Following (Bozzano et al. 2002), in order to characterize reachability problems between two “configurations” (goal formulas) we need an extra feature of linear logic, namely the logical constant 1. Differently from clauses with ⊤, clauses of the form A1 . . . An ◦− 1 make a derivation succeed if and only if the right-hand side of the current sequent matches an instance of A1 . . . An , i.e., all resources must be used in the corresponding derivation. Going back to the notation used in Section 3.1, let P be a set of LO rewrite rules over Σ and V, and M, M′ two multisets of ground atomic formulas (two config& & & & Model Checking Linear Logic Specifications P , D ⊢Σ,c 1 41 1r P , D ⊢Σ,c p(f (a)), p(f (b)), q(b), q(c) P , D ⊢Σ p(f (a)), p(b), q(f (b)) bc (D) bc (1) Fig. 11. Reachability as provability in LO∀ & urations). Furthermore, let H , G the (possibly empty) -disjunctions of ground b = M′ and G b = M. Then, the provability of the seatomic formulas such that H quent P , H ◦− 1 ⊢1 G precisely characterizes the reachability of configuration M′ from the initial configuration M via a sequence of multiset rewriting steps defined over the theory P (see (Bozzano et al. 2002)). Again, this is a straightforward consequence of the properties of clauses like H ◦− 1 and of the fact that, when working with LO rewrite rules, derivations have no branching. Example 8.1 Let us go back to Example 3.10 of Section 3.1 (compare the definitions of the formulas F1 and F2 given there). Let F1′ be the formula q(b) & & p(f (f (b))) q(b) & & p(a) q(f (f (b))) ◦− 1 and F2′ be the formula & p(a) q(b) ◦− 1 & & and G = p(a) p(b) q(f (b)). If we enrich P with F1′ , instead of F1 , then we can transform the partial derivation of Figure 3 into an LO proof as shown below (where δ stands for the derivation fragment of Figure 3): P ⊢Σ 1 δ 1r bc The resulting LO proof also shows that from the multiset {p(a), p(b), q(f (b))} we can reach the multiset {p(a), p(f (f (b))), q(b), q(b), q(f (f (b)))} after a finite number of rewriting steps defined in accordance with P . Note that on the contrary (compare with Example 3.10), if we enrich P with F2′ , it is not possible to turn the partial derivation of Figure 3 into an LO proof. In fact, every rewriting step will give us larger and larger multisets and the formula F2′ never becomes applicable.  Particular attention must be paid to the constants introduced in a derivation. They cannot be extruded from the scope of the corresponding universal quantifier. For this reason, the formulas representing target configurations must be generalized by introducing universally quantified variables in place of constants introduced in a derivation. For the sake of brevity, we will illustrate the connection between provability and reachability in the extended setting through the following example. 42 M. Bozzano, G. Delzanno and M. Martelli Infinite State Concurrent Systems Linear Logic Specification transition system transition current state initial state single final state upward-closed set of states reachability Pre operator Pre ∗ operator LO program and proof system rule instance goal formula initial goal axiom with 1 axiom with ⊤ provability TP operator lfp(TP ) Fig. 12. Reachability versus provability Example 8.2 Let Σ be the signature of Example 3.10. Let P consists of the clause q(y) q(w )) & & q(f (y)) ◦− ∀w . (p(f (x )) & & & 1. p(x ) & Now, let D be the clause ∀x . p(f (a)) p(f (b)) q(b) q(x ) ◦− 1, and let G be the goal p(f (a)) p(b) q(f (b)). The universal quantifier is used here to generalize the representation of the target configuration. In fact, new constants will be introduced and associated to the predicate q in the derivation of the goal G. As an example, a possible derivation is shown in Figure 11 (where we have omitted applications of the r rule for simplicity). The last backchaining step in Figure 11 is possible because of the universal quantifier used in D . It would not be possible to define D as p(f (a)) p(f (b)) q(b) q(c) ◦− 1. In fact, the resulting initial sequent would violate the side condition of the ∀r proof rule that requires the freshness of the new constants introduced in a proof.  & & & & & & The extension of the fixpoint semantics presented in this paper to more general linear logic languages (e.g., languages that include 1) is a possible future direction for our research. 9 Conclusions In this paper we have investigated the connections between techniques used for symbolic model checking of infinite-state systems (Abdulla et al. 1996; Finkel and Schnoebelen 2001) and provability in fragments of linear logic (Andreoli and Pareschi 1990). The relationship between the two fields is illustrated in Figure 12. From our point of view, linear logic can be used as a unifying framework for reasoning about concurrent systems (e.g., Petri Nets, multiset rewriting, and so on). In (Bozzano et al. 2002), we have applied algorithms previously developed for Petri Nets in order to derive bottom-up evaluation strategies for proposition linear logic. Conversely, in the current paper we have shown that the use of linear logic and the related bottom-up evaluation strategies can have interesting application for the automated verification of infinite-state systems in which processes are described via colored formulas. Several applications of the ideas presented in this paper can be found in (Bozzano 2002), and (Bozzano and Delzanno 2002). Model Checking Linear Logic Specifications 43 Apart from verification purposes, the new fixpoint semantics can also be useful to study new applications of linear logic programming (e.g., for active databases as discussed in (Harland and Winikoff 1998)). For this purpose, it might be interesting to extend the bottom-up evaluation framework to richer linear logic languages. Possible directions of research include languages with a richer set of connectives (e.g., Linlog (Andreoli 1992)), or languages with more powerful type theories (e.g., LLF (Cervesato and Pfenning 2002)). Acknowledgments We would like to thank the anonymous reviewers of the paper for their helpful comments. Appendix A Some Notations Multisets A multiset with elements in D is a function M : D → N. If d ∈ D and M is a multiset on D , we say that d ∈ M if and only if M(d ) > 0. For convenience, we often use the notation for sets (allowing duplicated elements) to indicate multisets, when no ambiguity arises from the context. For instance, {a, a, b}, where a, b ∈ D , denotes the multiset M such that M(a) = 2, M(b) = 1, and M(d ) = 0 for all d ∈ D \ {a, b}. Sometimes we simply write a, a, b for {a, a, b}. Finally, given a set D , MS(D ) denotes the set of multisets with elements in D . We define the following operations on multisets. Let D be a set, M1 , M2 ∈ MS(D), and n ∈ N, then: ǫ is defined s.t. ǫ(d ) = 0 for all d ∈ D (empty multiset); (M1 + M2 )(d ) = M1 (d ) + M2 (d ) for all d ∈ D (union); (M1 \M2 )(d ) = max {0, M1(d ) − M2 (d )} for all d ∈ D (difference); (M1 ∩ M2 )(d ) = min{M1 (d ), M2 (d )} for all d ∈ D (intersection); (n ·M)(d ) = nM(d ) for all d ∈ D (scalar product); M1 6= M2 if and only if there exists d ∈ D s.t. M1 (d ) 6= M2 (d ) (comparison); M1 4 M2 if and only if M1 (d ) ≤ M2 (d ) for all d ∈ D (inclusion); (M1 •M2 )(d ) = max {M1 (d ), M2 (d )} for all d ∈ D (merge); |M1 | = Σd∈D M1 (d ) (cardinality). We use the notation of a P formal sum i ∈ I Mi to denote the union of a family of multisets Mi , with i ∈ I , I being a finite set. It turns out that (MS(D ), 4) has the structure of a lattice (the lattice is complete provided a greatest element is added). In particular, merge and intersection are, respectively, the least upper bound and the greatest lower bound operators with respect to the multiset inclusion operator 4. Signatures Given a set of formulas P , we denote by ΣP the signature comprising the set of constant, function, and predicate symbols in P . We assume to have an infinite set V of variable symbols, usually noted x , y, z , etc. In order to deal with signature augmentation (due to the presence of universal quantification over goals) we also need an infinite set E of new constants (called eigenvariables). We denote by SigP the set of signatures which comprise at least the symbols in ΣP (and possibly some eigenvariables). TΣV denotes the set of non ground terms over Σ, i.e., the set of terms built over 44 M. Bozzano, G. Delzanno and M. Martelli Σ ∪ V where V is a denumerable set of variables. (A non ground term may have free variables; a ground term is also non ground). AV Σ denotes the set of non ground atoms over Σ, i.e., atomic formulas built over non ground terms over Σ. Multisets of atoms over AV Σ are also called facts throughout the paper, and usually noted A, B, C, . . .. Substitutions and Multiset Unifiers We inherit the usual concept of substitution (mapping from variables to terms) from traditional logic programming. We always consider a denumerable set of variables V, and substitutions are usually noted θ, σ, τ , . . . We use the notation [x 7→ t , . . .], where x is a variable and t is a term, to denote substitution bindings, with nil denoting the empty substitution. The application of a substitution θ to F , where F is a generic expression (e.g., a formula, a term, . . . ) is denoted by F θ. A substitution θ is said to be grounding for F if F θ is ground, in this case F θ is called a ground instance of F . Composition of two substitutions θ and σ is denoted θ ◦ σ, e.g., F (θ ◦ σ) stands for (F θ)σ. We indicate the domain of a substitution θ by Dom(θ), and we say “θ defined on a signature Σ” meaning that θ can only map variables in Dom(θ) to terms in TΣV . Substitutions are ordered with respect to the ordering ≤ defined in this way: θ ≤ τ if and only if there exists a substitution σ s.t. τ = θ ◦ σ. If θ ≤ τ , θ is said to be more general than τ ; if θ ≤ τ and τ ≤ θ, θ and τ are said to be equivalent. Finally, F V (F ), for an expression F , denotes the set of free variables of F , and θ|W , where W ⊆ V, denotes the restriction of θ to Dom(θ) ∩ W . We need the notion of most general unifier (mgu). The definition of most general unifier is somewhat delicate. In particular, different classes of substitutions (e.g., idempotent substitutions) have been considered for defining most general unifiers. We refer the reader to (Eder 1985; Lassez et al. 1988; Palamidessi 1990) for a discussion. Most general unifiers form a complete lattice with respect to the ordering ≤, provided a greatest element is added. For our purposes, we do not choose a particular class of most general unifiers, we only require the operation of least upper bound of two substitutions w.r.t ≤ to be defined and effective. The least upper bound of θ1 and θ2 is indicated θ1 ↑ θ2 . We refer the reader to (Palamidessi 1990) for the definition of the least upper bound. The only property which we use in this paper is that θ1 ≤ (θ1 ↑ θ2 ) and θ2 ≤ (θ1 ↑ θ2 ), for any substitutions θ1 and θ2 . We assume ↑ to be commutative and associative. We need to lift the definition of most general unifier from expressions to multisets of expressions. Namely, given two multisets A = {a1 , . . . , an } and B = {b1 , . . . , bn } (note that |A| = |B|), we define a most general unifier of A and B, written mgu(A, B), to be the most general unifier (defined in the usual way) of the two vectors of expressions ha1 , . . . , an i and hbi1 , . . . , bin i, where {i1 , . . . , in } is a permutation of {1, . . . , n}. Depending on the choice of the permutation, in general there is more than one way to unify two given multisets (the resulting class of mgu in general will include unifiers which are not equivalent). We use the notation θ = mgu(A, B) to denote any unifier which is non deterministically picked from the set of most general unifiers of A and B. Model Checking Linear Logic Specifications 45 Appendix B Proofs of Some Lemmas Proof of Lemma 1 If part. By induction on the derivation of I |=Σ ∆, C ◮ ǫ. - If ∆ = ⊤, ∆′ , obvious; - if ∆ = A and A + C ∈ IΣ , then also I |=Σ A ◮ C holds; - if ∆ = ∀x· G, ∆′ and I |=Σ,c G[c/x ], ∆′ , C ◮ ǫ, with c 6∈ Σ, then by the inductive hypothesis I |=Σ,c G[c/x ], ∆′ ◮ C, which implies I |=Σ ∀x· G, ∆′ ◮ C; - if ∆ = G1 & G2 , ∆′ , I |=Σ G1 , ∆′ , C ◮ ǫ and I |=Σ G2 , ∆′ , C ◮ ǫ, by the inductive hypothesis I |=Σ G1 , ∆′ ◮ C and I |=Σ G2 , ∆′ ◮ C, which implies I |=Σ G1 & G2 , ∆′ ◮ C; - if ∆ = G1 G2 , ∆′ or ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. & Only if part. By induction on the derivation of I |=Σ ∆ ◮ C. - If ∆ = ⊤, ∆′ , obvious; - if ∆ = A and A + C ∈ IΣ , then also I |=Σ A, C ◮ ǫ holds; - if ∆ = ∀x· G, ∆′ and I |=Σ,c G[c/x ], ∆′ ◮ C, with c 6∈ Σ, then by the inductive hypothesis I |=Σ,c G[c/x ], ∆′ , C ◮ ǫ, which implies I |=Σ ∀x· G, ∆′ , C ◮ ǫ; - if ∆ = G1 & G2 , ∆′ , I |=Σ G1 , ∆′ ◮ C and I |=Σ G2 , ∆′ ◮ C, by the inductive hypothesis I |=Σ G1 , ∆′ , C ◮ ǫ and I |=Σ G2 , ∆′ , C ◮ ǫ, which implies I |=Σ G1 & G2 , ∆′ , C ◮ ǫ; - if ∆ = G1 G2 , ∆′ or ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. & Proof of Lemma 2 i . By induction on the derivation of I1 |=Σ ∆ ◮ C. - If ∆ = ⊤, ∆′ , obvious; - if ∆ = A and A + C ∈ (I1 )Σ , then A + C ∈ (I2 )Σ , because I1 ⊆ I2 , therefore I2 |=Σ A ◮ C; - if ∆ = ∀x· G, ∆′ and I1 |=Σ,c G[c/x ], ∆′ ◮ C, with c 6∈ Σ, then by the inductive hypothesis I2 |=Σ,c G[c/x ], ∆′ ◮ C, which implies I2 |=Σ ∀x· G, ∆′ ◮ C; - if ∆ = G1 & G2 , ∆′ , I1 |=Σ G1 , ∆′ ◮ C and I1 |=Σ G2 , ∆′ ◮ C, by the inductive hypothesis I2 |=Σ G1 , ∆′ ◮ C and I2 |=Σ G2 , ∆′ ◮ C, which implies I2 |=Σ G1 & G2 , ∆′ ◮ C; - if ∆ = G1 G2 , ∆′ or ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. S∞ ii . By induction on the derivation of i=1 Ii |=Σ ∆ ◮ C. & - If ∆ = ⊤, ∆′ , then for every k ∈ N, Ik |=Σ ∆ ◮ C; S∞ - if ∆ = A and A + C ∈ ( i=1 Ii )Σ , there exists k ∈ N s.t. A + C ∈ (Ik )Σ , i.e., Ik |=Σ A ◮ C; 46 M. Bozzano, G. Delzanno and M. Martelli S∞ - if ∆ = ∀x· G, ∆′ and i=1 Ii |=Σ,c G[c/x ], ∆′ ◮ C, with c 6∈ Σ, then by the inductive hypothesis there exists k ∈ N s.t. Ik |=Σ,c G[c/x ], ∆′ ◮ C, therefore Ik |=Σ ∀x· G, ∆′ ◮ C; S∞ S∞ - if ∆ = G1 & G2 , ∆′ , i=1 Ii |=Σ G1 , ∆′ ◮ C and i=1 Ii |=Σ G2 , ∆′ ◮ C, by the inductive hypothesis there exist k1 , k2 ∈ N s.t. Ik1 |=Σ G1 , ∆′ ◮ C and Ik2 |=Σ G2 , ∆′ ◮ C. By taking k = max {k1 , k2 }, by i we get Ik |=Σ G1 , ∆′ ◮ C and Ik |=Σ G2 , ∆′ ◮ C, which implies Ik |=Σ G1 & G2 , ∆′ ◮ C; - if ∆ = G1 G2 , ∆′ or ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. & Proof of Lemma 4 i . By induction on the derivation of I Σ ∆ ◮ C ◮ θ. - If ∆ = ⊤, ∆′ , obvious; - assume ∆ = A, with B ∈ I (variant), B ′ 4 B, A′ 4 A, C = B \B ′ , and θ = mgu(B ′ , A′ )|F V (A,C) . We want to prove that [[I ]] |=Σ Aθθ′ ◮ C ′ θ′ for every substitution θ′ and fact C ′ < Cθ, i.e., Aθθ′ + Cθθ′ + Dθ′ ∈ [[I ]]Σ for every substitution θ′ and fact D. Now, Aθθ′ + Cθθ′ + Dθ′ = (Aθ + Cθ + D)θ′ = (A′ θ + (A\A′ )θ + (B\B ′ )θ + D)θ′ = (remember that B ′ 4 B) (A′ θ + (A\A′ )θ + (Bθ\B ′θ) + D)θ′ = Bθθ′ + ((A\A′ )θθ′ + Dθ′ ) ∈ [[I ]]Σ ; - if ∆ = ∀x· G, ∆′ and I Σ,c G[c/x ], ∆′ ◮ C ◮ θ, with c 6∈ Σ, then by the inductive hypothesis we have that [[I ]] |=Σ,c G[c/x ]θθ′ , ∆′ θθ′ ◮ C ′ θ′ for every substitution θ′ and fact C ′ < Cθ (where θ′ and C ′ are defined over Σ, c). Assuming that the variable x is not in the domain of θθ′ (it is always possible to rename the universally quantified variable x in ∀x· G), we have that [[I ]] |=Σ,c Gθθ′ [c/x ], ∆′ θθ′ ◮ C ′ θ′ , and, by definition of the judgment, we get [[I ]] |=Σ ∀x· (Gθθ′ ), ∆′ θθ′ ◮ C ′ θ′ , i.e., [[I ]] |=Σ (∀x· G, ∆′ )θθ′ ◮ C ′ θ′ , for every substitution θ′ and fact C ′ defined over Σ, c (and therefore also for every substitution θ′ and fact C ′ defined over Σ), with C ′ < Cθ; - assume ∆ = G1 & G2 , ∆′ and I Σ G1 & G2 , ∆′ ◮ C ◮ θ. We need to prove that [[I ]] |=Σ (G1 & G2 , ∆′ )θθ′ ◮ C ′ θ′ for every substitution θ′ and fact C ′ < Cθ, i.e., that [[I ]] |=Σ (G1 & G2 , ∆′ )θθ′ ◮ Cθθ′ + F θ′ for every substitution θ′ and fact F . By definition of Σ , we have that there exist facts C1′ 4 C1 , C2′ 4 C2 with |C1′ | = |C2′ |, and substitutions θ1 , θ2 , θ3 s.t. θ3 = mgu(C1′ , C2′ ), I Σ C = C1 + (C2 \C2′ ), G1 , ∆′ ◮ C1 ◮ θ1 and I θ = (θ1 ↑ θ2 ↑ θ3 )|F V (∆,C) , Σ G2 , ∆′ ◮ C2 ◮ θ2 · Model Checking Linear Logic Specifications 47 By the inductive hypothesis, we have that [[I ]] |=Σ (G1 , ∆′ )θ1 θ1′ ◮ C1 θ1 θ1′ + D1 θ1′ and [[I ]] |=Σ (G2 , ∆′ )θ2 θ2′ ◮ C2 θ2 θ2′ + D2 θ2′ for every substitutions θ1′ , θ2′ and facts D1 , D2 . By choosing D1 = (C2 \C2′ )θ1 + F1 and D2 = (C1 \C1′ )θ2 + F2 , we have, for every substitutions θ1′ , θ2′ and facts F1 , F2 , [[I ]] |=Σ (G1 , ∆′ )θ1 θ1′ ◮ (C1 + (C2 \C2′ ))θ1 θ1′ + F1 θ1′ , [[I ]] |=Σ (G2 , ∆′ )θ2 θ2′ ◮ (C2 + (C1 \C1′ ))θ2 θ2′ + F2 θ2′ · By definition of θ, we have that there exist substitutions γ1 , γ2 , γ3 and τ s.t. τ = θ1 ◦ γ1 , τ = θ2 ◦ γ2 , τ = θ3 ◦ γ3 , and θ = τ|F V (∆,C) · Now, let F1 be a variant of F θ′ with new variables, and define the substitution θ1′ s.t. Dom(θ1′ ) = Dom(γ1 ◦ θ′ ) ∪ F V (F1 ) (clearly these two ′ ′ ′ ′ latter sets are disjoint), θ1|Dom(γ ′ = γ1 ◦ θ and F1 θ1 = F θ . Do the 1 ◦θ ) ′ same for F2 , i.e., let it be another variant of F θ with new variables, and define θ2′ in the same way, so that Dom(θ2′ ) = Dom(γ2 ◦ θ′ ) ∪ F V (F2 ), ′ ′ ′ ′ θ2|Dom(γ ′ = γ2 ◦ θ , and F2 θ2 = F θ . 2 ◦θ ) From the definition of τ it follows that (G1 , ∆′ )θ1 θ1′ = (G1 , ∆′ )θ1 γ1 θ′ = (G1 , ∆′ )θθ′ , and similarly (G2 , ∆′ )θ2 θ2′ = (G2 , ∆′ )θθ′ . Also, (C1 + (C2 \ C2′ ))θ1 θ1′ = Cθ1 θ1′ = Cθθ′ . We also have that (C2 + (C1\C1′ ))θ2 θ2′ = (C2 + (C1\C1′ ))θ2 γ2 θ′ = (C2 + (C1\ C1′ ))τ θ′ = (C2 +(C1\C1′ ))θ3 γ3 θ′ = (remember that C1′ 4 C1 ) (C2 θ3 +(C1 θ3\ C1′ θ3 ))γ3 θ′ = (remember that θ3 is a unifier of C1′ and C2′ ) (C2 θ3 + (C1 θ3\ C2′ θ3 ))γ3 θ′ = (note that C2′ θ3 = C1′ θ3 4 C1 θ3 ) ((C2 θ3 + C1 θ3 )\C2′ θ3 )γ3 θ′ = (note that C2′ 4 C2 ) (C1 θ3 + (C2 θ3 \C2′ θ3 ))γ3 θ′ = (C1 + (C2 \C2′ ))θ3 γ3 θ′ = Cθ3 γ3 θ′ = Cθθ′ . By putting everything together, the inductive hypotheses become [[I ]] |=Σ (G1 , ∆′ )θθ′ ◮ Cθθ′ + F θ′ and [[I ]] |=Σ (G2 , ∆′ )θθ′ ◮ Cθθ′ + F θ′ , from which the thesis follows by definition of |=Σ ; - if ∆ = G1 G2 , ∆′ and I Σ G1 , G2 , ∆′ ◮ C ◮ θ, then by the inductive hypothesis we have that [[I ]] |=Σ (G1 , G2 , ∆′ )θθ′ ◮ C ′ θ′ , for every substitution θ′ and fact C ′ < Cθ. Therefore, [[I ]] |=Σ G1 θθ′ , G2 θθ′ , ∆′ θθ′ ◮ C ′ θ′ , and, by definition of the judgment, we get [[I ]] |=Σ (G1 G2 , ∆)θθ′ ◮ C ′ θ′ ; - if ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. & & ii . By induction on the derivation of [[I ]] |=Σ ∆θ ◮ C. - If ∆ = ⊤, ∆′ , take C ′ = ǫ, θ′ = nil , and σ = θ; 48 M. Bozzano, G. Delzanno and M. Martelli - assume [[I ]] |=Σ Aθ ◮ C and Aθ + C ∈ [[I ]]Σ = U pΣ (InstΣ (I )). Then there exist B ∈ I , a fact D, and a substitution τ (defined on Σ) s.t. Aθ + C = Bτ + D. We can safely assume, thanks to the substitution τ , that B is a variant of an element in I . Also, we can assume that Dom(τ ) ⊆ F V (B) and Dom(θ) ∩ Dom(τ ) = ∅. Now, take the substitution γ s.t. Dom(γ) = (Dom(θ) ∩ F V (A)) ∪ Dom(τ ), γ|Dom(θ)∩F V (A) = θ|Dom(θ)∩F V (A) and γ|Dom(τ ) = τ · We have that Aγ + C = Bγ + D. Let A′ 4 A and B ′ 4 B be two maximal sub-multisets s.t. A′ γ = B ′ γ, ρ = mgu(A′ , B ′ ), and θ′ = ρ|F V (A)∪F V (B\B′ ) . By definition of the Σ judgment, we have that I Σ A ◮ C ′ ◮ θ′ , where C ′ = B\B ′. As γ is a unifier for A′ ,B ′ , while ρ = mgu(A′ , B ′ ), we have that there exists a substitution σ s.t. γ = ρ ◦ σ. Therefore, θ|F V (A) = γ|F V (A) = (ρ ◦ σ)|F V (A) = (ρ|(F V (A)∪F V (B\B′ )) ◦ σ)|F V (A) = (θ′ ◦ σ)|F V (A) , as required. Furthermore, since Aγ + C = Bγ + D and A′ 4 A, it follows that A′ γ + (A\A′ )γ + C = B ′ γ + (B\B ′)γ + D, i.e., (A\A′ )γ + C = (B\B ′ )γ + D. By this equality and maximality of A′ and B ′ , we get that necessarily (B\B ′ )γ 4 C (otherwise, (B\B ′ )γ and (A\A′ )γ would have elements in common). Therefore, C ′ θ′ σ = (B\B ′)θ′ σ = (B\B ′ )ρσ = (B\B ′)γ 4 C, as required; - if ∆ = ∀x· G, ∆′ and [[I ]] |=Σ,c (G[c/x ], ∆′ )θ ◮ C, with c 6∈ Σ, then by the inductive hypothesis there exist a fact C ′ , and substitutions θ′ and σ (defined over Σ, c) s.t. I Σ,c G[c/x ], ∆′ ◮ C ′ ◮ θ′ , θ|F V (G[c/x ],∆′) = (θ′ ◦ σ)|F V (G[c/x ],∆′) , and C ′ θ′ σ 4 C. By definition of the Σ judgment, we get that I Σ ∀x· G, ∆′ ◮ C ′ ◮ θ′ · The conclusion follows (remember that we must ensure that C ′ , θ′ and σ are defined over Σ) by the following crucial observations: · Dom(θ′ ) ⊆ (F V (G[c/x ], ∆′ ) ∪ F V (C ′ )) by Lemma 3; · θ′ does not map variables in G[c/x ], ∆′ to the eigenvariable c. In fact we know that θ does not map variables in G[c/x ], ∆′ to c (by hypothesis) and we know that (θ′ ◦ σ)|F V (G[c/x ],∆′) = θ|F V (G[c/x ],∆′) ; · θ′ does not map variables in C ′ to c and C ′ itself does not contain c. In fact we know that C does not contain c (by hypothesis) and also that C ′ θ′ σ 4 C; · we can safely assume that Dom(σ) does not contain variables mapped to c. Intuitively, these bindings are useless. Formally, we can restrict Model Checking Linear Logic Specifications 49 the domain of σ to variables that are not mapped to c: with this restriction, the equalities θ|F V (G[c/x ],∆′) = (θ′ ◦ σ)|F V (G[c/x ],∆′) and C ′ θ′ σ 4 C still hold. - assume ∆ = G1 & G2 , ∆′ and [[I ]] |=Σ (G1 & G2 ∆′ )θ ◮ C. We need to prove that there exist a fact C ′ and substitutions θ′ and σ s.t. I Σ G1 & G2 , ∆′ ◮ C ′ ◮ θ′ , θ|F V (G1 ,G2 ,∆′ ) = (θ′ ◦ σ)|F V (G1 ,G2 ,∆′ ) , C ′ θ′ σ 4 C. By definition of |=Σ , we have that I |=Σ (G1 , ∆′ )θ ◮ C and I |=Σ (G2 , ∆′ )θ ◮ C· By the inductive hypothesis, we have that there exist facts C1 , C2 and substitutions θ1 , θ2 , σ1 , σ2 s.t. I Σ G1 , ∆′ ◮ C1 ◮ θ1 and I Σ G2 , ∆′ ◮ C2 ◮ θ2 , θ|F V (G1 ,∆′ ) = (θ1 ◦ σ1 )|F V (G1 ,∆′ ) , θ|F V (G2 ,∆′ ) = (θ2 ◦ σ2 )|F V (G2 ,∆′ ) , C1 θ1 σ1 4 C and C2 θ2 σ2 4 C. Now, let D1 4 C1 and D2 4 C2 s.t. D1 θ1 σ1 = D2 θ2 σ2 = C1 θ1 σ1 ∩ C2 θ2 σ2 . Let τ be the substitution (θ1 ◦ σ1 )|F V (G1 ,∆′ ,C1 ) ∪ (θ2 ◦ σ2 )|F V (G2 ,∆′ ,C2 ) ; τ is well defined because θ1 ◦ σ1 and θ2 ◦ σ2 both behave like θ on variables in F V (G1 , ∆′ ) ∩ F V (G2 , ∆′ ), and C1 , C2 do not have variables in common except for variables in G1 , G2 , ∆′ (note that new variants of elements in I are chosen every time the judgment Σ is computed). Now, D1 and D2 are unified by τ , because D1 τ = D1 θ1 σ1 = D2 θ2 σ2 = D2 τ . Therefore, there exists θ3 = mgu(D1 , D2 ) s.t. τ ≥ θ3 (θ3 is more general than τ ). Also, τ ≥ θ1 σ1 ≥ θ1 and τ ≥ θ2 σ2 ≥ θ2 . Therefore, τ is an upper bound for {θ1 , θ2 , θ3 } and there exist θ′ = (θ1 ↑ θ2 ↑ θ3 )|F V (G1 ,G2 ,∆′ ,C) , and a substitution γ s.t. τ = θ′ ◦ γ. Now we can apply the definition of Σ (rule for & ) and we get that I Σ G1 & G2 , ∆′ ◮ C ′ ◮ θ′ , where C ′ = C1 + (C2 \D2 ). Letting σ = γ, we can prove the thesis. First of all, since θ′ ◦ σ = θ′ ◦ γ = τ , and by definition of τ , we have that θ|F V (G1 ,G2 ,∆′ ) = (θ′ ◦ σ)|F V (G1 ,G2 ,∆′ ) . It remains to prove that C ′ θ′ σ 4 C holds. Now, we have C ′ θ′ σ = C ′ τ = C1 τ +C2 τ\D2 τ = C1 τ +C2 τ\D2 θ2 σ2 = C1 τ + C2 τ \(C1 θ1 σ1 ∩ C2 θ2 σ2 ) = C1 τ + C2 τ \(C1 τ ∩ C2 τ ) 4 C. The last passage holds because C1 τ 4 C and C2 τ 4 C (by definition of τ and by the inductive hypothesis) and relies on the following property of multisets: A 4 D and B 4 D implies A + B\(A ∩ B) 4 D; - if ∆ = G1 G2 , ∆′ of ∆ = ⊥, ∆′ , the conclusion follows by a straightforward application of the inductive hypothesis. & Proof of Lemma 5 i . Assume I1 Σ ∆ ◮ C ◮ θ and I1 ⊑ I2 . By item i of Lemma 4, [[I1 ]] |=Σ ∆θ ◮ Cθ. By item i of Lemma 2, [[I2 ]] |=Σ ∆θ ◮ Cθ. The conclusion then follows from item ii of Lemma 4; 50 M. Bozzano, G. Delzanno and M. Martelli F∞ ii . Assume i=1 Ii Σ ∆ ◮ C ◮ θ and I1 ⊑ I2 ⊑ . . .. By item i of Lemma 4, F∞ [[ i=1 Ii ]] |=Σ ∆θ ◮ Cθ, i.e., as it can be readily verified from Definition 5.6 S∞ and Definition 5.7, i=1 [[Ii ]] |=Σ ∆θ ◮ Cθ. By item ii of Lemma 2, there exists k ∈ N s.t. [[Ik ]] |=Σ ∆θ ◮ Cθ. The conclusion then follows from item ii of Lemma 4. Proof of Lemma 6 i . By simple induction on the derivation of I Σ1 ∆ ◮ C ◮ θ. ii . By induction on the derivation of [[I ]] |=Σ ∆ ◮ C. - If [[I ]] |=Σ ⊤, ∆ ◮ C, immediate; - assume [[I ]] |=Σ A ◮ C and A+C ∈ [[I ]]Σ . It follows that there exist B ∈ I , a fact D, and a substitution θ (defined on Σ) such that A + C = Bθ + D. Note that B is defined on ΣP by definition of (abstract) interpretation. Now, ⌈A⌉ + ⌈C⌉ = ⌈A + C⌉ = ⌈Bθ + D⌉ = ⌈Bθ⌉ + ⌈D⌉ = (remember that B is defined on ΣP ⊆ Σ1 ) B⌈θ⌉ + ⌈D⌉. We can conclude that ⌈A⌉ + ⌈C⌉ ∈ [[I ]]Σ1 (note that B ∈ I and ⌈θ⌉, ⌈D⌉ are defined on Σ1 ), it follows that [[I ]] |=Σ1 ⌈A⌉ ◮ ⌈C⌉; - assume [[I ]] |=Σ ∀x· G, ∆ ◮ C and [[I ]] |=Σ,c G[c/x ], ∆ ◮ C, with c 6∈ Σ. From Σ1 ⊆ Σ we get Σ1 , c ⊆ Σ, c, therefore we can apply the inductive hypothesis. It follows that [[I ]] |=Σ1 ,c ⌈G[c/x ], ∆⌉ ◮ ⌈C⌉ if and only if [[I ]] |=Σ1 ,c ⌈G[c/x ]⌉, ⌈∆⌉ ◮ ⌈C⌉ if and only if (remember that c 6∈ Σ\Σ1 because c 6∈ Σ) [[I ]] |=Σ1 ,c ⌈G⌉[c/x ], ⌈∆⌉ ◮ ⌈C⌉. By definition of |= (remember that c 6∈ Σ implies c 6∈ Σ1 ), we get [[I ]] |=Σ1 ∀x· ⌈G⌉, ⌈∆⌉ ◮ ⌈C⌉ if and only if [[I ]] |=Σ1 ⌈∀x· G, ∆⌉ ◮ ⌈C⌉ (we assume x to be disjoint with the variables introduced by the ⌈·⌉ construction); - the remaining cases follow by a straightforward application of the inductive hypothesis. References Abdulla, P. A., Cerāns, K., Jonsson, B., and Tsay, Y.-K. 1996. General Decidability Theorems for Infinite-State Systems. In Proceedings 11th Annual International Symposium on Logic in Computer Science (LICS’96). IEEE Computer Society Press, New Brunswick, New Jersey, 313–321. Abdulla, P. A. and Jonsson, B. 2001. Ensuring Completeness of Symbolic Verification Methods for Infinite-State Systems. Theoretical Computer Science 256, 1-2, 145–167. Andreoli, J.-M. 1992. Logic Programming with Focusing Proofs in Linear Logic. Journal of Logic and Computation 2, 3, 297–347. Andreoli, J.-M. and Pareschi, R. 1990. Linear Objects: Logical Processes with Built-In Inheritance. In Proceedings of the 7th International Conference on Logic Programming, D. Warren and P.Szeredi, Eds. MIT Press, Cambridge, MA, 495–510. Andreoli, J.-M. and Pareschi, R. 1991. Linear Objects: Logical Processes with Built-In Inheritance. New Generation Computing 9, 3-4, 445–473. Andreoli, J.-M., Pareschi, R., and Castagnetti, T. 1997. Static Analysis of Linear Logic Programming. New Generation Computing 15, 4, 449–481. Model Checking Linear Logic Specifications 51 Bossi, A., Gabbrielli, M., Levi, G., and Martelli, M. 1994. The s-Semantics Approach: Theory and Applications. Journal of Logic Programming 19-20, 149–197. Bozzano, M. 2002. A Logic-Based Approach to Model Checking of Parameterized and Infinite-State Systems. Ph.D. thesis, Università di Genova. Bozzano, M. and Delzanno, G. 2002. Automated Protocol Verification in Linear Logic. In Proceedings 4th International Conference on Principles and Practice of Declarative Programming (PPDP’02). ACM Press, Pittsburgh, Pennsylvania, 38–49. Bozzano, M., Delzanno, G., and Martelli, M. 2001. An Effective Bottom-Up Semantics for First Order Linear Logic Programs. In Proceedings 5th International Symposium on Functional and Logic Programming (FLOPS’01), H. Kuchen and K. Ueda, Eds. LNCS, vol. 2024. Springer-Verlag, Tokyo, Japan, 138–152. Bozzano, M., Delzanno, G., and Martelli, M. 2002. An Effective Fixpoint Semantics for Linear Logic Programs. Theory and Practice of Logic Programming 2, 1, 85–122. Cervesato, I. 1994. Petri Nets as Multiset Rewriting Systems in a Linear Framework. Unpublished manuscript. Draft available from URL http://theory.stanford.edu/∼iliano/forthcoming.html. Cervesato, I. 1995. Petri Nets and Linear Logic: a Case Study for Logic Programming. In Proceedings 1995 Joint Conference on Declarative Programming (GULP-PRODE’95), M. Alpuente and M. I. Sessa, Ed. Palladio Press, Marina di Vietri, Italy, 313–318. Cervesato, I., Durgin, N., Kanovich, M., and Scedrov, A. 2000. Interpreting Strands in Linear Logic. In Proceedings 2000 Workshop on Formal Methods and Computer Security (FMCS’00), H. Veith, N. Heintze, and E. Clarke, Eds. Chicago, Illinois. Cervesato, I., Durgin, N., Lincoln, P., Mitchell, J., and Scedrov, A. 1999. A Meta-notation for Protocol Analysis. In 12th Computer Security Foundations Workshop (CSFW’99), R. Gorrieri, Ed. IEEE Computer Society Press, Mordano, Italy, 55–69. Cervesato, I. and Pfenning, F. 2002. A Linear Logical Framework. Information and Computation 179, 1, 19–75. Delzanno, G. and Martelli, M. 2001. Proofs as Computations in Linear Logic. Theoretical Computer Science 258, 1-2, 269–297. Dickson, L. E. 1913. Finiteness of the Odd Perfect and Primitive Abundant Numbers with n Distinct Prime Factors. American Journal of Mathematics 35, 413–422. Durgin, N., Lincoln, P., Mitchell, J., and Scedrov, A. 1999. Undecidability of bounded security protocols. In Workshop on Formal Methods and Security Protocols (FMSP’99), R. Gorrieri, Ed. Trento, Italy. Eder, E. 1985. Properties of Substitutions and Unifications. Journal of Symbolic Computation 1, 31–46. Elliott, C. and Pfenning, F. 1991. A Semi-Functional Implementation of a HigherOrder Logic Programming Language. In Topics in Advanced Language Implementation, P. Lee, Ed. MIT Press, 289–325. Engberg, U. and Winskel, G. 1990. Petri nets as models of linear logic. In Proceedings of Colloquium on Trees in Algebra and Programming, A. Arnold, Ed. LNCS, vol. 389. Springer-Verlag, Copenhagen, Denmark, 147–161. Esparza, J., Finkel, A., and Mayr, R. 1999. On the Verification of Broadcast Protocols. In Proceedings 14th International Symposium on Logic in Computer Science (LICS’99). IEEE Computer Society Press, Trento, Italy, 352–359. Esparza, J. and Melzer, S. 2000. Verification of safety properties using integer programming: Beyond the state equation. Formal Methods in System Design 16, 159–189. Falaschi, M., Levi, G., Martelli, M., and Palamidessi, C. 1993. A Model-Theoretic Reconstruction of the Operational Semantics of Logic Programs. Information and Computation 103, 1, 86–113. 52 M. Bozzano, G. Delzanno and M. Martelli Farwer, B. 1999. A Linear Logic View of Object Petri Nets. Fundamenta Informaticae 37, 3, 225–246. Farwer, B. 2000. Linear Logic Based Calculi for Object Petri Nets. Logos Verlag. PhD thesis. Finkel, A. 1993. The minimal coverability graph for petri nets. In Advances in Petri Nets 1993, G. Rozenberg, Ed. LNCS, vol. 674. Springer Verlag, 210–243. Finkel, A. and Schnoebelen, P. 2001. Well-Structured Transition Systems Everywhere! Theoretical Computer Science 256, 1-2, 63–92. Gabbrielli, M., Dore, M. G., and Levi, G. 1995. Observable semantics for Constraint Logic Programs. Journal of Logic and Computation 5, 2, 133–171. Girard, J.-Y. 1987. Linear logic. Theoretical Computer Science 50:1, 1–102. Harland, J. and Winikoff, M. 1998. Making Logic Programs Reactive. In Proceedings Workshop on Transactions and Change in Logic Databases (Dynamics’98). Manchester, UK, 43–58. Higman, G. 1952. Ordering by divisibility in abstract algebras. Proceedings London Mathematical Society 2, 326–336. Hodas, J. and Miller, D. 1990. Representing Objects in a Logic Programming Language with Scoping Constructs. In Proceedins of 7th International Conference on Logic Programming, D. H. Warren and P. Szeredi, Eds. The MIT Press, Cambridge, MA, 511–526. Jensen, K. 1997. Coloured Petri-Nets. Basic Concepts, Analysis Methods and Practical Use. Volume 1, 2 and 3. Monographs in Theoretical Computer Science. Springer-Verlag. Karp, R. M. and Miller, R. E. 1969. Parallel Program Schemata. Journal of Computer and System Sciences 3, 2, 147–195. Kobayashi, N. and Yonezawa, A. 1994. Type-Theoretic Foundations for Concurrent Object-Oriented Programming. In Proceedings 9th Conference on Object Oriented Programming Systems, Languages and Applications (OOPSLA’94). SIGPLAN Notices, vol. 29. Portland, Oregon, 31–45. Kobayashi, N. and Yonezawa, A. 1995. Asynchronous Communication Model based on Linear Logic. Formal Aspects of Computing 7, 2, 113–149. Kopylov, A. P. 1995. Decidability of Linear Affine Logic. In Proceedings 10th Annual International Symposium on Logic in Computer Science (LICS’95), D. Kozen, Ed. IEEE Computer Society Press, San Diego, California, 496–504. Lassez, J.-L., Maher, J., and Marriott, K. 1988. Unification Revisited. In Foundations of Deductive Databases and Logic Programming, J. Minker, Ed. Morgan Kaufmann, 587–625. Lincoln, P. 1995. Deciding provability of linear logic formulas. In Advances in Linear Logic. London Mathematical Society Lecture Notes Series, vol. 222. Cambridge University Press. Lincoln, P., Mitchell, J., Scedrov, A., and Shankar, N. 1992. Decision problems for propositional linear logic. Annals of Pure and Applied Logic 56, 239–311. Also in the Proceedings of the 31th Annual Symposium on Foundations of Computer Science, St Louis, Missouri, October 1990, IEEE Computer Society Press. Also available as Technical Report SRI-CSL-90-08 from SRI International, Computer Science Laboratory. Lincoln, P. and Scedrov, A. 1994. First Order Linear Logic Without Modalities is NEXPTIME-Hard. Theoretical Computer Science 135, 139–154. Martı́-Oliet, N. and Meseguer, J. 1991. From Petri Nets to Linear Logic through Categories: A Survey. International Journal of Foundations of Computer Science 2, 4, 297–399. Model Checking Linear Logic Specifications 53 Mayr, E. W. 1984. An Algorithm for the General Petri Net Reachability Problem . SIAM J. Comput. 13, 441–460. McDowell, R., Miller, D., and Palamidessi, C. 1996. Encoding Transition Systems in Sequent Calculus. In Proceedings Linear Logic 96 Tokyo Meeting, J.-Y. Girard, M. Okada, and A. Scedrov, Eds. ENTCS, vol. 3. Elsevier, Keio University, Tokyo, Japan. Meseguer, J. 1992. Conditional Rewriting Logic as a Unified Model of Concurrency. Theoretical Computer Science 96, 1, 73–155. Miller, D. 1993. The π-Calculus as a Theory in Linear Logic: Preliminary Results. In Proceedings Workshop on Extensions of Logic Programming, E. Lamma and P. Mello, Eds. LNCS, vol. 660. Springer-Verlag, Bologna, Italy, 242–265. Miller, D. 1996. Forum: A Multiple-Conclusion Specification Logic. Theoretical Computer Science 165, 1, 201–232. Miller, D., Nadathur, G., Pfenning, F., and Scedrov, A. 1991. Uniform Proofs as a Foundation for Logic Programming. Annals of Pure and Applied Logic 51, 125–157. Milner, E. C. 1985. Basic wqo- and bqo-theory. In Graphs and Orders, I. Rival, Ed. D. Reidel Publishing Company, 487–502. Palamidessi, C. 1990. Algebraic properties of idempotent substitutions. In Proceedings 17th International Colloquium on Automata, Languages and Programming (ICALP ’90), M. S. Paterson, Ed. LNCS, vol. 443. Springer Verlag, Warwick University, England, 386–399. Silva, M., Teruel, E., and Colom, J. 1998. Linear Algebraic and Linear Programming Techniques for the Analysis of Place/Transition Net Systems. In Lectures in Petri Nets. I: Basic Models, G. Rozenberg and W. Reisig, Eds. LNCS, vol. 1491. Springer-Verlag, 309–373.
2cs.AI
ON TENSORING WITH THE STEINBERG REPRESENTATION arXiv:1804.00613v1 [math.RT] 2 Apr 2018 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE Abstract. Let G be a simple, simply connected algebraic group over an algebraically closed field of prime characteristic p > 0. Recent work of Kildetoft and Nakano and of Sobaje has shown close connections between two long-standing conjectures of Donkin: one on tilting modules and the lifting of projective modules for Frobenius kernels of G and another on the existence of certain filtrations of G-modules. A key question related to these conjectures is whether the tensor product of the rth Steinberg module with a simple module with pr th restricted highest weight admits a good filtration. In this paper we verify this statement when (i) p ≥ 2h − 4 (h is the Coxeter number), (ii) for all rank two groups, (iii) for p ≥ 3 when the simple module corresponds to a fundamental weight and (iv) for a number of cases when the rank is less than or equal to five. 1. Introduction 1.1. Let G be a simple, simply connected algebraic group scheme over the algebraically closed field k of characteristic p > 0. Let X be the set of weights and X+ denote the dominant integral weights. For any λ ∈ X+ , one can construct a non-zero module ∇(λ) = indG B λ and the Weyl module ∆(λ). The character of these modules is given by Weyl’s character formula. The finite dimensional simple modules L(λ) are indexed by dominant integral weights X+ and can be realized as the socle of ∇(λ) (and the head of ∆(λ)). A central idea in this area has been the concept of good and Weyl filtrations. A G-module admits a good filtration (resp. Weyl filtration) if and only if it admits a G-filtration with sections of the form ∇(µ) (resp. ∆(µ)) where µ ∈ X+ . Cohomological criteria have been proved by Donkin and Scott which give necessary conditions for a module to admit a good filtration (resp. Weyl filtration). A module which admits both a good and Weyl filtration is called a tilting module. Ringel proved that (i) for every λ ∈ X+ , there is a indecomposable tilting module T (λ) and (ii) every tilting module is a direct sum of these indecomposable tilting modules. Determining the characters of simple modules and tilting modules remains an open problem. In 2013, Williamson [Wi] produced families of counterexamples to the Lusztig conjecture for G = SLn and showed that the Lusztig Character Formula (LCF) in this case cannot hold for any linear bound on p relative to h (the associated Coxeter number). It is now evident that the character formula for simple modules will be highly dependent on the prime p. Therefore, this makes the understanding of the behavior of various G-filtrations even more crucial. A new approach has been introduced by Riche and Williamson [RW] that shows the characters of tilting modules and simple modules are given by p-Kazhdan-Lusztig polynomials that are constructed using p-Kazhdan-Lusztig bases. 1.2. Let λ ∈ X+ with unique decomposition λ = λ0 + pr λ1 with λ0 ∈ Xr (pr th restricted weights) and λ1 ∈ X+ . One can define ∇(p,r) (λ) = L(λ0 ) ⊗ ∇(λ1 )(r) where (r) denotes the twisting of the module action by the rth Frobenius morphism. A G-module M has a good (p, r)-filtration if and only if M has a filtration with factors of the form ∇(p,r) (µ) for suitable µ ∈ X+ . Let Str = L((pr − 1)ρ) Date: April 3, 2018. 2010 Mathematics Subject Classification. Primary 20G05, 20J06; Secondary 18G05. Research of the first author was supported in part by Simons Foundation Collaboration Grant 317062. Research of the second author was supported in part by NSF grant DMS-1701768. Research of the third author was supported in part by Simons Foundation Collaboration Grant 245236. Research of the fourth author was partially supported by NSF RTG grant DMS-1344994. 1 2 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE (which is also isomorphic to ∇((pr − 1)ρ) and ∆((pr − 1)ρ)) be the rth Steinberg module, where ρ is the sum of the fundamental weights. The following conjecture, introduced by Donkin at MSRI in 1990, interrelates good filtrations with good (p, r)-filtrations via the Steinberg module. Conjecture 1.2.1. Let M be a finite-dimensional G-module. Then M has a good (p, r)-filtration if and only if Str ⊗M has a good filtration. At the same meeting, Donkin presented another conjecture that realizes the injective hull, Qr (λ), for L(λ) over Gr as a tilting module, where Gr denotes the rth Frobenius kernel of G. Conjecture 1.2.2. For all λ ∈ Xr , T (2(pr − 1)ρ + w0 λ)|Gr = Qr (λ) where w0 denotes the long element in the Weyl group W . In exciting recent developments, it has been shown how these conjectures are related. Kildetoft and Nakano [KN15] proved that Conjecture 1.2.2 implies the forward direction of Conjecture 1.2.1 (which we will denote by “Conjecture 1.2.1(⇒)”). Sobaje [So] has proved that Conjecture 1.2.1 implies Conjecture 1.2.2. It is well-known that Conjecture 1.2.1(⇒) is equivalent to Str ⊗ L(λ) having a good filtration for all λ ∈ Xr . Using different approaches, Andersen [And01] and later Kildetoft and Nakano [KN15] verified Conjecture 1.2.1(⇒) when p ≥ 2h − 2. This paper is focused on the verification of Str ⊗ L(λ) having a good filtration for all λ ∈ Xr for many new cases. The reader should note that the connections to these various conjectures are quite striking. For example, if one discovers an example when Str ⊗ L(λ) does not have a good filtration for some λ ∈ Xr then Conjecture 1.2.2 would be false. It also should be mentioned that the verification of Conjecture 1.2.2 would prove the 40 year old Humphreys-Verma Conjecture about the existence of G-structures on injective indecomposable Gr -modules. Conjecture 1.2.2 holds for p ≥ 2h − 2 and the proof under this bound entails locating one particular G-summand of Str ⊗ L(λ). It has become evident that, in order to prove either conjecture for all p, one needs to analyze all G-summands of Str ⊗ L(λ). 1.3. The paper is organized as follows. In Section 2, we summarize the basic definitions and fundamental results on good (resp. good (p, r)-) filtrations. The following section, Section 3, is devoted to developing sufficient conditions to guarantee that Str ⊗ M has a good filtration for a rational G-module M . These sufficient conditions involve the mysterious Frobenius contraction functor studied by Gros and Kaneda [GK17] and Andersen [And17]. These results are used in Section 4 to prove that Str ⊗ L(λ) where λ ∈ Xr has a good filtration for (i) p ≥ 2h − 4 and (ii) for all rank two groups. The reader should note that Donkin’s Tilting Module Conjecture (i.e., Conjecture 1.2.2) is not known for all rank 2 groups. Later in this section, the aforementioned statement is proved for fundamental weights as long as one is not in the cases of E7 and E8 when p = 2. Section 5 is devoted to verifying Conjecture 1.2.1(⇒) for many cases when the rank of G is less than or equal to five. In Section 6, we carefully analyze the type A5 , p = 2 situation and verify the conjecture using new and detailed information. This is an important case because it is indicative of the cases of fundamental weights for E7 and E8 when p = 2, where the conjecture is not yet verified. At the end of the paper in Section 7, we consider the question of whether Str ⊗k[Gr ] has a good filtration, where k[Gr ] is regarded as a G-module by the conjugation action. 2. Preliminaries 2.1. Notation. Throughout this paper, the following basic notation will be used. (1) k: an algebraically closed field of characteristic p > 0. (2) G: a simple, simply connected algebraic group scheme over k, defined over Fp (the assumption of G being simple is for convenience and the results easily generalize to G reductive). ON TENSORING WITH THE STEINBERG REPRESENTATION (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) (31) (32) (33) (34) (35) 3 Dist(G): the distribution algebra of G. g = Lie(G): the Lie algebra of G. T : a maximal split torus in G. Φ: the corresponding (irreducible) root system associated to (G, T ). When referring to short and long roots, when a root system has roots of only one length, all roots shall be considered as both short and long. Φ± : the positive (respectively, negative) roots. S = {α1 , α2 , . . . , αn }: an ordering of the simple roots. B: a Borel subgroup containing T corresponding to the negative roots. U : the unipotent radical of B. E: the Euclidean space spanned by Φ with inner product h , i normalized so that hα, αi = 2 for α ∈ Φ any short root. X = X(T ) = Zω1 ⊕ · · · ⊕ Zωn: the weight lattice, where the fundamental dominant weights ωi ∈ E are defined by hωi , α∨ j i = δij , 1 ≤ i, j ≤ n. X+ = X(T )+ = Nω1 + · · · + Nωn : the dominant weights. Xr = Xr (T ) = {λ ∈ X(T )+ : 0 ≤ hλ, α∨ i < pr , ∀α ∈ S}: the set of pr -restricted dominant weights. F : G → G: the Frobenius morphism. Gr = ker F r : the rth Frobenius kernel of G. W : the Weyl group of Φ. w0 : the long element of the Weyl group. α∨ = 2α/hα, αi: the coroot of α ∈ R.P ρ: the Weyl weight defined by ρ = 12 α∈Φ+ α. h: the Coxeter number of Φ, given by h = hρ, α∨ 0 i + 1. α0 : the maximal short root. ≤ on X(T ): a partial ordering of weights, for λ, µ ∈ X(T ), µ ≤ λ if and only if λ − µ is a linear combination of simple roots with non-negative integral coefficients. M (r) : the module obtained by composing the underlying representation for a rational G-module M with F r . M ∗ : the k-linear dual module for a rational G-module M . λ∗ := −w0 λ, λ ∈ X: the dual weight. τ M : the dual module M ∗ for a rational G-module M with action composed with the anti-automorphism τ : G → G that interchanges positive and negative root subgroups. ∇(λ) := indG B λ, λ ∈ X+ : the induced module whose character is provided by Weyl’s character formula. ∆(λ), λ ∈ X+ : the Weyl module of highest weight λ. Thus, ∆(λ) ∼ = ∇(−w0 (λ))∗ . L(λ), λ ∈ X+ : the simple finite dimensional G-module with highest weight λ. T (λ), λ ∈ X+ : the indecomposable finite dimensional tilting G-module with highest weight λ. ∇(p,r)(λ) := L(λ0 ) ⊗ ∇(λ1 )(r) , λ ∈ X+ , where λ = λ0 + pr λ1 with λ0 ∈ Xr and λ1 ∈ X+ . ∆(p,r)(λ) := T (λ̂0 ) ⊗ ∆(λ1 )(r) , λ ∈ X+ , where λ = λ0 + pr λ1 with λ0 ∈ Xr and λ1 ∈ X+ . Here λ̂0 = 2(pr − 1)ρ + w0 λ0 . Str := L((pr − 1)ρ): the rth Steinberg module. Qr (λ), λ ∈ Xr : the injective hull (or equivalently, projective cover) of L(λ)|Gr as a Gr module. 2.2. Important G-Filtrations. Let M be a rational G-module. In this paper a G-filtration for M is an increasing sequence of G-submodules of M : M0 ⊆ M1 ⊆ · · · ⊆ M such that ∪i Mi = M . We now present the definition of a good filtration and a good (p, r)-filtration. Definition 2.2.1. Let M be a G-module 4 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE (a) M has a good filtration if and only if it has a G-filtration such that for each i, Mi+1 /Mi ∼ = ∇(λi ) where λi ∈ X+ . (b) M has a good (p, r)-filtration if and only if it has a G-filtration such that for each i, Mi+1 /Mi ∼ = ∇(p,r) (λi ) where λi ∈ X+ . (c) If M has a good (p, 1)-filtration, then we say that M has a good p-filtration. 2.3. Good Filtrations: Cohomological Criteria. The following well-known result due to Donkin [Don81, Cor. 1.3] and Scott [Sc] (cf. [Jan03, Proposition II.4.16]) gives very useful criteria to prove the existence of good filtrations. Theorem 2.3.1. Let M be a G-module. The following are equivalent (a) M has a good filtration. (b) Ext1G (∆(µ), M ) = 0 for all µ ∈ X+ . (c) ExtnG (∆(µ), M ) = 0 for all µ ∈ X+ , n ≥ 1. 2.4. Good Filtrations: Tensoring with the Steinberg. Kildetoft and Nakano [KN15, Theorem 9.2.3] proved a cohomological criteria that provides necessary and sufficient conditions for Str ⊗M to admit a good filtration. Theorem 2.4.1. Let M be a G-module with dim HomG (∆(p,r) (λ), M ) < ∞ for all λ ∈ X+ . The following are equivalent. (a) Str ⊗M has a good filtration. (b) HomGr (T (µ̂), M )(−r) has a good filtration for all µ ∈ Xr . (c) ExtnG (∆(p,r) (λ), M ) = 0 for all λ ∈ X+ , n ≥ 1. (d) Ext1G (∆(p,r) (λ), M ) = 0 for all λ ∈ X+ . Observe that if Conjecture 1.2.1 holds then Theorem 2.4.1 would give a cohomological criteria for a G-module M to admit a good (p, r)-filtration. 3. Good Filtrations on Str ⊗M 3.1. We will first introduce an important class of functors via the rth-Steinberg module that sends G-modules to G/Gr -modules. For µ ∈ Xr and a rational G-module M , set (3.1.1) Fµ (M ) = HomGr (k, Str ⊗ ∇(µ) ⊗ M ). The functor Fµ is an exact functor from Mod(G) → Mod(G/Gr ). We will call these functors generalized Frobenius contraction functors. When µ = (pr − 1)ρ these functors were introduced by Gros and Kaneda [GK17] and later investigated by Andersen [And17]. 3.2. The following theorem demonstrates that the functor Fµ can be expressed in terms of induction from B/Br to G/Gr . Theorem 3.2.1. Let µ ∈ X+ . Then  G/Gr r Tr . ∼ (a) Fµ (M ) = HomGr (k, indG B Str ⊗µ ⊗ M ) = indB/Br [µ − (p − 1)ρ ⊗ M ]  G/G (b) Ri indB/Brr [µ − (pr − 1)ρ ⊗ M ]Tr = 0 for i > 0. The B/Br -structures are given by the isomorphism ∼ HomB (k, Str ⊗µ ⊗ M ), [µ − (pr − 1)ρ ⊗ M ]Tr = r Proof. Consider the following isomorphic functors:  Gr F1 (−) = indG B (−)  G/G F2 (−) = indB/Brr (−)Br . ON TENSORING WITH THE STEINBERG REPRESENTATION 5 As each arises as a composition, we obtain two spectral sequences, whose abutments agree (since the functors are isomorphic): i+j Ê2i,j = ExtiGr (k, Rj indG F1 )(Str ⊗µ ⊗ M ) B (Str ⊗µ ⊗ M )) ⇒ (R G/G E2i,j = Ri indB/Brr ExtjBr (Str , µ ⊗ M ) ⇒ (Ri+j F2 )(Str ⊗µ ⊗ M ). Since Str is projective as a Gr -module the first spectral sequence collapses, one can identify the abutment and combine this with the second spectral sequence to obtain G/G E2i,j = Ri indB/Brr ExtjBr (Str , µ ⊗ M ) ⇒ HomGr (k, Ri+j indG B (Str ⊗µ ⊗ M )). This spectral sequence collapses and yields G/G Ri indB/Brr HomBr (Str , µ ⊗ M ) ∼ = HomGr (k, Ri indG B (Str ⊗µ ⊗ M )). The statement of (a) follows by setting i = 0. From the tensor identity and Kempf’s Vanishing Theorem, one has ∼ i G Ri indG B (Str ⊗µ ⊗ M ) = [R indB µ] ⊗ Str ⊗M = 0 when i > 0, which proves (b).  From the preceding theorem, it is interesting to note that, for any µ ∈ Xr , the B/Br -module ∼ HomB (k, Str ⊗µ ⊗ M ) [µ − (pr − 1)ρ ⊗ M ]Tr = r is acyclic with respect to the induction functor (r) indG (−). B (r) 3.3. Given µ ∈ Xr , let µ(r) := (pr − 1)ρ − µ ∈ Xr . Note that the correspondence µ with µ(r) gives a bijection on Xr . In particular, in Theorem 2.4.1(b), µ may be replaced with µ(r) . For any µ ∈ X, let prµ be the functor that sends a rational G-module to the component in the (linkage) block defined by µ (cf. [Jan03, II. 7.3]). The next result gives conditions using the projection and generalized Frobenius contraction functors to insure that Str ⊗ M has a good filtration. Theorem 3.3.1. Let M be a rational G-module. (a) If pr(pr −1)ρ (L(µ) ⊗ M ) has a good filtration for all µ ∈ Xr , then Str ⊗M has a good filtration.  G/G (b) If Fµ (M ) = indB/Brr [µ − (pr − 1)ρ ⊗ M ]Tr has a good filtration for all µ ∈ Xr , where the B/Br -structure is given by the isomorphism [µ − (pr − 1)ρ ⊗ M ]Tr ∼ = HomB (k, Str ⊗µ ⊗ M ), r then Str ⊗M has a good filtration. Proof. (a) Suppose that pr(pr −1)ρ (L(µ) ⊗ M ) has a good filtration for all µ ∈ Xr . Then Ext1G (Str ⊗∆(σ)(r) , L(µ) ⊗ M ) = 0 for all µ ∈ Xr and σ ∈ X+ . The Lyndon-Hochschild-Serre spectral sequence i+j E2i,j = ExtiG/Gr (∆(σ)(r) , ExtjGr (Str ⊗L(µ∗ ), M )) ⇒ ExtG (Str ⊗∆(σ)(r) , L(µ) ⊗ M ) collapses because Str is projective as a Gr -module and yields the isomorphism: Ext1G (Str ⊗∆(σ)(r) , L(µ) ⊗ M ) ∼ = Ext1G/Gr (∆(σ)(r) , HomGr (Str ⊗L(µ∗ ), M )). Therefore, HomGr (Str ⊗L(µ∗ ), M )) has a good filtration as a G/Gr -module. The G/Gr -module HomGr (T (µ̂(r) ), M ) is a direct summand of HomGr (Str ⊗L(µ∗ ), M ), because T (µ̂(r) ) is a G-direct summand of Str ⊗L(µ∗ ). Therefore, HomGr (T (µ̂(r) ), M ) has a G/Gr -good filtration. It follows by Theorem 2.4.1 that Str ⊗M has a good filtration. 6 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE (b) First observe that by [Jan03, II 12.2] HomGr (Str ⊗∆(µ∗ ), M ) ∼ = HomGr (Str , ∇(µ) ⊗ M ) G/Gr ∼ HomB (Str , µ ⊗ M ) = ind B/Br ∼ = G/G indB/Brr G/G ∼ = indB/Brr r HomTr ((pr − 1)ρ, µ ⊗ M )  [µ − (pr − 1)ρ ⊗ M ]Tr . Note as above that T (µ̂(r) ) is a G-direct summand of Str ⊗∆(µ∗ ) for µ ∈ Xr . Therefore, if  G/G indB/Brr [µ − (pr − 1)ρ, ⊗M ]Tr has a good filtration as a G/Gr -module for all µ ∈ Xr , then, by Theorem 2.4.1, Str ⊗M has a good filtration.  Note that in part (a) of the previous theorem the module L(µ) could be replaced by any of the following: ∇(µ), ∆(µ) or T (µ). 4. Applications: Tensoring with simple modules 4.1. In this section we will apply the results from the previous section to verify cases when Str ⊗L(λ) has a good filtration. In order to do so, the following result of Kildetoft and Nakano shows that it suffices to focus on the case when r = 1. Theorem 4.1.1. [KN15, Prop. 4.4.1] If St1 ⊗L(λ) has a good filtration for all λ ∈ X1 (T ), then Str ⊗L(λ) has a good filtration for all λ ∈ Xr (T ), r ≥ 1. 4.2. General bound on p. In [KN15, Thm. 5.3.1, Thm. 9.4.1] [And01, Prop. 2.1], it was shown that Str ⊗L(λ) has a good filtration for p ≥ 2h − 2. This bound agrees with the present state of Donkin’s Tilting Module Conjecture. The following result lowers the general bound for this to hold (as well as Conjecture 1.2.1(⇒)). Theorem 4.2.1. Let λ ∈ Xr (T ) and p ≥ 2h − 4. Then Str ⊗L(λ) has a good filtration. Proof. By Theorem 4.1.1, it suffices to prove this for r = 1, and we will do so by using the characterization given in Theorem 3.3.1(a) applied to M = L(λ). Suppose that µ, λ ∈ X1 (T ), and that St1 ⊗ L(γ)(1) is a composition factor of L(µ) ⊗ L(λ). Since (p − 1)ρ + pγ ≤ µ + λ, ∨ h(p − 1)ρ + pγ, α∨ 0 i ≤ hµ + λ, α0 i ≤ 2(p − 1)(h − 1). Thus hγ, α∨ 0i ≤ (p − 1) (h − 1) < h − 1. p From this, we have hγ + ρ, α∨ 0 i < 2(h − 1), so that hγ + ρ, α∨ 0 i ≤ 2h − 3. If p ≥ 2h − 3, then γ is contained in the closure of the fundamental alcove, and L(γ) ∼ = ∇(γ). This proves the result for p ≥ 2h − 3. The case when p = 2h − 4 only occurs if p = 2 and h = 3. But this result (indeed, the Tilting Module Conjecture as well) is known to hold for SL3 in characteristic 2, as the four restricted simple modules are all tilting in this case, and can be handled by [KN15, Theorem 9.4.1]. Therefore, the result holds when p ≥ 2h − 4.  ON TENSORING WITH THE STEINBERG REPRESENTATION 7 4.3. General bound on λ. One can also give a general upper bound on λ that will insure that tensoring the rth-Steinberg with a simple Gr -module will have a good filtration. r Proposition 4.3.1. If λ ∈ X(T )+ and hλ, α∨ 0 i ≤ 2p − 1, then Str ⊗L(λ) has a good filtration. Proof. We work again with the characterization in Theorem 3.3.1(a). Suppose that Str ⊗ L(γ)(r) is a composition factor of L(µ) ⊗ L(λ) for some µ ∈ Xr (T ). One has r ∨ hµ, α∨ 0 i ≤ h(p − 1)ρ, α0 i, so it follows that ∨ r pr hγ, α∨ 0 i ≤ hλ, α0 i ≤ 2p − 1. Thus r hγ, α∨ 0 i ≤ 2 − 1/p < 2, forcing γ to be minuscule and therefore L(γ) ∼ = ∇(γ).  4.4. Rank 2 groups. The following theorem completes work on rank two groups initiated in [KN15, Section 8]. Theorem 4.4.1. Assume the Lie rank of G is less than or equal to two. Then Str ⊗L(λ) has a good filtration for all λ ∈ Xr (T ). Proof. Again, we use Theorem 4.1.1 to reduce to the case that r = 1. In [KN15, 8.5], the claim was shown in all cases except for when Φ is of type G2 and p = 7, so we consider this case. Here h = 6 ∨ ∨ and α∨ 0 = 2α1 + 3α2 . Set λ = aω1 + bω2 with 0 ≤ a, b ≤ 6. We may assume that λ 6= 6ρ, so at least one of a or b is strictly less than 6. Suppose now that µ ∈ X1 (T ), and that St ⊗L(γ)(1) is a composition factor of L(µ) ⊗ L(λ). Then 7hγ, α∨ 0 i ≤ 2a + 3b ≤ 10 + 18 = 28, with equality occurring only if λ = 5ω1 + 6ω2 . So hγ, α∨ 0 i ≤ 4. Let γ = cω1 + dω2 with 0 ≤ c, d ≤ 6. i ≤ 4. So c ≤ 2, d ≤ 1, and at most one of c or d may be non-zero. Then 2c + 3d = hγ, α∨ 0 Case I. γ = 0: Then L(γ) = L(0) = k = ∇0 (0). Case II. γ = ω1 : This does not lie in the bottom alcove, however, there is nothing lower linked to it, and so L(ω1 ) = ∇0 (ω1 ). Case III. γ = ω2 : Similarly, this does not lie in the bottom alcove, however, there is nothing lower linked to it, and so L(ω2 ) = ∇0 (ω2 ). Case IV. γ = 2ω1 = 2α0 : Note that this is the same weight observed in [KN15, 8.5.4] to be problematic. Here L(2ω1 ) 6= ∇0 (2ω1 ). This situation occurs only if µ = (p − 1)ρ and λ = 5ω1 + 6ω2 . But HomG1 (St1 , St1 ⊗L(λ))(−1) ∼ = HomG1 (St1 ⊗ St1 , ⊗L(λ))(−1) , and it suffices to only check this for the tilting summand of highest weight in St1 ⊗ St1 . But 12ρ is not G1 -linked to λ, so HomG1 (T (12ρ)), L(λ))(−1) = 0.  Although we rely on [KN15, Section 8.2] to remove most of the cases, the results in this paper could have been used in other type G2 cases and lead to very short proofs for the other rank ≤ 2 groups. For example, Theorem 4.2.1 (and its proof) establish the result for SL2 and SL3 in all characteristics. For type B2 , we have h = 4, so that the result holds for all p ≥ 4 by Theorem 4.2.1, leaving only p = 2, 3 to check. If p = 2 and λ ∈ X1 (T ), then hλ, α∨ 0 i ≤ 3 = 2p − 1. If p = 3 and λ ∈ X1 (T ) is not the Steinberg weight (for which the result is clear), then hλ, α∨ 0 i ≤ 5 = 2p − 1. Thus, in both of these cases, the result holds by Proposition 4.3.1. 8 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE 4.5. Fundamental Weights. We now consider the case of a restricted irreducible G-module where the highest weight is a fundamental weight. Theorem 4.5.1. Let the Lie rank of G be n. Then (a) Str ⊗L(ωj ) has a good filtration for j = 1, 2, . . . , n and r ≥ 2. (b) St1 ⊗L(ωj ) has a good filtration for j = 1, 2, . . . , n, except possibly when p = 2 and Φ = E7 , E8 . (c) In the case when p = 2 and Φ = E7 or E8 , (i) St1 ⊗L(ωj ) has a good filtration for j 6= 4 when Φ = E7 (ii) St1 ⊗L(ωj ) has a good filtration for j 6= 4, 5 when Φ = E8 .  G/G Proof. We want to consider indB/Brr [µ − (pr − 1)ρ ⊗ L(ωj )]Tr for µ ∈ Xr (T ) and show it has a good filtration. This will occur if all the dominant weights in [µ − (pr − 1)ρ ⊗ L(ωj )]Tr are of the form pr δ with the property that H 0 (δ) = L(δ). Let pr δ be a dominant weight of [µ − (pr − 1)ρ ⊗ L(ωj )]Tr . Then pr δ = µ − (pr − 1)ρ + γ where γ is a weight of L(ωj ). Since µ ≤Q (pr − 1)ρ, it follows that (4.5.1) pr δ ≤Q γ. By taking the inner product with α∨ 0 , one obtains (4.5.2) 0 ≤ hδ, α∨ 0i ≤ 1 hωj , α∨ 0 i. pr Set h(j, r, p) = p1r hωj , α∨ 0 i. For types An , Bn , Cn , Dn , E6 and G2 , one has h(j, r, p) < 2 for all j, r. In these cases this implies that δ is either zero or minuscule and H 0 (δ) = L(δ). For type F4 , one can repeat this argument, but replacing α0 with the highest root, and obtain the same conclusion. In the case when Φ = E7 , one has h(j, r, p) < 2 unless j = 4, r = 1 and p = 2. For Φ = E8 , one has h(j, r, p) < 2 unless (i) j = ω3 , r = 1, p = 2; (ii) j = ω6 , r = 1, p = 2; (iii) j = ω5 , r = 1, p = 2; (iv) j = ω4 , r = 1, p = 2; (v) j = ω4 , r = 1, p = 3. For type E8 , the root lattice and the weight lattice coincide, so in this case pr δ ≤ γ ≤ ω j . Suppose δ 6= 0. Using [UGA, Figure 3], in cases (i), (ii), (v) it follows that δ = ω8 , and one has H 0 (δ) = L(δ) by [GGN17, Theorem 1.1]. One is left with cases (iii), (iv) for type E8 .  5. Higher Rank Cases 5.1. In this section, we consider the question of whether Str ⊗L(λ) has a good filtration for some higher rank groups over small primes. Here the results are less complete, and we will focus on the r = 1 situation. For those cases where we can show the following claim: (5.1.1) St1 ⊗L(λ) has a good filtration for all λ ∈ X1 , it will then follow from Theorem 4.1.1 that Str ⊗L(λ) has a good filtration for all λ ∈ Xr for r > 1. Note that L((p − 1)ρ) ≃ St1 , and the claim (5.1.1) always holds for this particular weight. For a given λ ∈ X1 , we may therefore assume throughout that λ 6= (p − 1)ρ. We again make use of Theorem 3.3.1(a). Suppose that St1 ⊗L(γ)(1) is a composition factor of L(µ) ⊗ L(λ) for γ ∈ X+ ON TENSORING WITH THE STEINBERG REPRESENTATION 9 and µ ∈ X1 . Our goal is to show that either no such γ and µ exist or that L(γ) = ∇(γ). Recall the notation µ(1) := (p − 1)ρ − µ. As in the proof of Theorem 4.2.1, we must have (5.1.2) pγ ≤ λ − µ(1) , from which we may conclude that (5.1.3) ∨ phγ, α∨ 0 i ≤ hλ, α0 i and phγ, α̃∨ i ≤ hλ, α̃∨ i, where α̃ denotes the highest root. These inequalities are often sufficient to eliminate options, but further reductions can also be made by noting that λ must be G1 -linked to µ(1) . 5.2. Rank 3 groups. For rank three groups, the claim (5.1.1) holds in almost all cases (cf. also [KN15, §8.3]). Theorem 5.2.1. Let G be of type A3 , B3 , or C3 and λ ∈ X1 . Then St1 ⊗L(λ) has a good filtration except possibly for the following cases: • Type B3 with p = 7: λ = (6, 5, 5), (6, 4, 5), (6, 5, 4), (5, 5, 5), (5, 5, 4), (5, 5, 4), (5, 4, 5), (4, 5, 5), (4, 5, 4), or (3, 5, 5), • Type C3 with p = 3: λ = (2, 1, 2) or (2, 2, 1), • Type C3 with p = 7: λ = (6, 5, 5), (6, 4, 5), (6, 5, 4), (5, 5, 5), or (4, 5, 5). Proof. The case of type A3 was shown by Kildetoft and Nakano [KN15, §8.3], but also follows from our previous results. By Theorem 4.2.1, we are reduced to p = 2 or 3. But those cases follow from Proposition 4.3.1. ∨ ∨ ∨ For type B3 , h = 6. By Theorem 4.2.1, we are done if p > 7. Note that α∨ 0 = 2α1 + 2α2 + α3 ∨ ∨ ∨ ∨ ∨ ∨ and α̃ = α1 + 2α2 + α3 , from which we see that hρ, α0 i = 5 and hρ, α̃ i = 4. For p = 2, Proposition 4.3.1 reduces us to λ = ω1 + ω2 . The only γ and µ satisfying (5.1.2) are γ = ω1 and µ = ρ (so L(µ) = St1 ). Since St1 ⊗L(ω1 + ω2 ) ⊂ St1 ⊗∇(ω1 + ω2 ), if St1 ⊗L(ω1 )(1) is a composition factor of St1 ⊗L(ω1 + ω2 ), then it is also a composition factor of St1 ⊗∇(ω1 + ω2 ). But, that is not the case based on explicit weight computations using LiE. For p = 3, applying both inequalities in (5.1.3), we are reduced to the following options for γ: ω1 , ω2 , ω3 , 2ω3 , or ω1 + ω3 . Applying (5.1.2) to γ = 2ω3 , we would need 6ω3 ≤ λ − µ(1) <Q 2ρ, which fails to hold. That leaves us with γ = ωi or ω1 + ω3 . For p 6= 2, each ∇(ωi ) is simple (cf. [Jan03, II.8.21]). Further, ∇(ω1 + ω3 ) is also known to be simple, except when p = 7 (cf. [GGN17]). For p = 5, (5.1.3) reduces us to γ = ω1 , ω2 , ω3 , 2ω3 , 3ω3 , ω1 + ω3 , or ω2 + ω3 . From (5.1.2), one has 5γ ≤ λ − δ <Q 4ρ. This fails to hold for γ = 3ω3 . While it is true that 5(ω2 + ω3 ) <Q 4ρ, there is no λ 6= 4ρ with 5(ω2 + ω3 ) ≤ λ − µ(1) . So this reduces us to γ = ωi , ω1 + ω3 , or 2ω3 . As noted above, each ∇(ωi ) and ∇(ω1 + ω3 ) is simple. Lastly, by explicit dimension computations of Lübeck [L], ∇(2ω3 ) is simple for all odd primes. For p = 7, from (5.1.3), we are reduced to the following options for γ: ω1 , ω2 , ω3 , 2ω1 , 2ω3 , 3ω3 , ω1 + ω2 , ω1 + ω3 , ω2 + ω3 , ω1 + 2ω3 . Using known facts and dimension computations of Lübeck [L], the only cases where ∇(γ) is not simple are γ = 2ω1 or ω1 + ω3 . Both can satisfy (5.1.2). In particular, for γ = 2ω1 , we can have λ − µ(1) = 6ρ − ω1 , 6ρ − ω2 , or 6ρ − 2ω3 . One can check that, in each case, λ is not G1 -linked to µ(1) . So this leaves only the second case of γ = ω1 + ω3 , which admits a large number of options for λ (and µ(1) ). However G1 -linkage holds only in the following cases: λ (6,5,5) (6,4,5) (6,5,4) (5,5,5) (5,5,4) (5,5,4) (5,5,5) (5,4,5) (4,5,5) (4,5,4) (3,5,5) µ(1) (3,0,0) (1,1,0) (2,0,1) (0,0,0) (0,0,1) (1,0,1) (2,0,0) (0,1,0) (1,0,0) (0,0,1) (0,0,0) ∨ ∨ ∨ ∨ ∨ ∨ ∨ For type C3 , we are again done if p > 7. In this case α∨ 0 = α1 +2α2 +2α3 and α̃ = α1 +α2 +α3 , ∨ ∨ from which we see that hρ, α0 i = 5 and hρ, α̃ i = 3. For p = 2, Proposition 4.3.1 reduces us to λ = ω2 + ω3 . The only weight γ satisfying (5.1.2) is γ = ω1 , which is miniscule. Hence, ∇(ω1 ) is simple. 10 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE For p = 3, (5.1.3) reduces us to γ = ωi for some 1 ≤ i ≤ 3. Again, ∇(ω1 ) is simple. Premet and Suprunenko [PrSu] showed that ∇(ω2 ) is simple if an only if p 6= 3 and ∇(ω3 ) is simple if and only if p 6= 2. So we are reduced to the case γ = ω2 , which does satisfy (5.1.2) for many values of λ − µ(1) . The following table summarizes the possible cases where λ is G1 -linked to µ(1) . λ (2,1,2) (2,1,2) (2,2,1) (2,0,2) µ(1) (0,0,0) (0,1,0) (1,0,0) (0,0,0) With some further investigation, we can eliminate two of those four options. For ν ∈ X1 , set 1T Z1 (ν) := coindG (ν). First, suppose that λ = (2, 0, 2) and µ(1) = (0, 0, 0) (the last case). Then B1+ T ∼ St1 . We are reduced to showing that pr µ = (p − 1)ρ and L(µ) = (St1 ⊗L(λ)) has a good (p−1)ρ filtration or, equivalently, that N := HomG1 (St1 , St1 ⊗L(λ))(−1) has a good filtration. This can only fail if L(ω2 ) is a composition factor of N . The weight-space multiplicity of 5ω2 in St1 is one. It follows that Z1 (2ρ + 5ω2 ) = Z1 (2(p − 1)ρ − λ + pω2 ) appears exactly once as a section of the G1 T module St1 ⊗ St1 . Moreover, the only weights in St1 ⊗ St1 that are higher than 2(p − 1)ρ − λ + pω2 are 4ρ, 4ρ − α1 , and 4ρ − α3 . The weight 2(p − 1)ρ − λ + pω2 is not strongly linked to any of these. Hence, 2(p − 1)ρ − λ + pω2 is a maximal weight inside St1 ⊗ St1 . It follows that Q1 (λ + pω2 ) appears exactly once as a summand of the G1 T -module St1 ⊗ St1 and that L(ω2 ) appears exactly once as a composition factor of N . By the same argument we can conclude that the induced module ∇(2(p − 1)ρ − λ + pω2 ) also appears exactly once as a section in the good filtration of the G-module St1 ⊗ St1 . The fact that 2(p − 1)ρ − λ + pω2 is a maximal weight in St1 ⊗ St1 says that the tilting module T (2(p − 1)ρ − λ + pω2 ) ∼ = T (2(p − 1)ρ − λ) ⊗ T (ω2 )(1) is a summand of the tilting module St1 ⊗ St1 . This implies that the tilting module T (ω2 ) is a summand of N . Since the multiplicity of L(ω2 ) in N is one, it appears inside this summand. All other composition factors L(η) of N satisfy L(η) ∼ = ∇(η). One concludes that N is tilting, and thus has a good filtration, eliminating the weight (2, 0, 2) from the above list. Consider now the second case in the above list: λ = (2, 1, 2) and µ(1) = (0, 1, 0). Then µ = (p − 1)ρ − µ(1) = λ. An argument similar to the preceding case shows that pr(p−1)ρ (T (λ) ⊗ L(λ)) has a good filtration, which eliminates this case as well, leaving only the following unknown cases: λ (2,1,2) (2,2,1) µ(1) (0,0,0) (1,0,0) For p = 5, (5.1.3) reduces us to the following options for γ: ω1 , ω2 , ω3 , 2ω1 , ω1 + ω2 , or ω1 + ω3 . Here we know the simplicity of ∇(ωi ) for each i. From dimension computations of Lübeck [L], ∇(2ω1 ) is simple for p > 2, ∇(ω1 + ω2 ) is simple if and only if p 6= 3 or 7, and ∇(ω1 + ω3 ) is simple if and only if p > 3. In particular, all are simple for p = 5. For p = 7, (5.1.3) reduces us to the following options for γ: ω1 , ω2 , ω3 , 2ω1 , 2ω2 , 2ω3 , ω1 + ω2 , ω1 + ω3 , ω2 + ω3 . From previous discussions, the only cases where ∇(γ) is not simple are γ = 2ω2 , ω1 + ω2 . Both can satisfy (5.1.2). For γ = 2ω2 , there are three options for λ : 6ω1 + 5ω2 + 6ω3 (with µ(1) = 0); 4ω1 +6ω2 +6ω3 (with µ(1) = 0); and 5ω1 +6ω2 +6ω3 (with µ(1) = ω1 ). However, one can directly check that in each case λ and µ(1) are not G1 -linked. In the second case (γ = ω1 + ω2 ), there are numerous values of λ that satisfy (5.1.2), however G1 -linkage holds only in the following cases: λ (6,5,5) (6,4,5) (6,5,4) (5,5,5) (4,5,5) µ(1) (0,0,0) (0,1,0) (0,0,1) (1,0,0) (0,0,0)  ON TENSORING WITH THE STEINBERG REPRESENTATION 11 5.3. Rank 4 groups. In types A4 and D4 , the claim also holds in almost all cases. While potentially problematic weights are not listed explicitly in the following theorem, some information is provided in the proof. Theorem 5.3.1. Assume G is of type A4 or D4 and λ ∈ X1 . Then St1 ⊗L(λ) has a good filtration except possibly for the following cases: • Type A4 with p = 5, • Type D4 with p = 7. Proof. We first consider type A4 , where h = 5. By Theorem 4.2.1, we are done for p > 5. For p = 2, the result follows from Proposition 4.3.1. For p = 3, one could again eliminate many λ via Proposition 4.3.1. However, we more directly focus on the weight γ. First, (5.1.3) reduces us to γ = ωi + ωj for i, j ∈ {1, 2, 3, 4}. Of those, the only weights potentially satisfying (5.1.2) are γ = ω1 + ω3 , ω2 + ω4 , or ω1 + ω4 . However, in each case ∇(γ) is simple, as can be seen by using Jantzen’s algorithm [Jan73, Satz 9] (cf. also [Jan03, II.8.21]) for checking the simplicity of a standard induced module in type An . For p = 5, using (5.1.3), (5.1.2), and Jantzen’s algorithm for simplicity, one can reduce the problem to just one possible value of γ: ω1 + ω4 = α0 . We have the following values of λ and µ(1) which are G1 -linked and satisfy (5.1.2). λ (4,3,3,4) (4,3,2,4) (4,2,3,4) (3,3,2,4) (3,2,3,4) (4,3,2,3) (4,2,3,3) µ(1) (2,0,0,2) (1,1,0,1) (1,0,1,1) (0,1,0,1) (0,0,1,1) (1,1,0,0) (1,0,1,0) λ (4,3,3,3) (3,3,3,4) (2,3,3,4) (4,3,3,2) (4,3,1,4) (4,1,3,4) (4,2,2,4) µ(1) (2,0,0,1) (1,0,0,2) (0,0,0,2) (2,0,0,0) (0,2,0,0) (0,0,2,0) (0,1,1,0) λ (3,3,3,3) (3,3,3,3) (2,3,3,3) (3,2,3,3) (3,3,2,3) (3,3,3,2) (2,3,3,2) µ(1) (1,0,0,1) (0,0,0,0) (0,0,0,1) (0,0,1,0) (0,1,0,0) (1,0,0,0) (0,0,0,0) ∨ ∨ ∨ For type D4 , h = 6. By Theorem 4.2.1, we are done if p > 7. We have α∨ 0 = α̃ = α1 + 2α2 + ∨ ∨ + α4 , and so hρ, α0 i = 5. For p = 2, using (5.1.3) and (5.1.2), we are reduced to γ = ω1 , ω2 , or ω3 . But all those weights are miniscule, giving a simple ∇(γ). For p = 3, many values of γ satisfy (5.1.3). Using dimension computations of Lübeck [L], one finds that the only cases where ∇(γ) is not simple are as follows: 3ω1 , 3ω3 , 3ω4 , ω1 + ω2 , ω2 + ω3 , ω2 + ω4 , and ω1 + ω3 + ω4 . By direct verification, none of these can satisfy (5.1.2). For p = 5, similarly, (5.1.3) and dimension computations of Lübeck [L] reduce us to the following options for γ: 3ωi , i ∈ {1, 3, 4}; 4ωi , i ∈ {1, 3, 4}; 2ωi + ωj , i, j ∈ {1, 3, 4}, i 6= j; 3ωi + ωj , i, j ∈ {1, 3, 4}, i 6= j; 2ωi + 2ωj , i, j ∈ {1, 3, 4}, i 6= j; ωi + 2ω2 , i ∈ {1, 3, 4}; and ω2 + ωi + ωj , i, j ∈ {1, 3, 4}, i 6= j. One then checks that (5.1.2) fails to hold in all cases. For p = 7, as above, (5.1.3) and Lübeck’s computations reduce us to the following options for γ: ωi + ω2 , i ∈ {1, 3, 4}, 2ω2 . Unfortunately, (5.1.2) can hold here. In the case γ = 2ω2 , the only values of λ and µ(1) that work are as follows: α∨ 3 λ (6,5,6,6) (4,6,6,6) (6,6,4,6) (6,6,6,4) (5,6,6,6) (6,6,5,6) (6,6,6,5) µ(1) (0,0,0,0) (0,0,0,0) (0,0,0,0) (0,0,0,0) (1,0,0,0) (0,0,1,0) (0,0,0,1) One can check that in each case λ is not G1 -linked to µ(1) . So that case is eliminated. In the first (symmetric) cases for γ, there are options for λ and µ(1) where linkage holds. For example, for γ = ω1 + ω2 , one has the following cases where G1 -linkage holds between λ and µ(1) : λ (6,4,5,5) (4,5,5,5) (5,5,5,5) (6,5,5,5) µ(1) (0,1,0,0) (0,0,0,0) (1,0,0,0) (2,0,0,0) 12 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE Similar cases would exist for µ1 = ω2 + ω3 and µ1 = ω2 + ω4 . Additional cases may also exist, as a complete list has not been computed.  For types B4 and C4 , h = 8, and the claim holds for p > 7. No investigation has been made for small primes. For type F4 , h = 12, and we are done if p > 17. We make some observations for p = 2. We have ∨ ∨ ∨ ∨ ∨ ∨ ∨ ∨ ∨ ∨ ∨ α0 = 2α∨ 1 + 4α2 + 3α3 + 2α4 and α̃ = 2α1 + 3α2 + 2α3 + α4 . So hρ, α0 i = 11 and hρ, α̃ i = 8. The ∨ ∨ inequalities in (5.1.3) force hγ, α0 i ≤ 5 and hγ, α̃ i ≤ 3. One has the following options: γ = ω1 , ω2 , ω3 , ω4 , 2ω4 , ω1 + ω4 , or ω3 + ω4 . The case γ = ω3 + ω4 may be eliminated as it does not satisfy (5.1.2), and the case case γ = ω4 may be eliminated as ∇(ω4 ) is simple (for p = 2) by [Jan91]. One finds the following possibilities where (5.1.2) holds and λ is G1 -linked to µ(1) : λ µ(1) (1,1,0,1) (0,0,0,0), (0,0,1,0), (0,0,0,1), (0,0,0,2) (1,1,1,0) (0,0,0,0), (1,0,0,0), (0,0,1,0), (0,0,0,1), (1,0,0,1) (0,1,1,0) (0,0,0,1) (1,1,0,0) (0,0,0,1) 5.4. Type A5 . For type A5 , h = 6. By Theorem 4.2.1, we are done for p > 7. In contrast to the smaller rank cases, even for p = 2, our earlier methods do not completely resolve the issue. Using (5.1.3), (5.1.2), and Jantzen’s simplicity algorithm, one is reduced to one case: λ = ω1 +ω2 +ω4 +ω4 with µ(1) = 0 and γ = ω1 + ω5 . Note that λ is indeed G1 -linked to the zero weight. However, through an intricate analysis of the modules involved, in Section 6, we are able to address this case. See Theorem 6.4.4. For p = 3, 5, or 7, there will be many more options for λ that cannot be dealt with by the above methods. 5.5. Summary. For λ ∈ X1 , St1 ⊗L(λ) has a good filtration in the following cases: • Type An : p > 2n − 3 • Type A2 : all primes • Type A3 : all primes • Type A4 : p 6= 5 • Type A5 : p 6= 3, 5, 7 • Type Bn : p > 4n − 5 • Type B2 (equivalently C2 ): all primes • Type B3 : p 6= 7 • p = 7 case, all except λ = (6, 5, 5), (6, 4, 5), (6, 5, 4), (5, 5, 5), (5, 5, 4), (5, 5, 4), (5, 4, 5), (4, 5, 5), (4, 5, 4), or (3, 5, 5) • Type Cn : p > 4n − 5 • Type C3 : p 6= 3, 7 • p = 3 case, all except λ = (2, 1, 2) or (2, 2, 1) • p = 7 case, all except λ = (6, 5, 5), (6, 4, 5), (6, 5, 4), (5, 5, 5), or (4, 5, 5) • Type Dn : p ≥ 4n − 9 • Type D4 : p 6= 7 • Type E6 : p > 19 • Type E7 : p > 31 • Type E8 : p > 53 • Type F4 : p > 19 • p = 2 case, reduced to λ = (1, 1, 0, 1), (1, 1, 1, 0), (0, 1, 1, 0) or (1, 1, 0, 0) • Type G2 : all primes ON TENSORING WITH THE STEINBERG REPRESENTATION 13 6. A Detailed Analysis In Characteristic 2 In this section we investigate two very similar situations in which a proof that St1 ⊗L(λ) has a good filtration is beyond the reach of our earlier arguments. In particular, basic weight combinatorics are not conclusive, and thus it becomes necessary to better understand the submodule structure of a tensor product of G-modules. We show in one of the two cases that we are able to verify that St1 ⊗L(λ) does have a good filtration, which allows us to conclude that Conjecture 1.2.1 (⇒) holds. That this holds in such a nontrivial setting could be viewed as the strongest evidence yet for its truth in arbitrary characteristic. However, if this is indeed true, one will need to find the underlying reason why it holds in situations similar to those considered here. 6.1. Unless otherwise noted, we assume throughout this section that p = 2. Further, we assume that (i) G = SL6 (type A5 ) and λ = ω1 + ω2 + ω4 + ω5 or (ii) G is of type E7 and λ = ω4 . In either case, 2α0 appears as a weight in L(λ). Therefore St1 ⊗L(α0 )(1) is a composition factor of St1 ⊗L(λ). At the same time, ∆(α0 ) ∼ = g (the adjoint representation), and L(α0 ) ∼ = g/z(g), with z(g) denoting the one-dimensional center of g. Since L(α0 )(1) ( ∇(α0 )(1) , St1 ⊗L(α0 )(1) ( St1 ⊗∇(α0 )(1) ∼ = ∇(ρ + 2α0 ), and so the composition factor St1 ⊗L(α0 )(1) does not have a good filtration. We note that G is simply-laced, so that α0 is the highest root. For SL6 , we have α0 = ω1 + ω5 , while, for E7 , α0 = ω1 . For G = SL6 , the other dominant weights γ such that 2γ is a weight of ∆(λ) are γ = 0, ω3 . For G of type E7 , they are γ = 0, ω7 . ∼ For G = SL6 , we have L(ω3 ) = ∇(ω3 ), and for G of type E7 , we have L(ω7 ) ∼ = ∇(ω7 ). Neither module (for the given G) extends nor can be extended by L(α0 ). Furthermore, we have in both cases that Ext1G (k, L(α0 )) ∼ = Ext1G (L(α0 ), k) ∼ = k. These one-dimensional extension groups are accounted for by the indecomposable modules ∆(α0 ) and ∇(α0 ). One may further check by standard long exact sequence computations that Ext1G (∇(α0 ), L(α0 )) = 0; Ext1G (L(α0 ), ∇(α0 )) = 0; ∼ k. Ext1 (∇(α0 ), k) = Ext1G (k, ∇(α0 )) = 0; G Applying the τ -functor, which interchanges Weyl and induced modules, while preserving simple (and tilting) modules, we obtain all extensions involving ∆(α0 ), k, and L(α0 ). Summarizing, the collection of indecomposable G-modules having composition factors coming from the collection {k, L(α0 )} are (up to isomorphism) {k, L(α0 ), ∇(α0 ), ∆(α0 ), T (α0 )}. The structure of the tilting module T (α0 ) is given by the exact sequence 0 → k → T (α0 ) → ∇(α0 ) → 0. Via the equivalence of categories between G-mod and its Steinberg block, it follows that an indecomposable summand of St1 ⊗L(λ) that contains St1 ⊗L(α0 )(1) as a composition factor must be isomorphic to one of the following: {St1 ⊗L(α0 )(1) , St1 ⊗∇(α0 )(1) , St1 ⊗∆(α0 )(1) , St1 ⊗T (α0 )(1) }. Note that, if we instead work with St1 ⊗∆(λ), the only possibilities from this list are the two involving the Weyl module or the tilting module. One can also make the deduction about the module structures above by working with the truncated category obtained by looking at the full 14 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE subcategory of rational G-modules having composition factors with highest weight less than or equal to α0 (and linked to α0 ). This category has finite representation type. Lemma 6.1.1. Assume p = 2. Let G be of type A5 with λ = ω1 + ω2 + ω4 + ω5 or G be of type E7 with λ = ω4 . The summands of St1 ⊗L(λ) containing the composition factor St1 ⊗L(α0 )(1) all have a good filtration if and only if HomG (St1 ⊗L(α0 )(1) , St1 ⊗L(λ)) = 0. Proof. By the previous discussion, if HomG (St1 ⊗L(α0 )(1) , St1 ⊗L(λ)) = 0, then the only relevant summands that can appear in St1 ⊗L(λ) are of the form St1 ⊗T (α0 )(1) and St1 ⊗∆(α0 )(1) , thus these summands have a Weyl filtration. Now, St1 ⊗L(λ) is τ -invariant. Further, if M is a summand of St1 ⊗L(λ), then τ M is isomorphic to a summand of St1 ⊗L(λ) having the same composition factors. It follows then that a summand containing the factor St1 ⊗L(α0 )(1) also has a good filtration. The converse is established by the reverse implication of each step in the argument.  6.2. In order to analyze this situation further, we need to establish some basic facts about tensor products of modules. Note that the results in this subsection hold under our general assumption on G, and Lemmas 6.2.1 and 6.2.2 hold for arbitrary primes p. Recall that for a B-module M , there is an “evaluation map” εM : indG B M → M which induces one direction of the Frobenius reciprocity bijection [Jan03, I.3.4]. Lemma 6.2.1. Let M be a B-module and N, N ′ be G-modules. Composition with the B-module homomorphism εM ⊗ id defines a bijection ∼ HomG (N ′ , (indG → HomB (N ′ , M ⊗ N ). BM ) ⊗ N ) − Proof. As recalled above, composition with εM ⊗N defines a bijection ∼ HomG (N ′ , indG → HomB (N ′ , M ⊗ N ). B (M ⊗ N )) − The “tensor identity” in [Jan03, I.3.6] is established by a canonical isomorphism ∼ indG → (indG B (M ⊗ N ) − B M ) ⊗ N. This isomorphism is specified via canonical embeddings G indG B (M ⊗ N ) ֒→ M ⊗ N ⊗ k[G] ←֓ (indB M ) ⊗ N, together with an automorphism of M ⊗N ⊗k[G] that sends the embedding on the left isomorphically onto the embedding on the right. Now, the morphisms εM ⊗ id and εM ⊗N both come from these embeddings, by restricting the map id ⊗ id ⊗ εG : M ⊗ N ⊗ k[G] → M ⊗ N ⊗ k, where εG is the counit map on k[G], to each embedded subgroup. This proves the claim.  Lemma 6.2.2. Let µ, λ ∈ X(T )+ , and let vµ and zλ denote highest weight vectors of the modules ∆(µ) and L(λ) respectively. Let M be any G-module. If φ : ∆(µ) → M ⊗ L(λ) is a non-zero homomorphism of G-modules, then there is some 0 6= m ∈ M such that ! X φ(vµ ) = (m ⊗ zλ ) + y, with y ∈ M ⊗ L(λ)σ . σ<λ ON TENSORING WITH THE STEINBERG REPRESENTATION 15 Proof. There is a canonical inclusion HomG (∆(µ), M ⊗ L(λ)) ֒→ HomG (∆(µ), M ⊗ ∇(λ)). By Lemma 6.2.1, the B-module homomorphism id⊗ε λ M ⊗ ∇(λ) −−−→ M ⊗λ induces a bijection HomG (∆(µ), M ⊗ ∇(λ)) ∼ = HomB (∆(µ), M ⊗ λ). As a B-module, ∆(µ) is generated by vµ , thus a non-zero B-homomorphism from ∆(µ) to any B-module must send vµ to a non-zero element. We have a vector space decomposition ! X M ⊗ ∇(λ) = M ⊗ zλ + M ⊗ ∇(λ)σ . σ<λ The result then follows by noting that id ⊗ ελ sends M⊗ X ∇(λ)σ σ<λ ! → 0.  Lemma 6.2.3. Assume p = 2. Let wρ+2α0 be a highest weight vector of St1 ⊗∆(α0 )(1) and wρ be a maximal vector generating the simple submodule St1 ⊗k ≤ St1 ⊗∆(α0 )(1) . There is some X ∈ Dist(U ) of weight −2α0 such that X.wρ+2α0 = wρ . The comultiplication of X in Dist(U ) is given by ∆(X) = X ⊗ 1 + 1 ⊗ X + where for each i X Xi′ ⊗ Xi′′ , −2α0 < wt(Xi′ ), wt(Xi′′ ) < 0. Proof. The Weyl module ∆(ρ + 2α0 ) ∼ = St1 ⊗∆(α0 )(1) is generated over B, and over U , by any highest weight vector. The same is true over Dist(B) and Dist(U ), thus there is some X ∈ Dist(U ) that gives the required action. Moreover, it is clear that we can chose X to be a T -weight vector of weight −2α0 (indeed, any X such that X.wρ+2α0 = wρ will be a sum of weight vectors, and any elements in the sum not having weight −2α0 must then act as zero, so we can modify X by subtracting off if necessary such terms). The augmentation ideal of Dist(U ) is the vector subspace spanned by all T -weight vectors of weight 6= 0, hence X is in this ideal. The claim about ∆(X) then follows from a general fact about the comultiplication of elements in the augmentation ideal of a Hopf algebra, together with the fact that the terms in ∆(X) must have total weight −2α0 .  6.3. Returning to our special assumptions on G, p, and λ, we now give a series of reductions toward proving that any summand of St1 ⊗L(λ) containing St1 ⊗L(α0 )(1) as a composition factor is tilting. Reduction 1: By Lemma 6.1.1, this is equivalent to showing that St1 ⊗L(α0 )(1) does not appear as a submodule of St1 ⊗L(λ). Reduction 2: This is equivalent to showing that any maximal vector in St1 ⊗L(λ) of weight ρ + 2α0 generates a submodule isomorphic to St1 ⊗∆(α0 )(1) . 16 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE Reduction 3: By Lemma 6.2.3, this is equivalent to showing that if vρ+2α0 is any such maximal vector of St1 ⊗L(λ) and X ∈ Dist(U ) is chosen as in the lemma, then X.vρ+2α0 6= 0. 6.4. For this subsection, we restrict ourselves to the case G = SL6 and λ = ω1 + ω2 + ω4 + ω5 . Fix, for each positive root β, the usual negative and positive Chevalley basis elements fβ and eβ of g coming from the natural representation, and let hβ = [eβ , fβ ]. We view these as elements inside Dist(G). We have [eαi , fαj ] = 0 if i 6= j. Because p = 2, we also have [hαi , eαj ] = eαj and [hαi , fαj ] = fαj if |i − j| = 1, otherwise [hαi , eαj ] = 0 = [hαi , fαj ]. One computes that λ − 2α0 = α2 + α3 + α4 . Let J = {α2 , α3 , α4 }. By [Jan03, II.2.11] (see [GGN17, Proposition 3.3] for a more thorough discussion), the LJ -Weyl module ∆J (λ) is a direct summand of ∆(λ), considered as an LJ -module. More specifically X ∆J (λ) ∼ ∆(λ)µ , = λ−µ∈ZJ with the LJ -complement to ∆J (λ) consisting of the sum of the remaining weight spaces. If we further restrict our attention to the weight spaces from 2α0 to λ, it follows (by weight considerations) that there is an isomorphism of B + -modules X X ∆J (λ)µ . ∆(λ)µ ∼ = µ≥2α0 µ≥2α0 The derived subgroup (LJ , LJ ) is isomorphic to SL4 , the restriction of ∆J (λ) to (LJ , LJ ) is the adjoint representation, and 2α0 restricts to the zero weight P for T ∩ (LJ , LJ ). Using the structure of Lie(SL4 ), one readily computes the B + structure of µ≥2α0 ∆(λ)µ . In particular, given a maximal weight vector zλ of ∆(λ), the following is a T -basis for ∆(λ)2α0 : {fα2 fα3 fα4 .zλ , fα4 fα3 fα2 .zλ , fα3 fα4 fα2 .zλ }. U + -fixed We also have (fα2 fα3 fα4 .zλ + fα4 fα3 fα2 .zλ ) as a vector, and (6.4.1) L(λ)2α0 ∼ = ∆(λ)2α0 /(fα2 fα3 fα4 .zλ + fα4 fα3 fα2 .zλ ). Let wρ be a highest weight vector in St1 . Any T -basis {yi } for Dist(U1 ) yields a T -basis {yi .wρ } for St1 . While a standard choice is to take a PBW-basis after choosing an ordering of roots, one can alternatively take a basis consisting of products of the various fαi for αi a simple root. While it is in general harder to list all such basis elements in this manner, we will find it more convenient in our limited consideration. Lemma 6.4.1. Assume G is SL6 and p = 2. Let wρ be a a highest weight vector in St1 . Let αi1 , . . . , αim be an ordered collection of simple roots without repetition (so 1 ≤ m ≤ 5). For any simple root α, eα fαi1 · · · fαim .wρ = 0 if αij 6= α for all ij . Otherwise, if some αij = α, then eα fαi1 · · · fαim .wρ = (s + 1)fαi1 · · · fαij−1 fαij+1 · · · fαim .wρ , where s is the number of ik such that k > j and |ij − ik | = 1. ON TENSORING WITH THE STEINBERG REPRESENTATION 17 Proof. If no αij = α, then eα commutes past each fαij in Dist(G1 ), and since eα annihilates wρ , the first statement follows. Otherwise, if α = αij for some j, then eα commutes past each fαiℓ , ℓ < j. One then applies the commutation relations above. We have eα fαi1 · · · fαim .wρ = fαi1 · · · fαij−1 eα fαij fαij+1 · · · fαim .wρ = fαi1 · · · fαij−1 (fαij eα + hαij )fαij+1 · · · fαim .wρ = fαi1 · · · fαij−1 fαij eα fαij+1 · · · fαim .wρ + fαi1 · · · fαij−1 hαij fαij+1 · · · fαim .wρ = fαi1 · · · fαij−1 hαij fαij+1 · · · fαim .wρ , since the first term is seen to be zero, by commuting the eα past the remaining terms. We now use the fact that hαij fαik = fαik hαij + fαik = fαik (hαij + 1) if |ij − ik | = 1, otherwise hαij fαik = fαik hαij . Repeatedly applying this we obtain eα fαi1 · · · fαim .wρ = fαi1 · · · fαij−1 fαij+1 · · · fαim (hαij + s).wρ , and as hαij .wρ = wρ , the result follows.  Lemma 6.4.2. Assume G is SL6 and p = 2. The following vectors form a basis of maximal vectors in St1 ⊗∆(λ) having weight ρ + 2α0 : v1 = wρ ⊗ fα3 fα2 fα4 .zλ + fα2 .wρ ⊗ fα3 fα4 .zλ + fα4 .wρ ⊗ fα3 fα2 .zλ +fα2 fα3 .wρ ⊗ fα4 .zλ + fα4 fα3 .wρ ⊗ fα2 .zλ +(fα2 fα3 fα4 + fα4 fα3 fα2 ).wρ ⊗ zλ , v2 = wρ ⊗ fα2 fα3 fα4 .zλ + fα3 .wρ ⊗ fα2 fα4 .zλ + fα3 fα2 .wρ ⊗ fα4 .zλ +fα3 fα4 .wρ ⊗ fα2 .zλ + fα3 fα2 fα4 .wρ ⊗ zλ , v3 = wρ ⊗ (fα2 fα3 fα4 + fα4 fα3 fα2 ).zλ . Proof. The elements fα3 fα2 fα4 .zλ , fα2 fα3 fα4 .zλ , and (fα2 fα3 fα4 + fα4 fα3 fα2 ).zλ are linearly independent in ∆(λ). From this it follows that the three different sums of simple tensors listed above are linearly independent in St1 ⊗∆(λ). To verify maximality, since (ρ + λ) − (ρ + 2α0 ) = α2 + α3 + α4 , we need only check that each eαi , 2 ≤ i ≤ 4, annihilates these elements, where the action on a simple tensor is via eαi ⊗ 1 + 1 ⊗ eαi . The verification for v3 is immediate as it is annihilated both by eαi ⊗ 1 and by 1 ⊗ eαi . For v1 , v2 , one applies Lemma 6.4.1 to see that the sum eαi ⊗ 1 + 1 ⊗ eαi annihilates each vector.  Fix a surjective G-module homomorphism f : ∆(λ) → L(λ). Over LJ , f restricts to a surjective homomorphism ∆J (λ) → LJ (λ). By (6.4.1), it follows that (ker f ) ∩ ∆(λ)2α0 = Span{fα2 fα3 fα4 .zλ + fα4 fα3 fα2 .zλ }. We obtain from f a surjective G-module homomorphism id ⊗ f : St1 ⊗∆(λ) → St1 ⊗L(λ). 18 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE On a simple tensor of the form wρ ⊗ v we have (id ⊗ f )(wρ ⊗ v) = wρ ⊗ f (v). Given the definition of f on ∆(λ)2α0 , it follows that (id ⊗ f )(v3 ) = 0, and that (id ⊗ f )(v1 ) and (id ⊗ f )(v2 ) are linearly independent. Lemma 6.4.3. Assume G is SL6 and p = 2. Let X ∈ Dist(U ) be as in Lemma 6.2.3 and vi be as in Lemma 6.4.2. Then, in St1 ⊗L(λ), X.(id ⊗ f )(v1 ) 6= 0, X.(id ⊗ f )(v2 ) 6= 0. Consequently, (St1 ⊗∆(α0 )(1) )⊕2 ֒→ St1 ⊗L(λ). Proof. The module St1 ⊗∆(λ), being the tensor product of two Weyl modules, has a Weyl filtration. Therefore, the vectors v1 , v2 , and v3 each generate copies of St1 ⊗∆(α0 )(1) . It follows then that X.vi 6= 0, for 1 ≤ i ≤ 3. Further, since the vi are linearly independent, the elements X.vi must be also (the vi must together generate a submodule isomorphic to (St1 ⊗∆(α0 )(1) )⊕3 ). Thus each X.vi is a maximal vector in St1 ⊗∆(λ) of weight ρ (lying within a copy of St1 inside the G-socle of St1 ⊗∆(λ)). By Lemma 6.2.2, it follows that each X.vi , expressed as a sum of simple tensors in St1 ⊗∆(λ), necessarily involves a term of the form wρ ⊗ v0 , with 0 6= v0 ∈ ∆(λ)0 . On the other hand, multiplying the expression for the comultiplication of X in Lemma 6.2.3 against the explicit computations of the vi above, for every X.vi to contain a term of this form it must hold that wρ ⊗ Xfα3 fα2 fα4 .zλ 6= 0, wρ ⊗ Xfα2 fα3 fα4 .zλ 6= 0, wρ ⊗ X(fα2 fα3 fα4 + fα4 fα3 fα2 ).zλ 6= 0. There is a non-zero B-module (composite) homomorphism St1 → ∆(λ) ⊗ ∇(ρ − λ) → ∆(λ) ⊗ (ρ − λ) which restricts to a surjective U -module homomorphism St1 → ∆(λ) (this holds more generally). In particular, any element in Dist(U ) that does not annihilate zλ cannot annihilate wρ . It follows that Xfα3 fα2 fα4 .wρ ⊗ zλ 6= 0, X(fα2 fα3 fα4 + fα4 fα3 fα2 ).wρ ⊗ zλ 6= 0. Since f (zλ ) 6= 0, then (id ⊗ f )(X.v1 ) 6= 0, (id ⊗ f )(X.v2 ) 6= 0, as each element, as a sum of simple tensors in St1 ⊗L(λ), contains a non-zero term that cannot be canceled out by the other terms.  By our reductions in Section 6.3, it follows that St1 ⊗L(λ) has a good filtration. As discussed in Section 5.4, this case was the only remaining one to check for SL6 , which proves the following. Theorem 6.4.4. Assume G = SL6 and p = 2. Then (a) Str ⊗L(λ) has a good filtration for all λ ∈ Xr , r ≥ 1. (b) In this case Conjecture 1.2.1(⇒) holds. 7. Tensoring With k[Gr ] 7.1. Recall that given any affine scheme X over k and an algebraic action of G on X, the coordinate ring k[X] becomes a G-module by the action g.f (x) = f (g −1 .x) (such actions are intended to hold functorially, i.e., for every k-algebra A, every g ∈ G(A), x ∈ X(A), and f ∈ A[XA ]). In particular, k[G] becomes a G-module via the conjugation action of G on itself. Further, since Gr is a normal subgroup scheme of G, one similarly obtains a G-module structure on k[Gr ]. There is a (G × G)-action on G via (g1 , g2 ).h = g1 hg2−1 . If we take the diagonal embedding of G into (G × G), then the restriction of this action is the conjugation action of G on itself. We recall the following result due to Donkin and Koppinen [Jan03, Proposition II.4.20] (see also [Jan03, Remark II.4.21]). ON TENSORING WITH THE STEINBERG REPRESENTATION 19 Proposition 7.1.1. As a (G × G)-module, k[G] has a good filtration. The good filtration factors are of the form ∇(λ) ⊗ ∇(λ∗ ), λ ∈ X+ , each occuring with multiplicity one. In particular, k[G], as a G-module under the action induced by the conjugation action of G, has a good filtration. 7.2. In consideration of this result and Conjecture 1.2.1, we ask the following. Question 7.2.1. For each r ≥ 1, does Str ⊗k[Gr ] have a good filtration? We conclude by making the following observation. Let Iε denote the augmentation ideal of k[G]. Under the conjugation action of G, this ideal is a G-submodule of k[G], with G-module complement spanned by the subalgebra k · 1 ≤ k[G]. It follows then that Iε has a good filtration over G. For each r ≥ 1, let Mr denote the subset of k[G] defined as r Mr = {xp | x ∈ Iε }. Since k is algebraically closed and of characteristic p, this is a subspace of k[G], and indeed a submodule for G. Further, the ideal defining the closed subgroup scheme Gr is the ideal generated by Mr . Thus, the algebra homomorphism k[G] → k[Gr ] factors (as G-modules) through k[G]/Mr . Theorem 7.2.2. The G-module Str ⊗(k[G]/Mr ) has a good filtration. Proof. If X and Y are any two affine schemes with algebraic G-actions, and if f : X → Y is a Gequivariant homomorphism of schemes, then the comorphism f ∗ : k[Y ] → k[X] is a homomorphism of G-modules (with the induced G-action on coordinate rings as above). Now let F : G → G be the Frobenius morphism arising from a chosen split Fp -structure on G, and let F r denote its r-th iterate. Consider (F r )∗ : k[G] → k[G]. We claim that (F r )∗ (Iε ) = Mr . To see this, let Fp [G] denote the chosen Fp -structure of k[G] and Iε,Fp denote the augmentation ideal of this Hopf algebra. The map (F r )∗ then arises (using this chosen Fp -structure) as simply the pr -th power map on Fp [G]. If we fix an Fp -basis {xi } for Iε,Fp , then {xi ⊗Fp 1} is a k-basis for Iε . We have that r r (F r )∗ (xi ⊗Fp 1) = xi p ⊗Fp 1 = (xi ⊗Fp 1)p . From this the claim follows. Now, the homomorphism F r : G → G is G-equivariant, if G acts on the target via F r . Therefore, the comorphism (F r )∗ is a G-module homomorphism. It follows then that, as a G-module, Mr ∼ = (r) Iε . Applying [Jan03, II.3.19], it follows that Str ⊗Mr has a good filtration. Since Str ⊗k[G] also has a good filtration, it then follows from [Jan03, II.4.17] (which is a consequence of Theorem 2.3.1) that Str ⊗(k[G]/Mr ) has a good filtration.  For each λ ∈ X+ , ∇(λ)(r) ⊆ ∇(pr λ). In particular, ∇(λ)(r) ⊗ ∇(λ∗ )(r) ⊆ ∇(pr λ) ⊗ ∇(pr λ∗ ). Note that the proof of the preceding result shows that there is a submodule of k[G], namely Mr , having a filtration over G with sections of the form ∇(λ)(r) ⊗ ∇(λ∗ )(r) , 0 6= λ ∈ X+ . References [And79] [And80] [And01] [And17] Henning Haahr Andersen, The first cohomology group of a line bundle on G/B, Invent. Math., 51, (1979), 287-296. Henning Haahr Andersen, The Frobenius morphism on the cohomology of homogeneous vector bundles on G/B, Ann. of Math, 112, (1980), 113-121. Henning Haahr Andersen, p-filtrations and the Steinberg module, J. Algebra, 244, (2001), 664-683. Henning Haahr Andersen, The Steinberg linkage class for a reductive algebraic group, arXiv:1706.00590. 20 CHRISTOPHER P. BENDEL, DANIEL K. NAKANO, CORNELIUS PILLEN, AND PAUL SOBAJE [Don81] [Don93] [GGN17] [GK17] [Hum78] [Jan73] [Jan91] [Jan03] [KN15] [L] [Mat90] [PS12] [Pil93] [PrSu] [RW] [Sc] [So] [UGA] [Wi] Stephen Donkin, A filtration for rational modules, Math. Zeit., 177, (1981), 1-8. Stephen Donkin, On tilting modules for algebraic groups, Math. Zeit., 212, (1993), 39-60. Skip Garibaldi, Robert M. Guralnick, Daniel K. Nakano, Globally irreducible Weyl modules, J. Algebra, 477, (2017), 69-87. Michel Gros, Masaharu Kaneda, Contraction par Frobenius et modules de Steinberg, arXiv:1707.00960. James E. Humphreys, Introduction to Lie algebras and representation theory, Graduate Texts in Mathematics, Springer-Verlag, New York, 1978. Jens Carsten Jantzen, Darstellungen halbeinfacher algebraischer Gruppen und zugeordnete kontravariante Formen, Bonn. Math. Schr., 67, (1973), v + 124 pp. Jens Carsten Jantzen, First cohomology groups for classical Lie algebras, in Representation theory of finite groups and finite-dimensional algebras (Bielefeld, 1991), 289-315, Progr. Math., Vol. 95, Birkhäuser, Basel, 1991. Jens Carsten Jantzen, Representations of Algebraic Groups, Second Edition, Mathematical Surveys and Monographs, Vol. 107, American Mathematical Society, Providence RI, 2003. Tobias Kildetoft, Daniel K. Nakano, On good (p, r) filtrations for rational G-modules, J. Algebra, 423, (2015), 702-725. Frank Lübeck, Website: Tables of Weight Multiplicities, http://www.math.rwth-aachen.de/ Frank.Luebeck/chev/WMSmall/index.html. Olivier Mathieu, Filtrations of G-modules, Ann. Sci. Ecole Norm. Sup., 23, (1990), 625-644. Brian J. Parshall, Leonard L. Scott, On p-filtrations of Weyl modules, J. London Math. Soc., 91, (2015), 127-158. Cornelius Pillen, Tensor product of modules with restricted highest weight, Comm. Algebra, 21, (1993), 3647-3661. Alexander A. Premet, Irina D. Suprunenko, The Weyl modules and the irreducible representations of the symplectic group with the fundamental highest weights, Comm. Algebra, 11, (1983), 1309-1342. Simon Riche, Geordie Williamson, Tilting modules and the p-canonical basis, to appear in Astérisque. Leonard L. Scott, Representations in characteristic p, Proceedings of the A.M.S. Summer Institute on Finite Groups, Santa Cruz, 1979. Paul Sobaje, On (p, r)-filtrations and tilting modules, to appear in Proc. Amer. Math. Soc.. University of Georgia VIGRE Algebra Group, First cohomology of finite groups of Lie type: simple modules with small dominant weights, Transactions of the AMS, 365, (2013), 1025-1050. Geordie Williamson, Schubert calculus and torsion explosion, J. Amer. Math. Soc., 30, (2017), no. 4, 1023-1046. Department of Mathematics, Statistics and Computer Science, University of Wisconsin-Stout, Menomonie, WI 54751, USA E-mail address: [email protected] Department of Mathematics, University of Georgia, Athens, GA 30602, USA E-mail address: [email protected] Department of Mathematics and Statistics, University of South Alabama, Mobile, AL 36688, USA E-mail address: [email protected] Department of Mathematics, University of Georgia, Athens, GA 30602 E-mail address: [email protected]
4math.GR
Modal analysis of masonry structures Maria Girardi, Cristina Padovani, Daniele Pellegrini arXiv:1611.00531v1 [cs.CE] 2 Nov 2016 Institute of Information Science and Technologies ”A. Faedo”, ISTI–CNR, Via Moruzzi 1 56126 Pisa, Italy Abstract This paper presents a new numerical tool for evaluating the vibration frequencies and mode shapes of masonry buildings in the presence of cracks. The algorithm has been implemented within the NOSA-ITACA code, which models masonry as a nonlinear elastic material with zero tensile strength. Some case studies are reported, and the differences between linear and nonlinear behaviour highlighted. Key words: masonry–like materials; modal analysis; numerical methods; nonlinear dynamics. 1. Introduction The worldwide architectural heritage is in pressing need of maintenance and restoration. Old structures are, in fact, threatened by numerous environmental and anthropogenic actions. In Italy, where seismic actions affect most of the territory, safeguarding ancient masonry buildings and monuments is a crucial issue for institutions and individuals alike. In this context, the use of non–destructive techniques able to evaluate the structural health of old buildings has a vital role to play. Traditional building monitoring protocols generally involve visual inspections and the measurement of some quantities (displacements, local stresses and crack width, etc.) and their variation in time, while the mechanical properties of the constituent materials are generally assessed locally through destructive or non–destructive tests. More recently ambient vibration tests, first adopted in civil engineering to assess the structural health of bridges and tall buildings, have assumed an increasingly important place in the fields of conservation and restoration. This is for the most part due to the availability Preprint submitted to Elsevier February 3, 2018 of very sensitive measurement devices and ever more powerful techniques for numerical simulation. These tests allow measuring structures’ dynamic properties, such as natural frequencies, mode shapes and damping ratios and, if coupled with a finite–element model, can provide important information on the mechanical properties of a building’s constituent materials and boundary conditions. Moreover, long–term monitoring protocols allow measuring any variation in the dynamic behaviour of the monitored structures: once the influence of environmental factors such as temperature and humidity has been accounted for, this variation can reveal the presence of any structural damage. Particular attention must be devoted in the monitoring of old masonry buildings, since their make–up and behaviour are profoundly different from modern structures. In fact, masonry is unable to withstand tensile stresses or large compressive stresses. For this reason, old buildings generally present damage scenarios, with cracking induced by the permanent loads or caused by some accidental events occurred during their long history. The dynamic behaviour of these structures should be analyzed taking into account the existing damage. Numerous examples can be found in the literature of methods for detecting the effects of damage on the dynamic properties of structures. A number of analytical models have been formulated for predicting the effects of cracks on the vibration frequencies of beams and rotors [1]. A review of methods for detecting structural damage by measuring the changes over time of the natural frequencies is presented in [2]. Changes in mode shapes are effective damage indicators [3], [4] and allow better localization of the damage location within the structure. In particular, modal curvatures seem to be very sensitive to local damage [5], though their measurement requires the use of a large number of sensors. Wide variations in modal parameters can be observed when damage occurs in zones with high modal curvatures. With regard to the monitoring of old masonry structures, a number of papers have recently been devoted to the analysis of data from long–term monitoring protocols; these have highlighted changes in the modal characteristics due to environmental factors [6], [7], [8], or, in some cases, structural damage [9], [10], [11], [12]. Much effort has also been devoted to numerically simulating the effects of damage on the vibrations of the structures. In [13] and [14] a damage identification procedure is presented to detect and localize damage in beam structures. A beam is discretized into finite–elements and the damage to it simulated by reducing the stiffness matrix of some selected elements via 2 a damage index. The equations obtained enable obtaining the beam’s frequencies and mode shapes when the damage indices are fixed or, viceversa, calculating the damage indices when frequencies and mode shapes are measured on real beams. Model updating procedures are employed in [15] in order to fit experimental data with finite–element models; the parameters to be updated are the Young’s moduli of the constituent materials. With regard to masonry buildings, a common approach consists of simulating the existing damage actually observed on the structure, by reducing the stiffness of those elements of the finite element model belonging to the cracked or damaged parts [16], [10]. In [17] and [18] the dynamic properties of some masonry structures at different damage levels are investigated via the discrete element method. The work presented in [19] formulates an explicit expression linking the fundamental frequency of a masonry–like beam to its maximum transverse displacement. The masonry–like constitutive equation models masonry as a non–linear elastic material with different strengths under tension and compression [20], [21]. This constitutive equation has been implemented in the finite–element code NOSA for the static analysis of masonry bodies [22]. The NOSA code and its updated version NOSA–ITACA 1.0 [23], have been applied to the static and dynamic analysis of many important monuments in Italy. NOSA–ITACA 1.0 is freely downloadable at [24]. The non–linear equilibrium equations of masonry–like bodies are solved via the Newton–Raphson method, by taking into account an explicit expression of the derivative of the stress with respect to the strain [22], which allows calculation of the system’s tangent stiffness matrix. This paper presents a numerical procedure, implemented in a newly updated version 1.2 of the NOSA–ITACA code, which can evaluate the natural frequencies and mode shapes of masonry buildings in the presence of cracks. Once the initial loads and boundary conditions have been applied to the finite–element model, the resulting non–linear equilibrium problem is solved through an iterative scheme. Then, a modal analysis is performed, by using the tangent stiffness matrix calculated by the code in the last iteration before convergence is reached. The incremental approach used by NOSA–ITACA 1.2 allows the user to perform the modal analysis at the initial step, before application of any load to the structure, and then for different loading steps. Following the prestressed modal analysis applied to problems with geometric nonlinearity [25] and [26], the proposed procedure allows the user to automatically take into account the stress distribution on the system’s stiffness 3 matrix, thereby evaluating the effects of the presence of cracked and crushed material on the structure’s dynamic properties. Section 2 briefly recalls the constitutive equation of masonry–like materials. The explicit expressions for the stress function and its derivative, obtained in [22], are summarized, and the numerical procedure for solving static and dynamic problems of masonry structures, implemented in the NOSA–ITACA 1.0 code, are sketched out. Finally, the modal analysis of linear elastic structures is addressed and the procedures implemented in the NOSA–ITACA 1.0 code to solve the constrained generalized eigenvalue problem resulting from application of the finite-element method is outlined [27]. Section 3 presents the new procedure implemented in the NOSA–ITACA 1.2 code. The code allows for calculating the natural frequencies and mode shapes of a masonry body subjected to prescribed boundary conditions and loads. The new procedure takes into account the non–linearity of the constitutive equation of masonry–like materials as well as the presence of cracks due to the applied loads. In general, the results of the modal analysis conducted after application of the assigned loads differ from those obtained via the standard modal analysis and can be used to assess the presence of damaged zones in the structure. Section 4 presents some applications of the method. The first two cases deal with a masonry beam and an arch on piers. Both structures are subjected to incremental loads and analyzed with the NOSA–ITACA code. The aim is to compare the natural frequencies and mode shapes in the linear elastic case with those calculated in the presence of the crack distribution induced by the increasing loads. The third case deals with an actual structure, the bell tower of San Frediano in Lucca. The tower has been instrumented with four high–sensitivity triaxial seismometric stations [28], and its first five natural frequencies have been determined via OMA techniques [29]. Then the NOSA–ITACA code, together with model updating techniques, has been employed in order to fit the experimental results. The model updating in the linear elastic case is compared to the model updating applied to the tower subjected to its own weight by taking into account the crack distribution induced by the loads. 2. The masonry–like constitutive equation and the NOSA-ITACA 1.0 code Let Lin be the set of all second-order tensors with the scalar product A · B = tr(AT B) for any A, B ∈ Lin, with AT the transpose of A. For 4 Sym the subspace of symmetric tensors, Sym− and Sym+ are the sets of all negative-semidefinite and positive-semidefinite elements of Sym. Given the symmetric tensors A and B, we denote by A ⊗ B the fourth-order tensor defined by A ⊗ B[H] = (B · H)A for H ∈ Lin and by ISym the fourth-order identity tensor on Sym. For a and b vectors, the dyad a ⊗ b is defined by a ⊗ bh = (b · h)a, for any vector h, with · the scalar product in the space of vectors. Let C be the isotropic fourth-order tensor of elastic constants C = 2µISym + λI ⊗ I, (1) where I ∈ Sym is the identity tensor and µ and λ are the Lamé moduli of the material satisfying the conditions λ ≥ 0. µ > 0, (2) C is symmetric, A · C[B] = B · C[A], for all A, B ∈ Sym, (3) and in view of (2) is positive-definite on Sym, A · C[A] > 0 for all A ∈ Sym, A 6= 0. (4) A masonry-like material is a nonlinear elastic material [22] characterized by the fact that, for E ∈ Sym, there exists a unique triplet (T, Ee , Ef ) of elements of Sym such that E = Ee + Ef , (5) T = C[Ee ], (6) T ∈ Sym− , Ef ∈ Sym+ , T · Ef = 0. (7) (8) T is the Cauchy stress corresponding to strain E. Tensors Ee and Ef are respectively the elastic and inelastic part of E; Ef is also called the fracture strain. The stress function T : Sym → Sym is given by T(E) = T, for any E ∈ Sym, 5 (9) with T satisfying (5)–(8). The explicit expression for the stress function T, calculated in [22], is recalled in the following. For E ∈ Sym, let e1 ≤ e2 ≤ e3 be its ordered eigenvalues and q1 , q2 , q3 the corresponding eigenvectors. We introduce the orthonormal basis of Sym (with respect to the scalar product · ) O11 = q1 ⊗ q1 , O22 = q2 ⊗ q2 , O33 = q3 ⊗ q3 , 1 1 O12 = √ (q1 ⊗ q2 + q2 ⊗ q1 ), O13 = √ (q1 ⊗ q3 + q3 ⊗ q1 ), 2 2 1 O23 = √ (q2 ⊗ q3 + q3 ⊗ q2 ). 2 (10) Given E, the corresponding stress T satisfying the constitutive equation of masonry-like materials (5)–(8) is given by if E ∈ V0 then T = 0, (11) if E ∈ V1 then T = Ee1 O11 , (12) 2µ {[2(1 + α)e1 + αe2 ]O11 2+α +[αe1 + 2(1 + α)e2 ]O22 } , (13) if E ∈ V3 then T = C[E], (14) V0 = {E ∈ Sym : e1 ≥ 0} , (15) V1 = {E ∈ Sym : e1 ≤ 0, αe1 + 2(1 + α)e2 ≥ 0} , (16) V2 = {E ∈ Sym : αe1 + 2(1 + α)e2 ≤ 0, 2e3 + αtrE ≥ 0} , (17) V3 = {E ∈ Sym : 2e3 + αtrE ≤ 0} , (18) if E ∈ V2 then T = where the sets Vk are 6 with α = λ/µ and E = µ(2µ + 3λ)/(µ + λ) the Young’s modulus. As for the fracture strain, if E ∈ V0 then Ef = E, if E ∈ V1 then Ef = (e2 + (19) α α e1 )O22 + (e3 + e1 )O33 , 2(1 + α) 2(1 + α) if E ∈ V2 then Ef = [e3 + α (e1 + e2 )]O33 , 2+α if E ∈ V3 then Ef = 0. (20) (21) (22) For Wk the interior of Vk , function T turns out to be differentiable in 3 S W = Wi [22],[30]. Thus, for E ∈ W denoting by DE T(E) the derivative i=0 of T(E) with respect to E, we have T(E + H) = T(E) + DE T(E)[H] + o(H), H ∈ Sym, H → 0. (23) DE T(E) is a symmetric fourth–order tensor from Sym into itself and has the following expressions in the regions Wi [22]. If E ∈ W0 then DE T(E) = O, where O is the null fourth-order tensor,  if E ∈ W1 then DE T(E) = E O11 ⊗ O11 − e1 O12 ⊗ O12 e2 − e1  e1 − O13 ⊗ O13 , e3 − e1 if E ∈ W2 then DE T(E) = 2µO12 ⊗ O12 − 2µ 2(1 + α)e1 + αe2 O13 ⊗ O13 2+α e3 − e1 7 (24) (25) − + 2µ αe1 + 2(1 + α)e2 O23 ⊗ O23 2+α e3 − e2 2µ(2 + 3α) O11 + O22 O11 + O22 √ √ ⊗ 2+α 2 2 O11 − O22 O11 − O22 √ √ + 2µ ⊗ , 2 2 if E ∈ W3 then DE T(E) = C. (26) (27) In order to study real problems, the equilibrium problem of masonry structures can be solved via the finite element method. To this end, suitable numerical techniques have been developed [22] based on the Newton-Raphson method for solving the nonlinear system obtained by discretising the structure into finite elements. Their application is based on the explicit expression for the derivative of the stress with respect to the strain, which is needed in order to calculate the tangent stiffness matrix. The numerical method studied and the constitutive equation of masonry-like materials described above have therefore been implemented into the finite element code NOSA [22]. As far as the numerical solution of dynamic problems is concerned, direct integration of the equations of motion is required [31]. In fact, due to the nonlinearity of the adopted constitutive equation, the mode-superposition method is meaningless. With the aim of solving such problems, we have instead implemented the Newmark method [32] within NOSA in order to perform the integration with respect to time of the system of ordinary differential equations obtained by discretising the structure into finite elements. Moreover, the Newton-Raphson scheme, needed to solve the nonlinear algebraic system obtained at each time step, has been adapted to the dynamic case. The NOSA code, devoted to static and dynamic analyses of ancient masonry constructions, enables determining the stress state and the presence of any cracking. Moreover, the effects of thermal variations and the effectiveness of various strengthening interventions, such as the application of tie rods and retaining structures, can be evaluated, and those with the least environmental and visual impact identified. The code has been successfully applied to the analysis of arches and vaults [33], and in a number of studies of buildings of historical and architectural interest [22], [34]. 8 Within the framework of the project ”Tools for modelling and assessing the structural behaviour of ancient constructions” [24] funded by the Region of Tuscany (2011-2013), the NOSA code has been integrated in the open source graphic platform SALOME [35], used both to define the geometry of the structure under examination and to visualise the results of the structural analysis. The result of this integration is the freeware code NOSAITACA 1.0 [23], [24]. NOSA-ITACA 1.0 has been applied to several studies commissioned by both private and public bodies of the static and dynamic behaviour of historical masonry buildings [36]. In many cases, such studies have also provided important information on the structure’s seismic vulnerability, which can be assessed with respect to current Italian and European regulations [37]. An efficient implementation of the numerical methods for constrained eigenvalue problems for modal analysis of linear elastic structures has been embedded in NOSA–ITACA 1.0 [27]. Such implementation takes into account both the sparsity of the matrices and the features of master-slave constraints (tying or multipoint constraints). It is based on the open-source packages SPARSKIT [38], for managing matrices in sparse format (storage, matrix-vector products), and ARPACK [39], which implements a method based on Lanczos factorization combined with spectral techniques that improve convergence. In particular in [27] the authors have implemented a procedure for solving the constrained generalized eigenvalue problem K φ = ω 2 M φ, (28) T φ = 0, (29) with T ∈ Rm×n and m  n. Equation (28) is derived from the equation M ü + Ku = 0, (30) governing the free vibrations of a linear elastic structure discretized into finite elements. In equation (30) u is the displacement vector, which belongs to Rn and depends on time t, ü is the second-derivative of u with respect to t, and K and M ∈ Rn×n are the stiffness and mass matrices of the finite-element assemblage. K is symmetric and positive-semidefinite, M is symmetric and positive-definite, and both are banded with bandwidth depending on the numbering of the finite-element nodal points. Displacements ui are also called degrees of freedom; the integer n is the total number of degrees of freedom 9 of the system and is generally very large, since it depends on the level of discretization of the problem. By assuming that u = φ sin(ωt), (31) with φ a vector of Rn and ω a real scalar, and applying the modal superposition [32], equation (30) is transformed into the generalized eigenvalue problem (28). Condition (29) expresses the fixed constraints and the masterslave relations assigned to displacement u, written in terms of vector φ. The restriction of the matrix K to the null subspace of Rn defined by (29) is positive-definite. Although the constitutive equation (5)–(8) adopted for masonry is nonlinear, the modal analysis, which is based on the assumption that the materials constituting the construction are linear elastic, is widely used in applications and furnishes important qualitative information on the dynamic behavior of masonry structures and thereby allows for assessing their seismic vulnerability in light of Italian and European regulations [37]. On the other hand, traditional modal analysis does not take into account the influence that both the nonlinear behaviour of the masonry material and the presence of cracked regions can have on the natural frequencies of masonry structures. The approach described in the next section and implemented in NOSA–ITACA 1.2 allows for calculating the natural frequencies and modal shapes of a masonry body subjected to given system of loads and exhibiting a crack distribution due to these loads. 3. A new procedure for the modal analysis of masonry–like structures Let us consider a body1 B whose boundary ∂B is composed of two complementary and disjoined portions ∂B1 and ∂B2 . B is made of a masonry-like material with constitutive equation (5)–(8) and mass density ρ. Given the loads (b, s0 ), with the body force b defined over B and the surface force e T) e a triple consisting of one vector and two s0 defined over ∂B2 , let (e u, E, tensor fields defined over B satisfying the following equilibrium problem [22] e +b=0 div T 1 on B, (32) A body is a regular region of the three-dimensional Euclidean space having boundary ∂B , with outward unit normal n [40]. 10 u + ∇e uT e = ∇e E 2 on B, e = T(E) e T e=0 u on B, on ∂B1 , e = s0 Tn on ∂B2 . (33) (34) (35) (36) The equilibrium problem (32)-(36) is dealt with in [22], where the uniqueness of its solution in terms of stress is proved and the iterative procedure implemented in the NOSA code to calculate a numerical solution is described in detail. Let (0, t0 ) denote a fixed interval of time; a motion of B is a vector field u defined on B × (0, t0 ). The vector u(x, t) is the displacement of x at time 2 t and ∂∂tu2 its acceleration. Let us consider small motions u such that their gradient ∇u is small, and u = 0 on ∂B1 . e + E, with E = e + u, the strain field E For the displacement field u T e (∇u + ∇u )/2 and the stress field T(E + E), the equation of motion reads ∂ 2 (e u + u) on B. (37) ∂t2 From (37), in view of (23) and (34), bearing in mind the equilibrium equation (32) and neglecting terms of order o(∇u), we get the linearized equation of motion e + E)) + b = ρ div(T(E 2 T e ∇u+∇u ]) = ρ ∂ u on B, div(DE T(E)[ (38) 2 ∂t2 e depends on x ∈ B. where the fourth-order tensor DE T(E) Equation (38), governing the undamped free vibrations of B about the e T), e is linear and via the application of the finite equilibrium state (e u, E, element method can be transformed into the equation e = 0, M ü + Ku (39) which is analogous to (30), though here the elastic stiffness matrix K, calculated using the elastic tensor C, has been replaced by the damaged stiffness 11 e which takes into account the presence e calculated using DE T(E), matrix K, of cracks in body B. Thus, a new numerical method for the modal analysis of masonry constructions has been implemented in an updated version 1.2 of the NOSAITACA code. Given the structure under examination, discretized into finite elements, and given the mechanical properties of the masonry-like material constituting the structure, together with the kinematic constraints and loads acting on it, the procedure consists of the following steps. Step 1. A preliminary modal analysis is conducted by assuming the the structure’s constituent material to be linear elastic. The generalized eigenvalue problem (28)-(29) is then solved and the natural frequencies fli = ωil /2π and mode shapes φli calculated. Step 2. The equilibrium problem (32)-(36) is solved and its solution, (e u, e e e E, T), calculated. The fourth-order tensor DE T(E) needed to calculate the e to be used in the next step is evaluated by using damaged stiffness matrix K (24)–(27). e in Step 3. The generalized eigenvalue problem (28)-(29), with matrix K place of the elastic stiffness matrix K, is solved and the natural frequencies fi = ωi /2π and mode shapes φi of the damaged structure calculated. 4. Case studies 4.1. The masonry beam Let us consider the rectilinear beam illustrated in Figure 1, with length l = 6 m, rectangular cross section of 0.4 m × 1 m, subjected to the concentrated vertical load P = 106 N and a uniform lateral load. The beam, simply supported at its ends and forced to move in the y − z plane, is discretized with 60 beam elements [23]. The goal of the finite–element analysis, conducted with the NOSA–ITACA 1.2 code is to compare the natural frequencies and mode shapes of the beam in the linear elastic case with those in the presence of the damage induced by the increasing lateral load. We conducted a preliminary modal analysis by assuming the beam to be made of a linear elastic material with Young’s modulus E = 3 · 109 Pa, Poisson’s ratio ν = 0.2 and mass density ρ = 1800 kg/m3 , for which we calculated the corresponding natural frequencies fli and mode shapes φli . Then, by following the procedure outlined in Section 3, we incremented the lateral load and, at each increment, calculated the frequencies fi and modes φi . The 12 value of the lateral load applied to the beam was increased through seven increments from 9 · 103 N (which was able to induce the first crack in the beam’s midsection) to 15.75 · 103 N. Table 1 reports the value of the lateral load and the corresponding natural frequencies. The first row summarizes the results of the linear elastic modal analysis. As outlined in Table 1, as the lateral load increases, the beam’s fundamental frequency decreases from the linear elastic value of 6.47 Hz to 3.71 Hz, about one half its initial value. The other frequencies fall by up to thirty per cent. The frequencies ratio fi /fli is reported in Figure 2. The Figure clearly shows that when the lateral load is applied, the fundamental frequency value falls faster than the other frequency values. This is due to the chosen lateral load distribution, which induces a deformation in the beam similar to the first mode shape. Table 1 also reports the values of the effective modal masses [41] calculated for the first six mode shapes. The modes are also shown in Figure 1, where the black line stands for the modes φli calculated for the linear elastic case, while the cyan line represents the modes φi calculated at the last increment of the analysis. It is worth noting that the first, second, fifth and sixth modes substantially maintain their shape, while some changes occur between the third and fourth mode: their frequency values are very similar, but in the linear elastic analysis the third mode has an axial direction, while the fourth mode has transverse direction. The nonlinear case shows that the masses of the third mode pass from the axial to the transverse direction, while for the fourth mode diverts from transverse to axial [42]. A small part of the total mass in the axial direction migrates towards the higher modes and is not shown in the Table. In order to compare the mode shapes φli and φj , we introduce the quantity MAC–M (φli , φj ) |φli · M φj | q , =p l φi · M φi φlj · M φj (40) which measures the correlation between the i − th linear elastic mode shape and the j − th mode shape of the damaged structure. More precisely, if the MAC–M value is close to unity, then the vectors φli and φj are nearly parallel with to respect to the scalar product in Rn induced by matrix M . Table 2 reports the quantities MAC–M (φli , φj ) calculated for i, j = 1, 2, ..., 6, with φj the damaged mode shape calculated at the last load increment, corresponding to the lateral load 15.75 · 103 N. As the lateral load increases, the quantities MAC–M (φl3 , φ3 ) and MAC–M (φl3 , φ4 ) drawn in Figure 3 in 13 Figure 1: The geometry of the beam (left) and its first six mode shapes (right): linear elastic (black) and masonry–like (cyan) case (lengths in cm). The masonry–like case is shown for the last load increment. blue and green lines, respectively, pass from 1 to 0.4 and from 0 to 0.88 (see Table 2), thus showing that mode shape φ3 , initially coincident with φl3 , tends to become M -orthogonal to it and φ4 initially M -orthogonal to φl3 tends to become M -parallel to it. Finally, Figure 4 shows the distributions of the fractured areas in the beam at the last load increment, together with the ratio between the cracked area Af and total area A calculated in every section of the beam. 4.2. The masonry arch on piers Let us consider the masonry arch on piers shown in Figure 5. The arch span is 6 m and its cross section measures 0.25 m × 1 m. The arch has a circular shape, with a mean radius of 3.75 m, and rests on two lateral piers with rectangular cross section of 0.8 m × 1 m and height 4 m. The structure is reinforced by means of two steel tie rods, with rectangular cross sections of 0.03 m × 0.03 m, fixed at the pier–arch nodes. An offset of 0.24 m has been considered between the axis of the arch and those of the piers. The structure, modelled by means of 1500 thick shell elements, [23], [36], is clamped at the piers’ base and forced to move in the x − z plane. Figure 5 also shows the elements’ local axes in red. Beam elements [23] have been used to model the tie rods. 14 15 Figure 2: The ratio fi /fi l for the first six natural frequencies of the beam vs. the lateral load. Figure 3: The quantities MAC–M (φl3 , φ3 ) (blue line) and MAC–M (φl3 , φ4 ) (green line) vs. the lateral load. 16 Figure 4: The ratio between the cracked area Af and total area A along the beam at the last load increment. (lengths in cm). 17 Just as for the beam described in the previous subsection, we conducted a preliminary modal analysis by assuming the masonry structure to be made of a linear elastic material with Young’s modulus E = 3 · 109 Pa, Poisson’s ratio ν = 0.2 and mass density ρ = 1800 kg/m3 , while for the tie rods we have assumed E = 2.1 · 1011 Pa, Poisson’s ratio ν = 0.3 and mass density ρ = 7850 kg/m3 . The modal analysis allowed us to calculate the structure’s natural frequencies fli and mode shapes φli . The loads have been applied incrementally, first the self–weight of the structure alone, and then a concentrated vertical load P, whose value was increased through four increments from 150.61 · 103 N to 154.61 · 103 N. Seven analyses were performed, each time moving the load P to different positions along the arch span (see Figure 5). The natural frequencies fi and mode shapes φi of the damaged structure have thus been calculated for each analysis at each load increment. Table 3 shows the structure’s first five natural frequencies vs. load increment for the concentrated load P in X4 , at about one fourth of the arch span. As the load P increases, the fundamental frequency value of the structure decreases from 6.54 Hz to 2.54 Hz, the others fall by up to fifty percent of their linear elastic value. This behaviour is also evident in Table 5, for P in the middle of the arch. Figures 6 to 10 show the first five frequencies of the structure vs. the load application point along the arch span, for the four load P values used during the analyses (P1 = 150605 N, P2 = 152605 N, P3 = 153605 N, P4 = 154605 N). These Figures show that all the structure’s frequencies reach their minimum values when load P is at the arch’s quarter points (between positions X4 and X5 ). The minimum decrease with respect to the linear elastic case is exhibited by frequencies f1 , f2 , f5 for P at X7 , while for frequencies f3 , f4 it appears between positions X5 and X6 . For a given load position Xi , all frequency values decrease their values as the load increases. The structure’s mode shapes are shown in Figures 11 and 12 for P at X4 and X7 , respectively. The corresponding effective modal masses are shown vs. load increments in Table 3 and 5, respectively. The masses excited by the first five modes in the linear elastic case [43] are about 80% of the total mass in the x direction and 10% in the z direction. The x direction, prevalent in modes 1, 2 and 5, is related to oscillations involving movement of the entire structure, while the z direction, prevalent in modes 3 and 4, relates to modes mainly involving local oscillations of the arch and piers. The values of the total excited masses remain stable during the nonlinear analyses, but their distribution among the modes tends to change: in particular, the masses 18 excited along x tend to migrate from the first mode shape to the second, while the masses along z pass from mode shape 3 to mode shape 4. This phenomenon is particularly evident when load P is at X4 . Accordingly, the MAC–M matrix plotted in Table 4 for P at X4 exhibits low values of the diagonal terms, while the off–diagonal terms reveal a high correlation at the end of the analysis between the first and second and third and fourth modes. Table 6, for P at X7 , shows that the first, second and fifth modes substantially maintain their shape, while the third and fourth do not. For each element we now introduce the Frobenius norm of the difference between the elemental stiffness matrices K̃e and Ke , whose assemblages form matrices K̃ and K, de = kK̃e − Ke k. (41) Figures 13 and 14 show the behaviour of de , e = 1, .., 1500 and highlight the elements in which the distance between the damaged and the linear elastic stiffness matrices attains the highest values. These elements substantially coincide with those characterized by the highest values of the fracture f strain, as shown in Figures 15 and 16, where the strains E22 = g2 · Ef g2 at the intrados and extrados of the structure are shown for P at X4 and X7 , respectively. 19 Figure 5: Geometry of the structure made of up the arch on piers and the different positions along the arch span at which the concentrated load P is applied (length in cm). The local axes of the finite–elements are drawn in red. 20 4.3. The bell tower of the Church of San Frediano in Lucca The Basilica of San Frediano (Figure 17), dating back to the 11th century, is one of the most fascinating monuments in Lucca, much of its fascination being due to the marvellous mosaics that adorn its façade. In June 2015 the church’s 52 m high bell tower was fitted with four high–sensitivity triaxial seismometric stations, made available by the Arezzo Earthquake Observatory (Osservatorio Sismologico di Arezzo) and left active on the tower for three days (Figure 18). Data from the instruments, analyzed via OMA techniques [29], allowed us to determine the tower’s first five natural frequencies fiexp and corresponding damping ratios [28]. Information on the mode shapes was also extracted, though the arrangement of the sensors, aligned along the vertical, did not allow for reliable identification of the torsional modes. In the following the NOSA–ITACA code, together with model updating techniques, is employed in order to fit the experimental results in the linear elastic and the masonry–like (nonlinear) case. The finite–element model of the tower consists of 18495 thick shell elements [36]. The four steel tie rods fitted to the masonry vault under the bell chamber (between section 3 and section 4 in Figure 18) are modelled with beam elements [23], which have also been used to model the wooden trusses and rafters constituting the pavillion roof covering the tower. The mechanical properties of the tie rods and wooden elements are, respectively, E = 2.1 · 105 MPa, ν = 0.3, ρ = 7850 kg/m3 and E = 9500 MPa, ν = 0.4, ρ = 800 kg/m3 . With regard to the materials constituting the masonry tower, no experimental information is available to date. Visual inspection reveals that the external layers of the walls are made up of regular stone blocks at the base, while quite homogeneous brick masonry forms the upper part, except for the central part of the walls, where the masonry between the windows is made up of stone blocks. A first attempt to fit the experimental results through model updating procedures, conducted in [28], showed that good results can be achieved by assuming homogeneous values for the mechanical properties of all the materials making up the tower. Herein we proceed in the same way by assuming Young’s modulus E and the mass density ρ of masonry as parameters to be updated. In particular, for different values of E and ρ satisfying 3 · 109 Pa ≤ E ≤ 7 · 109 Pa, 1800 kg/m3 ≤ ρ ≤ 2200 kg/m3 , 21 (42) 22 Figure 6: The structure’s frequency f1 vs. the position of the concentrated load P for different load increments. 23 Figure 7: The structure’s frequency f2 vs. the position of the concentrated load P for different load increments. 24 Figure 8: The structure’s frequency f3 vs. the position of the concentrated load P for different load increments. 25 Figure 9: The structure’s frequency f4 vs. the position of the concentrated load P for different load increments. 26 Figure 10: The structure’s frequency f5 vs. the position of the concentrated load P for different load increments. Figure 11: The first five mode shapes of the structure for load P at position X4 : linear elastic (black) and masonry–like (cyan) case. The masonry–like case is shown for the last load increment (length in cm). 27 Figure 12: The first five mode shapes of the structure for load P at position X7 : linear elastic (black) and masonry–like (cyan) case. The masonry–like case is shown for the last load increment. 28 Figure 13: Distribution of de , e = 1, .., 1500 in the structure for the load P at position X4 . The result refers to the last load increment. 29 Figure 14: Distribution of de , e = 1, .., 1500 in the structure for the load P at position X7 . The result refers to the last load increment. 30 f Figure 15: Fracture strain E22 at the intrados (left) and the extrados (right) of the structure for load P at position X4 . f Figure 16: Fracture strain E22 at the intrados (left) and the extrados (right) of the structure for load P at position X7 . 31 Figure 17: The Basilica of San Frediano in Lucca (Italy). On the left, the San Frediano bell tower. 32 the first five natural frequencies of the tower are calculated for the linear elastic and nonlinear case, after having applied the structure’s self–weight alone. The optimal values of E and ρ, are determined by minimizing the functions l e (E, ρ) = 5 X fil (E, ρ) − fiexp 2 , (43) i=1 e(E, ρ) = 5 X (fi (E, ρ) − fiexp )2 , (44) i=1 respectively in the linear and nonlinear cases, for E and ρ satisfying (42). Figures 19 and 20 respectively show the functions el and e vs. E and ρ. They reach their minimum values at E = 4 · 109 Pa and ρ = 2000 kg/m3 for the linear elastic case and at E = 5 · 109 Pa and ρ = 2000 kg/m3 for the nonlinear case. Figure 21 plots the two functions vs. E for ρ = 2000 kg/m3 . The first five natural frequencies of the tower are shown in Table 7, where the experimental values fiexp are compared with the numerical values, in  the linear elastic fil and nonlinear (fi ) case. Columns ∆fil and ∆fi show the differences between the numerical and experimental values for the linear and nonlinear case, respectively. The numerical frequencies differ from the experimental values by no more than five percent. The nonlinear case is more accurate in evaluating the higher modes. Figure 22 shows the first five mode shapes, calculated in the  nonlinear case for the optimal values 9 3 E = 5 · 10 Pa, ρ = 2000 kg/m . They are substantially equal to the linear elastic modes, which are shown in [28]. The Figure clearly shows that the third mode is torsional. Finally, Figure 23 shows the maximum principal fracture strains for the tower in equilibrium with its own weight in the inner and outer layers of the mesh for E = 5 · 109 Pa and ρ = 2000 kg/m3 . The crack distribution and the low values of the fracture strains indicate a modest level of damage inside the structure: the fracture strains are concentrated around the windows and lintels, and in the masonry supporting the vault under the bell chamber. This confirms the observations made upon visual inspection. Crack strains are concentrated in regions of the structure quite far from those of the highest curvatures for the first mode shapes, which in fact remain very similar to those calculated in the linear elastic case. However, due to the nonlinearity of the constitutive equation adopted, the model updating procedure yields higher values of Young’s modulus, which 33 increases by about the twenty–five percent with respect to the linear elastic case. 34 List of Figures 1 2 3 4 5 6 7 8 9 10 11 12 13 14 The geometry of the beam (left) and its first six mode shapes (right): linear elastic (black) and masonry–like (cyan) case (lengths in cm). The masonry–like case is shown for the last load increment. . . . . . . . . . . . . . . . . . . . . . . . . . . The ratio fi /fi l for the first six natural frequencies of the beam vs. the lateral load. . . . . . . . . . . . . . . . . . . . . . . . . The quantities MAC–M (φl3 , φ3 ) (blue line) and MAC–M (φl3 , φ4 ) (green line) vs. the lateral load. . . . . . . . . . . . . . . . . . The ratio between the cracked area Af and total area A along the beam at the last load increment. (lengths in cm). . . . . . Geometry of the structure made of up the arch on piers and the different positions along the arch span at which the concentrated load P is applied (length in cm). The local axes of the finite–elements are drawn in red. . . . . . . . . . . . . . . The structure’s frequency f1 vs. the position of the concentrated load P for different load increments. . . . . . . . . . . . The structure’s frequency f2 vs. the position of the concentrated load P for different load increments. . . . . . . . . . . . The structure’s frequency f3 vs. the position of the concentrated load P for different load increments. . . . . . . . . . . . The structure’s frequency f4 vs. the position of the concentrated load P for different load increments. . . . . . . . . . . . The structure’s frequency f5 vs. the position of the concentrated load P for different load increments. . . . . . . . . . . . The first five mode shapes of the structure for load P at position X4 : linear elastic (black) and masonry–like (cyan) case. The masonry–like case is shown for the last load increment (length in cm). . . . . . . . . . . . . . . . . . . . . . . . . . . The first five mode shapes of the structure for load P at position X7 : linear elastic (black) and masonry–like (cyan) case. The masonry–like case is shown for the last load increment. . . Distribution of de , e = 1, .., 1500 in the structure for the load P at position X4 . The result refers to the last load increment. Distribution of de , e = 1, .., 1500 in the structure for the load P at position X7 . The result refers to the last load increment. 35 14 15 16 17 20 22 23 24 25 26 27 28 29 30 Figure 18: Sections of the San Frediano bell tower and sensors’ arrangement. 36 Figure 19: Function el (E, ρ): linear case. 37 Figure 20: Function e(E, ρ): nonlinear case. 38 Figure 21: Functions e(E, ρ) (red line) and el (E, ρ) (blue line) vs. E for ρ = 2000 kg/m3 . 39 40 Figure 22: Mode shapes φi , i = 1, .., 5 of the San Frediano bell tower in the nonlinear case, 9 3 Figure 23: Maximum principal fracture strains in the San Frediano bell tower: inner (on the left) and outer (on the right) layers, for E = 5 · 109 Pa, ρ = 2000 kg/m3 . 41 15 16 17 18 19 20 21 22 23 f Fracture strain E22 at the intrados (left) and the extrados (right) of the structure for load P at position X4 . . . . . . . . f Fracture strain E22 at the intrados (left) and the extrados (right) of the structure for load P at position X7 . . . . . . . . The Basilica of San Frediano in Lucca (Italy). On the left, the San Frediano bell tower. . . . . . . . . . . . . . . . . . . . . . Sections of the San Frediano bell tower and sensors’ arrangement. Function el (E, ρ): linear case. . . . . . . . . . . . . . . . . . . Function e(E, ρ): nonlinear case. . . . . . . . . . . . . . . . . Functions e(E, ρ) (red line) and el (E, ρ) (blue line) vs. E for ρ = 2000 kg/m3 . . . . . . . . . . . . . . . . . . . . . . . . . . . Mode shapes φi , i = 1, .., 5 of the San Frediano bell tower in the nonlinear case, for E = 5 · 109 Pa, ρ = 2000 kg/m3 . . . . . Maximum principal fracture strains in the San Frediano bell tower: inner (on the left) and outer (on the right) layers, for E = 5 · 109 Pa, ρ = 2000 kg/m3 . . . . . . . . . . . . . . . . . . 31 31 32 36 37 38 39 40 41 5. Conclusions The paper deals with the modal analysis of masonry structures. In particular, a new procedure for calculating the natural frequencies and mode shapes of masonry buildings has been implemented within the NOSA–ITACA code, to take into account the inability of masonry to withstand tensile stresses. Some structures have been analyzed and the influence on their dynamic properties of the fracture strains induced by their self-weights and external loads investigated. In particular, the new algorithm has been applied to the finite– element model of the San Frediano bell tower in Lucca, and the results of the numerical simulation compared with those from an experimental campaign conducted on the tower in June, 2015. The new procedure provides for more realistic simulations of the dynamic behaviour of masonry structures in the presence of cracks and, when combined with experimental data, can be helpful in assessing damage. Moreover, the dependence of the natural frequencies on external loads (the case of thermal loads is under development) can be assessed, and used to interpret data from long–term monitoring protocols. References [1] Dimarogonas AD. Vibration of cracked structures: a state of art review. Engineering Fracture Mechanics 1996; 55(5):831-857, Elsevier. 42 [2] Salawu OS. Detection of structural damage through changes in frequency: a review. Engineering Structures 1997; 19(9): 718–723, Elsevier. [3] Dos Santos FLM, Peeters B, Van der Auweraer H, Goes LCS, Desmet W. Vibration-based damage detection for a composite helicopter main rotor blade. Case Studies in Mechanical Systems and Signal Processing 2016; http://dx.doi.org/10.1016/j.csmssp.2016.01.001. [4] Agarwali S, Chaudhuri SR. Damage detection in large structures using mode shapes and its derivatives. International Journal of Research in Engineering and Technology 2015; 4, Special Issue 13. [5] Wahab MMA. Effect of modal curvatures on damage detection using model updating. Mechanical Systems and Signal Processing 2001; 15(2): 439–445, Elsevier. [6] Azzara RM, Zaccarelli L, Morelli A, Trombetti T, Dallavalle G, Cavaliere A, Danesi S. Seismic monitoring of the Asinelli and Garisenda medioeval towers in Bologna (Italy), an instrumental contribution to the engineering modeling direct to their protection. Proceedings of the second International Conference on Protection of Historical Constructions 2014; F. M. Mazzolani and G. Altay (Eds), Bogaziçi University Publishing. [7] Gentile C, Saisi A, Cabboi A, Dynamic monitoring of a masonry tower. Proceedings of the 8th International Conference on Structural Analysis of Historical Constructions, SAHC 2012 2012; Jasienko J. (Ed). [8] Ramos LF , Marques L , Lourenço PB , De Roeck G, Campos-Costa A, Roque J. Monitoring historical masonry structures with operational modal analysis: two cas studies. Mech. Syst. Signal Process 2010; 24: 1291-1305, Elsevier. [9] Abbiati G, Ceravolo R, Surace C. Time-dependent estimators for on-line monitoring of full-scale structures under ambient excitation. Mechanical Systems and Signal Processing 2015; 60–61: 166–181. [10] Ramos LF, De Roeck G, Lourenço PB, Campos–Costa A. Damage identification on arched masonry structures using ambient and random impact vibrations. Engineering Structures 2010; 32: 146–162, Elsevier. 43 [11] Gentile C, Saisi A. Operational modal testing of historic structures at different levels of excitation. Construction and buiding Materials 2013; 48:1273–1285. [12] Saisi A, Gentile C, Guidobaldi M. Post–earthquanke continuous dynamic monitoring of the Gabbia Tower in Mantua, Italy. Construction and Buiding Materials 2015; 48:1273–1285, Elsevier. [13] Ren WX, De Roeck G. Structural Damage Identification using Modal Data. I: Simulation Verification. Journal of Structural Engineering 2002; 128(1): 87–95, ASCE. [14] Ren WX, De Roeck G. Structural Damage Identification using Modal Data. II: Test Verification. Journal of Structural Engineering 2002; 128(1): 96–104, ASCE. [15] Jayanthan M, Srinivas V. Structural Damage Identification Based on Finite Element Model Updating. Journal of Mechanical Engineering and Automation 2015; 5(3B): 59-63. [16] Pineda P. Collapse and upgrading mechanisms associated to the structural materials of a deteriorated masonry tower. Nonlinear assessment under different damage and loading levels. Engineering Failure Analysis 2016; 63:72–93, Elsevier. [17] Bui TT, Limam A, Bui QB. Characterisation of vibration and damage in masonry structures: experimental and numerical analysis. European Journal of Environmental and Civil Engineering 2014; 18(10), 1118– 1129. [18] Cakti E, Saygili O, Lemos JV, Oliveira CS. A parametric study of the earthquake behaviour of masonry minarets. Proceedings of the Tenth U.S. National Conference on Earthquake Engineering Frontiers of Earthquake Engineering, 10NCEE, 2014. July 21-25, Anchorage, Alaska. [19] Girardi M, Lucchesi M. Free flexural vibrations of masonry beam– columns. Journal of Mechanics of Materials and Structures 2010; 5(1): 143–159. [20] Del Piero G. Constitutive equations and compatibility of external loads for linear elastic masonry–like materials. Meccanica 1989; 24:150–162. 44 [21] Di Pasquale S. New trends in the analysis of masonry structures. Meccanica, 1992. 27:173–184. [22] Lucchesi M, Padovani C, Pasquinelli G, Zani N. Masonry constructions: mechanical models and numerical applications 2008; Lecture Notes in Applied and Computational Mechanics. Springer–Verlag. [23] Binante V, Girardi M, Padovani C, Pasquinelli G, Pellegrini D, Porcelli M. NOSA-ITACA 1.0 documentation 2014. www.nosaitaca.it/en. [24] http://www.nosaitaca.it [25] Harak SS, Sharma SC, Harsha SP. Modal analysis of prestressed draft pad of freight wagons using finite element method. J. Mod. Transport 2015; 23(1):43–49. [26] Noble D, Nogal M, O’Connor AJ, Pakrashi V. The effect of posttensioning force magnitude and eccentricity on the natural bending frequency of cracked post-tensioned concrete beams, Journal of Physics. Conference Series 628, 2015. IOPscience. [27] Porcelli M, Binante V, Girardi M, Padovani C, Pasquinelli G. A solution procedure for constrained eigenvalue problems and its application within the structural finite-element code NOSA–ITACA. Calcolo 2015; 52(2): 167–186, Springer Milan. [28] Azzara RM, De Roeck G, Girardi M, Padovani C, Pellegrini D, Reynder E. Assessment of the dynamic behaviour of an ancient masonry tower in Lucca via ambient vibrations. Structural Analysis of Historical Constructions–Anamnesis, diagnosis, therapy, controls 2016; Van Balen and Verstrynge (Eds), ISBN 978–1–138–02951–4. [29] Brincker R, Ventura C. Introduction to Operational Modal Analysis 2015. John Wiley & Sons. [30] Padovani C, Silhavy M. On the derivative of the stress-strain relation in a no-tension material. Mathematics and Mechanics of Solids 2015; Online First 27 February 2015, Sage Publications Inc. [31] Degl’Innocenti S, Padovani C, Pasquinelli G. Numerical methods for the dynamic analysis of masonry structures. Structural Engineering and Mechanics 2006; 22(1): 107-130. 45 [32] Bathe KJ, Wilson EL. Numerical Methods in Finite Element Analysis 1976. Prentice-Hall. [33] Lucchesi M, Padovani C, Pasquinelli G, Zani N. Static analysis of masonry vaults, constitutive model and numerical analysis. Journal of Mechanics of Materials and Structures 2007; 2(2), 221–224. Mathematical Science Publishers. [34] Bernardeschi K, Padovani C, Pasquinelli G. Numerical modelling of the structural behaviour of Buti’s bell tower. Journal of Cultural Heritage 2004; 5(4): 371–378. [35] http://www.salome-platform.org [36] Girardi M, Padovani C, Pellegrini D. The NOSA-ITACA code for the safety assessment of ancient constructions: a case study in Livorno. Advances in Engineering Software 2015. 89, 64–76. [37] D.M. 14 gennaio 2008, Norme Tecniche per le Costruzioni, G.U. 4 febbraio 2008, n. 29. [38] Saad Y. Iterative methods for sparse linear systems 2003. (2nd edition), SIAM. [39] Lehoucq RB, Sorensen DC, Yang C. ARPACK Users Guide. Solution of Large Scale Eigenvalue Problem with Implicit Restarted Arnoldi Methods 1998. SIAM. [40] Gurtin ME. The linear theory of elasticity. Encyclopedia of Physics, Vol. VIa/2, Mechanics of Solids II 1972. Truesdell C. (Ed). Springer-Verlag. [41] Clough RW, Penzien J. Dynamics of Structures 1975. McGraw–Hill Inc. [42] Nayfeh AH. Nonlinear Interactions 2000. Wiley Series in Nonlinear Science. John Wiley & Sons Inc. [43] Karnovsky IA. Theory of Arched Structures. Springer Science + Business Media, ISBN 978-1-4614-0468-2. 46 Lateral load [N] f1 [Hz] 0 9000 10125 11250 12375 13500 14625 15750 6.47 6.44 6.13 5.74 5.23 4.72 4.21 3.71 Lateral load [N] f4 [Hz] 0 9000 10125 11250 12375 13500 14625 15750 55.96 55.71 54.69 54.30 53.46 52.31 50.79 49.37 Eff. modal mass [%] y z 80.73 0.00 80.73 0.00 80.32 0.00 79.98 0.00 79.53 0.00 79.09 0.00 78.77 0.00 78.35 0.00 Eff. modal mass [%] y z 8.77 0.00 8.77 0.00 6.15 25.67 4.90 36.06 3.41 47.18 2.07 56.67 1.22 61.54 0.06 64.93 f2 [Hz] 25.48 25.48 25.27 24.36 23.12 21.80 19.95 18.34 f5 [Hz] 96.43 96.37 94.51 90.15 85.85 82.42 76.97 71.94 Eff. modal mass [%] y z 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Eff. modal mass [%] y z 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 f3 [Hz] 53.79 53.74 52.63 51.22 48.97 46.14 43.75 40.69 Eff. modal mass [%] y z 0.00 81.06 0.00 80.76 2.95 54.97 4.42 44.12 6.05 32.33 7.38 22.13 8.10 16.40 8.60 12.06 f6 [Hz] 145.30 144.79 141.80 137.51 130.80 122.50 115.60 108.10 Eff. modal mass [%] y z 3.07 0.00 3.07 0.00 3.10 0.00 3.11 0.00 3.27 0.00 3.49 0.00 3.72 0.00 3.92 0.00 Table 1: The beam’s natural frequencies fi , i = 1, ..., 6 and the effective modal masses of the corresponding mode shapes versus load increments. φl1 φl2 φl3 φl4 φl5 φl6 φ1 0.99 0.00 0.05 0.04 0.00 0.00 φ2 0.00 0.99 0.04 0.00 0.12 0.00 MAC – φ3 0.06 0.02 0.41 0.88 0.00 0.16 M φ4 0.03 0.04 0.90 0.41 0.04 0.09 φ5 0.00 0.12 0.04 0.01 0.95 0.00 φ6 0.00 0.00 0.01 0.19 0.00 0.93 Table 2: MAC–M (φli , φj ), for i,j = 1, 2, ..., 6 at the last load increment. 47 Total vertical load [N ] 0 144605 P1 =150605 P2 =152605 P3 =153605 P4 =154605 Eff. modal mass [%] f1 [Hz] 6.54 6.53 5.98 4.79 3.61 2.54 Total vertical load [N ] 0 144605 P1 =150605 P2 =152605 P3 =153605 P4 =154605 x 59.43 59.29 51.21 28.54 15.38 9.91 f4 [Hz] 33.74 32.44 30.34 27.28 25.45 24.20 z 0.00 0.00 0.00 0.00 0.00 1.32 f2 [Hz] x 18.81 8.75 18.50 8.83 12.57 15.47 9.00 37.27 8.10 50.00 7.74 77.4 Eff. modal mass [%] x 0.00 0.00 0.00 0.00 0.00 0.00 Eff. modal mass [%] z 1.57 2.82 4.55 8.91 11.08 11.70 z 0.00 0.00 0.00 0.00 0.00 0.00 22.49 22.01 21.04 18.79 15.43 12.06 Eff. modal mass [%] x 0.00 0.00 0.00 0.00 0.00 0.00 Eff. modal mass [%] f5 [Hz] 45.37 44.80 38.48 32.70 28.19 23.60 f3 [Hz] x 11.88 11.28 6.74 3.96 2.98 1.39 z 0.00 0.00 0.00 0.00 0.00 0.00 Table 3: The structure’s natural frequencies fi , i = 1, .., 5 and the effective modal masses of the corresponding mode shapes versus load increments. Load P at position X4 . φl1 φl2 φl3 φl4 φl5 φ1 0.64 0.71 0.14 0.07 0.10 MAC – M φ2 φ3 0.77 0.00 0.59 0.05 0.11 0.68 0.06 0.52 0.09 0.19 φ4 0.00 0.08 0.43 0.63 0.17 φ5 0.00 0.31 0.56 0.07 0.57 Table 4: MAC–M (φli , φj ), for i,j = 1, 2, ..., 5 at the last load increment. Load P at position X4 . 48 z 7.92 6.98 5.91 2.92 0.92 0.30 Total vertical load [N ] 0 144605 P1 =150605 P2 =152605 P3 =153605 P4 =154605 Eff. modal mass [%] f1 [Hz] 6.54 6.53 6.36 6.19 6.06 5.97 Total vertical load [N ] 0 144605 P1 =150605 P2 =152605 P3 =153605 P4 =154605 x 59.43 59.29 57.80 55.55 53.07 51.06 f4 [Hz] 33.74 32.44 26.00 24.37 23.34 22.96 z 0.00 0.00 0.00 0.00 0.00 0.00 f2 [Hz] 18.81 18.50 17.09 15.06 13.41 12.44 Eff. modal mass [%] x 0.00 0.00 0.00 0.00 0.00 0.00 z 1.57 2.82 12.76 14.06 13.78 13.41 Eff. modal mass [%] x 8.75 8.83 9.99 11.89 14.08 15.92 z 0.00 0.00 0.00 0.00 0.00 0.00 22.49 22.01 18.82 16.47 14.26 13.25 Eff. modal mass [%] x 0.00 0.00 0.00 0.00 0.00 0.00 Eff. modal mass [%] f5 [Hz] 45.37 44.80 40.18 39.31 37.13 35.52 f3 [Hz] x 11.88 11.28 0.00 0.00 2.74 2.09 z 0.00 0.00 5.55 3.69 0.00 0.00 Table 5: The structure’s natural frequencies fi , i = 1, .., 5, and the effective modal masses of the corresponding mode shapes versus load increments. Load P at position X7 . φl1 φl2 φl3 φl4 φl5 φ1 0.98 0.17 0.00 0.00 0.00 MAC – M φ2 φ3 0.17 0.00 0.98 0.00 0.00 0.46 0.00 0.64 0.03 0.00 φ4 0.00 0.00 0.89 0.34 0.00 φ5 0.00 0.04 0.00 0.00 0.75 Table 6: MAC–M (φli , φj ), for i,j = 1, 2, ..., 5 at the last load increment. Load P at position X7 . 49 z 7.92 6.98 0.70 0.00 0.60 0.10 Mode Mode Mode Mode Mode Shape Shape Shape Shape Shape 1 2 3 4 5 fiexp 1.14 1.38 3.44 4.60 5.34 fil ∆fil fi ∆fi 1.15 0.01 1.18 0.04 1.38 0.00 1.41 0.02 3.60 0.05 3.39 -0.01 4.41 -0.04 4.61 0.00 5.35 0.00 5.44 0.02 Table 7: Natural frequencies [Hz] of the tower: experimental values fiexp , numerical values fil identified on the linear elastic model; numerical values fi identified on the masonry–like model. 50
5cs.CE