get_pathlength function

Get Path Length