![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
quetzal::geography::landscape
into a quetzal::geography::graph
.The challenge of replicating a demographic process within a discrete landscape can be framed as a process on a spatial graph. In this graph, the vertices represent the cells of the landscape grid, while the edges link the areas where migration occurs.
The quantity of edges in this graph significantly influences both complexity and performance. For instance, in a landscape containing \(n\) cells, considering migration between any two arbitrary locations would result in a complete graph with \(\frac{n(n-1)}{2}\) edges, which could pose computational difficulties. A number of alternative assumptions can be made to control the computational feasibility.
All these choices are independently represented in the code and can be extended (although that may require some efforts).
Constructing a spatial graph first requires to account for the modality of dispersal between the vertices (locations) of the graph. That is, from one source vertex, define which vertices can be targeted: this is the concept of vicinity, or neighborhood.
We distinguish at least 3 modalities:
connect_4_neighbors
: each cell of the landscape grid is connected only to its cardinal neighbors (N, E, S, W).connect_8_neighbors
: each cell of the landscape grid is connected only to its cardinal (N, E, S, W) and intercardinal (NE, SE, SW, NW) neighbors.connect_fully
: each cell of the landscape grid is connected to all others: the graph is complete.Similarly, assumptions we make about the model's behavior at the bounds of the finite landscape influence the connectivity of the graph. We distinguish at least three bounding modalities:
mirror
: cells at the borders of the landscape are connected to their neighbors, without any further modification. In this case the individuals moving between cells will be reflected into the landscape.sink
: cells at the borders of the landscape will be connected to a sink vertex: individuals that migrate past the boundaries of the landscape escape into the world and never come back.torus
: the 2D landscape becomes a 3D torus world, as vertices on opposite borders are linked to their symmetric vertex: individuals that cross the Northern (resp. Western) border reappear on the Southern (resp. Eastern) border.Finally, a last assumption we make about the population process that impacts the graph representation is the directionality of the process:
isotropy
: the migration process is independent of the direction of movement. Moving from vertex \(u\) to \(v\) follows the same rules as moving from \(v\) to \(u\): the edge \(( u,v)\) is the same as \((v,u)\).anisotropy
migration will distinguish between \(( u,v)\) and \((v,u)\), doubling the number of edges in the graph.Input
Output