Build a mapping from coordinates to cells and use it to resolve border conflicts between adjacent cells.