adjust link order based on lorder | tsort