This study proposes a novel method of optimal path planning in stochastic constraint network scenarios. We present a dynamic stochastic grid network model containing semienclosed narrow and long constraint information according to the unstructured environment of an underground or mine tunnel. This novel environment modeling (stochastic constraint grid network) computes the most likely global path in terms of a defined minimum traffic cost for a roadheader in such unstructured environments. Designing high-dimensional constraint vector and traffic cost in nodes and arcs based on two- and three-dimensional terrain elevation data in a grid network, this study considers the walking and space constraints of a roadheader to construct the network topology for the traffic cost value weights. The improved algorithm of variation self-adapting particle swarm optimization is proposed to optimize the regional path. The experimental results both in the simulation and in the actual test model settings illustrate the performance of the described approach, where a hybrid, centralized-distributed modeling method with path planning capabilities is used.