overlap graph building and checking