igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Guidance for contribution


From: Perrone, Alexander G.
Subject: [igraph] Guidance for contribution
Date: Wed, 21 Jun 2017 21:28:27 +0000

​I'm looking for some guidance on how to contribute code to the igraph C package. The intent is to add an algorithm to find cohesive subgroups called truss. The implementation is based on Algorithm 2 found here: 


Wang, Jia, and James Cheng. "Truss decomposition in massive networks." Proceedings of the VLDB Endowment 5.9 (2012): 812-823.​


I think this algorithm should be part of igraph because it uses igraph C functions along the way and is thus hard to separate the algorithm entirely from having access to igraph C functions, and other people do not necessarily have igraph source. While the igraph C functions have R and python bindings, it seems more elegant to contribute to igraph C than to write separate packages with R and python with essentially duplicate optimized C/C++ code for each of those packages. 


My questions:


1. Will you accept a C++ contribution? I noticed walktrap was in C++. I need C++ firstly for a hashed data structure (I use std::undordered_set) to provide O(1) insert, removal, and lookup for edge IDs. Secondly, I need a flexible enough vector to store an ordered array of these, as I need to iterate through levels of these hashed data structures. So, igraph vectors or queues are not viable since they are O(n) for lookup. The undocumented igraph set could be viable since it is O(log n). However, remove for igraph set does not appear to be implemented, only add and lookup. In any event, constant time would be ideal, and again a way to hold a vector of these. So the igraph data structures in C do not seem to meet these needs. 


2. I have working, documented C++ code, but I'm unsure how to incorporate this into igraph C as I don't see any make files. Can you explain how compiling works? I'm wondering how I can test that it builds. I also have an example appropriate to place in examples/simple/. 


3. Does it suffice to test algorithm output in say R? It looks like all the tests in igraph C are for compiling, not accuracy. I have tests written in R, not currently hooked up with the C++ but that is the goal. 


I think I'll have a few more but this should get me started. Thank you for any input you can provide. If you prefer this discussion to take place within an Issue on GitHub, let me know. 


Alex


reply via email to

[Prev in Thread] Current Thread [Next in Thread]