Input:
 A network graph .
Output:
 A set of complete bipartite graphs .
(1) for each   do
(2)  Collect -hop neighborhood subgraph .
(3)  Calculate the shortest distance matrix .
(4)  Reconstruct the subgraph by MDS.
(5)  Calculate the virtual distance matrix .
(6)  Calculate the distortion factor .
(7)  Flood to the network.
(8)  Calculate the threshold .
(9)  if     then
(10)  Add to the suspect node set .
(11) end if
(12) end for
(13) Find all connected components from .
(14) for  each   do
(15) Find each MCBS from .
(16) Add to the MCBS set .
(17) end for
(18) for each in   do
(19) if     then
(20)  Remove edges .
(21) else
(22)  Remove from .
(23) end if
(24) end for
Algorithm 1: Our wormhole detection algorithm.