When implementing a specific, mostly standalone algorithm, I think it is best to put it in a small package, well-tested, documented, with a very lightweight interface.
This has the following advantages:
- the code should remain functional work a long time, because of the simple setup, and should be easy to update when needed,
- multiple packages can make use of it, possibly incorporating the algorithm into their own interface via a wrapper. All will benefit from improvements, and consequently the motivation to contribute increases.
- if a particular dependent project is abandonned, your algorithm implementation will continue to be around (as opposed to having to be excavated from a complex and abandonned codebase).