Hi list.

I am using graph-tool to model an apical junctions network, based on the model by Farhadifar et al.. In short, it corresponds to the outer surface of the cells in a particular region of the embryo, where each cell is represented by a polygon. Topology of the network changes due to cell division and cell death.

The physical model involves the local minimization of an energy depending on the local geometry.

I got a working model, but the energy optimization is time consuming. I think that this is due to the way I compute the components of the vector formed by each edge of the graph, by iterating over the edges., eg:

for edge in graph.edges():
        v0, v1 = edge.source(), edge.target()
        deltax[edge] = x[v1] - x[v0]
        deltay[edge] = y[v1] - y[v0]

This is further complicated (to a little extent) by periodic conditions to the coordinate systems, and some other details, but I think this is the core issue.

I have the feeling I can do better, perhaps by using the adjacency matrix? This would be particularly interesting as the graph topology doesn't change for a given optimization.

Any advice is welcome, thanks!

Guillaume