title: Linear time algorithm to make a graph strongly connected
body: <p>We have a weakly acyclic digraph.</p>
  
  <p>Also we are given a set A which holds vertices of G that have in-degree zero and a set B which holds vertices that have out-degree zero. (size of A is smaller then size of B).</p>
  
  <p>On top of that, we also know that if items in A and B have a particular order (e.g. A = a1, a2, ..., am and B = b1, b2, ... , bn) a DFS started at ai visits bi (1≤ i ≤ m).</p>
  
  <p>Is it possible to design a linear time algorithm which makes G strongly connected by adding to it as few edges as possible?</p>