Fred - Graph with hopCount() with no dupicate code