Academia.eduAcademia.edu

Monte Carlo based Algorithm for Scoring Grid Systems

2020

We evaluate Monte Carlo-Dijkstra algorithm for scoring grid systems. The former were used to describe features of the area under study. This was done to select suitable features for City Information Modelling. These algorithms measures path of shortest distance. However, shortest distance does not always ensures shortest time. The algorithm works by pairing multiple iterations of two random numbers in a polygon. The mean of shortest path between these points is calculated. Thus grid systems with shorter paths will return a lower value as compared to grid systems with longer paths.

Engr. Faisal Rehman [email protected] Syed Haseeb Shah Department of Civil Engineering University of Engineering & Technology, Peshawar Engr. Irfan Ahmad 1 [email protected] Monte Carlo based Algorithm for Scoring Grid Systems Abstract—We evaluate Monte Carlo-Dijkstra algorithm for scoring grid systems. The former were used to describe features of the area under study. This was done to select suitable features for City Information Modelling. These algorithms measures path of shortest distance. However, shortest distance does not always ensures shortest time. The algorithm works by pairing multiple iterations of two random numbers in a polygon. The mean of shortest path between these points is calculated. Thus grid systems with shorter paths will return a lower value as compared to grid systems with longer paths. 13 14 15 16 17 18 19 20 21 22 23 u ← vertex in Q with min dist[u] remove u from Q // only v that are still in Q for each neighbor v of u: alt ← dist[u] + length(u, v) if alt < dist[v]: dist[v] ← alt prev[v] ← u return dist[], prev[] To use the algorithm in processing toolbox paste the following code in Python shell of QGIS. Index Terms—Urban Planning, Grid Scoring INTRODUCTION T his paper defines a new feature for city information modelling by measuring the average length of N randomly generated paths in a grid system. A grid system with mostly longer paths would have a greater normalized local score (NLS). For benchmark, the algorithm was applied to different street systems namely gridiron, loose grid and radial grid. Monte Carlo method, Dijkstra algorithm were utilized for the task. It was found that radial grid systems are the best in comparison to loose grid and grid iron. Grid iron scored the worst because of shorter paths that are not allowed to move along diagonally. A. Random Points Generation: After specifying polygonal boundary of a city, 1000~5000 random points (latitudes and longitudes) were generated inside the polygon. These points were paired at randomly in the form [(lat, long), (lat, long)]. B. Dijkstra Algorithm: The shortest path between the algorithms was calculated using the processing toolbox. Dijkstra algorithm (Mehlhorn & Sanders, 2008) finds the shortest path between nodes of graph that have positive cost value. Pseudocode of the algorithms is as under; 1 function Dijkstra(Graph, source): 2 3 create vertex set Q 4 5 for each vertex v in Graph: 6 dist[v] ← INFINITY 7 prev[v] ← UNDEFINED 8 add v to Q 10 dist[source] ← 0 11 12 while Q is not empty: def shortest_path(a, b, c, d): res = processing.run( "native:shortestpathpointtopoint", {'INPUT':'<path_to_file>.geojson|layernam e=NewOrleans', 'STRATEGY':0,'DIRECTION_FIELD':None, 'VALUE_FORWARD':'','VALUE_BACKWARD':'', 'VALUE_BOTH':'','DEFAULT_DIRECTION':2, 'SPEED_FIELD':None,'DEFAULT_SPEED':50, 'TOLERANCE':0, 'START_POINT':'{},{}'.format(a,b) + ' [EPSG:4326]', 'END_POINT':'{},{}'.format(c,d) [EPSG:4326]', + ' 'OUTPUT':'TEMPORARY_OUTPUT'} ) Where (a, c), (b, d) are longitude and latitude of the two points. Engr. Faisal Rehman [email protected] Syed Haseeb Shah Department of Civil Engineering University of Engineering & Technology, Peshawar Engr. Irfan Ahmad 2 [email protected] C. Monte Carlo-Dijkstra algorithm: Flowchart of Monte Carlo algorithm coupled with Dijkstra algorithm was used to score the grid systems. Figure 1: Shakirabad Peshawar Pakistan Shakirabad, Peshawar Iteration 1 2 3 4 5 6 7 8 9 10 Points 229 232 228 231 231 4528 4563 2218 2238 2229 Normalized Local Score 0.290 0.339 0.331 0.306 0.300 0.298 0.284 0.270 0.298 0.282 Mean NLS: 0.300* Grid Iron: Grid Iron allow paths along the rectangular axis. Diagonal path, which is the shortest between two corners of a rectangle is not allowed so the algorithm has to travel along the horizontal and vertical paths. The sum of lengths is obviously larger than the length of diagonal path. It’s the primary reason why the NLS of grid iron is high. D. Results: Loose Grid: Loose grids have inclined roads as well as rectangular roads. This means that there exist a set points in the grid where diagonal path is allowed between two points. The path does not have to travel along rectangular grid therefor they have lower score in comparison to grid iron. Engr. Faisal Rehman [email protected] Syed Haseeb Shah Department of Civil Engineering University of Engineering & Technology, Peshawar Engr. Irfan Ahmad 3 [email protected] Central New Orleans, US Iteration Points Normalized Local Score 1 2 3 4 2215 2236 2236 2245 0.372 0.375 0.347 0.366 Figure 2: Phase 6 Hayatabad Pakistan Phase 6, Peshawar Iteration 1 2 3 4 5 6 7 8 9 10 Mean NLS: 0.433* Points 200 200 500 499 2498 2499 2499 2499 2497 2499 Normalized Local Score 0.447 0.437 0.449 0.456 0.423 0.436 0.403 0.438 0.427 0.415 Figure 3: Central New Orleans, USA Mean NLS: 0.366* CONCLUSION NLS is a measure of the distance between two nodes of a road network. Closer nodes have lower NLS values. Therefore a grid system have lower NLS value would have on average shorter paths from any location on the grid to another. The reason for introduction of this algorithm is to automate the scoring of grids for city planners. Instead of measuring individual polygons or curves in grid system this algorithm provides a heuristic approach for scoring grids. REFERENCES [1] E. Radial Grid: The geometry of radial grid is such that it utilizes the benefits of equidistant paths from grid iron and shortest diagonal paths due to rotation of local grid irons. It is composed of multiple grid irons inclined to each other in a way that they all point to the center of the city. The inclination of grid iron provides a shorter path between different grid irons. [2] [3] [4] [5] [6] [7] [8] Mehlhorn Kurt, Sanders Peter, Algorithms and Data Structures: The Basic Toolbox, Springer, 2008 Lawhead Joel, 2015. QGIS Python Programming Cookbook, ISBN 9781-78398-498-5 Zhang Z., Jigang W. and Duan X., 2010, Practical algorithm for shortest path on transportation network. International conference on computer and information application, 978-1-4244. Borch, C., and Kornberger, M. (eds.). (2015). Urban Commons: Rethinking the City. New York, NY: Routledge. Catalina Turcu (2013) Re-thinking sustainability indicators: local perspectives of urban sustainability, Journal of Environmental Planning and Management, 56:5, 695-719 Goldstein, N., Dietzel, C., Clarke, K.: Don’t Stop ‘Til You Get Enough Sensitivity Testing Of Monte Carlo Iterations For Model Calibration. In: Proceedings, 8th International Conference on GeoComputation, University of Michigan, Eastern Michigan University (2005) Berry, B.J.L., Marble, D.F.: Spatial analysis, a reader in statistical geography. Prentice-Hall, Englewood Cliffs (1968) Geertman, S., Stillwell, J., and Toppen, F. (eds.). (2013). Section-2, Planning Support Systems for Sustainable Urban Development. Berlin: Springer.