Residue i (orange) sits in a graph, not a line — edges connect residues that are physically close in 3D, sequence-neighbors or not. Step through the four stages below, then click any other node to repeat the whole thing for a different residue.
Edges here aren't the sequence 1–2–3… — they connect residues within a distance cutoff in real 3D. 1–8 and 2–7 are neighbors because this stretch folds into a hairpin, even though they sit far apart in sequence.