[erlang-questions] how to get labels on digraphs

Rustom Mody rustompmody@REDACTED
Sat Jan 19 04:54:23 CET 2013


On Fri, Jan 18, 2013 at 11:39 PM, Aggelos Giantsios <aggelgian@REDACTED>wrote:

> On Fri, Jan 18, 2013 at 7:36 PM, Rustom Mody <rustompmody@REDACTED>wrote:
>
>> The add_edge/4 routine in digraph claims to have labels that are
>> arbitrary erlang terms.
>> However nothing I do seems to show me the label I created the edge with.
>>
>
> Hello!!
>
> You can retrieve the label information of edge E in a digraph G with the
> function digraph:edge(G, E).
>
> Here's the output of my interpreter (R15B03)
>
> 1> G = digraph:new().
> {digraph,16400,20497,24594,true}
> 2> digraph:add_vertex(G, v1).
> v1
> 3> digraph:add_vertex(G, v2).
> v2
> 4> digraph:add_edge(G, e1, v1, v2, my_label).
> e1
> 5> digraph:edge(G, e1).
> {e1,v1,v2,my_label}
>
> I hope that helps!
>
> Aggelos
>

Thanks Aggelos -- kept doing 'edges' and seeing nothing.
In fact I think I tried edge as well – must have been something else the
matter…
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130119/16d452ae/attachment.htm>


More information about the erlang-questions mailing list