How do i make sure i get the correct Bellman Ford path? I was studying shortest path algorithms and was met with an issue regarding Bellman Ford for the image below.

Following the graph, i see that node 3 has a length of 1 while node 2 has a length of 2. When computing the path from 1 to 8 which is the correct path between 1-&gt;2-&gt;6-&gt;4-&gt;7-&gt;8 and 1-&gt;3-&gt;2-&gt;6-&gt;4-&gt;7-&gt;8 ?
I can see that 1-&gt;2-&gt;6-&gt;4-&gt;7-&gt;8 has the smallest path length but i'm confused because node 2 has length 2 while node 3 has length 1.
Will Bellman always give the shortest possible path or might it output a longer path because one of the nodes had shorter length but led to a longer path?
From Wikipedia:

The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph.

What is a shortest path? According to Wikipedia:

In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized.

Wikipedia isn't always a reliable source, but in this case the definitions are spot on. Suppose that $G=(V,E,w)$ is a weighted undirected graph. A path between two vertices $x,y \in V$ is a list
$$ v_0 = x, v_1, \ldots, v_\ell = y $$
such that $(v_i,v_{i+1}) \in E$ for all $i &lt; \ell$ (possibly $\ell = 0$). The weight of the path is
$$ \sum_{i=0}^{\ell-1} w(v_i,v_{i+1}). $$
A shortest path between $x$ and $y$ is a path with minimum weight.
The Bellman–Ford algorithm finds the lengths of all shortest paths from a given vertex $x$ to all other vertices. It also generates auxiliary information which makes it possible to find the corresponding shortest paths.