Algebraic evaluation of linking numbers of unstable periodic orbits in chaotic attractors