Optimal Path Learning for mmWave Communications in Smart Factory