ltilib hat brauchbare Algorithmen. Gibts auf sourceforge.