What does relaxation of an edge
mean in the context of graph theory ? I came across this while studying up on Dijkstra's algorithm for single source shortest path.
相关问题
- Finding k smallest elements in a min heap - worst-
- binary search tree path list
- High cost encryption but less cost decryption
- How to get a fixed number of evenly spaced points
- Space complexity of validation of a binary search
相关文章
- What are the problems associated to Best First Sea
- Coin change DP solution to keep track of coins
- Algorithm for partially filling a polygonal mesh
- Robust polygon normal calculation
- Algorithm for maximizing coverage of rectangular a
- How to measure complexity of a string?
- Select unique/deduplication in SSE/AVX
- How to smooth the blocks of a 3D voxel world?
The relaxation process in Dijkstra's algorithm refers to updating the cost of all vertices connected to a vertex v, if those costs would be improved by including the path via v.
Relaxing an edge, (a concept you can find in other shortest-path algorithms as well) is trying to lower the cost of getting to a vertex by using another vertex.
You are calculating the distances from a beginning vertex, say S, to all the other vertices. At some point, you have intermediate results -- current estimates. The relaxation is the process where you check, for some vertices u and v:
where
est(S,a)
is the current estimate of the distance, anddist(a,b)
is the distance between two vertices that are neighbors in the graph.What you are basically checking in the relaxation process is weather your current estimate from a to b could be improved by "diverting" the path through c (this "diversion" would be the length of a path from a to c and from c to b).
lets suppose in graph if we have (u,v)∈ E where w(u,v)=10 then if by adding a third vertex in between them like w(u,y)=1 and w(y,v)=3 now we find a path between u and v with weight 1+3=4<10. Now we will consider the second path as shortest which is (u,y,v) and will ignore the first one, this is relaxation.
Here's a nice description of the Algorithm that also explains the notion of relaxation.