SubgraphMatchGPU icon indicating copy to clipboard operation
SubgraphMatchGPU copied to clipboard

How to add new queries

Open haozixu opened this issue 4 years ago • 0 comments

Hi, I tried to add some self-defined queries and run the program on GPU (using algorithm type GPU_LIGHT). Following the instructions, I registered my query type in src/Meta.h and added query pattern with orderings in src/query/common/Query.h. class LazyTraversalPlanHardCode in src/optimizer/LazyTraversalPlanHardCode.h was also modified (if not, some assertions will fail). But it turned out that the answers (count) seemed to be incorrect. Am I missing some steps or did something wrong? Thanks.

My query code:

void MyQuery() {
    vertex_count_ = 6;

    con_.resize(vertex_count_);
    con_[0].push_back(1);
    con_[0].push_back(2);
    con_[0].push_back(3);
    con_[0].push_back(4);
    con_[0].push_back(5);
    con_[1].push_back(0);
    con_[1].push_back(2);
    con_[2].push_back(0);
    con_[2].push_back(1);
    con_[2].push_back(3);
    con_[2].push_back(4);
    con_[2].push_back(5);
    con_[3].push_back(0);
    con_[3].push_back(2);
    con_[3].push_back(4);
    con_[4].push_back(0);
    con_[4].push_back(2);
    con_[4].push_back(3);
    con_[4].push_back(5);
    con_[5].push_back(0);
    con_[5].push_back(2);
    con_[5].push_back(4);

    order_.resize(vertex_count_);
    order_[0].push_back(std::make_pair(LESS_THAN, 1));
    order_[3].push_back(std::make_pair(LESS_THAN, 4));
    order_[1].push_back(std::make_pair(LARGER_THAN, 0));
    order_[4].push_back(std::make_pair(LARGER_THAN, 3));
}

haozixu avatar May 12 '21 09:05 haozixu