[Lemon-user] Node/Arc Validity
Todorov, Vladimir
vladimir.todorov at intel.com
Tue Oct 4 10:40:22 CEST 2011
Hi Peter,
Even if I create a wrapper, when I use the NodeMaps, I have to get rid of it. Is there a way to set the minimal node ID of a graph? Then I can say that all nodes with id greater than X are from G2 and the rest come from G1. I thought of solving the problem by using a map container with <ListDigraph::Node*, bool> but I came to the conclusion that the lemon maps may not store a reference to the original Node object and, thus, mapping the pointer is of completely no use. Is this the case?
Regards,
Vladimir
-----Original Message-----
From: Kovács Péter [mailto:kpeter at inf.elte.hu]
Sent: Thursday, September 29, 2011 10:04 PM
To: Todorov, Vladimir
Cc: lemon-user at lemon.cs.elte.hu
Subject: Re: [Lemon-user] Node/Arc Validity
Hi Vladimir,
For efficiency reasons, node and arc objects do not contain references
to the graph. Actually, Node and Arc classes are simply wrapper classes
containing a single int value (index). The valid() function checks for a
node if its index is valid in the graph. If you create e.g. two
ListDigraph and add a node to each graph, the two Node objects will be
equal. You cannot differentiate between them, so there is no such
function you are looking for in LEMON.
If you really need this feature, you could e.g. define a wrapper class
containing a Node and a reference to the graph object that contains the
node.
Regards,
Peter
On 2011.09.29. 13:19, Todorov, Vladimir wrote:
> Hi,
>
> I have a problem using lemon. I use the method valid() to check whether
> a node/arc belongs to a graph. The problem is that when I have two
> graphs G1 and G2 and check if a node N from G1 is valid in G2 it returns
> true… This must not be the case. If there is another method for checking
> the affiliation of a node I would be happy to know it.
>
> Regards,
>
> Vladimir
>
More information about the Lemon-user
mailing list