Implementation of a Graph and search methods