44 ms·
Just FYI, it was possible to solve Advent of Code 2023 - Day 25 using a cool Linear Algebra trick as well. "Fiedler vector"[1] - Algebraic connectivity (withou
by vismit2000 3y ago
Just FYI, it was possible to solve Advent of Code 2023 - Day 25 using a cool Linear Algebra trick as well.
"Fiedler vector"[1] - Algebraic connectivity (without networkx): https://www.reddit.com/r/adventofcode/comments/18qbsxs/comment/keubcfd/ https://www.reddit.com/r/adventofcode/comments/18qbsxs/comme...
I also used networkx during the contest to solve and visualize[2] but it was good to learn the Linear Algebra approach also afterwards from the Reddit solution thread.
[1] https://en.wikipedia.org/wiki/Algebraic_connectivity?useskin=vector#Partitioning_a_graph_using_the_Fiedler_vector https://en.wikipedia.org/wiki/Algebraic_connectivity?useskin...
[2] https://github.com/vismit2000/compCode-II/blob/master/Advent-of-Code/2023/day25.py#L14 https://github.com/vismit2000/compCode-II/blob/master/Advent...