International Conference Mathematical and Computational Biology 2011 International Journal of Modern Physics: Conference Series Vol. 9 (2012) 488–494 World Scientific Publishing Company DOI: 10.1142/S2010194512005570
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
SHORTEST PATH TECHNIQUE FOR SWITCHING IN A MESH NETWORK WAN NOR MUNIRAH ARIFFIN Institute for Engineering Mathematics, Universiti Malaysia Perlis, Jalan Serawak, 02000 Kuala Perlis, Perlis, Malaysia
[email protected] SHAZALINA MAT ZIN Institute for Engineering Mathematics, Universiti Malaysia Perlis, Jalan Serawak, 02000 Kuala Perlis, Perlis, Malaysia
[email protected] SHAHARUDDIN SALLEH Mathematics Department, Faculty of Science, Universiti Teknologi Malaysia, 81310 Skudai, Johor, Malaysia
[email protected]
Switching is a technique to route data and instructions between pairs of source-destination nodes or among multiple nodes for broadcast communication. We realized that the shortest path problem has a wide application in the design of networks. Therefore, in this paper, we present a mesh network as our switching mechanism for computing the shortest path between the source and destination in our simulation model, developed using C++ on the Windows environment. The Floyd-Warshall algorithm is applied in finding the shortest path in all-pairs nodes. Keywords: Shortest path; Floyd-Warshall algorithm; C++ programming.
1. Introduction Switching often is at the heart of a test system and may adversely affect signal integrity if not correctly designed. Different types of switches are needed depending on the application being address. Switching also can be defined as a process moving data from one interface and delivering it through another interface, selecting the best paths between machines that store messages. In a telecommunications network, a switch is actually a device that channels incoming data from any of multiple input ports to the specific output port that will take the data toward its intended destination.1 The purpose of switching is to provide interconnection between all the nodes on a network without the need for single connections between each pair of nodes. Therefore, we require switching technology that provides a mechanism to establish connectivity as and when required.2
488
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
Shortest Path Technique for Switching in a Mesh Network
489
We realized that the shortest path problem has a wide application in the design of networks. As communication between processors may incur some significant delays in the execution of tasks, finding the shortest path between them definitely contributes to reducing the cost. There are many algorithms in order to find the shortest path between two destinations such as Dijkstra’s algorithm, Bellman-Ford algorithm, Johnson’s algorithm and Floyd-Warshall algorithm. This paper involves the application of graph theory methods in finding the shortest path using switching. Therefore, switching and shortest path technique binds together throughout this paper. The Floyd-Warshall algorithm is applied in finding the shortest path in all-pairs nodes through switching in formulating our simulation model. The rest of this paper is organized as follows: Section 2 describes the switching that is mesh network and discusses the shortest path problem as well as the Floyd-Warshall algorithm. Section 3 shows the simulation model which is developed using C++ on the Windows environment. Section 4 gives concluding remarks.
2. Mesh Path Problem 2.1. Mesh network In a mesh network, the nodes are arranged into a q-dimensional lattice. Communication is allowed only between neighbouring nodes where the interior nodes communicate with 2q other processors. Figure 1 below illustrates a two dimensional (2-D) mesh with no wraparound connections.
Fig. 1. 2D mesh of width 4 with no wraparound connections on edge or corner nodes.
490
W. N. M. Ariffin, S. M. Zin and S. Salleh
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
Computing the shortest paths between all pairs of processors is a necessity in a mesh network to allow active data movement in the network. A path is defined as the route from the source node to its destination node. As we have mentioned earlier, as communication between processors may incur some insignificant delays in the execution of the tasks, therefore, finding the shortest path between them definitely contributes to reducing the cost.
2.2. Shortest path problem roblem The shortest path problem can be stated as follows: Given a weighted graph, find the minimal cost linking a pair of nodes in the graph.4 In this paper, we state our problem as, given g m nodes as the source and n nodes as the destination (sink). The problem in this study is to assign each node in the the source to a node in the destination through switching. The switch switch is made of rectangular mesh which is shown in Figure 2.. The nodes in the first column denote the source while the nodes in the last column represent the destination. The intermediate nodes are the switching.
SOURCE
SWITCHING
DESTINATION
Fig. 2. The sketch of the shortest path through rectangular mesh switching.
The technique of computing the all-pairs all pairs shortest paths using the Floyd-Warshall Floyd algorithm is applied to compute the shortest path between the two nodes from the source to the destination.
2.2.1.
Floyd-Warshall Warshall algorithm
The Floyd-Warshall Warshall algorithm sometimes known as Roy-Floyd Roy Floyd computes the all-pairs all shortest path problem on weighted weighted and directed graphs with a running time complexity of
Shortest Path Technique for Switching in a Mesh Network
491
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
O(N3), where N is the number of nodes in our graph. The weight of a link between the nodes vi and vj is denoted wij. So, how does this algorithm works? First, in order to compute the shortest path, wij between vi and vj , for i = 1,2,3,…,N and j = 1,2,3,…,N, must be given. If the link between vi and vj does not exist, then the weight is set to be ∞. This weight is assigned to wijmin as the initial minimal distance between vi and vj. This algorithm assumes that the links in the graph to have nonnegative weights and nonnegative cycles.
; i= j 0 wij = w(i , j ) ; i ≠ j and (i , j ) ∉ E ∞ ; i ≠ j and (i, j ) ∈ E The Floyd-Warshall algorithm starts by finding all the minimal distances between the pairs of nodes without passing through any intermediate nodes. These values are recorded in a minimal distance table. The rule is then relaxed by allowing one node to be the only intermediate node, starting with v0. We set aijk as the shortest distance from vi to vj using only the nodes v0, v1,…, vk as the intermediate nodes. With ak as the intermediate node, the minimal distance is aijk. The minimal distances between the pairs of nodes are determined by comparing the previous values with the present ones. New updates are again recorded in the minimal distance table. This is followed by v1, v2, and so on until the last node, vN. The process repeats with two nodes and so on, using the earlier result for comparison. We consider an example as in Figure 1, but now each of the edge has its own value (weighted arc). We simplify our explanation by giving this simple example as shown in Figure 3 below.
Fig. 3. Illustration of shortest path between two nodes.
492
W. N. M. Ariffin, S. M. Zin and S. Salleh
From the Figure 3, we wish to find the shortest path between the two nodes which represented by the black nodes. The black node in the left is the source node while the right node is the destination. In order to find the shortest path between them, the FloydWarshall algorithm is applied.
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
3.
Simulation Model
In this section, we represent our simulation model that has been developed to simulate the shortest path in a mesh computing network. The technique of computing the all-pairs shortest paths using the Floyd-Warshall algorithm is applied to this simulation model.
3.1. Model description Our visualization model, simulates the standard mesh network on a 5 x 10 topology having 50 processors, as shown in Figure 4. The processors are numbered starting from the leftmost in the top row. To use this simulation model, the users need to click on the mouse’s left button on the two nodes which come from the source and the destination column. After clicking the source and destination node, user needs to click the ‘compute button’ in order to allow the program draw the shortest path. The intermediate nodes represent our switching, while the links represent the hops. The weights of the hops are integer numbers generated randomly from the clock cycles in the computer.5 The communication between the processors from the source to the destination must be going through the switching. The switches will connect the source and the destination nodes with the most minimum amount or value of hops. The shortest path between the source and the destination nodes in the model is obtained by clicking the nodes consecutively using the left button of the mouse. The path is shown as a thick line from the source to the destination. The program can only work if the user clicks at the correct nodes. The first click must be any nodes at the first column, defined as our source node, while the second click must be any nodes which come from the last column namely destination. If the user clicks at the intermediate nodes, nothing will be happen. The program does not allow the click on ‘switches’. The communication model in the mesh network modeled here is in its simplest form. Factors like the initial startup cost, the transmission rate, and the physical media of links are not considered in evaluating the communication cost involving shortest paths.
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
Shortest Path Technique for Switching in a Mesh Network
493
Fig. 4. The model of computing shortest path through switching.
Figure 4 above shows the shortest path between a pair of nodes through switching, which is made of 5 x 10 rectangular mesh networks. For example, the bold line shows the shortest path between node 1 and 30, passing through node 11, 12, 13, 14, 15, 16, 17, 27, 28 and 29 with the total cost is 42. This program allows up to eight shortest paths to be drawn by repeating the rule of clicking the source and the destination nodes consecutively using the left button of the mouse. The paths are drawn as thick lines using eight randomly determined colors, to differentiate one from another. Each time the shortest path is drawn, the visited nodes are also listed in the text area.
4.
Conclusion and Recommendation
Switches can be valuable asset to networking. Switching is a process of moving data from one interface and delivering it through another interface, selecting the best paths between machines that store messages. In this paper, we use the shortest path technique to find the shortest path between a pair of nodes where the path must go through switching arranged in a rectangular array. The simulation model which was developed for this purpose has a few weaknesses. It is not user friendly. This program does not allow user to key in the number of nodes which represent the Source, the Destination as well as the switching. As a conclusion, this simulation is still in a small scale and need effort to improve it. This simulation model is just to show the “beautiful” of mathematics and Visual C++ programming in computing the shortest path through switching. We will look into few real applications for our next coming papers.
494
W. N. M. Ariffin, S. M. Zin and S. Salleh
Int. J. Mod. Phys. Conf. Ser. 2012.09:488-494. Downloaded from www.worldscientific.com by 183.171.164.112 on 07/07/14. For personal use only.
References 1. J. Lum, The Importance of Switching, EE-Evaluation Engineering, (2001). 2. J.M.Quinn, Parallel Computing: Theory and Practice, (McGraw-Hill, Inc., United State of America). 3. Z. Ilia, SiC Schottky Diodes Improve Boost Converter Performance, Power Electronic Technology Magazine, (2003). 4. S. Salleh, et al., Numerical Simulations and Case Studies using Visual C++. Net, (John Wiley & Sons, Inc. New Jersey). 5. W.N.M. Ariffin, S. Salleh, Shortest Path Technique for Swithing in Mesh Networks, (UTM, Skudai, 2007).