Programming, Data Structures, Algorithms, Computer Science, Tech.
will “cost us” 5. However, if we take the route from node a to node c to node b, then it will cost us only 3. But why 3? Well, even though it may intuitively seem like a longer path, if we sum up the edges of going from node a to c and then from node c to b, we’ll see that the total cost ends up as