COMPARATIVE ANALYSIS OF MANHATTAN AND EUCLIDEAN DISTANCE METRICS USING A* ALGORITHM

A* algorithm is mostly used to find the shortest path searching for Grid and map based path like road and rail network. A* algorithm generally find the path using Heuristic technique. The main idea behind the A* find the shortest path is the calculating the path (start to destination) very fast. The main work of this paper is that study of two distance metrics viz. Euclidean and Manhattan. We can perform some those metrics experiments in A* algorithm to validate the study. The result is show the comparative analysis of those metrics.


Introduction
In artificial intelligence problem is solved in two steps. In first steps, problem is represented by state space search tree format with the help of problem description attributes like initial state, goat state, operators etc. In Second steps, optimal solution is searched to reach the goal, will be discussed in this chapter in sufficient details. Heuristic function is used to solve complex problem and working of this function will also be addressed. [1].
Searching path from a given or presented road networks from a source location to destination place is day to day problem for everyone. Tourists as well as general public are facing this type of problem every day. There are number of application available in market that needs to solve a huge number of such route queries. Current commercial solutions usually are slow or inaccurate [2].
Heuristic search: A heuristic is a technique to solve a problem where goal state is fully or partially known to the user with initial state. Heuristics play a major role in solving complex problem with optimality as well as completeness. Heuristic algorithm helps to reduce the number of alternatives from an exponential number to polynomial number. Application areas of heuristic search algorithm are decision making, planning, searching shortest path etc. [3]. f (n) is the sum of g(n) and h(n) (1)

Distance metrics overview
Euclidean distance is calculated by using following formula [4]. For example let X1,Y1 is coordinates of X while X2,Y2 is coordinates of Y then distance between X & Y is given by: Similarly Manhattan distance calculation between X and Y is given by.
It computes the absolute difference between coordinates of the two objects [4].

A * Algorithm
The A* algorithm is combination of uniform-cost search and greedy search algorithm. Implementation of A* algorithm is just like Best-first search algorithm except the cost estimation process i.e. f(n) = g(n) + h(n), where g(n) is the actual cost from initial state to current state and h(n) is the estimates cost from current state to a goal state [5]. That is why f(n) is minimum distance path of any solution path going through node n. At each and every step lowest f (n) is chosen for node n. The algorithm terminates when a goal states found. If h(n) is less then g(n) then A* provides best solution. The performance of A* similar to Dijkstra algorithm if h(n)=0[6].

Experimental Work
In this section, we conduct a experiment to find the shortest path in A* algorithm between two points. The calculation of shortest path done by Euclidean and Manhattan distance. In this we can calculate the Time and number of operation is perform to calculate those distance metrics and find which distance metrics is best for calculation the fast shortest path.

Result Analyses
Searching time is calculated for three cases as shown in table 1 (Comparative analysis of Manhattan and Euclidean distance) as well as figure (fig no.) .case 1 case 2 and case 3 have path length of 25, 34 and 48 respectively. Where: Length =Total number of minimum f value grid Time = End time -Start time As per experimental analysis based on execution time, A* using Manhattan distance is better than the Euclidean distance.

Conclusions
Manhattan distance metrics performs better than the Euclidean distance metrics in A* algorithm. The main reason of better performance of Manhattan distance is fast calculation of the all parameters as well as generation of fast shortest path.