final report ieor 180

37
INTRODUCING NEW YOSHI WWW.STARTYOSHI.COM IEOR 180 Prof. Kaminsky Dear David Gobaud, We are excited to introduce the final report of an extended version of the vehicle routing problem suited for Yoshi Inc. Although this report marks the culmination of four months work, it certainly does not signify that planning for the optimized solution is complete. It is but a milestone - the planning and formulating for optimization will continue. This report focuses on the optimal route of service to travel for each vehicle in order to minimize cost, while also figuring out when and where we should refill the fuel-tank. To clearly define our problem, we start by formulating an integer linear program with all the necessary constraints to address the problems. However, because of the complexity of ILP, another solution approach needs to be made. An algorithm based on the compilation of various VRP heuristics can be used to solve the problem and generate optimized solution, and when supported with further software development, can create an automated system for route optimization. This report suggests ways in which such plans can be coordinated to ensure that Yoshi Inc. optimally benefits from our investments. We also would love to invite you to meet with us to discuss our recommendations. Respectfully submitted, Calvin Gozali, Catherine Darmawan, Jay Jung, Jessica Wijaya, Jonathan Sumarto.

Upload: catherine-christabel-darmawan

Post on 10-Feb-2017

42 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Final Report IEOR 180

INTRODUCING

NEW YOSHI

W W W . S T A R T Y O S H I . C O M

I E O R 1 8 0P r o f . K a m i n s k y

Dear David Gobaud,

We are excited to introduce the final report of an extended

version of the vehicle routing problem suited for Yoshi Inc.

Although this report marks the culmination of four months

work, it certainly does not signify that planning for the

optimized solution is complete. It is but a milestone - the

planning and formulating for optimization will continue.

This report focuses on the optimal route of service to

travel for each vehicle in order to minimize cost, while also

figuring out when and where we should refill the fuel-tank.

To clearly define our problem, we start by formulating an

integer linear program with all the necessary constraints to

address the problems.

However, because of the complexity of ILP, another

solution approach needs to be made. An algorithm based

on the compilation of various VRP heuristics can be used

to solve the problem and generate optimized solution, and

when supported with further software development, can

create an automated system for route optimization. This

report suggests ways in which such plans can be

coordinated to ensure that Yoshi Inc. optimally benefits

from our investments. We also would love to invite you to

meet with us to discuss our recommendations.

Respectfully submitted,

Calvin Gozali, Catherine Darmawan, Jay Jung,

Jessica Wijaya, Jonathan Sumarto.

Page 2: Final Report IEOR 180

IEOR 180 Spring 2016

Final Report

Yoshi, Inc.

Submitted By: Calvin Gozali

Catherine Christabel Darmawan Jay Jung

Jessica Audrey Wijaya Jonathan Sumarto

Under the Guidance of: Prof. Philip M. Kaminsky

Tugce Gurek

1

Page 3: Final Report IEOR 180

Table of Contents 1. Executive Summary …………………………………………………………………….. 3 2. Introduction ……………………………………………………………………………... 4 3. Problem Statement ………………………………………………………………………4 4. Problem Formulation ………………………………………………………………….... 5

4.1. Definition ……………………………………………………………………….... 5 4.2. Parameters ……………………………………………………………………….5 4.3. Decision Variables ……………………………………………………………….6 4.4. Assumptions ……………………………………………………………………...7 4.5. Formulation ……………………………………………………………………... 8 4.6. Constraint Description ………………………………………………………….9 4.7. Performance Measures ……………………………………………………….. 11

5. Problem Analysis and Solution Approach …………………………………………... 11 5.1. Preliminary Analysis ………………………………………………………….. 11

5.1.1. Additional Feature (Mobile Depot) ………………………………….... 14 5.2. Sample Data ……………………………………………………………………. 15 5.3. Solutions (Data 3-1 Input) ……………………………………………………... 15

5.3.1. Solutions (3-1 Input) with Mobile Depot ……………………………... 16 5.4. Solutions (Data 3-3 Input) ……………………………………………………... 17

5.4.1. Solutions (3-3 Input) with Mobile Depot ……………………………... 18 6. Summary and Conclusions …………………………………………………………… 18 7. Recommendations ……………………………………………………………………... 20 8. Bibliography …………………………………………………………………………..... 21 9. Appendix ………………………………………………………………………………... 22

9.1. Sample Data (3-1 Input) ……………………………………………………….. 22 9.1.1. Data 3-1 with Mobile Depot …………………………………………… 27

9.2. Sample Data (3-3 Input) ……………………………………………………….. 29 9.2.1. Data 3-3 with Mobile Depot ………………………………………….... 35

2

Page 4: Final Report IEOR 180

1. EXECUTIVE SUMMARY

Nowadays, business models are starng to shi from having customers get the goods themselves ‐ such as going to stores and buying the products there ‐ to having the goods delivered to the customers instead, which basically means relying more on service. The service industry is growing very rapidly as we can see from the many successful companies who are providing food delivery service and transportaon service or even huge companies such as Amazon who now delivers grocery and daily necessies to customers. With this, comes the problem of figuring out how to deliver products to customers in the most cost‐efficient and effecve way. In this project, we are considering a more complex Vehicle Roung Problem (VRP), where not only do we have to consider the capacity of each different type of goods, we also have a specific me windows for service and intermediate depots, where goods will be refilled somewhere in the route we generated. While the main objecve is to sasfy all customer demands for every me period, we also want to minimize the total distance travelled by each vehicle. Since we want the goods to be replenished in the intermediate depots, instead of going back to the original point, we have to consider when and where in the route should the vehicle replenish the goods. In addion to that, we can also have mulple vehicles starng at different point of origin and ending at their respecve point of origin. To begin, we started to model this problem using an Integer Linear Program (ILP) with the necessary constraints to further understand the scope of the problem. However, given the number of variables and constraints that grow exponenally, it is not possible to solve this problem using ILP (due to the fact that VRP is an NP‐hard problem). Instead, we developed a heurisc algorithm as another approach to reach a soluon. This approach ulizes several different algorithms and mathemacal models, namely sweep algorithm, local search algorithm and the Travelling Salesman Problem, to solve the problem. To further improve the model, as requested by our client, we also implement the P‐median algorithm to determine the opmal locaon of mobile depots that will replace currently exisng intermediate depot. This will be the next step taken by our client in expanding the business. Aer doing some test runs with a few different data sets, the heurisc works really well, generang possible routes that sasfy all the constraints we specified. The added algorithm for the new mobile depot feature also works, giving a beer soluon (decrease in our objecve value) than the original problem where we use intermediate depot. This reducon in objecve was just as expected. With this formulated algorithm, the next step will be to make the process more automated by creang scripts/coding our algorithm into a soware that can generate the output faster, more automated, and with beer consistency.

3

Page 5: Final Report IEOR 180

2. INTRODUCTION Yoshi Inc. is a startup company, ready to serve all of its customers around town, filling up different types of gas to customers’ cars and saving the customers trips to the gas staons. This service will be conducted by small trucks, travelling around town to cover all the customer demands, and refilling their fuels tank at Yoshi’s mobile depot when necessary. Not only that this will help customers to save me, it will also also save miles, save the Earth with less combuson and polluon emied from personal vehicles. The founders had the idea for gas delivery in the Summer of 2014 with the hope of implemenng this business model in the future when vehicles operate on fuel cell, such as hydrogen instead of gasoline. Since the development of electric and fuel cell energy are advancing rapidly, Yoshi hopes to grow rapidly as well in the future. The team came together and the ideas were incorporated on April 15th, 2015. Aer doing their first test deliveries in May 2015, they have been in full operaon since June 2015, Currently, Yoshi Inc. is sll a relavely small start‐up, consisng of four co‐founders and a varying number of contractors. Up to today, they have been serving customers in San Jose, San Francisco and Nashville area.

3. PROBLEM STATEMENT Yoshi’s current business model depends on serving as many customers as possible each day while also considering promised me window for their service. Currently, Yoshi’s gas trucks are equipped with three different gas tanks; regular, super, and plus. They need to determine the shortest route for each truck to travel to sasfy the maximum number of customers within their requested me window. Considering the limited capacity of the trucks’ tanks, they also need to determine where, along the route, should the trucks refill their tanks. Hence, this a Vehicle Roung Problem with specific me windows and intermediate re‐filling depot staons. Our objecve is to generate an algorithm that maximize the number of customer served and minimizes total route cost of each truck next while taking into consideraons these constraints. This can be done by combining several opmizaon techniques which will be further discussed in the next secon. Currently, the trucks are refilling their tank at certain exisng gas staons. However, Yoshi Inc. also plans to have bigger trucks later on that will act as mobile depot (intermediate fuel depot) where the smaller truck can refill their tank, replacing the currently used gas staon. Compared to the exisng gas staons, these mobile depots provide a more efficient and cheaper way to fill up gas because their locaon can be pre‐determined daily depending on

4

Page 6: Final Report IEOR 180

the demand for that day. In this extended case, the algorithm should also include the decision of where to place these bigger trucks opmally so that the lile trucks can meet up with them to refill their tank.

4. PROBLEM FORMULATION To start modeling this problem, we formulated an integer linear program. Our objecve is to maximize the number of customer to be served and then minimize the total cost of the route. The cost is defined by the total distance traveled by the truck while sasfying all the possible demands from customers, in between the given me windows for each, on a daily basis. The model is an enhanced and modified version of the basic VRP model (vehicle roung problem) with a cost‐minimizaon objecve with addional constraints: limited capacity, mulple depots, me windows, and intermediate facilies/dumps (fuel depots).

4.1. DEFINITION

We define the problem on a directed mulgraph G(O ∪ D ∪ P, E, K), where:

O is the set of start/end fuel trucks depots

D is the set of fuel depot where each fuel truck will be refilled before going to the next customer locaon. (For now, Yoshi will refill their gas in specific gas staons)

P is the set of customers

E = (i, j : i, j ∈ O ∪ D ∪ P, i , j) is the edge set

K is the set of available trucks

F is the set of fuel types

4.2. PARAMETERS

Firstly, we have π ij as the length of edge (i, j) where i is the inial point locaon and j is the next point locaon. This parameter portrays the 2D distance between every pairs of given nodes (as the input), calculated linearly with given latude and longitude coordinate of the given node locaons.

The vehicles may have a different speeds, but our client agree to assume a constant speed of 25 mph for the formulaon (assumpon discussed in the next secon), which results in a

5

Page 7: Final Report IEOR 180

vehicle specific travel me t ij as the travel me on edge (i, j). Travel me t ij can be computed by π ij /25. Each customer sets a me window, during which they leave their cars in a specific place to be fueled. This is modeled by seng a me window as [λ i , µ i ] for each point i , where λ i and µ i stand for the earliest and latest possible start‐of‐service me respecvely. Since depots are not directly associated with me windows, we consider dummy me windows [0, ∞] for them.

The car‐fuelling service duraon on each point i is denoted by ∈ i , and the demand of customer at point i of fuel type f is a volume of ρ if . Service duraon at depots, the pickup quanty volume, weight at depots and dumps are fixed at 0. There is a fixed, limited fuel capacity of volume Ω kf for each fuel type f that can be stored in a truck of type k .

4.3. DECISION VARIABLE

In this model, we introduce the following binary decision variables:

This parcular binary variable would help to determine the opmal route to the vehicle roung problem, taking the value of 1 if a path from one customer to another is opmal, and taking the value of 0 if otherwise. By combining the individual path between nodes that are turned on (or is equal to one) collecvely, we’ll get one long connuous route as the final soluon. This route, built by some chosen paths between nodes, will be taken by the truck, starng at the origin and end at the final desnaon depot, travelling to every customers locaons, and stops by the (oponal) depot sites when needed. In addion, there will be connuous variable Q ikf to track the cumulave volume of fuel type f that has been filled to the customers cars when the truck k reached point i , and S i to track the start‐of‐service me at point i .

6

Page 8: Final Report IEOR 180

4.4. ASSUMPTIONS

In this model, our client agreed to ignore real‐me traffic; this feature will be an extended aspect that is to be introduced in future development. This leads us to just assume a constant speed of 25 mph; this is the value that we are going to use throughout the model formulaon and report analysis. The uncertainty about this speed can make our model be an over/underesmate of the quality of the real soluon: when the truck is in the highway, it will travel with higher speed, so it will reach the desnaon sooner than expected, while in neighborhood locaon, it will travel with lower speed, hence reaching the desnaon later. Nevertheless, in praccally, the trucks will have to cover both situaons; hence, just using the average speed with 25 mph would sll give a good enough soluon for our current model. Our client also believes that for simplicity, based on the customer locaon provided (latude and longitude coordinates), we should just use them as X/Y coordinates on a 2D plane and calculate the inter‐distance linearly between these nodes. These values will represent π ij used throughout the model. It is obvious that the linear distance would be shorter than the actual distance (length of actual roads covered). Hence, the objecve generated would be lowered than the actual. Nevertheless, as this informaon about real‐distance is sll not available, this approach will be used first to generate an insight about the soluon. These values of can be replaced by the real distance between nodes in the future to generate the real/ideal soluon when the informaon becomes available.

Furthermore, since there is no detailed informaon we could gather on the working hours so far, we assume that there is no specific break me (e.g. lunch break) or fixed me windows (maximum working hours/day) required by the driver, relaxing any constraint on the available me the truck can operates on. In other words, the only me windows we are concerned of are those of the customers’ request. This could be adjusted in the future when the informaon becomes available. Implemenng this assumpon can have lile to no effect in the result if we sll have some buffer‐me between service, or can have some significant impact if we have a ght schedule, forcing us to miss servicing some demands. For instance, those services scheduled during the middle of the day has to be shied when the driver has to be assigned with some lunch break. This can impact a number of service, depending on when the next buffer me (free me in between services) exists. The worst case scenario would be when the schedule is ght and there is no more buffer me available that this lunch‐break shi would have to sacrifice the service for one of more demands.

Lastly, we also assume that we always start at the beginning of the day with the trucks full of fuel, so the variable Q ikf that keeps track the cumulave fuel volume would be set to 0 at

7

Page 9: Final Report IEOR 180

the origins and the depots. This could be adjusted accordingly however desired. First, if we can have more informaon about the service from the day before, we can just set the starng volume to be whatever is le from the last service on previous day. Another opon would be to ask the driver to fill up the tank at the end of the day before or to come earlier before service to fill‐up the tank of the truck, which will help making the service more efficient than to leave the tank filled with the remaining fuel from the previous day of service. The laer opon is the one we used for this model currently as we have no informaon about the fuel from last service.

4.5. FORMULATION For modeling purposes, we duplicate the set O as O’ for the origins and O’’ for the desnaons. For notaon purposes we set N = O’ ∪ O’’ ∪ D ∪ P. In addion, M is a big number for the sake of constraint relaxaon.

8

Page 10: Final Report IEOR 180

4.6. CONSTRAINT DESCRIPTION The above formulaon can be described more detailed as follows:

The objecve funcon (1) minimizes the total cost of the roung schedule, computed by adding up all the distance of the edges travelled in the route, while making sure that the objecve priorizes maximizing the number of customers served first.

If the path from i to j is part of the final route taken by truck k , the distance i → j will by mulplied by 1 ( x ijk = 1); otherwise, it’s mulplied by 0. In other words, π ij x ijk = π ij if path i to j is taken, and π ij x ijk = 0 if not. All of this are summed up to give the total distance of the route.

This extra term involving W is to make sure that the objecve first priorizes maximizing the number of customer served. Value of W is set by the last constraint below.

Constraints (2a) and (2b) impose that customer at point j (set P) can only be served if the truck k travels from node i to j and then from current node j to the next node i .

Node j needs to be passed by ( x ijk = 1), whatever the next desnaon i is (summing up over all possible points for i and the truck type k ) for all node j that is in set P (the set of customer locaon).

Constraints (3) and (4) ensures that the number of trucks that start from point O k ’ and end at point O k ’’ is equal to the number of trucks of type k used.

Here we assume that each truck type k has a fixed starng and ending point and thus making sure that each truck type k starts and ends at its predetermined locaon.

Flow conservaon is ensured by constraint (5).

It makes sure the pathways of each vehicle are connected to form one smooth route. In this case, the route would be … i → j → k → … so there would not be any disconnuity in the route generated.

Inequality (6) capacitates the cumulave volume of fuel on the vehicle at each point to make sure it does not exceed the maximum fuel capacity of the tank. Equaon (7) resets them to zero at the fuel depots, origins and desnaons

At origin, each truck of type k starts with a full tank of each type of fuel f , and we use Q ikf to keep track of how much fuel we lost so far, making sure that we do not go to the next customer node if we can not fill up the demand with the

9

Page 11: Final Report IEOR 180

amount of fuel le in the truck or has reached its maximum capacity. Therefore, Q ikf cannot be greater than Ω kf ; it can not serve fuel demands with a cumulave total greater than the capacity of its tank at any point i , and for any fuel type f .

Nevertheless, the truck is going to re‐fill all tanks when we go to the depots, so this resets the tracking variable Q ikf to 0. Once the tank is full, we do not have to take into consideraon all the demands it has sasfied up to this point. The truck is then ready to start serving a new sub‐route from this point onwards. Now Q ikf will start tracking the cumulave fuel volume again from zero and makes sure it does not sasfy more than the fuel capacity.

Keeping track of the cumulave volume of each fuel on the vehicle is achieved by constraint (8).

Everyme the truck travels from i to serve demand at j , Q ikf will be increased by the amount of demand ρ jf . However, if the truck k doesn’t go from i to j ( x ijk =0), the RHS of the constraint is relaxed by adding M (a really big number), making the constraint ineffecve at this point.

Constraint (9) calculates the start‐of‐service me at every point, including service duraon and traveling duraon between points.

If the truck travels of i to j , then the earliest me the truck can arrive at j would have to be aer the me it arrives at i plus the me taken to do service at i and the me it travels from i to j . However, if the truck does not go from i to j ( x ijk =0), the RHS of the constraint is added with M (a really big number) to relax the constraint, making the constraint ineffecve at this point.

The me window restricons are captured by constraint (10).

The truck need to arrive at all customer locaons between the given me windows; it does not maer where it is going from, or where it is going aer this point (by summing up over all possible points for j )

Constraint (11) sets the value of W to always be greater than the value of the coefficient in the first term of the objecve.

Finally, constraints (12), (13), (14), and (15) establish the variable domains.

One important note here is that this problem formulaon assumes that the resulng route generated would not include any cyclic route(s). In cases where these cycle occurs, we will have to add addional constraint(s) customized to the parcular problem we are solving. Nevertheless, these types of constraint are not menoned in the above formulaon because the amount of those constraints needed grow exponenally with the number of nodes inpued. For example, having 3 nodes needs an extra of 4 constraints, having 4 nodes would

10

Page 12: Final Report IEOR 180

need an extra of 10 constraints, and having 6 nodes would need an extra 41 constraints. Since this type is of indefinite amount, we will omit it from the formulaon at the moment. Another approach to solve the problem without such constraints will be explained in the next secon.

4.7. PERFORMANCE MEASURES Currently, our client uses an API from a third‐party‐organizaon to solve for the route taken by the truck. Nevertheless, the model used is slightly different than what we are modelling. The currently used model minimizes the amount of idle me (the me period when the truck is not moving and just waing for the next service to start). Also, it does not include the fuel tank capacity as part of the constraints; hence, there is no visits to intermediate fuel depot to re‐fill the fuel in the middle of the service. These visits are to be added manually aer the soluon is generated from the model by “eye‐balling” the me when they will be running out of fuel. Nevertheless, our client has a different objecve that they want to solve (to maximize the amount of demand serviced and minimize travel distance), and hence our model is designed based on these preferences. That being said, the soluon generated from our model (with the desired objecve) will definitely give a beer soluon (lower objecve) for our client than the soluon from the currently‐used API with manual addion of intermediate depot visit.

5. PROBLEM ANALYSIS AND SOLUTION APPROACH The basic vehicle roung problem is well known to be NP‐hard. Our modified capacitated VRP model with me window problem is even harder to solve. Realisc instances involving 50 or more nodes and origins, intermediate fuel depots, and trucks will translate into thousands of binary variables and tens of thousands of constraints (the number of constraints disallowing cycle itself would grow exponenally with the number of nodes). Therefore, we propose a heurisc approach based on sweep algorithm, individual TSP, and local search. To incorporate the extra feature of mobile depots, we are going to portray it as a p‐median problem and embedded its heurisc to our exisng model. To evaluate the quality of the heurisc, we will then compare the soluon before and aer the addion of the mobile depot and see if any recommendaon for improvement could be made.

5.1. PRELIMINARY ANALYSIS

To start with with, we have a set of nodes, consisng of origin (and ending) points, customer locaons, and predetermined* intermediate fuel depot(s).

11

Page 13: Final Report IEOR 180

*these predetermined fuel depot can be replaced by the bigger truck later on, acng as a

mobile depot, where the locaon is set using a heurisc algorithm for the p‐median problem.

The algorithm we designed:

1. Divide the area into several secons based on the number of origin depots given, based on the distance. The first secon would cover the node(s) closest to the first depot, second secon covers the node(s) closest to the second depot, and so on.

2. Sweep algorithm a. For each secon, find the intermediate fuel depot(s) to be the center point of

our sweep algorithm. For each nodes in each secon, the polar angle is calculated using the formula:

where VerX[i] and VerY[i] is the X and Y locaon of the vertex/node i.

b. Find the origin and set it as the first node (angle of 0) where we start sweeping. c. Create cluster:

A cluster is a group of nodes that sasfies certain constraint, e.g. capacity constraint. These nodes are joined based on their angles, i.e. a node with smallest angle is joined with one with second smallest, and then third smallest and so forth while adding up the fuel demand, unl the capacity is max out.

d. Generate route: The nodes in each cluster is linked together based on the closest distance between each other to minimize the objecve = total distance travelled by the truck using the algorithm for travelling salesman problem, while sasfying the me window constraint. The origin depot should be the first node of the route. i. If there is any node with unsasfied me window constraint, shi the

node to the le/right (depending on whether this customer needs to be served earlier/later) unl the constraint is sasfied. Then, calculate the new objecve.

ii. Connue shiing the node and calculang the new objecve for each unl the le/right most end is reached. Compare the objecve of each trial to find the final locaon of the node that gives the minimum objecve.

iii. Set this route to be our temp. opmal soluon. iv. If there exist any node where the me constraint can’t be sasfied

(infeasible), we should now modify the model such that we can omit the node(s) (one at a me) from the current cluster. The objecve now become minimizing the number of unserved customer while minimizing

12

Page 14: Final Report IEOR 180

the total distance travelled by the truck serving the nodes at that cluster.

e. Add a path to the intermediate fuel depot (to re‐fill the fuel) aer we finish serving all customers of the first cluster.

f. Generate tour for the second cluster (repeat step d) with the starng me to be the me we le the intermediate fuel depot, and with this fuel depot to be the starng locaon. Repeat this for the third cluster, forth, and so on.

g. If there is any unserved customer from any of the cluster, switch that customer node to the closest node located at the neighboring cluster(s) that can return a feasible soluon. Solve the travelling salesman problem again for the new list of nodes located at each cluster to find the opmal route. i. If the problem is feasible, update the previous route with this new

route generated where there will be no unserved customer ii. If there are more than 2 clusters, repeat this step by switching the

problemac node to another neighboring cluster. If both returns a soluon (both models are feasible), compare which route gives the lower total distance (objecve) and set this route as our temporary opmal soluon

3. Do local search algorithm by switching all pairs of nodes in the route across clusters to see if there is a beer soluon (illustraon portrayed below)

a. Calculate the new objecve (total distance travelled) for each loop b. If this objecve (with switched nodes) is less than the previous objecve , we

use this route as our temp. opmal soluon

4. Repeat step 2‐3 using less number of secon (if we start with 2 secons, try combining them so we only have 1, meaning that only 1 truck is used) if possible

a. Calculate the new objecve (total distance travelled) for each trial b. If this objecve is less than the previous objecve with more secons (or trucks

used), we use this combined secons and have this route as our opmal soluon.

13

Page 15: Final Report IEOR 180

5.1.1. ADDITIONAL FEATURE (MOBILE DEPOT) An addional feature, planned to be implemented in the future by our client, involves using mobile depots to replace the exisng gas staons. These mobile depots are essenally big tanker trucks that carry a huge amount of fuel and whose parking locaon is flexible; they are designed to fill up the fuel of the smaller moving truck that travels around sasfying customers. Once the locaons of these big trucks (mobile depots) are set, they are going to park there and wait for the smaller travelling trucks to come and meet them to fill up their fuel tank. Our goal is to find this parking/meeng locaon(s) that can minimize the total cost (total distance travelled by the small truck), hence opmizing the system. Aer considering different ways to implement mobile depot in our model, we decided to use a heurisc algorithm for P‐Median problem, which takes into account the weight of the demands at each node. In this model, p represents the number of mobile depot(s) to be set, h i represents the demand of node i, and d i,j represents the distance from node i to node j Below is the heurisc algorithm that we are using:

1. First stage a. Place the first depot using brute force enumeraon to solve the 1‐median

problem; b. For i = 2, . . ., p

i. Keeping the locaon of already placed depots fixed, place another

depot to minimize the total weighted distance: . 2. Second stage

a. Find the neighborhood of each depot (meaning an assignment of demand nodes to each depot such that the distance between a demand node and the depot is minimum)

b. Do: i. Solve the 1‐median problem in each neighborhood; ii. Find the neighborhood of each depot

While the neighborhoods have changed from the previous iteraon. Once the neighborhoods are fixed, it means we cannot opmize the system even more that it changes our result. At this point, we have find the opmal locaon for the mobile depots.

* To solve our model, we are going to use the demand nodes as the possible meeng locaons.

In the future, these can be replaced by real data for the possible meeng locaons as well.

14

Page 16: Final Report IEOR 180

5.2. SAMPLE DATA To demonstrate the model we have built, there are 2 sample sets of data, provided by the client, that we are going to use as the problem to be solved. The first one is named “input 3­1”, and the second one is “input 3­3”. The following section will summarize the initial solution generated and the comparison of the quality of the solution with the added feature. The detailed step­by­step approach in solving the problem is included in the appendix.

5.3. SOLUTIONS (3-1 INPUT) Aer applying our algorithm, we have divided our customer base into two secons (for the 2 trucks with their corresponding origins) and the results are as follow; Secon 1 (to be served the truck #1, starng from Redwood City)

Cluster 1:

1 (Origin) ‐ 16 ‐ 21‐ 3 ‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 13 ‐ 7* ‐ 4 ‐ 17‐ 9 ‐ Depot Objecve = 25.118

Cluster 2:

Depot ‐ 15 ‐ 19 ‐ 5 ‐ 22 ‐ 8 ‐ 7 ‐ 20 ‐ 1 (Origin) Objecve = 53.577

Total objecve (distance covered in miles) for this trip = 25.118 + 53.577 = 78.695 Secon 2 (to be served the truck #2, starng from San Jose)

2 (origin) ‐ 10 ‐ 2 (origin) Objecve = 10.644

15

Page 17: Final Report IEOR 180

5.3.1. SOLUTIONS (3-1 INPUT) WITH MOBILE DEPOT

Solving the p‐median problem, we’ll get the locaon of customer node #7 to be the locaon of the mobile depot. Solving problems again using the previous algorithm with addional mobile depot feature, we will get following result for secon 1: Cluster 1:

1 (origin) ‐ 13 ‐ 16 ‐ 21‐ 3 ‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 4 ‐ 17‐ 9 ‐ 7*(depot) Objecve = 23.15

Cluster 2:

7* (depot) ‐ 15 ‐ 19 ‐ 5 ‐ 22 ‐ 8 ‐ 7* ‐ 20 ‐ 1 (origin) Objecve = 54.09

Total objecve = 77.24 miles

For secon 2, there is no need to go to intermediate fuel depot as the truck can serve all its customers in 1 trip. Hence, assigning a mobile depot for this secon will not have any effect on the objecve. In both cases, it could be seen that all the customers are served well within their me window, and the algorithm provides the route to do that in minimized total distance travelled.

16

Page 18: Final Report IEOR 180

5.4. SOLUTIONS (3-3 INPUT) Same approach with the previous case is taken, and we get the following result for the 2 secons of our customer base:

Secon 1 (to be served the truck #1, starng from San Jose) Cluster 1: 9 ‐ 6 ‐ 3 ‐ 7 ‐ 5 ‐ 15 ‐ Depot Objecve = 17.386

Cluster 2: Depot ‐ 16 ‐ 4 ‐ 1 (Origin) Objecve = 18.218

Total Objecve: 35.604 miles

Secon 2 (to be served the truck #2, starng from Redwood City)

At this secon, all the customers can be served in 1 trip. There is no need to go to intermediate fuel depot in between, so there is only 1 cluster. 2(Origin) ‐ 22 ‐ 12 ‐ 19 ‐ 17 ‐ 21 ‐ 13 ‐ 18 ‐ 14 ‐ 8 ‐ 10 ‐ 20 ‐ 11 ‐ 2(Origin) Objecve = 27.189

Same as the soluon from previous data, we cannot create a beer soluon by combining the route from the 2 trucks. Hence, these are our final soluon.

17

Page 19: Final Report IEOR 180

5.4.1. SOLUTIONS (3-3 INPUT) WITH MOBILE DEPOT Secon 1 Cluster 1: 9 ‐ 6 ‐ 5 ‐ 7 ‐ 3 (Depot) Objecve = 14.925

Cluster 2: 3(Depot) ‐ 15 ‐ 16 ‐ 4 ‐ 1 (origin) Objecve = 20.468

Total Objecve: 35.393 miles

For secon 2, there is no need to go to intermediate fuel depot as the truck can serve all its customers in 1 trip. Hence, assigning a mobile depot for this secon will not have any effect on the objecve.

6. SUMMARY AND CONCLUSION The problem presented in this problem is generally a more complicated version of vehicle roung problem, with fuel capacity and me window constraint, mulple fuel type, mulple origins, and addion of mobile depot with flexible locaon. This problem can be formulated as an integer linear program (ILP) with binary variables to represent the pathway / route generated for each of the truck. However, as the data (or nodes) increases in size, solving ILP proves to be NP‐complete. This basically means that the me and space complexity grows exponenally with the data size (the number of variables needed to represent the route between nodes and the number of constraints needed to be taken into account to eliminate cyclic path grows exponenally, hence me and space needed to solve the problem grows exponenally as well). This compels us to generate a heurisc that can help generate the best soluon possible, which is believed to be close enough to the ideal soluon of the ILP. To demonstrate the heurisc, we use this algorithm to solve the sample case for the sample data presented above, producing one possible opmized soluon that can be followed.

18

Page 20: Final Report IEOR 180

Nevertheless, we also believe that the locaon of intermediate fuel depot could be one factor that plays a big role in determining the opmal route. With a more flexible locaon for the fuel depot, a beer route can be generated. In the future, our client will be able to have the flexibility in seng these depot locaons by the addion of mobile depot features. We decided to use p‐median problem to represent this feature. Solving it with the heurisc discussed above, we get the opmal locaon for the mobile depot, which are going to serve as the replacement of the intermediate fuel depot locaon used before. As expected, aer solving the sample case all over again with the new locaon of the intermediate depot (using mobile depot), we get a soluon with less objecve value. With this feature, allowing a greater flexibility to have the intermediate fuel depot locaon being set ahead of me, our model can generate a beer soluon with beer objecve. For both sample data, we see a reducon in total objecve with the addion of mobile depot feature. This is because with the addion of mobile depot, we can set the locaon of the intermediate fuel depot to re‐fill the tank freely, according to the path of the truck. Hence, if set opmally, the trucks would not have to travel the extra distance to the intermediate fuel depot and will result in a more opmized route with less cost(distance). Nevertheless, in both cases, we also see that the reducon in total objecve is relavely low (only about 1 mile in the first sample data, and about 0.2 miles in the second sample data). This might be because of the data that is sll relavely simple, hence an improvement would not make a huge impact. However, in other cases where we have more complexity in the model data (more customer nodes, mobile depot locaons, and trucks), this method might decrease our objecve value more significantly. Although our case might not give major reducon in the objecve value, this sll proves how by seng and placing a mobile depot with flexible locaons beforehand, we can create a more opmal route. Further necessary work in programming would need to be implemented as well to this model. As this report only provide an algorithm to solve the problem, an actual effort of translang this algorithms into some lines of codes to produce an automated soware product would be needed. This will help Yoshi to generate the route more automacally and conveniently, customized with their daily demands input. Some areas of improvement to be made in the future is to assign the edges with real‐me cost (actual distance and traffic) instead of just basing it on a 2D linear distance and ignoring the traffic. Traffic, especially during rush hour, will make a huge difference in the travel me between customer nodes, and can really change the soluon generated. Higher costs would need to be associated with those paths as well since the truck will be wasng much of its fuel if it’s stuck in traffic. Moreover, the model can also include the specificaon about break‐me (e.g. lunch me) for the truck driver as part of the list of constraints. This will be needed to create a more realisc model and soluon.

19

Page 21: Final Report IEOR 180

7. RECOMMENDATION

In the meanme, while this feature is sll considered for future development and have not yet been established, some recommendaons would include adding more opons for the possible intermediate fuel depot. In our previous case, we only have 3 possible intermediate depots. If this can be set more flexibly by adding more gas staon that can serve as the intermediate depots, we can choose the gas staon that can suite the model more as the intermediate fuel depot used. Hence, a beer soluon with less objecve value (total distance) can be generated We also recommend that the implementaon of the mobile depot only be conducted when Yoshi has a large customer base. Based on our studies, having a mobile depot with the current customer base would not be profitable since large costs would be incurred on the purchase/maintenance of the mobile depot. As for now, expanding the customer base should be the top‐most priority before adding any new feature. Moreover, based on the soluon to previous data, there are sll a lot of free me associated with the trucks as well, although all of the assigned customers for that day are served. If these free me can be used more efficiently by serving more customers, greater profit can be generated for Yoshi.

20

Page 22: Final Report IEOR 180

8. BIBLIOGRAPHY Aswani, Anil. "P‐median Problem." Lecture 13. UC Berkeley, Berkeley. 10 Feb. 2016. IEOR 151 –

Service Operaons Design and Analysis . Web. < hp://ieor.berkeley.edu/~ieor151/lecture_notes/ieor151_lec13.pdf >.

"Line Sweep Algorithms." Line Sweep Algorithms . Topcoder, n.d. Web. 09 Feb. 2016.

<hps://www.topcoder.com/community/data‐science/data‐science‐tutorials/line‐sweep‐algorithms/>.

Markov, Illiya, Sacha Varone, and Michel Bierlaire. "Vehicle Roung for a Complex Waste

Collecon Problem." 14th Swiss Transport Research Conference (2014): n. pag. Print. Nurcahyo, Gunadi W., Rose Alinda Alias, Sm Mamyam Shamsuddin, and Mohd. Noor Md. Sap.

"Sweep Algorithm in Vehicle Roung Problem For Public Transport." ResearchGate . Rose Alinda Alias, 30 Apr. 2014. Web. < hps://www.researchgate.net/publicaon/241128434_Sweep_Algorithm_in_Vehicle_Roung_Problem_For_Public_Transport >.

"Vehicle Roung Problem." Networking and Emerging Opmizaon . NEO‐University of

Málaga, n.d. Web. < hp://neo.lcc.uma.es/vrp/vehicle‐roung‐problem/ >.

21

Page 23: Final Report IEOR 180

9. APPENDIX

9.1. SAMPLE DATA (3-1 INPUT) Using the sample data set from Yoshi (input 3‐1), here are the locaons in the map. The red nodes with numbers are the customer's posions, the green nodes are the predetermined intermediate fuel depots, and the grey nodes are the inial and final depots for the 2 trucks.

Trying to solve our problem, first we divide our model into 2 secons (we have 2 trucks starng at 2 different origins) based on the distance of the nodes to the closest origin depot. The first secon include the all nodes except #10 served by the truck from Redwood City The second secon include customer #10 served by the truck starng at San Jose

22

Page 24: Final Report IEOR 180

Secon 1: For the first secon, we use the depot (green node in between the crowds) in Redwood City as the center of our sweep algorithm, and the line segment from this center to the origin (grey node next to it) to be angle 0 and sweep counterclockwise, having node 3 next (the first customer node served).

Secon 2:

For the second secon, we only have 1 customer node, which means we will only have 1 cluster containing 1 node. The truck will leave at the origin in San Jose, travelling to node 10, and go back to the origin.

23

Page 25: Final Report IEOR 180

The sequence in which the sweep algorithm “sweeps” through the customer nodes will be as follow:

Secon 1 Secon 2

Node Time Window Fuel Type Node Time Window Fuel Type

3 9:00‐11:00 Regular 10 9:00 ‐ 17:00 Regular

9:00‐14:00 Regular 9:00 ‐ 17:00 Regular

20 15:00‐17:00 Regular 9:00 ‐ 17:00 Regular

21 9:00 ‐ 11:00 Super 9:00 ‐ 17:00 Regular

13 9:00‐17:00 Super 9:00‐11:30 Super

11 9:00 ‐ 17:00 Regular 9:00‐11:30 Super

16 9:00 ‐ 17:00 Super 9:00‐11:30 Super

14 9:00 ‐ 17:00 Regular 9:00‐15:00 Regular

6 9:00 ‐ 17:00 Regular 9:00‐15:00 Regular

10:00‐17:00 Regular 9:00‐15:00 Regular

7 9:00 ‐ 17:00 Super 10:00‐16:00 Regular

13:00 ‐ 17:00 Super 10:00‐17:00 Plus

18 10:00‐17:00 Regular 9:00‐16:00 Super

4 9:00 ‐ 17:00 Regular 9:00‐15:00 Super

9:00 ‐ 17:00 Regular

15 10:00‐17:00 Super

10:30‐17:00 Regular

9:00‐17:00 Regular

8 9:00‐17:00 Regular

9:00‐17:00 Regular

19 9:00‐13:00 Regular

24

Page 26: Final Report IEOR 180

9:00‐16:00 Regular

5 9:00‐17:00 Regular

9:00‐15:00 Regular

22 9:00‐17:00 Regular

17 10:00‐16:00 Super

9 9:00‐17:00 Regular

The capacity of our truck will be maxed out aer serving 10 customers with regular fuel demand. This means that in the first secon, we will end the first cluster aer sweeping the nodes starng from #3 to #4 (first cluster ‐ yellow background). Second cluster will begin from node #15, covering to node 9, the end of the sequence (second cluster ‐ blue background). Aer solving the travelling salesman problem, we will get the original route for the first cluster to be

1 (Origin) ‐ 13 ‐ 16 ‐ 21‐ 3 ‐ 20 ‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 7 ‐ 4 Objecve = 21.504

Nevertheless, the me window constraint is not sasfied. As a result, some nodes have to be shied. Through several loops, we get the final temporary opmal route, which sasfy the constraints but giving the minimum total distance (objecve) so far to be 1 (Origin) ‐ 16 ‐ 21‐ 3 ‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 20 ‐ 13 ‐ 7 ‐ 4 Objecve = 24.698 We also need to add the path to the intermediate fuel depot next to the last node, before connuing to the second cluster. Since the distance from node #4 to the depot is 2.449 miles, now we have 1 (Origin) ‐ 16 ‐ 21‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 20 ‐ 13 ‐ 7 ‐ 4 ‐ Depot Objecve = 27.147 For the second cluster, we get the route to be Depot ‐ 9 ‐ 17 ‐ 15 ‐ 19 ‐ 5 ‐ 22 ‐ 8 ‐ 1 (Origin) Objecve = 46.697

Nevertheless, we see that we can only start service at this second cluster at 16:38 pm the earliest (the me we depart from the depot aer cluster 1 service).This me is actually too late already to finish servicing all the customers at the second cluster. Turns out that we can only serve the first customer on the second cluster before we are running out of me. Since now we have unserved customers, we have to go to step 2.g. (from the algorithm described above) to see if we can switch any node(s) with the closest node at the opposite

25

Page 27: Final Report IEOR 180

cluster that sll returns a feasible soluon. Aer several loops trying each nodes for the switch, turns out switching node #20 and one of the customer at node #7 at the first cluster with node #9 and #17 (closest nodes at the second cluster), will result in a feasible soluon with the minimum objecve. This is because node #20 and #7 is those with ght constraint: The earliest me of service possible for node #20 and #7 (one customer) is at 15:00 and 13:00, pushing the service for the nodes aer this node backwards and hence, making us running out of me. Aer the switch, we can again solve the problem as a TSP and get the routes as follows: Cluster 1:

1 (Origin) ‐ 16 ‐ 21‐ 3 ‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 13 ‐ 7* ‐ 4 ‐ 17‐ 9 ‐ Depot Objecve = 25.118

Cluster 2:

Depot ‐ 15 ‐ 19 ‐ 5 ‐ 22 ‐ 8 ‐ 7 ‐ 20 ‐ 1 (Origin) Objecve = 53.577

Total objecve (distance covered in miles) for this trip = 25.118 + 53.577 = 78.695

Noce that there are 2 node #7. This is because at this locaon, there are 2 customers (one of them has a me constraint of 13:00‐17:00). The one with the ght me constraint are switched to cluster 2 while the other one stays in cluster 1. The detailed route with the me arrival are as follows: For the second secon, we only have 1 cluster consisng of 1 customer node (node #10) with 9 orders of fuel type regular , 5 orders of fuel type super , and 1 order of fuel type plus . Since we are going to run out of fuel aer sasfying of 10 orders (per fuel type), this means we will be able to finish all orders at this node without having to travel to the fuel depot in between order fulfillment. For this secon, we can have the route to be:

2 (origin) ‐ 10 ‐ 2 (origin) Objecve = 10.644

26

Page 28: Final Report IEOR 180

Connuing with the algorithm above, we now need to try combining the route to check if we can achieve a beer soluon that gives lower objecve. Here, we only have 2 secons (2 trucks) so the possible combinaon is just the combinaon of the routes for these 2 trucks. Now, we try to combine the route from the 2nd secon (covering node #10) to the 1st secon. If we connue the trip from the last node in secon 1 (node 20), going back to the depot to re‐fill the tank, and connue to node 10, and back to the origin, we would have added 44.439 miles to the objecve from the 1st secon, while eliminang the current cost of the second truck from the San Jose to serve node #10 (10.644 miles). Nevertheless, it is obvious that the current cost to have the second truck serving is only 10.644 miles as menoned above, which is far lower than the extra cost that would be added to have the customer node in the 2nd secon served by the truck from the 1st secon. The same applies when we try to add all the customer nodes from the 1st secon to the 2nd secon. This shows that combining the route together is not the best soluon for this case. Therefore, we sck with our temporary soluon menoned before, and set it as the final soluon.

9.1.1. DATA 3-1 WITH MOBILE DEPOT For 1 mobile depot, we can find the opmal locaon using the brute force enumeraon where we try to locate the mobile depot in each node and find total distance travelled corresponding to the locaon of mobile depot. We can find the opmal node by finding the one that gives us minimum total travel distance. In our case, we made a distance matrix in Microso Excel for all the nodes in the data set and found that node #7 gives us the smallest objecve (total distance travelled of 118.74 miles) by using Excel funcon to sum the total distance of each node , hence seng it as the locaon for our 1 mobile depot. If we are to locate 2 mobile depots, we would need connue on with the steps in the algorithm above. Fixing node 7 as one of the depot, we need to find the other node(s) that would result in smallest total distance. In our case, we try to find the total minimum distance of having 2 nodes using Excel funcon (MIN). We found that by adding node 5, the total distance travelled is reduced to 50.73 miles. Aer solving 1‐median problem from the neighbors of node 5: 5, 19, 22 and node 7: 1, 3, 4, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, 20, 21, both node 5 and node 7 are sll the opmal locaons to locate 2 depots because they produce the smallest distance compare to using their neighbors as the depots. Hence, we can break the loop and use these locaons as the final locaons. Depending on the value of p given (input of how many depot locaons needed to be set), we can connue this process on different measures.

27

Page 29: Final Report IEOR 180

For our given data set, we only need 1 mobile depot for secon 1 (from Redwood City) since the truck will run out of gas once in the process of fulfilling all the demands, while the truck in secon 2 (from San Jose) will not need to travel to the intermediate depot as the demands can all be fulfilled in one tour. In this case, adding more depots (seng node 5 as fuel depot as well) will not change the objecve and will sll give us the same soluon. But, assuming our data set will expand in the future as the number of customers increase, more than 1 mobile depot might be effecve. This same heurisc can be used, and more efficient implementaon of the heurisc might be useful in cases where many mobile depots are needed. Since no difference will take into effect in the secon 2 route for the truck from San Jose, we will only discuss the changes on the route covered by the truck in secon 1 (from Redwood City). Solving the problems again using the previous algorithm, we will get following final result: Cluster 1:

1 (origin) ‐ 13 ‐ 16 ‐ 21‐ 3 ‐ 11 ‐ 14 ‐ 6 ‐ 18 ‐ 4 ‐ 17‐ 9 ‐ 7*(depot) Objecve = 23.15

Cluster 2:

7* (depot) ‐ 15 ‐ 19 ‐ 5 ‐ 22 ‐ 8 ‐ 7* ‐ 20 ‐ 1 (origin) Objecve = 54.09

Total objecve = 77.24 miles

Same as before, we cannot create a beer route with lower objecve by combining the route from the 2 trucks. Hence, this will be our final soluon. Compared to 78.09 miles, this result gives lower objecve (total distance travelled in miles), meaning that this soluon is beer. Nevertheless, the reducon in the distance is not significant, only ~1 mile are saved. For this case, it might not be advisable to go through this extra amount of work (solving p‐median problem, solving the problem using sweep algorithm,

28

Page 30: Final Report IEOR 180

local search, etc.) just to save 1 mile of distance travelled. Besides, for our client to even consider using mobile depot, they will have to gain considerable amount of customers, otherwise it will not be profitable considering the cost to invest in new trucks and infrastructure might be higher.

9.2. SAMPLE DATA (3-3 INPUT) Mapping all nodes into the graph (red ‐ customer nodes, green ‐ intermediate fuel depot, grey = origin depot), we get the following:

*Noce node 2 (origin depot) is not visible. This is because it has the exact same locaon as customer node 22. As the nodes overlap, node 2 are completely covered behind node 22. Going on the first step, we divide all the nodes into 2 secons, depending on their distance to the 2 disnct origins. We’ll get the following result.

29

Page 31: Final Report IEOR 180

Secon 1:

For the first secon, we chose the depot (green node) above node 16, beside node 15, as the center of our sweep algorithm as it is closer the the surrounding customer nodes compared to the other depot in Coleman Ave; hence, the truck will have to travel less extra‐distance to visit the intermediate fuel depot. The line segment from this center to the origin (grey node #1) is set to be angle 0 and the algorithm sweeps counterclockwise, having node 9 next (the first customer node served).

30

Page 32: Final Report IEOR 180

Secon 2:

For the second secon, we use the depot (green node next to node #22) in Redwood City as the center of our sweep algorithm, and the line segment from this center to the origin (overlap with node #22) to be angle 0 and sweeps to node #11 next, covering all way to node #18 in the end. We then perform sweep algorithm that resulted in the following sequence:

Secon 1 ‐ San Jose

Node Time

Window

Fuel

Type

9 9:00‐17:00 Regular

6 9:00‐17:00 Regular

9:00‐11:30 Super

9:00‐17:00 Regular

31

Page 33: Final Report IEOR 180

9:00‐11:30 Super

9:00‐16:00 Super

9:00‐11:30 Super

9:00‐17:00 Regular

9:00‐15:00 Regular

9:00‐17:00 Super

3 12:00‐15:00 Super

7 10:00‐17:00 Regular

5 11:00‐17:00 Regular

15 11:00‐14:00 Regular

16 9:00‐17:00 Regular

4 9:00‐17:00 Regular

9:00‐17:00 Regular

9:00‐17:00 Regular

9:00‐17:00 Super

9:00‐17:00 Regular

9:00‐17:00 Super

9:00‐17:00 Regular

9:00‐15:00 Regular

9:00‐17:00 Regular

*yellow ‐ first cluster, blue ‐ second cluster

Secon 2 ‐ Redwood

Node Time Fuel

32

Page 34: Final Report IEOR 180

Window Type

22 10:00‐15:00 Super

11 9:00‐17:00 Regular

20 9:00‐16:00 Super

10 9:00‐17:00 Regular

12 11:00‐17:00 Super

8 9:00‐17:00 Regular

17 9:00‐17:00 Regular

19 10:00‐15:00 Super

13 9:00‐17:00 Regular

21 9:00‐17:00 Regular

14 9:00‐17:00 Regular

18 10:15‐17:00 Super

Secon 1

Solving the first TSP gives the following result: Cluster 1: 9 ‐ 6 ‐ 3 ‐ 7 ‐ 5 ‐ 15 ‐ 16 ‐ Depot Objecve = 22.166

Cluster 2: Depot ‐ 4 ‐ 1 (Origin) Objecve = 15.715

Total Objecve = 37.881 Aer going through Local Search Algorithm , turns out a beer soluon can be obtained when node 16 is switch with the depot visit, hence giving the following result: Cluster 1: 9 ‐ 6 ‐ 3 ‐ 7 ‐ 5 ‐ 15 ‐ Depot Objecve = 17.386

Cluster 2: Depot ‐ 16 ‐ 4 ‐ 1 (Origin) Objecve = 18.218

Total Objecve: 35.604 miles

33

Page 35: Final Report IEOR 180

Secon 2

At this secon, all the customers can be served in 1 trip. There is no need to go to intermediate fuel depot in between, so there is only 1 cluster. Solving the TSP problem, we get the following: 2(Origin) ‐ 22 ‐ 12 ‐ 19 ‐ 17 ‐ 21 ‐ 13 ‐ 18 ‐ 14 ‐ 8 ‐ 10 ‐ 20 ‐ 11 ‐ 2(Origin) Objecve =

27.189

Since all the me constraints can be fulfilled already, there is no need to go through the remaining steps in the algorithm provided before. We can set this as the final opmal soluon.

Same as the soluon from previous data, we cannot create a beer soluon by combining the route from the 2 trucks. The me our first truck (from San Jose) finishes its last customer, it will be almost 16:00 pm already. There will not be enough me to sasfy all the customers in the second secon (served by the second truck from Redwood City) in the requested me window.

34

Page 36: Final Report IEOR 180

9.2.1. DATA 3-3 WITH MOBILE DEPOT First, we are solving p‐median problem for secon 1 by implemenng the algorithm. For 1 mobile depot, we can find the opmal locaon using the same method we used in previous data set. Aer creang a distance matrix in Microso Excel for all the nodes in the data set, we found that node #3 gives us the smallest objecve (total distance travelled of 44.58 miles) by using Excel funcon to sum the total distance of each node , hence seng it as the locaon for our 1 mobile depot. If we are to locate 2 mobile depots, we would need to connue on with the steps in the algorithm above. Fixing node 3 as one of the depot, we try to find the total minimum distance of having 2 nodes using Excel funcon (MIN). We found that by adding node 9, the total distance travelled is reduced to 19.535 miles. Aer solving 1‐median problem from the neighbors of node 3: 3, 5, 7, 15, 16 and node 9: 1, 4, 6, 9, both node 3 and node 9 are sll the opmal locaons to locate 2 depots because they produce the smallest distance compare to using their neighbors as the depots. Hence, we can break the loop and use these locaons as the final locaons. Depending on the value of p given (input of how many depot locaons needed to be set), we can connue this process on different measures. Similar to the first data set, we only need to visit the intermediate fuel depot once in this secon. Therefore, we can just use node #3 as the locaon where the mobile depot would park, and treang it as the intermediate fuel depot. Hence, we will get the following final route: Cluster 1: 9 ‐ 6 ‐ 5 ‐ 7 ‐ 3 (Depot) Objecve = 14.925

Cluster 2: 3(Depot) ‐ 15 ‐ 16 ‐ 4 ‐ 1 (origin) Objecve = 20.468

Total Objecve: 35.393 miles

35

Page 37: Final Report IEOR 180

For secon 2, there is no need to visit intermediate fuel depot in the middle of the route. Hence, there will be no effect taking place if we try to solve p‐median problem for secon 2. We see that by adding mobile depot feature, we are saving ~ 0.2 miles. This implies 2 main points: first, we see that, again, by adding a mobile depot/making the intermediate fuel depot locaon more flexible, we can reduce the total cost/objecve (distance travelled) even more. Hence, making the soluon beer. However, the reducon is very lile. For this case, it might not be recommended to work through the whole effort in solving p‐median problem and solving the whole problem over again. However, in future cases where the system is more complicated, this model proves to be sufficient enough in giving the best soluon possible.

36