Calculate all edges at once.