Efficient Minimum Cycle Mean Algorithms And Their Applications