MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / path_cmp

Function path_cmp

src/procedures/proc_ss_paths.c:497–512  ·  view source on GitHub ↗

compare path by weight, cost and path length

Source from the content-addressed store, hash-verified

495
496// compare path by weight, cost and path length
497static int path_cmp
498(
499 const void *a,
500 const void *b,
501 void *udata
502) {
503 WeightedPath *da = (WeightedPath *)a;
504 WeightedPath *db = (WeightedPath *)b;
505 if(da->weight == db->weight) {
506 if(da->cost == db->cost) {
507 return Path_Len(da->path) - Path_Len(db->path);
508 }
509 return da->cost - db->cost;
510 }
511 return da->weight - db->weight;
512}
513
514// get all minimal paths (all paths with the same weight)
515static void SSpaths_all_minimal

Callers

nothing calls this directly

Calls 1

Path_LenFunction · 0.85

Tested by

no test coverage detected