Jeff Standen

227 Followers
604 Following
877 Posts

Founder & Software Architect @ Cerb for 23 years, building web-based team email and workflow automation. 100% source-available & customer-funded.

I've been obsessed with coding since the dial-up BBS days of the early 1990s. My daily stack is PHP/MySQL/AWS/Docker, with increasingly more Python for devops/ML.

Learning piano and German.

#php #mysql #aws #docker #python #programming #machinelearning #compilers #bootstrapping #german #music #piano

Workhttps://cerb.ai
Githubhttps://github.com/jstanden/

I am quite proud of having figured out a clean SAT formulation of this problem that could be solved using common optimization packages in python. Here's my cleaned up code for solving with PuLP/CBC (comment out the triviality check at the top to force solving using pulp - like I did on the weekend 馃槄 ).

https://github.com/johnpmay/AdventOfCode2025/blob/main/Day12/Day12-clean.ipynb

Tips welcome from any optimization gurus with more experience with Z3 / PuLP / ORtools for how this might be made better.

AdventOfCode2025/Day12/Day12-clean.ipynb at main 路 johnpmay/AdventOfCode2025

Contribute to johnpmay/AdventOfCode2025 development by creating an account on GitHub.

GitHub

@plbrault I went with backtracking for several hours too. Finding any possible solution wasn't too bad on most, but proving the impossible ones on an np-hard should have been my clue.

Worst part is I'd filtered the regions by impossible areas already as the first step. 馃槄

@adw99 Sorry for the delay. Something like this?

from itertools import product

list1 = list('ABC')
list2 = list(range(1,6))

print(list(product(*[product(list1[i],list2) for i in range(3)])))

@3j0hn Yeah, I cleaned the list that way in minutes and then spent hours on my backtrack solver and visualizations for combining shapes using Minkowski/etc.

Finding any solution was easy. Proving _impossible_ scenarios like the test case should have been the obvious clue; but I was too deep down the rabbit hole by then.

I just completed all 12 days of Advent of Code 2025!

https://adventofcode.com/

#AdventOfCode

Advent of Code 2025

I've completed "Christmas Tree Farm" - Day 12 - Advent of Code 2025

I was _deeply_ unsatisfied with this solution, so I've been turning it into a game and working on an actual solver instead.

https://github.com/jstanden/advent-of-code-python/blob/main/2025/day12.ipynb

#AdventOfCode #Python #Programming

Also, a shoutout and high鈥慺ive to a few fellow Mastodons who posted incredible stuff, interacted with me, or are just plain awesome:

@jochie @movq @alrj
@tipiak75 @RogerBW @jeff @everythingalsocan @psf @papajohn
@sol_hsa @mina @Tipa @psychotimmy
@teotwaki @mnvr

Thanks, #AdventOfCode was just so much more fun with you guys 馃槉.

Since I used nx.topological_sort() to do the heavy lifting for me on this one, here's an implementation of Kahn's algorithm to do the same thing for any graph model.

https://github.com/jstanden/advent-of-code-python/blob/main/2025/journals/topological-sort-graph.ipynb

advent-of-code-python/2025/journals/topological-sort-graph.ipynb at main 路 jstanden/advent-of-code-python

Advent of Code solutions in Python. Contribute to jstanden/advent-of-code-python development by creating an account on GitHub.

GitHub

@JesseSkinner Thanks! I haven't tried to write a linear solver yet, but it would be a fun challenge after AoC.

I always go straight for z3 and have a better appreciation for what it's doing now.

For Day 11's penance for using networkx, I'll probably implement topological sort with BFS. 馃槄

As penance for using Z3 on Day 10 Part 2, I wrote down some notes and worked examples for linear Diophantine equations and Gaussian Elimination with matrices.

This comes up every year and I never remember it.

I worked a few examples from my Day 10 input.

https://github.com/jstanden/advent-of-code-python/blob/main/2025/journals/diophantine-equations.ipynb

#AdventOfCode #math

advent-of-code-python/2025/journals/diophantine-equations.ipynb at main 路 jstanden/advent-of-code-python

Advent of Code solutions in Python. Contribute to jstanden/advent-of-code-python development by creating an account on GitHub.

GitHub