Skip to content

Instantly share code, notes, and snippets.

@hasibul-hasan-shuvo
Created January 14, 2020 15:41
Show Gist options
  • Select an option

  • Save hasibul-hasan-shuvo/9b14e873ec543ec5aea21130894cef19 to your computer and use it in GitHub Desktop.

Select an option

Save hasibul-hasan-shuvo/9b14e873ec543ec5aea21130894cef19 to your computer and use it in GitHub Desktop.
for(int adjacentNode = 0; adjacentNode < nodeNumber; adjacentNode++){
if(!visitedNode[adjacentNode] &&
graph[minNode][adjacentNode] != INT_MAX &&
visitedCost[minNode] != INT_MAX &&
visitedCost[minNode] + graph[minNode][adjacentNode] < visitedCost[adjacentNode])
visitedCost[adjacentNode] = visitedCost[minNode] + graph[minNode][adjacentNode];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment