A gene tree G with a weak edge (w,v) selected for an NNI. v is connected to two subtrees G
, while w is connected to v and to the subtree G
. Performing an NNI operation around (w,v) means interchanging subtree G
with either G
, leading to trees and respectively.