JURNAL TEKNOLOGI DAN OPEN SOURCE Go-Gallon App With A Star (A*) Algorithm Implementation Using Android Kotlin

The need for drinking water now is not to boil water, but to buy it in the form of gallon bottles, which are available wherever it is sold, either at the refill of water or in the supermarket. In a housing estate with many heads of families, it is also difficult to find and obtain water in gallon bottles under certain conditions, and there is also the problem that there is only one brand of gallon bottles, which also makes it difficult to obtain. For this reason, the author provides a solution by creating a go-gallon application with the application of the A-Star (A*) algorithm to be able to detect the service takers of the nearest people, which is basically intended for residential environments, where with this application others can ask to find and purchase gallons and then deliver them to their homes. The A-Star algorithm is one of the distance search algorithms that has an optimal and complete ability to solve problems related to finding or determining a route with the least distance. The hope is that with this application, especially housewives, there is no need to worry when they run out of gallons of drinking water at home, enough with this application, these problems can be overcome.


Introduction
In today's modern times, technology is developing rapidly. The advances in technology and communication make people's need for quick and accurate information even greater. This situation encourages people to continue to conduct various kinds of experiments and researches to develop and discover new ways to help people perform their activities. Housewives usually rarely consume home-boiled drinking water, so housewives buy high-quality bottled water.
Problems in the selection and purchase of quality water affect the ease of obtaining the desired litres of water. This can be seen in the example of the research object that the author studied in the street of the self-employed. The problem is that the housewives have doubts about the quality of bottled water. Therefore, the housewives have to buy high quality bottled water in supermarkets or mini-markets. With this e-ISSN: 2622-1659 Jurnal Teknologi dan Open Source, Vol. 5, No. 1, June 2022: 24 -34 25 application, housewives can easily buy high quality bottled water. In this research, A Star Algorithm (A*) is used to determine the nearest route. The A* algorithm (A Star) is one of the optimal and complete algorithms for route finding. Optimal means that the resulting route is the best and most complete route so that the algorithm can achieve the expected goal. In its application, the A* (A Star) algorithm uses distance as a calculation method for the best value.
Research using this method has been successfully conducted by many researchers including (Fernando, Mustaqov, and Megawaty 2020) in terms of finding location routes or photo spots in the city of Bandar Lampung using the A-Star method. Photo was successfully developed an application that contains photo spot information in Bandar Lampung with detailed information that is easily accessible by users [1]. In terms of applying the A* algorithm for finding the shortest route to the hospital in Bogor City was built using Android Studio software, using Java and XML programming languages for the user interface [2]. Based on the existing problems and what the researcher did with the method to be used, the author cast the method into a paper titled "go-gallon application with the application of the a star (a*) algorithm using android kotlin".

Application
A mobile application is software that runs on a mobile device such as a smartphone or tablet PC. Mobile applications are also called downloadable applications and have certain features to extend the functionality of the mobile device itself. To get the mobile application they want, users can download it through certain websites, depending on the operating system they have. Google Play and iTunes are some examples of websites that provide a variety of applications for Android and iOS users to download the desired application [3].

Algorithm A Star (A*)
A* is an algorithm first developed in 1964 by Nils Nilsson based on Dijkstra's algorithm. At that time, this algorithm was called the A1 algorithm. In 1967, Bertram Raphael further developed this algorithm and called it A2, but could not prove its superiority over the previous algorithm. In 1968, Peter E. showed that the A2 algorithm was optimal compared to A1. As a result, the A2 algorithm was found to be the most optimal algorithm for this case and was renamed A*. In terms of time, this algorithm is better than Dijkstra's algorithm with heuristic search [4]. Then, A is moved to the end that has the smallest F-value. The node in front of A is stored as a parent of A and included in a closed list (where the data of the node in front of A that is also part of the successfully found shortest path is stored). If there are other nodes that are neighbors of A (that have moved) but are not included in the open list members, then enter those nodes into the open list. Then compare the existing G-value with the previous G-value (in the first step, there is no need to compare the G-value). If the previous G-value is smaller, A returns to the initial position. The sampled node is added to the completion list. This is repeated until there is a solution or no other node is left in the open list [4]. Then A is moved to the closure that has the smallest F value. The node in front of A is stored as a parent of A and included in a closed list (which stores the data of the node in front of A that is also part of the successfully determined shortest path). If there are other nodes that are neighbors of A (that have moved) but are not included in the open list members, then enter those nodes into the open list. Then compare the existing G-value with the previous G-value (in the first step, there is no need to compare the G-value). If the previous G-value is smaller, A returns to the initial position. The sampled node is added to the completion list. This is repeated until there is a solution or no other node is left in the open list [4].

Ant Colony Optimization
Ant colony optimization or the ant algorithm was introduced by Moyson and Manderick and widely developed by Marco Dorigo. The ant algorithm is a bioinspired metaheuristic with a special group that attempts to mimic the behavioral characteristics of social insects, namely ant colonies [6]. The behavior of each perpetrator mimics the behavior of living ants and how they interact with each other to find a food source and efficiently bring it to their colony. During the walk, each ant emits pheromones to which the other ants are sensitive, giving them hope to follow in their footsteps. The intensity depends more or less on the concentration of the pheromones/pheroomones. Pheromones/Pheroomones are chemical compounds possessed by insects, especially ants, that are left on the ants' trails.
After some time, the shortest path will be followed more often and its pheromones become colonies. To simplify the process of designing the system, an analysis is needed before carrying out the next process. The analysis carried out is the inputting of the point of departure, the nodes created at the crossroads and the distance between the nodes. Here is the calculation formula used in the application of the A star method.

f(n) = g(n) + h(n)
f(n) = Evaluation function of node n g(n) = Cost or the distance from the origin node to n h(n) = The heuristic function of the n node, the heuristic function used is the straight line distance from the n node to the destination. The working principle of the A* algorithm can be explained by the pseudocode below: 1. Input the initial node to the openlist.

Loop Steps below:
a. Look for the node (n) with the lowest f(n) value in the openlist. This node is now the current node. b. Remove the current node from the openlist and input it to the closelist. c. For each neighbor of the current node do the following: 1. If it's impassable or already in the closelist, ignore it. 2. If it is not already on the openlist. Create a current parent node of this neighboring node. Store the f,g and h values of this node. 3. If it is already on the openlist, check if this neighboring node is better, using the value of g as a measure. If it is better to change the parent of this node in the openlist to the current node, then recalculate the g and f values of this node. d.Stop the loop if: 1. The destination node has been added to the openlist, which means the route has been found. 2. Haven't found the goal node while the openlist is empty or means no routes 3. Save the route. In 'backward', the sequence from the goal node to the parent continues until it reaches the initial node while saving the node into an array.

Android
Android is a Linux-based operating system for cell phones such as smartphones and tablet computers. Android provides an open platform for developers to create their own applications for a variety of mobile devices. Android is commonly used in smartphones and tablet computers. It works the same way as Nokia's Symbian operating system, Apple's iOS, and BlackBerry OS [5].
Android is an operating system developed by Google based on a Linux kernel to support the performance of touch-screen electronic devices such as tablets or smartphones. Thus, Android is operated by touching, swiping, or tapping on the device's screen. Android is open source and can be freely used, modified, repaired and distributed by software manufacturers or developers. Since Android is an open source technology, companies use it OS on their devices without a license, i.e. free of charge.

Methodology of Research
The research methodology is the order of conducting the research. It is intended for a more conceptual and focused research according to the objectives to be achieved, in order to create a system that has been tested and can solve the problems studied (Bulan Dewi Gulita, 2018). In this research methodology, it is described in the form of a research framework that starts with problem identification, data collection, observation, analysis, system design, program creation, testing, and evaluation, where the research methodology is presented as follows:

A-Star Method Testing
The A-star algorithm in this system is applied to the user's movement to reach the location of mineral water sales through the nearest channels. The author takes the distance of the users located at Jl. Swakarya and Indomaret Subrantas 13 as the target. To get more accurate measurement results. The author uses Google Maps to determine the paths to travel. 7 nodes are generated from the projections of Google Maps, and the node finding is based on an intersection.

Figure 2. Paths On Google Maps
Google maps data is not a reference in testing because the area that is the subject of research is of course always in the stage of development and change. In Figure 4.19, it can be seen that there are several blue lines which are paths that can be passed to Indomaret Subrantas 13. In the process of determining the shortest route with the A-Star algorithm, the following function formula is used. f(n) = g(n) + h(n) f(n) = Evaluation function of node n g(n) = Cost or the distance from the origin node to n h(n) = The heuristic function of the n node, the heuristic function used is the straight line distance from the n node to the destination. A to B = 200 M B to C = 154 M C to D = 129 M D to E = 118 M E to F = 161 M F to H = 16 M G to H = 246 M g(n) is the mileage between nodes indicated by the numbers contained on the sides of the vertices in the graph. The following is an overview of the graph that shows an alternative route from Jl. Swakarya to Indomaret Subrantas 13 as a result of simplification of the depiction from google maps along with the distance. The distance on the graph is obtained from google maps, each of which is calculated based on the distance between nodes.  Then calculating the distance h(n), namely h(n) functions as a heuristic function which is a straight-line distance between nodes which is a benchmark with the distance that the author has obtained from google maps using the measurement distance feature available on google maps. The following can be seen in the straight-line distance table in Table 2.  F to H : 16+0=16 After obtaining the entire distance, the next calculation process is called the living node and the expansion node. The living node is the root node. The expanse node is the smallest value of the evaluation function among other living nodes. Here is the calculation process of living nodes and expansive vertices in the A-Star algorithm to determine the shortest route. The description of the system use case designed is as follows: a. Login: Admin or user login first. b. Manage admin data: Admins process admin data. c. Managing partner data: Admin processes partner data. d. Managing officer data: Admin manages officer data e. Manage order data : Admin manages order data f. Reports : Admin sees user order report data g. Placing water orders: Users place orders for mineral water h. View the order list : User sees the order list i. View Notifications : User sees notification data j. View Account : User sees account data b. Class Diagram The Diagram class shows the properties and operations of a class and the constraints contained in the relationships of the object. Here is a picture of the diagram class of the proposed system.

User login page
The user login page is a page where the user of the application to enter the system on the user login display there are 2 buttons, namely the login button and the registration button, the user login display can be seen as shown below:

User Registration Page
The registration page is a page where users register into the application, this registration data will later be able to be used to log into the application, the registration display can be seen as shown below:

User Home Page
The user's main menu page is a page where users can see partner data information and can control all menus in the system, the display can be seen as shown below:

Account Menu Page
The account menu page is a page where users can see account information, the account menu display can be seen as shown below: 33 Figure 11. Account Menu Page

Search menu page
The search menu page is a page to find the data of the nearest partner, the search display can be seen as shown below: Figure 11. Search menu page

Notification Page
The notification page is a page where users can see the notification of the order list, the notification display can be seen as shown below:

Conclusion
After completing a series of steps to apply the A-Star algorithm (A*) to Go-Gallon applications using the Android programming language kotlin, it can be concluded as follows: 1.Based on the test results of the go-gallon application, conclusions can be drawn, namely that this application is able to find locations where there are gallon water vendors as desired by clicking on the provided list and selecting the desired type of water. 2.It can be used by people who want to order refillable drinking water. 3.To use this app, the user must have an Android smartphone. 4. according to the test results, every function of the app can be done properly.