add Graph class for optimization