For Advent of Code 2023 Day 25, I get a bunch of nodes and wires connecting them. I'll read them into a Graph with the Python networkx library, and then use the Stoer-Wagner algorithm implemented in networkx to get the answer very easily.
Code 2023 AOC: https://gitlab.com/0xdf/aoc2023
Challenge Link: https://adventofcode.com/2023/day/25
Stoer-Wagner: https://en.wikipedia.org/wiki/Stoer%E...
networkx: https://networkx.org/
networkx stoer_wagner: https://networkx.org/documentation/st...
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Part 1 description
[01:33] Input analysis
[02:16] Install networkx in venv
[03:12] Prase lines into graph
[03:59] Stoer-Wagner
[05:50] Solve part 1
[06:28] Summary
#adventofcode #python
Watch video Day 25: Snowverload [AOC2023 Python] online without registration, duration hours minute second in high quality. This video was added by user 0xdf 27 December 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 26 once and liked it people.