@nwjsmith: I’m working on a similar problem. My approach (which doesn’t work yet) will be something like this: Perform a random number of “rounds” On each round, generate an arbitrary number of new nodes, then draw arbitrary edges from the already-existing nodes to new nodes. Recur on the union of new nodes and existing nodes (i.e. add the new nodes to the already existing nodes)
@alex.ter.weele I managed to figure out how to generate the DAG in the way I described: https://gist.github.com/nwjsmith/0f4288db2f7c0be8b06e5237d6175b3d
The magic happens in gen-acyclic-edges
, where we build up a list of generators of connecting edges, and call gen/tuple
on it once we're finished
OK, I get it! It took me a second to realize why gen-acyclic-edges
will never create cycles--because edges only go forward in the list.