title: Finding subset of disjunctive intervals with maximal weights
body: <p>I am looking for an algorithm I could use to solve this, not the code. I wondered about using linear programming with relaxation, but maybe there are more efficient ways for solving this?</p>
  
  <p><strong>The problem</strong></p>
  
  <p>I have set of intervals with weights. Intervals can overlap. I need to find maximal sum of weights of disjunctive intervals subset. </p>
  
  <p><strong>Example</strong></p>
  
  <p><em>Intervals with weights :</em></p>
  
  <pre>|--3--|          |---1-----|
      |----2--| |----5----|</pre>
  
  <p><em>Answer: 8</em></p>