0

Please forgive me if I do not explain my question clearly in title. Here may I show you two pictures as my example:

enter image description here

enter image description here

my question is described as follows: I have 2 or more different objects(In the pictures, two objects: circle and cross), each one is placed repeatedly with a fixed row/column distance (In the pictures, the circle has a distance of 4 and cross has a distance of 2) into a grid.

In the first picture, each of the two objects are repeated correctly without any interruptions(here interruption means one object may occupy another one's position), but the arrangement in the first picture is ununiform distributed; on the contrary, in the second picture, the two objects may have interruptions (the circle object occupies cross objects' position) but the picture is uniformly distributed.

My target is to get the placement as uniform as possible (the objects are still placed with fixed distances but may allow some occupations). Is there a potential algorithm for this question? Or are there any similar questions?

I have some immature thinkings on this problem that: 1. occupation may relate to least common multiple; 2. how to define "uniformly distributed" mathematically? Maybe there's no genetic solution but is there a solution for some special cases? (for example, 3 objects with distance of multiple of 2, or multiple of 3?)

Lake_Lagunita
  • 521
  • 1
  • 4
  • 20
  • It appears that you have an optimisation problem with two objectives: maximising the "uniformity" and minimising the "interruptions". These objectives are somewhat opposite of each other. You'll need to decide how to aggregate them: for instance, use a weighted sum of the two measures, or put a budget constraint on one measure and maximise the other measure under that constraint, etc. – Stef Jan 04 '22 at 15:24
  • @Stef I think firstly, get the least common multiple of the objects' repeating distance, say, number n, then use this n to create a nxn square, then try to place the objects as uniform as possible. But I still can't figure out how to implement this placement. The only similar problem I can think about is OLED subpixel layouts like Pentile Diamond screen, but not exactly the same. – Lake_Lagunita Jan 04 '22 at 16:00

1 Answers1

0

Uniformity can be measured as sum of squared inverse distances(or distances to equilibrium distances). Because it has squared relation, any single piece that approaches others will have big fitness penalty in system so that the system will not tolerate too close piece and prefer a better distribution.

If you do not use squared (or higher orders) distance but simple distance, then system starts tolerating even overlapped pieces.

If you want to manually compute uniformity, then compute the standard deviation of distances. You'd say its perfect with 1 distance and 0 deviation but small enough deviation also acceptable.

I tested this only on a problem to fit 106 circles in a square thats 10x the size of circle.

enter image description here

huseyin tugrul buyukisik
  • 11,469
  • 4
  • 45
  • 97