Hi Phil, > I tried make_line_graph according to your suggestion. And it works very > well for small scale graph. > However, when the graph include millions of nodes, it becomes hard to > create a complete line graph. Yes, true, the line graph would probably be huge (but its exact size depends on the degree distribution). In that case, one thing that you can try before diving into the C code is to store an incidence list representation of the graph and work from that:
inc <- incident_edges(graph, V(graph)) Basically, inc will be a list that can be indexed with vertex indices and it would give you the IDs of the edges incident on a specific vertex. This is probably somewhat similar to your original approach but it might be faster because the indicent edges of a vertex are pre-computed so you can trade a call to incident() for an index lookup in the incidence list, which is likely to be faster. > I already come out a draft version of that, but I don't know how to test > it. My plan is to fork the igraph package to my local computer through > Github and then test it on my side so that it won't affect the original > package in case I make some mistake. Yes, that's the right thing to do. > The problem I encounter now is: how to > embed my code to the igraph package so that I can test the code. I'm not that familiar with the development of the R interface (I am mostly working on the C core and the Python interface), but I think that this file in the repository is meant to explain the process: https://github.com/igraph/rigraph/blob/dev/CONTRIBUTING.md Best, T. _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
