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

Function Graph_GetEdgesConnectingNodes

src/graph/graph.c:621–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621void Graph_GetEdgesConnectingNodes
622(
623 const Graph *g,
624 NodeID srcID,
625 NodeID destID,
626 RelationID r,
627 Edge **edges
628) {
629 ASSERT(g);
630 ASSERT(edges);
631 ASSERT(r < Graph_RelationTypeCount(g));
632
633 // invalid relation type specified;
634 // this can occur on multi-type traversals like:
635 // MATCH ()-[:real_type|fake_type]->()
636 if(r == GRAPH_UNKNOWN_RELATION) return;
637
638#ifdef RG_DEBUG
639 Node srcNode = GE_NEW_NODE();
640 Node destNode = GE_NEW_NODE();
641 ASSERT(Graph_GetNode(g, srcID, &srcNode) == true);
642 ASSERT(Graph_GetNode(g, destID, &destNode) == true);
643#endif
644
645 if(r != GRAPH_NO_RELATION) {
646 _Graph_GetEdgesConnectingNodes(g, srcID, destID, r, edges);
647 } else {
648 // relation type missing, scan through each edge type
649 int relationCount = Graph_RelationTypeCount(g);
650 for(int i = 0; i < relationCount; i++) {
651 _Graph_GetEdgesConnectingNodes(g, srcID, destID, i, edges);
652 }
653 }
654}
655
656void Graph_ResetReservedNode
657(

Callers 5

AR_SHORTEST_PATHFunction · 0.85
Graph_GetNodeEdgesFunction · 0.85
_Traverse_CollectEdgesFunction · 0.85
Proc_BFS_StepFunction · 0.85
test_getEdgeFunction · 0.85

Calls 3

Graph_RelationTypeCountFunction · 0.85
Graph_GetNodeFunction · 0.85

Tested by 1

test_getEdgeFunction · 0.68