Graph Implementation and Test code