Comparison Studies for Different Shortest path Algorithms

While technological revolution has active role to the increase of computer information, growing computational capabilities of devices, and raise the level of knowledge abilities, and skills. Increase developments in science and technology. In graph used the shortest path algorithms for solving the shortest path problem. The shortest path can be single pair shortest path problem or all pairs shortest path problem. This paper discuss briefly the shortest path algorithms such as Dijkstra's algorithm, Bellman-Ford algorithm,Floyd-Warshall algorithm, and johnson's algorithm. It describes the previous algorithms for solving the shortest path problem. The goal of this paper is to investigate and comparison the impacts of different shortest path algorithms. The study shows that the efficiency varies among algorithms, helps to suggest which one of them ought to be used to solve a specific variant of the shortest path problem.


INTRODUCTION
Today, we live in a rapid technological revolution and rapid development in the technical age. Technological revolution have active role to the increase of computer information. Raise the level of knowledge abilities, and skills. Increase developments in science and technology. Computer networks are considered one of the important elements that broke all barriers and develop many communication systems. Therefore, high speed routing has become more important in a process transferring packets from source node to destination node with minimum cost. Cost factors may be representing the distance of a router. The simplest link-weight strategy is to give each link a cost of 1; link costs can also be based on bandwidth, propagation delay, financial cost, or administrative preference value. Routing is the act of moving information across an internetwork from a source to a destination [3]. There are two main concepts of the routing: routing protocols and routing algorithms. The protocol defines rules and conventions for communication between network devices. Protocols for computer networking generally use packet switching techniques to send and receive messages in the form of packets. While algorithm is a procedure or formula for solve problem. Algorithm usually means a small procedure that solves a recurrent problem.

Routing protocols
Create to response to the demand for dynamic routing tables. A routing protocol is a combination of rules and procedures that allow routers in the internet deal with each other and adapt with changes [5]. The purpose of any routing protocol is a dynamically communicate information about all network paths used to reach to destination network. Routing protocols is determine the path that the packet are to follow when the packet transmitting from a source node to distention node. Routing protocols can be either an interior protocol or an exterior protocol. An interior protocol handles intra domain routing [8,9]. We discuss two intra-domain routing protocols: distance vector protocol and link state protocol.

Distance Vector Protocol (DVP):
Is designed in 1969 [3]. DVP uses the Bellman-Ford algorithm (also called Ford-Fulkerson) to calculate paths [3]. In DVA, needs to build table for each node to keep a distance vector to all other nodes. Which each node knows the distance of the link to each of its directly connected neighbors. DVP requires that a node informs its neighbors of topology changes periodically. When any change in the topology of a network is detected, must be a router to inform all the nodes in this change. When each node needs to transmit packet information to some destination, it needs transmit packet to the next hop node based on the best shortest path to the destination. Each router should keep at least three pieces of information for each route: destination network, the distance, and the next hop. Consist of the better path usable to pass to the destination and the next hop in the path. The better path can change based on administrative policies like shortest path or lowest cost path [3]. Routing Information Protocol (RIP) is the implementation of the distance vector protocol.

Link State Protocol (LSP):
Link-state routing is an alternative to DVP. In LSA, each node must have whole information about other nodes in the network. It stores information around each topology at every node. It computes the route from the source to the destination at the center. While, in DVA all nodes have information about neighboring nodes only. It computes the route on distributed mode [3]. Which each node keeps real picture of the network topology with a distance for each link. When any change occurs in each node, the node is broadcast the local case to every other node in the network. This broadcast process is called flooding, which link-state packets (LSPs) that flood the network. LSP does not distribute any routes, but exchange topology information that describes the network. Open Shortest Path First (OSPF) is the implementation of the link state protocol. The difference between DVP and LSP are: DVP based routers exchange their routing table on a periodic basis, while LSP based routers exchange only routing table updates. DVP is established path on a distributed version of the classical bellman-ford algorithm. While LSP, A node can then make the chart of the network and can compute path from itself to each other node independently [3].

Routing algorithm
Is that part of the network layer software responsible for deciding which output line an incoming packet should be transmitted on [8]. Routing algorithm that determines the best path for a packet is the heart of any routing protocol. Each algorithm has a different impact on network and router resources. In summary, the routing algorithm is performing tasks according of the routing protocol rules. Routing algorithm can be divided into two main classes: non-adaptive and adaptive algorithms.

Non-adaptive algorithms
Do not dependent on any measurements or estimates of the current topology and traffic for routing decisions. Its choice of the route to use to get from I to J (for all I and J) is computed in advance, offline, and downloaded to the routers when the network is booted [8]. When there is a change in the network or a failure occurs between two nodes, traffic will not be rerouted and does not respond for this change. These procedures sometimes called static routing algorithms. Static routing is often useful for situations in which the routing choice is clearly. M a y 2 9 , 2 0 1 5

Adaptive algorithm
In contrast, any changes in the topology of network to reflect changes in routing decisions, and sometimes changes in the traffic [8]. These procedures called Dynamic routing algorithms. Dynamic routing adapts well to changes in network topology, such as node failures and network expansion.

SHORTEST PATH ALGORITHMS (SPA)
The shortest path finding algorithms are used to find the minimum weighted or most efficient path in the network. The shortest paths from all vertices in the graph to a single destination vertex is called single shortest path problem. The shortest path between every pair of vertices is called all pairs shortest path problem. There are many algorithms for computing the shortest path such as: Dijkstra's algorithm, Floyd-Warshall algorithm, Bellman Ford Algorithm, and Johnson's algorithm. This paper used these shortest path algorithms for finding shortest path between source node and destination node. This paper is analysis for the results from algorithms, and compare between them. Find the best algorithm according to the time efficiency and number of nodes.

Dijkstra's algorithm:
Conceived by Dutch computer scientist Edsger Dijkstra in 1956 and published in 1959 [5,6]. Dijkstra's algorithm is used in search graph algorithm for solve the single-source shortest path problem for a weighted graph with non-negative edge path costs, producing a shortest path tree [1]. This algorithm is often used in routing and as a subroutine in other graph algorithms. The Dijkstra's Algorithm finds the shortest path between two nodes on a network by use the greedy strategy where an algorithm that always takes the best immediate solution when finding an answer. Greedy algorithms find the overall optimal solution for some optimization problems, but may find less-than-optimal solutions for some instances of other problems. In Dijkstra's algorithm firstly, no path is known. Dijkstra's algorithm divides the nodes into two subset groups: temporary set (t) and permanently set (p). Then this algorithm assigns the zero distance value to source node s, and label it as permanent [The state of node s is (0, p)], and Assign to the remaining nodes a distance value of (∞) and label them as temporary. [The state of every other node is (∞, t)]. At each iteration, updates its distance label, and puts the node into a permanently set as permanently labeled nodes p. The permanently labeled distance associated with each examined node is the shortest path distance from the source node to the destination node. The source node is node s and neighbor's nodes are v. At each iteration, the node s is selected and marked, then update distance and label for each node. Selected nodes neighbors for node s and update distance values for these node v by formula the following.
During the above formula, If the labeled distance of node u plus the weight of link (s, v) is shorter than the labeled distance of node v, then the estimated shortest distance from the source node to node v is updated with a value equal to . The algorithm continues the node examination process and takes the next node as source node [2]. The algorithm terminates when is reached to the destination. This is process is clearly in a Figure1.
The computational complexity of the implementation of the Dijkstra's algorithm big-O notation is where n = number of vertices [13]. Big-O notation is frequently used in the computer science and mathematics domain to describe an upper bound on the growth rate of the algorithm [4].

Bellman-ford algorithm
Is an algorithm that computes shortest paths from a single source node to all of the other nodes in a weighted graph. It was conceived by two developers Richard Bellman and Lester Ford. Who published it in 1958 and 1956, respectively; however, Edward F. Moore also published the same algorithm in 1957, and for this reason it is also sometimes called the Bellman-Ford-Moore algorithm. [6]. Bellman-Ford algorithm solves the single-source problem where some of the edge weights may be negative [6]. Dijkstra's algorithm cannot be used to solve the graphs with negative edge weights. The Bellman-Ford Algorithm finds the shortest path between two nodes on a network. This algorithm returns a boolean value representing whether or not there is a negative weight cycle that is reachable from the source, If there is no such a cycle ,the algorithm returns the shortest path, if there is negative cycle then the algorithms tells that no shortest path. A solution exist the Bellman-Ford algorithm can detect negative cycles and report their existence. The algorithm reducing an estimate d(v) on the weight of a shortest path from the source S to each vertex v ∈ V until it obtains the best the shortest path weight. The algorithm returns true if and only when the graph contains no negative weight cycles that are reachable from the source [7]. The bellman-Ford algorithm is executed in the simple example for 6 nodes as shown in figure 2. In step 1, Bellman-ford algorithm assigns every vertex distance to infinity, except the source vertex that gets distance 0. The step 2 relax each edge for (n − 1) times where n are the number of nodes . Relaxing an edge means checking to see if the path to the node to which the edge is pointing can be shortened, and if so, replace the path to the node with the found path [7]. Relax the edge with only 2 nodes starting from the source node, the E(1,2) of cost 7, the cost of the source node plus 7 is less than infinity. So, we replace the M a y 2 9 , 2 0 1 5

Figure 1. Dijkstra's algorithm
cost of the node 2 d(2)= 7. As well the E(1,6) of cost 6 which is also less than infinity, then d(6)=6 As figure 3. So relax edges for 5 times since n is 6. The step 3, consider the path with 3 nodes and relax the edge E(1,3) through 1→2→3, relax E(1,4) through 1→2→4 or 1→6→4 etc. The step 4, consider the path with 4 nodes. Thus, the process will continue. Hence, the final step gives the shortest path between each node and the source node. Thus all edges are relaxed, checked the negative cost cycle, and the appropriate boolean value is returned. Hence it is called the singlesource shortest path algorithm.

Floyd-Warshall algorithm
Is an algorithm using to computing of the shortest paths between all pairs of vertices in a weighted graph with positive or negative edge weights . The Floyd-Warshall algorithm also known as Floyd's algorithm, Roy-Warshall algorithm, Roy-Floyd algorithm, or the WFI algorithm [1]. The Floyd-Warshall algorithm was published in its currently recognized form by Robert Floyd in 1962 [1]. Floyd-Warshall algorithm uses a matrix (n*n) of lengths as its input. This matrix represents lengths of all paths between nodes that do not contain any intermediate node is called distance matrix . If there is an edge between nodes i and j, than the matrix contains its length at the matrix. The diagonal of the matrix contains only zeros. If there is no edge between edges i and j, than the position (i,j) contains positive infinity [2]. This matrix recalculate at every M a y 2 9 , 2 0 1 5 Bellman-Ford runs in time, where V and E are the number of vertices and edges respectively [10].
iteration of the Floyd-Warshall algorithm. So, it's keep track of the shortest path between any two vertices, using only some subset of the entire collection of vertices as intermediate steps along the path. The matrix , which is created by the first iteration of the procedure, contains paths among all nodes using exactly one (predefined) intermediate node.
Contain lengths using two predefined intermediate nodes. Finally the matrix uses n intermediate nodes. This process can be described using the following recurrent formula [2]: The above formula is the heart of the Floyd-Warshall algorithm. The algorithm works by first computing shortest path (i, j, k) for all (i, j) pairs for k = 1, then k = 2, etc. This process continues until k = n, Then find the shortest path for all (i, j) pairs using any intermediate vertices. The pseudocode as shown in algorithm 2:

Algorithm 2. Floyd-Warshall algorithm[2].
In order to return shortest paths among all pairs of nodes, must build another matrix during work of matrix , this matrix is called Sequences matrix( P). In firstly must built initial matrix (n*n) is called A, which that columns equal i. For example, in column 1 all the rows are equal 1, column 2 all the rows are equal 2 etc, and the diagonal of the matrix contains only zeros. The matrix P, initially is equal for matrix A. Update P matrix as algorithm 2. Can be read P matrix as follows: if we want to reconstruct the SP between nodes i and j, we look at the element . If its value is 0, than there is no path between these nodes. Otherwise, the value of the element in of j on the path from i to j. So we repeat this procedure, while the preceding node is not equal to i as Algorithm 2.1. The Floyd-Warshall algorithm runs in where N is number of nodes of the graph [4]. M a y 2 9 , 2 0 1 5