End to end polymer distance calculation

HI,
you can generate an index file and the use gmx distance. This post may help you

In general for the difference between

you can look to the following post

Best regards
Alessandra