المجلة العراقية للعلوم الاحصائية (Dec 2010)

A Computer Algorithm to Solve the Issue of the Shortest Path

DOI
https://doi.org/10.33899/iqjoss.2010.28414
Journal volume & issue
Vol. 10, no. 2
pp. 51 – 68

Abstract

Read online

This research aims to finding the shortest path between two Centers S and T which are connected by a network of roads of certain length and certain material or time costs, (as the word Centre could be cities or storage depots or production centers or centers of import and export) by using the new proposed programmable algorithm which depends on converting the road network, to the matrix in which number of columns and rows is equal to the number of the arcs of the under-study network (What ever the size of the road network of the studied problem is), and its elements are: either (1) which means that there is an arc connecting the two centers, or (0) which means that there is no arc connecting the two centers, and then processing this matrix in three basic stages: First: the stage of identifying the number of paths in the network: by counting the number of elements that are equal to (1) in the first row of the matrix, which represents the initial number of tracks, then moving to the following lines and counting the number of elements that is equal to (1) if they are more than one we will have other paths their number is equal to the initial number of elements that is equal to (1) minus one, and add this number to the number of tracks, and so on. Second: the stage of limiting the number of arcs, which is embedded in each path by identifying the number of the line and column of the elements that are equal to (1). Third: The stage of counting the lengths of the paths according to the arcs embedded in each path and comparing them to determine the shortest one.