Compute minimum peak

1. apply pseudo code
2. create compute_map and node_mem in new method
That isn't good. You must restore max_mem_count to the value it is at the start of this call. So save its previous value and restore it.