Benes (Fat Tree) Network for number of inputs/outputs that is not 2^n
Wasting ports to achieve an exact number of terminals is a common attribute of staged networks (butterfly, benes, folded-clos, etc.). The mesh, torus, and flattened butterfly topologies are a bit better because each dimension can have a different width, but this results in having uneven bisection bandwidth along each dimensional cut. The HyperX topology is a generalization of the flattened butterfly that allows each dimension to be configured independently in terms of width and weight (number of links connecting each pair of routers). The paper describes an algorithm to find the "optimal" configuration given a requirement for system size, bisection bandwidth, and router radix. An implementation of this algorithm is here. Given the requirements, it finds a satisfactory topology configuration that minimize cost (like wasted ports).