Related Articles
Probabilistic shortest path routing algorithm for optical networks
• Last Updated : 10 May, 2018

Data transfer operations is a crucial aspect in case of networking and routing. So efficient data transfer operations is a must need, with minimum hardware cost (Optical Cables, WDM Network components, Decoders, Multiplexers) and also in the minimum time possible. Thus, the need is to propose an algorithm that finds the shortest path between two nodes (source node and destination node).

Let’s see a completely new algorithm unlike Dijkstra’s Shortest Path or any other algorithm for finding Shortest Path.

Given a graph and two nodes (source node and destination node), find the shortest path between them.

Let’s Calculate the distance ratio for each link :

Distance of link AB [denoted by d(AB)] = 10
Distance of link AC [denoted by d(AC)] = 12

For link AB, Distance Ratio of AB = d(AB) / (d(AB) + d(AC))
For link AC, Distance Ratio of AC = d(AC) / (d(AB) + d(AC))

Algorithm :

Given a graph and two nodes -

1. Find all the paths connecting the two nodes.
2. For each path calculate probability = (Distance Ratio).
3. After looping over all such paths, find the path for
which the probability turns out to be minimum.

Examples :

Input :

Output : Shortest Path is [A -> B]

Explanation :
All possible paths are
P1 = [A->B]
P2 = [A->C->B]
P3 = [A->D->B]

total distance D = d(P1) + d(P2) + d(P3)
= (3) + (2 + 5) + (4 + 3)
= 17

distance ratio for P1 = d(P1) / D = 3/17
distance ratio for P2 = d(P2) / D = 7/17
distance ratio for P3 = d(P3) / D = 7/17

So the shortest path is  P1 = [A->B]

Input : Output : Shortest Path is [A -> B]

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

Let’s illustrate the algorithm with a 7-node network and find out the Probabilistic shortest path between node 1 and node 5.

Below is the implementation :