简体   繁体   中英

Array Fill w/Grouping

This is one of those, " I wish I had listened better, retained more of my math class info..", questions. I did this with brute force, but I know there's a better more correct way of accomplishing this.

Given a 4 x 4 array of stations, and 8 groups(ah). How to fill the array with group pair combinations so each pair(ab, ba) occurs only once, and each group occurs only once in each row and column? (If a is part of a pair in 1,1, it can no long appear in a grouping in row 1 or column 1)

Of course not all possible groupings happen.

是的,我认为蛮力是要走的路,尽管您可以根据需要更明智地投资于修剪分支机构。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM