How to obtain possible combinations of adjacent points with coordinates?

조회 수: 8 (최근 30일)
Manuel Matus
Manuel Matus 2023년 8월 17일
댓글: Walter Roberson 2023년 8월 25일
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
Manuel Matus
Manuel Matus 2023년 8월 24일
편집: Manuel Matus 2023년 8월 24일
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 2023년 8월 25일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by