Added a map to store all in/out degrees for every node for faster compututations.