add function: fix head and tail to the path  which is incomplete (still need implement function to get the shrotest path between two vertex