I have 9 nodes and 20 transceivers. How can I have all possible distributions of transceivers between nodes ?

2 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 31 de Mayo de 2017
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()

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by