Compute minimum peak

1. apply pseudo code
2. create compute_map and node_mem in new method
I think is should be faster then the other version. Use it in the code.
Also, enumerate is slow... Just use a loop conter that you manually increment. It will be faster. This is uglier code. So do this only when the speed is important in that section of code.