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

采纳的回答

Walter Roberson
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 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by