[Lemon-user] Convert ListDigraph into StaticDigraph

Kovács Péter kpeter at inf.elte.hu
Fri Aug 3 22:25:12 CEST 2012


Hi,

In LEMON, you can easily copy a digraph of any type (including e.g. 
graph adaptors) to a ListDigraph, SmartDigraph or StaticDigraph instance 
using the digraphCopy() function (or the DigraphCopy class). For more 
information and examples, see:
http://lemon.cs.elte.hu/pub/doc/1.2.3/a00107.html

 > The goal to achieve is to use the flexibility of ListDigraph (add and
 > remove graph elements) and later the efficiency of StaticDigraph.
 > Is this approach useful/efficient for large graphs?

The answer to this question really depends on your use case (e.g. the 
size of the graph, the number of delete operations called during the 
building of ListDigraph, the complexity of the operations that should be 
performed on the graph after it is built). In many cases, ListDigraph is 
almost as efficient as StaticDigraph, so copying it could cause larger 
overhead than using the ListDigraph representation. Unless you make sure 
that copying to StaticDigraph is really more efficient in your 
application, I suggest you to use ListDigraph.

Best regards,
Peter



On 2012.08.03. 19:26, bugi at gmx.info wrote:
> Hi LEMON users,
>
> basically the subject already says it all. Does LEMON has a function to
> create a StaticDigraph out of a ListDigraph?
> The goal to achieve is to use the flexibility of ListDigraph (add and
> remove graph elements) and later the efficiency of StaticDigraph.
> Is this approach useful/efficient for large graphs? My current
> workaround is to go through all arcs, and finally generate a
> StaticDigraph using "build(int n, ArcListIterator begin, ArcListIterator
> end)". How can I use "build(const Digraph& digraph, NodeRefMap& nodeRef,
> ArcRefMap& arcRef)" for my purpose?
>
> Thanks a lot!
> Best regards
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>




More information about the Lemon-user mailing list