Optimized Deployment of Sharing Bikes in LA

While bike-share program facilitate us reaching every corner in cities, it also brings another problem—bike waste. A large number of cycles on streets have led to scenes of clogged sidewalks[1]or discarded bicycles construct a giant mountain[2] when the number of provided bikes exceeded that of needed bikes.

Using Los Angeles Metro bike-share Trip Data(2016Q3 to 2017Q2)[3], this project aims to find out the optimized deployment of sharing bikes in the Los Angeles area.

Analysis and Visualization

Find the amount of using cycles at each time interval

The data set from the website only provide the start time and end time and the duration of each trip. The amount of cycles in use at each time interval is not directly given and should be computed first.

# set the time zone
Sys.setenv(TZ='GMT')  

# read the dataset
data = read.csv( "MetroBikeShareTripData.csv")

# change the data type to datetime
data$start_time = as.POSIXct(data$start_time,format="%m/%d/%Y %H:%M")   
data$end_time = as.POSIXct(data$end_time, format="%m/%d/%Y %H:%M")

# define the time interval - here we set the interval as "1 hour"
minDate=as.Date(min(data$start_time))
maxDate=as.Date(max(data$end_time))
interval='1 hour'
time_sequence=seq(as.POSIXct(minDate), as.POSIXct(maxDate+1), by=interval)
time_point_num=length(time_sequence)-1
counts_of_day=rep(0,time_point_num)

# define output format
aDate=as.Date(Sys.time())
output_ncol=length(seq(as.POSIXct(aDate), as.POSIXct(aDate+1), by=interval))-1

# define a helper function which aim to find the index of corresponding time interval of a record 
find_i=function(from, to, time_seq){
    return(sum(time_sequence<=from):sum(time_sequence<to))
}

# find the total amount of using cycles at each time interval 
for(i in 1:nrow(data)){
    all_i=find_i(data$start_time[i], data$end_time[i], time_sequence)
    counts_of_day[all_i]=counts_of_day[all_i]+1
}

# format the result to weekly scale
wresult=data.frame(matrix(counts_of_day, ncol=output_ncol*7, byrow=T))

# add the column of week for visualization
wresult$Date=seq(minDate, maxDate, by='1 week')

# ouput the result
##write.csv(wresult,file="WeeklyResult.csv")
Find the service pattern

After finding the total amount of using cycles at each time interval, a plot of the data shows the usage.

Figure 1. Service pattern of Matro Bike Share in Los Angeles

The x-axis starts from Thursday and ends on Wednesday due to the first record is July 7th, 2016 which is a Thursday.

It is easy to recognize that parttern of weekdays and weekends are completely different. Only one broad peak (13:00~17:00) exists during the daytime in weekends while three sharp peaks appear in weekdays(8:00~10:00 12:00~13:00 17:00~19:00). Therefore, how many sharing bikes satisfy the market demand should be take into consideration both on weekends and weekdays respectively before reaching a conclusion the number of total shared bikes should be placed on the market.

Three extremely high peaks are indentified: 2016.08.14(Sunday), 2016.10.16(Saturday), 2017.03.26(Sunday). Thanks to CicLAvia Campaign on those three days, people get out their house, leaving their cars at home, taking a walk, a bike ride, spinning, or dancing through Los Angeles. Much more bike-share trips started from or ended with those stations around the main open streets are records. Although the three extremely high peaks show the strong willingness of the public in LA to take part in the Campain, they help nothing with my intention. Removing them from dataset is a good choice.

Analysis the data in weekdays and weekends separately

It is a common sense that most of humans activities follows the normal distribution. Let’s assuming the amounts of bikes in usage for every time interval follow the normal distribution. Then the 68-95-97.5 rule is very powerful here. For example, it can be estimated that there are 95% probability that no more than mean+2*sigma number of sharing bike are sufficiently utilized and 50% probability that the average number of using sharing bike could meet the public demand for every time interval.


Figure 2.  Estimate Metro Bike Share peak in both weekdays and weekends

Note 5 lines are curved in each figures: mean-2*sigma, mean-sigma, mean, mean+sigma, mean+2*sigma and shade the area between mean and mean+2*sigma, as the line stands for the mean is the least public requirement number of the sharing bikes and the line stands for the mean+2*sigma can be thought as the upper limit number of available sharing bikes the Metro bike-share company should offer. If less than mean number of sharing bike is available in the market for every time interval, then the public demand cannot be effectively met. If more than the mean+2*sigma number of bikes are provided to the public for every time interval, the waste problem arise.

Taking sharing bike transfering into consideration

In the real world, the number of the bike of a specific site is not static. It ususally fluctuate as people keep picking up and dropping off bikes. In order to maintain a certain number of sharing bikes at each site, the total number of sharing bikes deployed in the market should be increased from what I got in the last section.

Figure 3.  Difference between pick-up and drop-off by stations in weekdays and weekends

Data collected shows that the number of sharing bike should be increased by 39 in weekdays and by 33 in weekend. we suggest 39 as an addend.

Conclusion

Since we already know the public demand amount of sharing bikes in reality and the basic principle of the number of sharing bikes should be provided to the public, a suggestion of optimized deployment of sharing bikes in the Los Angeles area should be made based on the analysis of the two groups, weekday and weekend. At this point. I suggest that the level of at least 61+39=100 and at most 102+39=141 available sharing bikes should be maintained in the Los Angeles area.

Citations

  1. ark H.. The bike share War is shaking up Seattle like nowhere else. https://www.wired.com/story/the-bike-share-war-is-shaking-up-seattle-like-nowhere-else/.
  2. Nick L. Photo of Ofo Bike Share graveyard in Dallas latest example of colossal waste. https://www.inverse.com/article/47878-ofo-bike-share-graveyard.
  3. https://bikeshare.metro.net/about/data/.