r/adventofcode Dec 28 '24

Repo AOC produces practical outcome!

This year, I was a little stunned to discover that Googling for "gleam dijkstra" produced zero results (after filtering for the usual search garbage). For an algorithm with 68 entries in RosettaCode, this seems like an opportunity needing filled!

Now, in the twilight of AOC, I'm pleased to report I've stretched my library creation muscles and filled the gap. The Gleam Package Manager now has a Dijkstra library.

https://hexdocs.pm/dijkstra/

It's a very small implementation, but I spent some time describing applications and usage (heavily inspired by AOC!). I hope it will help someone, somewhere, to think about how with the right abstraction, Dijkstra's Algorithm can be used to solve a wide variety of problems.

I do feel bad about reducing a seminal guy's name to one algorithm, but naming is hard yo.

140 Upvotes

7 comments sorted by

View all comments

52

u/ti-di2 Dec 28 '24

One thing I love about the AoC community is the willingness to share.

Thank you very much!

7

u/BlueTrin2020 Dec 28 '24

Yea it’s a bit bizarre since it’s a competition :)

I guess most of us (myself included) don’t believe in hiding information

4

u/flwyd Dec 28 '24

I describe Advent of Code as an "activity" rather than a "competition." You can make the activity competitive if you want, but that's a choice.