Skip to content

Instantly share code, notes, and snippets.

@tomasdelvechio
Created April 17, 2019 00:50
Show Gist options
  • Save tomasdelvechio/31b9cb4d29cc438755e65c52afb92423 to your computer and use it in GitHub Desktop.
Save tomasdelvechio/31b9cb4d29cc438755e65c52afb92423 to your computer and use it in GitHub Desktop.
Dijkstra Algorithm with SNAP Library
#include "Snap.h"
int main(int argc, char* argv[]) {
TFIn FIn(argv[1]);
PNEANet Graph = TNEANet::Load(FIn);
printf("Load Graph\n");
TIntFltH NDistH(Graph->GetNodes());
TFltV vec ;
int out = TSnap::GetWeightedShortestPath(Graph, 0, NDistH, vec);
printf("%d\n", out);
printf("Dijkstra ended\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment