Day 10: Factory

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 2 points 8 months ago* (last edited 8 months ago) (3 children)

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

(/relieving)

I would never have solved this if it weren't for AoC being only 12 days. I don't know if that was a good thing with how much this took out of me.

  • Written in the Really Ultimate Simplex Tableau (Rust) programming language
  • Over 600 lines (so long it didn't fit without using paste)
  • Two-phase simplex fully implemented, refactored to handle inequalities as well as equalities (you need inequalities during branch-and-cut)
  • Custom Fraction struct because floating-point made me sad (just like every other time I try to use it)
  • The hackiest branch-and-cut implementation ever (really, you had to add inputs with non-integer optima just to make life harder?)
  • Hideously unreadable use of iterators
  • Probably still filled with lingering bugs
  • All of the comments telling the story of my deteriorating mental state intact
  • Part 1 included as a bonus
  • Somehow, actually reasonably performant (37.1 +/- 0.3 ms)

Solution

  • source
  • hideshow 3 child comments
  • [โ€“] [S] 1 point 8 months ago (2 children)

    I dunno how topaz is meant to work, but I get an error about failing to decompress data on mobile Firefox, is the link right?

  • source
  • parent
  • hideshow 2 child comments