[Lemon-user] Define order on edges
Alpár Jüttner
alpar at cs.elte.hu
Tue Mar 6 05:17:00 CET 2012
On Mon, 2012-03-05 at 23:18 +0100, Drake Highfield wrote:
> 2012/3/5 Alpár Jüttner <alpar at cs.elte.hu>
>
> Not really.
>
> That's a strange quirk (of a graph library)
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.
> - I will definitely not rely on implementation details.
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.
Regards,
Alpar
More information about the Lemon-user
mailing list