Implementation of Dijkstra Algorithm with React Native to Determine Covid-19 Distribution

Since Covid-19 was declared a global pandemic because it has spread throughout the world, every effort has been made to help prevent and tackle the transmission of Covid-19, including information technology. Information technology developed to determine the shortest distance for Covid-19 cases around us needs to be developed. This research implements Dijkstra's Algorithm written in the React Native programming language to build a Covid-19 tracking application. The system can display the closest distance with a radius of at least one meter, and the test results can map the nearest radius of 41 meters and the most immediate radius of 147 meters. This system is built for the compatibility of Android OS and iOS applications with React Native programming.


Introduction
Since WHO designated Covid-19 as a global pandemic because it has spread throughout the world, various ways have been sought to help prevent and cope with the spread of Covid-19. The use of intelligent information and communication technology that can help prevent the spread of Covid-19 can be done by implementing artificial intelligence. One of the advantages of artificial intelligence is that it can be used for mobile telecommunications devices (mobile phones) or smartphones. The application of an Android OS-based application to prevent the spread of Covid-19 is used to diagnose someone when they experience some of the symptoms they feel, and it is feared that the signs lead to an indication of Covid-19 [1]- [3]. However, to be able to determine the distance from one user to another, more research is needed, because according to [4], [5] in the control Covid-19 required tracking of cases confirmed Covid-19 to see the physical distance between the point Covid-19 with other people at specific locations.
The exact algorithm is used to determine the distance to nearby locations, such as Dijkstra's Algorithm. It can choose the shortest length of several routes [6], [7]. Studies using this algorithm seek the direction of travel the closest [8] and the location of the nearest futsal [7]. Determining a distance between two location points utilizing the GPS feature, with GPS will be able to track, determine the direction, especially when outdoors [9] and when the distance between people who have been confirmed Covid-19 can be known, it will warn other people who are around it to be able to maintain its distance so that it will minimize the occurrence of Covid-19 transmission. Applications to find out the closest confirmed case of Covid-19 are essential to avoid too tight space so that news of Covid-19 can be prevented, and this application trial can be implemented on mobile platforms [5].
Application development on mobile devices itself can use native types in JavaScript (React Native). React Native has advantages over both the hybrid type and the web version. React Native has been widely used to develop multi-platform applications, which can develop Android OS and iOS applications [10]. This paper seeks to implement Dijkstra's Algorithm represented in React Native to track Covid-19 in the vicinity through mobile applications.

Literature Review
Dijkstra's Algorithm is an algorithm kind of greedy that concept in determining the minimum service on some routes there and produce solution sets. Dijkstra's Algorithm can determine the shortest route in the search for futsal fields, as in research [7] trying to determine the shortest path to the nearest futsal field in Pangkalpinang City, Bangka Island, Republic of Indonesia. This algorithm can determine the fastest route to the most relative futsal field according to the user's point on the map via a smartphone. The application of the Dijkstra's Algorithm can also be used in the tourism sector to determine the shortest distance to tourist attractions in Jember Regency, East Java, Republic of Indonesia. Dijkstra's Algorithm in this study offers tourist destinations that are registered in the system. Then the system will process the shortest distance that can be travelled by displaying a map to the user. This study produces a time value for calculating the distance between the system and manual calculation, which is not much different. Each tourist route selected by the user can be reached at various speeds [6]. Dijkstra's Algorithm effectively calculates the shortest route between two intersection points at one's geographic position, which is applied in the geofence index. The importance of determining the fastest way at two existing points will improve the performance of location-based services (LBS). LBS is widely applied in GPS-based mobile apps [11].
Application development currently uses React Native a lot. Applications developed with React Native to help longitudinal mapping residents who experience symptoms, behavior, and Covid-19 testing such as research [12] developed the How We Feel application (HWF; http://www.howwefeel.org) with React Native for data collection purposes. React Native is easy to formulate open-source programs, so it's available on GitHub (https://github.com/weallen/HWFPaper20). Health information systems that require large-scale processing of patient data are needed to have a measurement level that can be calculated quickly and accurately. Research in [12] built a health information system that can collect patient medical data with SOP determined in SMART Markers. This software is a mobile framework that encapsulates the functionality required for the fast processing of patient data.
When talking about the location of a point, the Global Positioning System (GPS) feature is the solution. This GPS technology can be used for various purposes, one of which is security. One of the preventions of vehicle theft is GPS technology based on the GPS-based location monitoring system. This system is built with geofencing features and IoT integration. The accuracy of this system in overseeing the theft of around 95%, compared to real-folder on smartphones [13]. The utilization of GPS-based LBS (Location-Based Services) also has been developed for application on a smartphone. LBS has proactively notified users about the content-based locations. In addition, LBS can help provide directions for users when entering or leaving specific areas [11]. GPS technology can also be utilized for the development of an early warning system for disaster status. One application is for real-time earthquake disaster mitigation. This technology develops architecture by integrating and analyzing information obtained from seismic events that occurred at that time. Seismic events based on their location are then processed into data that can be sent to the network. The information obtained will be quickly conveyed in an early warning system developed for Android OS devices [14].
Covid-19 continues to spread worldwide, so the WHO has designated it as a global pandemic in March 2020. Every country has found a confirmed case of Covid-19. Because the spread of Covid-19 that are zoonotic, various parties have carried out prevention and control of Covid-19. Covid-19 is a severe health problem, and it is essential to pay attention to [1], [2]. Many technologies have been developed to deal with Covid-19, and there will be more technology developments to contribute to the Covid-19 pandemic [3]. Developing a framework to control the spread of Covid-19 on mobile devices can be a solution during the Covid-19 pandemic. This framework consists of four phases. First, calculating the distance between the positive and the suspect. Secondly, Authorized Clinical Center (ACC) sent a positive person ID to Telecom Company (TC) to provide information related to the suspect's identity is unknown. Third, diagnose the suspect and be urged to visit the ACC immediately. Fourth, the suspect has been testing, and deployment Covid-19 can be resolved [5]. One of the technologies in controlling Covid-19 can be a mobile app for Covid-19 diagnosis. A person can check whether he has symptoms of Covid-19 indication or vice versa. Independent diagnosis will greatly assist medical personnel in following up on patients for a swab test or PCR-test to ensure the results of Covid-19 detection. Applications like this are very efficient and environmentally friendly because they can be

Research Method
Research application development on this form of implementation of Dijkstra's Algorithm, establishing a graph diagram, Google Maps API, activity diagrams, use case diagrams, class diagrams, sequence diagrams, flowcharts, and programs written in the programming language React Native. Dijkstra's Algorithm itself is an algorithm used to solve problems in the shortest distance (shortest path problem) for a directed graph by examining and comparing each existing line [6], [7], [15], [16]. Dijkstra's Algorithm applied in this study is science mapping. Determination of the shortest distance from a point around it is more accurate in maps using the Google Maps API and integration of mapping science in Dijkstra's Algorithm [16]. Graf strategy in finding the shortest distance in each source node in the graph, Dijkstra will determine which routes are fastest by assuming the minimum value between the node with other nodes in the vicinity [6]. A graph diagram is composed of a collection of nodes connected through edges. It consists of a set V (vertices) and a set E (edge; sides). Several nodes connected by edges are called graphs [6]. The graph diagram arranged refers to [16] with the improvement of Dijkstra's Algorithm to calculate the shortest route from one point to the other points around it. Google Maps offers an API (Application Programming Interface) to be used by third parties to use Google Maps. Google Maps provides a locator function to determine a location around the world. Google Maps has mapping satellite imagery, street view 360°, traffic, and route directions [6]. Google Maps using Dijkstra's Algorithm to determine the most efficient route in this system. System activity diagrams designed to determine the shortest range of Covid-19 cases nearest the user in the map can be seen in Figure 1.

Figure 1. Activity Diagram While the System Is Running
Use case diagrams in this system planned to see the nearest Covid-19 cases in the vicinity and be able to see details about a nearby Covid-19 case along with details of distance and health recommendations text-the use case diagram described in Figure 2.

. Use Case Diagram Planned in This System
The class diagram in this system consists of class "covid19" and class "graph c19". The class diagram can see in Figure 3.

Figure 3. Class Diagram Including Class Covid19 and Class Graphc19
The sequence diagram in this system that is planned to see the Covid-19 case is described in Figure  4.

Figure 4. System Sequence Diagram
The flowchart system in this research to be able to see the Covid-19 case includes: (1) Starting the application is by clicking the "Go To Covid19 Tracker" button in the Main Menu; (2) The application will ask for GPS permission. If "Yes", the process continues to take the GPS-based user's current position geo-triggered. If "No", the system will end the process and return to the beginning. The geotriggered process of the user's current location and Covid-19 cases around the user is assisted by health workers who have previously updated the latest information on the distribution of Covid-19 instances on the map; (3) The system will display the Covid-19 case points around the user after permitting location-based services (LBS) on the smartphone; (4) If you choose one of the Covid-19 case points, the system will offer the option to view the exact distance and patient details; (5) Both options always provide health recommendations to prevent Covid-19 transmission. In detail, the flowchart in this system is described in Figure 5.

Figure 5. System Flowchart
Based on Figure 5, the first time the system, after running, will ask for access to GPS permissions on the device; if it continues, it must select the "Yes" option. The system will display the distribution of the points of confirmed cases of Covid-19 on the map. The map used is adopted from the Google Maps API. Each issue is the closest one meter, based on user geotagging measurements with surrounding points (show range cases). If one end is selected, the system will display a detailed description of the patient being treated at the hospital. The system will terminate if the user completes the application.
The system is written in the React Native programming language on Android Studio 4.0. The application will be compatible with both Android OS and iOS devices. The coding implementation for Dijkstra's Algorithm is prioritized for the distance measurement function (a minimum radius of one meter from the user's location point) and the geolocation function. These codings are described in Figure  6 and Figure 7.  Figure 7 provides an overview of coding the geolocation function based on the previous distance measurement function (in Figure 6). The geolocation feature is taken from the distance measurement function in the Dijkstra's Algorithm to provide an accurate radius between the user and Covid-19 patients scattered in the map. The minimum distance the system warns the user is one meter from the patient. If the device cannot access the internet, the system requests a refresh to facilitate the geolocation by connecting to the internet accurately.

Results and Analysis
This application is built for Android and iOS compatibility. This menu will appear after the user opens the application. In this menu, the user can select the "Go To Covid19 Tracker" button to display a map with the surrounding conditions where the Covid-19 case is present. It can be seen in Figure 8.

Figure 8. Main Menu View
Based on Figure 8, the main menu display illustrates the application identity accompanied by a button to start tracking "Go to Covid-19 Tracker". Views like this are effortless and do not require ample memory space. Internet connection and GPS features must be active during this section. To display a map with the location around the user where there is a Covid-19 case, first permit the GPS so that the LBS feature can be taken. It can be seen in Figure 9. Based on Figure 9, the GPS feature must be active in this section. Because in this section, to activate the LBS feature as used in the tracking process later. The GPS that has been given a permit on the device can be continued for the Covid-19 Tracking Map. In this interface will be displayed distribution Covid case 19 closest around the user. For example, in Figure 10.  Figure 10 is the Google Maps API used to determine the distribution of Covid-19 patients with an adjusted radius between the user's distance and surrounding patients. Each patient has information on the patient's status, the place of hospitalization, and it can be seen based on Figure 11. Whereas in Figure  11, when a Covid-19 case is selected on the map, an option will appear to display the distance and patient details. Figure 11 displays information for one of the selected patients on the map. Shows the patient's status, the place of hospitalization, and a selection of options to calculate the distance to the user and other information regarding the patient. Some sensitive information is not displayed because the relevant health regulations protect it. If the option is selected, its details will display the calculated distance from the user's position on a map with a graph calculating in the processing system. In addition, the health recommendations text is said to prevent transmission of Covid-19 due to too close a distance. The minimum radius of the warning, the closest distance is one meter, can be seen in Figure 12. Based on Figure 12, when selecting the patient's detailed option, it will display information on the hospital that the patient referred to, as shown in Figure 13. During testing, this application can map the farthest distance from the closest range around the user, which is 147 meters, while the most relative distance to the user is as close as 41 meters. Meanwhile, when selecting the patient's detailed option, it will display information on the hospital the patient referred to, as shown in Figure 13.  Figure 13 describes detailed patient information when the user wants to get detailed patient information on the map. The concern here is the distance determined by the system from the user's position. The patient information is based on the location of the selected patient, and of course, the patient is also in the tracking system via an active GPS.
The implementation of Dijkstra's Algorithm with React Native coding can be used to be developed into applications that are compatible with Android and iOS. Based on the test results, the closest distance that the system can detect through the geolocation function is one meter from the point of the application user. System testing can map the farthest distance from the closest range around the user, 147 meters, while the most relative distance to the user is as close as 41 meters. This farthest distance is still within a radius of 1000 meters or one kilometer. We realize that the accuracy of the distance calculation is based on the device's geolocation features and internet connectivity. In an emergency, this measurement of the furthest distance (41 meters to 147 meters maximum) can increase users' awareness of the most distant Covid-19 patients so that actions or mitigation can be carried out quickly and precisely. In their study, Chen et al. [18] modelled the prediction method for selecting emergency evacuation routes using Dijkstra's Algorithm. This application can offer preventive measures against cases of transmission and spread of Covid-19 with a radius of the maximum closest one meter and the testing result most relative distance 41 meters to 147 meters maximum. It is proven that mobile devices such as Android can be used to prevent transmission of Covid-19, as in the research of Al Hakim [2], Al Hakim et al. [1], the difference is that this system offers to map of Covid-19 patients around When the system was running, Ahmed [5] also did a similar development with a programming language other than React Native. We consider implementing an early detection system on the system so that with a radius of the closest distance of one meter, the device will alert the user when the system is running.

Conclusion
Based on the research results and descriptions above, it can be concluded that the implementation of the Dijkstra's Algorithm can be used to map the shortest distance of Covid-19 cases around the user, the system able to display the closest distance to a minimum radius of one meter, and the test results can map the nearest radius. Forty-one meters and the closest farthest radius is 147 meters. This system is built for the compatibility of Android OS and iOS applications with React Native programming.