use sweep-line algorithm to speed up label conflict detection