Better memoization
Changed to breadth first search for Watts-Newmann