-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wishlist: Support reading/writing the graph6 format #1074
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It may be more useful to first create a function that takes a graph6 string (not a file) as input and creates a graph from it. Permission was granted (in private) to re-use code from gtools/nauty for this. (The license is not GPL2-compatible, so we could not just rely on that.) |
I use both nauty and igraph, and I think that implementing nauty's graph formats (graph6, sparse6, and digraph6) in igraph would be helpful. I find the graph6 format particularly convenient since it compactly encodes simple graphs as strings of ASCII characters. If such functionality were implemented in igraph, would it make more sense to work with C-style strings or igraph vectors of chars? |
Reading nauty strings (graph6/digraph6/sparse6, but not incremental sparse6) is already implemented in the Mathematica interface of igraph. It just needs to be ported over to C. It's not that hard to do but I was going to wait until writing nauty string is also implemented. Would the one-way conversion already be useful to you @tjsavitsky? If yes, we can make it happen for igraph 0.9. |
Yes, being able to read the nauty formats would be helpful. Thanks! |
OK, time allowing I'll port over the implementation I did for IGraph/M. It should be easy. May I ask which language you use igraph from? (C, R, Python, Mathematica?) |
@tjsavitsky If you have the expertise and the time to contribute a function to convert an The format description is here: https://users.cecs.anu.edu.au/~bdm/data/formats.html https://users.cecs.anu.edu.au/~bdm/data/formats.txt sparse6 in particular seems to be a bit fussy to deal with, so re-using nauty's original code is not a bad idea. It would reduce the likelihood of bugs. As for the reverse conversion (nauty -> igraph), that's mostly done, so we don't need help with it. |
I would say C style strings. All uses of @ntamas @gaborcsardi Do the R/Python interfaces give us any reason to choose |
Nope, just go with C strings; Python can convert from a Python string to a C string but not to an |
In the Python version of igraph, has the conversion of graph6 been implemented? |
No, it's not even in the C core. |
It's a work in progress, see #2526 |
This is a suggestion to support the graph6, sparse6 and digraph6 file formats. These are used by the nauty suite. Nauty comes with many command line tools that read and write graphs to stdin/stdout in these formats. Supporting them allows easy interoperability with these tools.
This format is primarily relevant for graph theory (not network science / data analysis).
Here's the format description: https://users.cecs.anu.edu.au/~bdm/data/formats.html
The tools to look at for implementation guidance are
showg
andlistg
.Note: I won't work on this myself because the current import/export design in igraph is not easy to integrate into Mathematica due to the use of
FILE *
pointers and thestdio
framework (i.e. I can't hook the functions up to custom streams).The text was updated successfully, but these errors were encountered: