1 Introduction

Trusses are widely used in countless projects worldwide. Due to the geometric complexity of truss structures, conventional design approaches are not only labour intensive but can also lead to inefficient designs. As an automatic design technique, the truss layout optimization approach is long-established. However, this approaches typically focus on identifying structures with lowest material consumption. Consequently, the optimized structures usually contain many structural members, each with different values of cross-sectional area and length, resulting in high manufacturing costs. Whilst the development of additive manufacturing (AM) techniques alleviates the manufacturing cost issue in small-scale projects (e.g., mechanical components), the applications of AM in large-scale projects (e.g., roofs and bridges) are limited. Therefore, this study aims to develop an approach to reduce the manufacturing costs of the optimized truss structures by controlling the number of member-types.

The classical layout optimization approach was pioneered by Dorn et al. (1964). Although the linear formulation of Dorn et al. (1964) guaranteed globally optimal solutions, this approach was numerically inefficient in large-scale problems and the optimized structures were usually complex. In recent decades, Gilbert and Tyas (2003) developed a member-adding approach that can significantly reduce computational costs without sacrificing solution optimality. He and Gilbert (2015) developed a geometry optimization approach that can rationalize the optimized truss structures. Therefore, state-of-art layout optimization can be used in the conceptual design of various projects, and examples are available in He et al. (2022). Recently, educational python codes were published in He et al. (2019b).

Previously, two categories of approaches have been considered to reduce manufacturing costs of optimized truss structures. The first category focused on reducing the number of members and nodes of the optimized structures. To achieve the targets, most studies in this category added integer variables to the optimization problem, which caused high computational costs. Therefore, different approaches have been proposed to address the numerical efficiency issue. For example, Asadpoure et al. (2015) and Torii et al. (2016) used step functions such as the Heaviside function to transform the continuous area values into integer values so that integer variables are avoided. Fairclough and Gilbert (2020) used runtime-generated constraints to speed up the integer programming solver.

The second category focused on designing structures consisting of members selected from given section lists. For example, Achtziger and Stolpe (2007, 2009) used discrete cross-sectional area variables in conjunction with the ground structure approach to obtain a series of 2D global optimal solutions. Later, similar problems were investigated by Kanno and Guo (2010) with considerations on load uncertainties added and by Mela (2014) with buckling constraints added. Ohsaki (2016) also considered the truss optimization problem with discrete area variables and treated the nodal positions as additional variables to achieve more efficient solutions. Besides the above studies based on the traditional layout optimization approach, many meta-heuristic-based studies also focused on the same topic, and a review can be found in Stolpe (2016). Meta-heuristic approaches are popular because of their versatility. However, their computational costs in large-scale problems are high, and therefore many studies fall into the category “size optimization” instead of “layout optimization” (Sigmund 2011). These studies in the second category are useful in designing structures with members selected from industrial manufacturers’ section lists. Nevertheless, with the development of AM techniques, manufacturing members with customized sizes has become easier since arbitrary-shaped moulds can be additively manufactured (Kang et al. 2018). In light of this, more efficient solutions can be identified by relaxing the requirement that the sections must be selected from the given lists. Therefore, the current study investigates truss optimization with limited types of members used, but the area/length values for each member-type are determined by the optimization process.

To achieve the target, we combine the truss optimization with the k-means clustering approach, which aims to partition n elements into k clusters in which each element belongs to the cluster with the nearest mean. A traditional k-means clustering algorithm was available in Hartigan and Wong (1979). Recently, on the 1D k-means clustering problem, Wang and Song (2011) developed an algorithm that can guarantee global optimality. In continuum topology optimization, the k-means clustering approach was used to design modular structures in lattice or microstructure optimization problems. Qiu et al. (2021) considered modular structure design in topology optimization. By performing the k-means clustering based on the elemental principal stress directions, the design domain can be divided into several subregions, and then the modular structures within each subregion can be further determined. Besides the topology optimization area, the k-means clustering approach was also used with the structural form-finding approaches. Similar to the target of the current study, Brütting et al. (2021) utilized the k-means clustering approach to design structures comprising a limited number of different types of members and joints. However, this study focused on the geometrical properties, and the structural performance was not considered. Yu et al. (2022) combined the k-means clustering approach with the truss form-finding approach. By designing the structure with reference to the principal stress lines selected using the clustering approach, the geometric pattern can be controlled and the structural performance can be improved. In the computational graphics area, Lee et al. (2022) focused on the sphere meshing problem. By firstly clustering the mesh elements based on the elemental area and further carrying out a geometry optimization, a sphere can be divided into spherical pentagons of equal area. Previous studies have used the k-means clustering approach to design structures with limited types of modules or members. However, this approach was rarely used in conjunction with the traditional layout optimization approach.

Therefore, in this study, we combine the k-means clustering approach with the truss layout optimization approach to design structures formed by limited types of members. On this topic, two different problems are considered. In the first problem, members of the same type share the same cross-sectional area (i.e. section-type problem). In the second problem, members of the same type share the same cross-sectional area and length (i.e., member-type problem). To avoid using integer variables that cause high computational costs, we consider the member-type constraints in the post-processing step only and use optimized structures from the traditional layout and geometry optimization as starting points. A few 2D and 3D examples demonstrate the effectiveness of the proposed approach. The rest of the paper is arranged as follows: Sect. 2 reviews the traditional layout and geometry optimization and then introduces the new post-processing approach; Sect. 3 presents a few 2D and 3D examples; Sect. 4 includes some relevant discussions, and the summary is in Sect. 5.

2 Formulation

2.1 Review of the traditional layout and geometry optimization

Since layout optimization is used in this study, it is firstly reviewed in this section. The standard process involves three steps, as shown in Fig. 1a–c. Firstly, the design domain, load and support conditions are specified (Fig. 1a); secondly, nodes are generated inside the design domain and potential members are created by interconnecting these nodes, forming a “ground structure” (Fig. 1b); finally, the optimal layout is identified by solving the underlying optimization problem (Fig. 1c). The basic 2D rigid-plastic layout optimization formulation can be written as follows:

$$\begin{aligned} \min _{{\textbf{a}}, \textbf{q}} \quad&V=\textbf{l}^\textrm{T}\textbf{a}\end{aligned}$$
(1a)
$$\begin{aligned} \text {s.t.}\quad&\textbf{B}\textbf{q}=\textbf{f} \end{aligned}$$
(1b)
$$\begin{aligned}&-\sigma _c\textbf{a}\le \textbf{q} \le \sigma _t\textbf{a} \end{aligned}$$
(1c)
$$\begin{aligned}&\textbf{a}\ge 0, \end{aligned}$$
(1d)
Fig. 1
figure 1

Four steps of the layout optimization approach (He et al. 2019a): a discretizing the design domain into a node grid; b building the ground structure which includes every possible interconnections between the nodes; c using the layout optimization formulation to select the optimal subset structure from the ground structure; d using geometry optimization to further rationalize the structure; red and blue bars represent members take tension and compression forces, respectively

where V represents total structure volume; \(\textbf{l} =[l_1,\ldots, l_m]^\textrm{T}\) is the length vector of the structural members with m denoting the number of members; \(\textbf{a} = [a_1, a_2,\ldots, a_m]^\textrm{T}\) is a vector containing the member cross-sectional areas; \(\textbf{q} = [q_{1}, q_{2},\ldots, q_{m}]^\textrm{T}\) is a vector containing the internal member forces; \(\textbf{f} = [f_{1x}, f_{1y}, f_{2x}, f_{2y},\ldots, f_{nx}, f_{ny}]^\textrm{T}\) is the vector containing the external forces, with n denoting the number of nodes. Also, \(\sigma _t\) and \(\sigma _c\) are limiting tensile and compressive stresses, respectively. \(\textbf{B}\) is a \(2n \times m\) equilibrium matrix consisting of direction cosines.

Problem (1) is a linear programming problem which can be solved efficiently by interior point solvers such as MOSEK (2019).

In practice, the structure obtained by solving Problem (1) may contain many members having non-zero areas, leading to complex truss layouts. To address this problem, geometry optimization can be used as a post-processing rationalization step (e.g., Fig. 1d). In the geometry optimization, the nodal positions are treated as additional variables:

$$\begin{aligned} \min _{\textbf{a}, \textbf{q}, \textbf{x}, \textbf{y}} \quad&V=\textbf{l}(\textbf{x}, \textbf{y})^\textrm{T}\textbf{a}\end{aligned}$$
(2a)
$$\begin{aligned} \text {s.t.}\quad&\textbf{B}(\textbf{x}, \textbf{y})\textbf{q}=\textbf{f} \end{aligned}$$
(2b)
$$\begin{aligned}&-\sigma _c\textbf{a}\le \textbf{q} \le \sigma _t\textbf{a}\end{aligned}$$
(2c)
$$\begin{aligned}&\textbf{a}\ge 0, \end{aligned}$$
(2d)

where \(\textbf{x} = [x_1, x_2,\ldots, x_n]^\textrm{T}\) and \(\textbf{y} = [y_1, y_2,\ldots, y_n]^\textrm{T}\) are vectors of nodal x- and y-coordinates with n denoting the number of nodes.

With the node positions added as variables, the optimization problem becomes non-convex and non-linear. Therefore, the non-linear interior point solver IPOPT (Wächter and Biegler 2006) is used. Geometry operations such as merging close nodes and creating crossovers are carried out in between the iterations. More details about the geometry optimization approach can be found in He and Gilbert (2015).

2.2 Truss optimization with limited types of members

The layout and geometry optimization approaches can obtain efficient and rationalized structures. However, the manufacturing costs are high because each member has its unique cross-sectional area and member length. To address this problem, we target to design a structure formed by limited types of members. The manufacturing costs can be significantly reduced if members in the same group share the same area and length. Nevertheless, in projects such as timber structures, the costs of member cutting are relatively low. In these situations, more effective structures can be obtained by relaxing the type requirement on the member length. Therefore, we consider two types of problems: the section-type problem (i.e., members of the same type have the same cross-sectional area) and the member-type problem (i.e., members of the same type have the same cross-sectional area and length).

2.2.1 Approach for the section-type problem

We propose a novel two-step post-processing approach to obtain optimized designs that are formed by a limited number of section types. The optimized structures from the traditional layout and geometry optimization (i.e., Problems (1) and (2)) are used as the starting points. Then in the first step, the k-means clustering approach is used to separate the members into clusters based on the cross-sectional areas:

$$\begin{aligned} \underset{\mathbb {S}}{\textrm{argmin}} \sum _{\eta \in \mathbb {C}}\Vert \textbf{a}_\eta - \mu _\eta \textbf{e}\Vert ^2, \end{aligned}$$
(3)

where \(\mathbb {C}= \{1, 2,\ldots,\eta ,\ldots, k\}\) is the cluster index set with k denoting the cluster number and \(\eta\) denoting the cluster index; \(\mu _\eta\) is the area mean value for the \(\eta\)-th cluster; \(\textbf{a}_\eta\) =\([a_i |\forall i\in \mathbb {S}_\eta ]^\textrm{T}\) is the area vector of the \(\eta\)-th cluster; \(\textbf{e}=[1, 1,\ldots]^\textrm{T}\) is an all-one vector with proper length; \(\mathbb {S}_\eta\) is the member index set for the \(\eta\)-th cluster and \(\mathbb {S} = \{\mathbb {S}_1, \mathbb {S}_2,\ldots, \mathbb {S}_\eta ,\ldots, \mathbb {S}_k\}\) is the total cluster set.

Since Problem (3) is a 1D clustering problem, we use the algorithm proposed by Wang and Song (2011), which can guarantee the global optimality of the clustering solution.

After the clustering step, the area deviation \(D_{\text {A}, i}\) of the i-th member can be evaluated by:

$$\begin{aligned} D_{\text {A}, i} = |a_i - \mu _{f(i)}|, \end{aligned}$$
(4)

where \(f:\mathbb {M} \mapsto \mathbb {C}\) is a mapping between the member index set \(\mathbb {M}\) and the cluster index set \(\mathbb {C}\).

In order to satisfy the member-type constraints on the area values, the area deviations \(D_{\text {A}}\) need to be close to zero. To achieve that, in the second step, we do further geometry optimization, with \(D_{\text {A}}\) penalized in the objective function:

$$\begin{aligned} \min _{\textbf{a}, \textbf{q}, \textbf{x}, \textbf{y}} \quad \overline{V} = \frac{w\,\textbf{l}(\textbf{x}, \textbf{y})^\textrm{T}\textbf{a}}{V_0} + \frac{(1-w)p\,\textbf{D}_\text {A}^\textrm{T}\textbf{e}}{D_{\text {A, 0}}}, \end{aligned}$$
(5)

where \(\overline{V}\) is the penalized and normalized volume; w is a pre-defined weighting factor to balance the reduction of structural volume and the reduction of area deviations and \(0\le w \le 1\); p is a penalty factor; here \(p=10\) is used; the volume and the area deviation penalty terms are normalized by \(V_0\) and \(D_{\text {A, 0}}\), which are the volume and the sum of the area deviations of the starting point structure, respectively; \(\textbf{D}_\text {A} = [D_{\text {A}, 1}, D_{\text {A}, 2},\ldots, D_{\text {A}, m}]^\textrm{T}\) is the area deviation vector.

By combining (2), (4) and (5), the post-processing optimization problem is:

$$\begin{aligned} \min _{\textbf{a}, \textbf{q}, \textbf{x}, \textbf{y}, \varvec{\mu }}&\quad \overline{V} = \frac{w\,\textbf{l}(\textbf{x}, \textbf{y})^\textrm{T}\textbf{a}}{V_0} + \frac{(1-w)p\,\textbf{D}_\text {A}^\textrm{T}\textbf{e}}{D_{\text {A, 0}}}\end{aligned}$$
(6a)
$$\begin{aligned} \text {s.t.}\quad&\textbf{B}(\textbf{x}, \textbf{y})\textbf{q}=\textbf{f} \end{aligned}$$
(6b)
$$\begin{aligned}&-\sigma _c\textbf{a}\le \textbf{q} \le \sigma _t\textbf{a}\end{aligned}$$
(6c)
$$\begin{aligned}&\textbf{D}_\text {A} = |\textbf{a} - \varvec{\mu }|\end{aligned}$$
(6d)
$$\begin{aligned}&\textbf{a}\ge 0, \end{aligned}$$
(6e)

where \(\varvec{\mu } = [\mu _{f(1)}, \mu _{f(2)},\ldots, \mu _{f(n)}]^\textrm{T}\) is the vector containing the corresponding mean area values.

Note that in Problem (6), the cluster mean values \(\varvec{\mu }\) are treated as design variables for more design freedom of the optimization problem. Since Problem (6) is non-linear non-convex, it is tackled by the interior point solver IPOPT (Wächter and Biegler 2006). An iterative scheme similar to the geometry optimization is used for the post-processing step. In each iteration, the k-means clustering approach is conducted first, then Problem (6) is solved to reduce the member area deviations. In addition, same as the geometry optimization, geometry modifications such as merging close nodes and creating cross-overs are carried out in between iterations (see He and Gilbert (2015)). The iterative scheme stops when the following condition is satisfied:

$$\begin{aligned} \Delta \overline{V} = |\overline{V}_{\xi +1} - \overline{V}_{\xi } |/\overline{V}_{\xi } \le t, \end{aligned}$$
(7)

where \(\overline{V}_{\xi }\) is the penalized and normalized volume value for the \(\xi\)-th iteration; t is a convergence tolerance, here 0.1% is used.

For clarity, a flow chart for the approach used to tackle the section-type problem is shown in Fig.  2.

Fig. 2
figure 2

Approach for the section-type problem, where \(\Delta \overline{V}\) represents change in the objective function value between two consecutive iterations; t is a convergence tolerance

2.2.2 Approach for the member-type problem

A similar process as the section-type problem can be used in the member-type problem. Nevertheless, it has been found that reducing the length deviations to 0 is much more difficult than reducing the area deviations. Whilst members can be non-fully stressed (i.e., \(a>|q/\sigma |\)) to make the area deviations 0, length deviations are mainly reduced by modifying the node coordinates, which is a challenging geometrical problem (see detailed reasons in Sect. 4). Therefore, instead of considering both area and length values in a 2D clustering problem, we consider a 1D clustering problem of length values only to get a starting point with lower length deviations:

$$\begin{aligned} \underset{\textbf{S}}{\textrm{argmin}} \sum _{\eta \in \mathbb {C}}\Vert \textbf{l} - \nu _\eta \textbf{e}\Vert ^2, \end{aligned}$$
(8)

where \(\nu _\eta\) is the mean for the \(\eta\)-th cluster; \(\textbf{l}_\eta\) =\([l_i |\forall i\in \mathbb {S}_\eta ]^\textrm{T}\) is the length vector of the \(\eta\)-th cluster.

After the clustering step, the length deviation \(D_{\text {L}, i}\) of the i-th member can be computed by:

$$\begin{aligned} D_{\text {L}, i} = |l_i - \nu _{f(i)}| \end{aligned}$$
(9)

The area deviations can be computed by Eq. (4) using the clustering solution from Problem (8).

In the length deviation penalization term, the length deviations are multiplied by the member areas so that the algorithm has the option to make the members with large length deviations “vanish”:

$$\begin{aligned} \min _{\textbf{a}, \textbf{q}, \textbf{x}, \textbf{y}} \frac{\quad w\,\textbf{l}(\textbf{x}, \textbf{y})^\textrm{T}\textbf{a}}{V_0} + (1-w)p\,(\frac{\textbf{D}_\text {A}^\textrm{T}\textbf{e}}{D_{\text {A, 0}}}+ \frac{\textbf{A}\textbf{D}_\text {L}^\textrm{T}\textbf{e}}{D_{\text {L, 0}}}), \end{aligned}$$
(10)

where \(\textbf{A} = \text {Diag}(a_1,\ldots, a_m)\) is a diagonal matrix containing the member areas; \(\textbf{D}_\text {L} = [D_{\text {L}, 1}, D_{\text {L}, 2},\ldots, D_{\text {L}, m}]^\textrm{T}\) is the length deviation vector; \(D_{\text {L, 0}} = \textbf{A}_0\textbf{D}_\text {L, 0}^\textrm{T}\textbf{e}\) is the normalization term of the length deviations; \(\textbf{A}_0\) and \(\textbf{D}_\text {L, 0}\) are the area value vector and the length deviation value vector of the starting point structure, respectively.

By combining (2), (9), and (10), the post-processing optimization problem is:

$$\begin{aligned} \min _{\textbf{a}, \textbf{q}, \textbf{x}, \textbf{y}, \varvec{\mu }, \varvec{\nu }}&\frac{\quad w\,\textbf{l}(\textbf{x}, \textbf{y})^\textrm{T}\textbf{a}}{V_0} + (1-w)p\,(\frac{\textbf{D}_\text {A}^\textrm{T}\textbf{e}}{D_{\text {A, 0}}}+ \frac{\textbf{A}\textbf{D}_\text {L}^\textrm{T}\textbf{e}}{D_{\text {L, 0}}}) \, \end{aligned}$$
(11a)
$$\begin{aligned} \text {s.t.}\quad&\textbf{B}(\textbf{x}, \textbf{y})\textbf{q}=\textbf{f} \end{aligned}$$
(11b)
$$\begin{aligned}&-\sigma _c\textbf{a}\le \textbf{q} \le \sigma _t\textbf{a}\end{aligned}$$
(11c)
$$\begin{aligned}&\textbf{D}_\text {A} = |\textbf{a} - \varvec{\mu }|\end{aligned}$$
(11d)
$$\begin{aligned}&\textbf{D}_\text {L} = |\textbf{l}(\textbf{x}, \textbf{y}) - \varvec{\nu }|\end{aligned}$$
(11e)
$$\begin{aligned}&\textbf{a}\ge 0, \end{aligned}$$
(11f)

where \(\varvec{\nu } = [\nu _{f(1)}, \nu _{f(2)},\ldots, \nu _{f(n)}]^\textrm{T}\) is the vector containing the corresponding mean length values for the members in every clusters.

Due to the difficulty in reducing the length deviations, the optimization scheme is also adjusted for the member-type problem. Here we set a target threshold \(\overline{D}_{\text {L, max}}\) for the maximum length deviation. During the iterative process, if Criterion (7) is satisfied but the maximum length deviation value \(D_{\text {L, max}}\) is not reduced below \(\overline{D}_{\text {L, max}}\), the optimization process will continue with the cluster number increased by 1. The optimization process terminates when Criterion (7) is satisfied and \(\overline{D}_{\text {L, max}}\) is reached. For the sake of clarity, a flowchart for the approach used to tackle the member-type problem is shown in Fig. 3.

Fig. 3
figure 3

Approach for the member-type problem, where \(\Delta \overline{V}\) represents change in the objective function value between two consecutive iterations; t is a convergence tolerance; \(D_\text {L, max}\) is the max length deviation of the current iteration and \(\overline{D}_\text {L, max}\) is the target length deviation; k is the cluster number

3 Numerical examples

The capability of the proposed approach is demonstrated through a few 2D and 3D examples. \(w=0.8\) is used for Problem (6) and Problem (11). The optimized structures are presented as solid models with members treated as cylinders and nodes as spheres.

3.1 Examples for the section-type problem

3.1.1 Cantilever

The first example is a simple cantilever. The problem conditions and the nominal design are shown in Fig.  4. To obtain the nominal design, a \(20 \times 10\) node grid is used in the traditional layout and geometry optimization scheme (i.e., Problems (1) and (2)). The nominal design contains 88 members, each has different cross-sectional areas.

In the section-type problem, members in the nominal design (i.e., Fig.  4) are first separated into clusters by solving Problem (3). After this step, members with similar cross-sectional area values are assigned to the same cluster, but within each cluster, area deviations exist. With 3 clusters used, the initial maximum area deviation for all the clusters is 0.257\(\text {P}/\sigma\); with 5 clusters used, the maximum area deviation is 0.086\(\text {P}/\sigma\). To reduce the area deviations, the post-processing step (i.e., Fig.   2) is carried out. The further optimized designs for 3 and 5 clusters are shown in Fig. 5a and b, respectively. Both of these designs have near 0 maximum area deviation (i.e., \(D_\text {A, max} = 1.37\!\times \!10^{\text {-}7}\text {P}/\sigma\) for Fig.  5a and \(D_\text {A, max} = 1.65\!\times \!10^{\text {-}7}\text {P}/\sigma\) for Fig.  5b). Although only 3 or 5 types of sections are used, the volumes of the structures in Fig.  5 are close to the benchmark in Fig.  4, highlighting the superiority of the proposed approach. In addition, Fig.  5 shows that when the cluster number increases from 3 to 5, the range of the member area values is expanded from \([0.244\text{P}/\sigma , 1.057\text{P}/\sigma ]\) to \([0.116\text{P}/\sigma , 1.078\text{P}/\sigma ]\), leading to the lower volume in Fig.  5b.

Fig. 4
figure 4

Cantilever example, where red and blue bars represent members in tension and compression

Fig. 5
figure 5

Optimized cantilever with limited types of cross-sectional areas: a solution with 3 types of cross-sectional areas, \(\Delta V = 7.02\%\); b solution with 5 types of cross-sectional areas, \(\Delta V = 3.61\%\). \(\Delta V\) is the relative volume increase compared to the nominal design in Fig.  4; the cross-sectional areas are listed on the right; P is the applied load (see Fig.  4) and \(\sigma\) is the stress limit

3.1.2 Influence of node grid density

Due to the non-linear and non-convex nature of the proposed formulation, the optimized results are influenced by the starting points (Haftka and Gürdal 2012). Therefore, the effect of different starting structures is investigated in this section. The same problem in Fig.  4 is used, and different starting points are generated using 10 \(\times\) 5, 20 \(\times\) 10 and 40 \(\times\) 20 nodes in the layout optimization stage (i.e., Fig. 6a, b and c). The used cluster number is 6 and the optimized results are shown in Fig. 6. The maximum area deviations for Fig. 6d, e and f are all near 0 (i.e., \(<\!1\!\times \!10^ {-6}\text {P}/\sigma\)). It can be observed from Fig.  6 that more complex starting points lead to more complex optimized results. However, contrary to the traditional layout and geometry optimization, the use of a denser node grid causes an increase in volume in this approach. This is because the member-type constraints are only considered in the post-processing stage and not in Problems (1) and (2). Consequently, using a denser node grid in Problem (1) does not guarantee better starting points for Problem (6). Furthermore, the results show that denser node grids are associated with higher volumes because the increased structural complexity of the starting points makes the section-type constraints difficult to be satisfied. This reveals the limitations of the post-processing approach and will be discussed in detail in Sect. 4.3. Nevertheless, in this example, considering that Fig. 6d, e and f have similar volumes, the simplest design Fig.  6d may be the favourable solution because of its lowest manufacturing costs.

Fig. 6
figure 6

Influence of different starting points: a starting point obtained with a 10\(\times\)5 node grid, \(V=V_0\); b starting point obtained with a 20\(\times\)10 node grid, \(V=0.994V_0\); c starting point obtained with a 40\(\times\)20 node grid, \(V=0.992V_0\); d optimized structure obtained with starting point (a), \(k=6\) and \(V = 1.0149V_0\); e optimized structure obtained with starting point (b), \(k=6\) and \(V = 1.030V_0\); f optimized structure obtained with starting point (c), \(k=6\) and \(V = 1.037V_0\); red and blue bars represent members in tension and compression; k represents the cluster number; V represents the normalized structural volume and \(V_0\) is an unit volume

3.1.3 Cantilever with circular support

In Sect. 3.1.1, solutions with lower volumes can be achieved using more cluster numbers. Therefore, a parametric study on the cluster number is carried out in this section. A cantilever example with pinned supports around a circumference is considered. The problem description and the nominal design are shown in Fig. 7. A \(20\!\!\times \!\!13\) node grid is used in the initial layout optimization.

Fig. 7
figure 7

Cantilever with circular support, where red and blue bars represent members in tension and compression

In this parametric study, the cluster number is increased from 1 to 10, and the optimized results are shown in Fig. 8. Note that all the solutions presented in Fig. 8 have near 0 area deviations. \(\Delta V\) (i.e., volume increase compared to the nominal design) reduces rapidly from 42.75% to 4.75% when the cluster number increase from 1 to 3; then \(\Delta V\) reduces slowly from 3.89 to 0.41% as the cluster number increases from 4 to 10. In addition, Fig. 8 shows that the complexity of the optimized structures increases gradually as the number of clusters increases.

Upon closer examination of the volume values, it is found that the solution with 8 clusters has a slightly higher (i.e., 1.7% higher) volume than the solution with 7 clusters. This is due to the non-linear and non-convex nature of Problem (6) and the fact that geometry modifications, such as merging nodes and creating cross-overs, are performed between optimization iterations, which can result in locally optimal solutions. To assess the optimality of the solutions, the volumes of the nominal designs were used as a reference. Since the nominal design process (i.e., Problems (1) and (2)) does not consider member-type constraints, the resulting structures are lower bound solutions. In the current example, although the solution with 8 clusters is locally optimal, it still approaches the global optimum because the volume increase is only 1.49% compared to the nominal design.

Fig. 8
figure 8

Relation between number of the cross-sectional area types and the volume increases, where k is the number of the cross-sectional area types; \(\Delta V\) is the volume increase relative to the nominal design in Fig.  7

3.1.4 Michel sphere

Fig. 9
figure 9

Michell sphere example: a the problem description; b the nominal design from the layout and geometry optimization. T is the applied torque and L is the radius of the Michell sphere, \(\phi = 18^\circ\) is used

Fig. 10
figure 10

Optimized Michell sphere with limited types of cross-sectional areas: a 4 types of cross-sectional areas used, \(\Delta V = 11.9\%\); b 5 types of cross-sectional areas used, \(\Delta V = 5.28\%\); c 6 types of cross-sectional areas used, \(\Delta V = 2.84\%\). \(\Delta V\) is the volume increase relative to the nominal design in Fig. 9b

The proposed approach can be extended to 3D by adding the z coordinates as variables. The Michell sphere example is used to demonstrate the effectiveness of this approach in 3D cases. The case description is shown in Fig. 9a. By taking advantage of the symmetry, 1/8 of a full sphere is used as the design domain; and a \(10\!\times \!10\!\times \!10\) nodal grid is used. The torsional load is considered as 20 point loads (with equal magnitude P) applied circumferentially in the full problem (i.e., 20/4 + 1 = 6 nodes in the reduced problem). A nominal design from the layout and geometry optimization step is shown in Fig.  9b, with only half of the Michell sphere shown for clarity. The optimized Michell sphere with 4, 5 and 6 types of cross-sectional areas are shown in Fig.  10. The initial maximum area deviations for Figs. 10a, b and c are \(0.102\text {P}/\sigma\), \(0.088\text {P}/\sigma\) and \(0.073\text {P}/\sigma\). After the post-processing optimization, the maximum area deviations are reduced to \(1.58\!\times \! 10^{-7}\text {P}/\sigma\), \(6.78\!\times \! 10^{-7}\text {P}/\sigma\) and \(1.41\!\times \! 10^{-7}\text {P}/\sigma\), which are small enough to be considered as 0. One eighth of the full Michell sphere (i.e., 1/4 of the structure in Fig.  9b) contains 248 members. Although the member number is high, the members are arranged in a grid pattern. Figure 10b and c show that by taking advantage of the grid pattern, low volume increases can be achieved using 5 or 6 section types.

3.2 Examples for the member-type problem

Examples in this section focus on the member-type problem. The previous results show that the area deviations can be reduced to near 0 for any given cluster number in the section-type problem. This point stays the same in the member-type problem, and all the presented results in this section also have near 0 area deviations. Therefore, in this section, the discussions are focused on the length deviations. In addition, for the approach shown in Fig.  3, \(k=5\) is used in the first iteration for all examples in this section.

3.2.1 2D examples for the member-type problem

Fig. 11
figure 11

Example with two point loads, where red and blue bars represent members in tension and compression

Fig. 12
figure 12

2D Case 1 for the member-type problem - cantilever: a \(\overline{D}_{\text {L, max}} =0.025\text {L}\) and 6 member-types used; b \(\overline{D}_{\text {L, max}} =0.010\text {L}\) and 9 types used; c \(\overline{D}_{\text {L, max}} = 1\!\times \!10^{\text {-}4}\text {L}\) and 13 types used. \(\overline{D}_{\text {L, max}}\) is the target maximum length difference among all the member clusters; more supplementary information is available in Table 1

Fig. 13
figure 13

2D Case 2 for the member-type problem - cantilever with circular supports: a \(\overline{D}_{\text {L, max}} =0.025\text {L}\) and 7 member-types used; b \(\overline{D}_{\text {L, max}} =0.010\text {L}\) and 9 types used; c \(\overline{D}_{\text {L, max}} = 1\!\!\times \!\!10^{\text {-}4}\text {L}\) and 11 types used. \(\overline{D}_{\text {L, max}}\) is the target maximum length difference among all the member clusters; more supplementary information is available in Table 1

Fig. 14
figure 14

2D Case 3 for the member-type problem - example with two point loads: a \(\overline{D}_{\text {L, max}} =0.025\text {L}\) and 5 member-types used; b \(\overline{D}_{\text {L, max}} =0.010\text {L}\) and 10 types used; c \(\overline{D}_{\text {L, max}} = 1\!\!\times \!\!10^{\text {-}4}\text {L}\) and 16 types used. \(\overline{D}_{\text {L, max}}\) is the target maximum length difference among all the member clusters; more supplementary information is available in Table 1

Table 1 Supplementary data for the 2D member-type cases, where Case 1 corresponds to Fig.  12, Case 2 corresponds to Fig.  13 and Case 3 corresponds to Fig.  14; \(\overline{D}_{\text {L, max}}\) is the target maximum length deviation; k is the cluster number; \(D_{\text {L, max}}\) and m are the maximum length deviation and the number of members, respectively; \(\Delta V\) is the volume increase relative to the corresponding nominal design

In this section, three 2D examples have been investigated for the member-type problem. Cases 1 and 2 are the cantilever problems in Figs.  4 and  7. Case 3 is shown in Fig.  11, which contains a nominal design obtained using a \(26 \times 20\) node grid. As mentioned in Sect. 2.2.2, in the member-type problem, the cluster number gradually increases until the target length deviation is reached. We consider three target length deviation values: high allowance - 0.025 L, low allowance - 0.01 L and near 0 allowance - \(1\!\times \! 10^{\text {-}4}\)L. Note that L is a unit length, see Figs. 4, 7 and 11.

The optimized results are shown in Figs. 12, 13 and 14, and the corresponding data are shown in Table 1. Note that for Fig.  14a, a starting point structure obtained using a \(9\times 7\) node grid is used to reach a sensible solution, and all the other results in Figs. 12, 13 and 14 are obtained using the starting point structures in Figs. 4, 7 and 11, respectively. For comparison, the length deviations obtained directly with the clustering approach (i.e., without the post-processing optimization) are shown in the table as well. It can be seen that initially all \(D_{\text {L, max}}\) values are higher than the targets; and after the post-processing step, the maximum length deviations are reduced below the targets. In addition, Table 1 shows that for the 3 cases, approximately 6 clusters are needed to reach \(\overline{D}_{\text {L, max}}=0.025\text {L}\), around 10 clusters are needed to reach \(\overline{D}_{\text {L, max}}=0.01\text {L}\), and more than 10 clusters are needed to reach \(\overline{D}_{\text {L, max}}=1\!\times \! 10^{\text {-}4}\text {L}\). Compared to the section-type problem, the increased cluster number demonstrates the influence of the length type requirements. Table 1 also indicates that the \(\Delta V\) decreases as the \(\overline{D}_{\text {L, max}}\) decreases. This is because achieving lower target length deviations requires more clusters, resulting in a larger number of cross-sectional area types, which in turn leads to lower \(\Delta V\) (i.e., same as Fig.  8).

The results in Figs. 12 and 14 resemble the layout of the nominal designs to some extent. However, in Fig.  13 the layout changed significantly compared to the nominal design. This is because the nominal designs contain fan-shaped structures for Case 1 and 3. The members in the fan-shaped structure share similar member lengths and areas, making them tend to be kept in the post-processing process. In particular, in Case 3, where the fan-shaped structure takes a large proportion, the volume increases are relatively low for Figs. 14b and c. On the other hand, the nominal design of Case 2 (Fig.  7) is formed by grid-shaped structures, where the member length gradually increases from the support position to the loading position. Unlike the section-type problem, where area deviations can be easily reduced, the variation of the member lengths makes it difficult to reduce the length deviations. Consequently, the optimized results shown in Fig.  13 have significantly different layouts from the nominal design. In addition, it can be observed from Table 1 that number of members is reduced during the optimization process. This is because in Function (11a) the penalty term for the length deviation is multiplied by the cross-sectional area. Therefore, the algorithm deletes some members to reduce the maximum length deviation.

3.2.2 3D examples for the member-type problem

Fig. 15
figure 15

Cantilever with three pinned supports: a case description; b nominal design with layout and geometry optimization; red and blue bars represent members in tension and compression

Table 2 Supplementary data for the 3D member-type cases, where Case 1 corresponds to Fig.  16; Case 2 corresponds to Fig.  16; \(\overline{D}_{\text {L, max}}\) is the target maximum length deviation; k is the cluster number; \(D_{\text {L, max}}\) and m are the maximum length deviation and the number of members, respectively; note that the m values for 3D Case 1 and 2 correspond to the half problem and \(1/8\) problem, respectively; \(\Delta V\) is the volume increase compared to the corresponding nominal design

Same as the section-type problem, the member-type problem can be easily extended to 3D. Therefore, two 3D examples are investigated in this section. The first case is a 3D cantilever with three pinned point supports (see Fig. 15a). Half of the problem is considered by exploiting the symmetry, and a nominal design obtained from layout and geometry optimization is shown in Fig. 15b. The second case is the Michell sphere example shown in Fig. 9. For these two cases, the same target length deviations (i.e., 0.025 L, 0.01 L, and \(1\!\times \!10^{\text {-}4}\)L) are used. The optimized results are shown in Figs. 16 and 17, with supplementary data available in Table 2.

In the 3D cantilever example, the algorithm is able to achieve the target length deviation with relatively fewer clusters, and the volume increases are relatively low. On the other hand, the Michell sphere example requires more clusters to reach the target length deviations due to the progressively varying length and area values of the members in its nominal design, and the optimized structural volumes are relatively high (as shown in Table 2). This is similar to the behaviour observed in the 2D circular cantilever example (Fig. 13).

Fig. 16
figure 16

3D Case 1 for the member-type problem - cantilever with three pinned supports: a \(\overline{D}_{\text {L, max}} =0.025\text {L}\) and 6 member-types used; b \(\overline{D}_{\text {L, max}} =0.010\text {L}\) and 7 types used; c \(\overline{D}_{\text {L, max}} = 1\!\!\times \!\!10^{\text {-}4}\text {L}\) and 8 types used. \(\overline{D}_{\text {L, max}}\) is the target maximum length difference among all the member clusters; more supplementary information is available in Table 2

Fig. 17
figure 17

3D Case 2 for the member-type problem - Michell sphere: a \(\overline{D}_{\text {L, max}} =0.025\text {L}\) and 10 member-types used; b \(\overline{D}_{\text {L, max}} =0.010\text {L}\) and 15 types used; c \(\overline{D}_{\text {L, max}} = 1\!\!\times \!\!10^{\text {-}4}\text {L}\) and 19 types used. \(\overline{D}_{\text {L, max}}\) is the target maximum length difference among all the member clusters; more supplementary information is available in Table 2

3.2.3 Electricity transmission tower example

In this section, we apply the proposed approach for the member-type problem to the conceptual design of a low-profile electricity transmission tower (Zhang et al. 2022). The case description is shown in Fig.  18. By exploiting the symmetry of the problem, we considered half of the tower. The weight of electricity cables and conductors are considered as four vertical loads (i.e., V in Fig.  18a). The drag forces from the electricity cables are considered as four horizontal loads (i.e., H in Fig.  18b). For simplicity, \(\text {V}\!=\!30\;\text {kN}\) and \(\text {H}\!=\!12\;\text {kN}\) are used. Three load cases are considered: vertical and positive horizontal loads (V+H), vertical and negative horizontal loads (V-H) and vertical loads only (V). The tower is supported by four pinned point supports at the bottom surface. The limit stress is set to 270 MPa and the target maximum length deviation is 0.1 m.

Using the traditional layout and geometry optimization, a nominal design is obtained and shown in Fig.  19a. The nominal design consists of 92 members (for the half problem). Separating the members in the nominal design into 15 clusters using Problem (8) results in a maximum length deviation of 0.153 m, and a maximum area deviation of 257 mm\(^2\). After the post-processing, these values are reduced to 0.081 m, and \(3.65\!\times \!10^{\text {-}5}\;\text {mm}^2\) (i.e., near 0), respectively. The optimized result is shown in Figs. 19b and c, with members represented as hollow cylinders with an inner radius equal to 95% of the outer radius. Compared to the nominal design in Fig.  19a, the relative volume increase is 17.2%.

Fig. 18
figure 18

Electric transmission tower case description

Fig. 19
figure 19

Optimized electric transmission tower: a the nominal design obtained by traditional layout and geometry optimization; b optimized design with 15 types of members used, the volume increase is 17.2% compared to a; c three-view drawing of b; red and blue bars represent members in tension and compression

4 Discussion

4.1 Numerical efficiency

In this study, we proposed a novel post-processing approach to control the number of different types of members in optimized truss structures. The approach involves two additional steps beyond the traditional layout and geometry optimization: (1) member clustering (using either Problem (3) or Problem (8)) and (2) post-processing geometry optimization (using either Problem (6) or Problem (11)). The computational cost of the clustering step is negligible for the problems considered in this study. For example, it takes only 0.089 s on a personal laptop with an AMD 5900HX CPU to cluster the 248 members in Fig. 9b into 6 area types. The post-processing step involves additional linear constraints (i.e., relative to Problem (2)), the number of which is proportional to the number of members (i.e., two times the number of members in Problem (6) and four times the number of members in Problem (11)). As a result, the computational cost of solving Problem (6) is similar to that of traditional geometry optimization. For example, it takes 26 iterations to obtain the solution in Fig. 10c, with the IPOPT solving time for each iteration ranging from 3.678 to 7.194 s. Overall, the proposed approach has a similar computational cost to traditional geometry optimization and can therefore be applied to large-scale problems.

4.2 Numerical effectiveness

The effectiveness of the proposed approach has been shown with the numerical examples in Sect. 3. For the section-type problem, the proposed approach can reduce the area deviations to near 0 for any given cluster number, and the optimized volumes are relatively low compared with the nominal designs. The reason for such effectiveness is demonstrated through two examples in Fig.  20. The first example is a simple two-bar structure, where a fully stressed nominal design is shown in Fig.  20a. When one cluster is used, the maximum area deviation is 0.21\(\text {P}/\sigma\). To reduce the maximum area deviation to 0, the area of the horizontal member can be increased to \(1.44\text {P}/\sigma\), which leads to the non-fully stressed structure as shown in Fig.  20b. The same principle applies to a relative complex cantilever example in Fig.  20c. By increasing the area of several selected members and preserving the nodal positions, as shown in Fig.  20d, the maximum area deviation can be reduced to 0. Although Fig.  20d has a 20.88% \(\Delta V\) relative to Fig.  20c, further geometry optimization can reduce this value to \(4.67\%\) (Fig. 20e). The steps in Fig. 20d and e are carried out simultaneously in the solving process of Problem (6), which leads to solutions with near 0 maximum area deviations and low volumes.

Fig. 20
figure 20

Elimination of area deviations can be achieved by increasing the areas of selected members: a a fully stressed two-bar structure with \(D_\text {A, max}=0.21\text {P}/\sigma\) for \(k=1\); b by increasing the area of the horizontal bar, \(D_\text {A, max}\) is reduced to 0; c a nominal design of the cantilever example, \(D_\text {A, max}=0.20\text {P}/\sigma\) for \(k=4\); d by increasing the area of several selected members, \(D_\text {A, max}\) is reduced to 0, \(\Delta V = 20.88\%\); e further optimized structure with geometry optimization, \(\Delta V = 4.67\%\); \(D_\text {A, max}\) represents the maximum area deviation; \(\Delta V\) is the relative volume increase compared to (c); k represents the cluster number; red and blue bars represent members in tension and compression

As for the member-type problem, the required number of clusters and the structural volume are increased compared to the section-type problem. The member-type problem is more challenging than the section-type problem because reducing the length deviations is a geometrical problem. Most members in the nominal design have initial length deviations after the clustering step. These length deviations can be reduced by moving the position of the nodes. However, since the optimized structures usually have much more members than the nodes, the design freedom provided by the nodal movement is not enough to reduce all the length deviations to zero. Therefore, the algorithm tends to reach the target maximum length deviation by (1) simplifying the structure (i.e., reducing the member number); (2) increasing the cluster number. The results in Sect. 3 show that the post-processing step can achieve the target length deviations in all the example investigated.

4.3 Limitations, advantages and future developments

The optimized results presented in Fig.  6 indicate that using a denser node grid for obtaining starting points results in optimized solutions with higher volumes. This suggests that, in contrast to the traditional layout optimization approach, the post-processing scheme proposed in this study does not exhibit a larger search region when a denser node grid is employed, potentially causing sub-optimal solutions. In addition, the results in Fig.  8, Tables 1 and 2 demonstrate that, the algorithms (i.e., Figs. 2 and 3) reduce the number of members and nodes during the iterative process when the member-type constraints are challenging to be satisfied (i.e., complex starting point structures or small k values). Consequently, this post-processing approach may struggle to simultaneously satisfy the member-type constrains and preserve the complexity of the given starting points. Due to this reason, it may be beneficial to test various starting points for the same problem in order to achieve a favourable result, as starting points with an excessive number of members may lead to unfavourable results due to the difficulty in satisfying the member-type constraints, while starting points with too few members may also result in unfavourable results due to their own sub-optimality. Nevertheless, the advantages of using this post-processing approach are that: (1) by considering member-type constraints in the post-processing step only, the computational costs are controlled in a reasonable low level (i.e., Sect. 4.1); (2) for the section-type problem, due to the reason described in Sect. 4.2, the type constraints are easily get satisfied and the volumes of the obtained solutions are close to the lower bound solutions; (3) while the proposed approach may not preserve the complexity of the starting points, from a practical standpoint, reducing the number of nodes and members can lead to lower manufacturing costs, which aligns with the target of this study.

For the member-type problem, due to the difficulty of reducing the length deviations, the volume sacrifices (i.e., brought by the member-type constraints) are relatively high in examples with complex structures (e.g., Fig.  17). This means the propose approach still has the potential to be improved. In realistic projects, a long structural member can be considered as a combination of two (or more) raw material members (i.e., by adding joints), or a long raw material member can be cut into several structural members. By taking advantage of these two points in future studies, an improved approach that can lead to fewer clusters and lower volumes may be developed.

5 Conclusion

This study aims to reduce the manufacturing costs of optimized truss structures by controlling the number of member types. Two problems are considered: in the first problem, members in the same group share the same cross-sectional area (i.e., section-type problem); in the second problem, members in the same group share the same cross-sectional area and member length (i.e., member-type problem). In order to obtain efficient solutions, the optimized structures from the traditional layout and geometry optimization scheme are used as the starting points. The k-means clustering approach is used to separate the members into groups. Then the structure is further optimized in a post-processing optimization step to reduce the length/area deviations (i.e., the differences between the member area/length values and the corresponding cluster mean values). Since the post-processing optimization problem is non-linear and non-convex, potentially leading to locally optimal solutions, the optimized designs are compared to the lower bound solutions for efficiency check.

Several 2D and 3D examples are presented to demonstrate the effectiveness of the proposed approaches. For the section-type problem, it is found that for any given cluster number, the proposed approach can reduce the area difference within all the member groups to near 0. In addition, in the problems investigated, the results show that with 6 clusters provided, the volume increases compared to the nominal designs are small (i.e., <3%).

The member-type problem is more challenging than the section-type problem. Therefore, in order to achieve designs with lower length deviations, the algorithm is adjusted to allow members that have large length deviations to “vanish”, and the cluster number gradually increases during the iterative process until the target length deviation is reached. In the problems investigated, near 0 maximum length deviation can be achieved with less than 20 clusters provided. However, the volume sacrifices (i.e., brought by the member-type constraints) are relatively high when less clusters are allowed. This is worth investigating in future studies.