Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we call it "Relaxing" an edge?

Tags:

In Dijkstra's shortest path algorithm and others, to examine an edge to see if it offers a better path to a node is referred to as relaxing the edge. Why is it called relaxing?

like image 838
Eric G Avatar asked May 24 '12 23:05

Eric G


People also ask

Why is it called edge relaxation?

In general mathematically, relaxation is making a change that reduces constraints. When the Dijkstra algorithm examines an edge, it removes an edge from the pool, thereby reducing the number of constraints. It's not horribly useful terminology, but think how cool you'll sound saying it.

What is relaxation in graphs?

The single - source shortest paths are based on a technique known as relaxation, a method that repeatedly decreases an upper bound on the actual shortest path weight of each vertex until the upper bound equivalent the shortest - path weight.

What is edge relaxation in Bellman-Ford algorithm?

Relaxation is the most important step in Bellman-Ford. It is what increases the accuracy of the distance to any given vertex. Relaxation works by continuously shortening the calculated distance between vertices comparing that distance with other known distances.

What do you mean by relaxation in algorithm?

Dijkstra's and Bellmann Ford's algorithm use a technique called edge relaxation. This means that during traversing our graph and finding our shortest path, we update the paths we have for already known nodes as soon as we find a shorter path to reach it.


2 Answers

In general mathematically, relaxation is making a change that reduces constraints. When the Dijkstra algorithm examines an edge, it removes an edge from the pool, thereby reducing the number of constraints.

It's not horribly useful terminology, but think how cool you'll sound saying it.

like image 101
Charlie Martin Avatar answered Oct 20 '22 20:10

Charlie Martin


I do not think the question is related to the mathematical concept talked about in the current accepted answer. I am basing my answer on the second edition of Cormen's (CLRS) book, specifically on chapter 24 in a section about relaxation.

Context: You are searching for the shortest path between a node s and all the other nodes. Imagine you have two nodes u and v. You already have an intermediate path for them.

relax(u,v) is a function that should be read as "relax v using u". I prefer to understand the function as "shorten v's distance to s using u". You are asking yourself if you should give up on your current path s-v in favor of transforming it into s-u-v. All you have to do to see if the distance of s-u plus the additional cost of the arrow u-v are better than the distance s-v. The picture examplifies the function

A picture from CLRS's explanation on Relaxation

like image 29
Eric Grinstein Avatar answered Oct 20 '22 20:10

Eric Grinstein