igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Shortest path matrix


From: Gábor Csárdi
Subject: Re: [igraph] Shortest path matrix
Date: Sun, 5 Jul 2015 15:37:17 +0200

Yes, create a matrix from a list, and then put the igraph results in it. R matrices can be lists, eg.

a <- list(1:3, 1:3, 3:1, 3:1)
matrix(a, 2, 2)

Gabor

On Sun, Jul 5, 2015 at 3:34 PM, seema aswani <address@hidden> wrote:
Hi gabor,
Thank you for response.
I have worked with it but it is just giving a vector. But i want  i want the matrix which display the shortest path sequences. Like if there are two nodes A and B and the shortest path between them is A C B. Then i want the matrix of displaying shortest path as a single matrix element with A C B. Is there any way to do this..??

On Sun, Jul 5, 2015 at 6:57 PM, Gábor Csárdi <address@hidden> wrote:
You can convert an igraph.vs to vertex names with `as_ids`, and vertex ids with `as.vector`.

Gabor

On Sun, Jul 5, 2015 at 3:22 PM, seema aswani <address@hidden> wrote:
Hi ,
Thanks for the response.
I don't want the matrix of shortest path lengths i want the matrix which display the shortest path sequences. Like if there are two nodes A and B and the shortest path between them is A C B. Then i want the matrix of displaying shortest path as a single matrix element with A C B. Is there any way to do this..??

On Sun, Jul 5, 2015 at 6:45 PM, Chris Watson <address@hidden> wrote:
Are you using the 'shortest.paths' function? It returns a matrix

On Sun, Jul 5, 2015 at 7:25 AM, seema aswani <address@hidden> wrote:
Hi , 
I am using igraph package for finding shortest paths between two nodes of graph. As my dataset is having biological information about Protein Protein Interaction. The names are of type string and those are the names of proteins. I have names of 11 proteins and i found the shortest path between all those 11 proteins pairwise. As a result of for loop i am getting the list of shortest paths and the vertex sequences as a class igraph.vs. I want to display this result in matrix of 11*11. How can i do this ?? Can any one help ??

Thanks

_______________________________________________
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



_______________________________________________
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]