add nodes and links array
remove isSwUsed
remove sw in circle
fix bugs of not loop
remove repeated in bfs