Abstract
This paper proposes an improved Hopfield neural network (I-HNN) algorithm to optimize the slot assignment scheme in wireless sensor networks. The key advantage of the proposed algorithm is to increase the convergence probability under different traffic loads. To achieve this, nodes can adjust their slot demands according to the traffic load, slots number, and demand history. Various aspects of the network performances with the proposed I-HNN algorithm are evaluated via simulation. The results indicate that I-HNN is suitable for wireless sensor networks with dynamically varying traffic. In particular, it can increase the convergence probability and slot utilization under the heavy traffic load.
1. Introduction
A wireless sensor network is a special wireless network without the support of any fixed infrastructure. Due to the lack of central schedulers, the media access control (MAC) protocol is one of the key design challenges for wireless sensor networks. According to the assignment strategy, the MAC protocols can be classified into three categories: random access mechanism such as IEEE 802.11 [1], allocation based mechanism such as FPRP [2], and hybrid mechanism such as TDMA/CSMA [3]. In this paper, we focus on the allocation based mechanism, which has two assignment strategies: static and dynamic. Compared with the static strategy, the dynamic assignment strategy can adapt to the dynamic network topology to achieve collision-free packet transmission and reduce time delay. However, dynamic assignment protocols require nodes to run in parallel and cooperate mutually. Such a lack of centralized control brings further challenges to the design of slot assignment algorithms.
The Hopfield neural network [1] was originally proposed in the neural network literature. It is composed of several interconnected simple neurons and has been widely used in solving nonlinear optimization problems. The Hopfield neural network algorithm has the following four features: (1) it runs on multiple nodes in parallel, (2) it allows multiple nodes to cooperate in a distributed manner, (3) it approaches an optimization goal with a nonlinear method, and (4) it computes rapidly. Consequently, The Hopfield neural network algorithm is naturally suitable for resource assignment (including TDMA assignment) in decentralized systems such as sensor networks.
In the literature, the neural network algorithm has been proposed for resource allocation in cellular radio networks [4–15]. The continuous Hopfield network [6], firstly used in channel assignment, requires very large iteration numbers to converge and is unsuitable for decentralized wireless sensor networks. Funabiki and Takefuji proposed a modified neural network model called the hysteresis McCulloch-Pitts neuron model [5]. This model uses two thresholds to limit the neuron's input. When the input exceeds the upper threshold or is below the lower threshold, the output then changes to 1 or 0, respectively. Otherwise, the output remains unchanged. All neurons update their outputs in parallel, and four heuristics are introduced to increase the probability of convergence to the global minimum. In [4], another modified Hopfield network algorithm was proposed. To accelerate convergence, the algorithm uses different random initialization methods for the neuron's input and then compares the different initialization methods by simulation. References [7, 8] proposed a TDMA slot assignment scheme based on the neural model in [5] and achieved a collision-free TDMA broadcast mechanism for every node.
The papers mentioned above cannot solve the local-minimization problem. Therefore, they are not applicable to a distributed dynamical network. As a result, several improvements upon the above algorithms were proposed [6–12]. Reference [9] added a negative self-feedback in the neuron model of [5] and proposed a new parallel algorithm for slot assignment in wireless packet radio network. In [10], a dynamic slot assignment algorithm based on the Hopfield network is proposed. Once a node needs to apply for a slot, it randomly chooses a slot number and runs the Hopfield network to judge whether the slot is available according to local contentions. If the slot is not available, the node will subsequently try other slots and update the entire network. Another algorithm called binary recursion neural network [11] proposed a new activation function. To solve the local minimum problem, it unifies the Gaussian distribution to determine the termination threshold. Reference [12] applied a nonlinear function to modify the neuron's connection weight and increase the convergence rate. However, this algorithm does not achieve the best performance in terms of convergence probability.
Recently, with the development of advanced optimization algorithms such as genetic algorithm and chaotic algorithm, new types of neural networks combined with these new algorithms are sought to increase the convergence probability. One mixed assignment algorithm that combines the genetic algorithm and neural network was proposed in [13]. This algorithm adopts the Hopfield network concept and is able to achieve the maximum throughput. Moreover, a fuzzy neural network algorithm was proposed to solve the channel assignment problem in [14, 15]. This algorithm uses the fuzzy C-means clustering to classify nodes in a network, adds the correlation degree between a node and a cluster to the neuron's weight, and adopts the Hopfield neural network to update the neurons. The modified algorithms can solve the local-minimization problem at the cost of increased iteration number.
The algorithms proposed in the above literature do not consider the dynamic change of traffics in wireless sensor networks, which, in practice, are likely to have varying traffics. This paper proposes an improved HNN (I-HNN) algorithm to solve the channel assignment problem in wireless sensor networks with dynamic traffic demands. Compared with existing algorithms, the proposed algorithm can increase the convergence probability under different traffic loads.
The remainder of this paper is structured as follows. In Section 2, the neural network model and the slots assignment algorithm are described. The proposed algorithm I-HNN is presented in Section 3. Section 4 shows the simulation results and Section 5 concludes the paper.
2. Hopfield Based Channel Assignment Algorithm
2.1. Slot Assignment in TDMA-Based WSN
We consider a TDMA-based wireless sensor network, in which time is divided into frames and a frame is further divided into slots. TDMA-based communication system has the ability to provide collision-free packet transmission regardless of the traffic load.
Figure 1 illustrates a simple wireless sensor network with 7 nodes operating in the TDMA fashion. To avoid transmission collision, nearby nodes cannot use the same time slot. However, a slot can be spatially reused by nodes separated by more than two hops away. Due to the decentralized and multihop characteristic of wireless sensor networks, the slot assignment algorithm should run in a distributed manner. Hopfield neural network is composed of several interconnected neurons which can run in a distributed manner. Therefore, it is naturally suitable for slot allocation in wireless sensor networks.

An example of slot assignment for wireless sensor network.
2.2. Construction of Hopfield Neural Network in Slot Assignment
In a wireless sensor network with n nodes and m slots per frame, the slot assignment problem can be considered as a combinatorial optimization problem consisting of a Hopfield neural network with

The construction of neural network based assignment.
The Hopfield neural network above consists of an array of simply connected neurons with binary output. Each neuron has several inputs from other connected neurons and has only one output. The neuron model is shown in Figure 3.

The neuron model.
A neuron in the Hopfield neural network can be regarded as a simple processing unit, which is composed of an input unit and an output unit. The input unit
The update of input
How to design the function
Here, UTP (upper trip point) and LTP (lower trip point) denotes maximum and minimum thresholds, respectively, and the values of UTP and LTP are given in [5]. When
2.3. The Energy Function
The slot assignment problem in wireless networks must meet the following two constraints: one is that the same slot must not be assigned to nodes within two hops; the other is that the slots assigned to a node should meet the node's demand of slots. Therefore, the slots assignment problem can be transformed to an energy-minimization problem, as formulated in (4). Consider
Here,
The slot assignment algorithm is to minimize the energy function
In symmetric neural networks, we have
It has been proved by [5] that when
As described above, the Hopfield neural network can solve the slot assignment problem in a parallel and nonlinear way. In a network with n nodes and m slots to be assigned per frame, there are
3. Dynamical Slot Assignment Based on Hopfield Neural Network
In TDMA-based wireless sensor works, the slots in a frame have two types: a control slot at the beginning of a frame, followed by several traffic slots to be allocated. The control slot is used to exchange control information for scheduling the traffic slots. The traffic slots are used to carry the actual payload. To establish a neural network with
3.1. Modeling Assumptions and Discussions
Three key assumptions are made in our system model. Assumption 1 is that all nodes keep perfect timing synchronization. This assumption is the premise of all TDMA-based communication systems and is widely applied in the studies of TDMA systems [2, 3]. Assumption 2 is that the network topology will not change during one iteration interval. In practice, because the iteration time is typically very short, the change of network topology during one iteration time is negligible. Therefore, the network topology can be treated as static within one iteration time. This is a widely used assumption for ad hoc network studies [2]. Assumption 3 is that there is no packet error in the channel. Although communication errors are inevitable in practice, various practical techniques such as forward error coding (FEC) and ARQ can be used to manage the error rate at a desired level. In this paper, we consider the exchange of channel allocation information between nodes. In practice, such sensitive control information is typically well protected with FEC and ARQ schemes to have very low bit error rates. In addition, preliminary simulations show that the main conclusions of this paper remain robust for an error rate below
3.2. Energy Function and Motivation Equation
In a wireless sensor network, nodes can only receive local information within two hops. If the network guarantees that different time slots are assigned to nodes within two hops, it will realize conflict-free transmission.
As shown in (4), the information from other nodes is mainly used to calculate the second term, which guarantees that the slots assigned to different nodes do not conflict. Because nodes more than two hops away can reuse the slots, the calculation of the second term in each node only needs the information of nodes within its neighboring two hops. It follows that the energy function can be modified as follows:
Since the connection between two neurons is restricted to the topology of the network, the weight of
According to
Therefore, the motivation equation can be written as follows:
The termination condition of the iteration of neural network is that the energy value of the whole network equals zero. This implies that all nodes can acquire the global information about the network's energy by use piggybacking techniques to relay this information while iterating. To increase the convergence speed, [5] adopts some heuristics. It follows that
3.3. Slot Demand Model
The slot demand of a node in the uth frame is the packet arrival number within a frame. The demand is a random variable and can be expressed as follows:
Suppose that the packet arrival rate is a Poisson's distribution with mean
The expectation of packet arrival number in a frame of time is
The Hopfield slots assignment algorithm introduced above does not consider dynamic changes of the traffic load in the wireless sensor network. When a node has a heavy traffic, it needs more slots. The high slot demands in some nodes may lead to a failed convergence in Hopfield slot assignment algorithm. If these nodes can automatically adjust and reduce their slot demands, the convergence probability can be increased under different traffic conditions.
An appropriate slot demand model should include many factors, such as packet arrival rate λ, total slots number M, and history slot demand of other contention nodes within two hops
Here,
Threshold
3.4. Algorithm Description
Consider a wireless sensor network with n nodes and m slots per frame, the slot assignment task can be achieved by constructing a Hopfield neural network with
The above slot allocation algorithm runs in the control slot at the beginning of each frame. All the
The main process of the proposed I-HNN algorithm is as shown in Algorithm 1.
//initializing the input and output of its M neurons; for Parameter initialization: UTP = 5, LTP = −5, set all the inputs and output of neuron are set to zero: end //begin the iteration of I-HNN
while (t≤ maximum iteration) do Calculate the slot demands Received output for calculated the Update the input of neuron end for Determine and update the output end Calculate the energy function value by (6). if ( quit iteration and generate final slots assignment; else send new output end
Algorithm 1
When the Hopfield neural network converges successfully, channel scheduling with no conflict and low time delay can be achieved. The performance of the proposed I-HNN algorithm depends on the frame size, node density, and traffic load. The next section of the paper will evaluate the performance of I-HNN.
3.5. Performance Evaluation
The main performance metrics are as follows.
Average convergence probability: the convergence probability is defined as the probability of successful convergence. Average iteration number: it is the required iteration number when the Hopfield neural network successfully converges. When the network fails to converge, the iteration number is equal to the maximum iteration number. Slot utilization: the slots utilization is defined as the acquired slot number in one assignment for each node. Average time delay: the time delay is defined as the average service time for one packet. To derive the time delay, we assume the N nodes in the network are
where the service rate of the station i is
The total time delay is given by
4. Simulation Analysis
4.1. Simulation Scenarios
Our simulation aims to analyze the average convergence probability, average iteration number, average acquire slots number for each node, and average time delay, under different traffics, frame sizes, and nodes densities. And we assume that
the packets have a fix length, which is also equal to the length of one slot; the traffic demands of nodes are independent. Packets of each node arrive according to a Poisson's process with rate
In our simulation setting, the nodes are distributed in a

An instance of network topology in a simulation.
4.2. Simulation Results and Analysis
This paper compares the Hopfield neural network based slots assignment algorithm in [7] (HNN) and our improved Hopfield neural network slots assignment (I-HNN) from four aspects: average convergence rate, average iteration number, slots utilization, and average time delay.
We first take an example to illustrate how the I-HNN algorithm works. It is assumed that the network traffic is under saturated traffic condition and all nodes require at least one slot. We use the sign “T” to represent that this node is assigned with a current slot. Figure 5 illustrates a simulated network topology with 16 nodes. Table 1 shows that the proposed I-HNN algorithm can assign slots well to achieve better slot utilization.
Slot assignment according to the proposed IHNN algorithm. (Frame size: 10 slots; coverage: 1.5 units; traffic: saturation).

An illustration of a simulated network topology with 16 nodes.
(1) Average Convergence Probability. The relation between the convergence probability and slot demand is shown in Figure 6. The slot demand d depends on the traffic load. The simulation result indicates that the convergence probability of the HNN algorithm reduces quickly with increasing slot demand. Although the increase of frame size can improve the convergence probability to a certain extent, the convergence probability is also low with high slot demands. In the proposed I-HNN, the slot demands can be dynamically adjusted according to the traffic demand. As a result, the convergence probability is increased under different traffic loads. Figure 6 also shows that the I-HNN algorithm can increase the convergence probability of the Hopfield neural network under the condition of high slot demands.

The average convergence probability with varying average slots demands. (Frame size:
(2) Average Iteration Number. We note that for iterative algorithms, the minimum necessary iteration number can serve as an effective indicator of the computational burden. Therefore, Figure 7 also suggests the advantage of IHNN over HNN in terms of computation burden.

The average iteration number with varying slots demands. (Frame size:
Figure 7 shows the relation between the iteration number and slots demands. The higher the demand is, the more iteration is needed for the Hopfield slot assignment algorithm to converge. As for the HNN algorithm, the iteration number increases with the growth of slot demands and eventually reaches the maximum iteration number. By dynamically adjusting the threshold T, the I-HNN algorithm can reduce the iteration number and accelerate the convergence rate.
(3) Slot Utilization. Slots utilization can be evaluated as the average number of assigned slots for each node. This simulation shows the slots assignment efficiency with different slot demands and frame size.
In conventional reservation based TDMA protocols, the frame size has a significant effect on the network performance. Because the contention nodes within two hops cannot reuse the same slot, the slot assignment will not succeed when the number of slots is less than the number of contention nodes within two hops.
Figure 8 shows that the slot utilization will change when the average slot demands increases. When the average slot demand is low, the slot utilization of HNN is higher than that of I-HNN; this is because the I-HNN can adjust and reduce its slot demands automatically. However, when the average slot demand is high, the slot utilization of HNN is lower than that of I-HNN; this is because higher slot demand may lead to failed convergence of HNN; hence, the slot utilization will accordingly decrease. Otherwise, the I-HNN can reduce the overmuch slot demand and improve the convergence probability, so as to increase the slot utilization.

The average number of assigned slots for each node with varying slots demands. (Frame size:
Figure 9 shows the slot utilization as a function of different frame sizes. When the slot demands are low, the I-HNN can improve the slots utilization with short frame sizes; when the slot demands are high, the I-HNN algorithm can obviously increase the slots utilization.

The average number of assigned slots for each node with varying frame size. (Nodes number: 100; coverage: 1.5 units; average slots demands: 1, 2, and 3 slots.)
Similarly, the network performance is also related to the contention range of nodes. As the contention range expands, the number of contenting nodes within two hops will also increase, leading to decrease in slots utilization. As shown in Figure 10, the effect of contention range on slot utilization is similar to the effect of frame size.

The average number of assigned slots for each node with varying contention range. (Frame size: 30 slots; nodes number: 100; average slots demands: 1, 2, and 3 slots.)
(4) Average Time Delay. When the packet arrival rates are lower than the packet transmitting rates, all packets can be sent eventually. However, when the packet arrival rates are higher than the packet transmit rates, some packets cannot be sent, which will lead to an infinite time delay. Figure 11 compares the time delay of HNN with I-HNN.

The average time delay with varying packet arrival rates. (Frame size: 30 slots; nodes number: 100; coverage range: 1.5 units; average slots demands: 0.5, 1, and 1.5 slots.)
The packet transmit rate is denoted by
5. Conclusions
An improved HNN algorithm has been proposed in this paper to solve the channel assignment problem in TDMA-based wireless sensor networks. The proposed algorithm is adopted from the classic HNN algorithm in the neural network literature and features two major modifications. First, a “two-hop” constraint has been imposed on the output of the network to reflect the nature of local channel contention in wireless sensor networks. Second, a simple but effective mechanism is introduced to dynamically adjust the channel assignment policy according to traffic demands. Through simulation, the performance of the proposed algorithm has been evaluated in terms of average convergence rate, average iteration number, slots utilization, and average time delay. It has been observed that the proposed algorithm is effective in improving all the above aspects compared with the conventional HNN algorithm.
Footnotes
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
The authors would like to acknowledge the support of the Natural Science Foundation of China (nos. 61201196 and 61201195), the Natural Science Foundation of Fujian (nos. 2012J05127 and 2012J01292), and the PhD Programs Foundation of Ministry of Education of China (no. 20100121120020).
