The following example uses my package, IGraph / M.

```
Needs("IGraphM`")
```

First, we generate random points to use as Voronoi centers. We apply some Lloyd relaxation steps to make them more distant.

```
pts = RandomReal({-1, 1}, {100, 2});
Do(
pts = PropertyValue({VoronoiMesh(pts, {{-1, 1}, {-1, 1}}), {2, All}}, MeshCellCentroid),
{2}
)
```

Here is our mesh, representing the cells:

```
mesh = VoronoiMesh(pts, {{-1, 1}, {-1, 1}},
MeshCellStyle -> {1 -> White})
```

We will simulate the diffusion between cells. For this, we need the Laplacian matrix (also called Kirchhoff matrix) from their neighborhood graph.

```
ag = IGMeshCellAdjacencyGraph(mesh, 2);
km = IGKirchhoffMatrix(ag)
```

IGraph / M provides `IGMeshCellAdjacencyGraph`

to construct the neighborhood graph of meshes of different dimensions, `IGMeshCellAdjacencyMatrix`

to build the corresponding adjacency matrix (faster), and `IGKirchhoffMatrix`

to get the Laplacian graph. There is more information about these functions in the package documentation (`IGDocumentation()`

).

Let's create random initial concentrations:

```
initC = RandomReal({0, 1}, MeshCellCount(mesh, 2));
```

Then solve the diffusion equation using `NDSolve`

:

```
diffConst = 1.0;
solfun = NDSolveValue({c'(t) == - diffConst * km.c(t), c(0) == initC}, c, {t, 0, 1})
```

We can animate the solution like this:

```
Animate(
SetProperty({mesh, {2, All}}, MeshCellStyle -> ColorData("Rainbow") /@ solfun(t)),{t, 0, 1}
)
```