[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [igraph] spanningtree
From: |
Harun Pirim |
Subject: |
RE: [igraph] spanningtree |
Date: |
Mon, 8 Mar 2010 12:47:36 -0600 |
Thank you Tamas for your quick response but I couldn't find a function in R
called graph.bfs(), do you mean I should define this function using shortest
paths?
Harun
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Tamas Nepusz
Sent: Monday, March 08, 2010 5:20 AM
To: Help for igraph users
Subject: Re: [igraph] spanningtree
> Is there a way to find spanning trees with the flexibility of
> choosing the source vertex and is there a way to run BFS or DFS to
> end up with a spanning tree?
I assume that you are interested in an arbitrary spanning tree only and
not all of them (or those that satisfy some criterion). In this case,
calculating all the shortest paths from a given source vertex to all
others will give you a spanning tree if the graph is connected. If you
are using R, try graph.bfs() and set the "father" argument to TRUE. The
result vector will contain a $father component that gives you the
"parent" of each vertex in the BFS tree. Connecting each vertex with its
parent will give you a spanning tree.
--
Tamas
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
- [igraph] i can't find it, but there must be an easy was to reduce a graph, Yannick Rochat, 2010/03/06
- Re: [igraph] i can't find it, but there must be an easy was to reduce a graph, harun pirim, 2010/03/06
- Re: [igraph] i can't find it, but there must be an easy was to reduce a graph, Yannick Rochat, 2010/03/07
- Re: [igraph] i can't find it, but there must be an easy was to reduce a graph, Tamas Nepusz, 2010/03/07
- Re: [igraph] i can't find it, but there must be an easy was to reduce a graph, Yannick Rochat, 2010/03/07
- [igraph] spanningtree, harun pirim, 2010/03/07
- Re: [igraph] spanningtree, Tamas Nepusz, 2010/03/08
- RE: [igraph] spanningtree, Harun Pirim, 2010/03/08
- RE: [igraph] spanningtree,
Harun Pirim <=
- Re: [igraph] spanningtree, Gábor Csárdi, 2010/03/08
- RE: [igraph] spanningtree, Harun Pirim, 2010/03/08
- Re: [igraph] spanningtree, Gábor Csárdi, 2010/03/08
- RE: [igraph] spanningtree, Harun Pirim, 2010/03/08
- Re: [igraph] spanningtree, Gábor Csárdi, 2010/03/09