igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Getting the vertices associated to an edge


From: Gábor Csárdi
Subject: Re: [igraph] Getting the vertices associated to an edge
Date: Tue, 30 Jun 2015 14:52:17 +0200

I guess something like

ends(E(g)[ label == value ])[1]

Would do it. There is also head_of and tail_of but they are mixed up in the current version. :(
Gabor

On Tue, Jun 30, 2015 at 12:09 AM, Matt <address@hidden> wrote:
Hi Gabor,

Thank you very much for your prompt answer.

What can I do in case I need to get the first vertex of a specific
edge, depending on a label that I set for that edge?
For example I have a graph g whose edges have a label, "label" and I
want to select the first vertex of all these edges.

For selecting the edge I can use the following:

edges = E(g)[which(E(g)$label == value)]

But afterwords? How can I get the first vertex too?

Thank you again.

Best Regards.

Matt

On Mon, Jun 29, 2015 at 7:49 PM, Gábor Csárdi <address@hidden> wrote:
> Hi Matt. In the new version it is called ends(). G.
>
> library(igraph)
> g <- make_ring(10)
>
> ends(g, 1)
> #>      [,1] [,2]
> #> [1,]    1    2
>
> ends(g, 3)
> #>      [,1] [,2]
> #> [1,]    3    4
>
>
>
> On Mon, Jun 29, 2015 at 7:30 PM, Matt <address@hidden> wrote:
>>
>> Dear All,
>>
>> If I have an edges, is there a way to get its vertices?
>>
>> Thank you very much.
>>
>> Best regards.
>>
>> Matt
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]