I have downloaded a bunch of graphs from http://users.cecs.anu.edu.au/~bdm/data/graphs.html and I want to do some analysis. I want to use the graph-tool Python module for this but I cant find a convenient way to convert from graph6 format to a format compatible with graph-tools. There must be an easy way to do this... any help would be appreciated.
-- EDIT: A possible solution is convert from g6 to gt format... but I haven't found any tools that do this.
The
graph6format looks annoying to work with, but fortunately the documentation mentions a tool namedshowgfor pretty-printing graphs. It's easy to simply parse the output of that program.First, build the
showgtool. (Useclangorgccas appropriate for your system. Or just download the binary they provide on their website.)Download some example data and look at it. I think the
-eoption produces the easiest output to work with.Here's a simple script that reads the edge list from
./showg -p<N> -eand creates agraph_tool.Graphobject:Let's give it a try: