Question about calculate_min_energy_path

Hello everyone :slight_smile:

I’m currently implementing the calculate_min_energy_path function, as mentioned in Task 3.2.
I’ve got confused by the corresponding documentation comment, which states:

Calculate the index of the column with the least energy in bottom row

Does this mean, that the function calculate_min_energy_path is exclusively looking at the very last row of my energy matrix? So, I would have to implement some loop logic, to loop through all rows, calling this function over and over again, until I’ve reached the upper boundary of the matrix?

Or what else does “bottom row” mean?

Thanks in advance,
David

Hi,

Blockquote
Does this mean, that the function calculate_min_energy is exclusively looking at the very last row of my energy matrix?

Yes! Only the last row.

You’re not supposed to call this function for every row! Have a look at the PDF of the project on how to find the path through the image using calculate_min_energy only once!

Greetings
Henry

2 Likes