WASTE TRUCK ROUTING AND SCHEDULING IN LOS BAÑOS LAGUNA USING VEHICLE ROUTING HEURISTICS A Research Proposal In Partial Fulfillment for the Requirements in Eng 10 – Writing of Scientific Papers Submitted by: CARLO LUIS M. BATION BS in Computer Science Submitted to: ERIC P. PALIGAT Instructor UNIVERSITY OF THE PHILIPPINES LOS BAÑOS First Semester School Year 2011-2012 I. INTRODUCTION A. Significance of the Study The study of waste management involves many fields. One of the main aspects of waste management is waste truck routing and scheduling. It greatly involves graph theory and route optimization on its background. We can say that each stop represents a node and the ways to each node represents the edges in graph theory. Solving the graph problem can lead to route optimization. This leads to the main theme of the study which is to improve scheduling and routing of waste truck in a given area using real world maps. In the Philippines today, usually waste truck management is taken care by government offices and usually by the city of the mayor office. Most don’t have a system to schedule the routes of the waste trucks in their area. A routing system is needed in order to minimize cost, manpower and time. It minimizes cost by giving the shortest paths, the minimum way to traverse a group of clients or nodes and this will minimize the usage of gasoline. It also minimizes the possibility the truck to be damage because of the fact that the truck will traverse the minimum route and travel for a short time period. Manpower because we can come up with a solution of minimizing the number of trucks then if the number trucks to be used are minimized, the number of drivers and assistants will also be reduced. The use of time will also be minimized when we consider the weight and type of waste in each node as a parameter. When we know the estimated amount of waste per node the number of going back of the trucks to the depot will be reduce so cost and time here will be reduced. In foreign countries there is a competition in waste collection. Many companies like SA Waste Holdings, Greenstar and WSN Environmental Solutions competes for customers. One of the factors that can be used as a main weapon on other companies is to have a better way of routing in order to traverse more nodes and to have minimum company expenses in the collection system. The study also uses the real world maps. So that if a road or something was changed in the topography of the concerned area, the manager will just again run the system and it will produce new results of routes and schedules for the new map. The map of Los Baños Laguna will be the first input in the system. This map has interesting routes and has many ways to traverse a given node or place meaning there are more than one way to go to a place. There is also one depot or dump site in the map so the problem will be simplified. The types of garbage in the map also vary. Because of the existence of hospitals in the map, the hospital waste will be included in the constraints of types of wastes. The map also includes the University of the Philippines Los Baños and inside the university there is a building called Physical Science building that produces toxic or chemical waste that is another type of waste. So, not just biodegradable and non-biodegradable types of wastes will be the constraint of the study. The focus of this paper is to develop software that can return near optimal routes and schedules for the waste truck to follow. The solutions will be based from vehicle routing heuristics like branch and bound and traveling salesman algorithms. The map of Los Baños Laguna will be the starting point of the study and other maps will be chosen as input to train the software to be generic and adapt in any kinds of map in the future. B. Review of Related Literature Waste truck routing and scheduling can be solve using vehicle routing heuristics and other related concepts such the Traveling Problem. Heuristics are those methods that can be program in polynomial time and give results that are near to the optimal solution to the problem. Optimal solution can be achieved in exponential time, meaning as the number of input increases the amount of time also increases exponentially. Heuristics were developed in order to have an acceptable solution to a problem. It runs in polynomial time, meaning as the number of input increases the amount of time only increases linearly. In this part of the paper related literature about waste truck routing and scheduling in terms of combinatorial optimization will be presented. The first is the Traveling Salesman Problem (TSP). It is based from the 1857 game called Icosian Game invented by Sir William R. Hamilton (J. Dalgety, 2009). The rule of the game is to visit 20 connected points with going to a point only once. We can relate traveling salesman to our problem by making the number of trucks equal to one. It means that the single truck will traverse all nodes or customers. Branch and Bound algorithm can give a near optimal solution to TSP. The idea of branch and bound algorithm is that you will make a tree. Find the row minimum of a given matrix of constraints then it will be the starting node of the tree. After finding the row minimum detect the indexes of the matrix that are involve in the row minimum Then compute the different sub tours of the remaining indexes of the matrix and again add the nodes to the parent and repeat the process until an stopping criteria is detected. Branch and Bound algorithm was first presented by A.H. Land and A.G. Doig in their book. The book also contains other combinatorial problems. Many papers were publish and presentations were made regarding to the solution of TSP using the Branch and Bound Algorithm. The concept of parallelization was also introduced to make the computation of nodes of the tree in the algorithm (S. Tschoeke and et al, 1995). This is done by assigning different task to each of the processors and because of this the result generation will be fast as like doing the computation in a sequential process with few data. A presentation made by Busby, Dodge, Fleming and Negrusa about Backtracking and Branch and Bound algorithm tells how the concept of backtracking helps to know the solution to the TSP in a faster way by implementing some methods related to backtracking. Remember that in Branch and Bound algorithm sometimes if the cost of the current child node is greater than the cost of the previous child nodes then it is needed to go back one higher level in order to come with another better solution and concepts of backtracking can help to find a better path. This is how the combination of backtracking and branch and bound algorithm works: (1) Branch and bound will create the tree of possible paths, (2) as it creates the tree a pointer will check if the current node has the lowest cost (3) then if not a backtracking algorithm will be used and the pointer to the current node will go to another node which have the lowest cost until near optimal path or a stopping criteria is found. An implementation of the said algorithm written in a programming language called java was made by Pawel Kalczynski in 2005. Pawel made a package of classes in java based from the processes involved in the algorithm and in TSP. Pawel based his package in the Branch and Bound Algorithm made by Balas(1985). As what we can see solving TSP using Branch and Bound Algorithm requires too much computing power and takes a lot of time. So we need some other methods that can solve TSP in a “serial” way or a simpler way. The paper of Christian Nilsson presents many different heuristics about TSP (2003). One of the methods that were presented was the nearest neighbour algorithm. The idea of this method is to find the nearest accessible node then go to it if it is not yet visited. In waste truck problem with the number of trucks equal to one the starting point is the depot or the garage of the truck and from the depot it will go to the nearest area assigned to it. The next graph combinatorial problem related to the waste truck routing and scheduling is the vehicle routing problem (VRP). Given number of customers with each having certain demands (time and cost), each customer have distances on each other and each have weights (garbage in terms of waste collection). The goal of the VRP is to (1) minimize the number of vehicles to be use or to optimally use the existing number of vehicles (2) to satisfy the customers by getting the requirements on time and (3) to have a near optimal path to traverse all the customers(Garn, 2003). Vehicle routing problem with time windows (VRPTW) is a type of VRP which added time as a constraint. The idea is that each node or customer has “starting time” and “end time”. The “starting time” is the earliest time the vehicle should arrive to the node and the “ending time” is the latest time the vehicle should arrive to the node. Solomon on his paper on 1987 lists some heuristics on how to come up with a solution to the VRPTW. One of the heuristics that was presented on the paper is the time oriented nearest neighbour algorithm. The algorithm was similar to the TSP’s nearest neighbour algorithm the VRP version just added the number of vehicles and the time windows as additional constraints. Another heuristic that was presented by Solomon is the insertion heuristic. The goal of the heuristic is to insert a new node that is not yet in the current partial path. The insertion of the new node can be in any part of the partial path and the resulting partial path of the insertion should be feasible. In terms of waste truck routing not only time windows can be added as a constraint but also the lunch break of the drivers also needs to be consider (Byung-In and et al., 2005). Extension of Solomon’s insertion algorithm was made so that a better time window handling will be done and to have an optimal lunch break for the drivers. Another constraint that can be added to the problem is the number of available vehicles that already existed (Hoong and et al., 2003). The problem here is that what if the number of vehicles available where not yet sufficient in order to have the optimal path for waste collection so some customers will be not served. Holding list is used to store customers that were not served in the resulting path. Maximization of customers into the vehicles was made so that all customers will be served. Tabu search was used to insert customers in a vehicle schedule. Tabu search is an enhanced version of local search. It uses data structures to store all visited candidate solutions to avoid repetition in searching. Evolutionary methods such as genetic algorithm and coevolutionary genetic algorithm approach can be used in solving VRP (Penousal, 2002). These methods can come up with better solutions than normal heuristics. Both algorithms came from the concept of genetics in science mainly the theory of evolution of Charles Darwin. The algorithm can be simply describe in this steps: (1) generate possible solutions (2) evolve this solutions to new set of solutions (3) loop until a stopping criteria is found.The solutions will evolve as the given constraints changes. The coevolutionary genetic algorithm add some heuristics, like nearest neighbour algorithm, to generate some of the possible solutions while the simple genetic algorithm uses random possible solutions at the starting phase of the genetic algorithm. So the result of the coevolutionary genetic algorithm is nearer to the optimal solution than the result of the simple genetic algorithm. In this study we will use the data generated by Open Street Map (http://www.openstreetmap.org/) an open source online mapping system. In Open Street Map you can convert a given map into xml and download it. This xml file have attributes like “lat” (latitude) and “long” (longitude) that can be used into knowing the position of a place in the map this is from. In the Philippines there are two websites that are using Open Street Map as their mapping service for their users. Those are Ortigas Online and Red Cross Rizal Chapter. The Wikipedia page(http://wiki.openstreetmap.org/) of Open Street Map is the source for this data. Traveling Salesman Problem algorithms are essential for path finding and can help solving the problem with the number of trucks is equal to one. Vehicle Routing Problem with Time Windows algorithms are essential for routing with capacity and time as main constraints. The basics and some applications of openstreetmap is essential in order to have a real world nodes represented by the places in the given map. These concepts can help me accomplish my objectives in this study. C. Objectives of the Study The main objective of this study is to make software that produces near optimal routes and schedules for waste trucks given an input map from openstreetmap.org. 1. To solve the problem using vehicle routing problem heuristics. 2. To make a graphical user interface from the map that can accept inputs from user. Examples of inputs are name of the area, weight of garbage in an area and time window for that area. 3. To produce routes lines in the given map and schedules as an output. Routes lines are lines that connect one area from another area based from the resulting path. An assignment colour for a truck will be given to visualize the route of a truck in the map. For example for truck A colour yellow will be given. 4. To extend the constraints into heterogeneous trucks. Meaning that a truck can have different capacities and specs. 5. To start to the map of Los Baños Laguna as the first input to the software. D. Date and Place of Study The study will be done at the Institute of Computer Science, College of Art and Science University of the Philippines Los Baños Laguna from October 2011 to January 2012. II. Methodology A. Methods 1. Parsing the “osm” file. a. The “osm” file is an input of the user that can be downloaded at openstreetmap.org. b. The user will enter this “osm” file to the parser of the system. c. This parser will convert the “osm” file which is in “xml” format to usable inputs for the problem. d. The “xml” file has different tags that denote a particular element like nodes, ways, longitude, latitude and other elements in the map. 2. Rendering the “osm” file. a. To have a personalized view, rendering the “osm” file and combining the data that was collected in the parsing part is needed. b. User interface will be shown in this phase where the user can pinpoint nodes that he/she wants to service. c. In the user interface there is also a spinner that lets the user to enter the number of trucks the user want to use. 3. User Interface for entering inputs. a. This includes the creation of the buttons, combo boxes or selection boxes, the design of the interface of the system. b. The creation of these elements is for the user to interact to the system and to put the user’s input to the system. 4. Converting the inputs into values for the graph problem. a. The user will tag a node that the user wants to service. This tagging system will enclose the selected node into a rectangle. b. Then because of the rectangle the system can now get the distances of each rectangle to other rectangles. c. Using this code snippet: Math.sqrt(((x-x1) * (x-x1)) + ((y-y1) * (y- y1))), the system now can compute for the distances of each rectangle in the map. 5. Solving the Graph problem. a. Getting the path for each truck. i. Using the nearest neighbour algorithm with linear truck assignment. The computation will always start with the depot or the 0th index in the matrix. ii. The system will compute the shortest path using the nearest neighbour algorithm. b. Nearest neighbour algorithm i. From the depot select the nearest node to it. ii. Go to that node if it is not visited yet but if it is visited then find another near node to the previous node. Store the selected node to the list of visited nodes. iii. Repeat step one until all nodes are covered. c. Assigning the nodes in each truck. i. After getting the shortest path assign each node in the list of visited nodes in each truck. ii. The assigning technique is simple. First divide the number of nodes by the number of trucks. Then the quotient will be the number of nodes that will be assigned in a truck. iii. If there is a remainder then assign them equally in each truck. iv. The assignment will be based on the list of the visited nodes. v. To give a better look for this algorithm here is an example. In case the resulting list of visited nodes is [0 ,3, 4, 2, 1] where “0” is the depot and there are two trucks then the assignments for each truck are for truck A [0, 3, 4] and for truck B [0, 2, 1]. vi. Another example is if there is a remainder. For example the resulting list of visited nodes is [0, 5, 3, 4, 2, 1] and the number of trucks is 2. There is a remainder which is one. The assignment will be for truck A the nodes are [0, 5, 3, 4] and for truck B the nodes are [0, 2, 1]. The remainder was assigned to the truck that have the route nearest to the depot so that if it’s capacity of carrying garbage exceeds because of the added remainder node to it, then it can go back to the depot to dump it’s garbage then go back to the node that is not serviced yet. d. Optimizing the path using the genetic algorithm. i. After finding the path using the nearest neighbour algorithm the next step is to optimize the path by using the principles of genetic algorithm. ii. The first step of the algorithm is the generation of the initial population of possible solution. For our problem half of the population will be generated randomly and half of the population will be generated using the modification of nearest neighbour algorithm. The modification of the nearest neighbour algorithm is to calculate other short paths to the depot. Meaning the second path, the third path up to the nth path. The random part of the population will be the permutation of the number of nodes. iii. Then calculate the fitness of each path or chromosome (chromosome is the term in genetic algorithm that means a possible solution to the problem). The fitness function considers the minimum value of the distance travel by each truck and also considers the estimated capacities of each truck for the given chromosome. iv. Next step is the selection where the system selects the fittest chromosomes and kills all weak chromosomes. For this research the fitness of each chromosome will be sorted and the weak half of the population will be disregarded. v. The fifth step is the mutation part where we combine two paths to form a new path. The formation of a “child” is by randomly selecting a part of the path then combining the parents based from the selected part. Example path A [1,2,4,3] and path B [2,1,3,4] the resulting child can be the Child [1,2,3,4]. The selected part is the second node of each path. Node 1 and node 2 is from path A while nodes 3 and 4 are from path B. vi. Stop if the fitness is not changing in a great way or stop if the indicated number of generations where achieved. 6. Plotting the path in the map and generating a result text file. a. After finding the near optimal path given by the system it is time to plot the resulting path for each truck in the map. b. The trucks will have different colours in terms of lines that will be plotted in the map. c. There is also a text file that contains the path and the node assignment for each truck. B. Detailed Schedule of Activities Date Activities October 16 – 17, 2011 Research about the renderer and parser of the osm file. October 18 - 22 Creation and implementation of the parser and renderer of the osm file. October 23 –29 Creation of the solver. This involves the implementation of the nearest neighbour and genetic algorithm. October 30- November 2 Rest. Create paper for the results and research. November 3– 4 Combine the parser, renderer and the solver. November 5 – November 9 Polishing and additional research for the software. November 10 Initial presentation to my adviser Si Jaime Samaniego. November 11 – 18 Optimization and addition of requirements set by Sir Samaniego November 19 - 23 Rest. Create paper for the results and research. November 24 Second Presentation to Sir Samaniego. November 25 – January 2012 Testing, optimization, creation of additional requirements, creation of paper and frequent visit to instructor. III. Curriculum Vitae A. Personal Information Name: Nickname: Date of Birth: Place of Birth: Permanent Address: Religion: Email Address: Carlo Luis M. Bation Carlo January 30, 1992 East avenue medical hospital Quezon City Blk. 1 Lot 26 North Ridge Royale Palmera Brgy. Sto. Cristo City of San Jose del Monte Bulacan Roman Catholic carloluisbation@gmail.com B. Educational Background Elementary Secondary Tertiary Sto Rosario Sapang Palay College Area I Sapang Palay City of San Jose del Monte Bulacan San Rafael Elementary School Area H Sapang Palay City of San Jose del Monte Bulacan Sapang Palay National High School Fatima 5 Area E Sapang Palay City of San Jose del Monte Bulacan University of the Philippines Los Baños Laguna University of the Philippines Los Baños College Laguna 1998-2000 6th honourable mention 2000-2004 3rd honourable mention 2004-2008 5th honourable mention Bachelor of Science in Computer Science 2008-present REFERENCES BALAS, E. and P. TOTH, (1985) Branch and Bound Methods, in E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys, eds., The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, Wiley, New York, pp.361 - 401. BUSBY and et al.,(2009). Backtracking and Branch and Bound Algorithm [online], Available from: http://www.academic.marist.edu/~jzbv/algorithms/StudentProjects/BacktrackingandB andB.ppt BYUNG-IN, K., K. SEONGBAE and S. SURYA (2005) Waste collection vehicle routing Problem with Time Windows DALGETY, J. (2009).The Icosian Game. [online], Available from: http://www.puzzlemuseum.com/month/picm02/200207icosian.htm GARN W. (2007) Vehicle Routing Problem Algorithm [online], Available from: http://osiris.tuwien.ac.at/~wgarn/VehicleRouting/vehicle_routing.html HOONG CHUIN L., S. MELVYN AND M.T. KWONG (2003) Vehicle Routing Problem with Time Windows and a Limited Number of Vehicles KALCZYNSKI P., (2005) A Java Implementation of the Branch and Bound Algorithm: the Asymetric Traveling Salesman Problem, in Journal of Object Technology, 4(1) pp. 155-163. LAND, A. H.and A. G. DOIG (1960). An automatic method of solving discrete programming problems. Econometrica 28 (3): pp. 497-520 N.D Waste companies. In Wikipedia. Retrieved October 15, 2010, Available from: http://en.wikipedia.org/wiki/Category:Waste_companies NILSSON, C., (2003) Heuristics for the Traveling Salesman Problem. A Report for Theoretical Computer Science. PENOUSAL M, T. JORGE, P. FRANCISCO, C ERNESTO. (2002), Vehicle Routing Problem: Doing it the Evolutionary Way, Genetic and Evolutionary Computation Conference, GECCO-02, New York, USA SOLOMON M. (1987) Algorithms for the Vehicle Routing and Scheduling Problems with Time Window Constraints, in Journal of Operations Research 35 pp.254-265 TSCHOEKE, S., R. LUELING and B. MONIEN.(1995) .Solving the Traveling Salesman Problem with a Distributed Branch-and-Bound Algorithm on a 1024 Processor Network, in Journal of Parallel Processing Symposium.pp. 182-189