@@ -4611,6 +4611,10 @@ The above algorithm essentially splits the search space in half each time a rule
4611
4611
is evaluated: one half is accepted and continues to the next workflow, while the
4612
4612
other half is rejected and passed on to the next rule of the current workflow.
4613
4613
4614
+ This can be nicely visualized using a [ Sankey diagram] [ wiki-sankey ] , which is
4615
+ what was done [ here in this Reddit post] [ d19-reddit-sankey ] in the AoC
4616
+ subreddit. Pretty neat!
4617
+
4614
4618
We'll implement the above as a recursive function taking 3 arguments: the
4615
4619
workflows, the initial ranges and the current workflow name. The variable ranges
4616
4620
will be represented with a dictionary of the form ` {var_name: (lo, hi)} ` ,
@@ -5117,6 +5121,7 @@ print('Part 2:', answer)
5117
5121
[ d08-p2 ] : #part-2-7
5118
5122
[ d12-original ] : original_solutions/day12.py
5119
5123
[ d18-jonathan-video ] : https://www.youtube.com/watch?v=UNimgm_ogrw
5124
+ [ d19-reddit-sankey ] : https://old.reddit.com/r/adventofcode/comments/18lyvuv
5120
5125
[ d20-reddit-viz1 ] : https://www.reddit.com/r/adventofcode/comments/18mypla
5121
5126
[ d20-reddit-viz2 ] : https://www.reddit.com/r/adventofcode/comments/18mqnrl
5122
5127
[ 2019-d06-p2 ] : ../2019/README.md#part-2-5
@@ -5204,6 +5209,7 @@ print('Part 2:', answer)
5204
5209
[ wiki-pick-theorem ] : https://en.wikipedia.org/wiki/Pick%27s_theorem
5205
5210
[ wiki-priority-queue ] : https://en.wikipedia.org/wiki/Priority_queue
5206
5211
[ wiki-quadratic-formula ] : https://en.wikipedia.org/wiki/Quadratic_formula
5212
+ [ wiki-sankey ] : https://en.wikipedia.org/wiki/Sankey_diagram
5207
5213
[ wiki-shoelace ] : https://en.wikipedia.org/wiki/Shoelace_formula
5208
5214
[ wiki-sparse-matrix ] : https://en.wikipedia.org/wiki/Sparse_matrix#Dictionary_of_keys_(DOK)
5209
5215
[ wiki-taxicab ] : https://en.wikipedia.org/wiki/Taxicab_geometry
0 commit comments