Adam N. Elmachtoub and Hyemi Kim
This repository contains the source code to reproduce the findings presented in the research paper titled "Fair Fares for Vehicle Sharing Systems". For an in-depth understanding, please refer to the full paper.
Some code files utilize the Pyomo library to address non-convex optimization challenges. We employ the Couenne (global solver) and Ipopt (local solver) optimization solvers. While the codebase is tailored for usage with Colab, you have the flexibility to execute it locally by setting up the necessary libraries, such as pyomo.
-
$N$ : Number of locations (nodes) -
$K$ : Number of vehicles (units)
Visualizes characterized regions demonstrating price fairness implications for both linear and exponential demand models.
- Fairness Metrics: Price & Access
- Demand Function: Linear Demand
-
$N = 2$ ,$K = 1$
- Fairness Metrics: Price & Access
- Demand Function: Exponential Demand
-
$N = 2$ ,$K \geq 1$
- Fairness Metrics: Price & Access
- Demand Function: Linear Demand
-
$N = 2$ ,$K = 1$ - travel time >= 0
- Fairness Metrics: Price & Access
- Demand Function: Linear Demand
-
$N = 2$ ,$K = 1$ - Reposition is available
- Fairness Metrics: Price & Access
- Demand Function: Linear Demand
-
$N = 2$ ,$K \geq 1$
- Adjust the file location within the relevant code sections.
- Download the required data based on your desired analysis timeframe:
- Yellow Taxi Trip Records (PARQUET)
- Green Taxi Trip Records (PARQUET)
- High Volume For-Hire Vehicle Trip Records (PARQUET)
- Taxi Zone Lookup Table (CSV)
- Organize downloaded files into the "Case_Study/Data" folder.
- To visualize outcomes, download Taxi Zone Shapefile (PARQUET) and include the following files:
- taxi_zones.shx
- taxi_zones.shp
- Adjust the timeframe within the code as needed:
time_start = "2023-03-03 18:00:00"
time_end = "2023-03-03 20:00:00"- Output: data_dictionary_logistic.pkl
- Update the pwd (path) to load data_dictionary_logistic.pkl.
Computational_Linear.ipynb & Computational_Linear_Visualize_Results.ipynb (Figure 8 & 9 in Appendix)
- Run Computational_Linear.ipynb for each range of piece-wise linear demand (denoted as z)
- Visualize the result using Computational_Linear_Visualize_Results.ipynb
- The derived results are in the Computational_Linear_Results.zip
- Fairness Metrics: (trip/origin based) Price & Access
- Demand Function: Exponential Demand
-
$N = 3$ ,$K \geq 1$
- Get an approximate solution from Heuristic_Exponential.ipynb
- Using the approximated solution, run Exponential_Grid_Search.ipynb in Grid_Search
- Characterized_Region_Travel_time.ipynb: Figure 1
- Travel_time_K: Figure 2 & 3
- Repositioning_K: Figure 4 & 5
- Change the timeframe and follow the same procedure as in the Case Study