SWAP gate is an essential element of nearest neighbor qubit networks which carry out quantum information processing tasks. The customary way of applying the SWAP gate consists of consecutive probabilistic operations which requires considerable resources. We propose the theoretical design of a structure constructed from linear optical elements on-chip, which applies the SWAP gate deterministically. Using reconfigurable elements, the structure can apply either the SWAP or instead the identity gate. Utilizing components frequently employed in the design and physical implementation of photonic networks on-chip, the structure can be implemented on various platforms. With its compact structure requiring no detectors or ancilla qubits, our design substantially reduces the required resources for the implementation of the SWAP gate.