[BGL] Importing adjacency list from a txt file
Hi, I've got a file with the adjacency list of a graph, where each line contains the node index followed by the index of nodes that are adjacent to it (comma-separated). One of the lines of this file could read like: 1,3,4 This would mean that node '1' is adjacent to nodes '3' and '4' (undirected & unweighted graph). I'm declaring it as: typedef adjacency_list < vecS, vecS, undirectedS, no_property, no_property > Graph; Graph g; My question is: is there a simple way of reading the adjacency list into the graph from my txt file? I found Kevin_Bacon, but was looking for something more powerful. Then I found adjacency_list_io.cpp (is it documented?), but it wouldn't compile on MSVC. Am I missing something obvious? Thanks, Rui
On Aug 2, 2004, at 5:13 PM, Rui Carvalho wrote:
My question is: is there a simple way of reading the adjacency list into the graph from my txt file? I found Kevin_Bacon, but was looking for something more powerful. Then I found adjacency_list_io.cpp (is it documented?), but it wouldn't compile on MSVC.
Am I missing something obvious?
I don't believe we have a graph reader for that kind of format. adjacency_list_io hasn't been actively maintained, as far as I know. Doug
On Aug 2, 2004, at 5:13 PM, Rui Carvalho wrote:
My question is: is there a simple way of reading the adjacency list into the graph from my txt file? I found Kevin_Bacon, but was looking for something more
Then I found adjacency_list_io.cpp (is it documented?), but it wouldn't compile on MSVC.
Am I missing something obvious?
I don't believe we have a graph reader for that kind of
powerful. format.
adjacency_list_io hasn't been actively maintained, as far as I know.
Doug
Thanks for this. Adjacency_list_io seemed to provide simple ways of inputting graph data from txt files -does the new BGL ver have an alternative to it? Thanks, Rui
On Aug 3, 2004, at 4:28 AM, Rui Carvalho wrote:
Thanks for this. Adjacency_list_io seemed to provide simple ways of inputting graph data from txt files -does the new BGL ver have an alternative to it?
Not really. The only graph input that seems to get any use is the Graphviz parser, although even that could use an overhaul. I tend to write my own little graph parsers each time, because I find that everybody seems to write their own graph file formats anyway. Nevertheless, a newer Graphviz input/output module is on my TODO list, and will probably become more important for us soon (so that it might get done...). Doug
participants (2)
-
Doug Gregor
-
Rui Carvalho