Seeking algorithm to invert (reverse? mirror? turn inside-out) a DAG

后端 未结 5 1435
我寻月下人不归
我寻月下人不归 2021-02-01 09:54

I\'m looking for an algorithm to \"invert\" (reverse? turn inside-out?) a DAG:

       A*      # I can\'t ascii-art the arrows, so just
      / \\      # pretend          


        
5条回答
  •  孤独总比滥情好
    2021-02-01 10:52

    Depth-first search might be able to generate what you're after: Note your path through the tree and each time you traverse add the reverse to the resulting DAG (leaves are roots).

提交回复
热议问题