Added docstring.
Cleaner separation between interface and graph implementation.