In your sketch, all cell clusters are composed of 3 or more â€śsquaresâ€ť?

Will the individual cells remain squares and aligned grid-like like in your sketch or wildly change in size and proportion, making some or all polygons or rectangles?
The moving part is not really an issue, since â€śgrowingâ€ť clusters might be more appropriate here, meaning that you start from a cell and append appropriate, matching neighbours.

Sure, but you should make up your mind about what you want to do and establish some rules.

thank you for your reply. My apology for the late reply. In the meantime, I was trying some solutions.

Basically what I would like to achieve is something like this animation

Rectangles change size and proportion and they should be fully intersected.

In my script I can change input data (width, length of rectangles and points position). I set a condtion, when the two rectangles are not fully intersected, the solution is not created.

I will use this dynamic sizing for energy simulation and I would need to get always a solution (with fully intersected rectangles).

What does â€śfully intersectedâ€ť mean? Do two sides of one rectangle need to intersect exactly two of the other one? Is overlapping allowed and seen as â€śfullâ€ť intersection?

How do you want to change the state of the configuration? Do you want to play around with a single slider or get a certain number of possible permutations?

Iâ€™ve started with the creation of two rectangles. So far you can change their dimension, keeping the fixed area of each. Now I need to apply a rule to move them and change their position.

It doesnâ€™t matter if one or more sliders are used to get a certain number of permutations.

Hereâ€™s another way to do this a bit differently and potentially more economically.

Instead of two rectangles that have to completely intersect each other, thereâ€™s a central rectangle and 4 rectangles that get constructed on its edges.