This repository contains the code and data necessary to achieve the model presented in the paper Optimal Siting and Sizing of Electric Vehicle Energy Supplement Infrastructure in Highway Networks. In this research, a mixed integer linear programming (MILP) model is proposed to optimize the location and capacity of ESIs, including vehicle charging stations (VCSs), battery swapping stations (BSSs), and battery charging stations (BCSs), in highway networks.
The objective of this model is to minimize the total cost with the average waiting time for EVs being constrained. In this model, battery swapping and transportation behaviors are optimized such that the EV average waiting time can be reduced, and the average queue and service process waiting time is estimated by the M/M/1 model. Real-world data from the London M25 highway network system are used as a case study to test the effectiveness of the proposed method. The results show that considering battery transportation behaviors is more cost-efficient, and the results are sensitive to the EV average waiting time tolerance, battery cost, and charging demand. Note that the performance and the results can vary due to the version of the Gurobi solver and the gap.
- Python 3.x
- pandas
- numpy
- os
- math (part of Python Standard Library)
- networkx
- gurobipy
-
Install the required Python libraries:
pip install pandas numpy networkx gurobipy
-
Ensure you have Gurobi installed and properly licensed. Here are some useful links:
- Gurobi License: How do I obtain a Gurobi license?
- Gurobi Installation: How do I install Gurobi Optimizer?
- Get Started: Getting Started with Gurobi Optimizer
- How do I set up Gurobi in WSL2 (Windows Subsystem for Linux)?
We generate London M25 highway network system traffic flow data using data from the National Highways of the UK.
Place the following files in the data
directory:
Node.csv
: Contains information about highway nodes.- Traffic flow CSV files: Named according to the format specified in
Node.csv
.
-
Place the script files
data.py
,model.py
, andtest.py
in your working directory. -
Run the optimization script:
python test.py
The script will load the data, process it, create a traffic network graph, define and solve the optimization model, and save the results to results.txt
. If the model is infeasible, the IIS (Irreducible Inconsistent Subsystem) will be saved to model.ilp
.
A step-by-step development of the code is shown in EV_Infrastructure_Planning.ipynb
, which is friendly for beginners in the classic problem in Operational Research: Facility Location Problem (FLP), solved by Mixed-Integer Linear Programming (MILP).
This project is licensed under the MIT License - see the LICENSE file for details.