Question: say I have a graph (DAG, specifically) of arbitrary complexity. I want to turn this into a sequence through a deterministic(!) topological sort.
However, new parts of the graph may be discovered at any point in time, in which case the sequence needs to be updated to reflect this new part. But the full sequence is not present in memory; it is stored in a flat database, such as an RDBMS or key/value store.
What would be a reasonable sorting approach and storage format that would allow for doing this sort of 'incremental resorting', without needing to load potentially unbounded-in-size parts of the graph into memory to do so?