Maximize the number of pairs of overlapping intervals

Revision en1, by Phantom_Dreams, 2024-03-28 06:25:48

Given $$$N$$$ integer intervals $$$[a, b]$$$, find the maximum number of pairs of overlapping intervals where each interval can belong to at most one pair.

Two intervals overlap if they share a common point, including closed endpoints.

The answer to the example above is 2. Pair the 2 black intervals and the 2 red intervals together.

What is the best time complexity that can be achieved for this problem? Currently I'm not sure if it's even solvable in polynomial time.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Phantom_Dreams 2024-03-28 06:25:48 600 Initial revision (published)