improve graph structure