We begin running time analysis of MHED by inspecting the number of iterations of the while loop in line 3. The while loop runs until there are no hop-vertices left in the queue; therefore, the iteration count is equal to the number of enqueue and dequeue operations. As discussed earlier, there can be at most |Adj[v]| number of n-hop paths to a vertex v, if every neighbor provides a path with different number of hops from the source. Sum of |Adj[v]| for all vertices v gives the number of edges, |E|. As a result, there are |E| number of hop-vertices, enqueue and dequeue operations.
The for loop in line 5 executes |E| times, each execution iterates through |Adj[u]| number of edges. A total of |V | executions of the loop results in |E| iterations; therefore, the iteration count in |E| executions is |E||V |2. Relax method runs in constant time, since every statement including the enqueue operation on FIFO queue takes constant time.
The initialization procedure takes O(V2) time, therefore the running time of the BFS based MHED algorithm is O(V2+ EV2), which is always between O(V2) and O(V3) for an arbitrary network.
The Dijkstra based MHED algorithm uses insert and extract-min operations on a min heap instead of enqueue and dequeue operations on a FIFO queue. There are also decrease-key operations inside the relax method.
CHAPTER 3. ROUTING FOR PERIODIC CONNECTIONS 28
Using a binary heap, insert takes O(E), extract-min takes O(ElgE) and decrease-key takes O(E2VlgE) time, making the running time of the overall al- gorithm O(E2VlgE). By using a Fibonacci heap, extract-min operations take O(ElgE) amortized time and running time of decrease-key operations decrease to O(EV2) amortized time. Taking the initialization procedure into account, the running time of the MHED algorithm based on Dijkstra using Fibonacci heap is O(V2+E2
V + ElgE), which is equal to O(V
2+ ElgE) for sparse networks.
We conclude that BFS based approach runs asymptotically faster than Dijk- stra based approach.
Chapter 4
Experiments and Evaluation
In this chapter, we present experiment results of proposed DTN routing algo- rithms and evaluate the findings. For this purpose, we first define the simulation environment, properties and parameters of the simulations, then discuss the re- sults and their implications.
4.1
Simulation Properties
We performed simulations to find statistical properties of our routing algorithms for different parameter values. Transmission count, average and maximum path length to destination and routing tree stability statistics are measured. Imple- mentation is done on Java platform using custom graph and routing code. Simu- lations are run on a Linux machine with a quad-core AMD 64-bit processor and 4 GB memory, though minimum requirements for the implementation are much lower.
A simulation is performed as follows: First, a random graph is generated with a given node count, network density and a connection model. Then, measures are taken over a time interval of 100 units separately for each node as the source. Similarly, every other node becomes the destination when a destination node is
CHAPTER 4. EXPERIMENTS AND EVALUATION 30
needed. Results at each step are averaged. The overall procedure is repeated 30 times to ensure enough randomness and to get statistically enough number of samples.
We produce random graphs given vertex count and graph density. Since DTNs are connected graphs, we must ensure our random graph to be connected. To achieve this, we keep two sets of vertices: connected and disconnected. Until the graph becomes connected, we choose one random node from the set of connected vertices, one from the set of disconnected and connect them. When all of the vertices are connected, we get a connected graph with |V | − 1 number of edges. Then, we add edges by randomly choosing two vertices, until the density con- straint is satisfied. Note that the produced graph cannot have a lower density than the density of a connected graph with given vertex count and minimum number of edges, |V |−1|V |2 . The properties of a graph produced with this method is
random enough for our purposes.
For some of the experiments, we considered two scenarios with different con- nection models. Scenario 1 simulates a DTN inside a campus. Nodes represent college students, attending 50 minute-long lectures and having 10 minute breaks. We assume that connections occur mainly during break times; though we take into account slightly shorter and longer connections and disconnections. There- fore, TON ranges between 5 and 20 minutes and TOF F ranges between 15 and
60 minutes. The key property of this scenario is the fact that connections take shorter time than disconnections.
The second scenario is a more homogenous environment, where connection and disconnection periods are the same. Scenario 2 simulates connection properties of a public transportation network. Nodes represent both vehicles (bus, subway etc.) and passengers. Connections occur either in stations or during travel between people and vehicles. We assume waiting time for a vehicle and travel time are similar; therefore, TON and TOF F values have a range of 10 to 30 minutes.
For both scenarios we use an initial wait time between minimum and max- imum of the connection or disconnection times. For Scenario 1, it is 5 to 60 minutes; for Scenario 2, it is 10 to 30 minutes. For practical purposes, we scale
CHAPTER 4. EXPERIMENTS AND EVALUATION 31
down the time and let one time unit of simulation represent 5 and 10 minutes of real time respectively in Scenarios 1 and 2. Actual values for each connec- tion are drawn from a uniform distribution between determined intervals. Unless otherwise stated, Scenario 1 is used in the experiments.
In the experiment results, ED refers to the earliest delivery algorithm based on Dijkstra’s algorithm in Algorithm 3 using vertex relaxing procedure in Algorithm 8, MHED refers to min-hop earliest delivery algorithm based on BFS, presented in Algorithm 12 using vertex relaxing procedure in Algorithm 14.