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

Function TriangleGraph

tests/unit/test_query_graph.c:93–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93QueryGraph *TriangleGraph() {
94 // create a triangle graph
95 // (A)->(B)->(C)->(A)
96 size_t node_cap = 3;
97 size_t edge_cap = 3;
98
99 // create nodes
100 const char *relation = "R";
101
102 QGNode *A = QGNode_New("A");
103 QGNode *B = QGNode_New("B");
104 QGNode *C = QGNode_New("C");
105
106 QGEdge *AB = QGEdge_New(relation, "AB");
107 QGEdge *BC = QGEdge_New(relation, "BC");
108 QGEdge *CA = QGEdge_New(relation, "CA");
109
110 QueryGraph *g = QueryGraph_New(node_cap, edge_cap);
111 QueryGraph_AddNode(g, A);
112 QueryGraph_AddNode(g, B);
113 QueryGraph_AddNode(g, C);
114
115 QueryGraph_ConnectNodes(g, A, B, AB);
116 QueryGraph_ConnectNodes(g, B, C, BC);
117 QueryGraph_ConnectNodes(g, C, A, CA);
118
119 return g;
120}
121
122QueryGraph *DisjointGraph() {
123 // create a disjoint graph

Callers 1

Calls 5

QGNode_NewFunction · 0.85
QGEdge_NewFunction · 0.85
QueryGraph_NewFunction · 0.85
QueryGraph_AddNodeFunction · 0.85
QueryGraph_ConnectNodesFunction · 0.85

Tested by

no test coverage detected