A vertical line passing through n points and extending. Draw point p on the vertical line so that PN= river width. Connect MP, cross group A to group A, cross point Q, and make a vertical line through group B to group B. The route M-A-B-N is the shortest distance.
The shortest distance from point P to m is a straight line MP, and AP=BN (parallelogram ABNP).