Condition to check if there is no path between the vertices
if ( path [ i ] == -1 ) { cout << " Path ▁ not ▁ found ! ! " ; return ; } printPath ( path , path [ i ] , s ) ; cout << path [ i ] << " ▁ " ; } }