condense graph when needed