Many routing protocols, such as distance vector and link-state protocols are used for finding the best paths in a network. To find the path between the source and destination nodes where every node is visited once with no repeats, Hamiltonian and Hypercube routing protocols are often used. Nonetheless, these algorithms are not designed to solve the problem of a node failure, where one or more nodes become faulty. This paper proposes an efficient modified Fault-free Hamiltonian Cycle based on the Hypercube Topology (FHCHT) to perform a connection between nodes when one or more nodes become faulty. FHCHT can be applied in a different environment to transmit data with a high-reliability connection by finding an alternative path between the source and destination nodes when some nodes fail. Moreover, a proposed Hamiltonian Near Cycle (HNC) scheme has been developed and implemented. HNC implementation results indicated that FHCHT produces alternative cycles relatively similar to a Hamiltonian Cycle for the Hypercube, complete, and random graphs. The implementation of the proposed algorithm in a Hypercube achieved a 31% and 76% reduction in cost compared to the complete and random graphs, respectively.

State-of-the-art technology, especially the Internet of Things (IoT), has increased the demand for Wireless Sensor Networks (WSNs). A WSN is a network of nodes that communicate with each other, sense the environment, and transmit the collected data via wireless links. A sensor network employs small, lightweight, battery-powered devices, known as sensor nodes [

Although WSNs can successfully distribute data collection for IoT applications, they have limited reliability because one or more nodes may become faulty [

Furthermore, the nature of the region plays an essential role in the distribution of sensors and may increase repair challenges. For example, a geographic territory with steep terrain is not easily accessible for repairing faulty sensors. Therefore, a failure could lead to the partitioning of the network into disjoint blocks, and to changing the routing path.

The problem of a complete halt in any communication network occurs when no message can be delivered towards its destination due to faulty nodes. Consequently, no communication occurs through the sensor nodes until the network administrator takes exceptional action to handle the problem, which usually requires a long time. Hamiltonian and Hypercube Routing Protocols can be used to solve the faulty node problem and therefore have been used in many applications to avoid deadlock issues [

Hamiltonian routing protocols employ either a Hamiltonian path or a Hamiltonian cycle. The Hamiltonian path requires visiting each node of the graph exactly once during the routing process. When the end node is the same as the start node, it becomes a Hamiltonian cycle [

A Hypercube is either a graphical representation of some nodes and edges or is the set of all n-bit strings denoted by

A complete graph, denoted by Kn, is a graph where n is the number of nodes with an edge that links each pair of separate nodes. The graph is assumed to be simple; i.e., it contains no loops or multiple edges.

A connected graph G is a graph where each pair of nodes is connected by a simple path.

This paper will present a modified Hamiltonian cycle protocol implemented on a Hypercube graph to find an alternative cycle in case of the occurrence of one or more faulty nodes. Additionally, a new simulator, called HNC, has been designed and implemented to verify the efficacy of this protocol.

The rest of this paper is organized as follows. Section 2 provides graph-theory preliminaries on the Hamiltonian path and cycle and Hypercube graphs. Section 3 reviews related works. In Section 4, the theorems lying behind the proposed algorithm are proven and the general idea of the algorithm is introduced and explained briefly. The algorithm and pseudo code of the algorithm’s components are given in Section 5, where the simulation results are shown in Section 6. Finally, Section 7 concludes the paper followed by the list of references.

This section reviews and discusses some basic concepts and definitions of the Hamiltonian and Hypercube topologies.

Definition 1 (Hamiltonian Path): In a graph

Definition 2 (Hamiltonian Cycle): In a graph

Definition 3 (Hypercube): A Hypercube, Q_n, is a graph whose node set V consists of the n-dimensional Boolean vectors, i.e., vectors with binary coordinates 0 or 1, where two nodes are adjacent whenever they differ in exactly one coordinate [

Luca Trevisan [

Theorem 1: For every

Consequently, we propose solving the faulty node problem in the Hamiltonian cycle routing protocol for the Hypercube. Hypercube _{n}^{n} nodes is an undirected graph where each node is labeled with a binary number that differs from each of its adjacent nodes in exactly one bit. The parity of the node is determined based on the number of 1’s in its binary-number label; i.e., the parity is 0 if the number of ones is even and otherwise it is 1.

The n-Hypercube graph also called the n-cube graph and commonly denoted as

In addition, Hypercube _{n}_{n}

Hsieh et al. [_{n}_{n}

In order to find the most extended cycle in an n-dimensional Hypercube graph G, [

This section discusses the traditional Hamiltonian cycle, Hamiltonian path, and Hypercube used to connect nodes. Ammerlaan et al. [

Xiaofan et al. [

Guo et al. [_{0}, F_{1}) is distinguishable for

Zhang et al. [

Liu et al. [

Chen [

Theorem 2: Let G be a Hypercube graph with a degree (

Let

Let ^{*} can be calculated by

In general, the number of all edges in the

Proof: Let

Case 1: See

and since

Such that

Case 2: See

and since

Such that

Case 3: See

and since

Such that

Consequently, there exists at least one Hamiltonian path from node A to node C through node B where

To introduce our own proposed algorithm (FHCHT) based on the above theorems,

To reduce the cost of transmission and avoid existing faulty nodes, the Hamiltonian cycle is used first to label all nodes and to process the communication between nodes. This phase is called the initialization phase. As mentioned, the Hamiltonian cycle algorithm is used where the source address is the same as the destination address (start node = destination node). At this phase, all nodes are labeled either in binary or in decimal and the transmission phase is applied, which has two scenarios. The first scenario is called the standard scenario where the packet is transmitted smoothly from the source node to the destination node using the Hamiltonian cycle without any obstacles. The second scenario is when one or more nodes do not work (faulty node). Here, FHCHT is applied to bypass these nodes and go to the next node through an intermediate node, and to find other possible paths.

In this section, we introduce the two proposed algorithms: Extracting Hamiltonian Cycle and Applying FHCHT.

The code of the algorithm is as follows:

The code for applying the algorithm is as follows:

In this section, we introduce the implementation of the proposed FHCHT algorithm and show the obtained simulation results. The simulation was run with Matlab 2019 on a laptop computer with Intel Core i5 Duo CPU 2900 4M, 4GB DDR3 RAM, and Windows 10 operating system.

As an example, let a Hypercube degree (^{4} = 16, as illustrated in

The packet format is shown in

P_ID: packet ID, N_ID: Node ID, N_Node: Next Node, W_msg: Wakeup Message, Ack.: Acknowledgment, F_Nodes: Faulty Node(s) and A_Nodes: Alternative Node(s).

To find a near-Hamiltonian path after a faulty node(s) exists, apply Algorithm 2. If a full Hamiltonian cycle exists, then it exits and outputs the Hamiltonian cycle with no faulty nodes. Otherwise, the output is a near-Hamiltonian cycle with one or more loops.

To increase the efficiency of the system, the source node will use

Packet ID | Faulty nodes | Alternative nodes |
---|---|---|

IDx | Fn_{1}, Fn |
An |

A subcase example is shown in

Additionally, we implemented a complete connected and random connected graphs with node degree greater than or equals 2, in order to compare the efficiency and total cost, when we obtain a Hamiltonian or near-Hamiltonian cycle.

Graph | Number of nodes | Number of faulty nodes | Faulty nodes | Near Hamiltonian path | Time (ms) | Total cost | |
---|---|---|---|---|---|---|---|

Hypercube | 8 | 2 | 3_4 | 0_1_0_2_6_7_5_1_0 | 0.0063 | 34 | |

16 | 3 | 4_6_7 | 0_1_3_2_0_1_5_13_15_11_9_13_12_14_10_8_0 | 0.0006 | 86 | ||

16 | 4 | 5_7_9_12 | 0_1_3_2_6_4_6_14_15_11_15_13_15_14_10_8_0 | 0.0031 | 96 | ||

16 | 5 | 2_5_7_9_12 | 0_1_3_7_6_4_6_14_15_11_15_13_15_14_10_8_0 | 0.0031 | 92 | ||

Complete | 8 | 2 | 3_4 | 0_1_2_0_1_5_6_7_0 | 0.0015 | 60 | |

16 | 3 | 4_6_7 | 0_1_3_2_6_4_6_14_15_11_15_13_12_14_10_8_0 | 0.0006 | 115 | ||

16 | 4 | 5_7_9_12 | 0_1_3_2_6_4_6_14_15_11_15_13_15_14_10_8_0 | 0.0008 | 98 | ||

16 | 5 | 2_5_7_9_12 | 0_1_3_7_6_4_6_14_15_11_15_13_15_14_10_8_0 | 0.0009 | 101 | ||

RandomNumber of edges | 8 | 2 | 3_4 | No cycle | 0.003 | 80 | |

16 | 3 | 4_6_7 | No cycle | 0.008 | 135 | ||

16 | 4 | 5_7_9_12 | No cycle | 0.008 | 140 | ||

16 | 5 | 2_5_7_9_12 | No cycle | 0.012 | 148 |

By applying Algorithm 2 twenty times with a fixed number of nodes with randomly generated faulty nodes, we got the results shown in ^{n}(2^{n} −1)/2), where n is the Hypercube degree.

Graph | Number of nodes | Number of faulty nodes | Number of graph edges | Number of runs | Number of existing cycle | |
---|---|---|---|---|---|---|

Hypercube | 8 | 2 | 12 | 20 | 20 | |

16 | 3 | 32 | 20 | 20 | ||

16 | 4 | 32 | 20 | 20 | ||

16 | 5 | 32 | 20 | 20 | ||

Complete | 8 | 2 | 28 | 20 | 20 | |

16 | 3 | 120 | 20 | 20 | ||

16 | 4 | 120 | 20 | 20 | ||

16 | 5 | 120 | 20 | 20 | ||

Randomnumber of edges | 8 | 2 | 14 | 20 | 2 | |

16 | 3 | 70 | 20 | 5 | ||

16 | 4 | 70 | 20 | 1 | ||

16 | 5 | 70 | 20 | 1 |

The results show that the time required for the complete graph was better than the time of the Hypercube, while the cost for the complete graph, measured by the number of edges, is greater than in the Hypercube. For instance, for a Hypercube with 16 nodes, the number of edges is 32, while in the complete graph for the same number of nodes the number of edges is 120, which was a significant difference between them.

At the same time, when we use a graph with a random number of edges to reduce cost, we cannot guarantee an existing Hamiltonian or near-Hamiltonian cycle. Thus, it is not preferable to choose a random number of edges.

In this study, a Modified Fault-free Hamiltonian cycle based on the Hypercube Topology (FHCHT) and a Hamiltonian Near Cycle (HNC) simulator were developed to obtain one or more alternative paths between the source and the destination nodes in WSNs. FHCHT aims to solve a well-known faulty node problem. HNC was applied as follows. First, Hypercube connectivity was used to establish a connection path between the source and destination through a set of active nodes. Second, a random number was chosen to represent the number of faulty nodes. Third, HNC was applied to create and find the shortest path.

The results obtained from HNC confirmed that the proposed algorithm finds multiple alternative paths between the source and destination nodes with the existence of many faulty nodes with an approximate 31% reduction of cost over the complete graph and a 76% reduction over the random graph. However, repeated runs for a Hypercube, complete and random graphs show that the Hypercube edges are fewer than the complete graph edges, which reduces the connection cost. Meanwhile, the random connected graph does not guarantee to obtain a Hamiltonian or near Hamiltonian cycle when a number of faulty nodes exist. The rectified communication process should enhance the overall efficacy of WSN applications.

The authors would like to thank Al-Zaytoonah University of Jordan for supporting this research.