Update graph.h

Modified graph.h to work with A* algorithm