Abstract
Dijkstra's algorithm is one of the most popular classic path planning algorithms, achieving optimal solutions across a wide range of challenging tasks. However, it only calculates the shortest distance from one vertex to another, which is hard to directly apply to the Dynamic Multi-Sources to Single-Destination (DMS-SD) problem. This paper proposes a modified Dijkstra algorithm to address the DMS-SD problem, where the destination can be dynamically changed. Our method deploys the concept of Adjacent Matrix from Floyd's algorithm and achieves the goal with mathematical calculations. We formally show that all-pairs shortest distance information in Floyd's algorithm is not required in our algorithm. Extensive experiments verify the scalability and optimality of the proposed method.
Introduction
In the era of Smart Cities and Industry 5.0, navigation systems are evolving beyond simple point-to-point routing. Modern urban coordination often requires multiple agents—such as a group of friends, business colleagues, or autonomous service vehicles—to converge at a single location. When the destination is fixed, standard algorithms suffice. However, in dynamic environments where the optimal meeting point depends on the real-time locations of all participants, a more sophisticated approach is required. This is the Dynamic Multi-Sources to Single-Destination (DMS-SD) problem.
The DMS-SD problem presents two primary challenges: efficiency (minimizing total travel distance) and fairness (minimizing the variance in travel time among participants). While Dijkstra’s algorithm is efficient for single-source paths, it lacks the multi-source perspective. Conversely, Floyd’s algorithm provides all-pairs shortest paths but suffers from a computational complexity of $O(V^3)$, making it impractical for large-scale urban maps. This paper introduces a Modified Dijkstra (MD) algorithm that leverages adjacent matrix concepts to solve the DMS-SD problem with linear scalability.
Methodology
The proposed MD algorithm bridges the gap between the speed of Dijkstra and the comprehensive utility of Floyd’s algorithm by utilizing a partial Adjacent Matrix approach.
Adjacent Matrix Integration
Rather than calculating every possible path between all nodes in a city, the MD algorithm focuses exclusively on the paths from active "sources" (the users) to every other potential node in the map. These results are stored in a partial matrix, significantly reducing the computational overhead compared to a full all-pairs shortest path calculation.
Optimization Function
To determine the optimal destination node, the algorithm employs a weighted multi-objective formula:
$$D = \alpha D_{total} + \beta D_{sim}$$
- $D_{total}$: The sum of distances from all users to a specific candidate node.
- $D_{sim}$: A similarity metric that calculates the difference between users' travel distances to ensure fairness and minimize waiting times.
By adjusting the weights $\alpha$ and $\beta$, the system can prioritize either the shortest overall travel distance or the most equitable distribution of travel time. Because the algorithm is computationally efficient, it can be re-run frequently to account for user movement or environmental changes, allowing the "optimal" destination to shift dynamically.
Experimental Setup
The researchers evaluated the MD algorithm using a custom navigation environment built on OpenAI Gym. This environment allowed for the rendering of complex maps and the simulation of real-time user movement. Testing was conducted on three distinct grid map sizes to assess scalability:
- 22x10 vertices
- 88x27 vertices
- 109x128 vertices
These maps included obstacles and varying path accessibility to simulate the constraints of an urban layout. The simulation code has been open-sourced to ensure reproducibility.
Key Insights and Results
Computational Efficiency and Scalability
The most significant finding is that full knowledge of all-pairs shortest paths is unnecessary for solving the meeting point problem. By only calculating the rows of the matrix corresponding to active users, the MD algorithm achieves linear scalability. As the number of users increases, the computation time grows linearly rather than exponentially. On the largest map (109x128), the algorithm identified optimal solutions for seven users in approximately 60 seconds—a task that would take hours using Floyd’s algorithm.
Optimality and Fairness
The MD algorithm is exhaustive, meaning it is mathematically guaranteed to find the best meeting point based on the defined weights. The inclusion of the $\beta$ weight successfully prevents the "first to arrive waits forever" scenario by shifting the destination to a location that balances travel times for all participants.
Path Stability
The researchers noted a "Moving Target" phenomenon in larger maps. As users move, the optimal destination may shift, occasionally resulting in "wasted" movements. This highlights a critical trade-off between absolute mathematical optimality and the stability of the path for the end-user.
Limitations and Future Work
While the MD algorithm provides a robust framework for DMS-SD, several areas for improvement remain:
- The Isolated User Problem: Currently, a single user located far from a cluster can disproportionately pull the meeting point toward them. Future work will explore thresholds that allow isolated users to travel further to accommodate the majority.
- Multi-Agent Collision Avoidance: The current model focuses on path planning and destination selection but does not yet incorporate logic to prevent agents from colliding in restricted spaces.
- Real-World Variables: The simulation currently uses distance as a proxy for time. Future iterations will integrate real-time traffic data, public transit schedules, and weather conditions into the Adjacent Matrix values to better reflect smart city dynamics.
Summary updated