Enumerating trichromatic triangles containing the origin in linear time

  • Authors:
  • Amr Elmasry

  • Affiliations:
  • Department of Computer Engineering and Systems, Alexandria University, Egypt

  • Venue:
  • Journal of Discrete Algorithms
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Consider a set P of n points in the plane, where each point is associated with one of three colours. We give an output-sensitive algorithm that enumerates a set of triangles T, where each triangle in T contains the origin and its three vertices are points in P with distinct colours. Our algorithm requires O(n+|T|) time, and hence it is asymptotically optimal in terms of n and |T|.