Completed new Graph class, optimized for big n