add recursive dijistra function to fix the pathset when the path does not start with an start state or end with an accpetence state