Fix the node's order issue when the content of graph is changed (#16088)
Fix the node's order issue when the content of graph is changed (#16088)

* Fix the node's sort issue when the graph is changed.

test=develop

* Clean code

test=develop

PaddlePaddle/Paddle,luotao1/Paddle,luotao1/Paddle,luotao1/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,tensor-tang/Paddle,luotao1/Paddle,luotao1/Paddle,tensor-tang/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,baidu/Paddle,chengduoZH/Paddle,chengduoZH/Paddle,tensor-tang/Paddle,chengduoZH/Paddle,PaddlePaddle/Paddle,baidu/Paddle,PaddlePaddle/Paddle,baidu/Paddle,baidu/Paddle,PaddlePaddle/Paddle,tensor-tang/Paddle,tensor-tang/Paddle,chengduoZH/Paddle,chengduoZH/Paddle,baidu/Paddle