title: Re-order a ranked-list based on new partial rank
body: <p>I have a question about ranking algorithm that might hasn't exist so far:</p>
  
  <p>I have a list ordered by a score, for example a following list (denotes list-a):</p>
  
  <p><img src="https://i.stack.imgur.com/WBlEp.png" alt="enter image description here"></p>
  
  <p>Now I have new information to know that the list should be ranked as follow (denotes list-b):</p>
  
  <p><img src="https://i.stack.imgur.com/0w0mh.png" alt="enter image description here"></p>
  
  <p>The question in here is: <strong>How to construct a new ranking for the list-a follow restriction in list-b?</strong></p>
  
  <p>We can say that the new list must:</p>
  
  <ol>
  <li>It must follow the rank in the list-b</li>
  <li>Try to have less conflict with the rank in the list-a. (e.g about conflict: list-a says a>b, but now we say b>a => conflict).</li>
  </ol>
  
  <p>The problem in here is the list-b doesn't have information about c, e, g (marked by red color in list-a). Now we need to construct a new ranking for list-a follow restriction in list-b.</p>
  
  <p><strong>My current solution:</strong></p>
  
  <p>Sure that we can solve it by using a brute force strategy as follow: add to the list-b the missing items c, e, g one by one and find the best place for it by:</p>
  
  <ul>
  <li>Select one place for it in list-b (e.g: a > c > d > b > f)</li>
  <li>Next check number of conflict with list-a, then select a position that have less conflict. </li>
  </ul>
  
  <p>For example with c, we can do as follow:</p>
  
  <p><img src="https://i.stack.imgur.com/dbeZ3.png" alt="enter image description here"></p>
  
  <p>When we have equal number of conflict for different position, then we select the first position (i guess). Just follow this way, we can add up to the final item.</p>
  
  <p>This is my "bad way" to do it, so do you have any better idea for this problem? Because my list is really long (about 1 million items), if follow this way, it must be too expensive for computation. </p>
  
  <p>Looking forward to hearing your suggestion.</p>