# Spatial Cluster Analysis by the Bin-Packing Problem and DNA Computing Technique

Authors: Xiyu Liu; Jie Xue
Journal: Discrete Dynamics in Nature and Society
 (2013)

---

## Abstract

Spatial cluster analysis is an important data mining task. Typical
techniques include CLARANS, density- and gravity-based clustering,
and other algorithms based on traditional von Neumann's computing
architecture. The purpose of this paper is to propose a technique
for spatial cluster analysis based on sticker systems of DNA
computing. We will adopt the Bin-Packing Problem idea and then
design algorithms of sticker programming. The proposed technique
has a better time complexity. In the case when only the
intracluster dissimilarity is taken into account, this time
complexity is polynomial in the amount of data points, which
reduces the NP-completeness nature of spatial cluster analysis.
The new technique provides an alternative method for traditional
cluster analysis.


---

## Body

## 1. Introduction

Spatial cluster analysis is a traditional problem in knowledge discovery from databases [1]. It has wide applications since increasingly large amounts of data obtained from satellite images, X-ray crystallography, or other automatic equipment are stored in spatial databases. The most classical spatial clustering technique is due to Ng and Han [2] who developed a variant PAM algorithm called CLARANS, while new techniques are proposed continuously in the literature aiming to reduce the time complexity or to fit for more complicated cluster shapes.For example, Bouguila [3] proposed some model-based methods for unsupervised discrete feature selection. Wang et al. [4] developed techniques to detect clusters with irregular boundaries by a minimum spanning tree-based clustering algorithms. By using an efficient implementation of the cut and the cycle property of the minimum spanning trees, they obtain a performance better than O(N2), where N is the number of data points. In another paper, Wang and Huang [5] developed a new density-based clustering framework by a level set approach. By a valley seeking method, data points are grouped into corresponding clusters.Adleman [6] and Lipton [7] pioneer a new era of DNA computing in 1994 with their experiments which demonstrated that the tools of laboratory molecular biology could be used to solve computation problems. Based on Adleman and Lipton's research, a number of applications of DNA computing in solving combinatorially complex problems such as factorization, graph theory, control, and nanostructures have emerged. There appeared also theoretical studies including DNA computers which are programmable, autonomous computing machines with hardware in biological molecules mode; see [8] for details.According to Păun et al. [8], common DNA systems in DNA computing include the sticker system, the insertion-deletion system, the splicing system, and H systems. Among those, the sticker system has the ability to represent bits which is similar to the silicon computer memory. In a recent work, Alonso Sanches and Soma [9] propose an algorithm based on the sticker model of DNA computing [10] to solve the Bin-Packing Problem (BPP), which belongs to the class NP-Hard in the strong sense. The authors show that their proposed algorithms have time complexities bounded by O(n2) which are the first attempt to use DNA computing for the Bin-Packing Problem. Here the integer n is the number of items to be put in the bins.Inspired by the work of Alonso Sanches and Soma [9], we propose a new DNA computing approach for spatial cluster analysis in this paper by the Bin-Packing Problem technique. The basic idea is to take clusters as bins and locate data points into bins. In order to complete evaluation of clustering, we need to accumulate dissimilarities within clusters. By the sticker system we can accomplish these tasks. We also show that our algorithm has a time complexity in polynomial in the case when only intracluster dissimilarity is considered, relative to the amount of data points. Notice that cluster analysis is NP-complete. It is interesting to notice that the method in this paper is new in cluster analysis.The rest of this paper is organized as follows: in Section2, we present the Bin-Packing Problem formulation of spatial clustering problem for the purpose of this paper. Then in Section 3 some basic facts on sticker model are presented with implementation of some new operations. The following two sections are devoted to the coding of the problem and the algorithms of clustering with sticker system. Finally, a brief conclusion is reached.


## 2. Formulation of the Problem

LetRn be the real Euclidean space of dimension n. A subset Ω⊂Rn is called a spatial dataset with N points and Ω={x1,x2,…,xN}, where xi=(ξi1,ξi2,…,ξin)∈Rn for each i=1,…,N. A clustering problem over Ω is to group the dataset Ω into k partitions called clusters where the intracluster similarity is maximal and the intercluster similarity is minimal. In this sense, clustering is an optimization process in two levels: one is maximization and the other is minimization. Here the integer k indicates the number of clusters. There are two kinds of clustering when we consider k as a parameter. The first kind is fixed number clustering, where the number of clusters k is a priori determined. The second kind is flexible clustering where the number k is chosen as one of the parameters to meet the two level optimization problem.Now we denote a partition ofΩ by 𝒞:𝒞=(C1,…,Ck) with Ω=C1∪⋯∪Ck and Ci⊆Ω for 1≤i≤k. If we define Asim(Ci) as the intracluster dissimilarity measure for Ci∈𝒞 and Simm(Ci,Cj) as the intercluster similarity measure for Ci,Cj∈𝒞, then the two kinds of clustering problems are formulated as follows:
(1)min𝒞Asim(Ci)for1≤i≤k,min𝒞Simm(Ci,Cj)for1≤i,j≤k,i≠j,(2)min𝒞,kAsim(Ci)for1≤i≤k,min𝒞,kSimm(Ci,Cj)for1≤i,j≤k,i≠j.To simplify the multiplicity of optimization, we often use the following variation of the above problems:(3)min𝒞∑i=1k‍Asim(Ci),min𝒞∑1≤i,j≤k,i≠j‍Simm(Ci,Cj),(4)min𝒞,k∑i=1k‍Asim(Ci),min𝒞,k∑1≤i,j≤k,i≠j‍Simm(Ci,Cj).Next we only consider the cluster problem (1) or (3). In order to unite the two optimization formula: we introduce the following total energy function:
(5)min𝒞ET(𝒞):ET(𝒞)=∑i=1k‍Asim(Ci)+∑1≤i,j≤k,i≠j‍Simm(Ci,Cj).For the purpose of this paper, we will use a simplified version of the total energy as shown in the following equation:(6)min𝒞E(𝒞):E(𝒞)=∑i=1k‍Asim(Ci).In the case when the number of clustersk is a variable, the total energy is computed for nonempty clusters and the optimized number k of clusters is the counting of nonempty bins:
(7)min𝒞E(𝒞):E(𝒞)=∑1≤i≤k,Ci≠∅‍Asim(Ci).We now propose aBin-Packing Problem (BPP) formulation of the clustering problem as stated above. The classical one-dimensional BPP is given as a set of N items x1,…,xN with respective weights w(xi)=ai∈(0,c],1≤i≤N. The aim is to allocate all items into N bins with equal capacity c and by using a minimum number of bins [9]. For clustering purpose we assume that there are k empty bins and we allocate all items into the bins with least energy. If we consider k as a variable, then the problem is to allocate N points into N bins with least energy. The capacity restriction c is removed. For the two cases of clustering, there are altogether kN (NN, resp.) combinations of allocation and the best solution can be achieved by brute force search.First we consider the case whenk is fixed. To solve the problem, we consider an array 𝒞 of integers
(8)𝒞=c1c2⋯cN,eachci∈{1,…,k}.Theith bin (cluster) Ci is defined as Ci={xp:cp=i,p=1,…,N} for i=1,…,k. We will identify the allocation 𝒞 with its corresponding partition. Therefore the energy function is defined on {𝒞} of all allocations. In order to guarantee the bins are nonempty, we need to add a restriction that #(Ci)>0 for i=1,…,k, where #(Ci) denote the cardinality of the set Ci.Then the final problem is(9)minE(𝒞),𝒞=c1c2⋯cN,eachci∈{1,…,k},#(Ci)>0fori=1,…,k.Next whenk is a variable, the array 𝒞 is
(10)𝒞=c1c2⋯cN,eachci∈{1,…,N}.Theith bin (cluster) Ci is defined as Ci={xp:cp=i,p=1,…,N} for i=1,…,N. The energy function defined on {𝒞} to be optimized is
(11)minE(𝒞),𝒞=c1c2⋯cN,eachci∈{1,…,N}.


## 3. A Sticker DNA Model

First we recall some standard operations of DNA computing as shown in [8]. They are merge, amplify, detect, separate, and append.(i)
merge: T←merge(T1,T2). Two given tubes T1andT2 are combined into one T without changing the strands which.(ii)
amplify: Given a tube T, amplify(T,T1,T2) produces two copies T1,T2 of  T and then make T empty.(iii)
detect: Given a tube T, return true if  T contains at least one DNA strand, otherwise return false.(iv)
separate: T←+(T,w) and T←-(T,w). Given a tube T and a word w, a new tube +(T,w) (or -(T,w)) is produced with the strands in T which contain w as s substring (resp., do not contain).(v)
append: Given a tube T and a word w, append(T,w) affixes w at the end of each sequence in T.The sticker model is based on the paradigm of Watson-Crick complementarity and was first proposed in [10]. There are two kinds of single-stranded DNA molecules, the memory strands and sticker strands, in this model. A memory strand is L bases in length and contains p nonoverlapping substrands, each of which is m bases long, where L=pm [8]. A sticker is m bases long and complementary to exactly one of the p substrands in the memory strand. A specific substrand of a memory strand is either on or off and is called a bit. If a sticker is annealed to its matching substrand on a memory strand, then the particular substrand is said to be on. Otherwise it is said to be off. These partially double strands are called memory complexes.The basic operations of the sticker model are merge, separate, set, and clear and are listed as follows [8]. Among these, merge is exactly as the standard operation as shown before.(i)
separate: T←+(T0,i) and T←-(T0,i). Given a tube T0, a new tube +(T0,i) (or -(T0,i)) is produced with the ith bit on (resp., off).(ii)
set: T←set(T0,i). A new tube T is produced from T0 by turning the ith bit on.(iii)
clear: T←clear(T0,i). A new tube T is produced from T0 by turning the ith bit off.Now we consider a test tubeT consisting memory complexes α. We define the length of α as the number of bits, that is, the number of substrands (stickers) contained in α denoted by p(α). Each numerical value is represented by q-bit stickers, where q is a constant designed for a certain problem. For a q-bit stickers α, the corresponding numerical value is denoted by h(α). The substring in a memory complex from the (b+1)th bit to the (b+q)th bit of α is denoted by cut(α,b), where b is an integer with 0≤b≤p(α)-1. Apart from the basic operations, we need more operations designed and inspired by Alonso Sanches and Soma [9] in order to handle numerical computations.(i)
increment: T←incr(T,b). For each α∈T, generate a strand β with h(cut(β,b))=h(cut(α,b))+1 and let T be replaced by the collection of such new strands β.(ii)
add: T←add(T,b,d). For each α∈T, generate a strand β with h(cut(β,b))=h(cut(α,b))+d and let T be replaced by the collection of such new strands β. Here d is an integer in binary form with length p(α)-b.(iii)
compare: compare(T,b1,b2,Tl,Tg,Te). For each α∈T, if h(cut(α,b1))<h(cut(α,b2)), then let α∈Tl; if h(cut(α,b1))>h(cut(α,b2)), then let α∈Tg; else let α∈Te.(iv)
weigh: weigh(T,b,d,Tl,Tg,Te). For each α∈T, if h(cut(α,b))<d, then let α∈Tl; if h(cut(α,b))>d, then let α∈Tg; else let α∈Te.(v)
clearq: clearq(T,b). For each strand in the tube T, turn all bits off from (b+1)th bit to (b+q)th bit.We only give a DNA algorithm forweigh and clearq as the other algorithms are presented in Alonso Sanches and Soma [9]. Suppose the binary digits of the integer d is db+1db+2⋯db+q (see Algorithm 1).Algorithm 1:Algorithms of weigh and clearq.
weigh
(
T
,
b
,
d
,
T
l
,
T
g
,
T
e
)
i←1; Tl←∅; Tg←∅
repeat
T0←-(T,b+i), T1←+(T,b+i)
if  di=0then
Tg←Tg∪T1; T←T0
else
Tl←Tl∪T0; T←T1
endif
i←i+1
until  (i=q+1)  or (detect(T)= no)
Te←T
clearq
(
T
,
b
)
i←1; T0←∅;
repeat
T0←clear(T,b+i)
T←T0
i←i+1
until  (i=q+1)


## 4. Sticker Algorithms for Fixedk

Now we consider solving the spatial clustering problem as described in Section2, where the number of clusters k is fixed, and Ω={x1,x2,…,xN}, xi=(ξi1,ξi2,…,ξin)∈Rn for each i=1,2,…,N. A partition of the dataset Ω is denoted by 𝒞 which is an array of integers
(12)𝒞=c1c2⋯cN,∀ci∈{1,…,k}.For two pointsx,y we use ρ(x,y) to denote the Euclidean distance between them. We use M=maxx,y∈Ωρ(x,y) to denote the diameter of Ω. Let the dissimilarity measure of x,y∈Ω be d^(x,y)=ρ(x,y)/M∈[0,1]. Now we convert the dissimilarity measure into binary string consisting of “0”s and “1”s. For an acceptable given error rate to measure the dissimilarity ε>0, divide the interval [0,1] into 2K1 subintervals with equal width 2-K1<ε. Now choose an integer K such that kN22K1<2K. Then we can use a K bits string to represent the subintervals. For z∈[0,1] let its corresponding string be s(z)=[2-K1z], where operator [·] is the largest integer without exceeding it. We will use a sticker system with q stickers in length that is capable of representing numbers between 0,1,…,Nand0,1,…,2K.Now we define the dissimilarity matrix as(13)D=[dij]N×N,dij=s(d^(xi,xj)),i,j=1,…,N.For the partition𝒞, the ith bin (cluster) Ci is defined as Ci={xp:cp=i,p=1,…,N} for i=1,…,k. A partition is called feasible if Ci≠∅ for i=1,2,…,k. The energy of a partition defined by (9) has the following form:
(14)Et≜Asim(Ct)=∑i,j∈Ct‍dij,E(𝒞)=∑t=1k‍Et.For an integerj, we use seq(j) to represent the subsequence of q stickers corresponding to j. Conversely, if s is a sequence, we use h(x) to denote the numerical value decoded by the q-bit sticker x. By the sticker model [9], a memory complex seq(𝒞) is designed as the coding of 𝒞:
(15)seq(𝒞)=seq(c1)seq(c2)⋯seq(cN).Then we appendk+1 stickers representing E1,…,Ek and E=E(𝒞). Finally we append k stickers to store the cardinality of clusters. The structure of stickers for our problem is shown in Figure 1. The clustering algorithm consists of four steps as shown in Algorithm 2.Algorithm 2:
(a)generate: Generate multiple copies of all the kN combinations as 𝒞. Append 1,2,…,k
as the position numbers of𝒞. Then append E1,…,Ek and E to store the energies.
(b)energy: Compute the dissimilarities of the k clusters and store the energy.
(c)prune: Discard unfeasible partitions, that is, those where there exists empty clusters.
(d)find: Find the best solution.
Now we present algorithms to implement the above procedures.
(a) Generation of all the possiblekN solutions. Append k values in order to store the energies.
generate
(
T
)
T0←T
for  i←1to  N  do
for  j←1  to  k/2  do
amplify(T0,T2j-1,T2j)
endfor
for  j←1  to  k  do
append(Tj,seq(j))
endfor
for  j←1  to  k  do
append(Tj,seq(0))
endfor
for  j←k  downto  1  do
Tj-1←Tj-1∪Tj
endfor
endfor
T←T0
append(T,seq(0)).
for  j←1  to  k  do
append(T,seq(0))
endfor
append(T,seq(0))
(b) Energy computation. The problem is to compute totals of energy for thosei  where  ci=j. Hence
Ej=∑r,s∈Cj,r≠s‍drs  and  Cj={i∣ci=j}. The total energy is stored in  E.  At the same time,
the counting number of each bin is stored in the followingk  stickers.
energy
(
T
)
for j←1to  k  do
Tj←∅
endfor
for  i←1  to  N  do
for  ←1  to  k  do
compare(T,qi,q(N+j),T1′,T2′,T3′)
clearq(T2′,qi)
Tj←Tj∪T2′
if  detect(T2′)=  yes  then
incr(Tj,q(N+2k+1+j))
endif
endfor
endfor
for  j←1  to  k  do
for  i1←1  to  N  do
for  i2←1  to  N  do
add(Tj,q(N+k+j),~(h(cut(Tj,i1q)∨h(cut(Tj,i2q)))di1i2)
endfor
endfor
add(Tj,q(N+k+j),q(N+2k+1))
T←T∪Tj
endfor
(c) The third step is to eliminate unfeasible partitions. This is done by checking the lastk  stickers.
prune (T)
Tl′←∅, Te′←∅  Tg′←∅
for  i←1  to  k  do
compare(T,q(N+2k+1)+i,q(N+3k+2),Tl′,Tg′,Te′)
T←Tg′
endfor
(d) The last step is to find the best solution with least energy. Ifdetect(T)= yes in the final step,
then we get the optimal solution.
find
(
T
)
T0←∅, T1←∅
for  i←1  to  q  do
T0←-(T,q(N+2k+1)+i),  T1←+(T,q(N+2k+1)+i)
if  detect(T0)=  no then
T←T1
else
T←T0
endif
endfor
detect(T).Figure 1
Coding structure of clusters.


## 5. Sticker Algorithms for Variablek

In this section we consider cluster analysis whenk is a variable. In this case a partition of the dataset Ω is denoted by 𝒞 which is an array of integers
(16)𝒞=c1c2⋯cN,∀ci∈{1,…,N}.Similar to the previous section, theith bin (cluster) Ci is defined as Ci={xp:cp=i,p=1,…,N} for i=1,…,N. Notice that Ci may be empty and the final number of clusters is the counting of nonempty clusters. The energy of a partition defined by (11) has the following form:
(17)E(𝒞)=∑t=1k‍Et,Et={∑i,j∈Ct‍dijforCt≠∅,0forCt=∅.Now the coding isseq(𝒞). Then we append N+1 numbers of q bits, that is, (N+1)q stickers representing E1,…,EN and E=E(𝒞). Next we append N values to store the counting number of the N clusters. Finally we append a value to store the number of valid (nonempty) clusters. The structure of stickers in this case is shown in Figure 2.Figure 2
Coding structure whenk is changing.The clustering algorithm consists of four steps as shown in Algorithm3.Algorithm 3:
(a)generate: Generate multiple copies of all the  NN  combinations as  𝒞.  Append 1,2,…,N
as the position numbers of𝒞. Then append E1,…,EN and E to store the energies.
(b)energy: Compute the dissimilarities of the N possible clusters and store in energy.
(c)find: Find the best solution.
(d)count: Count the number of clusters.
Now we present algorithms to implement the above procedures.
(a) Generation of all the possibleNN solutions. Append N values in order to store the energies.
generate
(
T
)
T0←T
for  i←1  to  N  do
for  j←1  to  N/2
amplify(T0,T2j-1,T2j)
endfor
for  j←1  to  N
append(Tj,seq(j))
endfor
for  j←1  to  N
append(Tj,seq(0))
endfor
for  j←N  downto  1
Tj-1←Tj-1∪Tj
endfor
endfor
T←T0
append(T,seq(0)).
for  j←1  to  N
append(Tj,seq(0))
endfor
append(T,seq(N)).
(b) Energy computation. The problem is to compute totals of energy for thosei  where ci=j.
HenceEj=∑r,s∈Cj,r≠s‍drs  and  Cj={i∣ci=j}.  The total energy is stored in  E.  At the same time,
the counting number of each bin is stored in the followingN  stickers.
energy
(
T
)
for  j←1  to  N  do
Tj←∅
endfor
for  i←1  to  N  do
for  j←1  to  N  do
compare(T,qi,q(N+j),T1′,T2′,T3′)
clearq(T2′,qi)
Tj←Tj∪T2′
if  detect(T′2)= yes then
incr(Tj,q(3N+1+j))
endif
endfor
endfor
for  j←1  to  N  do
for  i1←1  to  N  do
for  i2←1  to  N  do
add(Tj,q(2N+j),~(h(cut(Tj,i1q)∨h(cut(Tj,i2q)))di1i2)
endfor
endfor
add(Tj,q(2N+j),q(3N+1))
T←T∪Tj
endfor
(c) The next step is to find the best solution with least energy. Ifdetect(T)= yes in the final step,
then we get the optimal solution. The final numberk  of clusters in stored in the last sticker.
find
(
T
)
T0←∅, T1←∅
for  i←1  to  q  do
T0←-(T,q(3N+1)+i),  T1←+(T,q(3N+1)+i)
if  detect(T0)=  no then
T←T1
else
T←T0
endif
endfor
detect(T).
(d) The final step is to count the number of clusters. It is stored in the last sticker while in the variablek.
count (T)
k←0
for  i←1  to  N  do
weigh(T,q(3N+1+i),0,Tl,Tg,Te)
if  detect(Tg)= yes then
incr(T,q(4N+2))
k←k+1
endif
endfor


## 6. Conclusion

In this paper we presented a new DNA-based technique for spatial cluster analysis. Two cases when the number of clustersk is predefined and not determined are considered. If we take the scale of data N, and the length of bits for a sticker q, as a variables, then clearly Algorithm 1 has a time complexity of O(qN). Among the four steps of Algorithm 2, the operator  generate (T) has a time complexity of O(kqN), and the operator  energy (T) has complexity of O(kqN2). The remaining two operators all have complexity of O(kq). Thus the total time complexity for fixed number of clusters k is O(kqN2). In the other case when k is dynamic, time complexity for the four algorithms changes to O(qN2), O(qN3), O(q), and O(qN). Hence the total complexity is O(qN3). The reason why our complexity is worse than that of [9] (of course for a different problem) is that the summation of dissimilarity is time consuming. It is interesting if one can reduce this complexity to O(qN2).Finally we will point out that up to the authors knowledge, this is the first research in cluster analysis by sticker DNA systems. It provides an alternative solution for this traditional knowledge engineering problem, which isnot combinatorial in nature. Comparing many applications of DNA computing mainly in combinatorial problems, this is still interesting.



---

*Source: 891428-2013-04-09.xml*