Effacer les filtres
Effacer les filtres

How to obtain possible combinations of adjacent points with coordinates?

3 vues (au cours des 30 derniers jours)
Manuel Matus
Manuel Matus le 17 Août 2023
Commenté : Walter Roberson le 25 Août 2023
Hi all,
I am trying to obtain all possible combinations of adjacent points in combinations of 2, 3, 4, 5,...n number.
Example, I have 9 points, and I would like to get all the possible combinations shown below:
If I do it with the combination function, I will get combinations that will not work for me, therefore a lot of noise will be introduced into my analysis. Also, the points are not always aligned and most of the time they look something like this:
I do have all the x and y coordinates of each point. Anyone can give me a hand on this please??
Thank you in advance!
  3 commentaires
Manuel Matus
Manuel Matus le 24 Août 2023
Modifié(e) : Manuel Matus le 24 Août 2023
Thanks for your reply!
There are cases in which the tributary areas of each point are rectangular cells, but some others become like cells diagonally connected. Both are correct.
We have the X and Y coordinates of each point (always located within each cell - see figure below). We do not have the coordinates of the boundaries (I am using VORONOI matlab function to create the tributary areas of the points - cells). The only rule to estimate the boundaries between two points is the midpoint between them.
In regards to the "rows" and "columns" not being well defined for this situation, I showed it to more or less give a simpler example of what the main point is when finding possible combinations. In addition, there might be times in which the placement of points end upt with rectangular cells next to each other, as shown below. Again, here the main point is to find combinations, lets say 2, 3, 4 until a single combination covers all 24 points.
Example :
combinations of 2:
1 2 ; 2 3 ; 3 4 ; 5 6 ; . . . ; 23 34 ; 1 5 ; 5 9 ; ..... ; 20 24
combinations of 4:
1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16 ; 17 18 19 20 ; 21 22 23 24 ;
1 5 9 13 ; 5 9 13 17 ; 9 13 17 21 ; ..... ; 12 16 20 24 ;
1 2 5 6 ; 2 3 6 7 ; 3 4 7 8 ; ..... ; 19 20 23 24.
Walter Roberson
Walter Roberson le 25 Août 2023
It is not obvious why 1 2 6 10 would be excluded? In the case of purely rectangular boundaries would could guess about that... but especially as soon as you introduce diagonal connections as being permitted sometimes, then the rules become very unclear.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by