Delivery Route Management based on Dijkstra Algorithm

For businesses that provide delivery services, the efficiency of the delivery process in terms of punctuality is very important. In addition to increasing customer trust, efficient route management, and selection are required to reduce vehicle fuel costs and expedite delivery. Some small and medium businesses still use conventional methods to manage delivery routes. Decisions to manage delivery schedules and routes do not use any specific methods to expedite the delivery settlement process. This process is inefficient, takes a long time, increases costs and is prone to errors. Therefore, the Dijkstra algorithm has been used to improve the delivery management process. A delivery management system was developed to help managers and drivers schedule efficient ways to deliver product orders to recipients. Based on testing, the Dijkstra algorithm that has been included in the nearest route search function for the delivery process has worked well. This system is expected to improve the efficient management and delivery of orders.


Introduction:
Delivery Order Management System is a system that connects the sender and the order system manager. Systems may differ in design, but they are all based on a core routing function that selects the path to transport an object, regardless of whether it is in the network or in real life (1). Delivery management is a system that has been used to optimize routes and improve the delivery process. For a delivery service company to maintain its sustainability, one of the factors influencing profits is fuel consumption. There are studies showing that there are many companies that find it difficult to profit from expensive fuel protection contracts (2). This causes the companies involved in product delivery to consider the costs involved in completing the delivery (3). Therefore, a delivery management system that uses the shortest road algorithm will help determine the shortest and most efficient route to reduce fuel consumption and indirectly reduce company costs. With the rapid development of technology, the traditional business model needs to be changed too. The trend of using technology to promote business development has become more and more obvious. For example, application of Point of Sales (POS) System at a retail shop. With more advance application like, usage of Artificial Intelligent or algorithm in business (4).
Based on the case studies conducted at flower shops that provide delivery services, there are many implications for this procedure which is mostly done manually. For example, an administrator organizes the delivery of an order in the shortest way using geographical knowledge and marks the order as sent when he receives a message from the driver. This indicates that there are some limitations to the existing delivery service system. Also, because all routes are manually planned by the administrator as described, they cannot assume that the travel conditions are always smooth.
In the process, the administrator collects all the order sheets that need to be sent. The administrator will then take the order and check the order destination area. The administrator will then compile the order sheet with the shortest 'logical path' that connects all locations for delivery. Once the route is scheduled, the driver enters the ordered product into the vehicle and begins the delivery / order process. The driver will enter the shipping address in the navigation application so that he can navigate there. When the driver successfully delivers the product, the driver will send a text message to the administrator for recognition via WhatsApp, an instant messaging app. The driver will notify the administrator once each product is shipped until the administrator can take further action. For example, inform the sender if requested. The driver will repeat the process until all orders are shipped and will return to the store again. Typically, the driver will start delivery from the nearest place to the store. However, there are some situations that require the driver to send from the farthest point. For example, the driver orders to send a specific order in the range at all times. Once the driver arrives at the delivery point, he will deliver the relevant product to the recipient and ask the recipient to sign the delivery order as proof of delivery. The driver will then take a picture of the delivery order and send it via a mobile application (i.e. WhatsApp) to the administrator for recognition. The driver will then move on to the next delivery. When the driver returns to the store, he will send all delivery orders to the administrator for recording. This method is seen as a problem because all steps need to be managed manually and take up a lot of time when the number of deliveries is large. From this point of view, there are some limitations to the existing delivery service system, particularly regarding scheduling, tracking, and recording of data. This will increase the administrative burden as it also takes some time to arrange delivery while still needing to distribute orders to the relevant branch. Also, because all routes are manually planned, as a result, they cannot assume that there are several factors that influence the delivery time such as traffic jams or accidents that may result in inaccuracies and also, there may be incorrect calculations.
Therefore, a Dijkstra algorithm is utilized in the developed delivery management system to manage good's delivery information efficiently. It consists of two different subsystem of web system and mobile application. Web based subsystem is prioritized for administrator while the mobile application is prioritized for driver based on their preference. As a result, the Delivery Management System provides two subsystems for its users with different tasks and functions in order to achieve better system efficiency.
The rest of the paper is organized as follows: Section 2 describes the related work on Delivery Management System studies. Section 3 presents the methodology of the project. Section 4 explains the findings from analysis and design. Section 5 gives the conclusion.

Related Work:
Delivery means taking good, letters and other things to people sent to (5). The delivery system is a standard procedure for transporting an object from a place to another place. Delivery service is now a new trend for this technology era. The convenience and the easy access to the internet promoting the uses of delivery services. According to research on Malaysia, e-commerce, also known as online shopping, had grown sharply to about 31% in just three years (6). Due to the big potential of online shopping, many off-line retailer shops will undergo business model transformation by promoting their product online to increase the walkin customer or even purchase their product online. Thus, shipping services can be a tool for increasing business profits (7,8). However, when there is an increase in delivery order, the fuel consumption and time used is the main factor affect the profitability (9, 10). To enable a maximum profit, lower fuel consumption for delivery is a priority. Thus, the route for delivery act an important role in ensuring a maximum profit to a business.
Although it is one of the ways to schedule a route for a less path's delivery, this method cannot predict the road condition. Some of the paths may suffer from heavy traffic jam or even closed for maintenance but the administrator cannot be acknowledged. In addition, we can also find another complicated process where the driver completes the delivery order, he must acknowledge the administrator so that the administrator can update the delivery status. The process seems simple and straightforward; however, this is not the best way to create a verification status as there is a possibility of missing some messages sent between the administrator and the driver. Therefore, the entire delivery process which is conducted conventionally is time consuming and contain uncertainty such as miscalculation or miscommunication. Hence, the process needs to be supported by computer systems that can perform efficient record keeping, decision making, data storing and retrieval, analysis, notifications and others that improve the efficiency of the delivery process.
Shortest path algorithm is an algorithm that calculate the path which connect two nodes (location) together (11,8). It is commonly used in current existing navigation system. The famous shortest path algorithm including Dijkstra's algorithm and short path tree algorithm. This algorithm is commonly applied not even in the road planning but also the internet protocol (11). As one of the business values is efficiency, the application of algorithm into the delivery service is important. With a better optimization of the path, the efficiency of delivery will be much improved. Google Maps is of the example for a web mapping services provided by Internet Giant company, Google LLC. It provides many functionalities to the user such as route planning, street view, and the traffic condition. It can help the user to find a most suitable route to move to a location. Dijkstra algorithm is one of the shortest path algorithms. It is a simple and greedy algorithm as it will find a shortest path in every node to get the optimum path (12). The Dijkstra's algorithm will first consider the starting location as initial node while the distance of node is the distance calculated from the starting node. If there are many nodes in a map, then each node will have respective distance.

System Design:
Software Development Life Cycle is used to guide the development of this software (13). While the analysis and design of the system use an objectoriented approach. Usage case diagrams are used to describe system users and their relationship to use cases, i.e. functional modules in the system. The system user, also known as actors, will stay outside the system boundary and interact with the system. Figure 1 shows the use case diagram for the Delivery Management System. System actors include drivers, administrators, and even external systems that are Google Map APIs. There are six modules included in the system, namely login, manage orders, manage products, manage delivery, and reports.

Figure 1. Use Case Diagram
Path management for this study uses the Dijkstra algorithm. The shortest path algorithm is an algorithm that calculates the path that connects two nodes (locations) together (Makariye, 2017) and is commonly used in current existing navigation system. The famous shortest path algorithm including Dijkstra's algorithm. This algorithm is commonly applied not even in the road planning but also the internet protocol. Google Maps is of the example for a web mapping services that using the shortest path algorithm. It helps the user to find a most suitable route to move to a location.
The Dijkstra algorithm is shown as follows: i. All nodes will be assigning as infinity distance except zero for the initial node.
ii. All the nodes are marked as non-visited. At the same time, make the starting node as current. Besides, create a set that consists of all nonvisited nodes.
iii. Find the neighbour node of current node (the node that are linked to the current node) and calculate the distance. For example, if the current node have a distance of 3 and consists of a neighbour with an edge of 2 connecting it, then the distance of through node is 3 + 2 = 5. If the distance that previously recorded is less than the current result, remain the distance of node . If the result is lesser than the previous result, replace it with the shortest distance.
iv. Once all the neighbour node is calculated and the shortest distance's node is determined, mark the selected node as visited and remove from the non-visited set.
v. If the destination node is removed from nonvisited node, the algorithm is finish.
vi. If there is still non-visited node in non-visited set, then the step 3 will be repeated.
Once the algorithm is implemented, the shortest path will be found and can be used to improve the transmission efficiency. Therefore, this developed system also uses the help of google maps to find the distance between two locations and the shortest route algorithm to schedule delivery orders.
The pseudocode for Dijkstra algorithm is in the following:

Goods Delivery and Route Management System:
Goods delivery and route management system has been developed using web-based systems with Bracket software and mobile-based systems Android Studio. The system database is developed through the MySQL Database operated by phpMyAdmin. The user interface for web-based applications includes the Login module, Register module, Product Management module, Order module, Delivery module, and Reporting. For mobile devices, the interface involves the Registration module, the Delivery module and the Order module. Figure 2 shows the administrator dashboard.

Figure 2. Administrator Dashboard
The stock product management module will enforce the items available in the store for the purpose of CRUD (Create, Retrieve, Update, Delete). This helps administrators to get better inventory management. Figure  3 shows the interface for stock product management. 732 The product management interface shows basic product information including product ID, sample photos, descriptions, prices and so on. Administrators can change the availability so that they cannot receive new orders if the bouquet is not in storage. In addition to changing availability, administrators can also edit product information or delete products by clicking the button provided in the operating space. In addition, there are additional features and searches available for administrators.
Administrators can search for products efficiently by searching for products using their product ID. Figure 3 shows the interface for administrators to add new products to the database.
The delivery interface is used to indicate the order to be shipped the same day. It's built in conjunction with google maps. Figure 4 shows the delivery module for the administrator. Figure 5 shows the driver delivery module.  Figure 6 shows the code segment for the geocode () function. The geocode () function is a function used to generate the coordinates of the location of the order to be shipped. The output of a function will be a URL that can navigate the destination. When all operations are completed, the interface will be redirected to the order management interface The administrator can appoint the driver responsible for the order. Then, only the given driver will see the order listed in their respective delivery interface. Additionally, administrators have areas that show delayed orders reported from drivers. For example, the recipient could not be reached. Then, administrators can update orders and send notifications to drivers. For both the driver and administrator interface containing google maps with a marker showing all the locations of the order to be sent. This helps drivers and administrators to see the front page of which location.
The report interface is specified for administrator to see the summary for the sales and profits for past 6 days. Figure 7 shows the interface for the report. The sales and profits graph are done by using JavaScript. However, the data is retrieved from the database by using php function and passed to the JavaScript for further interpretation. . Report Interface Figure 8 shows the mobile-based system delivery interface. There will be a navigation button for each request, a call button, and a change status button for the driver to facilitate delivery. This program will open a third-party navigation application (Google Maps) that will specify the shipping address. If the driver should contact the recipient, he can click the call button to call the recipient. Once the delivery is complete, the driver can change the delivery status to be completed to remind the administrator.

Figure 8. Delivery Interface (Driver)
In conclusion, the route delivery and management system based on the Dijkstra algorithm has been successfully developed. Such a system has been fully developed and is being tested with a planned test case. All test cases with the device showed good performance.

Conclusion:
The results of this project leverage existing algorithms implemented in real life. For example, use an algorithm to manage and organize all received orders based on the date and location of delivery. Furthermore, the probability of an administrator committing an error will also be reduced as all information is conveyed in a more consistent and easy way than referring to information in an instant messaging application. Later, this will reduce the delivery time of the order as it will plan the shortest way to connect all the delivery points. Every customer would like punctual and fast delivery services. With the improvement of delivery routes, it will produce a better customer experience and increase their willingness to use the services again in the future. This will become a good factor to keep business sustainable. However, there are still some suggestions that can be considered to improve this program. First, a webbased system layout can be a responsive layout. Then, the system can then notify the administrator after the driver completes the order. Additionally, the program allows drivers to take pictures and store them as evidence in the database. Moreover, the report module may provide more options for users to view different types of graphics. From another perspective, this system is just one of example that using algorithms to smoothen the business process but it can be an inspiration to the future business model and allow others to think about how to integrate the power of the algorithm into a business.