My suspicion is that if such an algorithm existed, in any reasnably efficient form, we'd already have auto-routers which could select part positions for you as well as routing traces between them.
Fortunately for you it looks like you've got a lot of space to play with for wiggling traces round one another and having vias, it might not be the optimum choice, but on a board like this it won't be difficult to fit.
If keeping the back side of the board as clear as possible (for fairly solid ground plane, or for placing components and traces not involved in the charliplexing layout) matters for you, I'd suggest the following two tips:
1. only go to the bottom layer for traces running vertically, traces which run horizontally should stay on the top layer. You could do this the other way round, but the trick is to reserve the back layer only for traces going in one of the directions, and only put traces of thatdirection on the back when routing on top isn't possible.
2. when you need to swap the "order" (which is furthest left, next left, middle, right...) of a series of traces, have them undergo a 90 degree cornering in the area where you put your vias, you can often get a whole swarm of traces to swap order, in many diferent mappings using just one via per trace (some traces not needing a via at all) or two vias if all traces afterwards are to be back on the top layer.