A stochastic approach to shortcut bridging in programmable matter