Message Routing and Scheduling in Optical Multistage Networks using Bayesian Inference method on AI algorithms