add graph pre-processing