5
An Application of the A* Algorithm on the Ambulance Routing *Noraimi Azlin Mohd Nordin, *Norhidayah Kadir, *Zati Aqmar Zaharudin and *Nor Amalina Nordin *Department of Mathematics, Faculty of Computer and Mathematical Sciences, Universiti Teknologi MARA (UiTM), 40450 Shah Alam, Selangor, Malaysia. [email protected], [email protected], [email protected], [email protected] Abstract - EMS ambulance is designed to provide medical care or treatments to patient at the emergency site. If intensive care is needed, the patient will be send to the nearest hospital. Quick response and comprehensive care is vital in this case. In order to ensure the ambulance can arrive to incident site within the targeted time, ambulance availability must be ensured and the time taken to arrive must be controlled. Therefore, this paper describes the application of A* Algorithm and road network as parts of the development for the ambulance routing system. Methods mention is used in finding the shortest distance for the ambulances located at Klinik Kesihatan Shah Alam (KKSA) to the emergency sites. Based on the results obtained, we can say that routes that satisfy the 10 minutes response time has been generated by the algorithm for the EMS ambulances. It is always a preferable if ambulances can arrive at the incident faster as many lives can be saved. Keywords - EMS ambulances; shortest distance; mathematical model; A* algorithm; road network I. INTRODUCTION The Emergency Medical Services (EMS) ambulance is designed to give medical care or treatments to patient at the emergency sites and/or directly send the patients to hospital where intensive care by doctors can be given [1]. The EMS ambulance provided is equipped with basic life support equipment to help whenever an emergency occurs. Following protocols and guidelines, EMS provides emergency care and ambulance to the patients and involves with patients life or death. Moreover, EMS also provides non- emergency standby duties with minimal charges, for instance, the festivals, sports, motor racing, national and international conference, duties during aircraft emergency landings or crashes and transfer of patients from a hospitals to other hospital. In Malaysia, 999 can be used to summon assistance from the three main emergency services, the police, fire brigade and ambulance. This emergency number has been activated since October 2007, as reported by The Star on 1 October 2007 [2]. On calling 999, the operator will extend the call to the service required by the caller. For instance, the caller will be connected to the ambulance service for a road traffic accident. In order, to ensure the ambulance can arrive to patient within the target time, ambulance availability must be ensured and the time taken to arrive must be controlled. Thus, in order to help improving ambulance system, efficient ambulances’ management and system is required to increase the standard of EMS in Malaysia. EMS efficiency can be measured in many ways. The most important way of looking at this system is by examining the whole process of EMS episode [3]. Due to few challenges face by ambulance service in KKSA, we tried to reduce the problem by developing ambulance routing system. The main problem in Shah Alam is the hectic situation during peak hour, where most vehicles are trapped and gradually move. The peak hours identified is from 7 a.m. to 10 a.m., from 12 p.m. to 2 p.m., and from 4 p.m. and above. This is the time where people busy to go to school or work, lunch and go back home, respectively. Shah Alam with commercial centres occupying many parts of the city, and also education institution scattered around different Seksyen – to name a few, has contribute to traffic congestion. This is not the only constraints that ambulances face. There are also traffic light, toll and roundabout. Generally, the road in Shah Alam is a one way lane. Thus, if the ambulance has taken the wrong road, they will results in late of arrival at the emergency sites. This paper only focuses on the application of A* algorithm in finding the shortest distance of the ambulances. Details on the results and findings of the model developed are to be discussed on the next paper. In this paper, the shortest distance for ambulances for the area serviced by ambulance located at the KKSA is projected by using A* Algorithm and road network for ambulance routing system. The objectives of this project are to develop an ambulance road network in 5 kilometers for the area under study and to apply a suitable mathematical model to minimize ambulance travelling distance. II. LITERATURE REVIEW Response time is the main concern in ambulance service. Many studies of ambulance response time in many countries had shown that ambulance response time are important in measuring a quality of EMS system, such as [4] in United Kingdom, [5] in Singapore, [6] in Norway and [7] in London. Shortest distance for ambulance is an alternative for ambulance management to have better response time. The application of algorithms in finding the shortest distance with the quickest response time is one of the well-known methods. 2011 IEEE Colloquium on Humanities, Science and Engineering Research (CHUSER 2011), Dec 5-6 2011, Penang 978-1-4673-0020-9/11/$26.00 ©2011 IEEE 855

[IEEE 2011 IEEE Colloquium on Humanities, Science and Engineering (CHUSER) - Penang, Malaysia (2011.12.5-2011.12.6)] 2011 IEEE Colloquium on Humanities, Science and Engineering - An

Embed Size (px)

Citation preview

An Application of the A* Algorithm on the Ambulance Routing

*Noraimi Azlin Mohd Nordin, *Norhidayah Kadir, *Zati Aqmar Zaharudin and *Nor Amalina Nordin *Department of Mathematics, Faculty of Computer and Mathematical Sciences, Universiti Teknologi

MARA (UiTM), 40450 Shah Alam, Selangor, Malaysia. [email protected], [email protected], [email protected],

[email protected] Abstract - EMS ambulance is designed to provide medical care or treatments to patient at the emergency site. If intensive care is needed, the patient will be send to the nearest hospital. Quick response and comprehensive care is vital in this case. In order to ensure the ambulance can arrive to incident site within the targeted time, ambulance availability must be ensured and the time taken to arrive must be controlled. Therefore, this paper describes the application of A* Algorithm and road network as parts of the development for the ambulance routing system. Methods mention is used in finding the shortest distance for the ambulances located at Klinik Kesihatan Shah Alam (KKSA) to the emergency sites. Based on the results obtained, we can say that routes that satisfy the 10 minutes response time has been generated by the algorithm for the EMS ambulances. It is always a preferable if ambulances can arrive at the incident faster as many lives can be saved.

Keywords - EMS ambulances; shortest distance; mathematical model; A* algorithm; road network

I. INTRODUCTION The Emergency Medical Services (EMS) ambulance is

designed to give medical care or treatments to patient at the emergency sites and/or directly send the patients to hospital where intensive care by doctors can be given [1]. The EMS ambulance provided is equipped with basic life support equipment to help whenever an emergency occurs.

Following protocols and guidelines, EMS provides emergency care and ambulance to the patients and involves with patients life or death. Moreover, EMS also provides non-emergency standby duties with minimal charges, for instance, the festivals, sports, motor racing, national and international conference, duties during aircraft emergency landings or crashes and transfer of patients from a hospitals to other hospital.

In Malaysia, 999 can be used to summon assistance from the three main emergency services, the police, fire brigade and ambulance. This emergency number has been activated since October 2007, as reported by The Star on 1 October 2007 [2]. On calling 999, the operator will extend the call to the service required by the caller. For instance, the caller will be connected to the ambulance service for a road traffic accident.

In order, to ensure the ambulance can arrive to patient within the target time, ambulance availability must be ensured and the time taken to arrive must be controlled. Thus, in order

to help improving ambulance system, efficient ambulances’ management and system is required to increase the standard of EMS in Malaysia.

EMS efficiency can be measured in many ways. The most important way of looking at this system is by examining the whole process of EMS episode [3]. Due to few challenges face by ambulance service in KKSA, we tried to reduce the problem by developing ambulance routing system.

The main problem in Shah Alam is the hectic situation during peak hour, where most vehicles are trapped and gradually move. The peak hours identified is from 7 a.m. to 10 a.m., from 12 p.m. to 2 p.m., and from 4 p.m. and above. This is the time where people busy to go to school or work, lunch and go back home, respectively. Shah Alam with commercial centres occupying many parts of the city, and also education institution scattered around different Seksyen – to name a few, has contribute to traffic congestion. This is not the only constraints that ambulances face. There are also traffic light, toll and roundabout. Generally, the road in Shah Alam is a one way lane. Thus, if the ambulance has taken the wrong road, they will results in late of arrival at the emergency sites.

This paper only focuses on the application of A* algorithm in finding the shortest distance of the ambulances. Details on the results and findings of the model developed are to be discussed on the next paper. In this paper, the shortest distance for ambulances for the area serviced by ambulance located at the KKSA is projected by using A* Algorithm and road network for ambulance routing system. The objectives of this project are to develop an ambulance road network in 5 kilometers for the area under study and to apply a suitable mathematical model to minimize ambulance travelling distance.

II. LITERATURE REVIEW Response time is the main concern in ambulance service.

Many studies of ambulance response time in many countries had shown that ambulance response time are important in measuring a quality of EMS system, such as [4] in United Kingdom, [5] in Singapore, [6] in Norway and [7] in London. Shortest distance for ambulance is an alternative for ambulance management to have better response time. The application of algorithms in finding the shortest distance with the quickest response time is one of the well-known methods.

2011 IEEE Colloquium on Humanities, Science and Engineering Research (CHUSER 2011), Dec 5-6 2011, Penang

978-1-4673-0020-9/11/$26.00 ©2011 IEEE 855

Among the existing studies, one of it had been developed and been implemented in Malaysia, where the application of the Dijkstra’s algorithm is used to find the shortest path route and the quickest time route for EMS ambulances [1]. Another Dijkstra’s algorithm implementation and enhancement are [8], [9], [10], [11], [12], [13], [14], and [15]. Others studies on finding the shortest distance and the quickest response time are Kruskal’s Algorithm [16], Bellman-Ford Algorithm [17], Floyd’s Algorithm [18], Dynamics Shortest Path [17], Restricted Search Algorithm [11], Prim’s Algorithm, Johnsons’s Algorithm [9], Binary Search Tree [18], Matrix Multiplication Based Algorithm [19], Best-First-Search Algorithm [15] and Greedy Algorithm [18]. However for this study, only A* algorithm are used.

The history of shortest path algorithm can be traced as early as 1968 in which the A* algorithm was established [20]. The evolution of these shortest path algorithms continues and further discussed and extended [21], [22], [23] and [15]. A* algorithm can calculate the shortest path as Dijkstra’s algorithm does. [12] resulted in saying that A* algorithm is better than Dijkstra’s algorithm as A* algorithm gives better result in finding the shortest path. Later, these algorithms were improved by [10]. The author stated that A* algorithm is essentially the same as Dijkstra’s algorithm, except that the application of heuristic in their methods. Heuristic is useful in finding optimal solution and as stated by [24], heuristic is very fast, thus it can be easily adapted to various objectives such as minimizing total distance with a few changes in the constraint model. Therefore, A* algorithm able to computes faster than Dijkstra’s algorithm, and according to [25], A* algorithm generates good result for the problem of path planning. A* algorithm can achieve better running time than other algorithm in the road network application [11] and widely used in finding an optimal route such as travel distance, traffic condition and etc [26]. A* algorithm can be used in increasing and searching for shortest distance from starting nodes to end nodes where the end nodes is optimal way [27].

This paper proposed an implementation of A* Algorithm to determine the route with the shortest total distance in KKSA, Shah Alam, Selangor, Malaysia. A* algorithm was chosen as it may gives better result in finding the shortest path as mentioned in [12]. This paper is arranged as the following (1) Introduction, (2) Literature Review, (3) Methodology, (4) Results and Discussion and (5) Conclusion.

III. METHODOLOGY

A. Data Collection The data on ambulance services are collected from the

KKSA. Data includes information about the location and information related to the routing of ambulances. The KKSA is assumed to use only government ambulances and all ambulances are dispatched from known stations. Road network developed involved all major roads which connected to the designated hospital. The road network consists of nodes and edges, which will be the directional links that connects the two nodes between them. The route with the shortest total distance is determined by applying the A* algorithm. The location of KKSA is shown in Figure 1. The map is obtained by using Google Map.

Based on Figure 1, the data is obtained within 5 kilometres (km) radius from KKSA. From there, the road network is developed to show all possible routes to be considered when deciding the shortest path for the ambulance to reach the emergency site KKSA. In the same figure, the 5 km distance from KKSA ambulances road network with the distance from one node to another is shown. In this case, the KKSA will be classified as starting node (SN) and the incident sites will be known as ending node (EN). Thus, based on the road network developed, the A* Algorithm will be applied using Microsoft Office Excel to calculate the shortest path. The shortest straight line distance in kilometres will be found using Google Maps Distance Calculator and will be calculated together with distance between nodes. This part will be explained further under the next section.

Figure 1: Location and road network of KKSA

B. A* Algorithm Model Here, the A* algorithm will be applied to determine the

shortest path of ambulance distance from KKSA to other locations. Referring to model by [28] the idea of this algorithm is to avoid expanding paths that is already far or expensive. The models are:

)()()( nhngnf += (1)

where n : A node on the network

)(nf : The estimated cost of the least-cost path to

a goal node through n

)(ng : The cost of reaching node n from the start

node

)(nh : An estimated cost of getting from node n to

a goal node.

2011 IEEE Colloquium on Humanities, Science and Engineering Research (CHUSER 2011), Dec 5-6 2011, Penang

856

This algorithm choose the next node n whose g(n) + h(n)

is minimal. This process repeats until the goal node reached. [12] stated the algorithm choose their node based on the cost from the start node plus an estimated of the goal node.

The A* algorithm can also be described as the following, based by [29] in Figure 2:

Figure 2: A* Algorithm Pseudo Code

C. Computing the Data The A* algorithm is applied to determine the shortest path

from KKSA to incident site. The shortest paths are based on incident site and current ambulance station. A preliminary study was done manually to calculate the shortest path for the ambulances. For instance, based on Figure 1, say an accident occur at D3. Thus, all the possible routes involved will be around the SN which is at KKSA and the EN will be D3. The distances are given in kilometers (km). The procedures will be discussed under the Results and Discussion section.

IV. RESULTS AND DISCUSSION

As mentioned earlier, all the data pertaining to ambulance location and information are collected from KKSA. From there, we develop a complete road network within 5km radius from KKSA. Hence, once the incident site is identified, we developed a detailed road network that shows complete distances as in Figure 3. In this case, KKSA is the starting node and D3 is the ending node whereby the other nodes will be connectivity joints by edges.

Based on the route network, we can see that there are many possibilities of reaching to D3. The main concern is whether the route chosen is the fastest since in this case, the faster the ambulance can arrive the better chances of helping people in need. Dealing with emergency cases usually involves with lives of innocent people. Therefore, shortest path is vital. Thus, the A* algorithm is applied in determining the shortest path from KKSA to D3. The implementation of this algorithm is explained in details in this section.

Before the distance is calculated, straight line distance

from D3 to other nodes in km is obtained. The straight line distances are found using Google Maps Distance Calculator. This tool is useful to find the straight line distance between two or more points anywhere on the earth. Table 1 shows straight line distance from D3 to other nodes. These nodes will then be added together with distance between nodes in order to obtain the shortest path.

Figure 3: Detailed route network for finding shortest path from KKSA to D3 (in km)

By using data from Figure 3 and Table 1, we determine the shortest path by using the A* algorithm. Based on the formula (1), the distance from Figure 3 is our g(n) meanwhile, the data from Table 1 is our h(n). Next the figures show the application and procedures of A* algorithm in finding the shortest distance from KKSA to D3.

TABLE I. STRAIGHT LINE DISTANCE FROM D3 (IN KM)

Nodes Straight Line Distance from D3 (in km)

KKSA 1.694

A1 1.734

B1 1.591

A9 2.229

C1 1.581

A2 2.069

B2 1.867

C2 1.909 D1

1.276

D3 0.000

2011 IEEE Colloquium on Humanities, Science and Engineering Research (CHUSER 2011), Dec 5-6 2011, Penang

857

a. The starting node is KKSA. The distance from KKSA to KKSA is 0.000 km while the straight line distance from D3 is 1.694 km. Thus, we add it according to our formula (1).

Figure 4: Distance from KKSA to KKSA

b. From KKSA, the formula is used again but now it depends on the distance between nodes and straight line distance. From Figure 5, we found out that B1 is smaller than A1. Thus, B1 is chosen as the next shortest path.

Figure 5: KKSA to A1 and B1

c. Next, in Figure 6, there are two choices of edges to go from B1 which are A9 and C1. By using f(n), we can see that C1 (2.423 km) has lower distance compared to A9 (3.153 km). However, as mentioned, the objective of A* algorithm is to find the lowest distance among them. Thus, these distances must also be compared with A1. Since A1 is still the lowest distance among all, hence we choose A1 (2.246 km) for our next choice.

Figure 6: B1 to A9 and C1

d. The same process is repeated again using the same formula to find the lowest distance. As shown in Figure 7, we choose C1 for our next choice.

Figure 7: A1 to A2 and B2

e. Next, as shown in Figure 8, we select D1 as the next preferred node.

Figure 8: Current preferred node from C1 to B1, C2 and D1

f. Finally, in Figure 9, D3 is selected as the ending node with the shortest distance.

Figure 9: Final preferred node from D1 to C1, D3 and C2

Based on the Figure 4, 5, 6, 7, 8 and 9, it shows that the shortest distance from KKSA to D3 is achieved via path KKSA B1 C1 D1 D3, with the total distance of 2.541 kilometres. The result can also be obtained using Microsoft Office Excel template that carries out the steps in A* algorithm. Microsoft Office Excel is preferred since we will involve larger sets of data and to avoid miscalculation.

V. CONCLUSION

This study produced a complete road network and determine shortest path from a location to another location within 5 kilometres radius from the KKSA. The implementation of A* algorithm will be extended to other part under the study. Though the shortest path can be calculated manually, it consumes time and may results to miscalculation. Due to this, computational experiments will be conducted using C# programming since it involves larger sets of data.

2011 IEEE Colloquium on Humanities, Science and Engineering Research (CHUSER 2011), Dec 5-6 2011, Penang

858

By using the system, it is hoped that the ambulance will be send from any wanted starting node to a specified destination node. In our case, the algorithm for the EMS ambulances helps in finding the shortest path that will satisfy within 10 minutes response time. This is to comply with the suggestion made by the Ministry of Health [30]. Thus, the proposed algorithm is hoped to increase the efficiency and to enhance the quality of the EMS ambulance management. Moreover, both the government and the public will benefit through the proposed model and algorithm which is capable of enhancing the quality of the EMS.

ACKNOWLEDGEMENT Special appreciation goes to the Faculty of Computer and

Mathematical Sciences, Universiti Teknologi MARA, Shah Alam and everyone involved for their contributions and assistance given throughout this project.

REFERENCES [1] N. A. Mohd Nordin, A. Shuib, and R. Ismail, “Determining The

Quickest Time Route for the Developed Road Network Using Dijkstra’s Algorithm: The HTAR Case Study,” Proceeding of 2nd International Conference on Mathematics and Natural Sciences (ICMNS) 2008c, Bandung, Indonesia.

[2] D. Rajah, “999: One Number, One Nation,” The Star, 1 October 2007. [3] L. Guppy and M. Wollard, “Emergency Ambulance Services:

Performance and Review,” Pre Hosp Em Care, 4, 2000, pp. 40-45. [4] J. P. Pell, J. M. Sirel, A. K. Marsden, I. Ford, and S. M. Cobbem,

“Effects of Reducing Ambulance Response Times on Deaths From Out Of Hospital Cardiac Arrest: Cohort Study.” BMJ, vol. 322, 2001, pp. 1385-1388.

[5] E. Seow and E. Lim, “Ambulance Response Times To Emergency Departments,” Singapore Med J, vol. 34, 1993, pp. 530-532.

[6] J. E. Steen-Hansen and E. H. Folkestad, “How Long Does It Take For An Ambulance To Arrive? (Norwegian). Tidsskrift for Den Norske Laegeforening,” 2001, 121(8), pp. 904-907.

[7] Striving For Fast Response To Emergencies. Retrieved from http://malaysianmedicine.blogspot.com/2006_09_01_archive.html. (Accessed on September 9, 2006).

[8] R. Cocks and E. Glucksman, “What Does London Need From its Ambulance Service?” BMJ, vol. 306, 1993, pp. 950.

[9] J. A. Lawrence and B. A. Pasternack, Applied Management Science, John Wiley & Sons, Inc. 1998.

[10] S. Pettie, “A Faster All Pairs Shortest Path Algorithm for Real Weighted Sparse Graphs*” Department of Computer Science, The University of Texas at Austin. Retrieved from http://www. springerlink. com/ content/p01kkglqca3l1td6/ fulltext.pdf, 2002.

[11] P. Lester, “A* Pathfinding for Beginners,” Retrieved from http://www. polic yalmanac.org/games/aStarTutorial.htm, 2005.

[12] D. Liang, “Fast Shortest Path Algorithm for Road Network and Implementation,” Honour Projects Carleton University, 2005, pp. 5-13.

[13] X. Chen, Q. Fei, and W. Li, “A New Shortest Path Algorithm based on Heuristic Strategy,” Proceedings of the 6th World Congress on Intelligent Control and Automation, June 21-23, 2006, Dalian, China.

[14] N. A. Mohd Nordin, A. Shuib, and R. Ismail, “An Application of the Dijkstra’s Algorithm on the Ambulance Dispatching and Routing,” Prosiding Seminar Kebangsaan Matematik & Masyarakat 2008, 2008a, Kuala Terengganu, Terengganu, pp. 222-231.

[15] N. A. Mohd Nordin, A. Shuib, and R. Ismail, “Finding the Quickest Time Route using the Dijkstra’s Algorithm,” Prosiding Seminar Kebangsaan Matematik ke-16,2008, 2008b, Kota Bharu, Kelantan.

[16] A. Patel, “A* Algorithm,” Retrieved from http://www-cs-students .stanford. edu /~ amitp/, December 2009.

[17] P. B. Guttoski, M. S. Sunye, and F. Silva, “Kruskal’s Algorithm for Query Tree Optimization,” 11th International Database Engineering and Application Symposium (IDEAS 2007), IEEE Computer Society 2007.

[18] J. Kleinberg, and E. Tardos, “Algorithm Design,” Addison Wesey, 2005.

[19] S. Sahni, Data Structures, Algorithms, and Application in Java. United States: McGraw Hill, 2000.

[20] Desalvo, “Application of Matrix Multiplication,” Retrieved from http://library.standrewsde.org/lists/CourseGuides/math/precal_honors/desalvo /2005-2006/5.3_matrix_multiplication.pdf, 2005.

[21] P. E. Hart, N. J. Nilsson, and B. Raphael, “A Formal Basis for the Heuristic. Determination of Minimum Cost Paths,” IEEE Transactions on Systems Science and Cybernetics SSC4 4 (2), 1968, pp. 100–107.

[22] J. N. Nilsson, Problem-Solving Methods in Artificial Intelligence. New York: McGraw Hill, 1971.

[23] I. Pohl, “Heuristic Search Viewed as Path Finding in a Graph. Artif.Intell, vol. 1, 1970, pp. 193-204.

[24] J. Pearl, Heuristic Intelligence Search Strategies for Computer Problem Solving. Reading, Ma: Addison-Wesley, 1984.

[25] Y. Caseau, and F. Laburthe, “Heuristic for Large Constrained Vehicle Routing Problems,” Journal of Heuristics, vol. 5, 1999, pp. 281-303.

[26] A. Shukla, R. Tiwari, and R. Kala, “Mobile Robot Navigation Control in Moving Obstacle Environment using A* Algorithm,” Intelligence System engineering systems through artificial neural networks ASME Publications, vol. 18, 2008, pp. 113-120.

[27] R. Kala, A. Shukla, and R. Tiwari, “Fussion of Probabilistic A* Algorithm and Fuzzy Inference System for Robotic Path Planning,” Indian Institute Technology and Management Gwalior, 2010, India.

[28] K. Ik-Soon and Y. Kwangkeun, “LR Error Repair using the A* Algorithm,” Seoul National University. Retrieved from http:// www. springerlink. com/content/ ll372 2138x0m/fulltext.pdf, 2010.

[29] K. Khantanapoka and K. Chinnasarn, “Pathfinding of 2D & 3D Game Real- Time Strategy with Depth Direction A* Algorithm for Multi-Layer,” Eighth International Symposium on Natural Language Processing, 2009, Bangkok, Thailand.

[30] R. De Silva, “Ambulance Crisis: Emergency Services Not Up to the Mark,” New Straits Times, 26 Sep 2006.

2011 IEEE Colloquium on Humanities, Science and Engineering Research (CHUSER 2011), Dec 5-6 2011, Penang

859