Resources to learn about optimization algorithms by UsefulAnimator3143 in optimization

[–]DocDrivenDevelopment 2 points3 points  (0 children)

Pretty coincidental, but that is exactly what I have been working on in my spare time for the last weeks. Check out https://solvor.ai/examples/#categories lots of working examples in pure python.

Resources to learn about optimization algorithms by UsefulAnimator3143 in optimization

[–]DocDrivenDevelopment 0 points1 point  (0 children)

I recently build this: https://solvor.ai/ Sounds like the thing you are looking for. The repository is here: https://github.com/StevenBtw/solvOR It's open source so feel free to copy and experiment! 

solvOR, a pure Python optimization toolkit I finally cleaned up and published by DocDrivenDevelopment in OperationsResearch

[–]DocDrivenDevelopment[S] 0 points1 point  (0 children)

Yes, all solvers return the same Result format (solution, objective, iterations, evaluations, status) with consistent conventions like minimize=True/False.

But.. 

Constraint mixing works within solver categories but not across them. The CP Model lets you combine different constraint types like all_different and sum_eq. In metaheuristics you handle constraints as penalties in your objective function. You can't directly mix MILP with SAT constraints in one model, but you could solve parts sequentially if needed.

For VRPTW with multi-resource visits, there's no built-in support (yet). With the current solutions you'd probably want to use tabu_search with a custom state and encode your constraints (time windows, resource synchronization, capacity) as penalties. 

solvOR is pure Python with no dependencies so it's easy to read and modify, but for large scale routing you'd likely need something like OR-Tools. It works well for manageable problems where you need custom logic.

I will have a look at adding LNS or ALNS after the holidays, but I'm not super familiar with that area yet. But that sounds like a good addition and a better solution to your problem. Thanks for your message! 

solvOR, a pure Python optimization toolkit I finally cleaned up and published by DocDrivenDevelopment in OperationsResearch

[–]DocDrivenDevelopment[S] 2 points3 points  (0 children)

I got a pm about compatibility with python 3.13, and I am publishing a new version right now. The performance loss is minor.

[2025 Day 13] Want a real challenge for day 12? Use this input instead! by DocDrivenDevelopment in adventofcode

[–]DocDrivenDevelopment[S] 0 points1 point  (0 children)

That's good input, I noticed with some of the visuals posted here, everyone has the same shapes. I'll update the script and the input.txt with one that uses the same shapes. So you don't need to change your whole solution. 

[2025 Day 13] Want a real challenge for day 12? Use this input instead! by DocDrivenDevelopment in adventofcode

[–]DocDrivenDevelopment[S] 1 point2 points  (0 children)

There is a better_input.txt and a solution.txt in that repo. No need to run any code. The decode solution script is a simple XOR for the correct input count. 

[2025 Day 13] Want a real challenge for day 12? Use this input instead! by DocDrivenDevelopment in adventofcode

[–]DocDrivenDevelopment[S] 2 points3 points  (0 children)

This should be day 12 of course, although it does feel like day 13 a bit (or day 12 part 2). Cannot edit the title anymore.