This algorithm is the same as "bottom-up" but incremental estimates of cost only count nodes in the solution set once.
It does this by keeping track of the entirety of these incremental solutions in a persistent set data-structure: essentially a HAMT with PATRICIA-style unions and support for incrementally computed aggregations (in this case, costs).
The diff is large because it includes a full sub-crate implementing this set data-structure (which I had laying around a dev branch for egglog). The interfaces aren't at the stage where I'd want to publish it on its own, so adding it here seemed like the best option. Let me know if I should nest it under a subcrates subdirectory though.
This algorithm is the same as "bottom-up" but incremental estimates of cost only count nodes in the solution set once.
It does this by keeping track of the entirety of these incremental solutions in a persistent set data-structure: essentially a HAMT with PATRICIA-style unions and support for incrementally computed aggregations (in this case, costs).
The diff is large because it includes a full sub-crate implementing this set data-structure (which I had laying around a dev branch for egglog). The interfaces aren't at the stage where I'd want to publish it on its own, so adding it here seemed like the best option. Let me know if I should nest it under a
subcrates
subdirectory though.