[Seqan-dev] getting vertex descriptors from graphs
- From: Mat <matthias.dodt@mdc-berlin.de>
- To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
- Date: Wed, 12 Jan 2011 14:26:40 +0100
- Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
- Subject: [Seqan-dev] getting vertex descriptors from graphs
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); } <<< |
- Follow-Ups:
- Re: [Seqan-dev] getting vertex descriptors from graphs
- From: "Weese, David" <weese@campus.fu-berlin.de>
- Re: [Seqan-dev] getting vertex descriptors from graphs
-
seqan-dev - January 2011 - Archives indexes sorted by:
[ thread ] [ subject ] [ author ] [ date ] - Complete archive of the seqan-dev mailing list
- More info on this list...