Added support for pickling graph