Unable to load image

rDrama Advent of Code Day 25: Stop Eating And Code Edition

Summary for those just joining us:

Advent of Code is an annual Christmas themed coding challenge that runs from December 1st until christmas. Each day the coding problems get progressively harder. We have a leaderboard and pretty good turnout, so feel free to hop in at any time and show your stuff!

Whether you have a single line monstrosity or a beautiful phone book sized stack of OOP code, you can export it in a nice little image for sharing at https://carbon.vercel.app

What did you think about today's problem?

https://adventofcode.com/2023

Our Code is 2416137-393b284c (No need to share your profile, you have the option to join anonymously if you don't want us to see your github)


This is it, we're at the end now. Did you finish it all?

15
Jump in the discussion.

No email address required.

I was gonna do Karger's algorithm but I'm too full of food and alcohol to care at this point, so I used graphviz to manually find the three support edges and remove them from the input.

https://i.rdrama.net/images/17035586795034015.webp

Complete finish times - almost all of these were done after work, but my personal goal was doing all of them within their day of release so I'm happy :marseyexcited:

https://i.rdrama.net/images/17035586801827033.webp

Jump in the discussion.

No email address required.

A disappointing end to a disappointing year. I did it with NetworkX. At least we're done now.

Jump in the discussion.

No email address required.

Looking back, this year really lacked a lot of the multi-day puzzles like assembunny or elf cards. We implemented a lot of stuff that just never got used again.

Jump in the discussion.

No email address required.

I agree, he spent a few days doing questions with mirrors, lenses, pipes etc and then never tied them together. There could have been some cool construction problems. The lense question was especially weird because he explained so much but it went nowhere.

Jump in the discussion.

No email address required.

Also a total lack of parser problems, the ones where you have to build a calculator around some weird encoding are fun.

Jump in the discussion.

No email address required.

Python:

https://i.rdrama.net/images/17035068772750766.webp

I suck at graph theory so I cheated and just visualised the darn thing.

Jump in the discussion.

No email address required.

Changed my mind, got the correct solution and it's a v neat puzzle.

First 5 lines are parsing the input, there's nothing to it:

a←⎕C⎕A ⋄ r←(∊∘a⊆⊢)¨⊃⎕NGET'25.in'1
rk←⊃,/1↑¨r ⋄ rv←1↓¨r ⋄ k←∪⊃,/r
u←{(≢rk)<i←rk⍳⊂⍵:⍬ ⋄ i⊃rv}¨k
v←(⌷∘rk)∘⊂∘⍸¨↓⍉∨/¨rv(∘.∊)⊂¨k
T←≢i←k∘⍳¨u,¨v
⎕←{
    c←(≢~∘⍵)∘(⊃∘i)¨⍵
    3≡+/c:T(-×⊢)≢c
    ⍵~⍵⊃⍨⊃⍒c
}⍣{2>≢⍺}⊢⍳≢i

Full calendar:

https://i.rdrama.net/images/17035605739579258.webp

Jump in the discussion.

No email address required.

It's a shame nobody can read that language to figure out what you're actually doing

Jump in the discussion.

No email address required.

Since every node has 4+ connections and the cut size is 3:

>start with a set of all nodes

>for each node in the set, count the number of nodes it maps to outside the set

>add them up, if it's 3, you have the min cut

>if not, remove the element with most outside edges (random to start with) and go back to step 2

It can trip up if crosses the bridge early on, but 99% of the time it gives the right answer.

Jump in the discussion.

No email address required.

:marseypeacekeeper: We've got you surrounded! Come find the minimum cut!

:marseytrollgun: I HATE GRAPH THEORY! I HATE GRAPH THEORY!

https://i.rdrama.net/images/17036669734308054.webp

This was fun for a while, but it became a real slog from day 17 onwards. I don't think I'll be doing this again.

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.