Final answer:
To solve this problem, we can use a greedy algorithm to find the set of intervals with the largest sum of weights and no overlapping intervals. The algorithm has a time complexity of O(nlog(n)).
Step-by-step explanation:
To solve this problem, we can use a greedy algorithm. The idea is to sort the intervals in non-decreasing order of their end points. Then, we can start with an empty set S and iterate through the sorted intervals. For each interval, if it does not overlap with any interval in S, we can add it to S. This ensures that no two intervals in S will overlap. We continue this process until we have processed all intervals.
To implement this algorithm, we can use a min-heap to keep track of the intervals sorted by their end points. Initially, we can insert all the intervals into the min-heap. Then, we repeatedly extract the interval with the smallest end point from the heap, check if it overlaps with any interval in S, and add it to S if it does not. This process can be done in O(nlog(n)) time, where n is the number of intervals.