Next Article in Journal
Assessing the Impact of Climate-Resilient City Development on Urban Sustainability: Evidence from China
Previous Article in Journal
Drainage Network Generation for Urban Pluvial Flooding (UPF) Using Generative Adversarial Networks (GANs) and GIS Data
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Sustainable Dynamic Scheduling Optimization of Shared Batteries in Urban Electric Bicycles: An Integer Programming Approach

1
School of Management, Shanghai University, Shanghai 200444, China
2
School of Cultural Heritage and Information Management, Shanghai University, Shanghai 200444, China
*
Authors to whom correspondence should be addressed.
Sustainability 2025, 17(10), 4379; https://doi.org/10.3390/su17104379
Submission received: 13 March 2025 / Revised: 29 April 2025 / Accepted: 6 May 2025 / Published: 12 May 2025

Abstract

:
With the proliferation of electric bicycle battery swapping models, spatial supply demand imbalances of battery resources across swapping stations have become increasingly prominent. Existing studies predominantly focus on location optimization but struggle to address dynamic operational challenges in battery allocation efficiency. This paper proposes an integer programming (IP)-based dynamic scheduling optimization method for shared batteries, aiming to minimize transportation costs and balance battery distribution under multi-constraint conditions. A resource allocation model is constructed and solved via an interior-point method (IPM) combined with a branch-and-bound (B&B) strategy, optimizing the dispatch paths and quantities of fully charged batteries among stations. This study contributes to urban sustainability by enhancing resource utilization efficiency, reducing redundant production, and supporting low-carbon mobility infrastructure. Using the operational data from 729 battery swapping stations in Shanghai, the spatiotemporal heterogeneity of rider demand is analyzed to validate the model’s effectiveness. Results reveal that daily swapping demand in core commercial areas is 3–10 times higher than in peripheral regions. The optimal scheduling network exhibits a ‘centralized radial’ structure, with nearly 50% of batteries dispatched from low-demand peripheral stations to high-demand central zones, significantly reducing transportation costs and resource redundancy. This study shows that the proposed model effectively mitigates battery supply demand mismatches and enhances scheduling efficiency. Future research may incorporate real-time traffic data to refine cost functions and introduce temporal factors to improve model adaptability.

1. Introduction

Governments worldwide are increasingly focusing on renewable energy and its associated infrastructure. This shift is driven by the global adjustment of energy structures and the advancement of sustainable development goals [1]. Electric bicycles (e-bikes) have become popular for urban short-distance commuting [2]. They are also widely used in logistics, especially in food delivery, because of their economic efficiency and environmental benefits [3]. However, inadequate charging infrastructure and prolonged charging times, among other challenges, exacerbate range anxiety among electric bicycle users [4]. Compared to conventional charging methods, the battery swapping mode offers rapid energy replenishment, reduces user waiting time, and enhances operational efficiency, thereby emerging as a critical energy supply solution for e-bikes [5]. This mode integrates centralized charging management with intelligent scheduling, effectively utilizes off-peak electricity resources, reduces carbon emissions, and provides essential technical support for constructing urban green transportation systems [6]. In recent years, extensive research has been conducted on facility location optimization, focusing on point-demand theory-based approaches such as P-median location studies [7,8], coverage location research [9,10], and P-center location analysis [11,12] to enhance user experience and optimize infrastructure deployment. Our prior work [13] presents a location model founded on point-demand theory. It comprehensively considers rider satisfaction and cabinet service capacity and thus improves rider experience via optimized network layouts. Nevertheless, while location optimization enhances coverage and user convenience, it remains insufficient for efficient battery swapping operations. In practice, spatial mismatches frequently occur between battery resource distribution in swap cabinets and localized rider demand, leading to a resource surplus in certain areas and shortages in others. Consequently, allocating and scheduling shared batteries rationally has become a pivotal challenge. The goal is to ensure spatiotemporal alignment between supply and demand in the swapping network.
The supply demand imbalance in shared battery operations predominantly manifests spatially. Commercial and office districts have substantially higher swapping demand than residential or suburban areas [14]. Reliance on static replenishment without dynamic redistribution may exacerbate shortages in high-demand zones and surplus in low-demand regions, thereby degrading overall service quality [15]. To address this, effective resource allocation strategies must dynamically adapt fully charged battery supplies to heterogeneous spatial demands, forming a crucial research direction for optimizing swapping network efficiency.
Building upon existing location optimization studies, this paper proposes an integer programming (IP)-based resource allocation model for shared battery networks. The model aims to minimize distribution imbalance, maximize matching rates, and reduce scheduling costs while incorporating constraints such as swapping demand, cabinet capacity, and operational limits. To enhance computational efficiency for large-scale IP problems, the IPM [16] is employed for model resolution. Empirical validation using real-world data demonstrates the method’s effectiveness in improving matching rates, optimizing resource distribution balance, and reducing transportation costs.
This research further investigates dynamic resource allocation in battery swap cabinets, proposing a coordinated optimization strategy integrating IP with IPM. This approach effectively mitigates supply demand mismatches. Our results show that dynamically adjusting battery paths and quantities enhances operational efficiency and reduces service response times. This work offers both theoretical insights and practical paradigms for intelligent scheduling and resource management in urban battery-swapping networks. The main contributions of this paper are threefold:
(1)
We develop an integer programming model for the dynamic scheduling of shared e-bike batteries that minimizes transportation costs and promotes resource balance in a sustainable urban mobility context.
(2)
We propose a hybrid solution framework combining an IPM and B&B to improve computational efficiency and guarantee global optimality.
(3)
We validate our approach using operational data from 729 Shanghai swap stations, demonstrating enhanced resource utilization, reduced operational costs, and lower carbon emissions.
The remainder of this paper is organized as follows. Section 2 reviews related work on sustainable resource allocation and presents the materials and methods. Section 3 presents the problem description and basic modeling assumptions. Section 4 details our methodology, including the integer-programming formulation and the ‘IPM + B&B’ solution strategy. Section 5 reports a real-world case study and computational results on Shanghai’s swap-station network. Finally, Section 6 concludes and outlines directions for future research.

2. Materials and Methods

2.1. Integer Programming in Resource Allocation

IP exhibits broad applicability in resource allocation. In logistics and supply chain management, Chen et al. [17] addressed rail cargo flow distribution by constructing a mixed-integer programming (MIP) model integrating express, rapid, and standard freight trains, as well as passenger luggage compartments. This model optimized cargo scheduling strategies with the objective of minimizing operational costs. Yu et al. [18] tackled congestion and vehicle utilization inefficiencies in temporary storage zones in airport logistics. They incorporated flight arrival times and cargo destinations as constraints in their MIP formulation. This approach minimizes detention time and transportation costs and, as a result, enhances air cargo sorting efficiency. In road freight transportation, Peng et al. [19] designed an MIP model to reduce truck empty-load rates under trailer swapping mode (TSM), achieving cost reduction and operational efficiency improvements. Additionally, Zoltners and Sinha [20] established an IP framework for sales resource allocation, providing decision support for complex sales environments through multi-period and multi-constrained modeling. Yu et al. [21] further integrated Q-learning algorithms to solve nonlinear resource allocation problems in disaster relief logistics, validating their effectiveness in multi-objective collaborative optimization.
In logistics distribution, IP plays a pivotal role. Huang et al. [22] optimized order allocation and transportation using IP, while Li et al. [23] improved rural logistics site selection and vehicle scheduling via MIP, both significantly reducing distribution costs and enhancing economic efficiency. For long-haul freight scenarios, Yücel et al. [24] developed a mixed-integer linear programming (MILP) model that integrates delivery deadlines, vehicle capacities, and cargo compatibility constraints. Coupled with an adaptive large neighborhood search (ALNS) algorithm, their approach achieved transportation cost reduction and efficiency gains. Sun et al. [25] explored emerging delivery paradigms by proposing an MILP model for drone-rider collaborative scheduling, optimizing order allocation under energy consumption and pickup time constraints to enhance on-demand delivery services.
In telecommunications resource allocation, IP has also seen profound applications. Wu et al. [26] designed an MILP-based resource allocation model for simultaneously transmitting and reflecting reconfigurable intelligent surface (STAR-RIS)-assisted multi-carrier networks, maximizing spectral efficiency through total system rate optimization. Xu et al. [27] systematically reviewed the role of IP in 5G heterogeneous networks (HetNets), emphasizing its core value in spectrum sharing and interference management, with dynamic allocation strategies notably enhancing network performance. Wei et al. [28] developed a multi-objective integer programming model for vehicular cloud computing (VCC) systems, balancing resource acceptance rates and cloud service costs to advance vehicular network resource management.
Although Jia et al. [29] proposed a hybrid IP model for battery charging and logistics, their work overlooked the spatial heterogeneity of swapping demand and real-time dispatch constraints. Tan et al. [30] developed an MIP-based scheduling model for battery charging stations to optimize charging processes, reduce costs, and meet battery demand. However, their study primarily targets electric vehicles and fails to consider the heterogeneity of battery swapping demand and real-time allocation constraints in electric bicycle networks. As battery swapping gains traction, the contradiction between shortages in high-demand zones and surpluses in low-demand areas has intensified, necessitating dynamic scenario-adapted optimization models.
Despite these advancements, a research gap persists in applying IP to battery resource allocation among electric bicycle swapping stations. Existing studies predominantly focus on static facility location or single-objective optimization, lacking attention to dynamic supply–demand matching and multi-objective coordination. Therefore, this paper fills this gap by proposing a dynamic scheduling optimization model based on integer programming for shared battery systems. The model minimizes distribution imbalance, maximizes matching rates, and reduces scheduling costs. IPM is employed to solve the resource allocation problem under complex constraints, and the model is empirically validated using operational data from battery-swapping networks. This research not only bridges the application gap of IP in electric bicycle battery swapping but also provides a theoretical and practical framework for intelligent scheduling in urban green transportation systems.

2.2. Algorithmic Approaches for Vehicle Resource Allocation

In vehicle resource allocation problems, the selection of solution algorithms has a direct impact on scheduling efficiency and cost control. Owing to the frequent involvement of complex constraints and multi-objective optimization, researchers typically integrate mathematical modeling with intelligent algorithms. Widely adopted models include MIP, constraint programming (CP), and linear programming (LP). These are often combined with heuristic methods (e.g., large neighborhood search, greedy algorithms), metaheuristic techniques (e.g., tabu search), and machine learning approaches to improve solution efficiency. While some studies verify algorithm performance via simulation, others employ neural network-based demand forecasting to develop multi-objective optimization models for precise resource allocation.
Regarding general vehicle scheduling algorithms, Lam et al. [31] tackled the joint scheduling of vehicles and passengers by formulating a hybrid model that integrates MIP with CP, subsequently optimizing vehicle routing and passenger allocation through large neighborhood search. In parallel, Ouahmed et al. [32] developed an LP-based model aimed at balancing service quality with operational costs. They then scaled up the scope by combining greedy algorithms with tabu search, demonstrating feasible multi-objective coordination. Eliiyi et al. [33] addressed one-way vehicle allocation with a mixed-integer model. They also proposed six heuristics that cut configuration costs and handle complex constraints efficiently.
Focusing on resource optimization in specific contexts, Alfian et al. [34] evaluated relocation strategies via discrete event simulation to resolve imbalances in one-way vehicle allocation. Similarly, Tang et al. [35] addressed the fluctuating demand inherent in car-sharing by devising a two-tier multi-traveling-salesman model with time windows and employing the IPM to minimize overall system and labor costs. For non-full-load vehicle scheduling under time window constraints, Yang et al. [36] refined the nearest insertion method by designing a heuristic algorithm to boost delivery efficiency. Furthermore, Gao et al. [37] integrated long short-term memory (LSTM) neural networks to forecast station demand and developed a multi-objective IP model to optimize labor and inventory costs, thereby achieving dynamic resource allocation. Additionally, Xu et al. [38] transcended traditional cost models by incorporating full lifecycle costs including fuel consumption, carbon emissions, and vehicle depreciation. Then, they proposed an improved IPM for solving vehicle allocation problems. Finally, Li et al. [39] developed a prototype decision support system for the vehicle routing and scheduling problem (VRSP) to minimize operational and delay costs. Testing under trip interruptions confirmed the algorithm’s robustness and provided guidance for real-time scheduling.
In the field of resource allocation solution algorithms, existing studies have provided valuable insights through heuristic or meta-heuristic algorithms. However, these approaches often suffer from limited adaptability to real-time scheduling, and face challenges in balancing computational efficiency with solution feasibility—especially for large-scale problems. These limitations highlight the need for more robust and scalable optimization frameworks. To address these challenges, this study proposes a dynamic shared-battery allocation strategy based on IP. Specifically, we construct an IP model that aims to minimize transportation costs while accurately defining supply–demand relationships among swap stations. To solve the model efficiently, we adopt a hybrid framework that integrates the IPM with the B&B strategy. Unlike simplex-based or heuristic methods, IPM offers better scalability and faster convergence with reduced reliance on initial solutions. The B&B component ensures integrality by systematically branching on variables, while IPM efficiently solves the continuous relaxations of sub-problems. This hybrid approach not only improves computational performance but also maintains high solution quality under complex real-time constraints. It provides a precise and practical tool for dynamic scheduling in urban battery-swapping networks, thereby enhancing operational feasibility and supporting intelligent resource management at scale.

2.3. Integrated Framework for Dynamic Scheduling Optimization

This section details the methodological framework for optimizing shared battery systems:
(1)
Problem formulation and IP model: We formalize the battery scheduling problem as a multi-constraint integer program (Section 3 and Section 4.1). Key components include decision variables ( n j s j d ), the objective function (Equation (5)), and constraints (Equations (6)–(8)).
(2)
Synergistic ‘IPM + B&B’ optimization: To solve the model efficiently, we combine (a) the interior-point Method (IPM): handles continuous relaxations of sub-problems, using barrier functions (Equation (9)) and Newton iterations (Equation (13)) to navigate the feasible region; and (b) Branch-and-Bound (B&B)): Enforces integer constraints via variable branching (Equations (10) and (11)) and pruning strategies.
(3)
Algorithmic workflow: The step-by-step workflow ensures systematic convergence, including (a) initialization: feasible integer solutions via greedy allocation, (b) iterative optimization: IPM solves relaxed sub-problems; B&B partitions non-integer variables, and (c) convergence: terminates when duality gaps or iteration limits are met.

3. Problem Description

3.1. Fundamental Issues of Battery Resource Allocation

It is essential to first clearly define the decision variables in applying IP methods to the allocation of shared battery resources for electric bicycles. Specifically, the model must determine two integer decision variables. First, it computes how many batteries to reallocate from each supply point to each swap station. Second, it allocates the required manpower at each station. The objective function balances cost-effectiveness and service quality. It minimizes transportation, procurement, and labor costs. At the same time, it boosts service efficiency by reducing users’ waiting times for battery swaps. The constraints ensure feasibility by stipulating that (a) battery supplies must not exceed inventory limits, (b) the demands at swap stations are fully met, and (c) the manpower available is appropriately matched with battery quantities to maintain operational efficiency. Finally, professional optimization software is employed to solve the established integer programming model. The resulting solution directly informs the optimal allocation of both batteries and manpower.
Our study specifically addresses the spatial mismatch between fully charged batteries within swap cabinets and the battery swapping demand from riders in a given region. To optimize resource allocation, a three-stage solution is proposed:
(1)
Data Collection and Analysis:
Utilizing sensor data from existing swap cabinets within the region, records of rider battery swap activities (including time, location, and operation) are gathered.
(2)
Demand Forecasting and Supply Planning:
Sub-problem 1: Analyzing historical data to quantify the geographical distribution of rider swap demand.
Sub-problem 2: Battery supply at each station is quantified based on demand forecasts and initial cabinet inventories.
(3)
Configuration and Scheduling Implementation:
Sub-problem 3: Developing a shared battery resource allocation plan by integrating the daily swapping patterns of riders.
Sub-problem 4: Optimal dispatch routes are planned to minimize transportation costs based on the configuration from the sub-problem.
This systematic framework (Figure 1) ensures that the resource allocation scheme is both scientifically rigorous and practically feasible.
The following provides detailed descriptions of the four sub-problems:
(1)
Battery Demand Forecasting at Swap Stations:
The core of demand forecasting lies in determining the daily quantity of shared batteries to be dispatched to each cabinet. Historical operational data (e.g., swapping times, locations, and frequencies) are analyzed to quantify regional demand distribution. Food delivery riders, as the primary user group, exhibit high-frequency swapping behaviors, often causing shortages of fully charged batteries in core areas. When demand at station D j exceeds its initial reserve S , the deficit d j is calculated as follows:
d j = D j S ,   D j > S 0 ,   D j S
In this expression, d j , D j , and S represent the daily battery deficit, rider demand, and initial reserve at station j , respectively. That is, if the demand at station j exceeds the initial inventory, additional batteries are needed. If the demand is less than or equal to the initial inventory, no additional batteries are required (i.e., d j = 0 ).
(2)
Battery Supply Forecasting at Swapping Stations
The supply forecast and demand forecast form a bidirectional complementary relationship. When the battery swap demand D j at a network site is lower than the initial storage capacity S , the surplus batteries can be allocated as supply resources. The supply s j is defined as follows:
s j = 0 ,   D j S S D j ,   D j < S
where s j is the battery supply quantity that can be allocated from the swap station j each day. When the daily demand D j at a swap cabinet is greater than or equal to the initial capacity of fully charged batteries S , there are no surplus batteries available for allocation, resulting in s j = 0 . When the daily demand D j is less than the initial fully charged storage capacity S , the cabinet can allocate surplus batteries, with the supply quantity given by s j = S D j .
(3)
Battery Configuration Scheme Design
The allocation scheme must clearly define both the method of transfer and the scheduling frequency. The chosen method involves the use of dedicated operational vehicles for centralized battery transport, while each station is equipped with explosion-proof cabinets for the temporary storage of surplus batteries (assuming sufficient storage capacity). The scheduling frequency is derived from an analysis of one week’s battery swap and collection records from all swap cabinets in Shanghai, as provided by Company H (Figure 2). These records reveal that food delivery riders primarily request battery swaps between 10:00 and 22:00, with the period from late night to early morning reserved for concentrated charging. We implement a dynamic scheduling strategy based on usage patterns. After 22:00 each day, regional transfers begin. Fully charged batteries are sent to high-demand stations, and low-charge batteries are returned to cabinets for overnight recharging. This two-step process ensures smooth, efficient resource circulation.
(4)
Dispatch Route Planning
Route planning involves determining the optimal path for each battery transfer—from swap cabinets with surplus batteries to those experiencing shortages. This requires obtaining the geographical coordinates (latitude and longitude) of both the supplying and receiving cabinets, as well as the transfer quantities. We address this multi-source, multi-destination problem with a linear-programming model. Its objective is to minimize total transfer cost, measured by the sum of Euclidean distances. The model is formulated as follows:
f = j s = 1 J S j d = 1 J D c j s j d n j s j d
In this equation, c j s j d denotes the transportation cost between surplus station j s and deficit station j d , n j s j d represents the number of batteries dispatched, and J S , J D are the sets of surplus and deficit stations, respectively. Thus, the objective is to minimize the overall distance traveled by all transferred batteries.
By sequentially addressing the sub-problems above, an IP model is constructed to resolve spatiotemporal mismatches in battery supply and demand. It thus provides a systematic solution for efficient shared battery network operations. This solution not only enhances the operational efficiency of shared battery networks but also contributes significantly to reducing energy waste and promoting a sustainable green transportation ecosystem.

3.2. Basic Assumptions for Battery Resource Allocation

To minimize transportation costs, we make these assumptions:
(1)
Rider demand follows predictable patterns, accurately forecast using one week of historical swapping records (time, location, frequency).
(2)
Daily initial battery reserves at each station are fixed, with stable battery performance and no unexpected failures or charging errors.
(3)
Dispatch vehicles, station capacities, and labor resources are unlimited, and non-dispatch operational costs are fixed, and thus excluded from the model.
(4)
Per-battery dispatch costs are calculated piecewise, with fixed unit distance costs substituted for actual transportation expenses.
We simplified and replaced some of the parameters in the model:
(1)
The distance between swap cabinets is computed using the Euclidean distance. Consequently, the transfer cost is shown in Equation (4), where ( x j s , y j s ) and ( x j d , y j d ) are the geographic coordinates of surplus and deficit stations, respectively, ( x j s x j d ) 2 + ( y j s y j d ) 2 is the Euler distance between the two cabinets, and C is a fixed cost coefficient. Thus, the allocation cost is proportional to the distance.
c j s j d = C × ( x j s x j d ) 2 + ( y j s y j d ) 2
(2)
Each station is assumed to be equipped with two swap cabinets, each with a capacity of 24 batteries, resulting in a total initial daily inventory of 48 fully charged batteries per station.
(3)
A battery takes 24 h to discharge from full charge to depletion (ignoring the transfer time), meaning that battery transfers are required only once per day.

4. Model Construction and Algorithm Design

4.1. Model Construction

The decision variable n j s j d , an integer variable, denotes the number of batteries dispatched from surplus swapping station j s to deficit swapping station j d . When n j s j d > 0 , batteries are transferred from j s to j d . When n j s j d = 0 , no transfer occurs between the two stations. The variable satisfies n j s j d ϵ N + ( j s ϵ J S , j d ϵ J D ) . Detailed model symbols and indices are listed in Table 1.
Based on the above definitions, the swapping station location model with transportation cost minimization is formulated as follows:
Objective Function:
m i n f = j s = 1 J S j d = 1 J D c j s j d n j s j d
Constraints:
(1)
For any deficit station j d , the total incoming batteries must satisfy its deficit without over-supply:
j s = 1 J S n j s j d = D j d S j d ϵ J D
(2)
For any surplus station j s , the total outgoing batteries must not exceed its supply capacity:
j d = 1 J D n j s j d S D j s j s ϵ J D
(3)
Non-negativity and integrality:
n j s j d ϵ N + ( j s ϵ J S , j d ϵ J D )

4.2. Interior Point Method

Building on the prior literature, this study employs the interior-point method (IPM) to solve the integer programming model. Compared to traditional simplex methods, IPM offers the following advantages:
(1)
Scalability to Large-Scale Problems: IPM efficiently handles high-dimensional, sparse linear/quadratic programming problems, making it ideal for complex resource allocation scenarios like multi-station battery dispatch.
(2)
Numerical Stability: In ill-conditioned or pathological optimization problems, the iteration paths of IPM remain within the feasible region, reducing numerical oscillations compared to simplex methods.
(3)
Global Feasibility: By constraining iteration paths via barrier functions, IPM maintains solution feasibility throughout the process, minimizing inefficient searches and accelerating convergence.
The shared battery resource allocation problem studied in this paper involves integer decision variables and must meet complex operational constraints. Traditional heuristic methods, although fast in computation, are prone to issues such as local optima and insufficient stability [40]. By contrast, the interior-point method, as a deterministic optimization approach, not only improves solution accuracy and stability but also exhibits good scalability [41]. To further enhance the ability to solve integer constraints, this paper combines the interior-point method with the branch-and-bound (B&B) method. The B&B strategy systematically explores the solution space and progressively prunes to narrow the search range, thereby improving computational efficiency while maintaining global optimality.
In summary, this paper employs the ‘IPM + B&B’ strategy to optimize the integer programming model constructed. This approach effectively enhances the model’s computational efficiency and practical operability in complex scheduling scenarios, while ensuring global feasibility. The solution process consists of four key steps, which will be detailed in the following sections.

4.2.1. Initialization of Feasible Solutions

The initial solution n j s j d is critical for the IP model, requiring the satisfaction of all constraints and integrality. A heuristic approach is adopted: (a) Initial State: Set n j s j d = 0 (no battery dispatch). (b) Greedy Allocation: For each deficit station j d , allocate batteries from surplus stations j s until demand D j is met or surplus capacity S D j s runs out, ensuring n j s j d remains an integer. (c) Feasibility Adjustment: The variables are adjusted to ensure that all constraint conditions are satisfied after the initial allocation.

4.2.2. Construction of the Potential Function

Since the IPM inherently handles continuous variables, the integer constraints are initially relaxed, and the continuous relaxation problem is solved via IPM. The solution is subsequently an integer. IPM constructs an objective function incorporating a logarithmic barrier function to manage equality and inequality constraints:
η , μ = j s = 1 J S j d = 1 J D c j s j d n j s j d μ ( j d = 1 J D ln S j s = 1 J S n j s j d + j s = 1 J S ln S j d = 1 J D n j s j d D j s )
In Equation (9), μ represents a positive parameter controlling the influence of the logarithmic barrier function, which decays gradually toward zero. After each iteration, the continuous solution is rounded to the nearest integer. If the rounded solution violates constraints, adjustment strategies—such as battery reallocation via swap operations—are applied to enforce integrality and feasibility.

4.2.3. Iterative Optimization for the Optimal Solution

The branch-and-bound (B&B) algorithm solves integer programming problems by recursively decomposing the problem into sub-problems, bounding their solutions, and pruning non-optimal branches [42]. Its core principles include (a) branching: decomposing the problem into sub-problems, (b) bounding: calculating upper and lower bounds for each sub-problem, and (c) pruning: eliminating sub-problems that cannot yield optimal solutions through bound comparisons.
Our study integrates B&B with IPM to efficiently explore the solution space. After obtaining an initial integer solution, the problem splits into two branches: one enforcing the upper bound and the other the lower bound of a selected variable. IPM is then applied to optimize each branch by computing the gradient of the potential function η , μ based on the current solution n j s j d . Finally, the updated known solutions are saved, pruning the search space, and gradually obtaining better integer solutions. Under the B&B framework, the core steps for solving the IP model with the IPM are as Table 2.
Table 2 outlines the iterative optimization process of B&B with the IPM, covering initialization, branch variable selection, sub-problem generation, barrier function adjustment, and pruning rules.
To clarify the overall algorithm logic, Algorithm 1 defines input-output parameters and termination conditions based on these steps, integrating them into a complete algorithm framework using pseudocode. Together with Table 2, these present both the theoretical foundation and a practical implementation pathway.
Algorithm 1 B&B and IPM
Input: Model parameters ( c , S , D ), termination conditions ( ϵ g a p ,   K m a x )
Output: Optimal dispatch scheme n j s j d , minimum transportation cos t   f
1. Initialize global bounds: f U B = + ,   f L B =
2. add root node to the active node queue
3. while active node queue is non-empty and not timed out:
4. extract a node and solve its relaxation via IPM
5. if the relaxed solution is infeasible or f r e l a x f U B :
6.  prune the node
7. elif the relaxed solution is integer-feasible:
8.   if f r e l a x < f U B :
9.    update f U B = f r e l a x ,   n j s j d = n r e l a x
10. else:
11.  select branching variable ( j s * ,   j d * ) via δ j s j d
12.  generate sub-problem 1: n j s * j d * n j s * j d * * , sub−problem 2: n j s * j d * n j s * j d * *
13.  for each sub-problem:
14.   warm-Start initialization n i n i t i a l = n * + α Δ n
15.   solve sub-problems using the IPM, Obtain f s u b , n s u b
16.   if f s u b < f U B :
17.    add sub-problems to the active queue
18. update f L B = m i n {active queue’s f r e l a x }
19. if f U B f L B ϵ g a p , terminate
20. check convergence criteria (Table 4)
21. return n j s j d ,   f

4.2.4. Initialization of Feasible Solutions

Table 3 outlines the convergence criteria for our hybrid “B&B + IPM”. These criteria ensure the method approaches an optimal solution without excessive computational effort. The core steps include the following:
The corresponding algorithm framework is shown in Algorithm 2:
Algorithm 2 Model convergence verification
Input: f U B , f L B , k , t ,     μ k , parameters { σ = 0.1 , ϵ μ = 10 6 ϵ g a p = 10 6 , ϵ i n t = 10 3 ϵ o p t = 10 4 , K m a x = 1000 T m a x = 3600 }
Output: True/False
1. update barrier parameter μ k + 1 = σ μ k
2. if μ k + 1 ϵ μ : stop decay
3. end if
4. if the difference between primal and dual objectives satisfies f p r i m a l f d u a l ϵ g a p :
5.  return True
6. end if
7. if m a x j s J S , j d J D n j s j d * r o u n d n j s j d * ϵ i n t (For all integer variables in the continuous relaxed solution, check the deviation between their values and rounded counterparts, and apply rounding to variables that meet the criteria to obtain n j s j d i n t )
8. if A n i n t b and n j s j d i n t 0   (verify the rounded solution satisfies all constraints. Then, the algorithm converges)
9.  return True
10. end if
11. end if
12. if ( f U B f L B ϵ o p t ) or ( k K m a x ) or ( t T m a x ) (bounds close/reach maximum iteration count/time limit is exceeded)
13. return True
14. else
15. return False
16. end if
To validate the proposed dynamic scheduling model, a case study using empirical data from Shanghai’s battery swap network was conducted. The next section details this application, showcasing how the model performs under real-world operational scenarios.

5. Computing Example

5.1. Data Preprocessing

Our study adopts an instance analysis approach, focusing on operational battery swapping stations in Shanghai. The data are sourced from Company H, a domestic shared battery service provider. The company’s battery swapping cabinets are equipped with sensors and cameras to record riders’ operational behaviors in real time. We collected battery pickup and replacement logs from riders over the past week to estimate daily swapping demand. Prior research has revealed the district-level distribution of rider demand in Shanghai [13]. Through kernel density analysis and the natural breaks classification method, a precise demand density map (Figure 3) was generated, dividing the study area into 16 grids corresponding to Shanghai’s 16 administrative districts. Color intensity indicates demand density, with the darkest hues representing the highest-demand areas, typically located in urban commercial cores.
During data preprocessing, the study area was confined to a rectangular region of approximately 120 km × 100 km. Daily demand distributions were calculated by aggregating and averaging (rounded up) weekly battery pickup and replacement records. Shanghai currently has 729 operational swapping stations. Figure 4 visualizes the spatial distribution of swapping demand: administrative boundaries form the map background, with stars marking station locations. A color gradient (green to yellow to red) indicates demand intensity: green for low-demand stations (daily demand ≤ 50 swaps) and red for high-demand stations (daily demand ≥ 200 swaps). High-demand clusters (red) concentrate in the city’s geometric center, aligning with rider density hotspots in Figure 3, confirming higher demand in commercial downtown areas.

5.2. Swapping Demand Analysis

We focused on the supply–demand relationship in the battery allocation process by analyzing the distribution of daily average battery swap demand at swap stations in Shanghai. Assuming each swap station initially holds 48 fully charged batteries per day, according to Equations (1) and (2), a station is classified as a surplus station if its initial battery stock meets its predicted swap demand. Such stations can supply excess batteries for redistribution. Conversely, if a station’s initial battery stock is insufficient to meet actual daily demand, it is classified as a deficit station, requiring battery inflows from surplus stations to maintain operations. Table 4 illustrates specific changes in selected swap stations during the allocation process.
When the daily battery swapping demand at a station exceeds its initial fully charged battery reserve, external resource allocation is required to meet operational needs (as shown in Table 4). For instance, Station ‘9201801796’ has a daily demand of 96 swaps but only 48 fully charged batteries initially, necessitating an additional 48 batteries from surplus stations. Conversely, Station ‘9201801855’ has a daily demand of 22 swaps, well below its 48-battery reserve, allowing it to supply 26 surplus batteries to neighboring stations.
As visualized in Figure 5, the spatial distribution of battery dispatch status is marked by pentagonal symbols: red stars indicate deficit stations requiring external batteries (‘battery-deficient type’), while green stars represent surplus stations (‘battery-surplus type’). Symbol size correlates with the magnitude of supply–demand gaps: larger symbols denote greater dispatch requirements or surplus capacities. Deficit stations cluster in the urban core, matching the hotspots in Figure 3. This spatial overlap confirms a positive link between swap demand and economic intensity. In contrast, surplus stations are predominantly distributed in peripheral zones, providing critical insights for optimizing dispatch routes.
Notably, analyzing these spatial distribution patterns reveals key insights: First, the city center endures high operational pressure from dense swap demand. Second, suburban areas supply surplus batteries, but their spread makes coordination harder. This spatial heterogeneity also provides valuable perspectives and practical guidance for optimizing battery allocation pathways.

5.3. Battery Configuration Scheme Analysis

The e-bike battery swap industry is still in its expansion phase, with most companies focused on market growth and network deployment. Due to spatial imbalances in fully charged battery distribution and mismatches with rider demand density, efficient battery reallocation among swap stations is necessary. However, no mature allocation strategy currently exists. To address this, we formulate an integer programming model to minimize transport costs and solve it using Equation (4). With a fixed unit transport cost C set to 1 for simplicity, we calculate costs between swap stations. An interior-point algorithm is employed to solve the model iteratively, leading to an optimal solution that minimizes transport costs. Table 5 presents battery allocation results, detailing each station’s redistribution needs. For instance, swap station 9201801051 (121.4080, 31.2460) must transfer eight fully charged batteries to station 9201804694 (121.4140, 31.2360).
Based on the proposed battery allocation model, the overall daily battery distribution in Shanghai is illustrated in Figure 6. Similar to Figure 5, pentagrams represent swap stations: green pentagrams indicate stations supplying fully charged batteries, while red ones denote stations receiving them. The pentagram size reflects the degree of surplus or shortage, and blue arrows indicate battery transfer routes. The figure shows that all blue arrows converge toward the central area, which has the highest swap demand. Most stations requiring battery transfers obtain them from the nearest stations with surplus capacity. Notably, low-demand stations in peripheral areas often struggle to transfer out batteries due to their distance. Thus, we suggest reducing the number of swap cabinets at these stations to better align with daily rider demand. Furthermore, following the site selection strategy proposed in previous research [10], underutilized swap cabinets with low daily transactions should be relocated to more strategic positions, as outlined in Table 6.

6. Conclusions and Future Research

Battery swap cabinets for e-bikes can effectively address users’ charging difficulties, including low charging efficiency, long charging times, and safety hazards during charging. Meanwhile, by employing a shared economy model of ‘centralized charging, self-service swapping, and substituting swapping for charging,’ these cabinets offer a convenient and flexible power solution for professionals such as food delivery personnel. The rapid growth of the battery swapping industry not only accelerates progress in the electric bicycle sector but also promotes green transportation. As such, it represents a key direction in the development of renewable energy infrastructure. This paper proposes a dynamic scheduling strategy to optimize the spatiotemporal allocation of battery resources. The approach reduces unnecessary battery production and disposal, extends the lifecycle of batteries, and supports the circular transformation of urban transportation systems.
In response to the current spatiotemporal mismatch in battery swap networks, we developed an integer programming model to minimize transportation costs. Specifically, the model is constructed as follows: first, the objective is to minimize the total transportation cost among multiple sites by defining a linear function that is positively correlated with transportation cost and delivery distance. Second, constraints are set to reflect real operational scenarios, including demand forecast accuracy, battery inventory capacity limits, and delivery timeliness requirements. Third, decision variables and mathematical constraints are defined to ensure feasibility and solution quality. Finally, the model is efficiently solved using the IPM combined with a B&B strategy to handle integer constraints. Through this modeling and solution process, the paper provides a scientific and feasible solution for optimizing the operation of e-bikes battery swap systems, significantly enhancing overall system efficiency and service quality.
The empirical part of the study focuses on 729 operational swap stations in Shanghai. By collecting one week of continuous rider swap behavior logs, we constructed a database on the spatiotemporal distribution of demand. Statistical analysis was performed to estimate daily average demand at each station. This data, combined with battery inventory information, allowed us to quantify the supply–demand imbalance at the station level. Based on the previously proposed integer programming model, the battery dispatch plan is optimized using the interior-point method, yielding a resource allocation strategy that minimizes transportation cost. The results are as follows. (a) Spatial Demand Heterogeneity: Battery swap demand exhibits significant spatial clustering, with demand intensity negatively correlated with distance from the city center. Core commercial areas (e.g., Huangpu and Xuhui Districts) experience daily demands three to ten times higher than those in peripheral regions (e.g., Chongming District). (b) Regularity of Dispatch Routes: the optimal transportation network displays a ‘centralized radial’ structure, with fully charged batteries primarily transferred from peripheral low-demand stations to central high-demand stations, accounting for nearly 50% of the total transfers. (c) Economic Decision Recommendations: due to low marginal transportation benefits and sparse demand (daily ≤ 20 swaps) at peripheral stations, it is recommended to optimize the network topology through facility relocation or dynamic closure to reduce system redundancy costs.
While the one-week dataset employed in this study effectively captures short-term spatial demand heterogeneity, it does not account for seasonal fluctuations or prolonged demand trends. Future work will extend the data collection period to validate the model’s adaptability to temporal dynamics. Furthermore, actual travel distances can replace Euclidean distances, and real-time traffic data can be used to construct dynamic cost functions that more accurately represent transport conditions. While this paper focuses solely on minimizing transport costs, future work should incorporate time constraints and operational variables such as dispatch personnel availability. Moreover, further studies will explore advanced modeling techniques and optimization algorithms to enhance solution quality and applicability under complex, real-world conditions.

Author Contributions

Conceptualization, Z.Z.; methodology, X.Y., P.L. and W.Y.; validation, P.L., X.Y. and C.Z.; writing—original draft preparation, X.Y. and P.L.; writing—review and editing, Z.Z., X.Y., P.L., W.Y. and C.Z.; visualization, P.L. and W.Y.; supervision, Z.Z. and C.Z.; project administration, Z.Z.; funding acquisition, Z.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data that support the findings of this study are provided by the enterprise. Restrictions apply to the availability of these data, which were used under license for this study. Data are available with the permission of the enterprise.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Olabi, A.G.; Abdelkareem, M.A. Renewable energy and climate change. Renew. Sustain. Energy Rev. 2022, 158, 112111. [Google Scholar] [CrossRef]
  2. Bieliński, T.; Kwapisz, A.; Ważna, A. Electric bike-sharing services mode substitution for driving, public transit, and cycling. Transp. Res. Part D Transp. Environ. 2021, 96, 102883. [Google Scholar] [CrossRef]
  3. Shao, D.; Li, W. New Characteristics and Management Countermeasures of Electric Bicycle Development in Shanghai. Traffic Port Transp. 2020, 7, 16–20. [Google Scholar]
  4. Kohlrautz, D.; Kuhnimhof, T. E-bike charging infrastructure in the workplace—Should employers provide it? Sustainability 2023, 15, 10540. [Google Scholar] [CrossRef]
  5. Gao, S. Electric Bicycles Embrace the “Battery Swap Model”. Hebei Dly. 2021, 7, 1–2. [Google Scholar]
  6. Zhang, S.; Li, X.; Li, Y.; Zheng, Y.; Liu, J. A green-fitting dispatching model of station cluster for battery swapping under charging-discharging mode. Energy 2023, 276, 127600. [Google Scholar] [CrossRef]
  7. Gwalani, H.; Tiwari, C.; Mikler, A.R. Evaluation of heuristics for the p-median problem: Scale and spatial demand distribution. Comput. Environ. Urban Syst. 2021, 88, 101656. [Google Scholar] [CrossRef]
  8. Dang, J.; Wang, X.; Xie, Y.; Fu, Z. The location optimization of urban shared new energy vehicles based on P-Median model: The example of Xuzhou City, China. Sustainability 2023, 15, 9553. [Google Scholar] [CrossRef]
  9. Atta, S.; Mahapatra, P.R.S.; Mukhopadhyay, A. A multi-objective formulation of maximal covering location problem with customers’ preferences: Exploring Pareto optimality-based solutions. Expert Syst. Appl. 2021, 186, 115830. [Google Scholar] [CrossRef]
  10. Hashim, N.I.M.; Shariff, S.S.R.; Deni, S.M. Allocation of relief centre for flood victims using Location Set Covering Problem (LSCP). In Proceedings of the International Conference on Mathematics, Statistics and Computing Technology 2021 (ICMSCT 2021), Bangkok, Thailand, 27–28 October 2021; Volume 2084, p. 012016. [Google Scholar]
  11. Wang, W.; Yang, K.; Yang, L.; Gao, Z. Tractable approximations for the distributionally robust conditional vertex p-center problem: Application to the location of high-speed railway emergency rescue stations. J. Oper. Res. Soc. 2022, 73, 525–539. [Google Scholar] [CrossRef]
  12. Ayudhya, W.S.N. Selecting Temporary Flood Shelter Locations by P-Center Model. In Proceedings of the 2021 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM), Singapore, 13–16 December 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 78–82. [Google Scholar]
  13. Zou, Z.; Yang, W.; Sheng, S.Y.; Yan, X. Research on the Location Selection Problem of Electric Bicycle Battery Exchange Cabinets Based on an Improved Immune Algorithm. Sustainability 2024, 16, 8394. [Google Scholar] [CrossRef]
  14. Faghih-Imani, A.; Hampshire, R.; Marla, L.; Eluru, N. An empirical analysis of bike sharing usage and rebalancing: Evidence from Barcelona and Seville. Transp. Res. Part A Policy Pract. 2017, 97, 177–191. [Google Scholar] [CrossRef]
  15. Shuai, C.; Yang, F.; Ouyang, X.; Xu, G. Data-Driven Prediction of Electric Bicycle Battery Swap Demand. J. Transp. Syst. Eng. Inf. Technol. 2021, 21, 173–179. [Google Scholar]
  16. Gondzio, J. Interior point methods 25 years later. Eur. J. Oper. Res. 2012, 218, 587–601. [Google Scholar] [CrossRef]
  17. Chen, X.; Hai, Y.; Lang, M.; Yu, X.; Li, Y. Railway Express Logistics Network Cargo Flow Distribution Based on Multiple Transportation Organization Modes. Railw. Transp. Econ. 2024, 46, 1–9. [Google Scholar]
  18. Yu, Y.; Bao, X.; Zhang, Y.; Li, Z. Research on Cargo Distribution and Delivery in Airport Logistics Temporary Storage Areas. Mod. Manuf. Eng. 2023, 10, 113–119. [Google Scholar]
  19. Peng, W.; Chen, X.; Xue, Z. Optimization of Highway Truck Freight under the Trailer Swap Mode. J. Transp. Eng. Inf. 2024, 22, 107–117. [Google Scholar]
  20. Zoltners, A.A.; Sinha, P. Integer programming models for sales resource allocation. Manag. Sci. 1980, 26, 242–260. [Google Scholar] [CrossRef]
  21. Yu, L.; Zhang, C.; Jiang, J.; Yang, H.; Shang, H. Reinforcement learning approach for resource allocation in humanitarian logistics. Expert Syst. Appl. 2021, 173, 114663. [Google Scholar] [CrossRef]
  22. Huang, C.; Lin, Y.; Li, N.; Wu, X.; Han, F.; Zhang, J. Optimal Strategies for Production Order Allocation and Transportation Based on Integer Programming Models. Enterp. Sci. Technol. Dev. 2023, 12, 110–115. [Google Scholar]
  23. Li, J.; Zhang, X.; Li, H.; Zhang, S. Design and Optimization of Rural Logistics Distribution Schemes: A Case Study of China Post. Logist. Res. 2023, 6, 34–42. [Google Scholar]
  24. Yücel, E.; Salman, F.S.; Erdoğan, G. Optimizing two-dimensional vehicle loading and dispatching decisions in freight logistics. Eur. J. Oper. Res. 2022, 302, 954–969. [Google Scholar] [CrossRef]
  25. Sun, X.; Fang, M.; Guo, S.; Yue, H. UAV-rider coordinated dispatching for the on-demand delivery service provider. Transp. Res. Part E Logist. Transp. Rev. 2024, 186, 103571. [Google Scholar] [CrossRef]
  26. Wu, C.; Mu, X.; Liu, Y.; Gu, X.; Wang, X. Resource allocation in STAR-RIS-aided networks: OMA and NOMA. IEEE Trans. Wirel. Commun. 2022, 21, 7653–7667. [Google Scholar] [CrossRef]
  27. Xu, Y.; Gui, G.; Gacanin, H.; Adachi, F. A survey on resource allocation for 5G heterogeneous networks: Current research, future trends, and challenges. IEEE Commun. Surv. Tutor. 2021, 23, 668–695. [Google Scholar] [CrossRef]
  28. Wei, W.; Yang, R.; Gu, H.; Zhao, W.; Chen, C.; Wan, S. Multi-objective optimization for resource allocation in vehicular cloud computing networks. IEEE Trans. Intell. Transp. Syst. 2021, 23, 25536–25545. [Google Scholar] [CrossRef]
  29. Jia, W.; Ding, T.; Bai, J.; Bai, L.; Yang, Y.; Blaabjerg, F. Hybrid swapped battery charging and logistics dispatch model in continuous time domain. IEEE Trans. Veh. Technol. 2022, 71, 2448–2458. [Google Scholar] [CrossRef]
  30. Tan, X.; Qu, G.; Sun, B.; Li, N.; Tsang, D.H.K. Optimal scheduling of battery charging station serving electric vehicles based on battery swapping. IEEE Trans. Smart Grid 2017, 10, 1372–1384. [Google Scholar] [CrossRef]
  31. Lam, E.; Van Hentenryck, P.; Kilby, P. Joint Vehicle and Crew Routing and Scheduling. Transp. Sci. 2020, 54, 488–511. [Google Scholar] [CrossRef]
  32. Ouahmed, A.A.; Josselin, D.; Zhou, F. Relocation optimization of electric cars in one-way car-sharing systems: Modeling, exact solving and heuristics algorithms. Int. J. Geogr. Inf. Sci. 2017, 32, 367–398. [Google Scholar] [CrossRef]
  33. Eliyi, D.T.; Ormek, A.; Karakütük, S.S. A vehicle scheduling problem with fixed trips and time limitations. Int. J. Prod. Econ. 2008, 117, 150–161. [Google Scholar] [CrossRef]
  34. Alfian, G.; Rhee, J.; Ijaz, M.F.; Syafrudin, M.; Fitriyani, N.L. Performance Analysis of a Forecasting Relocation Model for One-Way Carsharing. Appl. Sci. 2017, 7, 598–619. [Google Scholar] [CrossRef]
  35. Tang, J.; Cao, J. Research on Joint Scheduling Optimization of Shared Cars. J. Syst. Simul. 2021, 33, 1959–1968. [Google Scholar]
  36. Yang, Y.; Wu, Y.; Yao, Z.; Ren, Z.; Gao, Y. Research and Application of Heuristic Algorithms for Vehicle Routing Problems with Time Windows. Comput. Appl. 2013, 33 (Suppl. S1), 59–61. [Google Scholar]
  37. Gao, J.; Cui, X.; Zhao, P.; Yao, B. Vehicle Scheduling Method for One-Way Shared Electric Vehicles Based on Demand Forecasting. J. Dalian Univ. Technol. 2019, 59, 648–655. [Google Scholar]
  38. Xu, M.; Yu, G.; Zhou, X.; Ge, X. Low-Carbon Vehicle Routing Problem with Integrated Cost Minimization and Its Algorithm. Comput. Integr. Manuf. Syst. 2015, 21, 1906–1914. [Google Scholar]
  39. Li, J.-Q.; Borenstein, D.; Mirchandani, P.B. A decision support system for the single-depot vehicle rescheduling problem. Comput. Oper. Res. 2005, 34, 1008–1032. [Google Scholar] [CrossRef]
  40. Liu, C.; Wu, L.; Xiao, W.; Li, G.; Xu, D.; Guo, J.; Li, W. An improved heuristic mechanism ant colony optimization algorithm for solving path planning. Knowl.-Based Syst. 2023, 271, 110540. [Google Scholar] [CrossRef]
  41. Kardoš, J.; Kourounis, D.; Schenk, O.; Zimmerman, R. BELTISTOS: A robust interior point method for large-scale optimal power flow problems. Electr. Power Syst. Res. 2022, 212, 108613. [Google Scholar] [CrossRef]
  42. Tomazella, C.P.; Nagano, M.S. A comprehensive review of Branch-and-Bound algorithms: Guidelines and directions for further research on the flowshop scheduling problem. Expert Syst. Appl. 2020, 158, 113556. [Google Scholar] [CrossRef]
Figure 1. Design flow of the shared battery scheduling scheme.
Figure 1. Design flow of the shared battery scheduling scheme.
Sustainability 17 04379 g001
Figure 2. Daily trend of battery swap demand by time of day.
Figure 2. Daily trend of battery swap demand by time of day.
Sustainability 17 04379 g002
Figure 3. Kernel density analysis.
Figure 3. Kernel density analysis.
Sustainability 17 04379 g003
Figure 4. Location distribution of power change demand in Shanghai power change network.
Figure 4. Location distribution of power change demand in Shanghai power change network.
Sustainability 17 04379 g004
Figure 5. Distribution of supply and demand for shared battery scheduling in Shanghai.
Figure 5. Distribution of supply and demand for shared battery scheduling in Shanghai.
Sustainability 17 04379 g005
Figure 6. Shared battery scheduling path in Shanghai.
Figure 6. Shared battery scheduling path in Shanghai.
Sustainability 17 04379 g006
Table 1. Model dependent variables.
Table 1. Model dependent variables.
SymbolDescription
j s Index of surplus swapping station, j s ϵ J S .
J S Set of surplus swapping stations.
j d Index of deficit swapping station, j d ϵ J D .
J D Set of deficit swapping stations.
c j s j d Transportation cost per battery from j s to j d .
D j Daily battery demand at station j .
s j Daily surplus battery supply at station j .
d j Daily battery deficit at station j .
S Initial daily reserve of fully charged batteries at each station.
n j s j d Decision variable (number of batteries dispatched).
δ j s j d Fractional deviation of n j s j d , used for branching variable selection.
μ Barrier parameter controlling the precision of interior path tracking.
σ Fixed attenuation factor determining the decay rate of the barrier parameter.
ϵ μ Termination threshold for the barrier parameter.
ϵ g a p Convergence threshold for the duality gap.
ϵ i n t Tolerance for integer feasibility checks.
f U B Global upper bound (current best integer solution’s objective value).
f L B Global lower bound (minimum relaxed solution across active nodes).
Table 2. Steps of iterative optimization via B&B and IPM.
Table 2. Steps of iterative optimization via B&B and IPM.
Step 1: Initialization
 Initialize global bounds: the global upper bound is f U B = + , and the global lower bound is f L B = . Initially, there is no feasible integer solution or relaxed solution information. Then, add the original integer programming problem to the active node queue as the root node. Generate an initial feasible integer solution using the heuristic method in Section 4.2.1 ( n j s j d = 0 followed by greedy allocation) and assign it as the root node’s relaxed solution.
Step 2: Branch Variable Selection and Sub-problem Generation
 Step 2.1: Branch Variable Selection: Select the non-integer variable with the greatest impact on the objective function using fractional deviation:
δ j s j d = m i n n j s j d * n j s j d * , n j s j d * n j s j d * (10)
The variable with the smallest δ j s j d is chosen:
j s * , j d * = a r g   m i n j s , j d δ j s j d (11)
 Step 2.2: Sub-problem Generation: Two sub-problems are created by adding constraints:
 Sub-problem 1: n j s * j d * n j s * j d * * , Sub-problem 2: n j s * j d * n j s * j d * *
Step 3: IPM-Based Sub-problem Solving
 Step 3.1: Barrier Function Modification: For each sub-problem, a barrier term l n n j s * j d * * n j s * j d * is incorporated into the objective function (Equation (9)) to implicitly enforce branching constraints. For instance, in sub-problem 1, the modified objective function is as follows:
η , μ = j s = 1 J S j d = 1 J D c j s j d n j s j d μ ( j d = 1 J D ln S j s = 1 J S n j s j d + j s = 1 J S ln S j d = 1 J D n j s j d D j s + l n n j s * j d * * n j s * j d * ) (12)
 Step 3.2: Newton Iteration: Construct Newton direction linear system, where A is the constraint matrix and b is the right-hand side.
 (Newton’s method is not applied directly to integer variables. Instead, in our hybrid approach, the interior-point/Newton iterations are used only to solve the continuous barrier sub-problems that arise after relaxing the integrality constraints and adding branch-specific barrier terms. The integrality of decision variables is then enforced by the overarching B&B framework through explicit branching constraints and node-wise bounds.)
2 Φ A A 0 Δ n Δ λ = Φ A n b (13)
 Step 3.3: Warm-Start Strategy: Use the parent node’s solution n * as the initial point for sub-problems. Adjust the step size α 0,1 via backtracking line search to ensure feasibility. Ensure that the sub-problem solution starts from the region close to the parent node’s solution, accelerating convergence.
n i n i t i a l = n * + α Δ n (14)
Step 4: Pruning and Bound Updates
 Step 4.1: Pruning Rules: (a) Bound Pruning: prune the branch if the sub-problem’s relaxed solution value is greater than the current optimal integer solution ( f r e l a x f U B ); (b) Infeasibility Pruning: prune if no feasible solution exists; (c) Integer Solution Pruning: update f U B = f r e l a x and prune if f r e l a x < f U B and the solution is integer-feasible.
 Step 4.2: Global Bound Updates: Record the relaxed solution values of all active nodes and update the global lower bound f L B = m i n f r e l a x to ensure it always reflects the potential optimum bound of unprocessed branches.
Step 5: Convergence Check and Termination
 Terminate if f U B f L B ϵ g a p , maximum iterations, or time limit is reached. Otherwise, return to Step 1.
Table 3. Steps of model convergence verification.
Table 3. Steps of model convergence verification.
Step 1: Barrier Parameter Decay
   Reduce the barrier parameter μ by a fixed ratio ( σ = 0.1 ) per iteration; decay stops when μ 10 6 : (namely μ k + 1 = σ μ k 10 6 ,   σ = 0.1 ,   μ 0 = 1 ). This avoids numerical oscillations and controls the precision of path tracking.
Step 2: Duality Gap Check
   Convergence is declared if the absolute difference between the primal objective value f p r i m a l and the dual objective value f d u a l is less than 10−6 (namely f p r i m a l f d u a l ϵ g a p ( ϵ g a p = 10 6 ) ).
Step 3: Integer Feasibility Check
   Evaluate the deviation of the continuous relaxed solution from integrality. Round the solution to integers n j s j d i n t if the maximum deviation is less than 10−3 (namely m a x j s J S , j d J D n j s j d * r o u n d n j s j d * ϵ i n t = 10 3 ) and verify if the rounded solution satisfies the original constraints A n i n t b and n j s j d i n t 0 .
Step 4: Global Termination Conditions
   Terminate the algorithm if (a) The bounds close: f U B f L B ϵ o p t ϵ o p t = 10 4 ; the maximum iteration count is reached: k K m a x K m a x = 1000 ; or the time limit is exceeded: t T m a x T m a x = 3600 s .
Table 4. Incoming and outgoing battery counts for several stations.
Table 4. Incoming and outgoing battery counts for several stations.
Station IDLongitudeLatitudeDaily DemandInitial ReserveIncoming BatteriesOutgoing BatteriesNote
9201801796121.40131.1349648480Incoming
9201801837121.76031.1149648480Incoming
9330015974121.40131.1339548470Incoming
9201807446121.47731.2442248026Outgoing
9201801855121.53431.2632248026Outgoing
9330012493121.31931.1072148027Outgoing
Table 5. Partial scheduling scheme.
Table 5. Partial scheduling scheme.
Origin Station IDOrigin LongitudeOrigin LatitudeDestination Station IDDestination LongitudeDestination LatitudeDispatch Quantity
9201801051121.40831.2469201804694121.41431.2368
9330008636121.50631.1729201801755121.50731.1658
9201803153121.68831.1909201807403121.69331.1808
9201801666121.41631.1379201801841121.40131.1339
9330015149121.47031.3069330015802121.44231.2239
9330008423121.50031.1349201801131121.49731.1349
9201801051121.45731.1589201804694121.43031.1677
9330008636121.45731.1589201801755121.42531.1772
9201803153121.52131.0729201807403121.51031.0779
9201801666121.32631.0699201801841121.31931.0739
Table 6. Tiered location scheme for e-bike replacement power stations.
Table 6. Tiered location scheme for e-bike replacement power stations.
Demand Density RangeTypical RegionsCoverage TierStation Distribution StrategyService Optimization Measures
1907.76–55,748.89Chongming, Jinshan DistrictsBasic CoverageUniform distribution at community centersStandardized facilities, 24/7 availability
55,748.89–109,590.02Fengxian, Qingpu DistrictsModerate CoverageIncreased density along major roadsOptimized spacing, reduced wait times
109,590.02–163,431.15Pudong Outer Areas (Kangqiao, Zhoupu)Medium-High DensityNear commercial complexes/subway stationsFast-charging equipment, extended peak-hour service
163,431.15–217,272.28Xuhui, Changning (non-core)High DensityStar-marked stationsDynamic inventory allocation to prevent empty cabinets
217,272.28–271,113.41Jing’an, Huangpu (office clusters)Core CoverageDynamic density adjustment for rush hoursReal-time dispatch via navigation apps + emergency backup cabinets
271,113.41–324,954.54Lujiazui, Nanjing West RoadUltra-High DemandEmbedded micro-stations in offices/mallsCorporate partnerships for scheduled battery swaps + drone replenishment trials
324,954.54–378,795.68Hongqiao Transport HubSpecialized HubCoordinated layout with railway station/airportsLarge-capacity reserves for cross-regional dispatch
378,795.68–432,636.81Zhangjiang, Lingang New AreaEmerging RegionsPlanned per industrial park commuter demandCustomized services (e.g., nighttime swap cabinets)
432,636.81–486,477.94People’s Square, The BundExperimental ZoneRedundant high-density layout + AI optimizationReal-time monitoring, iterative algorithm updates
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zou, Z.; Yan, X.; Liu, P.; Yang, W.; Zhang, C. Sustainable Dynamic Scheduling Optimization of Shared Batteries in Urban Electric Bicycles: An Integer Programming Approach. Sustainability 2025, 17, 4379. https://doi.org/10.3390/su17104379

AMA Style

Zou Z, Yan X, Liu P, Yang W, Zhang C. Sustainable Dynamic Scheduling Optimization of Shared Batteries in Urban Electric Bicycles: An Integer Programming Approach. Sustainability. 2025; 17(10):4379. https://doi.org/10.3390/su17104379

Chicago/Turabian Style

Zou, Zongfeng, Xin Yan, Pupu Liu, Weihao Yang, and Chao Zhang. 2025. "Sustainable Dynamic Scheduling Optimization of Shared Batteries in Urban Electric Bicycles: An Integer Programming Approach" Sustainability 17, no. 10: 4379. https://doi.org/10.3390/su17104379

APA Style

Zou, Z., Yan, X., Liu, P., Yang, W., & Zhang, C. (2025). Sustainable Dynamic Scheduling Optimization of Shared Batteries in Urban Electric Bicycles: An Integer Programming Approach. Sustainability, 17(10), 4379. https://doi.org/10.3390/su17104379

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop