add graph.h from garret's assignment to use as base
for binary search later