reuse rug elements when updating graphs, and remove unused rug elements.
Fix merge conflicts