The return-difference matrix in linear networks