Learning to Perform Local Rewriting for Combinatorial Optimization