## 3 The Multi-Agent Framework  
In order to realise the framework, a two-layer architecture is introduced, where the first layer is the wireless sensor network and the second layer is a multi-agent cooperation network, as shown in Figure 1.  
Figure 1: A sample two-layer architecture.  
In the first layer, the wireless sensor network layer, sensors are connected by a wireless medium, such as infrared devices or radio, which is represented by the solid lines connecting the two sensor nodes. The first layer is the physical network, which really exists. In the second layer, each sensor is modelled as an agent, and agents are linked by a cooperative relation, represented as dashed lines. In the rest of the paper, the two terms, sensor and agent, are used interchangeably. The second layer, the multi-agent cooperation network layer, is an abstract network, which does not really exist. The multi-agent cooperation network is formed on the basis of the sensors' past cooperation. For example, in Figure 1, if many packets sent from Sensor \(1\) have to be forwarded by Sensor \(7\), Sensor \(1\) may add Sensor \(7\) as one of its cooperative neighbours. Then, in the future, if Sensor \(1\) has packets to be sent, it first sends the packets to Sensor \(7\), and Sensor \(7\) then forwards the packets to the destinations for Sensor \(1\). For the process that Sensor \(1\) sends packets to Sensor \(7\) and Sensor \(7\) forwards packets to the destinations, Sensors \(1\) and \(7\) can use any existing routing approaches. It can be seen that the multi-agent cooperation network layer is used to guide the packet routing process in the wireless sensor network layer in order to improve the routing efficiency, instead of becoming a concrete routing protocol that directly operates in the wireless sensor network layer. Thus, in this case, many existing routing protocols can be employed in the wireless sensor network layer. Such a two-layer architecture is necessary, because in the first layer, the topology of a WSN cannot be altered (unless some nodes move or leave the network, or new nodes join the network), and hence, the proposed framework has to work in the second layer, the multi-agent cooperation network layer, which enables each agent to keep the most useful cooperative neighbours and, in turn, assists existing routing approaches to achieve better performance.  
In this paper, the sensor network is defined as a graph, \(G=(V,E)\), where \(V=\{v_{1},...,v_{n}\}\) is the set of \(n\) sensors in the network and \(E\subseteq V\times V\) is a set of physical links. Two sensors, \(v_{i}\) and \(v_{j}\), are physical neighbours if \((v_{i},v_{j})\in E\) and they can directly transmit packets between each other. \(N_{i}=\{v_{j}|(v_{i},v_{j})\in E\}\) indicates sensor \(v_{i}\)'s physical neighbour set. Similarly, the cooperation network is defined as a graph, as well, \(G^{\prime}=(A,E^{\prime})\), where \(A\) is the set of agents and \(E^{\prime}\subseteq V\times V\) is a set of cooperation links. Each agent represents a sensor node. Two agents, \(ag_{i}\) and \(ag_{j}\), are cooperative neighbours if \((ag_{i},ag_{j})\in E^{\prime}\). \(N^{\prime}_{i}=\{ag_{j}|(ag_{i},ag_{j})\in E^{\prime}\}\) indicates agent \(ag_{i}\)'s cooperative neighbour set. It should be noticed that physical neighbours are symmetrical, namely that if \((v_{i},v_{j})\in E\), then \((v_{j},v_{i})\in E\) holds, but cooperative neighbours are asymmetrical, namely that when \((ag_{i},ag_{j})\in E^{\prime}\), it is not necessary that \((ag_{j},ag_{i})\in E^{\prime}\) holds. Initially, each sensor's physical neighbour set is identical to its cooperative neighbour set (although later, its cooperative neighbour set may be adapted).  
Before devising the framework, it is necessary to introduce some evaluation indices to estimate each sensor, as well as the sensor network. These indices include energy consumption, storage consumption and sensing coverage.