Compute minimum peak

1. apply pseudo code
2. create compute_map and node_mem in new method
This isn't the right check. You should do like in the loop over val. 

if (dmap and idx in dmap) or (vmap and ...):

Use idx correctly.

Also, keep my comments in the pseudo-code I did. Do for all my comments in the pseudo-code, I won't repeat that at each place.