update treeNode and graph