Passing graph object to SearchGraph, instead of a data structure.

This can affect execution time since there's more operations taking
place, but makes for better code usability/maintainability, where say
the data structure used for the graph could get changed in the future,
in which case one won't have to make specific changes in other classes
to avoid errors.