Boost logo

Boost Users :

From: Rui Carvalho (rui.carvalho_at_[hidden])
Date: 2004-08-02 17:13:46


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:


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?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at