I am currently working with graph_tool to analyse text documents. let's say
that in my graph each vertex is a word that appears in the text and each
edge corresponds to a relationship between two words. Because of the fact
that vertex is individuated only by its index i suppose to use a vertex
property map (let's call it 'name', of type 'string') to put the word
related to the vertex, assuring a bijective property of the "word <-> vertex
Intuitively i'd like to do something like idx = g.vertex("example").
I cannot see how to implement it with the PropertyMaps because i can only
have the function "vertex index -> word".
I cannot keep the "word -> vertex index" elsewhere because remove_vertex()
is changing my indexes under my feet.
Does anybody of you have a suggestion?
Thank you very much,
I'm going on with my algorithms and i'm stuck on a thing: I cannot
find the interface on graph_tool to access the adjacency matrix of the
The rationale behind my request is that i have a graph and i have a
matrix based algorithm to calculate new edges and new weights. So I'd
(1) create a graph through the usual API
(2) get its adjacency matrix
(3) modify it with my matrix operations based algorithm
(4) feed it back to the graph / create a new graph from the matrix
What is your suggestion to do this in graph_tool?