Support for Maximum Load Path Algorithm (Modified Dijkstra's Algorithm) #7815
Replies: 2 comments 4 replies
-
Are there significant differences in practice? Note that dijkstra gives the path as a sequence of nodes, so reconstructing the weight along the path is straightforward (even if a callable was used for |
Beta Was this translation helpful? Give feedback.
-
|
We can support this within the current Dijkstra's implementation. The trick is to define a new class "Bottleneck" and override add, radd, iadd methods in a way such that:
You would also need to define compassion methods so you prioritize the biggest bottleneck first. Basically: Bottleneck(c).cmp(Bottleneck(d)) = (-c).cmp(-d). Then you can call Dijkstra or any shortest path algo and pass a custom "weight" function that does: weight(u, v) = Bottleneck(G[u][v]["weight"]) And that should do it. Will add in to the Shortest path docs in the next weeks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi NetworkX team,
I am wondering if NetworkX currently provides a built-in function for computing the maximum load path, also known as the bottleneck path. This is a modification of Dijkstra's algorithm where the objective is to find a path between a source node
sand a destination nodetsuch that the minimum bandwidth of any edge along the path is maximized.A common workaround in NetworkX would be using
nx.dijkstra_path(G, src_node, dst_node, weight="inv")where"inv"is the inverse weight, but this is not directly equivalent to maximizing the minimum edge weight along the path.This problem is well-studied in graph theory and is particularly useful in network routing, logistics, and road freight optimization. A reference for this approach is:
Would it be possible to include an implementation of this algorithm in NetworkX? Or is there already a function that supports this feature?
I would like to contribute if possible.
Thank you for your time and your fantastic work on NetworkX! 🚀
Best,
@TakumiSenaha
Beta Was this translation helpful? Give feedback.
All reactions