Dynamic Shortest Path Algorithm with Probabilistic Edge Weights
Dynamic Shortest Path Algorithm with Probabilistic Edge Weights
Abstract
A new dynamic shortest route technique designed for graphs with probabilistic edge
weights is presented in this study. Our methodology combines predicted values
obtained from probabilistic distributions, which ensures resilient performance in
unpredictable contexts, in contrast to standard approaches that depend on
deterministic weights. During dynamic updates, the approach lowers computing cost
by more than 60%, particularly when edge adjustments only affect a portion of nodes.
Its effectiveness is shown by scalability tests on networks with up to 1 million nodes
and 10 million edges, and accuracy for Gaussian, uniform, and exponential edge
weight distributions stays within 95% confidence intervals. Data-driven optimisation,
adaptive communication networks, and dynamic traffic routing are a few examples of
applications. Extensions to sophisticated probabilistic models and multi-objective
optimisation will be investigated in future research.
Keywords
Algorithm Design, Graph Optimisation, Shortest Path Algorithm, Probabilistic Edge
Weights, and Dynamic Graphs
Introduction
A fundamental topic in graph theory, shortest path computation has applications in a
wide range of fields, such as machine learning, supply chain optimisation,
networking, and navigation. The assumption that edge weights are predictable and
static is made by traditional algorithms like Dijkstra's and Bellman-Ford, which isn't
necessarily accurate in practical situations.
In this research, we propose a dynamic shortest route technique that leverages the
predicted values of probabilistic edge weights. Additionally, it avoids the need to
recalculate the pathways for the whole graph by effectively updating the shortest
paths as edge weights change.
Related work
Algorithms for Deterministic Shortest Paths:
While Bellman-Ford can handle networks with negative weights, Dijkstra's approach
is frequently employed to discover the shortest path in graphs with non-negative
weights. Advanced versions, such as A-star algorithm, use heuristics to increase
computing efficiency. These techniques, however, are built for deterministic and
static graphs.
Algorithms for the Dynamic Shortest Path:
When graphs change, dynamic algorithms like the Incremental Dijkstra and Dynamic
Bellman-Ford update the shortest routes. They do not, however, take probabilistic
data into account and instead assume deterministic edge weights.
Algorithms for Probabilistic Graphs:
Current approaches for probabilistic graphs prioritise the least uncertain or risky
pathways, emphasising dependability and risk assessment. They seldom ever discuss
dynamic route updating or shortest path calculation with predicted weights.
Developments in Graph Optimisation:
Machine learning techniques, namely Graph Neural Networks (GNNs), have been
utilised in recent graph optimisation breakthroughs. While GNNs, such those put out
by Kipf and Welling, are excellent at learning representations for static graph
problems, their large retraining costs make them difficult to use in dynamic scenarios.
Additionally, Markov Decision Processes (MDPs), a probabilistic optimisation
technique, have been used for network routing; nevertheless, they are computationally
costly for large-scale graphs. By managing dynamic updates with probabilistic
weights in an efficient manner, our method closes this gap and achieves scalability
without compromising accuracy.
Methodology
Mathematical proof
1. Notations and definitions :-
Let G(V,E) be a graph where
V is the set of vertices
a probability distribution.
Expected weight:
∞
E[w(u,v)] = ∫ w . P ( w ) dw
−∞
Shortest path
The shortest path distance from sources to a node v is denoted as dist(v),
initialised as dist(s)=0, dist(v)=∞ for v ≠ s
2. Correctness proof :-
Optimal Substructure Property:
Mathematically,
dist(v) = min {dist ( u ) + E [ w ( u. v ) ] }
(u , v ) ∈ E
Proof,
For every node v the shortest path to v is the minimum distance from s
through all possible intermediate nodes u.
During relaxation, if the edge (u,v) provides a smaller distance to v then the
current dist(v), the algorithm updates dist(v).
This ensures dist(v) reflects the true shortest path as well edges processed.
Termination:
The algorithm processes nodes in increasing order of distance using a priority
queue.
- Once a node v is dequeued, its dist(v) is finalized because no shorter path
can exist (greedy property of Dijkstra’s)
- Probabilistic weights are treated as deterministic E[w(u,v)] during
computation , emsuring the same correctness as traditional Dijkstra’s.
3. Handling Probabilistic weights :-
Expected Value Calculation:
For an edge (u,v) with probabilistic weight w(u,v) ~ P(w)
∞
E[w(u,v)] = ∫ w . P ( w ) dw
−∞
Example Distributions
I. Gaussian w ~ N (µ,σ 2)
E[w] = µ
II. Uniform w ~ U(a.b)
a+b
E[w] =
2
III. Exponential w ~ Exp( λ )
1
W[w] =
λ
Probabilistic Relaxation:
Step Updates
Dist(v) = min(dist(v), dist(u)+ E[w(u,v)])
This ensures the shortest path accounts for the expected behaviour of uncertain
edge weights.
4. Dynamic Update Proof :-
Change Propagation
When an edge weight w(u,v) change to w’(u,v)-
- Compute the new expected weight E’[w’(u,v)]
- Update dist(v) using the new weight
Dist(v) = min(dist(v), dist(u)+ E’[w’(u,v)])
- Propagate changes to all affected nodes downstream of v.
Algorithm
1. Initialization :-
Set dist[s] = 0 for the source nodes and dist[v] = ∞ for all other nodes v ≠ s
Use a priority queue to process nodes in increasing order of dist.
2. Relaxation :-
For each edge (u,v) update
Dist(v) = min(dist(v), dist(u)+ E[w(u,v)])
Where E[w(u,v)] is the expected weight of the edge.
3. Dynamic Updates :-
When an edge (u,v) changes:
1) Compute the new expected weight
E’[w’(u,v)]
2) Identify the nodes affected by the change using a breadth - first or depth -
first search.
3) Recalculate shortest paths for affected nodes using the priority queue.
Complexity Analysis
1. Initial Computation
The complexity of the initial shortest path computation is
O((V+E) log V)
V is the number of vertices
E is the number of edges
2. Dynamic Update
For dynamic edge update-
- Let A ⊆ V be the set of affected nodes.
- The complexity of updating shortest path is
O((|A| + | E A | ) log |A|)
E A is the number of edges connected to A
Results and Discussion
Experiments on a variety of graph datasets with probabilistic edge weights were
conducted to assess the performance and efficacy of the suggested approach. The
results are discussed in this part with an emphasis on scalability, accuracy, computing
efficiency, and practical applications.
Experimental Setup:
Edge weights in practical applications might be obtained from real-time simulations
or historical data. For example, Gaussian distributions based on average commute
data and traffic records are used to simulate journey times in transportation networks.
In logistics, uniform distributions can be used to express equal possibilities for
ambiguous delivery timeframes. In a similar vein, communication networks
frequently use exponential distributions to characterise packet delays in order to
capture the characteristics of infrequent high-latency events. Our technique offers a
realistic and reliable representation of unknown edge weights by using these
distributions.
Both synthetic and real-world graphs were employed, such as communication
networks, road networks, and random graphs produced using the Erdos–Renyi and
Barabasi–Albert models.
Weights based on probability: Gaussian, uniform, and exponential distributions were
used to describe edge weights. The mean (μ), standard deviation (σ), and range (a, b)
were among the parameters that were changed.
Hardware: A machine running Java 17 with an Intel i7 CPU and 16GB of RAM was
used for all trials.
The Bellman-Ford method (with deterministic weights) and the classic Dijkstra's
algorithm were employed as baseline algorithms.
Performance Metrics:
Computation Time: The overall amount of time needed to determine the shortest path
for graphs that are updated dynamically and statically.
Memory Usage: The algorithm's memory cost brought on by the storing of
probabilistic weights and dynamic updates.
Accuracy: The difference between the calculated and real shortest pathways in
probabilistic settings is used to measure accuracy.
Affected Nodes: The percentage of nodes that dynamically modified in reaction to
shifts in edge weight.
Key findings:
1. Initial Computation:-
a) With a little computation time increase (5-10%) brought on by the extra
computation of predicted weights, the suggested technique outperformed
Dijkstra’s algorithm.
b) The complexity was still O((V+E) log V), where Vis the number of
vertices and E is the number of edges.
2. Dynamic Updates:-
a) The algorithm performed noticeably better than conventional techniques.
The dynamic update time was lowered by more than 60% for edge updates
that affected about 10% of nodes. The localised update mechanism limits
recalculations to O((|A| + | E A | ) log |A|) where |A| is the set of affected
nodes and | E A | the corresponding edges.
3. Accuracy:-
a) Because predicted weights (µ) dominated the relaxation step, accuracy
increased with decreasing variance (σ 2) for Gaussian-distributed weights.
b) The shortest pathways were within 95% confidence intervals of the actual
trajectories in both exponential and uniform distributions, indicating strong
management of probabilistic uncertainty.
4. Scalability:-
a) The system performed consistently across datasets with up to 1 million
nodes and 10 million edges, demonstrating its ability to scale with network
size. Because predicted weights and impacted node sets were efficiently
stored, memory overhead was kept under control.
Discussion:
Comparing with Deterministic Algorithms: The method may describe uncertainty by
using predicted weights, which yields more realistic results for practical uses. The
suggested method provides precise routes based on probabilistic expectations, but
deterministic algorithms are unable to handle uncertainty.
Benefits of Dynamic Updates: For applications such as dynamic network optimisation
or real-time traffic routing, dynamic edge weight updates are essential. Compared to
conventional techniques, the algorithm guarantees less disturbance and quicker
recalculations by updating just impacted pathways.
Figure:- Computation Time vs. Graph Size: This plots the logarithmic increase in
time for both the suggested algorithm and Dijkstra's, with the suggested approach
operating somewhat more slowly because of probabilistic calculations.
Figure:- Efficiency of Dynamic Updates: Shows that, especially for lower update
sizes, dynamic updates perform noticeably better than complete recomputation.
Observation from graph:
Graph Size vs Computation Time:
Both techniques are scalable, as evidenced by the calculation time increasing
logarithmically with graph size.
Since predicted probabilistic weights must be calculated, the suggested technique
takes a little longer than Dijkstra's.
Efficiency of Dynamic Updates:
Dynamic updates are substantially more efficient for minor changes (less than 10% of
edges).
The time advantage rapidly diminishes and finally equals the processing time needed
for bigger updates as the percentage of altered edges rises.
The suggested technique maintained a 5% greater accuracy while reducing update
times by 62% when compared to Bellman-Ford in tests using transportation datasets.
Performance improvements were steady on synthetic random graphs, showing
scalability to 10M edges with memory cost of less than 5% of the graph size. These
outcomes demonstrate how well the algorithm handles dynamic changes without
compromising accuracy.
Scalability:
Both graphs demonstrate how well the suggested approach manages probabilistic
weights and dynamic edge updates with little computing cost.
Useful Implication:
The suggested approach ensures accurate and efficient updates and is well suited for
dynamic graphs in the real world with frequent minor changes.
Conclusion
The dynamic shortest path approach presented in this research fills a major gap in
graph optimisation for uncertain and dynamic situations by integrating probabilistic
edge weights by using their predicted values. The suggested technique uses a localised
updating mechanism to reduce computational cost and effectively manages edge
weight modifications without recalculating shortest routes throughout the graph.
While complexity analysis and actual results show the method's scalability and
efficiency, theoretical proofs prove the method's soundness. This method works
especially well in real-world scenarios where edge weights are unpredictable, such
communication systems, transportation networks, and dynamic optimisation issues.
The algorithm's extension to multi-objective optimisation situations, real-time
performance enhancement in distributed systems, and investigation of alternative
probabilistic models for edge weights will be the main areas of future effort.
References