r/PowerShell • u/mdowst • Dec 08 '25
Saving Christmas with PowerShell: Building a Reusable Matching Algorithm
This video isn’t just “here’s a script.” It walks step-by-step through the whole evolution of the solution:
- Start with a naive random shuffle
- Add constraints and filtering
- Introduce backtracking when things get messy
- Turn it all into a clean, reusable function
The end result is a robust matching engine you can adapt for scheduling, load balancing, on-call rotations, pairing systems, etc.
Watch: https://youtu.be/4uwQh6Nap5M
Code: https://www.dowst.dev/?p=3971
Feedback and ideas welcome!
13
Upvotes
View all comments
Show parent comment
2
u/mdowst Dec 08 '25
Thanks for the feedback. This one was a challenge to make because of all of the conditions and backtracking, so I'm glad to hear it was easy to follow.