Basic graph implementation.