GraphIt-DSL / graphit

GraphIt - A High-Performance Domain Specific Language for Graph Analytics

Home Page:http://graphit-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is there a way to create edges as part of the algorithm?

tommy-mor opened this issue · comments

commented

I am trying to implement this algorithm: https://arxiv.org/pdf/1209.1688.pdf . In section 2.2 is suggests "Finally, to ensure that each row-sum is exactly one, we add a self-loop to each node".

Essentially I need to add an edge. I can't find a function to do this in examples/source/documentation.

My current idea is to either 1) include |V| self edges from python wrapper script, modify them in graphit 2) make a custom cpp function that adds a self edge somehow (would like guidance on this), 3) run the getOutDegrees() in one graphit script, then use those values from python to construct self edges, then feed them to another graphit script. 4) calculate getOutDegrees() in python, then put the self edges into the first script.

Would like some guidance on this.. tysm for very cool project.

Hi @tommy-mor,
Thank you for your interest in GraphIt. Currently GraphIt doesn't support modifying the graph data structure at runtime. The loader is also borrowed from the GAPBS project. If I understand correctly it does drop all the self referencing edges.

As a work around, it would be possible to do what you are trying to achieve with external functions. After loading the graph, you can call a external function written in C++ to insert the self edges. Although we haven't tested any algorithms with self edges so far. So the implementation of all the operators like edgeset.apply could have issues.

Please let me know if you would like an example of how to use extern functions.

commented

I would like an example actually. I feel like I saw one in the repo, and I know the docs have some info on this. Currently was going down path 3, but 2 might be easier if I have a good example. Thanks for helpfulness