Skip to main content
. 2016 Jan 9;16(1):82. doi: 10.3390/s16010082
Algorithm 1. Adjustment process of sink node.
  • (I)

    The command nodes with the maximum and minimum mi are denoted as madn and midn, respectively. If more than one command node owns the same maximum or minimum mi, the one with the smaller ID number is denoted as madn or midn.

  • (II)

    The sink node demands that the command node madn transports the common nodes in its administrating area to the administrating area of the command node midn. To decrease the movement distance, the common nodes nearest the command node midn are chosen for transport. Every time one common node is transported, the mi of the command node madn decreases by 1, and the mi of the command node midn increases by 1. This process continues until the mi of the command node madn or midn becomes 0. The transport process is as follows: the dispatch node madn chooses the common node nearest to the command node midn, and marks it as node trn. Meanwhile, madn sends the message di to node trn. The message trn contains the information about the command node midn. As soon as this message is received, node trn moves toward the command node midn along the connection line form itself to the command node midn, and examines its own location. If it reaches the administrating area of the command node midn, it stops moving.

  • (II)

    The sink node judges whether the mi of all the command nodes is equal to 0 or not. If it is, the adjustment ends. Otherwise, (I) is repeated.