Text this: Optimal base station selection based on dynamic programming for reprogramming in mine wireless network