A Banyan-type network is a typical network topology for optical interconnection networks. In this paper, we propose a routing algorithm to generate the nonblocking connections for any request on a Banyan-type network with a given crosstalk constraint, in which the number of planes exactly equals to the necessary and sufficient condition derived in our previous results. In addition, we analyze this routing algorithm by relating to the study of graph theory and found it is a polynomial time algorithm.