Xenia at a computer
Skip to Content

FoxSylv.dev:$ cd _

FoxSylv.dev

~/coding

~/trackmania

~/contact

cd _

~/coding

~/trackmania

~/contact

HLP

HLP Discord

A brute-force algorithm for the HLP

Goals

The HLP is a question in Minecraft redstone that asks how to optimally convert a hex line into a desired set of signal strength outputs. Because I am a massive nerd, this problem piqued my interest greatly.

Production Details

There is no "nice" algorithm, since a subset of the HLP is equivalent to sorting by prefix reversals, which has been proven to be NP-hard. As such, brute force is the only option, while desperately clawing at optimizations to save time.

I coded the algorithm in C to maximize speed, and implemented a novel way to store HLP functions to minimize space needed for caching to the theoretical minimum. This new approach plus other optimizations makes it surprisingly fast.

Conclusion

While not perfect, I like my algorithm, if for no other reason than because I made it. The HLP is a really interesting problem to work on, even if a bit niche!

  • Favicon by drakonicguy
  • Background Xenia art by Neotheta
  • Footer Xenia art by cathodegaytube
  • Blobfoxes by Volpeon
Xenia the fox linux mascot confidently holding a keyboard