I am searching for an algorithm...
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Now, this one isn't really the spirit of the post, so my suggestion is to remove that phrase from the post.
What would be an elegant algorithmic approach...
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.
All I can suggest (because I'm not an expert in that technology) is to be more precise about what you are after. What metrics do you want to improve?