I have 9 nodes and 20 transceivers. How can I have all possible distributions of transceivers between nodes ?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Mahmoud Ahmed
 el 31 de Mayo de 2017
  
    
    
    
    
    Respondida: Walter Roberson
      
      
 el 31 de Mayo de 2017
            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 comentario
  Walter Roberson
      
      
 el 31 de Mayo de 2017
				See https://www.mathworks.com/matlabcentral/answers/327941-row-column-summation-constraints-in-random-binary-matrix#answer_257192 for the random distribution case
Respuesta aceptada
  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()
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!