Algorithm for computing the connectivity in planar kinematic chains and its application. (October 2021)