igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] random generator graph in C


From: Gábor Csárdi
Subject: Re: [igraph] random generator graph in C
Date: Tue, 10 Nov 2009 15:42:40 +0100

On Tue, Nov 10, 2009 at 2:02 PM, wassim gmail <address@hidden> wrote:
> Hi, i have used   the function :
>
>       igraph_minimum_spanning_tree_unweighted(igraph_t*, igraph_t*);
> to extract one minimal spanning tree from another graph. I have remark that
> the spanning begins always from node with identifier 0. Is there any way to
> change the root. I want to construct the minimal spanning tree from a random
> vertex (not the vertex 0).

Hi,

permute the vertices with the permute_vertices() function, calculate
the spanning tree, and permute them back. But don't think that this
way you can generate all spanning trees, in general you cannot. It is
not even sure that different root vertices will give you different
spanning trees, they might just all give the same.

> If not is there a possibility to modify the code source function responsable
> of generating the spanning tree ?

Feel free to modify it, if you like. igraph is free software, as long
as you don't distribute it, you can do whatever you want with it.

Gabor

> Thank you
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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