Question: I'm looking to organize some items based on inheritance, with the goal of identifying which items are the most densely-connected parents, and also just seeing the connections formed.

Normally this would be done with a topological sort, but my graph has cycles. Is there something like a "best-effort" topological sort, which can attempt to determine the "most important" parents based on things like number of connections or something analogous?

As an example, given the graph below, I'd like for 1 and 2 to be the top-level parents. 1 has no parents; and while 2 is in a cycle, it is the parent of more children than it inherits from.

[![enter image description here](https://i.stack.imgur.com/y8Lpz.png)](https://i.stack.imgur.com/y8Lpz.png)

Answer: 
One way to achieve something like that would be to compute for each node how many other nodes are accessible from it, and then sort the nodes based on that number. 

Alternatively, you can reverse that logic. For each node compute how many nodes have access to it, then sort nodes in ascending order.
Google's [pagerank-Algorithm](https://www.youtube.com/watch?v=P8Kt6Abq_rM) evaluates websites, whose hyperlinks are represented as directed edges. Websites with many and important incoming links are rated highly.  

In your case it seems to be the opposite. You want few/no incoming edge.  

You could therefore try the pagerank-algorithm, but reverse its results in the way, that the nodes with the highst page-rank get the lowest inheritance-rating and the other way around.