In order to realize the linear nearest neighbor (LNN) arrangement of a quantum circuit
the nearest neighbor Toffoli gates cascade method of an MCT gate is given.To solve the issue of the increased quantum cost resulted from the extra inserted SWAP gates during the process of nearest neighbor
the NNTS gate is introduced to decrease the number of the inserted SWAP gates
and the LNN line arrangement using NNTS gates of an MCT gate is obtained.The line arrangement algorithm is proposed.The LNN line arrangement of each MCT gate can be realized by the exchange of the order of the lines
and each NNTS gate is replaced by its optimal LNN form
then the LNN quantum circuit is obtained directly
which can greatly reduce the length of the quantum circuit and the quantum cost.Test on benchmark circuits
and compared with the existing relevant results
the average improvement rate is almost 42.83% in SWAP gate count