[Lemon-user] Define order on edges

Drake Highfield drakehighfield at googlemail.com
Sun Mar 11 15:13:10 CET 2012


2012/3/6 Alpár Jüttner <alpar at cs.elte.hu>

> It's about "genericity". Remember, "directed graph" does not refer to a
> specific implementation in LEMON, but instead it is a "concept". A kind
> of common denominator which all graph implementations must meet in order
> that the algorithms can be run on them.
>
> Neither the standard (math) definition of graph refers to the order of
> the arcs nor the well-known algorithms rely on that.
> Thus it would be the quirk to restrict the all the graph implementation
> to iterate the arcs in a certain predefined order.
>
> If you need any extra feature, then you can always choose an
> implementation that provides it. It's again about genericity, and
> exactly the above design consideration is that makes it possible.
>

Oh, I didn't want to harm the genericity. I just wondered that there is no
"InOrderIterator" (interface) or something like that provided by LEMON. Of
course there is no reason for graph edges to be ordered in general. Maybe
my desire for such an iterator is not as natural as I thought first.
Suppose it's my quirky mind. ;-)


> For example, the order of listing outgoing arcs in ListGraph is a so
> natural consequence of the way it stores the arcs (multi-head double
> linked lists), that it will certainly not change in the future. You can
> safely rely on that.
>

So it would be a proper option to derive my own "OrderedEdgesListGraph"
from ListGraph with it's own "ordered edges iterators"?

Regards,
Drake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20120311/cd57ffa1/attachment.html>


More information about the Lemon-user mailing list