Analysis and Simulation of the Dynamic Spectrum Allocation Based on Parallel Immune Optimization in Cognitive Wireless Networks

Spectrum allocation is one of the key issues to improve spectrum efficiency and has become the hot topic in the research of cognitive wireless network. This paper discusses the real-time feature and efficiency of dynamic spectrum allocation and presents a new spectrum allocation algorithm based on the master-slave parallel immune optimization model. The algorithm designs a new encoding scheme for the antibody based on the demand for convergence rate and population diversity. For improving the calculating efficiency, the antibody affinity in the population is calculated in multiple computing nodes at the same time. Simulation results show that the algorithm reduces the total spectrum allocation time and can achieve higher network profits. Compared with traditional serial algorithms, the algorithm proposed in this paper has better speedup ratio and parallel efficiency.


Introduction
Wireless spectrum is one of the nonrenewable scarce resources. With the rapid development of wireless communication services, wireless spectrum resource is becoming increasingly scarce. The existing research results show that the management system of fixed spectrum has caused huge waste of spectrum resources [1]. In cognitive wireless network, the cognitive users improve the spectrum efficiency effectively by authorizing the "secondary utilization" of spectrum to licensed users (primary users), which is identified as the most effective way at present to solve the contradiction between spectrum resources scarcity and increasing access demands [2,3].
Spectrum allocation is one of the key issues to improve spectrum efficiency and has become the hot topic in the research of cognitive wireless network. The main goal of spectrum allocation is to assign leisure spectrum resources efficiently to achieve the optimal state under the requirements of cognitive user, network QOS (quality of service), and so on. At present, there are several methods to classify the spectrum allocation. According to different application requirements, the existing spectrum allocation methods mainly include game theory, auction theory, and graph coloring theory [4].
The main idea of spectrum allocation method based on game theory is to map real-time interactive process of cognitive users to game model and to establish a distributed dynamic spectrum sharing mechanism. Neel et al. present various game theory models in cognitive wireless network and analysis of power control, call admission control, and interference avoidance with latent game model [5]. Cao and Zheng propose a bargaining game distributed allocation algorithm. With bargaining game, it is not necessary to recalculate the optimal allocation when the topological structure changes [6]. In [6], the bargaining game trade framework assumes that the network nodes are cooperative; however, network nodes may be selfish in actual system. For the game between noncooperative users, Etkin et al. analyze the efficiency of repeated game using Folk theorem and prove the convergence properties of dynamic spectrum sharing with simulation experiments [7]. Nie and Comaniciu 2 The Scientific World Journal describe formally adaptive channel allocation strategy in cognitive wireless network and, respectively, analyze system performance under the circumstance of cooperative users and noncooperative users [8].
In recent years, auction theory is applied to the spectrum allocation, but the trading way is auction. Successful auction system needs to meet truthfulness, ex post budget balance, and individual rationality [9]. Zhou et al. propose a greedy spectrum allocation algorithm based on computational complexity and truthfulness for the first time and design a bid pricing mechanism based on critical neighbor nodes to ensure the integrity of auction [10]. The algorithm can guarantee integrity of auction, but the allocation result often results in degradation of spectrum utilization. Aiming at this problem, Wang et al. introduce the concept of approximate truthfulness and achieve best tradeoff between the truthfulness of users and the spectrum efficiency [11,12]. In 2009, Zhou and Zheng apply the concept of double auctions to spectrum auctions and propose new algorithm to ensure that buyers and sellers bid truthfully in double auctions. Inspite of some loss in performance, the algorithm increases the spectrum's using efficiency effectively, and the operation is also predigested much [9].
In this paper we mainly discuss the cooperation based distributed completely limited spectrum allocation algorithm which is implemented based on graph coloring theory. According to Peng's viewpoint, spectrum allocation problem can be equivalent to graph coloring problem, that is, how to select the appropriate channel (color) from channel set of nodes (each channel corresponds to a color) to color each node [13]. In view of the time-varying characteristics of network topology and available channel in cognitive wireless network, Hao et al. put forward two heuristic dynamic spectrum assignment algorithms: fast convergency algorithm with maximum bandwidth (FCMB) and heuristic fairness algorithm with maximum bandwidth (HFWB) [14,15]. In the existing graph-theory based research, CSGC [13] (colorsensitive graph coloring) algorithm which provides the graph-theory based spectrum allocation model and analyzes the efficiency and fairness in detail is a most representative achievement. The graph-theory based spectrum allocation is an optimization problem and its optimal coloring algorithm is an NP-hard problem. Intelligence optimization is an effective way to solve such problems. In order to reduce the complexity of the algorithm, Zhao et al. introduce genetic algorithm to spectrum allocation and get better allocation results [16]. Later, the artificial-intelligence algorithms such as immune algorithm [17], particle swarm optimization [18,19], and ant colony algorithm [20,21] are used to improve the allocation results.
At present, the overall gain of network is a hot point in the existing algorithms, while few related systematic studies in reducing running time of algorithm were reported. In fact, due to the dynamic changes of leisure spectrum information, real-time requirement is one of the notable features to differentiate spectrum allocation in cognitive wireless network from others. Therefore, the time need for spectrum allocation should be as short as possible. Therefore, a spectrum allocation algorithm based on parallel immune optimization is proposed in this paper to reduce the computing time. The experimental results show that the algorithm can achieve higher network profits and can shorten time of spectrum allocation. Compared with traditional serial algorithm, the proposed algorithm can get ideal speedup ratio and efficiency.

Mathematical Modeling of Spectrum Allocation
To better understand the concept of spectrum allocation, it is necessary to give the mathematical model of spectrum allocation. In this paper we mainly discuss the cooperation based distributed completely limited spectrum allocation algorithm which is implemented based on graph coloring theory. Therefore the spectrum allocation model of cognitive wireless network can be expressed in the following matrices: leisure spectrum matrix (Leisure), benefit matrix (Benefit), constraint matrix (Constraint), and allocation matrix (Allocation). Suppose that there are cognitive users and leisure spectrums that are all orthogonal to each other. These matrices are stated below.
(2) Benefit Matrix (Benefit). In the same leisure spectrum, the benefit achieved by different cognitive users can be represented by benefit matrix = { , } × , that is, the benefit user (1 ≤ ≤ ) gains from using spectrum (1 ≤ ≤ ). Obviously, when , = 0, there will be , = 0; that is to say, only the leisure spectrum has benefit matrix.
(3) Constraint Matrix (Constraint). Different cognitive users can sometimes share the same leisure spectrum. This means that more spectrum resources are available, but it may cause interference which can be represented by constraint matrix = { , , | , , ∈ {0, 1}} × × , where , , = 1 denotes that the interference will be caused when cognitive users and (1 ≤ , ≤ ) simultaneously use spectrum (1 ≤ ≤ ); otherwise, , , = 0. The constraint matrix is determined by the leisure spectrum matrix. When = , we can get that , , = 1 − , and , , ≤ , × , . That is to say, only spectrum is available to cognitive users and simultaneously; the interference may be caused.
(4) Noninterference Allocation Matrix . Assign the leisure and noninterference spectrum to cognitive users. We can get noninterference allocation matrix: where is equal to zero or 1 and , = 1 denotes assigning the spectrum to cognitive user . Otherwise, , = 0. Allocation matrix must satisfy the following constraints defined by : From the above description we can see that more than one allocation matrix satisfies the conditions. Let Λ , be the set of all allocation matrices. For a given noninterference allocation matrix , the total revenue earned by secondary user can be represented by benefit vector : ( The primary goal of spectrum allocation is to maximize the network efficiency ( ), which can be represented as the following optimization problem: * = arg max where arg(⋅) denotes the corresponding spectrum allocation matrix when maximizing the network efficiency. Therefore, * is the most optimal noninterference spectrum allocation matrix.
It is clear that ( ) has different representations [4,17]. Considering the demand for network flow and fairness, this paper defines ( ) with the following three forms [17,22].

(1) The Sum of the Maximized Network Efficiency (MSR).
The goal is to maximize the system total revenue and the optimization problem can be expressed as follows: In order to adopt the same evaluation standard with the following two revenue functions, this paper uses average revenue instead of total revenue. The sum of average maximized network revenue (MSRM) is defined as follows: (2) Maximized Minimum Bandwidth (MMR). The goal is to maximize the spectrum efficiency of restricted user (bottleneck user) and the optimization problem can be expressed as follows: (3) Maximized Proportion Fairness (MPF). The goal is to consider the fairness of each user. To ensure that mean and min are comparable, the fairness measure can be defined as follows: Therefore, under the same allocation, mean ≥ fair ≥ min .

Implementation of Spectrum Allocation
Based on Parallel Immune Optimization

Main Idea of the Algorithm.
It can be seen from the above analysis that the main problem of spectrum allocation is how to find the most optimal spectrum allocation matrix so as to maximize network benefit ( ) when , , and are known. In order to accelerate the convergence rate of intelligent optimization algorithms and also keep the population diversity, parallel implementation is an effective way. Using the evolutionary algorithms for reference, parallelization models of artificial immune optimization mainly include masterslave parallel model, coarse-grained parallel model, and finegrained parallel model [23][24][25]. In this paper, master-slave parallel model is adopted for its simpleness and tending to realize. It is a single population evolution model, divided into master process and slave process [26,27]. The master process executes evolution operator while the slave process computes the affinity of each antibody, respectively. And they work alternatively.
Antibody is mapped to the candidate solution to the problem in artificial immune optimization algorithm. The algorithm will obtain the required solution eventually by optimizing the antibody through initialization, affinity evaluation, clonal expansion, clonal variation, and clonal selection [28,29]. For artificial immune optimization algorithm, the traditional serial algorithm circularly computes the affinity of each individual after cloning the individual, while in parallel computing, the circulation can be decomposed [21,30]. That is to say, the individuals are sent to many nodes in the cluster through message; and then their affinity are computed parallel; finally each node sends the computed affinity back.
Parallel algorithm process is described simply as follows.
(1) The master node obtains the number of CPUs ( ) and population size ( ).
(2) For each node, calculate the number of individuals ( ). The number of individuals for each CPU to calculate is = ⌊ / ⌋ (rounding down) and the rest of the individuals are sent to the higher-numbered CPU. Therefore, the number of individuals each CPU receives in this approach is not more than one at most.
(3) The master nodes send individual coding to slave nodes; then each slave node computes the affinity parallel and sends back the result to master node. The master node receives the affinity value from slave node.

Explanation of the Key Techniques.
For spectrum allocation optimization problem, the key technologies of immune optimization algorithm designed in this paper are described as follows.
(1) Antibody Encoding. Encoding is the process of mapping the problems to be solved to immune antibody. According to the characteristics of the problems, the simplest way to obtain the allocation matrix is to use matrix encoding. But due to the fact that many elements of are zero, this causes many elements of the corresponding allocation matrix to be zero 4 The Scientific World Journal too [31][32][33]. Hence, it will waste considerable storage space to use matrix storage. In this paper, only the elements of matrix that correspond to the elements whose value is one in are encoded. So the number of such elements in is = ∑ =1 ∑ =1 , . Each antibody represents a possible spectrum allocation scheme and this encoding method reduces the search space effectively.
(2) Mapping from Antibody Encoding to Allocation Matrix . In matrix , let and denote the subscripts of the elements whose value is equal to 1 and be kept in 1 in incremental way first according to and then ; that is, 1 = {( , ) | , = 1}. Obviously, the number of elements in 1 is . Then each digit of each antibody (1 ≤ ≤ ) is mapped to , , that is, the elements of matrix , where the value of ( , ) is (1 ≤ ≤ ).
(3) Representation of Affinity Function. The goal of spectrum allocation is to maximize the network benefit ( ), so we use ( ) as affinity function directly.

Implementation
Steps of the Algorithm. In this paper, the implementation steps of the algorithm are as follows: (where denotes antibody population and denotes an antibody).
Step 2 (mapping from antibody representation to allocation scheme). With the antibody mapping pattern, each antibody is mapped to corresponding allocation matrix , that is, a possible spectrum allocation scheme.
Step 3 (processing the interference constraint). The allocation matrix produced in Step 2 meets the requirement of uncertainly, so it should be revised. The implementation procedure is as follows: for any , if , , = 1, then check whether the elements in line and of the column are equal to 1 simultaneously. If so, set one of the two elements to zero at random and keep the other unchanged. In this way, the allocation matrix obtained is a feasible solution. Meanwhile, ( ) should be updated by mapping the corresponding antibody.
Step 4 (according to the above parallelization process, evaluating ( ) with affinity function). Compute the affinity of the antibodies in ( ) and sort them in descending order. Obviously, the corresponding allocation matrix of the antibody whose affinity value is the biggest of all is namely the optimal allocation scheme.
Step 5 (checking termination conditions). The algorithm will terminate if the number of iterations reaches the set threshold ( max ). Map the antibody with the highest affinity value in the antibody population to , that is, the optimal spectrum allocation (the focus of this article). Otherwise, go to Step 6.
Step 6 (clonal expansion ). The antibodies in ( ) are cloned in adaptive mode, that is, the higher the antibody affinity and the smaller the antibody concentration is, the larger the clone scale will be, which is beneficial to keep population diversity and avoid premature convergence. After the clone operation, the antibody population is marked as ( ).
Step 7 (clonal variation ). Based on the probability , the simple mutation [34,35] operation is carried out in population ( ); then we will obtain the antibody population ( ).
Step 8 (clonal selection ). If the population size is less than after clone operation, new antibodies will be generated randomly to replenish it. Otherwise, select the top antibodies to form new antibody population ( +1) = ( ( )). Then go to Step 2.

Simulation Environment and Parameter Settings.
The algorithm is realized on HPC cluster in parallel computing lab. There is a management node, an I/O node, and 32 conventional computing nodes in the HPC cluster. Operating system is RedHat Enterprise Linux AS and C+ MPI is used for programming implementation. MPI is the international standards of message-passing model. In the course of the experiment, the matrices , , and are generated by the pseudocode listed in the literature [13] and they are ensured to meet the corresponding constraint. In this paper, the parameters in immune algorithm are set as follows: maximum evolutional generation max = 200, population size = 20, mutation probability = 0.1, and controlling parameters for clone scale = 5 and the number of CPUs is 1 to 4.

Experimental Results and Analysis.
In order to validate the performance of this algorithm, we compare it with the classic spectrum allocation algorithm CSGC [13], immune clonal selection algorithm [17], and GA-SA (GA-spectrum allocation) [36]. These three algorithms which work on I/O nodes are serial algorithms. Experimental result is measured with the network benefits. For fair comparison, we use the same matrices , , and and the same parameter settings and run the algorithm 50 times to take the average result. The average benefits of 50 times experiments are listed in Tables 1  and 2, where = = 5 and = = 20, respectively ( and denote the leisure spectrum and cognitive user, resp.).
From Tables 1 and 2, we can see that the network benefits including MSRM, MMR, and MPF in this paper are all higher than the other three typical algorithms. Meanwhile, with the increase of iteration times (CSGC is deterministic algorithm and does not change with the iteration times), convergence speed of this algorithm is faster than that of serial immune algorithms, which shows that this algorithm has satisfactory result with fast solution speed.
The Scientific World Journal 5  To further validate the algorithm, let cognitive users remain unchanged ( = 10). The performance of the relevant algorithms is shown in Figures 1, 2, and 3 with the increase of leisure spectrum .
From Figure 1 to Figure 3, it can be see that network benefits increase with the increase of leisure spectrum . Experimental results show that this algorithm is superior to the three existing classical algorithms in terms of network benefits (MSRM, MMR, and MPF), which further indicates the effectiveness of the algorithm. Meanwhile, the experiments also verity the influence of the number of cognitive users on network benefits in the case that the leisure spectrum is known ( = 20), which is shown in Figures 4, 5, and 6. The experimental results show that with the increase of cognitive users, system benefits will decrease. But the benefit of this algorithm is superior to the other three existing algorithms, which proves its superiority.
In addition, the theoretically optimal allocation can be viewed as upper limit of network performance. The theoretically optimal allocation can be obtained by exhaustive search. However, the optimal algorithm of spectrum allocation is an NP-hard problem; solution space increases exponentially with the problem scale magnifying. In order to ensure the computational complexity of exhaustive search is feasible, we let = = 5 in the following contrast experiment [17]. The calculation method of relative error is as follows: if optimal  value of network benefits obtained by one algorithm is and the theoretically optimal is opt , then the relative error is 1− / opt . Table 3 lists the relative error of different algorithm. From Table 3 we can see that the relative error of the algorithm proposed in this paper is smaller than the others. After about 100 iterations with this algorithm, the results are very close to the optimal solution. And after 200 iterations, the optimal solution can be obtained basically which proves its superiority from another side.

Performance Analysis of Parallel Algorithm.
In general, speedup ratio and efficiency analyses [23][24][25] are used to evaluate the relative benefits of parallel algorithms. Speedup

This paper
Literature [17] GA-SA CSGC ratio = / , where is the running time of serial algorithm to solve a problem and is the running time of parallel algorithm to solve the same problem. Thus it can be seen that speedup ratio is the degree that the parallelism of algorithm is expected to improve the running time. Efficiency = / , where is the number of CPUs. Efficiency reflects the effective utilization of the processor in parallel system. Here, we compare the algorithm with serial immune clone algorithm discussed in the literature [17] under the scale of problem = = 20. Table 4 shows the running time, speedup ratio, and efficiency of spectrum allocation algorithm with different number of CPUs.

This paper
Literature [17] GA-SA CSGC Figure 6: Influence of number of cognitive users on MPF.
As can be seen from Table 4, with the increase of the number of CPUs, the running time of algorithm will decrease by not more than 50%. The major reasons are as follows.
(1) System computational power induces more significant effect on parallel algorithm than serial algorithm.
With the increase of the number of CPUs, the running time of parallel algorithm decreases rapidly; however, the downtrend of serial algorithm is gentler.
(2) The part of parallel program is sample, which makes the percentage of the execution of serial program portion increase.
The Scientific World Journal 7  (3) There are some limiting factors in hardware and network settings. In addition, with the increase of the CPU number, speedup ratio increases obviously but the efficiency reduces. The main reason is that the amount of computation for each CPU decreases as the number of CPUs increases. In this way the proportion of data transmission time to the whole time will increase, which results in decrease of efficiency gradually.

Conclusion and Ongoing Work
Spectrum allocation is one of the key issues in cognitive wireless network, and real-time performance is one of its notable characteristics. In this paper, we define a general mathematical model of spectrum allocation. By reducing the optimal allocation to one of color-sensitive graph coloring (CSGC), we show that it is an NP-hard problem. While taking into account spectrum heterogeneity, we propose a spectrum allocation algorithm based on parallel immune optimization and give the detailed steps of the implementation. Meanwhile, we set up a set of evaluation indices of algorithm performance. Our experimental results show that our algorithm not only can drastically improve network benefits but also shortens the time of spectrum allocation and promotes the real-time performance of cognitive spectrum allocation.
In the simulation, we assume that the available spectra are static during the time they takes to perform spectrum assignment. But if a dynamic network is considered, spectrum allocation becomes a more complex problem and the algorithm needs to recompute allocations as the topology changes. So, an adaptive approach should be developed to adapt the environment change and the change of spectrum availability. Meanwhile, the load balancing and program optimization of the dynamic network, the parallel model of parallel immune optimization algorithm, and the relation between the subpopulation size and computing power also need further research.
Furthermore, the researches of this paper are mainly oriented toward qualitative analysis; therefore it is necessary to do some quantitative analysis in the next step to verify its superiority in the actual communication environment.