[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] How to get all component in distance 2 from the specific compoe
From: |
Chang Jin Shin |
Subject: |
[igraph] How to get all component in distance 2 from the specific compoent |
Date: |
Mon, 23 Mar 2009 09:06:25 +1000 |
Hi!
I have an undirected graph as follow.
1 - 2
1 - 5
1 - 7
2 - 3
3 - 4
5 - 6
>From this graph, I want to collect all vertices and edges in distance 2
from 'vertex 1'
SO, I want obtain
1) List of vertices in distance 1 from vertex 1
Here it's going to be: 2,5,7
2) List of vertices in distance 2 from vertex 1
Here it looks like: 3, 6
3) List of edges in distance 1 and 2 from vertext 1
1 - 2
1 - 5
1 - 7
2 - 3
5 - 6
For this, I was thinking 'subgraph' works. HOWEVER, my shortage of
knowledge in Igraph, it does not work properily to me.
Would you advise to me?
Cheers,
- [igraph] How to get all component in distance 2 from the specific compoent,
Chang Jin Shin <=