Notes

Code

Here's a Python implementation of the algorithm we developed: