You can use union and setdiff functions to find out the particles that are not in contact.
Total_Particles - all particles
Particle1 - particles in column 1
Particle2 - particles in column 2
Contacted_Particles=union(Particle1, Particle2 ) - all particles that are in contact
setdiff(Total_Particles,Contacted_Particles) - gives particles that are not in contact.
Total_Particles, Particle1, Particle2 are all arrays with particle numbers