[Lemon-user] Define order on edges

Alpár Jüttner alpar at cs.elte.hu
Mon Mar 5 07:07:53 CET 2012


On Sun, 2012-03-04 at 21:15 +0100, Drake Highfield wrote:
> Hi,
> 
> I wonder how to define an order on outgoing edges since LEMON
> iterators do not provide that functionality.
> Is there a better solution than mapping a node onto a std::vector of
> edges? :)

Not really.

The only thing guaranteed by the graph concept is that re-iterating
through the same items will provide the same order, assuming that the
graph was not modified in between.

Using ListDigraph and SmartDigraph, the adjacency iterators (OutArcIt,
InArcIt) lists the arcs in the opposite order as they were added.
SmartDigraph::NodeIt lists the nodes in the same order, while
ListDigraph::NodeIt does it oppositely. SmartDigraph::ArcIt lists the
arcs in the order of addition, while ListDigraph::ArcIt lists them in a
mixed order.

But all these are implementation details, there are no declared general
guaranties.

Regards,
Alpar

> 
> Regards,
> Drake
> _______________________________________________
> 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