With a little modification of the algorithm, I think I've gotten an acceptable order for the tree case, while still surviving the DAG case:
| Class SSL.https | Inherit graph | | predef::ADT.Queue | | | | predef::SSL.context | | | | | | predef::Stdio.Port | | | | | +---+---+--predef::SSL.sslport | | | +--predef::SSL.https
| Class Parser.XML.Tree.SimpleRootNode | Inherit graph | | predef::Parser.XML.Tree.XMLParser | | | | predef::Parser.XML.Tree.AbstractSimpleNode | | | | | | predef::Parser.XML.Tree.VirtualNode | | | | | | +---+--predef::Parser.XML.Tree.SimpleNode | | | | +-----------+--predef::Parser.XML.Tree.SimpleRootNode
| Class GTK2.FileChooserDialog | Inherit graph | | predef::GTK2.FileChooser | | | | predef::GTK2.Object | | | | | +--predef::GTK2.Widget | | | | | +--predef::GTK2.Container | | | | | +--predef::GTK2.Bin | | | | | +--predef::GTK2.Window | | | | | +--predef::GTK2.Dialog | | | | +-----------------------+--predef::GTK2.FileChooserDialog