6.1. Experimental Setup
We implement algorithms on the self-stabilizing simulator proposed in [
47]. The simulator has been written with the widely used programming language Python. The simulator provides three main types of schedulers with fair and unfair options. Each node is represented as a class object and holds its variables as attributes. Having made a move, the node changes its variables and sends the new set of variables to all of its neighbors. Each node tracks the sent and received bytes which vary for each algorithm according to the size of the messages (the total size of the fields in the messages). The simulator also provides an infrastructure to make it possible to implement algorithms that need 2-hop information about topology. We run the algorithms under the unfair distributed scheduler, which is the most restricted scheduler type, since it does not guarantee that all active nodes are privileged eventually. The scheduler prevents nodes from making moves with 0.5 probability, but guarantees global progress by privileging at least one vertex in each step.
We used random geometric network models in order to simulate WSNs. Each vertex of the given graph
G(V,E) is scattered to a 2D area
A. The sizes of the randomly generated WSNs vary from 50 to 300 (with 50 steps), in which the nodes are considered connected if the Euclidean distance between two of them is smaller than their transmission range
r, as applied in [
47]. WSNs are classified for various densities that have three, five, seven and nine average degrees. Each performance metric is obtained with 30 different simulation scenarios. We randomly assign a weight to each vertex in the interval
. Furthermore, we assign to each vertex
i a
value in the interval
, where
represents the maximum degree of a network.
In addition to the algorithms we proposed, we implemented the algorithms of Kiniwa [
38] and Turau [
39], which are state-of-the-art algorithms for self-stabilizing vertex cover domain. To provide the capacity constraint for the algorithms of Kiniwa and Turau, we added
and
and
variables and two rules which are shown in Algorithm 3. Furthermore, we provided the 1-hop implementation of the SS-CVC
algorithm thanks to the transformer proposed in [
46].
Algorithm 3: Additional rules. |
processi R1: R2:
|
All variables for each node are initialized randomly before the algorithm starts. When a node changes its state, all 1-hop neighbors can see this move (For SS-CVC, 2-hop information is provided). We compared the algorithms in terms of move count, step count, the total weight of vertex cover, and cardinality of vertex cover multi-set. In addition, we measured important WSN metrics such as sent bytes, received bytes and energy consumption. The energy consumption of an algorithm is the energy required for its execution. Move count plays a crucial role in the WSN because a node must send their new state to its neighbor after a move. The count of moves has a direct impact on the complexity of the message. Step complexity is important to see how long it takes to reach the stable algorithm configuration (the time passed during the execution of the algorithm in WSN). The weight and cardinality of the vertex cover are other important metrics to facilitate when comparing the algorithms, since we want to formulate a desirable solution in the shortest possible time. Although Kinawa’s and Turau’s algorithms have been proposed for unweighted graphs, we carried out weighted experiments to compare all algorithms.
Thereafter, Turau’s basic and improved algorithms and Kiniwa’s algorithm will be called TURAU, TURAU and KINIWA, respectively. The transformed version of the SS-CVC algorithm is called T-SS-CVC.
6.2. Evaluations
Move counts of the algorithms are shown in
Figure 7 with a fixed average degree and a fixed network size. It is seen clearly that the move counts increase with the number of nodes in the network for each algorithm, as shown in
Figure 7a. The KINIWA algorithm makes the maximum number of moves to reach a stable configuration and is followed by TURAU
. In networks with 250 vertices, KINIWA took 1347 moves to stabilize, while our proposed algorithms, SS-CVC
and SS-CVC
, needed 332 and 309 moves, respectively, on the same networks. The closest algorithm to our algorithm regarding move count is TURAU
, which makes 833 moves until reaching the stable configuration on the 250-sized networks. The density of the networks does not significantly affect the move counts of the algorithms, as seen in
Figure 7b. Especially, SS-CVC
and SS-CVC
have been minimally affected by density. The SS-CVC
algorithm makes 173, 184, 192 and 194 moves in networks which have 3, 5, 7 and 9 average degrees, respectively. KINIWA needs 669, 783, 854 and 919 moves on average in the same types of networks. Our proposed algorithm, SS-CVC
, showed 2.5 times better performance than its nearest counterpart, TURAU
, in terms of move counts.
The step count of SS-CVC
varies between 33 and 68, while SS-CVC
has less than 34 step counts, as shown in
Figure 8a. KINIWA needs 78–148 steps to stabilize for each size of the graph. The algorithm that has the closest step count to our algorithm is TURAU
with 45 to 74 steps. Compared with TURAU
, the SS-CVC
and SS-CVC
algorithms need 1.10 and 2.15 times less steps, respectively, to stabilize. SS-CVC
and SS-CVC
are 4.22 and 2.17 times faster than KINIWA, respectively, which has the greatest step size for all graph sizes. As seen in
Figure 8b, the step count of SS-CVC
stayed stable at around 28 as the density of the graph increased, while SS-CVC
’s step count increased with the density. Starting with the average degree of 7, the SS-CVC
algorithm exceeds the TURAU
algorithm. However, in most graph types, the SS-CVC
and SS-CVC
algorithms outperformed other algorithms in terms of step count.
Figure 9 depicts the sent bytes for each algorithm on the whole network in kB. The SS-CVC
and SS-CVC
algorithms need the lowest message passing traffic related to their move count performance, which directly impacts message traffic because nodes must inform their neighbors after each move. Note that the other factor for sent byte performance is the message size. For example, the message size for the SS-CVC
algorithm is 5 bytes, while SS-CVC
holds 9 bytes for each package. Due to this difference, the slope of the sent bytes and the move counts line of SS-CVC
remain stable, but the sent bytes exceeded SS-CVC
, as seen in
Figure 9a,b. The size of the network directly influences the number of bytes sent by nodes since a larger network needs more move and message passing. For the networks with 250 nodes, TURAU
, TURAU
and KINIWA send 3.26 kB, 6.1 kB and 6.57 kB of messages in total, respectively, while the SS-CVC
and SS-CVC
algorithms need 1.62 kB and 2.72 kB messages, respectively, to stabilize. The SS-CVC
algorithm has a two times better performance against its closest competitor, TURAU
. Network density did not play a crucial role on the sent byte performance of algorithms, as seen in
Figure 9b.
The received bytes is another important measurement to determine the quality of the algorithm because they affect the lifetime of the network.
Figure 10 shows the performances of the algorithms in terms of received bytes for the whole network until the system reaches a stable configuration.
Figure 10a compares the received bytes performance of the algorithms with respect to the size of the network. As seen in
Figure 10a, there is a linear correlation between received bytes and the size of the network because the increasing node count directly affects the transmitted byte count. The SS-CVC
algorithm outperformed all other algorithms since it has smaller packages to send and less message traffic. For example, the SS-CVC
algorithm needed 9.72 kB average received bytes for networks with 300 nodes; on the other hand, KINIWA needed 39.1 kB to stabilize in same type of networks. The best algorithm after SS-CVC
is the TURAU
algorithm, which needs two times more received bytes in total. The SS-CVC
algorithm showed poor results since it assumes messages are passed to the 2-hop neighborhood.
Figure 10b shows the performance of the algorithms as the average degree of the networks increases. Increasing the density of the network increases the received byte counter linearly since the transmitted messages reach more neighbors. Unlike the sent byte performance of algorithms, the density of the networks impacts the received byte performance of the algorithms. However, this impact is minimal for SS-CVC
in comparison to the other algorithms, as seen from the slopes of lines. In networks with 150 nodes, SS-CVC
always stayed below 9 kB for all density types.
Figure 11 illustrates the energy consumption of each node in the network. The energy consumption is formulated according to the IRIS datasheet, where each IRIS device consumes 17 mA in transmit mode and 16 mA in receive mode when it works with the maximum transmission power. The devices needs 3.3 V to operate. The transmit data rate of each node is 250 kb/s, which is equal to 31.25 kB/s. By using the energy formula
, we can obtain Equation (4) [
48,
49]. As seen in
Figure 11a, the SS-CVC
algorithm consumes 67.44 mJ per node as the most energy-efficient algorithm among all implemented algorithms. Since the energy calculation takes into account the received bytes count, the SS-CVC
algorithm consumes more energy than its counterparts. After the SS-CVC
algorithm, TURAU
consumes 136.08 mJ per node to reach the stable configuration. The SS-CVC
algorithm solves the capacitated vertex cover problem two times more efficiently than its nearest counterpart.
Figure 11b shows the impacts of the network density on energy consumption for algorithms. Again, SS-CVC
has the best performance among the other implemented algorithms.
Figure 12a,b show that the cardinality of the VC solution is directly affected by the size and density of the network. Intuitively, when the network becomes larger and denser, it must choose more vertices to cover all edges in the network because the edge count increases by the node count and the average degree of the network. The SS-CVC
algorithm produced the best VC solution for all network sizes and densities. The SS-CVC
produced a VC multiset that contains 291 vertices on the 250-sized network. The SS-CVC
algorithm is the runner-up with a multiset that contains 360 vertices on the networks that have 250 vertices. The SS-CVC
algorithm produced 1.75, 1.59 and 1.48 times smaller vertex cover solutions in comparison to TURAU
, TURAU
and KINIWA, respectively. As the network becomes denser, the SS-CVC
algorithm is less affected by the density when we compare it against the other algorithms. On the 150-sized networks, SS-CVC
produced VCs in sizes of 140, 168, 183 and 194 in networks whose average degrees vary between 3 and 9, while the best matching-based algorithm KINIWA produced 183-, 249-, 281- and 320-sized VC solutions.
When we investigate
Figure 13, it can be stated that the weight of the VC has the same characteristic as the cardinality of the VC. The SS-CVC
and SS-CVC
algorithms produce vertex cover solutions that have less weight than the other algorithms. SS-CVC
, KINIWA, TURAU
and TURAU
produced weighted vertex covers which are 1.23, 1.58, 1.70 and 1.88 times bigger, respectively, than SS-CVC
’s solutions for networks in size 300. The density of the networks affects the weight of the solution, as seen in
Figure 13 for all algorithms; however, our proposed algorithm SS-CVC
produced the lowest weights among all other algorithms for all network densities.
We elaborate the approximation ratios of the weights of the algorithms in
Table 1,
Table 2 and
Table 3. We obtained the optimal solution using the SageMath programming language by implementing Guha’s integer linear programming algorithm proposed for capacitated vertex cover in [
12]. The implemented algorithm is executed on a server that has an Intel-Xeon E5-2620 v4 processor. The tables show us that the SS-CVC
algorithm has better approximation ratios among all algorithms. After the SS-CVC
algorithm, the second lowest approximation belongs to SS-CVC
for all network types. Matching-based vertex cover algorithms produced more than two approximation ratios. Since these algorithms have not been proposed for weighted networks, they exceeded theoretical approximation ratios. The density of the networks affects the approximation ratios of all algorithms, while the network size has no correlation with the approximation ratio.
We provide the move count and step count performances of the transformer proposed by Turau in
Figure 14. The transformer provides an interface that enables executing an algorithm which is designed for 2-hop with 1-hop information with
slow-down factor. The move count and step count of the transformed SS-CVC
(namely, T-SS-CVC
) are always higher than SS-CVC
due to slow-down factor. T-SS-CVC
needs to make moves at least 15.4 times more than SS-CVC
to reach the capacitated vertex cover solution since the SS-CVC
algorithm stabilizes after 309 moves while the T-SS-CVC
algorithm needs 4773 moves to reach the stable configuration on the 250-sized network. We could infer the same with respect to the step count, which is 15 times more for the T-SS-CVC
on the 50-sized network. To reach a stable configuration, T-SS-CVC
needs more message traffic, as shown in
Figure 15. As mentioned before, message sending is tightly related to the move count of the algorithm. Nodes in T-SS-CVC
send 15 times more bytes and receive 4 times more message bytes in comparison with SS-CVC
. As shown in
Figure 16a, T-SS-CVC
needs approximately five times more energy to produce a vertex cover set on average. In terms of the weight of the vertex cover, the SS-CVC
and T-SS-CVC
algorithms produced the same results as those given in
Figure 16b.