[Top][All Lists]

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

[igraph] Reproducibly computing Kamada-Kawai layout?

From: Jan Kim
Subject: [igraph] Reproducibly computing Kamada-Kawai layout?
Date: Mon, 20 Jul 2015 10:33:32 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Dear All,

exploring the layout_kamada_kawai method of the igraph.Graph class in
Python, I can't seem to find a way to reproduce a layout. The graph is
always the same (to the extent I can visually tell), but the placement
of vertices is different each time.

I tried specifying the seed parameter as follows:

    s = []
    l = g.layout_kamada_kawai(seed = s)

but the layout is still different each time.

The best educated guess I have at this point is that the iterative
vertex placement by simulated annealing involves stochastic elements
in addition to the initial placement, but I can't seem to find any
way to locate the pseudorandom number generator used for such purposes,
so I could take control of it / its seed.

As the documentation on the seed parameter "If a matrix (list of lists),
uses the given matrix as the starting position" is not entirely unambiguous
to me, I also tried the transposed version of that generated above:

    s = []
    for i in xrange(len(g.vs)) :
      s.append([i, i])

but the layouts still differ each time.

Any suggestions / RTFMs welcome.

Best regards & thanks in advance, Jan
 +- Jan T. Kim -------------------------------------------------------+
 |             email: address@hidden                                |
 |             WWW:   http://www.jtkim.dreamhosters.com/              |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

reply via email to

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