I have 9 nodes and 20 transceivers. How can I have all possible distributions of transceivers between nodes ?
2 次查看(过去 30 天)
显示 更早的评论
I have 9 nodes and 26 transceivers. How can I have all possible distributions of transceivers between nodes ? Hint: The maximum number of transceivers at any node = 3 The minimum number of transceivers at any node = 1
1 个评论
Walter Roberson
2017-5-31
See https://www.mathworks.com/matlabcentral/answers/327941-row-column-summation-constraints-in-random-binary-matrix#answer_257192 for the random distribution case
采纳的回答
Walter Roberson
2017-5-31
This is the Integer Partition Problem.
Because you have a minimum of one transceiver at any node, and 9 nodes, create 9 bins with initial value 1, and reduce the total 20 by 9*1 to get 11. You now have the problem of integer partition of 11 elements across 9 bins with a maximum of 2 to be added to any one bin.
There are various ways to program that partitioning. There are some suitable File Exchange Contributions, including https://www.mathworks.com/matlabcentral/fileexchange/12009-partitions-of-an-integer . There are other ways that might perhaps be less efficient but are easy to program, including making use of dec2base()
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!