Optimize the graph by removing edges to non-matching cells. Make all of