| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Interval overlap problem
Hello,
I am interested in an algorithmic problem, but don't really have a good intuition about its complexity. So, the problem is as follows: Given a range of real numbers and given a set of (potentially overlapping and non-connected) sub-regions (= multiple intervals) on this range, what is the minimum set for which its union covers at least a certain amount of the complete range? As an example, let's assume a number range from 0 to 1 (i.e. [0,1]), and a set of sub-regions with 100 elements could look like this: 1) [0.1,0.2] [0.3,0.35] [0.7,0.9] 2) [0.2,0.4] 3) [0.0,0.05] [0.6,0.85] 4) [0.65,0.8] [0.85,0.95] 5) [0.7,1] . . 100) [0.2,0.4] Each element covers a certain part of the number range, but this part need not be connected. Now I want to find the minimum subset of elements that cover at least 90% of the original range (assuming this is possible). Elements in this subset may overlap and the final result need not be connected. I am not sure which complexity class this kind of problem belongs to and if efficient solutions exist. Can someone help and give me some pointers? Thanks, Michael |
|
#2
|
||||
|
||||
|
Re: Interval overlap problem
This problem is NP-Hard, as there exists a polynomial time reduction from the Set Cover Problem to this problem.
I would try an approximation algorithms approach. Regards, Zachm |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|