Added method to save graphs to disk.