sharing and rebuilding of graphs