1. 04 Jan, 2010 1 commit
    • Nicolas Dumazet's avatar
      algorithm: a topological sort in a graph can be much simpler · 6dd1ab34
      Nicolas Dumazet authored
      There were three surprising things in the previous version:
       * the XXX mention: leafs can indeed be detected at construction time
       * the need to track both children and parents of a node: usually only one
          or the other is enough to work efficiently on a graph
       * the idiom:
            if n in list: list.remove(n)
            list.append(n)
      
      Replace it by a generic sort on node depth. A dictionary is used for lookups to
      avoid linear list lookups, and only the successor relation is kept (parent_dict)
      
      Also explicit in comments the graph we are building/the order expected for code
      clarity (ie avoid confusion wrt what is the parent/child of the graph node)
      
      
      git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31556 20353a03-c40f-0410-a6d1-a30d3c3de9de
      6dd1ab34
  2. 31 Dec, 2009 7 commits
  3. 30 Dec, 2009 17 commits
  4. 29 Dec, 2009 15 commits