some code to reduce graph nodes in the point graph