[erlang-questions] How to access digraph vertices

Torben Hoffmann torben.hoffmann@REDACTED
Tue Jun 3 08:28:09 CEST 2014


Hi Lloyd,
Lloyd R. Prentice writes:

> Hello,
>
> The documentation for digraphs tells us that vertices can be any Erlang term.
>
> How would we retrieve a vertex expressed as a record? E.g., by key. Surely we
> wouldn't want to use or even know the whole record. 
>
Not quite sure what it is you are trying to do here, maybe an example would help us
(or just me) understand what you are up to.

Even though vertex() is term() I would not push a record into the vertex. I would
push the key in as the vertex() type and let the record be the label of the vertex.

But, again, it highly depends on what the use case is... hint, hint!!
Might be that digraph is not the right way to solve your problem.

Cheers,
Torben

> Many thanks,,
>
> LRP
>
> Sent from my iPad
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions


-- 
Torben Hoffmann
CTO
Erlang Solutions Ltd.
Tel: +45 25 14 05 38
http://www.erlang-solutions.com



More information about the erlang-questions mailing list