A simple graph implementation