Greenfield Analysis — Anylogistix vs Teitz and Bart Algorithm
Introduction
This article is about a well-known Greenfield analysis modeling method. The method is used to identify optimal locations to open warehouse(s) or production facilities in the network analysis study of the supply chain. This analysis is either focuses on improving service levels or reducing the average travel distance from DC to customers. However, there are a plethora of tools available in the market offering this method. Here, we will see how we can leverage Teitz and Bart algorithm to solve the P-median problem using R-programming. We will compare the results of the Anylogistix and the Teitz and Bart algorithm to understand the effectiveness of the algorithm.
The Problem Statement
A common example of Anylogistix GFA(Greenfield analysis) is taken where two warehouses need to be located based on the demand of 100 customers in the Great Britain region. The customers are located over the region as shown below:
The decision to open the warehouses is based on the demand weighted travel distance minimization.
The Model — P-median in R
Installing essential packages:
While modeling the P-median problem in R-programming, two essential packages; ‘sp’ and ‘tbart’ needs to be installed in the system. The ‘sp’ package converts geological data (latitude and longitude) into spatial objects, whereas, the ‘tbart’ package uses the algorithm and spatial object to generate central locations of the warehouse(s).
install.packages("sp") # installing spatial package
install.packages("tbart") #installing tbart package for teitz and bartz algorithm
Code:
As the system is all set with desired packages installed, we begin by calling the installed packages (and other supportive packages) and set up the working directory.
library(sp)
library(geosphere)
library(tbart)
library(readxl)set.wd("--") # setting up working directory
Data Inputs: Next step is to import the customer data containing demand and geolocation information. Some data manipulation and munging are required to prepare the data for the algorithm. We create a spatial point database using latitude and longitude information.
Customers_data <- read_xlsx(file.choose(),sheet=2)
(Customer, Latitude, Longitude, Demand)
Customers_data <- na.omit(Customers_data)
x <- Customers_data$Lat
y <- Customers_data$Long
Creating spatial point data base
xy <- SpatialPointsDataFrame(matrix(c(x,y), ncol=2), data.frame(ID=seq(1:length(x))),proj4string=CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))
Calculating distance matrix
mdist <- distm(xy)
Algorithm: As the required data for the algorithm is prepared, we will now run the algorithm to generate results. Since here we want to open two new warehouses we will use p=2.
allocations.list <- allocate(xy,p=2) # identifying two warehouse locations
allocations.list <- unique(allocations.list)
DC_ID <- data.frame(unlist(allocations.list))
colnames(DC_ID)[which(names(DC_ID) == "unlist.allocations.list.")] <- "DCID"
Warehouse <- unique(DC_ID) #identifying unique warehouse locations
The algorithm provides the best place to open the warehouse based on-demand concentration of customers and their distance matrix. Furthermore, these customers can be allocated to the newly suggested warehouses based on their distance from the warehouse (customer to be assigned to the nearest warehouse).
Anylogistix Model: When the same data is used on anylogistix with requirements of 2 warehouses as Greenfield Analysis(GFA), we get a result close to the (Teitz and Bart) T-Bart algorithm. Below is the side by side comparisons of the two results:
Result Summary: Key observations from the results show that both the models propose the same warehouse locations in the southern part of the region (i.e London), it is undeniable that London has the highest concentration of demand and the results are meeting the expectations.
On the other hand, the Anylogistix solutions propose northern warehouse locations in the city ‘Lincoln’. The city can cover all the northern demand points in minimum total distance compared to other locations, therefore a warehouse in ‘Lincoln’ will certainly require minimum total distance to serve all the customers. Whereas, the T-Bart algorithm proposes rather a central location (‘Stoke-on-Tent’) for the second warehouse. De facto, the city is close to the biggest customers and in a high customer concentration region compare to ‘Lincoln’. Therefore, even though the total distance from all the northern customers is longer from this city, it offers a higher service level.
Undoubtedly, Anylogistix offers functionality to locate the warehouses based on desired service level, but here the algorithm suggests the number of warehouses based on the required service level. The T-Bart algorithm proposes a combined solution, it provides the flexibility to select the count of warehouses and suggest a location offering the highest service level.
BONUS: The T-Bart algorithm also includes an integrated parameter for defining existing locations. Therefore, if we want to continue with the existing facility while adding new ones to the network, it is possible to run the T-Bart algorithm in such scenarios. For such cases one needs to choose the following code:
“allocations.list <- allocate(xy,p=2,force = c(-))”
the ‘force’ parameter takes the existing facility location in the algorithm. The model then considers it in the calculation and looks out for other best locations to serve the customers.
Many algorithms are available in the market that offers greenfield analysis solutions. The above article helps us in leveraging R-programming to solve industrial-scale facility location problems. For large-scale data (e.g. ~300,000 customer points or more) the customers can be combined into clusters (e.g. city to the county in the USA) and further the suggested cluster location can be investigated to identify the exact warehouse location. If you are seeking any help understanding the algorithm or others, feel free to connect at satpal.singh16@outlook.com.
If you have read it here, please don’t forget to share it with your fellow members. Your sharing will encourage me to post more about industrial-scale OR-based solutions using open source platforms. Happy coding!!!