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

Function _Graph_GetEdgesConnectingNodes

src/graph/graph.c:135–158  ·  view source on GitHub ↗

Locates edges connecting src to destination.

Source from the content-addressed store, hash-verified

133
134// Locates edges connecting src to destination.
135void _Graph_GetEdgesConnectingNodes
136(
137 const Graph *g,
138 NodeID src,
139 NodeID dest,
140 int r,
141 Edge **edges
142) {
143 ASSERT(g);
144 ASSERT(r != GRAPH_NO_RELATION);
145 ASSERT(r < Graph_RelationTypeCount(g));
146 ASSERT(src < Graph_RequiredMatrixDim(g));
147 ASSERT(dest < Graph_RequiredMatrixDim(g));
148
149 // relation map, maps (src, dest, r) to edge IDs.
150 EdgeID id = INVALID_ENTITY_ID;
151 RG_Matrix M = Graph_GetRelationMatrix(g, r, false);
152 GrB_Info res = RG_Matrix_extractElement_UINT64(&id, M, src, dest);
153
154 // no entry at [dest, src], src is not connected to dest with relation R
155 if(res == GrB_NO_VALUE) return;
156
157 _CollectEdgesFromEntry(g, src, dest, r, id, edges);
158}
159
160static inline AttributeSet *_Graph_GetEntity(const DataBlock *entities, EntityID id) {
161 return DataBlock_GetItem(entities, id);

Callers 1

Calls 5

Graph_RelationTypeCountFunction · 0.85
Graph_RequiredMatrixDimFunction · 0.85
Graph_GetRelationMatrixFunction · 0.85
_CollectEdgesFromEntryFunction · 0.85

Tested by

no test coverage detected