Exploring Edge Selection in the Bellman-Ford Algorithm

  • MHB
  • Thread starter evinda
  • Start date
In summary, the Bellman-Ford algorithm relaxes all the edges in the graph by $|V|-1$ times, looking for a vertex with the lowest value.
  • #1
evinda
Gold Member
MHB
3,836
0
Hello! (Wave)

I am reading an example about the Bellman-Ford algorithm in order to understand it, but I don't really know what edges we pick from the second step and at the following ones.

Here is the example I am looking at, where they want to detect if there is a negative cycle.

bf1.PNG


bf2.PNG


bf3.PNG


bf4.PNG


bf5.PNG


bf6.PNG

Could you explain to me the idea that we follow? (Thinking)
 
Physics news on Phys.org
  • #2
evinda said:
I am reading an example about the Bellman-Ford algorithm in order to understand it, but I don't really know what edges we pick from the second step and at the following ones.

Here is the example I am looking at, where they want to detect if there is a negative cycle.

Could you explain to me the idea that we follow?

Hi evinda!

Wiki explains:
Like Dijkstra's algorithm, Bellman–Ford proceeds by relaxation, in which approximations to the correct distance are replaced by better ones until they eventually reach the solution. In both algorithms, the approximate distance to each vertex is always an overestimate of the true distance, and is replaced by the minimum of its old value and the length of a newly found path.
However, Dijkstra's algorithm uses a priority queue to greedily select the closest vertex that has not yet been processed, and performs this relaxation process on all of its outgoing edges; by contrast, the Bellman–Ford algorithm simply relaxes ''all'' the edges, and does this$|V|-1$ times, where $|V|$ is the number of vertices in the graph.

but I don't really know what edges we pick from the second step and at the following ones.

We pick all edges and see if we can make reduce the value of the target node of each edge. 🤔
 
  • #3
Klaas van Aarsen said:
Hi evinda!

Wiki explains:
Like Dijkstra's algorithm, Bellman–Ford proceeds by relaxation, in which approximations to the correct distance are replaced by better ones until they eventually reach the solution. In both algorithms, the approximate distance to each vertex is always an overestimate of the true distance, and is replaced by the minimum of its old value and the length of a newly found path.
However, Dijkstra's algorithm uses a priority queue to greedily select the closest vertex that has not yet been processed, and performs this relaxation process on all of its outgoing edges; by contrast, the Bellman–Ford algorithm simply relaxes ''all'' the edges, and does this$|V|-1$ times, where $|V|$ is the number of vertices in the graph.
We pick all edges and see if we can make reduce the value of the target node of each edge. 🤔

I see... Thank you! (Mmm)
 

1. How do we determine the best edge for a specific experiment?

Choosing the best edge for an experiment involves considering various factors such as the research question, available resources, and potential outcomes. Scientists typically use their expertise and knowledge of the field to make an informed decision on the most suitable edge for their experiment.

2. What role does data play in choosing the edges?

Data plays a crucial role in choosing the edges for an experiment. Scientists analyze and interpret data to identify patterns and trends, which can help determine the most effective edge to use. Data also allows for comparisons between different edges and their outcomes.

3. How do we ensure the chosen edge is ethical?

Ethics is an essential aspect of scientific research. When choosing edges, scientists must consider the potential impact on human subjects, animals, and the environment. They must also follow ethical guidelines and regulations set by their institution or governing bodies.

4. Can we change the chosen edge during the course of an experiment?

In some cases, it may be necessary to change the chosen edge during an experiment. This could be due to unforeseen circumstances or new information that arises. However, any changes must be carefully considered and documented to maintain the integrity and validity of the experiment.

5. How do we communicate the chosen edge and its rationale to others?

Communication is crucial in scientific research. Scientists must clearly and accurately communicate the chosen edge and its rationale to other researchers, colleagues, and the general public. This allows for transparency and reproducibility of the experiment and its results.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
22
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
3K
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
466
  • General Math
Replies
5
Views
829
Back
Top