Hi seqan-users! Anybody could give me a hint on the following problem? I created a directed graph and added some nodes. Each node has an additional datastructure (VertexProperty - node name and size...) which is linked to each node by a vertexMap. Now: Later on i would like to add some edges to my graph, so i need two VertexDescriptor's to add an edge. Is there a standard way to search a vertexMap's via VertexProperties and get the corresponding VertexDescriptor? One way would be to iterate on the vertexMap and look for a VertexProperty but this might be to slow... Thanks! >>> //EdgeProperty and VertexProperty store additional information... typedef Graph<Directed<EdgeProperty> > GraphType; GraphType *contigGraph = new GraphType(); typedef VertexDescriptor<GraphType>::Type TVertexDescriptor; typedef EdgeDescriptor<GraphType>::Type TEdgeDescriptor; typedef seqan::String<VertexProperty > TVertexProperty; TVertexProperty *vertexPropertyMap = new TVertexProperty(); TVertexDescriptor vertDesc1; ... for(unsigned int n=0;n<numberOfContigs;++n){ //get a vertex descriptor vertDesc1 = addVertex(*m_g); //create a vertex property VertexProperty vp1; vp1.contigId = n; vp1.length = length(fragStore.contigStore[n].seq); //store descriptor:vertexproperty seqan::resizeVertexMap(*m_g, *vertexMap); seqan::assignProperty(*vertexMap,vertDesc1,vp1); } <<< |