Skip to content

Instantly share code, notes, and snippets.

@hmthanh
Created April 16, 2019 07:31
Show Gist options
  • Save hmthanh/68ecc7c449525e14bfc320eff8d452c4 to your computer and use it in GitHub Desktop.
Save hmthanh/68ecc7c449525e14bfc320eff8d452c4 to your computer and use it in GitHub Desktop.
Thuật toán FloyWarshall
vector<int> pathS2E = vector<int>();
while (start != end){
pathS2E.push_back(end);
end = path[start][end];
}
pathS2E.push_back(start);
for (vector<int>::iterator i = pathS2E.end(); i != pathS2E.begin(); i--)
{
cout << *(i-1) << " ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment