1 Introduction

Nowadays, the agriculture industry has attracted the attention of many governments because of its essential role in nutrition, health, and improving the economy of developing countries (Yaseen et al., 2023; Abbas et al., 2020). In addition, the Agricultural Supply Chain (ASC) is considered an attractive research field among researchers due to unique attributes such as the sensitivity of product quality, fluctuations in their demand and prices, and the effects of climate change. (Abbas & Dastgeer, 2021; Abbas et al., 2021). Among all agricultural products, pistachio is one of the most valuable garden products that play a crucial role in improving the economy of pistachio-producing countries (Taghizadeh-Alisaraei et al., 2017). World pistachio production in 2014 reached more than 638,000 tons (with its soft shell), which showed an increase by 37% and 50% compared to 2013 and 2004, respectively (Dolatabadi et al., 2021). In 2018, the top three pistachio farmers in the world were Iran, the USA, and Turkey, which their annual production is 551 × 103, 447 × 103, and 240 × 103 tons, respectively (see Fig. 1) (www.fao.org).

Fig. 1
figure 1

Pistachio production between 1994 and 2019 (FAO)

Annually, a huge large quantity of wastes is produced in pistachio processing centers (terminals), which can be used in many other industries instead of destruction (see Fig. 2). In addition to economic benefits, optimal use of pistachio wastes will have positive environmental impacts. For example, approximately 135,000 tons of pistachio waste is produced annually just in Iran. These wastes, such as the soft shell of pistachio, have great potential for biofuel production in bio-refineries (Taghizadeh-Alisaraei et al., 2017). The soft shell of pistachio also can be recycled to produce large amounts of compost, which is used as fertilizer by farmers (Esmaeili et al., 2020). Therefore, reverse logistics utilization in the pistachio case and the optimal use of waste from its processing is essential for producing countries, which has rarely been considered by researchers.

Fig. 2
figure 2

From left to right: raw pistachios, processing center, pistachio nuts, and the soft shell of pistachio

Moreover, uncertainty in decision-making is one of the most important challenges that pistachio farmers face every year. The demand for this products is sensitive to the price and the farmer’s yield could experience a significant fluctuation rate (Gilani & Sahebi, 2021). Robust optimization is a proper technique to predict future conditions in the unstable environment of pistachio Supply Chain (SC), but literature review shows that this approach has rarely been considered by researchers.

Environmental concern, and the importance of the circular economy have motivated this research group to focus on a Closed-Loop Supply Chain (CLSC) network design in the ASC sector. To fill the abovementioned research gap, a CLSC network is designed for the pistachio SC, and then a new Mixed-Integer Linear Programming (MILP) model is formulated to minimize the chain’s costs. A robust optimization approach is used to handle uncertainty of demand and production capacity of farmers. Also, GAMS software and some metaheuristic algorithms including Whale Optimization Algorithm (WOA), Particle Swarm Optimization (PSO), Rat Swarm Optimizer (RSO), and a new hybrid approach based on RSO and PSO (is called RSO-PSO) were used to solve the model, and then their results were compared. Then, the algorithm parameters are adjusted by applying the Taguchi method for achieving better results. Finally, the validation of the model is confirmed by analyzing the obtained results from a case study in Iran.

Therefore, the most important innovations of this research are as follows:

  • Designing a CLSC network for pistachio under uncertainty.

  • Proposing a new optimization model with a price and freshness-dependent demand.

  • Presenting a new hybrid algorithm based on both RSO and PSO to solve the planned model.

The main purposes of this article are to solve the following problems:

  1. 1.

    How can mathematical modeling help in better distribution of agricultural products and recycling of their waste with the aim of reducing costs?

  2. 2.

    How to get better results in solving SC optimization problems in high dimensions by combining meta-heuristic algorithms?

  3. 3.

    How can the robust optimization approach be used in the decision-making and modeling processes in uncertain environments?

The current article has been written in 6 sections, which other sections are organized as the following: Sect. 2 has a complete literature review. The mathematical formulation of the problem is presented in Sect. 3. The optimal solution finding approach and the meta-heuristic algorithm are described in Sect. 4. A real case study is implemented on the proposed model to show efficiency, which is described in Sect. 5. The parameters of the meta-heuristic algorithm are adjusted in this section. Moreover, a comparison between the computational results is performed after obtaining individual results, and then a sensitivity examination is conducted to achieve a further evaluation of the model. Finally, in Sect. 6, the obtained results are concluded, and new research lines for future studies are described.

2 Literature review

In the recent past decades, several studies have been conducted to evaluate and expand pistachio production and obtain proper use of its wastes due to the high importance of the economic aspect of pistachio for its producing countries (Taghizadeh-Alisaraei et al., 2017). According to our best knowledge, only a few articles have used mathematical models to optimize the pistachio SC. Therefore, some studies related to SC optimization for other agricultural products are described to get to the research gap. This section aims to review and analyze these papers in three subsections, namely ASC optimization, applying meta-heuristic algorithms and considering uncertainty in this field.

2.1 ASC optimization

There are several studies in the scope of ASC optimization (Abbas et al., 2018). As a pioneer of this field Ahumada and Villalobos (2009) considered different agricultural products, including both perishable and non-perishable, and as well as vegetables. Following this research, a model developed by Bohle et al. (2010) for red grape via considering correctly determining the amount of harvested crop in each period, transporting way to the final product processing site, and planning the factory processing regarding the products, and packaging into the formation of a mixed integer programming model. For considering possible delays in the SC, both costs of harvesting and reducing product quality were included in the objective function of the model.

Asgari et al. (2013) studied a linear programming model for investigating the optimal quantity of wheat between farmers and consumers, and Lingo optimization software was applied for resolving the presented model. For large-scale problems, a genetic algorithm was also developed. A comparison between the obtained solutions from Lingo software and the obtained results from the genetic algorithm showed that the developed genetic algorithm is more effective by considering the computational time and quality of the obtained results. For SC management of imported fruits and perishable vegetables, Teimoury et al. (2013) also proposed a multi-objective model. The system dynamics approach was used to analyze the impact of fruit imports in the SC. Subsequently, Nadal-Roig and Plà-Aragonés (2015) formulated a transport programming model to optimize fruit logistics to meet demands in off-harvest seasons.

Banasik et al. (2017) studied a multi-objective MILP model by considering different recycling technologies for reproduction in the CLSC network of the mushroom product. Their results showed that using such technologies in the CLSC could increase the overall profit by up to 12% and reduce emissions by about 28%. Sazvar et al. (2018) studied a multi-objective linear mathematical programming model for providing a sustainable SC of perishable agricultural products, which were produced by organic and non-organic methods. In this research, the epsilon constraint approach was applied for solving the model to achieve specific goals, including maintaining an equilibrium of production and consumption of non-organic and organic foods and reducing prices, reduction of environmental impacts, and improve consumers' health.

Chávez et al. (2018) investigated the waste of Colombian coffee to produce biofuels in a multi-objective problem. Their multi-period model's objective functions maximized net present value, minimized the cost of carbon pollution and maximized the positive social effects.

2.2 Utilizing meta-heuristic algorithms in ASC

Meta-heuristic algorithms are utilized to resolve the Np-hard optimization problems. These algorithms are applied by several scientists in the field of ASC optimization (Cheraghalipour, 2021). For instance, Cheraghalipour et al., (2018) proposed a CLSC network and a multi-objective model for optimizing citrus fruits chain costs and the responsiveness of customers’ demand. Several multi-objective evolutionary algorithms, such as NRGA, MOSA, MOKA, and NSGA-II, were also applied in this research to solve the planned model. Their results were compared to each other.

In other research, Cheraghalipour et al. (2019) formulated a two-level optimization model to optimize total costs in the rice SC. Several meta-heuristic algorithms, including the Genetic Algorithm (GA) and PSO, as well as two unique hybrid algorithms based on them, were used in this study to solve the proposed model. Roghanian and Cheraghalipour (2019) proposed a multi-objective model for the citrus fruit SC network for minimizing total costs, maximizing the responsiveness of demand, and minimizing CO2 pollution. Some Pareto-based meta-heuristic algorithms were used as the solution methods, i.e., TGA, NRGA, and NSGA-II. The "ideal filter / ideal displacement" method was used to find the best algorithm. Finally, MOTGA was selected as the best algorithm. Recently, a multi-objective optimization model was developed by Sahebjamnia et al. (2020) for minimizing total costs and maximizing total profits in the ASC. Some evolutionary algorithms such as NSGA-II, MOPSO, and MOICA were also used to solve the suggested model. Salehi-Amiri et al. (2021) designed a CLSC network for walnut industry. They formulated a novel optimization model for optimizing logistics costs. They used some meta-heuristics algorithm and exact methods for solving the planned model. Rajabi-Kafshgar et al. (2023) considered the environmental impacts of agricultural wastes, and proposed a MILP model for an ASC network to minimize total costs. Some hybrid meth-heuristics algorithms such as KASA and GASA were used to find optimal solutions.

Gharye et al., (2023a) designed a dual-channel SC network for tea industry, and considered the role of traditional and digital advertising rates on demand focusing on social factors. They used some multi-objective algorithms such as MOSA, MOGWO and MOWOA to solve their model. Gholian-Jouybari et al., (2023) proposed a new sustainable MILP model to optimize the total net profit while monitoring CO2 emissions and the satisfaction of customers for the soybean industry. Some multi-objective optimizers such as MOGWO and MOHHSA were utilized to solve their model.

2.3 Considering uncertainty in ASC optimization models

Since the production of agricultural products is affected by climatic conditions, and the market for agricultural products is susceptible to economic fluctuations, ASC managers should consider the uncertainty in decision-making process. In many studies in the field of ASC optimization, uncertainty in the model has been considered. For example, Motevalli-Taher et al. (2020) presented a new model for optimizing wheat production under demand uncertainty. Cost and water consumption minimization, and job opportunity maximization were considered as the objective functions. In addition, the simulation approach was used to estimate demand under uncertainty. In this research, a robust probabilistic optimization approach, and epsilon constraint method were used to handle uncertainty and to solve the model, respectively.

Gilani and Sahebi (2021) proposed a bi-objective mathematical model for optimizing the profit and the amount of pollutants in the pistachio SC under both demand and cost uncertainty. Clavijo-Buritica et al. (2023) considered a resilience agro-food SC network during disruptions, and combined optimization and simulation schemes to address the uncertainty. Gharye et al. (2023b) investigated weather conditions and economic fluctuations in different scenarios in date fruit SC using a robust MILP model.

3 Research gap and innovation

Table 1 shows a summary of related articles to shed light on the research gap. All of these articles are related to the field of ASC optimization. By reviewing the articles, it can be concluded that mathematical models have been studied in very few articles to achieve an optimized solution for the pistachio SC network. Also, considering uncertainty in ASC optimization model is rarely seen. In addition, the use of reverse logistics in the ASC is infrequent.

Table 1 Some papers published in the field of ASC

In the current research, an innovative mathematical model is introduced to fill the research gap by optimizing the CLSC of pistachio under uncertainty. A robust optimization approach is used to deal with uncertainty. Also, it is assumed that the demand for the product depends on the freshness and price of the product. GAMS software and meta-heuristic algorithms are used as solution methods to solve the proposed model. During each period, our model aims to find the best location for the construction of new facilities, determine the optimal flow of the product and its waste between the facilities, and the level of inventory of processed product (pistachio nuts) in each warehouse. The structure of the suggested logistics network and the mathematical model are described in the following chapters.

4 Problem definition

A pistachio CLSC network is presented in this work. The network is developed to be a multi-period type, is composed of farmers (producers), distribution (processing) centers, factories, customers areas, recyclers (compost production centers), and compost customers (pistachio farmers) as shown in Fig. 3. In the forward flow, the raw products are sent from the farmers to the processing centers for peeling, washing, separating, sorting, and packaging. Because the maximal harvest and processing duration of raw pistachios are two months, forward and reverse flows in the pistachio logistics network are only arranged in two periods. Then, the processed pistachios (pistachio nuts) are packed and transported to a warehouse with a maximum storing time of twelve months. In the next step, the goods are sent from the warehouse to customers to meet their demand.

Fig. 3
figure 3

The presented CLSC network of pistachio

In the reverse flow, the waste from pistachio processing (i.e., its soft shell) is sent from processing centers to bio-refineries and recyclers to produce biofuels and compost, respectively. Finally, the produced compost in the reprocessing centers is sent to its relevant customer (pistachio producers). Since, farmers (gardeners) are the customers of fertilizers, the network can be regarded as a CLSC.

4.1 Demand function modeling

In our study, the demands of customers are assumed to be sensitive to the price and freshness of product, as follows:

$$dm_{mt} = \alpha \times pr_{mt}^{ - \xi } \times f\left( t \right)$$
(1)
$$f\left( t \right) = e^{ - \sqrt t }$$
(2)

In these equations, \(pr_{mt}\) is the price of product in market m in period t, \(\alpha\) is a constant parameter, and \(\xi\) is the price elasticity of demand. Moreover \(f\left( t \right) = e^{ - \sqrt t }\) indicates the freshness of the product, which decreases with time period.

4.2 Model assumptions

  • The designed CLSC network is multi-period, and has four levels.

  • Transportation costs between network facilities are considered per unit of product.

  • The location of farmers, processing centers, bio-refineries, existing recyclers and customer zones is predetermined and constant. Some points are potential centers for opening new recyclers.

  • All centers have a limited capacity.

  • The demand for the product depends on the freshness and price of the product.

  • The demand and production capacity of farmers are assumed to be uncertain.

  • A time horizon of 1 year is considered.

5 Sets and indicators

\(I\)

Set of farmers indexed by \(i \in I\)

\(J\)

Set of processing centers indexed by \(j \in J\)

\(W\)

Set of warehouse points indexed by \(w \in W\)

\(B\)

The set of Bio-refinery points indexed by \(b \in B\)

\(M\)

Set of customers points (markets) indexed by \(m \in M\)

\(T\)

Set of period indexed by \(t \in T = \left\{ {1,2, \ldots ,t^{\prime } , \ldots ,T} \right\}\) and \(t^{\prime } \left( {{\text{harvest}}\;{\text{ period}}} \right) \subseteq T\)

\(T^{\prime }\)

Set of harvest period indexed by \(t^{\prime } \in T^{\prime } = \left\{ {1,2} \right\} \subseteq T\)

\(C_{1}\)

Set of existing recyclers indexed by \(c_{1} \in C_{1}\)

\(C_{2}\)

Set of new recyclers indexed by \(c_{2} \in C_{2}\)

\(C\)

Set of all recyclers indexed by \(c \in C = C_{1} \cup C_{2}\)

5.1 Parameters

\(fc_{{c_{2} }} { }\)

Constant cost of opening recyclers \(c_{2}\)

\(cpa_{i} { }\)

Producing cost for one unit of a product for farmer \(i\)

\(txi_{it}\)

Co2 emission tax per unit of product for farmer \(i\) in period \(t\)

\(cpc{}_{c}^{ } { }\)

Producing cost per unit of a compost by recycler \(c\)

\(pr{}_{mt}^{ } { }\)

The price of product in market \(m\) in period \(t\)

\(txc{}_{ct}^{ } { }\)

CO2 emission tax per unit of compost for recycler \(c\) in period \(t\)

\(capw_{w}\)

Holding capacity of warehouse \(w\)

\(capj_{j}\)

Holding capacity of processing center \(j\)

\(capc_{ct}\)

Compost manufacturing capacity of recycler \(c\) at time \(t\)

\(chw_{wt}\)

Holding cost of one unit product for warehouse \(w\) in the period of \(t\)

\(cta_{ij}\)

Transporting cost of one unit of product between farmer \(i\) and processing center \(j\)

\(ctb_{{jw{ }}}\)

Transporting cost of one unit of product between processing center \(j\) and warehouse \(w\)

\(ctc_{wm}\)

Transporting cost of one unit of product between warehouse \(w\) and market \(m\)

\(ctd_{jb} { }\)

Transporting cost of one unit of product between processing center \(j\) and bio-refinery \(b\)

\(cte_{jc}\)

Transporting cost of one unit of product between processing center \(j\) and recycler \(c\)

\(ctf_{ci}\)

Transporting cost of one unit of product between recycler \(c\) and farmer \(i\)

\(mincap_{{it^{\prime } }}\)

Minimum of production by farmer \(i\) in the period of \(t^{\prime }\)

\(\beta\)

The conversion rate of raw pistachio to waste

\(1 - \beta\)

The conversion rate of raw pistachio to the processed product

\(\varphi\)

The conversion rate of waste pistachio to compost

\(dc_{{ct^{\prime } }}\)

Demand for compost by recycler in the period of \(t^{\prime }\)

\(di_{it}\)

Demand for compost by farmer \(i\) in the period of \(t\)

\(db_{{bt^{\prime } }}\)

Demand for compost by bio-refinery \(b\) in the period of \(t^{\prime }\)

\(M\)

A large positive number

\(cpj_{j}\)

Processing cost of one unit of product for processing center \(j\)

5.1.1 The uncertain parameters

\(\widetilde{{cap_{{it{^{\prime}}}} }}\)

Production capacity for farmer \(i\) in the period of \(t^{\prime }\)

\(\widetilde{{dm_{mt} }}\)

The demand for the processed pistachio by the customer (market point) \(m\) in the period \(t\)

5.1.2 Positive decision variables

\(Xhw_{{wt{ }}}\)

The amount of stored product in warehouse \(w\) in the period of \(t\)

\(Xa_{{ijt^{\prime } }} { }\)

The amount of the transported product from farmer \(i\) to processing center \(j\) in the period of \(t\)

\(Xb_{{jwt^{\prime } }} { }\)

The amount of the transported product from processing center \(j\) to warehouse \(w\) in the period of \(t^{\prime }\)

\(Xc_{{jbt^{\prime } }}\)

The amount of the transported pistachio waste from processing center \(j\) to bio-refinery \(b\) in the

period of \(t^{\prime}\)

 

\(Xe_{{jct^{\prime } }}\)

The amount of the transported pistachio waste from processing center \(j\) to recycler \(c_{ }\) in the period of \(t^{\prime}\)

\(Xg_{{wmt^{\prime } }}\)

The amount of the transported pistachio from warehouse w to market m in the period of \(t^{\prime}\)

\(Xf_{{cit{ }}}\)

The amount of the transported compost from recycler \(c\) to farmer \(i\) in the period of \(t\)

5.1.3 Binary decision variables

$${\text{V}}_{{c_{2} }} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {{\text{if}}\;{\text{new}}\;{\text{recycler}}\;{\text{c}}2\;{\text{is}}\;{\text{opened}}} \hfill \\ 0 \hfill & {O.W} \hfill \\ \end{array} } \right.$$

The objective function of the model (3) aims to optimize all related costs to the SC network. These costs include fixed opening cost, transportation cost, maintenance cost for processing centers, production and Co2 emissions tax for farmers, processing and Co2 emissions tax for processing centers, and reprocessing cost for recyclers.

$$\begin{aligned} {\text{Min}}\;{\text{Costs}} & = \mathop \sum \limits_{{c_{2} \in C_{2} }} fc_{{c_{2} }} \times v_{{c_{2} }} + \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{i \in I} \mathop \sum \limits_{j \in J} cta_{ij} \times Xa_{{ijt^{\prime } }} + \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{j \in J} \mathop \sum \limits_{w \in W} ctb_{jw} \times Xb_{{jwt^{\prime } }} \\ & \quad + \mathop \sum \limits_{t \in T} \mathop \sum \limits_{w \in W} \mathop \sum \limits_{m \in M} ctc_{wm} \times Xg_{wmt} + \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{j \in J} \mathop \sum \limits_{{b \in {\rm B}}} ctd_{jb} \times Xc_{{jbt^{\prime } }} + \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{j \in J} \mathop \sum \limits_{c \in C} cte_{jc} \times Xe_{{jct^{\prime } }} \\ & \quad + \mathop \sum \limits_{t \in T} \mathop \sum \limits_{{i \in {\rm I}}} \mathop \sum \limits_{c \in C} ctf_{ci} \times Xf_{cit} \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{i \in I} \mathop \sum \limits_{j \in J} \left[ {cpa_{{it^{\prime } }} + txi_{it} } \right] \times Xa_{{ijt^{\prime } }} + \mathop \sum \limits_{w \in W} \mathop \sum \limits_{{t^{\prime } \in T}} chw_{wt} \times Xhw_{wt} \\ & \quad + \mathop \sum \limits_{{i \in {\rm I}}} \mathop \sum \limits_{j \in J} \mathop \sum \limits_{{t^{\prime } \in T}} cpj_{j} \times Xa_{{ijt^{\prime } }} + \mathop \sum \limits_{t \in T} \mathop \sum \limits_{i \in I} \mathop \sum \limits_{c \in C} \left[ {cpc_{c} + txc{}_{ct}^{ } } \right] \times Xf_{cit} + \mathop \sum \limits_{t \in T} \mathop \sum \limits_{w \in W} \mathop \sum \limits_{m \in M} pr{}_{mt}^{ } { } \times Xg_{wmt} \\ \end{aligned}$$
(3)

5.2 Constraints

5.2.1 Capacity constraints

$$mincap_{{it^{\prime } }} \le \mathop \sum \limits_{j \in J} Xa_{{ijt^{\prime } }} \le \widetilde{{cap_{{it^{\prime } }} }} \quad \forall i \in I, t^{\prime } \in T$$
(4)
$$\mathop \sum \limits_{{i \in {\rm I}}}^{ } Xf_{{c_{1} it}} \le capc_{{c_{1} t}} ,\quad \forall c_{1} \in C_{1} , \forall t \in T$$
(5)
$$\mathop \sum \limits_{{i \in {\rm I}}}^{ } Xf_{{c_{2} it}} \le capc_{{c_{2} t}} \cdot V_{{c_{2} }} ,\quad \forall c_{2} \in C_{2} , \forall t \in T$$
(6)
$$\mathop \sum \limits_{{i \in {\rm I}}} Xa_{{ijt^{\prime } }} \le capj_{j} ,\quad \forall j \in J,t^{\prime } \in T$$
(7)
$$Xhw_{wt} \le capw_{w} , \quad \forall w \in W, \forall t \in T$$
(8)

5.2.2 Balancing constraints

$$\left( {1 - \beta } \right) \cdot \mathop \sum \limits_{i \in I} Xa_{{ijt^{\prime } }} \ge \mathop \sum \limits_{w \in W} Xb_{{jwt^{\prime } }} \quad \forall j \in J, t^{\prime } \in T$$
(9)
$$\left( \beta \right) \cdot \mathop \sum \limits_{i \in I} Xa_{{ijt^{\prime } }} \ge \mathop \sum \limits_{b \in B} Xc_{{jbt^{\prime } }} + \mathop \sum \limits_{c \in C} Xe_{{jct^{\prime } }} , \quad \forall j \in J,t^{\prime } \in T$$
(10)
$$Xhw_{{wt^{\prime } }} = Xhw_{{wt^{\prime } - 1 }} + \mathop \sum \limits_{j \in J} Xb_{{jwt^{\prime } }} - \mathop \sum \limits_{m \in M} Xg_{{wmt^{\prime } }} , \quad \forall w \in W, t^{\prime } \in T$$
(11)
$$\mathop \sum \limits_{j \in J} \mathop \sum \limits_{t^{\prime} \in T} Xe_{{jc_{2} t^{\prime } }} \le M \times V_{{c_{2} }} ,\quad \forall c_{2} \in C_{2}$$
(12)
$$\varphi \cdot \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{j \in J} Xe_{{jct^{\prime } }} = \mathop \sum \limits_{{t^{\prime } \in T}} \mathop \sum \limits_{i \in I} Xf_{{cit^{\prime } }} , \quad \forall c \in C$$
(13)
$$\mathop \sum \limits_{{t^{\prime } \in {\rm T}}} \mathop \sum \limits_{j \in J} Xb_{{jwt^{\prime } }} = \mathop \sum \limits_{{t \in {\rm T}}} \mathop \sum \limits_{m \in M} Xg_{wmt} , \quad \forall w \in W$$
(14)

5.2.3 Demand constraints

$$\mathop \sum \limits_{w \in W}^{ } Xg_{wmt} \ge \widetilde{{dm_{{mt^{\prime } }} }}\quad \forall m \in M,t' \in T'$$
(15)
$$\mathop \sum \limits_{j \in J}^{ } Xc_{{jbt^{\prime } }} \ge db_{{bt^{\prime } }} , \quad \forall b \in B,t^{\prime } \in T'$$
(16)
$$\mathop \sum \limits_{j \in J}^{ } Xe_{{jc_{1} t^{\prime } }} \ge dc_{{c_{1} t^{\prime } }} ,\quad \forall t^{\prime } \in T,c_{1} \in C_{1}$$
(17)
$$\mathop \sum \limits_{j \in J}^{ } Xe_{{jc_{2} t^{\prime } }} \ge dc_{{c_{2} t^{\prime } }} \cdot V_{{c_{2} }} ,\quad \forall c_{2} \in C_{2} ,t^{\prime } \in T$$
(18)
$$\mathop \sum \limits_{c \in C}^{ } Xf_{cit} \ge di_{it} ,\quad \forall i \in I , \forall t \in T$$
(19)

5.2.4 Decision variables types

$$\begin{aligned} & Xa_{{ijt^{\prime } }} ,Xb_{jwt} ,Xc_{{jbt^{\prime } }} ,Xg_{wmt} ,Xe_{jct} ,Xf_{{cit^{\prime } }} ,Xhw_{wt} \ge 0, \\ & \forall i \in I , \forall t \in T,\forall c \in C, \forall m \in M,\forall w \in W \\ & \forall j \in J,\forall b \in B, \forall c_{2} \in C_{2} , Vc_{2} \in \left\{ {0,1\} } \right. \\ \end{aligned}$$
(20)

Constraint (4) is considered to ensure that the harvest of each farmer is between the minimum and maximum of predicted production. Constraint (5) illustrates that the amount of transported compost to pistachio farmers is smaller than or equal to the production capacity of recyclers. Constraint (6) indicates that the amount of transported pistachio to the warehouse should be smaller than or equal to the holding capacity of each warehouse. Constraint (7) shows that the amount of transported raw pistachio to processing centers should be smaller than or equal to the holding capacity of each processing center. Constraint (8) indicates that warehouse inventory in each period must be smaller than or equivalent to its storage capacity.

Constraint (9) is considered to balance the flow of processing centers. So, all raw pistachios received from farmers multiplied by the conversion rate to the processed pistachio is greater than or equal to the total processed pistachio in warehouses. Constraint (10) is similar to constraint (9), which is considered the amount of raw pistachio in each processing center multiplied by the conversion rate to waste is greater than or equal to the amount of transported waste to recyclers and bio-refineries. Constraint (11) illustrates the balance of the processed pistachio inventory in the warehouse. This constraint states that the amount of inventory in each warehouse in each period is equivalent to the inventory level for the previous period plus the amount of processed pistachio received from processing centers minus the amount of the delivered product to consumers. Constraint (12) ensures that the waste of pistachio processing is transported to the new recycler only if the new center is opened. Constraint (13) is defined to ensure that all received pistachio waste from processing centers multiplied by the compost conversion rate equals the total delivered compost to the farmers. Constraint (14) balances the flow of warehouses.

Constraints (15), (16), (17), (18) and (19) indicate that the demand for each facility in each period must be met and, finally, constraint (20) defines the type of decision variables and their non-negativity.

5.3 Robust counterpart

Here, to deal with the uncertainty of parameters, a robust optimization proposed by Ben-Tal and Nemirovski (1998) is employed. In this approach, it is assumed that each of the uncertain parameters changes in an interval uncertainty set, as follows:

$$\tilde{\tau } = \overline{\tau } + \varphi \hat{\tau } \forall \tilde{\tau } \in R$$
(21)

In this set, \(\overline{\tau }\) is the nominal values, \(\hat{\tau }\) is a constant deviation and \(\left| \varphi \right| \le \sigma\) is the scale of uncertainty in which \(\sigma\) is the radius bound.

Considering the mathematical model with uncertain parameters, including \(\tilde{a},\tilde{b},\tilde{c}{ }\) and \(\tilde{d}\):

$$Max \tilde{c}{ }x + \tilde{d}$$
(22)
$$s.t.~ \tilde{a}x \le \tilde{b}$$
(23)
$$x \ge { }0$$
(24)

To convert mathematical modeling (Eq. (23)) and solve it, the following structure is suggested:

$$Max~ \gamma$$
$$\gamma - cx + \left[ {\sigma \left\{ {\hat{c}x + \hat{d}} \right\}} \right] \le \overline{d}$$
(25)
$$\overline{a}x + \left[ {\sigma \left\{ {\hat{a}x + \hat{b}} \right\}} \right] \ge \overline{b}$$
(26)

Here, the deterministic programming model is formulated based on the robust model to embed the uncertainty of demand and production capacity of farmers. The boundaries for uncertain parameters, according to Eq. (21), are defined as follows:

$$\widetilde{{dm_{mt} }}{ } = { }dm_{mt} { } + \varphi m_{mt} \overline{{dm_{mt} }} \quad \forall m \in M,t \in T$$
(27)
$$\widetilde{{cap_{it} }}{ } = cap_{it} + \varphi i_{it} \overline{{cap_{it} }} \quad \forall i \in I,t \in T$$
(28)

The objective function doesn’t include uncertain parameters, so the following constraints are added:

$$\mathop \sum \limits_{w \in W} Xg_{wmt} + \sigma \times \widetilde{{dm_{mt} }} \ge \overline{{dm_{mt} }} \quad \forall m \in M,t \in T$$
(29)
$$\mathop \sum \limits_{j \in J} Xa_{{ijt{^{\prime}}}} + \sigma \times \widetilde{{cap_{it} }} \ge \overline{{cap_{it} }} \quad \forall i \in I,t \in T$$
(30)

6 Solution approach

A MILP model is presented to optimize the pistachio logistics network costs in this research. To solve this model, GAMS software was used as an exact solution method and some metaheuristic algorithms with priority-based encoding were used as the proposed approach, respectively. In this section, the proposed solution approach is described through several separate subsections including Structure and display of initial solution, WOA, PSO, RSO and, RSO-PSO algorithm. In addition, it is showed that this approach can satisfy the model’s limitations.

6.1 Structure and display of the initial solution (encoding)

In this study, the priority-based encoding method introduced by Gen et al. (2006) is applied to display a candidate answer. To use this method to two-level SC optimization problems with I origins and J destinations, the structure of a solution will be a string of numbers with the length of I + J. Also, I + J random numbers are generated and sorted according to their priority. Then, the minimum amount is transported between the origin’s capacity and the demand of the destination from the origin and destination with the highest priority. For more details on this method, see (Gen et al., 2006). The decoding method of the solution for the model of this current research is described here. Also, the structure of the initial solution is more complex due to several periods and several levels of the proposed logistics network, so a small-scale example is described for better understanding. Assume that the total numbers of farmers, processing centers, warehouses, buyers, bio-refineries, and recyclers are 2, 2, 2, 1, 1, and 2, respectively. As shown in Fig. 4, the proposed solution is a matrix with twelve rows and 2*i + 3*j + 2*k + l + m + c columns. The cells of this matrix are packed with random numbers between 0 and 1, and these cells are sorted according to their priority in the next step. The sorting procedure of the numbers is performed separately for each section, which the first part of the proposed array is shown in Fig. 5 for better understanding. This section corresponds to the product amount transported from farmers (I) to processing centers (J). The constraints of 7, 9 and 10 are satisfied due to the encoding of the first part as shown in Fig. 6. In addition, the demands of bio-refineries and recyclers are met using the decoding of the second part. Moreover, inventory can be controlled by using the third part of the encoding. Other constraints can be met by the encoding of the rest of the sections, which are described in Fig. 23 in appendix.

Fig. 4
figure 4

A schematic diagram of proposed arrays

Fig. 5
figure 5

The proposed array, which is composed of random numbers for the first segment

Fig. 6
figure 6

The process of the priority-based decoding procedure for segment 1

6.1.1 Whale optimization algorithm

One of the most common and recent population-based algorithms was proposed by Mirjalili and Lewis (2016) called WOA, which designed based on the social behavior of humpback whales. In WOA, a series of random candidate solutions (population) and three rules is used to update and enhance the location of candidate solutions in each step that is common in other population-based algorithms. Indeed, these three rules are including encircling prey, spiral updating location and searching for prey. A list of them is presented in the following:

  • Encircling prey: if (p < 0.5 and |A|< 1).

The position of the candidate solution \(\overrightarrow { X} \left( {t + 1} \right)\) is updated according to Eqs. (31) and (32):

$$\mathop {\vec{D}}\limits^{\phantom{i}} = \left| {\left. {C.\vec{X}*\left( t \right) - X\left( t \right)} \right|} \right.$$
(31)
$$\mathop {\overrightarrow { X} \left( {t + 1} \right) = \overrightarrow {X*} }\limits^{\phantom{i}} \left( t \right) - \overrightarrow {A.} \vec{D}$$
(32)

where \(\overrightarrow { X} \left( {t + 1} \right)\) is used to show the best candidate solution for the current generation. \(\vec{A}~ and ~\vec{D}\) are calculated according to Eqs. (33) and (34):

$$\vec{A} = { }2\vec{a}*r - \vec{a}$$
(33)
$$\vec{C} = 2*r$$
(34)

where a linearly decrease from 2 to 0, and r is a random vector in [0,1] interval.

  • Search for prey: if (p < 0.5 and |A|< 1)

Both searching for prey and encircling prey are very similar, but instead of using \(\overrightarrow { X} {*}\), in searching for prey, a random candidate solution \(\overrightarrow {Xrand}\) is chosen. The process is showed by Eqs. (35) and (36).

$$\mathop {\vec{D}}\limits^{\phantom{i}} = \left| {\left. {C.\vec{X}{\text{rand}}\left( t \right) - X\left( t \right)} \right|} \right.$$
(35)
$$\mathop {\overrightarrow { X} \left( {t + 1} \right) = \overrightarrow {Xrand} }\limits^{\phantom{i}} \left( t \right) - \overrightarrow {A.} \vec{D}$$
(36)

Searching for prey is applied during performing of the exploration phase, in which WOA is enabled to conduct a full global search (Mirjalili & Lewis, 2016).

  • Spiral updating position: if p < 0.5

During the WOA's exploitation process, two methods including encircling prey and spiral updating position are also used. Individual positions are modified by the spiral updating position, according to Eq. (37):

$$\vec{X}\left( {t + 1} \right) = \vec{D} {*}e^{bt} {\text{*cos}}\left( {2\pi l} \right){ } + { }\vec{X}\left( t \right)$$
(37)

where \(\mathop {\vec{D}}\limits^{\phantom{i}} = \left| {\left. {\vec{X}*\left( t \right) - X\left( t \right)} \right|} \right.\) is specified to show the distance among ith candidate solution and the best solution in the current iteration. Figure 7 shows the pseudo-code of the WOA algorithm.

Fig. 7
figure 7

Pseudo-code of the WOA algorithm (Mirjalili & Lewis, 2016)

6.2 Rat swarm algorithm

RSO was introduced by Dhiman et al. (2020) which is a population-based algorithm that mimics the mechanism of social behavior of rats in nature, such as chasing. Chasing prey and aggressive behavior of rats caused the death of some animals which is simulated as follows:

6.2.1 Chasing prey

Prey is chased by a group of rats. To model this mechanism, it is assumed that the best search agent knows the location of the prey and that other rats update their position relative to it. The following formulas are used to model this behavior:

$$P = { }A \cdot \vec{P}_{i} \left( x \right){ } + { }C \cdot \left( {\vec{P}_{r} \left( x \right) - \vec{P}_{i} \left( x \right)} \right)$$
(38)

where \(\vec{P}_{i} \left( x \right)\) and \(\vec{P}_{r} \left( x \right)\) represent the position of the rats and the best answer, respectively. In this equation, parameters A and C are defined as follows:

$$\begin{array}{*{20}l} {A = R{ } - { }x{ } \times { }\left( {\frac{R}{MaxIteration}{ }} \right)} \hfill \\ {} \hfill \\ \end{array}$$
(39)
$${\text{C }} = 2{ } \times rand$$
(40)

where R and C are random numbers between [1, 5] and [0.2], respectively. These parameters are used for better exploration and exploitation in each iteration.

6.2.2 Fight against prey

To simulate a group of rats that fights against prey, the following equation is used:

$$\overrightarrow {{P_{i} }} \left( {x + 1} \right) = \left| {\overrightarrow {{P_{i} }} \left( x \right) - P} \right|$$
(41)

where \(\overrightarrow {{P_{i} }} \left( {x + { }1} \right){ }\) shows the next position of the rats in the next iteration so that the others update their positions using this variable. The simulation of these equations is shown in Fig. 8. According to this figure, rat (A, B) can update their location to the location of their prey. By setting the parameters, a number of different situations can be achieved in the current position. Thus, exploration and exploitation can be guaranteed by parameters A and C. The pseudo-code of this algorithm is shown in Fig. 9.

Fig. 8
figure 8

3D position vectors of rats

Fig. 9
figure 9

The pseudo code of RSO algorithm

6.2.3 Time complexity

  1. 1.

    The initialization of RSO population needs O (n × d) time where n indicates the number of iterations and, d defines the dimension of a test function to adjust the solutions within the boundary.

  2. 2.

    In the next step, the fitness calculation of each search agent requires O (MaxIteration × n × d) time where MaxIteration is the maximum number of iterations to simulate the proposed RSO algorithm.

  3. 3.

    Repeat Steps 1 and 2 until the satisfactory results is found which needs O (N) time. Therefore, the overall time complexity of RSO algorithm is O (MaxIteration × n × d × N) (Dhiman et al., 2020).

6.3 Particle swarm optimization

The PSO is a meta-heuristics algorithm proposed based on the social behavior of birds' flocks (Coello Coello & Lechuga, 2002). Particles as a population of candidate solutions move across the search space in this algorithm, which is following basic mathematical formulae over the particle's position and corresponding velocity, as below formulation:

$$\begin{aligned} V_{ij} { }\left( {t{ } + { }1} \right){ } & = { }W \times V_{ij} { }\left( t \right){ } + { }c_{1} r_{1j} \left( t \right)\left[ {p_{ij} \left( t \right) - x_{{ij{ }}} \left( t \right) } \right] \\ & \quad + c_{2} r_{2j} \left( t \right)\left[ {g_{j} \left( t \right) - x_{{ij{ }}} \left( t \right) } \right] \\ \end{aligned}$$
(42)
$$x_{ij} \left( {t{ } + { }1} \right){ } = { }x_{ij} { }\left( t \right){ } + { }V_{ij} { }\left( {t{ } + { }1} \right){ }$$
(43)

where \({ }V_{ij} \left( {t{ } + { }1} \right) ,x_{ij} \left( t \right)\) are particle velocity and particle position, respectively;\({ }p_{ij} \left( t \right)\) is the individual local of best position and \({\text{ g}}_{j} { }\left( t \right)\) is the global best solution at that iteration. Moreover, W is the inertia weight factor that has a great impact on the dynamic fly of the particle, and C1 and C2 represent the acceleration constants and \(x_{ij} \left( {t{ } + { }1} \right){ }\) is the new position of the particle. In this Algorithm, the particle best position \(\left( {pbest} \right)\) and the global best position \(\left( {gbest} \right)\) are updated by Eq. (44).

$$\begin{aligned} pbest_{ } \left( {t + 1} \right) & = x_{i,j} \left( {t + 1} \right) \\ gbest_{ } \left( {t + 1} \right) & = x_{i,j} \left( {t + 1} \right) \\ \end{aligned}$$
(44)

The process will continue till obtaining the best possible solution, otherwise particles’ velocity and, position must be updated. The time complexity of PSO is O (DN) (D and N are the dimensionality and population size, respectively.

6.4 RSO-PSO hybrid algorithm

In this subsection, a new hybrid algorithm of PSO and RSO is presented. In this algorithm, a combination of different formulas and operators are used based on these algorithms. The algorithm starts with a population of candidate rats that have random positions and speeds in the search space. They can memorize their positions and the best position (\(pbest\)) and the best global position (\(gbest\)) similar to the PSO algorithm. For each primary iteration, the RSO is performed for a specific number of secondary iterations, and the best rat qualification is considered as \(gbest\). Next, for some sub-third-party iterations, the PSO algorithm starts by updating the position, velocity, \(pbest\), and \(gbest\) using the PSO mechanism and Eqs. 8 and 9. Finally, a comparison is performed between the two different best answers obtained by the PSO and the RSO, and a more appropriate answer is considered as \(gbest\). This process continues till ending the initial iterations. The flowchart and Pseudo-code of the proposed RSO-PSO hybrid algorithm is demonstrated in Figs. 10 and 11.

Fig. 10
figure 10

Flowchart of the hybrid RSO-PSO

Fig. 11
figure 11

Pseudo-code of the hybrid RSO-PSO algorithm

6.4.1 Time complexity of RSO-PSO

  1. 1

    The initialization of RSO-PSO population needs O (n × m × d) time where n and m indicate the number of RSO and PSO iterations and d defines the dimension of a test function.

  2. 2

    In the next step, the fitness calculation of each search agent requires O (RSOMaxIteration × PSOMaxIteration × n × d) time where RSOMaxIteration and PSOMaxIteration are the maximum number of iterations in RSO and PSO.

  3. 3

    Repeat Steps 1 and 2 until the satisfactory results is found which needs O (M) time. Therefore, we can conclude that the overall time complexity of RSO-PSO algorithm is O (RSOMaxIteration × PSOMaxIteration × n × d × M).

6.5 Evaluation of metaheuristics using benchmark functions

This section employs a benchmark outline to analyze the capability of meta-heuristics algorithms. A set of constrained problems from DTLZ (Deb et al., 2005), which are represented in Table 9 in Appendix are selected to evaluate the performance of the proposed metaheuristics. The numerical results are available in Table 2. According to the obtained results, it can be concluded that RSO-PSO outpaced the other optimizers.

Table 2 The obtained average deviation results of algorithms on unimodal benchmark tests

7 Case study and results

The correctness of the presented model is investigated through a real case study in Kerman province, Iran. At present, the pistachio cultivated area in Iran is approximately more than 300,000 hectares, and Kerman province, with a total of 200,000 hectares, provides 67% of the total pistachio in Iran (Taghizadeh-Alisaraei et al., 2017). In this study, information was collected as input data from some pistachio farmers to close the case study to reality. Some cities of Kerman province including Rafsanjan, Ravar, Zarand, Anar, Kerman, and Sirjan, are selected to collect data, which are considered as farmers, processing centers, recyclers and warehouses. The location of these cities is shown in Fig. 12. In addition, consumers are considered among other provinces of Iran, which are highlighted in Fig. 13. Besides, as shown in Table 3, ten test problems are created depending on the number of network facilities for evaluating the effectiveness of the proposed model. In addition, Table 4a and 4b show the transportation costs between the mentioned facilities. These costs are calculated using the distance between the abovementioned cities (kilometers) and Iranian fare rates (dollars per kilometer). The conversion rate of raw pistachio to processed pistachios is approximately determined to 0.7 according to the collected information. Therefore, the conversion rate of raw pistachio to waste is about 0.3. Moreover, the conversion rate of waste pistachio to compost is 1.3. The price of product per Kg is between 7$ and 8$).There was a challenge to find exact data concerning the amount of demand, capacity and costs of related companies in the pistachio industry. For these reasons, the required data are mostly approximated, which are presented in Table 5.

Fig. 12
figure 12

The main cities of Kerman Province

Fig. 13
figure 13

Customer zones locations highlighted in blue color

Table 3 The general data about the test problems
Table 4 The cost of transportation between the mentioned cities (unit: dollar per ton)
Table 5 Adjustments for other parameters of the model

7.1 Parameter adjustment

The efficiency and effectiveness of any meta-heuristic algorithms depended on the proper adjustment of their parameters. Several methods have been proposed to adjust these parameters that the Taguchi method is used in this study. In this method, a group of factors is classified into two main subclasses based on orthogonal arrays, namely control and perturbation factors (Roghanian & Cheraghalipour, 2019). The influence of control and perturbation factors simultaneously is changed to maximum and minimum amounts, respectively. The optimum level for a factor is the one that produces the highest signal-to-noise ratio (S/N) (Liao et al., 2020). This ratio measures the level of changes during the process, which is calculated using the following formula.

$${\text{SN }} = { } - 10{\text{ log}}\left( {{ }\frac{{\mathop \sum \nolimits_{i = 1}^{n} Y^{2} }}{n}} \right)$$
(45)

where the response value in this equation is showed by \(Y\) and the number of orthogonal arrays is showed by \(n\) (Cheraghalipour et al., 2018).

Three levels for each parameter are considered to obtain better performance of the algorithms, which are shown in Table 6. According to these levels, the Taguchi design method presents the L9 orthogonal array for PSO and WOA and the L27 for RSO and hybrid RSO-PSO. After performing the Taguchi experiment in the Minitab software, the best level for each parameter is obtained using the diagrams of the S/N ratio (Figs. 14, 15, 16, 17). The best value for each level is the value that the diagram reaches its maximum value. The best values ​​for the algorithm’s parameters are shown in the right column of this table. For example, the best value for the maximum repetition parameter is 150. These optimal values ​​are usable in all sample problems.

Table 6 Algorithm’s parameters and their levels
Fig. 14
figure 14

Diagram of the S/N ratio for WOA

Fig. 15
figure 15

Diagram of the S/N ratio for PSO

Fig. 16
figure 16

Diagram of the S/N ratio for RSO

Fig. 17
figure 17

Diagram of the S/N ratio for RSO-PSO

7.2 Analysis and comparison of results

In this sub-section, the suggested model is examined on ten sample problems designed in the previous section. Hence, sample problems 1–5 and 6–10 are considered as small- and medium-size problems, respectively. Then the proposed model and the meta-heuristic algorithm are encoded in GAMS software and MATLAB software, respectively. For performing calculations, a computer with 4 GB of RAM and a 2.2 GHz CPU was used. The numerical and graphical results obtained from solving the model are demonstrated in Table 7 and Fig. 18, respectively. The difference between GAMS and the proposed hybrid approach (RSO-PSO) results in all sample problems is acceptably between 0.009 and 0.028. According to the obtained results, this solution approach is valid for solving large-scale problems. Moreover, Table 8 and Fig. 19 display the running time of the described meta-heuristic algorithms. This table illustrates that the running time of the algorithm increases following an increase in the problem size. Overall, according to these tables, although the hybrid algorithm has more execution time, it provides better results.

Table 7 The obtained computational results via solving the model
Fig. 18
figure 18

Graphical diagram of the obtained results via GAMS and the proposed solution approach

Table 8 Metaheuristic Algorithms’ run time (Second)
Fig. 19
figure 19

Graphical diagram of the execution time

7.3 Sensitivity analysis

For further evaluating the proposed model, sensitivity analysis is conducted on different values of the demand parameter, and Co2 emissions tax for recyclers. It should be remembered that the first sample problem is subjected to sensitivity analysis.

7.3.1 Demand

The diagram of the objective function values for different demands of pistachio (between 1400 and 1500 kg) is presented in Fig. 20. As can be shown, when the demand increases from 1450 to 1460, the total costs will also increase by 4.4%. The higher the demand, the more product will be moved, which leads to an increase in costs.

Fig. 20
figure 20

The effect of increasing demand parameter on the objective function

7.3.2 Co2 emissions tax for recyclers

Here, we perform a sensitivity analysis on Co2 emissions tax fluctuations. After solving with GAMS software, the obtained outcomes are shown in Fig. 21. Sensitivity analysis shows that with a 10% increase in Co2 tax, the total costs will also increase by 0.4.4%, but when the demand value increases from 10 to 20%, total costs will increase slowly.

Fig. 21
figure 21

The effect of Co2 tax for recyclers on total costs

7.3.3 The scale of uncertainty (\(\varphi )\)

In this section, the effect of changing the scale of uncertainty on the objective function is investigated. Figure 22 assesses the presented robust model with several values of uncertainty levels in the first test problem. As seen in this figure, the objective function increases with an increase in this parameter.

Fig. 22
figure 22

The effect of uncertainty levels on total costs

8 Conclusions, managerial insights and suggestions for future studies

Optimal use of pistachio waste is one of the significant challenges in the pistachio SC, which these wastes are produced after pistachio processing. In this paper, a CLSC network was firstly organized for pistachio products, which is rarely considered by researchers. The proposed network structure was a four-level network, in which farmers were defined as the lowest level. The second layer is processing centers for processing raw pistachio products that are received from farmers. Then they sent the processed and packaged pistachios to the warehouse for storing in the third layer. Besides, produced waste in processing centers was sent to bio-refineries and recyclers for producing biofuel and compost. In the fourth layer, processed pistachios were shipped from the warehouse to the consumer points, and the produced composts were sent to the farmers to meet their demand in the last level. In the present problem, a MILP model was developed to optimize the total costs under uncertainty of demand and capacity of farmers. These costs included transportation costs between network layers, production costs and Co2 emissions tax for farmers and recyclers, storing costs of warehouses, and fixed costs for opening new recyclers. The mathematical model was proposed to address strategic and several operational decisions such as the construction of recyclers, product flow rate, and the amount of inventory level. The demand for the product was sensitive to the freshness and price of the product. Then, GAMS software and some metaheuristic algorithms including WOA, PSO, RSO, and also a new hybrid algorithm based on RSO and PSO called RSO-PSO were used to solve this model in low and medium dimensions. Besides, parameters of the meta-heuristic algorithm were adjusted via the Taguchi method for obtaining better results and performance, and the obtained results from solving the model were analyzed. In addition, to more measurement, a sensitivity analysis was performed on some key parameters. In this paper, ten test problems with different sizes were used to evaluate the efficiency of the presented solution approach, and the obtained results indicated that this hybrid approach can be used to solve large-scale problems.

8.1 Managerial insights

The results of this research can be used by decision-makers and managers in agricultural fields. Besides, the applications of the presented model can be expanded to optimize the SC of some other agricultural products such as citrus, crops, etc. The planed model can assist marketing executives, and production directors in their economic decision-making process. Correspondingly, the planned model can help relevant managers in the agricultural sector to better distribute products in local markets when faced with demand uncertainty.

8.2 Limitations and future directions

Although this research designed a framework to optimize the pistachio SC, it seems to have many limitations. For example, collecting real data was beyond the author’s ability. Therefore, some of model’s parameters were generated based on existing information. Considering water resources or pistachio production methods were not considered in this research. In addition, pricing or advertising decisions in modeling or disruption effects were ignored.

For developing this study in the future, the proposed model can be turned into a multi-objective model and, sustainability aspects must be integrated with it. Considering other robust optimization to deal with uncertainty are among the future suggestions that must be considered by researchers in this field. Furthermore, solving the proposed model by using heuristic methods and other meta-heuristic algorithms and, comparing their results can raise some motivation for researchers to follow this research field. Finally, due to the expansion of the Internet, it seems that the integration of ASC management with new concepts such as the Internet of Things or machine learning could improve it, which has rarely received the attention of researchers. Therefore, these issues could also be investigated in the future.