Vol.8/No.1 (2016)
INTERNETWORKING INDONESIA JOURNAL
17
A Food Ordering System with Delivery Routing Optimization Using Global Positioning System (GPS) Technology and Google Maps Roy Deddy Hasiholan Tobing Abstract—The capability of a consumer to purchase products online or via telephone, and then has the purchased items to be delivered safely to her/his address is a value added by sellers. The products may vary and food is one of items that can be ordered via website and delivered to customers’ location. In daily life, some fast-food chain restaurants in Indonesia have implemented this type of service to their customers. However, one of the main problems in current delivery service is the routing optimization. The delivery staff may have little knowledge about location, street names and the shortest path to deliver some ordered food, especially in relatively big city. Moreover, the customers usually do not have much information about the status of their order nor the position of the delivery staff. This research develops an online food ordering system and applies heuristic algorithm to solve the so-called Travelling Sales Problem (TSP) in routing optimization. The system also uses the Global Position Systems (GPS) technology in Android-based mobile phone and takes the advantage of Google Maps for coordinate-to-map solution. Index Terms—Travelling Salesman algorithm, Android, GPS, Google Maps.
Problem,
heuristic
I. INTRODUCTION
I
MPROVING customer satisfaction can increase the customers’ loyalty to a product or service provider. One way to improve it is by having a food ordering system which enables customers to purchase the products without physically visiting the shop, namely by phone or by website, and then have the product delivered to the customer’s address safely and in good condition. Some food franchises in Indonesia have implemented this type of system, such as Kentucky Fried Chicken, McDonald’s, and Pizza Hut [1-3]. In delivery service, one of the main problems is to find the shortest path between customers’ addresses in order to deliver the product in reasonably short time, to save fuel usage and to optimize the utilization of the vehicles and delivery personnel [4][5]. The optimization requirement is usually represented on the delivery staff job vacancy announcement that often requires the applicants to know the streets or shortcuts in particular area or city. The routing problem that is related to the condition of food delivery service is called Traveling
R. D. H. Tobing is with the Faculty of Informatics Engineering and Electro, Del Institute of Technology, Laguboti, Indonesia (e-mail:
[email protected]).
Salesman Problem (TSP). In TSP, the seller starts moving from his/her hometown and is required to visit several cities exactly one time before going back to his/her hometown with minimum total distance. All cities are connected to each other. In this research, the author develops a system that can optimize the delivery routing process by implementing one of the solutions to TSP, which is heuristics algorithm. In addition, the system also utilizes the Global Positioning System (GPS) technology and mapping solution software, Google Maps. Nowadays, the usage of GPS has been part of modern human daily activities. The technology can be found and has become the standard feature of most smartphones [6]. This technology can be used to give information about something’s or someone’s position on earth surface. The GPS technology can be used along with Google Maps Application Programming Interface (API) to make the proposed delivery service system working better. GPS technology can return the coordinate of specific position; meanwhile, Google Maps can be used to (1) calculate the distance of two coordinates, and (2) return the information of a set of streets name and their directions that must be passed to arrive at one address from other address [7].
II. METHODOLOGY When conducting the research, the author follows systematic steps in order to provide the food ordering system with routing optimization feature. The steps that also represent Software Development Life Cycle (SLDC) are shown in the following Fig. 1. Requirement Gathering on Food Ordering Business Processes
Study on GPS Technology
Analysis Phase
Study on Google Maps API Technology
Fig. 1. The research methodology.
ISSN: 1942-9703 / © 2016 IIJ
Design Phase
Implementation Phase
Testing Phase
18
INTERNETWORKING INDONESIA JOURNAL
TOBING
order information to the web-based application. In each steps, the activities are: 1) Observe the delivery service business process of several fast-food franchises in Indonesia. These observed business processes are the based to develop the proposed food ordering system in this research. 2) Study on GPS technology in order to gather information, data, and knowledge that can be used to develop the system. In this research, the developed application uses the GPS technology in Android smartphones. 3) Study about Google Maps API. This process aims to explore the features and functionalities offered by Google Maps. The study uses the resources available on the Internet and university library. 4) Using the result of phase (1), (2), and (3), the author conducts analysis to produce complete information for developing the system. 5) In design phase, the author designs the system using the information provided by analysis phase. This phase provides the blueprint for the developed system. 6) During the implementation phase, the application is developed using the chosen technology and tools. 7) To confirm the functionalities of the application, a testing phase is entered in which the application is tested using several test case.
III. ANALYSIS A. Food Ordering System The architecture of the developed food ordering system can be seen in Fig. 2. The food ordering system can be divided into two main applications, which are: 1) Web-based food ordering application. This application can be accessed by Customer and he/she can order the products after registering himself/herself. As for the Operator, this application is used to register a Customer that has ordered via telephone, input the order into the application, and generate the information about the outlet that will handle the request and route that should be followed by Delivery Staff. Cook also uses the application to receive the order and prepare the food. The assigned Cook will be notified by the system. In addition, the status of the order can be accessed by Customer using this web-based application. 2) Android-based application [8]. The application is installed in the Android smartphone used by the Delivery Staff. This application is used to access information about the Customers, their orders, the address for delivery and the recommended route that should be passed. This application also records the position of the Delivery Staff so that the Customer can check the position of his/her ordered food. As Fig. 2 suggests, Customer can make order using telephone or the website. The assigned outlet will have Operator that handles the orders from telephone and enter the
When the information has been inputted, the system will automatically assign the outlet and Cook that will handle the order. After the food has been prepared, the Delivery Staff will be notified to pick-up the food and bring them to the Customer. The Delivery Staff will get notification, order and delivery information in the smartphone. Order via Web Customer Customer
Satellite
Customer Customer
Customer Customer
Customer Customer
Outlet 2
Outlet n Delivery Delivery Staff Staff
Cook Cook
Internet Delivery Delivery Staff Staff
Cook Cook Outlet 1
App App Web Web Server Server
Cook Cook
Delivery Delivery Staff Staff Satellite
Order-By-Phone Order-By-Phone Operator Operator Telecommunication Provider
Customer
Customer
Customer
Order by Phone
Fig. 2. Food Ordering System Architecture.
The business process of proposed ordering system can be seen in the following Fig 3. Customer can make order using telephone or the website. After order has been made by telephone and website, in Fig. 3 we can see that several activities related to food ordering application are added (blue box). B. Heuristic Algorithm for Routing Optimization Heuristics algorithm is based on the model of undirected weighted graph. The constructive heuristics algorithm is applied in the developed system and uses nearest-neighbor (NN) approach. The algorithm that is used to solve TSP has several iterations, which are [9,10]: 1) Salesman is in initial point as the current vertex. 2) Search the edge that has the least weight between the current vertex and the unvisited vertex V. 3) V is set as the current vertex. 4) Mark V as visited vertex. 5) Repeat step 2. 6) If all vertices have been visited, stop the iteration and go back to initial point. The output of this algorithm is the sequence of steps as the TSP solution.
Vol.8/No.1 (2016) Customer
INTERNETWORKING INDONESIA JOURNAL Operator
Restaurant Outlet
Fig. 5 shows the example of optimized route for four addresses. In this application, point 1 is the initial and end point. Table with blue cells contain the data about distance between two points that are generated using Google Maps API. Meanwhile, the table with red and yellow cells contains the solution for optimized routes.
Order notification Is available at the system
Fig. 5. Example of optimized routing using application that applies heuristic algorithm and uses Google Maps.
Cook processes the Order
IV. DESIGN RESULT
Start
Orders via Telephone/ Website
Customer & Order
Completes the data
Accepts Accepts order order & & validate validate customer customer & & order order data data Asks Asks data data via via Phone/sends Phone/sends email email to to customer customer
No
19
Is Is data data complete complete ?? Yes
Chooses the nearest outlet from customer address
Generates delivery route
Delegates order handling to outlet
Customer & Order, Delivery Route
Staff prints the payment bill Delivery staff download the order and delivery route data into mobile phone Receives order and does payment
A. Data Design The Physical Data Model (PDM) can be used as the base for implementing the database and table structure of the application. The PDM of web-based food ordering application can be seen in Fig. 6.
Staff delivers the ordered items Delivery staff returns and reports the payments
MENU_OUTLET KODE_OUTLET Text(20) KODE_MENU Text(50)
MENU_ITEM KODE_MENU_ITEM Text(50) KODE_KAT Text(50) PILIHAN Text(100) HARGA Text(20) VOLUME Text(10) DESKRIPSI Memo
PAKET_ANTAR ID_PAKET_ANTAR LongInteger ID_OUTLET Text(50) KODE_KARYAWAN Text(50) KODE_KENDARAAN Text(20) TANGGAL_ANTAR DateTime JAM_ANTAR DateTime JAM_KEMBALI DateTime TOTAL_EST_WAKTU Text(20) TOTAL_EST_JARAK Text(20) CURRENT_POS_LONG Text(50) CURRENT_POS_LAT Text(50) STATUS Integer
End
Fig. 3. The proposed food ordering business process.
A simple web-based application was developed to test the heuristic algorithm for routing optimization. This testing application also utilizes Google Maps API. In this application, user can input several locations/addresses, and then Google Maps API will return the coordinate of those locations. This function can be seen in Fig 4.
PAKET_ANTAR_RUTE ID_PAKET_ANTAR LongInteger TUJUAN_KE Integer LONG_START Text(50) LAT_START Text(50) LONG_END Text(50) LAT_END Text(50) OUTLET KODE_OUTLET Text(20) NAMA_OUTE Text(250) DESKRIPSI Memo ALAMAT Memo LONGITUDE Text(50) LATITUDE Text(50) JAM_BUKA DateTime JAM_TUTUP DateTime STATUS Integer
KATEGORI_PRODUK KODE_KAT Text(50) NAMA_KAT Text(250)
KARYAWAN_OUTLET KODE_OUTLET Text(20) KODE_KARYAWAN Text(50) STATUS Integer
JENIS_KENDARAAN KODE_JENIS Text(20) JENIS_TEKS Text(100) VOLUME Text(10) DESKRIPSI Memo
KONFIG NAMA_KONFIG Text(50) NILAI_KONFIG DateTime KETERANGAN Text(250)
ORDER_CUSTOMER ID_ORDER LongInteger USERNAME Text(50)
ARTIKEL ID_ARTIKEL LongInteger JUDUL_ARTIKEL Text(250) SPOILER Text(250) ISI_ARTIKEL DateTime TGL_BUAT DateTime JAM_BUAT DateTime TGL_BATAS DateTime JAM_BATAS DateTime READER Text(50) STATUS Integer
JENIS_KARYAWAN ID_JENIS Integer JENIS Text(20) JENIS_TEKS Text(100) DESKRIPSI Memo
USR_PRIV_LINK ID_USR_PRIV LongInteger JENIS_PENGGUNA Text(50)
DAFTAR_USR_PRIV ID_USR_PRIV LongInteger USR_PRIV Text(250) DateTime GRUP Integer TIPE Text(50) URUTAN Integer
ID_USR_PRIV = ID_USR_PRIVUSR_PRIV_TEKS
Fig. 6. PDM of web-based food ordering system.
ISSN: 1942-9703 / © 2016 IIJ
ORDER ID_ORDER LongInteger TGL_ORDER DateTime JAM_ORDER DateTime TIPE_ORDER DateTime IP_ORDER Text(50) KETERANGAN Text(250) STATUS Integer
PELANGGAN NAMA Text(250) TGL_LAHIR DateTime TGL_DAFTAR DateTime ALAMAT Memo WILAYAH Text(250) EMAIL Text(100) TELEPON Text(15) EXT Text(5) LONGITUDE Text(50) LATITUDE Text(50) TGL_LAST_LOGIN DateTime IP_LAST_LOGIN Text(20) USERNAME Text(50) PASSWORD Text(100) REG_SOURCE Text(10)
KENDARAAN_OUTLET KODE_OUTLET Text(20) KODE_KENDARAAN Text(20) STATUS Integer
KARYAWAN KODE_KARYAWAN Text(50) NAMA_DEPAN Text(50) NAMA_BELAKANG Text(50) TEMPAT_LAHIR Text(50) TGL_LAHIR DateTime TGL_MASUK DateTime TGL_LAST_LOGIN DateTime PASSWORD Text(100) JENIS_KARYAWAN Text(20) JENIS_KENDARAAN Text(20) STATUS Integer IS_SET Text(50)
ORDER_EXPRESS ID_ORDER LongInteger NAMA Text(250) ALAMAT Memo WILAYAH Text(250) EMAIL Text(100) TELEPON Text(15) EXT Text(5) LONGITUDE Text(50) LATITUDE Text(50)
PAKET_ANTAR_ORDER ID_PAKET_ANTAR LongInteger ID_ORDER LongInteger TUJUAN_KE Integer STATUS Integer
KENDARAAN KODE_KENDARAAN Text(20) KODE_JENIS Text(20) JENIS_TEKS Text(100) VOLUME Text(10) NAMA_KENDARAAN Text(50) NO_PLAT Text(10) DESKRIPSI Memo STATUS Integer
JADWAL_OUTLET KODE_OUTLET Text(20) KODE_OUTLET_TEKS Text(250) NAMA_JADWAL Text(200) TANGGAL DateTime JAM_BUKA DateTime JAM_TUTUP DateTime DESKRIPSI Memo
Fig. 4. Example of application that applies heuristic algorithm and uses Google Maps.
ORDER_MENU ID_ORDER LongInteger KODE_MENU_ITEM Text(50) JUMLAH Text(10) HARGA Text(20)
MENU KODE_MENU Text(50) KODE_KAT Text(50) NAMA_MENU DateTime
20
INTERNETWORKING INDONESIA JOURNAL
As to Android-based food ordering application, the PDM can be seen in Fig. 7. This PDM implies that the mobile application will save into and query data from the following tables. The mobile application downloads the data from the developed web service.
Meanwhile, the system user characteristic can be seen in the following Table 1. TABLE I USER CHARACTERISTIC
ORDER_ANTAR
PAKET_ANTAR ID_PAKET_ANTAR ID_OUTLET ID_KARYAWAN KODE_KENDARAAN TANGGAL_ANTAR JAM_ANTAR JAM_KEMBALI TOTAL_EST_WAKTU TOTAL_EST_JARAK TOTAL_VOLUME CURR_LONGITUDE CURR_LATITUDE CURR_DEST STATUS
Integer Text(30) Text(30) Text(30) Text(20) Text(10) Text(10) Text(30) Text(30) Text(30) Text(50) Text(50) Integer Text(30)
ID_PAKET_ANTAR ID_ORDER TUJUAN_KE TGL_ORDER JAM_ORDER SUB_TOTAL_HARGA ONGKOS_DELIVERY TOTAL_HARGA UANG_BAYAR TOTAL TIPE_ORDER KETERANGAN NAMA ALAMAT TELEPON EXT STATUS
User
Integer Text(50) Integer Text(20) Text(10) Text(30) Text(30) Text(30) Text(30) Text(50) Text(20) DateTime Text(250) DateTime Text(20) Text(10) Text(30)
Activities
Operator
Manage Customer order, delegate the orderhandle task to eligible outlet, and check the order status
Customer
Register as buyer in the food ordering system, make order, check the order status and Delivery Staff position.
Cook
Receive notification of new order and notify
DETAIL_ORDER_ANTAR ID_ORDER KODE_MENU_ITEM NAMA_ITEM JUMLAH HARGA TOTAL
Text(50) Text(50) Text(250) Integer Text(50) Text(50)
Delivery Staff that the order has been handled and the food is ready to delivered. Delivery Staff
Download routing data, initiate delivery
RUTE_ANTAR ID_PAKET_ANTAR TUJUAN_KE LONG_START LAT_START LONG_END LAT_END STATUS
TOBING
Integer Integer Text(50) Text(50) Text(50) Text(50) Text(30)
process, do delivery closure Administrator
Manage the system parameters based on the management policy, such as change the delivery fee, manage the menu and manage
Fig. 7. PDM of Android-based food ordering system.
new outlet
B. Main Functions and User Characteristics The main functions of the food ordering system are: 1) Customer registration. This enables customer to save personal details for the next orders. Customers are also forced to register first before placing order in the system. 2) Outlet delegation function. This function to choose the suitable outlet for handling the order. It is based on the distance between outlet and customer address. 3) Generate optimized delivery address routing. Optimized routing is generated in the system to provide detailed information about the sequence of delivery routes. 4) Order management. Order management enables the staff of the restaurant to receive the order information and update the status of each process. 5) Order status checking. This function enables customer to monitor the status of his/her order. 6) Order closure function. This function is to close an order by changing the status of the order as being handled and the payment has been reported. Other than that, the application should be able to have the configuration of: 1) The address and exact coordinate of the outlets. 2) The opening and closing time of an outlet. This configuration to make sure that only available outlet that can handle the order. 3) Delivery fee, which is a sum of money that must be paid by Customer to have delivery service. This fee will be added automatically to the order bill. 4) Food menu that can be ordered by Customer. 5) The available vehicles and the number of Delivery Staff.
C. Web Service The data communication between web-based and Androidbased application is mediated by a web service. Using the web service, the Android-based application can access the order information produced by the web-based application. The web services also provide service that enables the Android-based application updating the current position of the Delivery Staff. V. IMPLEMENTATION RESULT The development tools for developing the food ordering system can be seen in Table II. TABLE II DEVELOPMENT TOOLS User
Activities
Platform
Microsoft Windows, Android
Application Server
Apache server, MySQL server
IDE
Eclipse, Editplus
Technology
Web Service, JSON, CSS
Database
MySQL, SQLite
Programming Language
PHP, JAVA, HTML, Javascript
API
Google Maps
After coding the application, the screenshot of web-based food ordering system homepage can be seen in Fig. 8.
Vol.8/No.1 (2016)
INTERNETWORKING INDONESIA JOURNAL
21
[6]
List of devices with assisted GPS. Available: http://en.wikipedia.org/wiki/List_of_devices_with_Assisted_GPS. Accessed on April, 1st, 2015. [7] Google Maps API Web Services. Available: http://code.google.com/apis/maps/documentation/webservices. Accessed on April 1st, 2015. [8] Android. “Android Developer”. Available: http://developer.android.com/. Accessed on April, 1st, 2015. [9] C. Nilsson. “Heuristics for the Traveling Salesman Problem”. Available: https://web.tuke.sk/fei-cit/butka/hop/htsp.pdf. Accessed on April, 1st, 2015. [10] S. Lin, B. W. Kernighan, “An Effective Heuristic Algorithm for the Travelling-Salesman Problem”. Available: http://www.seas.gwu.edu/~simhaweb/champalg/tsp/papers/LinKernigha st nOriginal.pdf. Accessed on April, 1 , 2015.
Fig. 8. Screenshot of web-based food ordering system.
Meanwhile, the screenshot of Android-based food ordering system can be seen in Fig. 9.
Roy Deddy Hasiholan Tobing is a lecturer in Faculty of Informatics Engineering and Electro, Del Institute of Technology, Laguboti, Indonesia. He received his B. Eng. degree from Institut Teknologi Harapan Bangsa, Indonesia in 2012 and M.I.C.T. degree from University of Wollongong, Australia in 2014. His main research interests are text mining, mobile application development and social media.
Fig. 9. The screenshot of Android-based food ordering system.
VI. CONCLUSION This research proposed and developed food ordering system that are of web-based and Android-based application. In future research, the author suggests adding more variable for routing optimization process, such as the type of the vehicles, the size of food package, holiday season, the driver license type owned by Delivery Service, and the maximum capacity of a vehicle type. These additional variables will add the complexity of the routing optimization. REFERENCES [1] [2] [3] [4]
[5]
Home KFCKU. Available: http://www.kfcku.com. Accessed on June 15th, 2015. McDelivery Indonesia. Available: https://www.mcdelivery.co.id. Accessed on June 15th, 2015. PHD Ahlinya Delivery. Available: https://www.phd.co.id. Accessed on June 15th, 2015. D.S. Johnson, L.A. McGeoch. ”The traveling salesman problem: A case study in local optimization” Local Search in Combinatorial Optimization, 1997, pp 215-310. F.A.T. Montane, R.D. Galvao.” A tabu search allgorithm for the vehicle routing problem with simultaneous pick-up and delivery service”. Computers & Operations Research , vol. 33, no. 3, pp. 595–619, 2006.
ISSN: 1942-9703 / © 2016 IIJ