[Lemon-user] SubDigraph and ListDigraph

Alpár Jüttner alpar at cs.elte.hu
Thu Oct 27 09:32:15 CEST 2011


On Wed, 2011-10-26 at 05:48 -0700, Todorov, Vladimir wrote:

> I didn't want to resort to making all graphs subgraphs.

The only clear drawback of this is a somewhat increased running time.
Even then, it is still faster than it would be using a virtual function
API.

Anyway, I am yet to understand why you cannot use templates to resolve
your problem.

>  I tried copying
> the SubDigraph into a ListDigraph. All I can say is that it copies it,
> but it jumbles up the id's of the nodes

Yes, this is the intended behavior. E.g. when you remove a bunch of
nodes and arcs from a graph, there will be big "holes" in the data
structures. When you copy the graph, you probably want to get rid of
them. In addition, in case of many graph structures, the ids are always
contiguous. Thus it is impossible to copy to this graphs while keeping
the ids. 

>  and renders the copy unusable.

You can create references (and cross references) between the ids in the
source and target graphs, see 
http://lemon.cs.elte.hu/pub/doc/1.2.2/a00544.html#ga59011124e7760c273e82d6029313943c
and
http://lemon.cs.elte.hu/pub/doc/1.2.2/a00107.html#a0e00a8bc6e29761785543e0a7c95e05b


> It is too bad that the subgraph feature is highly unusable.

It's a bit strong to say.

Subgraph serves pretty well the purpose it is designed for. If you feel
otherwise, you probably try to use it either for a wrong purpose, or in
a wrong way.

If you tell some more details on your original task you want to solve,
we will be happy to give advise on the optimal way of implementing it
with LEMON.

All the best,
Alpar





More information about the Lemon-user mailing list