Compute minimum peak

1. apply pseudo code
2. create compute_map and node_mem in new method
What you can do is remove those two lines.  I'll comment on the place where compute_map is used to show you what I mean by defaultdict().