add Graph class for path solving