Computing topological sort while keeping edges "short"
Your problem is known under the name MINIMUM DIRECTED BANDWIDTH.
It is NP-complete:  


  M.R. Garey, R.L. Graham, D.S. Johnson and D.E. Knuth:
  "Complexity Results for Bandwidth Minimization"
  SIAM Journal on Applied Mathematics 34, (1978), pp. 477-495 


It is problem [GT41] in the NP-completeness book by Garey and Johnson.

The special case where every vertex in $G=(V,E)$ has indegree $\Theta(|V|)$ has a polynomial time approximation algorithm with worst case guarentee 2:
https://www.nada.kth.se/~viggo/wwwcompendium/node54.html