MCPcopy Index your code
hub / github.com/Colin97/DeepMetaHandles / spfa

Function spfa

data_preprocessing/sample_key_points.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void spfa(int st) {
37 std::queue<int> Q;
38 Q.push(st);
39 std::vector<int> inq;
40 inq.resize(n, false);
41 inq[st] = true;
42 while (!Q.empty()) {
43 int u = Q.front(); Q.pop();
44 inq[u] = false;
45 for (int i = head[u]; i != -1; i = edges[i].n) {
46 int v = edges[i].v;
47 if (!is_key_point[v] && dis[v] > dis[u] + edges[i].l) {
48 dis[v] = dis[u] + edges[i].l;
49 if (!inq[v]) {
50 inq[v] = true;
51 Q.push(v);
52 }
53 }
54 }
55 }
56}
57
58int main(int argc, char *argv[])
59{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected