Shortest paths and best strings algorithms implemented.