1 The Packing Radius of a Code and Partitioning Problems: the Case for Poset Metrics Rafael Gregorio Lucas D’Oliveira, Marcelo Firer Abstract—Until this work, the packing radius of a poset code chain posets [3], hierarchical posets [4], disjoint union of was only known in the cases where the poset was a chain, a chains of the same size [5], and for some families of codes hierarchy, a union of disjoint chains of the same size, and for [6]. We will approach the general poset case. To do this we some families of codes. Our objective is to approach the general will divide our problem in two. caseofanyposet.Todothis,wewilldividetheproblemintotwo 3 parts. The first part consists in determining the packing radius of 1 Thefirstpartconsistsinfindingthepackingradiusofasingle a single vector. We will see that this is equivalent to solving 0 vector.Wewillshowthatthisisequivalenttoageneralizationof a generalization, which we will call “the poset partition prob- 2 a famous NP-hard problem known as “the partition problem”. lem”, of a famous NP-hard problem known as “the partition Then,wewillreviewthemainresultsknownaboutthisproblem n problem”.Wewillthentakealookatthebestknownalgorithm giving special attention to the algorithms to solve it. The main a ingredient to these algorithms is what is known as the differen- forsolvingthepartitionproblemandgeneralizeittotheposet J tiating method, and therefore, we will extend it to the general partition problem. The first time the problem of finding the 4 case. packing radius of a poset code was identified, in some sense, 2 Thesecondpartconsistsinfindingthevectorthatdetermines as a partitioning problem was in [7]. the packing radius of the code. For this, we will show how it is ] sometimespossibletocomparethepackingradiusoftwovectors The second part consists in finding which code-word deter- T without calculating them explicitly. minesthepackingradiusofthecode.Todothiswewillshow I how some times it is possible to compare the packing radius . Index Terms—Error correction codes, poset codes. s of two vectors without calculating them explicitly. c [ 1 I. INTRODUCTION II. PRELIMINARIES Animportantconceptofcodingtheoryisthatofthepacking v A. The Poset Metric 5 radiusofacode.WhenusingtheHammingmetricthisconcept 1 is overshadowed by that of the minimum distance since it is Let [n] = {1,2,...,n} be a finite set and (cid:22) be a partial 9 determined completely by it, i.e. if C is a code and d (C) is order on [n]. We call the pair P =([n],(cid:22)) a poset and often H 5 the minimum distance of C in the Hamming metric, it is well identify P with [n]. An ideal in P is a subset J ⊆ P with . 1 known that the packing radius of C is the property that if x ∈ J and y (cid:22) x then y ∈ J. The ideal 0 (cid:22) (cid:23) generated by a subset X ⊆P is the smallest ideal containing 3 R (C)= dH(C)−1 . X and is denoted by (cid:104)X(cid:105). A poset is called a chain if every 1 dH 2 two elements are comparable, and an anti-chain if none are. : v In this work we will consider the problem of finding the Thelengthofanelementx∈P isthecardinalityofthelargest i X packing radius in the case of poset metrics. These metrics chain contained in (cid:104){x}(cid:105). where first introduced by Brualdi et al. [1] generalizing on Let q be the power of a prime, F the field with q elements r q a the work of Neiderreiter [2]. An interesting property of these and Fn the vector space of n-tuples over F . We denote the q q metricsisthatthepackingradiusisnotnecessarilydetermined coordinates of a vector x∈Fn by x=(x ,x ,...,x ). q 1 2 n by the minimum distance. What we do have, nonetheless, is A poset P = ([n],(cid:22)) induces a metric d , called the P- P the following inequality distance, in Fn defined as q (cid:22) (cid:23) d (C)−1 P ≤R (C)≤d (C)−1. dP(v,w)=|(cid:104)supp(v−w)(cid:105)| 2 dP P where supp(x) = {i ∈ [n] : x (cid:54)= 0}. The distance ω (v) = i P It is known that the upper bound is attained when the poset is d (v,0) is called the P-weight of v. P a chain [3]. Note that if P is an anti-chain then d is the Hamming Until this work, to the authors’ knowledge, the packing P distance. Because of this, when P is an anti-chain we will radiusofaposetcodewasonlyknowninthefollowingcases: denote it by H. Given a linear code C ⊆Fn and a poset P =([n],(cid:22)), we R.G.L.D’OliveirawaspartiallysupportedbyCNPq.M.Firerwaspartially q supportedbyFAPESPgrant2007/56052-8. define the minimum distance of C as d (C)=min{ω (v): P P R.G.L.D’OliveiraiswithIMECC-UNICAMP,UniversidadeEstadualde v ∈C−{0}}.ThepackingradiusofC isdenotedbyR (C) Campinas,CEP13083-859,Campinas,SP,Brazil(e-mail: dP and is defined as the largest positive integer such that [email protected]) M.FireriswithIMECC-UNICAMP,UniversidadeEstadualdeCampinas, CEP13083-859,Campinas,SP,Brazil(e-mail:mfi[email protected]) BP(x,RdP(C))∩BP(y,RdP(C))=∅ 2 for every x,y ∈ C. Since C is linear, z = x−y ∈ C and elements terminate, otherwise add one to r and start again. thereforethepackingradiusisthelargestpositiveintegersuch After the algorithm is terminated the packing radius will be that r−1. B (0,R (C))∩B (z,R (C))=∅ P dP P dP Example 1. Let P be a chain of height three such that 1 (cid:22) for every z ∈C. 2(cid:22)3andd themetricinducedbythisposetonF3.Letsfind P 2 It is well known that in the Hamming case, the packing the packing radius v = 001 using the brute force algorithm radius of a linear code C ⊆Fn is given by described above. The following table lists the elements found q in the spheres of size r and center c. (cid:22) (cid:23) d (C)−1 R (C)= H . dH 2 c=000 c=001 r=1 100 101 In the general case, however the following inequality is true: r=2 110 010 111 011 (cid:22) (cid:23) d (C)−1 P ≤R (C)≤d (C)−1. r=3 111 101 001 011 110 100 000 010 2 dP P Since there are no repetitions of elements on the two columns III. THEPACKINGRADIUSOFAVECTOR until r =3, the packing radius of v is RdP(001)=2. We begin this section by defining the packing radius of a Intheexamplegivenabove,thevectorsofthetwocolumns vector. are related by a translation T of the form T(x) = v − x Definition 1. Let x ∈ Fn and d be a metric over Fn. The with the property that x ∈ S(0,r) iff T(x) ∈ S(v,r). The q q packing radius of x is the largest integer r such that reason for this is that the poset metric above, as all other poset metrics, is translation invariant, i.e. for all x,y,z ∈Fn, q B(0,r)∩B(x,r)=∅ d (x,y)=d (x+z,y+z). P P We make the following definition: and is denoted by R (x). d Definition 3. Let x,v ∈ Fn. We define the complement of x Note that the packing radius of x is the packing radius of q with respect to v as xv =v−x. the code C ={0,x}. Next, we show that the packing radius of a linear code is We now make our last statement precise. the smallest of the packing radius of its code-words. Lemma 1. Let d be a translation invariant metric over Fn, Proposition 1. Let C ⊆Fnq be a linear code and d a metric x,v ∈ Fn, and r ∈ R, such that r ≥ 0. Then x ∈ S(0,r) iqff over Fnq. Then, xv ∈S(vq,r). R (C)= min R (x). d d Proof: Since d is translation invariant, x∈C∗ Proof: Let y ∈ C∗ such that Rd(y) = minRd(x). By d(v,xv)=d(v−xv,0)=d(x,0). x∈C∗ definition, for every x∈C∗ B(0,Rd(x))∩B(x,Rd(x))=∅. Therefore, when the metric being considered is translation invariant, as is the case for a poset metric, the packing radius But, R (y)≤R (x), and therefore, d d of a vector v ∈ Fn can be found in the following way: We q B(0,Rd(y))∩B(x,Rd(y))=∅. maketwolists;inthefirstweputthevectorsofFnq orderedby weight,andforeveryvectorofthislistweputitscomplement Since inthesecondlist.Whenavectorxwhichhasalreadyappeared B(0,R (y)+1)∩B(y,R (y)+1)=∅, in the second list appears also in the first, we can determine d d the packing radius of v which will be ω (x)−1. P R (C)=R (y). d d This result motivates the following definition: Example 2. Using the method just described on the last example we have: Definition 2. Let C ⊆ Fn be a linear code and d a metric q over Fnq. A code-word x ∈ C∗ such that Rd(C) = Rd(x) is List 1 List 2 called a packing vector of C. 100 101 110 111 The packing vector of a linear code determines its packing 010 011 radius.Inthissection,wewillfocusontheproblemoffinding 111 110 thepackingradiusofavector,andleavetheproblemoffinding thepackingvectorofalinearcode,andthusitspackingradius, Since 111 already appeared in the second row, R (001) = for later. dP ω (111)−1=2. A possible brute force algorithm for finding the packing P radius of a vector v is the following: Start with r = 1. List We will use the following notation to simplify our expres- the elements of B(0,r) and B(v,r). If there are any repeated sions. 3 Definition 4. Let ω be a weight over Fn and x,y ∈ Fn. We Byitsdefinition,xsatisfiesthethirdcondition.Toshowthatit q q denote the maximum weight between x and y as satisfies the second condition, let i∈supp(x). Then, x (cid:54)=0, i but for this to happen we must have v (cid:54)=0 and z (cid:54)=0. Thus, ω∨(x,y)=max{ω(x),ω(y)}. i i i∈supp(v)∩supp(z). Ingeneralwehavethefollowingexpressionforthepacking radius: Finally,wemustshowthat itsatisfiesthefirstcondition.Note that Theorem 1. Let d be a translation invariant metric over Fn q and v ∈Fnq. Then, xvi =vi−xi =v −v [z (cid:54)=0] R (v)= min{ω∨(x,xv)}−1. i i i d x∈Fn =v (1−[z (cid:54)=0]) q i i Proof: Let y ∈Fnq be such that =vi[zi =0]. ω∨(y,yv)= min{ω∨(x,xv)} Since ziv =vi−zi, x∈Fn q [z =0]=[zv =v ] and R = ω∨(y,yv). Suppose there exists z ∈ B(0,R−1)∩ i i i B(v,R−1). Since z ∈B(0,R−1), we have ω(z)≤R−1, and therefore, and therefore, xvi =vi[ziv =vi]. ω(z)<ω∨(y,yv). Thus,ifi∈supp(xv),thenxv (cid:54)=0,andtherefore,v (cid:54)=0and i i Since z ∈B(v,R−1), by Lemma 1, zv ∈B(0,R−1). But ziv =vi, hence, ziv (cid:54)=0. Therefore, then, ω(zv)≤R−1, and therefore, supp(xv)⊆supp(zv). ω(zv)<ω∨(y,yv). But we have already seen that But if this is true, then supp(x)⊆supp(z). ω∨(z,zv)<ω∨(y,yv), Thus, ω (x)≤ω (z) a contradiction. Thus, B(0,R−1)∩B(v,R−1) = ∅, and P P since y ∈B(0,R)∩B(v,R), the theorem is proved. and The following definition is quite natural. ω (xv)≤ω (zv). P P Definition 5. Let d be a translation invariant metric over Fnq But then, and v ∈Fnq. We say y ∈Fnq is a radius vector of v if ωP∨(x,xv)≤ωP∨(z,zv), ω∨(y,yv)= min{ω∨(x,xv)}. from which the first condition follows. x∈Fn q This lemma reduces our search space for a vector radius Wecanthereforefindthepackingradiusofavectorv ∈Fn of v ∈ Fn to 2|supp(v)| elements. The third condition of the q q by finding a radius vector of v. If we search the whole of Fn lemmashowsthatthecardinalityofthefieldisirrelevanttoour q our search space will have size qn. Our following results will problem, that is, the case q = 2 is equivalent to the general reduce the size of our search space. We will be using the case. The second condition shows that the structure of the following notation. posetoutsideoftheidealgeneratedbythesupportofv isalso irrelevant. Thus, the packing radius of a vector is a property Definition 6. The Iverson bracket, introduced in [8], is of the ideal generated by its support. defined as: (cid:26) Withthisinmind,thefollowingdefinitionsarequitenatural. 1 if P is true [P]= 0 if P is false Definition 7. Let P be a poset and A ⊆ P. We define the P-weight of A as where P is a statement that can be true or false. ω (A)=|(cid:104)A(cid:105)|, P This notation was popularized by Knuth in [9]. the cardinality of the Ideal generated by A. Lemma 2. Let P be a poset and v ∈ Fn. Then, there exists x∈Fn such that: q Definition 8. Let P be a poset, v ∈ Fnq, and A ⊆ supp(v). q We define the complement of A with respect to v as 1) x is a radius vector of v ; 2) supp(x)⊆supp(v) ; Av =supp(v)−A. 3) for all i∈P, x =v or x =0. i i i Note that (A,Av) is a partition of supp(v). Proof:Letz ∈Fn bearadiusvectorofv.Definex∈Fn We are now ready to show that the problem of determining q q such that the radius vector of a vector is essentially a partitioning x =v [z (cid:54)=0]. problem. i i i 4 Lemma 3. Let P be a poset and v ∈Fn. Then, Since i∈supp(v), there exists j ∈M such that i≤j. q supp(v) If j ∈M , then min{ω∨(x,xv)}= min {ω∨(A,Av)} Z x∈Fnq P A⊆supp(v) P i∈(cid:104)MZ ∩Msupp(v)(cid:105), Proof: Define a contradiction. Thus, j ∈ M , and therefore, i ∈ (cid:104)M . Zv Zv fv :2supp(v) (cid:55)→Fnq Hence, Xv ⊆(cid:104)MZv(cid:105) and consequently as the function that takes A ⊆ supp(v) as input and outputs ωP(Xv)≤ωP(Zv). fv(A)=x such that Using both inequalities we have proven that X is a radius setofv.Now,weneedtoprovethat(M ,M )isapartition x =v [i∈A]. X Xv i i of M . We do this by proving that supp(v) Thisfunctionisinjectiveandweightpreserving,i.e.ω (A)= P M =M −M . ω (f (A)). It also respects complementation, as, since Xv supp(v) X P v (A,Av) is a partition of supp(v), Let i ∈ MXv. Then, certainly, i ∈/ MX. Suppose that i ∈/ M , then there exists j ∈ M such that i < j. f (A)+f (Av)=v [i∈A]+v [i∈Av]=v , supp(v) supp(v) v v i i i Since j cannot be in Xv we must have j ∈X, but that would and therefore, imply i ∈ MX, a contradiction. Thus, i ∈ Msupp(v), and f (Av)=f (A)v. therefore, v v M ⊆M −M . Xv supp(v) X Thus, Now, let i ∈ M − M . Then, i ∈ M and supp(v) X supp(v) A⊆msuipnp(v){ωP∨(A,Av)}=x∈fv(m2siunpp(v)){ωP∨(x,xv)}. iM∈/ MX. Sanindceisith∈/erXefoirteiisncMertain.lyHeinncXe,v, but it is also in supp(v) Xv ByLemma2,thereexistsaradiusvectorofv inf (2supp(v)), v M ⊇M −M , and the result follows. Xv supp(v) X Wedefinearadiussetanalogouslytotheconceptofaradius and the lemma is proven. vector. Thus, the problem of finding the packing radius of a vector has been transformed into a partitioning problem over the set Definition 9. Let P be a poset and v ∈ Fn. We say X ⊆ q of maximal elements of its ideals. supp(v) is a radius set of v if Theorem 2. Let P be a poset and v ∈Fn. Then, ω∨(X,Xv)= min {ω∨(A,Av)}. q P P A⊆supp(v) R (v)= min {max{ω (A),ω (B)}}−1, We will now reduce our search space even more. For this dP A,B⊆Msupp(v) P P we will need the following definition: where (A,B) is a partition of Msupp(v). Definition 10. Let P be a poset and A ⊆ P. We denote the Proof:ApplyLemma3toTheorem1,andthenusingthe set of maximal elements of A by M . definition of radius set, apply Lemma 4. A The size of our search spaced has been reduced to The weight of a set is determined by its maximal elements, 2|Msupp(v)| elements. i.e. ωP(A) = ωP(MA) since the ideal generated by both are We can make some changes on the notation in order to thesame.Itisquiteclearthenthatthemaximalelementsmust emphasize on the partitioning problem. be important in determining the radius set. Definition 11. Let P be a poset and M be the set of its P Lemma 4. Let P be a poset and v ∈ Fnq. Then, there exists maximal elements. We define the packing radius of the poset a radius set X of v such that (MX,MXv) is a partition of P as M . supp(v) R(P)= min {max{|(cid:104)A(cid:105)|),|(cid:104)B(cid:105)|}}−1, Proof: Let Z be a radius set of v. Define A,B⊆MP where (A,B) is a partition of M . P X =(cid:104)M ∩M (cid:105)∩supp(v). Z supp(v) Apartitionthatminimizestheexpressionaboveiscalledan First, we show that X is a radius set of v. By definition, optimum partition. M =M ∩M , As a direct corollary to Theorem 2 we have: X Z supp(v) Corollary 1. Let P be a poset and v ∈Fn. Then, and therefore, q R (v)=R(supp(v)). (cid:104)X(cid:105)=(cid:104)MZ ∩Msupp(v)(cid:105)⊆(cid:104)MZ(cid:105). dp Theproblemoffindingthepackingradiusofavectoristhen Thus, equivalent to the problem of finding the packing radius of a ω (X)≤ω (Z). P P poset, which we will call the poset partition problem. This Now, let i ∈ Xv. By definition, i ∈ supp(v) and i ∈/ X, problem is a generalization of the famous NP-hard problem hence, known as “the partition problem”, that will be introduced in i∈/ (cid:104)M ∩M (cid:105). the next section. Z supp(v) 5 IV. THEPARTITIONPROBLEM difference.Theonlyotheroptionwouldbetocommittoplace theminthesameset,replacingthembytheirsum.Thisresults Thepartitionproblem,whichwewillalsocalltheclassical inabinarytreewhereeachnoderepresentsapossibleinstance. partition problem, is defined as follows: Given a finite list A left branch on a node will lead to a node where the two S of positive integers, find a partition (S ,S ) of S that 1 2 chosenelementswerereplacedwiththeirdifferenceandaright minimizes branch to a node where they were replaced with their sum. If (cid:88) (cid:88) max x, y . thelisthasnelements,thewholetreewillhave2n−1 terminal x∈S1 y∈S2 nodes corresponding to all the possible partitions. This is equivalent to minimizing the discrepancy (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)(cid:88) (cid:88) (cid:12) ∆(S1,S2)=(cid:12) x− y(cid:12). (cid:12) (cid:12) (cid:12)x∈S1 y∈S2 (cid:12) In principle, the lowest possible value for the discrepancy is 0 or 1, depending on the parity of sum of the elements of S. A partition that attains this value is called a perfect partition. The possible existence of these perfect partitions is very important for the algorithms used to solve the problem, for if one is found it determines the answer completely. Thisproblemisofgreatimportancebothfromthepractical and theoretical point of view. In [10], Karp proves that it is Fig.1. Binarytreeforpartitioning(8,7,6,5,4)usingLDM. NP-hard. This being the case, unless P=NP, there does not exist an algorithm that solves all instances of the problem in If no perfect partition exists, the whole tree must be polynomial time. searched. In this (worst case) scenario, the running time of CKK is O(2n). If, otherwise, there is a perfect partition, then A. The Karmarkar-Karp Heuristic upon finding it, the search can stop. This being the case the order in which the terminal nodes are searched is important The best heuristic known for this problem is the and the best results come from using the LDM criterion and Karmarkar-Karp(KK) Heuristic, also known as the differ- giving preference to left branches. For a discussion on good encing method, first introduced in [11]. The method involves ways to search the tree, see [13]. using the differencing operation: select two elements x and i Another important aspect of searching the binary tree is x from the list being partitioned and replace them by the j pruning, i.e. sometimes it is not necessary to look at all the element |x − x |. Doing this is equivalent to making the i j terminal nodes. For example, if the largest element of an decisionthattheywillgointodifferentsubsets.Afterapplying instance is bigger than the sum of the remaining elements, thisoperationn−1timesapartitionwillhavebeenmadeand then the best partition for that instance is to put the largest its discrepancy will be the value of the single element left on element in a subset and all the rest in the other one. Other the list. criteria for pruning are: Depending on which criterion is used to choose the two elements in each step to apply the differencing operation, • Inalistwiththreeelementstheoptimalpartitionistoput many partitions can be obtained. For the classical partition the biggest one in a subset and the other two in another. problem, the best criterion known is the largest differencing • In a list with four elements the KK heuristic finds the method(LDM), which chooses the two biggest elements. optimal partition. • In a list with five elements, if the KK heuristic does not Example3. Let(8,7,6,5,4)bethelistbeingpartitioned.The find the optimal partition then the optimal partition is to KK heuristic using the LDM criterion will have the following put the two biggest elements in the same subset and the instances:(8,7,6,5,4),(6,5,4,1),(4,1,1),(3,1),(2),giving other ones in another. a discrepancy of 2 pertaining to the partition (8,6),(7,5,4). In this case the heuristic does not find the optimal partition (8,7),(6,5,4). B. Complete Karmarkar-Karp In [12], Korf shows how to extend an heuristic using the differencing operation into a complete anytime algorithm, i.e.analgorithmthatfindsbetterandbettersolutionsthelonger it runs, until it finally finds the optimal one. This algorithm is known as the Complete Karmarkar-Karp(CKK) algorithm. At each instance the KK heuristic commits on placing two Fig.2. Prunedtreeforpartitioning(8,7,6,5,4)usingLDM. elements in different subsets, by replacing them with their 6 V. THEPACKINGRADIUSOFAPOSET So, to find the packing radius of a poset satisfying the disjoint ideals case we can use all the methods known for Inthissectionwewilldiscusshowtodeterminethepacking the classic partition problem. Given the importance of the radius of a poset. First we will show that when the ideal discrepancy for the classic partition problem it will be useful generated by the maximal elements are pairwise disjoint, to define the discrepancy for the poset case. whichwewillcallthedisjoint ideals case,theposetpartition problemisequivalenttotheclassicpartitionproblem.Nextwe Definition 12. Let P be a poset and (A,B) be a partition of will approach the more general case of any poset, and after M , the maximal elements of P. We define the discrepancy P this we will generalize the differencing operation so that we between A and B as can use it in the poset partition problem. ∆(A,B)=|ω (A)−ω (B)|, P P A. The Disjoint Ideals Case and the minimum discrepancy of P as Webeginbyshowingthatwhentheidealsgeneratedbythe ∆∗(P)= min ∆(X,Y), maximal elements of a poset are pairwise disjoint, the poset X(cid:116)Y=MP partitionproblemisequivalenttotheclassicpartitionproblem. where X (cid:116) Y indicates a disjoint union, i.e. (X,Y) is a Note that this condition is equivalent to stating that each partition of M . P connected component of the Hasse diagram of the poset has a uniquemaximalelement.Thisinstanceincludestheimportant In the last section we saw that in the classical partition class of NRT-Posets, that is explored, for example, in [14]. problem what we want to minimize is the discrepancy. For the disjoint ideal case this will then also be true, and we can Theorem 3. Let P be a poset with maximal elements M = P writethepackingradiusofaposet,inthiscase,asthefunction {x ,x ,...,x } such that 1 2 m of its minimum discrepancy. <xi >∩<xj >=∅,∀ i(cid:54)=j. Theorem4. LetP beaposetofsizenwithmaximalelements M ={x ,x ,...,x } such that Denote ω (x )=l . Then, finding the packing radius of P is P 1 2 m P i i equivalent to solving the classic partition problem for the list <x >∩<x >=∅ ∀ i(cid:54)=j. i j S =(l ,l ,...,l ). 1 2 m Then, the packing radius of P is Proof: Let (A,B) be a partition of M . Define P n ∆∗(P) R(P)= + −1. S1 =(li :xi ∈A) 2 2 S2 =(li :xi ∈B). Proof: Let (A,B) be a partition of MP. Then, the following equations are satisfied: It is clear that (S ,S ) is a partition of S. Since 1 2 ∆(A,B)=ω∨(A,B)−min{ω (A),ω (B)} P P P <x >∩<x >=∅,∀ i(cid:54)=j, i j n=ω∨(A,Bv)+min{ω (A),ω (B)}. P P P we have The first one is true by definition. The second one follows from the fact that there is no intersection between the ideals (cid:88) ωP(A)= ωP(x) generated by A and B, and therefore, x∈A (cid:88) n=ω (A)+ω (B). = ω (x)[x∈A] P P P x Takingthesumbetweenbothequationsanddividingbytwo (cid:88) = ωP(xi)[xi ∈A] we have n ∆(A,B) i ω∨(A,B)= + . (cid:88) P 2 2 = l [l ∈S ] i i 1 But then, by Theorem 2, i (cid:88) = l. R(P)= min ω∨(A,B)−1 P l∈S1 A(cid:116)B=MP n ∆(A,B) = min + −1 A(cid:116)B=MP 2 2 Analogously, n ∆∗(P) ω (B)= (cid:88)l, = + −1 P 2 2 l∈S2 andtherefore,findingapartition(A,B)ofM thatminimizes P the maximum between ω (A) and ω (B) is equivalent to P P finding a partition (S ,S ) of S that minimizes the maximum Example 4. Let H be the Hamming poset (anti-chain) of size 1 2 (cid:80) (cid:80) between l e l. n. The partition problem associated with it is to partition the l∈S1 l∈S2 7 list with n ones. The minimum discrepancy is then 0 or 1 depending on the parity of n, i.e. ∆∗(H)=[n is odd], which leads to the classical expression, n [n is odd] R(H)= + −1. 2 2 Fig. 4. In this poset, the partition {6,4}{7,5} has discrepancy Example5. LetP beachainofsizen.Thepartitionproblem ∆({6,4},{7,5}) = 0 and maximum weight equal to 5. But the optimal associated with it is to partition the list (n). The minimum partitionis{6,7}{4,5}withmaximumweight4,eventhoughthediscrepancy is1. discrepancy is then ∆∗(P)=n, Wewillthushavetoconsiderthepossibilityofintersections and therefore, between the ideal generated by maximal elements. n n Definition 13. Let P be a poset and (A,B) a partition of R(P)= + −1 2 2 M , the maximal elements of P. We define the discordancy P =n−1, between A and B as Λ(A,B)=∆(A,B)+|(cid:104)A(cid:105)∩(cid:104)B(cid:105)|, as found in [3]. and the minimum discordancy of P as Λ∗(P)= min Λ(X,Y). X(cid:116)Y=MP Notethatthediscordancycoincideswiththediscrepancyin the disjoint ideals case. We now show that the discordancy is what we need to minimize. Theorem 5. Let P be a poset of size n. Then, the packing radius of P is n Λ∗(P) R(P)= + −1. 2 2 Proof: The proof is analogous to the one given in The- orem 4. The only difference is that in the general case we have n+|(cid:104)A(cid:105)∩(cid:104)B(cid:105)|=ω∨(A,B)+min{ω (A),ω (B)}. P P P Fig.3. Findingthepackingradiusofthisposet,denotedbyP,isequivalent tosolvingthepartitionproblemforthelist(8,7,6,5,4).Wealreadysawthat forthispartition∆∗(8,7,6,5,4)=0.Thus,sincen=30and∆∗(P)=0, Proposition 2. Let P be a hierarchical poset of size n and thepackingradiusoftheposetisR(P)=14. M ={x ,x ,...,x } the maximal elements of P. Then, P 1 2 m [m is odd] m R(P)=n+ − −1, B. The General Case 2 2 In the general case, finding the packing radius of a poset as found in [4]. will not always be equivalent to minimizing the discrepancy Proof: If m=1: as the following figure shows. Then there exists only one partition for M , ({x },∅). But P 1 Λ({x },∅)=n, and therefore, 1 Λ∗(P)=n. If m>1: The trivial partition (M ,∅) is certainly not optimal. Let P (A,B) be a non trivial partition. Then (cid:104)A(cid:105)∩(cid:104)B(cid:105)=P −M . P Thus, the discordancy of any non trivial partition is Λ(A,B)=∆(A,B)+|P −M |. P 8 (cid:9) 0 1 -1 i ⊕ 0 1 -1 i Inthiscase,minimizingthediscordancyisequivalenttomini- mizingthediscrepancy.SinceP−M isintheintercectionof 0 0 -1 1 i 0 0 1 -1 i P theidealsofanynontrivialpartition,ourproblemisequivalent 1 1 i 1 i 1 1 1 i i to partitioning the poset M , a Hamming poset (anti-chain). -1 -1 -1 i i -1 -1 i -1 i P Therefore, i i i i i i i i i i The value of x(cid:9)y is found in the x row and y column, for Λ∗(P)=[m is odd]+|P −M |. P example, 1(cid:9)−1=1. For the associating operator the order is immaterial since x⊕y =y⊕x. In the case of two vectors xˆ,yˆ ∈ Xn, for some n, the operators are defined coordinate by coordinate: (xˆ⊕yˆ) =xˆ ⊕yˆ i i i (xˆ(cid:9)yˆ) =xˆ (cid:9)yˆ. i i i The differencing and associating operators behave similarly toadditionandsubtraction.Wedefine⊕xtobe0⊕xand(cid:9)x to be 0(cid:9)x. We now list some of these operators properties: Fig. 5. Using the notation from our last proposition, the poset P above has parameters n = 9, m = 3 e |P −MP| = 6. Thus, Λ∗(P) = 7, and Proposition 3. Let x,y,z ∈{0,1,−1,i}. Then: 9+7 therefore,R(P)= −1=7. 1) x⊕y =y⊕x 2 2) (x⊕y)⊕z =x⊕(y⊕z) 3) 0⊕x=x⊕0=x 4) ⊕(x⊕y)=⊕x⊕y C. The Differencing Method for Posets 5) ⊕(x(cid:9)y)=⊕x(cid:9)y We now aim to generalize the differencing method so that 6) (cid:9)(x⊕y)=(cid:9)x(cid:9)y we can use them for any poset. In the disjoint ideals case 7) (cid:9)(x(cid:9)y)=(cid:9)x⊕y the only information needed to find the packing radius is the These properties extend naturally to the vector case. weights of its maximal elements. In the general case we must alsoconsidertheintersectionsbetweentheirideals.Todothis, Proof: This proof follows in a straightforward manner instead of considering numbers we will consider vectors. from the definition, but is omitted since it may be quite lengthy. Definition 14. Let P = ([n],(cid:22)) be a poset. Given x ∈ P, Analogously to the classical case we need to associate a we denote its adjacency vector by xˆ where its coordinates are partition to every expression involving the differencing and defined as associating operators. We begin with simple expressions. xˆ =[i(cid:22)x]. i Definition 16. Let (xˆ ,xˆ ,...,xˆ ) be the list of adjacency 1 2 m Example 6. Let P =([n],(cid:22))be a poset. Then, its adjacency vectors associated with the maximal elements of a poset. A matrix is simple expression involving the elements of this list and the . . . . .. .. .. .. operators ⊕ and (cid:9) is a sequence of the form ˆ1T ˆ2T ··· nˆT ∗ xˆ ∗ xˆ ...∗ xˆ , . . . . 1 k1 2 k2 n kn . . . . . . . . where k ∈[m] and ∗ =⊕ or ∗ =(cid:9). i i i Given the set M = {x ,x ,...,x } of the maximal P 1 2 m The partition associated with the simple expression is the elements of a poset, we have associated to it a list of adja- partition (A,B) defined as follows: cency vectors (xˆ ,xˆ ,...,xˆ ). We will define two operators, 1 2 m the differencing operator((cid:9)), and the associating operator(⊕) A={xki :∗i =⊕} which will operate on the vectors from the list of adjacency B ={x :∗ =(cid:9)}. vectors in such a way that differencing two vectors becomes ki i equivalent to committing to place the maximal elements they A is called the primary set and B is called the secondary represent in different subsets, and associating two vectors set. becomes equivalent to committing to place the maximal el- We now extend the definition to any expression. ements they represent in the same subset, thus generalizing Definition 17. The partition associated with any expression the differencing method used in the classic partition problem. isthepartitionassociatedwiththesimpleexpressionobtained Definition 15. Let X = {0,1,−1,i}. The differencing and by applying the properties of Proposition 3 to the original associating operators are defined by the following tables: expression. 9 We make the following notation abuse: we sometimes de- Our two hypothesis tell us that noteanexpressionbythevectorwewouldobtainbyfollowing k ∈(cid:104)Pri(vˆ)(cid:105)−(cid:104)Sec(vˆ)(cid:105) the calculations on the expression, i.e. we might denote the expression xˆ⊕yˆ by the vector vˆ = xˆ⊕yˆ. The k coordinate and of an expression is then the k coordinate of the vector which k ∈(cid:104)Sec(wˆ)(cid:105)−(cid:104)Pri(wˆ)(cid:105). is a result of the expression if it were calculated. But then, We denote the primary set of an expression vˆ by Pri(vˆ), k ∈(cid:104)Pri(vˆ)(cid:105)⊆(cid:104)Pri(vˆ ⊕wˆ )(cid:105) and its secondary set by Sec(vˆ). k k and Example 7. Let P be a poset with maximal elements M = P k ∈(cid:104)Sec(wˆ)(cid:105)⊆(cid:104)Sec(vˆ ⊕wˆ )(cid:105), {x ,x ,x ,x }.TheadjacencyvectorsassociatewithM are k k 1 2 3 4 P (xˆ1,xˆ2,xˆ3,xˆ4). The simple form of the expression and therefore, (xˆ1(cid:9)xˆ2)(cid:9)(xˆ3(cid:9)xˆ4) k ∈(cid:104)Pri(vˆk⊕wˆk)(cid:105)∪(cid:104)Sec(vˆk⊕wˆk)(cid:105). is ⊕xˆ1(cid:9)xˆ2(cid:9)xˆ3⊕xˆ4 Sincethelistofvectors(xˆ1,xˆ2,...,xˆm)satisfiesthecondi- tions of our lemma the differencing and associating operators whichisassociatedtothepartition({x ,x },{x ,x })where 1 4 2 3 workinthewayweintendedthemto.Inthesamewaywebuilt {x ,x } is the primary set and {x ,x } is the secondary set. 1 4 2 3 a tree for the classic partition problem, we can now build a The primary and secondary sets have the following proper- treefortheposetpartitionproblemwhereineachnodewewill ties. have a list of vectors, left branches substitute two vectors for their difference, and right branches substitute them for their Proposition 4. Let P be a poset with maximal elements associate. By our last lemma the terminal nodes, consisting M = {x ,x ,...,x }, and associated adjacency vectors P 1 2 m of single vectors, must have the information necessary to (xˆ ,xˆ ,...,xˆ ). If vˆ and wˆ are two expressions using ele- 1 2 m calculate the discordancy of the partition associated with each ments from the adjacency list, then: vector. To extract this information we need the following: 1) Pri(vˆ⊕wˆ)=Pri(vˆ)∪Pri(wˆ) 2) Sec(vˆ⊕wˆ)=Sec(vˆ)∪Sec(wˆ) Definition 18. Let vˆ ∈ {0,1,−1,i}n. We define the sum of 3) Pri(vˆ(cid:9)wˆ)=Pri(vˆ)∪Sec(wˆ) entries function as n 4) Sec(vˆ(cid:9)wˆ)=Sec(vˆ)∪Pri(wˆ) (cid:88) S(vˆ)= vˆ k Proof: Just put vˆ and wˆ in their simple forms and note k=1 that, by properties 4 and 5 of Proposition 3, ⊕ does not alter where i is treated formally as if it where the imaginary unit. the operators in front of the vectors and, by properties 6 and Example 8. If vˆ=(1,1,−1,i,1,i) then 7ofProposition3,(cid:9)switchesalltheoperatorsinfrontofthe vectors of wˆ. S(vˆ)=2+2i. We can now prove the following: We can therefore refer to the real part of S(vˆ), denoted as Lemma 5. Let P be a poset of size n, M = P (cid:60)(S(vˆ)),andtheimaginarypart,denotedas(cid:61)(S(vˆ)).Wecan {x ,x ,...,x } be the maximal elements of P, 1 2 m now find explicitly the discordancy of the terminal nodes of (xˆ ,xˆ ,...,xˆ ) be the adjacency vectors associated 1 2 m our tree. with M , and vˆ and wˆ be two expressions using the P adjacency vectors. Suppose that for every k ∈[n]: Theorem 6. Let P be a poset with maximal elements MP = {x ,x ,...,x }, (xˆ ,xˆ ,...,xˆ ) be the adjacency vectors 1) vˆ =0⇔k ∈/ (cid:104)Pri(vˆ)(cid:105)∪(cid:104)Sec(vˆ)(cid:105) 1 2 m 1 2 m k associated with M , and vˆ be an expression using all the 2) vˆ =1⇔k ∈(cid:104)Pri(vˆ)(cid:105)−(cid:104)Sec(vˆ)(cid:105) P k adjacency vectors exactly once. If we denote by (A,B) the 3) vˆ =−1⇔k ∈(cid:104)Sec(vˆ)(cid:105)−(cid:104)Pri(vˆ)(cid:105) k partition of M associated to vˆ, then, 4) vˆ =i⇔k ∈(cid:104)Pri(vˆ)(cid:105)∪(cid:104)Sec(vˆ)(cid:105) P k andthatthesepropertiesarestilltruewhenwesubstitutevˆfor ∆(A,B)=|(cid:60)(S(vˆ))| wˆ. Then, the properties listed are still true when we substitute and vˆ for vˆ⊕wˆ or vˆ(cid:9)wˆ. |(cid:104)A(cid:105)∩(cid:104)B(cid:105)|=(cid:61)(S(vˆ)). Proof: The proof consists in separating in all possible Thus, cases and using the properties from Proposition 4. Since there Λ(A,B)=|(cid:60)(S(vˆ))|+(cid:61)(S(vˆ)). are four possible values for vˆ and for wˆ and there are two k k operations, the total number of cases is thirty-two. We will Proof: Without loss of generality, suppose A = Pri(vˆ) only show one case as an example. The proof for the other and B = Sec(vˆ). Then, since the adjacency vectors of M P cases is completely analogous. satisfy the conditions of Lemma 5, it follow that, Associating case for vˆ =1 and wˆ =−1: k k n n In this case, |(cid:104)A(cid:105)|=(cid:88)[v =1]+(cid:88)[v =i] k k vˆ ⊕wˆ =i. k k k=1 k=1 10 and i.e. the matrix M after substituting columns j and k with the n n (cid:88) (cid:88) column associating their corresponding vectors. |(cid:104)B(cid:105)|= [v =−1]+ [v =i]. k k The matrix M(cid:9) is defined analogously. k=1 k=1 j,k Thus, Note that both M⊕ and M(cid:9) have one less column than j,k j,k (cid:12)(cid:12)(cid:88)n (cid:88)n (cid:12)(cid:12) M. ∆(A,B)=(cid:12) [v =1]− [v =−1](cid:12) (cid:12) k k (cid:12) Definition 22. Let M be a matrix with elements in (cid:12) (cid:12) (cid:12)k=1 (cid:12)k=1 {0,1,−1,i}. The minimum discordancy of M is defined as =(cid:12)(cid:12)(cid:12)(cid:88)n vk[vk (cid:54)=i](cid:12)(cid:12)(cid:12) Λ∗(M)=min(cid:110)Λ∗(M⊕ ),Λ∗M(cid:9) (cid:111), (cid:12) (cid:12) j,k j,k k=1 =|(cid:60)(S(vˆ))|. where the choice of j and k is irrelevant as long as they are different. But by Lemma 5 we also have The minimum discordancy of a vector is defined as its (cid:88)n discordancy. |(cid:104)A(cid:105)∩(cid:104)B(cid:105)|= [v =i] k We now define the packing radius of a matrix. k=1 =(cid:61)(S(vˆ). Definition 23. Let M be a matrix with elements in {0,1,−1,i} and n be the number of rows in M where there We can now build a tree similar to the one in the CKK existsatleastoneelementdifferentthan0.Thepackingradius algorithm. We will make one modification, nonetheless, we of M is defined as will substitute the lists of vectors for matrices. n Λ∗(M) R(M)= + −1. Definition 19. Let P be a poset of size n with maximal 2 2 elements M = {x ,x ,...,x }, and (xˆ ,xˆ ,...,xˆ ) be Some direct properties of the packing radius of a matrix is P 1 2 m 1 2 m the adjacency vectors associated with M . We define the that it does not change under row or column permutations. P radius matrix of P as We can now rephrase Theorem 6 in terms of the radius . . . . matrix of a poset. . . . . . . . . Theorem 7. Let P be a poset and M its radius matrix. Then xˆT xˆT ··· xˆT. 1 2 m R(P)=R(M). . . . . . . . . . . . . Proof: By Theorem 6, Λ∗(P)=Λ∗(M). Note that this matrix can be obtained from the adjacency LetnbethesizeofP.Thus,M hasnrowsandallofthem matrixofP byremovingthecolumnswhichdonotcorrespond must have at least one element different from 0 since P is a to maximal elements. poset. Therefore, the packing radius of M is By Theorem 6, the packing radius of a poset is completely n Λ∗(P) determined by its radius matrix. The packing radius can R(M)= + −1. 2 2 therefore be seen as the property of a matrix. We will now extend the definition of discordancy and To construct a searching tree using the differencing method packing radius to matrices. forposetsweneedtohaveacriterionforchoosingthevectors We begin by the discordancy of a vector. to differenciate or associate. In the classical problem the best Definition20. Letvˆbeavectorwithelementsin{0,1,−1,i}. criterion was LDM. We present now a generalization of the The discordancy of vˆ is defined as LDMcriterionand,despitetheinexistenceofdifferentcriteria, conjecture that it should perform well in the same context Λ(vˆ)=|(cid:60)(S(vˆ))|+(cid:61)(S(vˆ)). as in the classical partition problem. We call it the Poset The discordancy of a matrix will be given recursively. LDM (PLDM) criterion.Our first vector, vˆ, will be the one that maximizes Λ∗(vˆ), and our second one, wˆ, will then be Definition 21. Let the one that minimizes Λ∗(vˆ(cid:9)wˆ). In our examples we will . . . . .. .. .. .. always list these two vectors in the first two columns. M =xˆT1 xˆT2 ··· xˆTm Example 9. Lets find the packing radius of a poset P with . . . . . . . . adjacency matrix . . . . 1 0 0 1 1 0 0 be a matrix with elements in {0,1,−1,i}. We define M⊕ as the matrix 0 1 0 0 1 1 1 j,k 0 0 1 1 1 0 0 .. .. .. .. .. .. 0 0 0 1 0 0 0 . . . . . . xˆ.T1 xˆ.T2 ··.· xˆTj ⊕. xˆTk ··.· xˆ.Tm, 00 00 00 00 10 01 00 . . . . . . . . . . . . 0 0 0 0 0 0 1