1 Introduction

Livestock production is a source of Greenhouse Gases (GHG). Emissions from this source will increase over the next 40 years as a result of increased food production [1]. Between 2005 and 2015, global milk production grew by 30% generating an 18% increase in GHG emissions from the dairy sector associated with an 11% increase in the dairy herd [2]. When not treated, animal manure becomes a major source of air and water pollution, nutrient leaching, and pathogens [3]. Animal manure purines have the greatest impact on the environment [4]. Air pollutants include odours, methane, nitrous oxide and ammonia emissions [5]. One well-known alternative is to produce biogas from the manure and slurry of dairy cows, which produces cheap energy and helps to decrease GHG emissions [2].

In this context, it is necessary to develop new technologies, as well as new ways to implement existing ones cost-effectively [1]. One option is to obtain biogas for electricity production. This process causes a significantly lower environmental impact than do conventional energy sources, contributing to the objectives of supply security and environmental sustainability. The magnitude of this contribution and the economic viability of its implementation depend on the particularities of each country. The exploitable potential of renewable resources, and their allocation by geographic information systems, reveals that the reality and characteristics of energy markets vary locally [6]. However, only one percent of the world’s manure production has been used for biogas generation [7].

Several countries, including Chile, have pursued the strategic incorporation of renewable energies in their power grid [8]. Following this line, installing biogas plants is a reasonable alternative as this technology mitigates environmental effects [9]. Moreover, the generation of electricity from biomass waste is a viable option that presents significant economic advantages in relation to the direct use of biogas [10]. Nevertheless, there are conditions that make it difficult to set up biogas plants; one of these is the lack of specifications for the transportation of substrates since the sources are generally dispersed, which limits the economies of scale and the sale of energy [11]. The absence of a distribution network in the case of biogas for use in household heating is another point to consider.

The anaerobic digestion of biomass is a complex, dynamic, and highly nonlinear process, on which hundreds of microbial populations intervene [12]. Process simulators like SIMBA#Biogas [13] and others mentioned in [14], which use mathematical models that make continuous predictions in time, have allowed to improve the understanding of this process and can be used to improve the performance of digesters [15].

While these tools are suitable for improving the efficiency of one digester in a particular scenario, to evaluate the economic efficiency of networks of biogas plants, it is necessary a methodology that, even if not as precise, allows to consider the different levels of substrate availability and transport cost (which increases with the distances) of the multiple candidate locations of the plants that can comprise the network, and the possible ways on which the available substrate must be assigned to each one of them, identifying the economies of scale.

Location models provide a criterion for choosing where to install facilities considering the location and demand of clients—in this case manure supplying farms—that have to be reached. According to [16], these can be divided into four great categories: analytic models, continuous models, network models and discrete location models, which assume that there is a discreet set of demands I, and a discrete set of candidate locations J. The problems related to these models often consist on minimizing the total weighed distance between the nodes of demand in set I and the facilities in set J. Normally, the demands are assigned to the nearest facility, as long as there is no consideration of the capacities, economies of scale or restrictions of costs, which may make more convenient to assign demands to more distant facilities [17].

Although many authors emphasize in the financial considerations of biogas plant operations, these are seldom included in the evaluation function to be optimized. Location-allocation models in the renewable energy literature tend to focus on the spatial distribution of demand [18]. In particular, functions of location allocation provided in programs like the ArcGIS Network Analyst of ESRI, try to find optimal locations for multiple facilities on a geographic area to decrease the weighed sum of the transport costs or in the travel distances between the demand points and their closest open facility [19] or, alternatively, find the minimum number of facilities required to cover all demands, given a maximum coverage radius.

Among the works developed that use this methodology are [20] who analysed the spatial distribution and amount of potential biomass for biomethane production to find the optimal location, size and number of biogas plants in southern Finland. The study concluded that the number of plants was 49, and its methodology used a radius of up to 40 km. [21] considered the location of centralized biogas plants in 139 municipalities of the Japanese island of Hokkaido, evaluating the production cost of electricity from cow manure, and concluded that its development was not possible given the cost of purchase of this type of energy in that country. He obtained the locations of the centralized biogas plants, also using ArcGIS Network Analyst’s, for minimizing the number of facilities considering a coverage radius of 10 km. [22] proposed a mixed-integer mathematical model to find the optimal location of raw material collection centres and biomethane gas plants; Franco [23] proposed a combined Analytical Hierarchy Process and Fuzzy Weighted Overlap Dominance methodology to identify the most suitable sites for building biogas plants; Bojensen [24] combines a location assignment model with a production-restricted spatial interaction model that addresses the dual problem of determining optimal location and production capacity; Velázquez-Martí [25] presented an algorithm that identifies possible points where a bioenergy plant can be located with a minimum logistic cost of supplying consumers, finding an optimal location around the points using linear programming techniques.

In Chile, according to research in the dairy sector by [26, 27], cattle effluents are used as nutrient sources through direct application to grasslands and/or supplementary crops, and just a small part of such effluents is used as base substrate for biogas generation. Given the rainfall conditions of Chile’s south, almost half the volume of the slurry generated in the dairy farms is due to the use of washing water and the contribution of rainwater. Besides, the farms work mainly under a grazing system, with a low degree of animal confinement, which usually takes place when milking the cows, and before or after this activity, in a feeding yard; therefore, a high percentage of the generated slurry is retained in the prairie.

In the south of Chile, they have used three types of digesters for the anaerobic digestion of dairy manure [28]: covered lagoon, piston flow, and complete mixing. A covered lagoon refers to tanks with an airtight cover installed to capture biogas. This design is often used for solid contents under 2% and operates at room temperature. Those of flow piston are nonmixed systems in which the waste flows semicontinuously, like a piston through a horizontal reactor that usually handles 10–14% of solid contents and operates at mesophilic temperatures. HRT hydraulic retention times range from 20 to 30 days. Finally, the full mix digesters, also called continuous stirred tank reactors (CSTR), are mixed systems in which the content of the digester is mixed by means of mechanical stirring, effluent recirculation, or biogas recirculation, and operate at mesophilic temperatures. The TRH range from 20 to 25 days [29]. It is the latter that we have considered for our research.

The total GHG emissions of the country were equivalent to 109,909 Gg of CO2 in 2013. The agriculture and livestock sector accounted for 12.5% (13,735 Gg CO2eq) of these emissions, corresponding mainly to 59.2% nitrous oxide (N2O) and 40.8% methane (CH4) [30].

In the Chilean regions of Los Ríos and Los Lagos, 53 dairy farms have been evaluated at the pre-feasibility level, for the development of larger biogas projects [28], with powers of up to 100 kW in farms having between 90 and 1000 cows. The results of these studies have not been positive, as in Chile there are no incentives associated to the abatement of GHG. Also, at the farm level there is a shortage of trained human resources; there have been problems in the design, construction and operation of biodigesters; and data from dairy production systems are not available to technology providers [28]. So, it is important to study and promote associative business [31]. This confirms what was stated by [10] who recommends considering the option of the centralized use of manure as substrate. Small farms are not encouraged to develop their own plants [32].

While Chile does not have specific promotion instruments for biogas plants, it has a complex incentive policy for renewable energies. For power plants below 9 MW connected to the distribution grid, like the ones analysed in this work, applies the PMGD scheme. This scheme allows plants operators to self-dispatch and access to a stabilized price in the electric market [33].

Considering the geographic and economic conditions of Chile, and the little availability and quality of the slurry, it is necessary a model that goes beyond the limitations of the models provided in geographic information systems. The model should allow to discard isolated farms when it is not profitable to add them to the network and capture the VPN accurately. Having in mind the low profit margin that is expected under these conditions complex factors, like the efficiency of the generators which increases with the amount of biomass, should be included. As the size of the plant increases the investment costs per kW of capacity decrease [34], therefore, clients should not necessary be assigned to the nearest open facility.

The aim of our work to determine the actual economic viability of a network of biogas plants in southern Chile. For this purpose, a model that considers the details previously indicated was developed, along with an algorithm suitable for finding efficient sets of locations with this model.

2 Proposed location algorithm

We developed an algorithm for the financially efficient location of a network of biogas plants, evaluating the plant-farm NPV in the different plant configurations, according to the following optimization model.

2.1 Optimization model

Let the set \(I=\{1..N\}\) give the potential biogas plant locations, and let set \(J=\{1..M\}\) be the farms potentially supplying the network. Let:

$$\begin{aligned} w_j&= \text {livestock units on farm }j. \\ d_{ij}&= \text {distance between potential plant }i \text { and farm }j. \end{aligned}$$

Sets J and I are assumed to be equal, as each farm is considered a potential location for a plant. \(d_ij\) corresponds to the Euclidean distance between the two points.

Configuration c, is a set of farm indices \(P \subset J\) that supply an enabled biogas plant \(p^* \in I\).

$$\begin{aligned} c = (P,p^*) : p^* \in P \end{aligned}$$
(1)

\(p^*\) is called plant farm in this configuration.

Collision occurs when two configurations a and b include the same farm.

$$\begin{aligned} \text {For} \quad a=(P_a,p_a^*) \quad \text {and} \quad b=(P_b,p_b^*) \quad \text {it happens that} \quad P_a \cap P_b \ne \phi \end{aligned}$$
(2)

Combination a combination C is a set of configurations. A combination is valid if there are not collisions between their configurations, as shown in Figure 1.

Fig. 1
figure 1

An invalid and a valid combination of two configurations

Profit function the profit of a given combination. In this case, the NPV is used according to [35]. Although it only depends on constant factors, \(\text {cowmeters}(c)\), and \(\text {cows}(c)\), this dependency is nonlinear as the reactor efficiency increases with the amount of biomass [36]. This nonlinearity implies that the assumption that it is optimal to assign each farm to the nearest plant does not always hold.

$$\begin{aligned} \mathrm{PF}(c) = NPV (\text {cows}(c),\text {cowmeters}(c)) \end{aligned}$$
(3)

Total profit function The sum of the profits of the configurations that lead to the maximization of a combination.

$$\begin{aligned} \mathrm{TPF}(C) = \sum _{c \in C} PF(c) \end{aligned}$$
(4)

Dissimilitude a distance between two combinations of the same size. For this problem, we use the minimum weight matching [37, Chapter 21.1] between the plant farms of both combinations:

$$\begin{aligned} D(A,B) = \min _{m \in M(A,B)} \sum _{(i,j) \in m} d_{ij} \end{aligned}$$
(5)

where M(AB) is the set of all possible matchings between the plant farms of A and the plant farms of B.

This is equivalent to the minimum number of kilometres required to move the coordinates of the plant farm in the configurations of one combination to obtain the coordinates of the plant farms of the other combination. This relation is symmetric and is completely geographic.

To calculate this amount, an assignment problem must be solved which consists in finding for each plant farm in this first combination, a match in the second combination, so that the sum of the distances between each pair of corresponding plant farms is the smallest possible. The Hungarian Method was used for this purpose [38].

2.1.1 Computing the NPV of a given configuration

For a configuration \(c{=}(P,i)\), the total number of livestock units reached is given by:

$$\begin{aligned} \text {cows}(c) = \sum _{j\in P} w_j \end{aligned}$$
(6)

The sum of the distance travelled to connect each livestock unit to the network is:

$$\begin{aligned} \text {cowmeters}(c) = \sum _{j\in P} w_j d_ij. \end{aligned}$$
(7)

In summary, the resulting problem is:

$$\begin{aligned} \max _{C \in {\mathcal {C}}} \text {TPF}(C) \end{aligned}$$
(8)

where \({\mathcal {C}}\) is the set of all possible combinations:

$$\begin{aligned} {\mathcal {C}} = \{ \{(F_i,i) | i \in K\} \, | K \subseteq I, (F_i \subseteq J, \forall i \in K) : \forall (i,j \in K) \,((i {=} j) \vee (F_i {\cap } F_j {=} \phi )) \} \end{aligned}$$
(9)

2.2 Proposed search algorithm

We propose a search heuristic to find the best combination C for the model described. Below we define the initialization process, generation of new solutions and stopping criteria for the procedure.

2.2.1 Obtaining initial combinations

For each farm, we seek the configuration which produces the highest profit. We start with a configuration that includes only the plant farm in question, and all the other farms are added progressively according to their distance from that farm. Of all the configurations tested, the one with the highest profit is chosen:

$$\begin{aligned} BC = \left\{ C_i = \mathop {{{\,\mathrm{arg\,max}\,}}}\limits _{c \in C_i'} PF(c) \quad : \quad PF(C_i) \ge 0 \right\} \end{aligned}$$

where

$$\begin{aligned} C_i' = \cup _{k \in 1..n} \{ (P_{ik},i) \} \end{aligned}$$

and \(P_{ik}\) are the indices of the k farms closest to farm i. These best configurations are recorded as they will be used later to expand a set of stored combinations, which we refer to as the pool.

Then, for each best configuration, a combination is created that only includes that configuration. These combinations form the basis for the first generation of combinations:

$$\begin{aligned} B_1 = \{ \{c\} : c \in BC \} \end{aligned}$$
(10)

2.2.2 Generation of new combinations

In each iteration of the algorithm, up to P combinations are chosen from the current generation trying to maximize the dissimilitude between pairs.

The selected combinations form the pool of this generation and are then used to build the next generation. This approach is similar to a beam search [39] but tree branches are not only chosen by profit but also ensuring diversity between them in a disperse construction process using the reduction method explained in Sect. 2.2.4

$$\begin{aligned} P_n=\, \mathrm{Reduce}(B_n) \end{aligned}$$
(11)
$$\begin{aligned} \mathrm{Reduce}(B_n)= & {} \mathop {{{\,\mathrm{arg\,max}\,}}}\limits _{P \subseteq B, \, |P| = \text {PZ}} \quad \min _{C_i,C_j \in P, \, C_i \ne C_j} \text {Dissimilitude}(C_j,C_i) \end{aligned}$$
(12)

To form the next generation, derived combinations are obtained for each combination of the pool by adding, separately and one at a time, configurations of BC to each combination. These new combinations pass to the next generation if they increase their total profit, as:

$$\begin{aligned} B_{n+1} = \{S = \mathrm{Add}(c,p) | \quad c \in BC, p \in P_n, \mathrm{TPF}(S)> \mathrm{TPF}(p) : \forall (c' \in S)(\mathrm{PF}(c') > 0)\} \end{aligned}$$
(13)

The Add function inserts c into p modifying the configurations to manage the collisions.

2.2.3 Add function, collision management

Given a valid combination p (without collisions), if a new configuration c needs to be added to combination p, all colliding farms are assigned to the new configuration c. Then, they are sorted from the most relatively close to the most relatively distant in relation to the configuration in which they formerly were in p, using the coefficient between their distance to the plant farm of the new configuration c and the plant farm of the old configuration in p:

$$\begin{aligned} d(j,p,c) = \frac{d_{p(j)\, j}}{d_{ij}} \end{aligned}$$
(14)

where i is the plant farm of c and p(j) is the plant farm of p assigned to the colliding plant j.

In this order, the process checks whether the colliding farm j should return to p(j), comparing the total profit (TPF) before and after return.

2.2.4 Reduction method

The group of combinations to be reduced is sorted according to the TPF, from highest to lowest. Then, the dissimilitude is calculated, using the method described above, between each combination and a range R of the following combinations.

We look for the smallest dissimilitude recorded between the two combinations that provoke it, and we eliminate the combination that produces the lower total profit. Subsequently, new dissimilitudes are calculated so that, after the deletion, each solution still has its dissimilitude computed for the next R solutions. This procedure, which constitutes an approximation to a pseudo-clustering algorithm, continues until only P combinations remain.

2.2.5 Stopping criteria

The execution ends after M iterations, after \(P_M\) is calculated. Finally, the combinations of each pool are combined, and the best are retrieved.

3 Applying the model

3.1 Programming language, software and equipment used

This approach was implemented using the C++ language, the code is available onlineFootnote 1. The implementation retrieves the quantity, power generation and configurations of the best combinations found. This information was then imported into ArcGIS in order to obtain the corresponding geographic projections. The tables and maps presented in the following section were generated. The Troquil Cluster with 96 Nodes of the Centro de Excelencia de Modelación y Computación Científica was used.

3.2 Search parameter settings

In order to balance computational feasibility and quality of solutions, P was set to 1000; and M to 20. The best one hundred solutions were analysed. As the computing capacity available is limited, the range used was:

$$\begin{aligned} R = \frac{|B_n|+1}{\min \{|B_n|,1000\}} \end{aligned}$$
(15)

This was done to reduce the computing cost implied by calculating the dissimilitude between all pairs, since it is assumed that the geographical similarity between two configurations, specifically their plant farms, results in an economic similarity.

3.3 Databases

Farm locations and numbers of cows were obtained from Chile’s Livestock and Agriculture Service (SAG), responsible for keeping livestock statistics. We used data from its most recent complete database [40]. ]. The farms were filtered in order to consider only those that have 100 or more dairy cows. The total number of georeferenced farms is 572, with a combined total of 173,631 cows. The farms are distributed across three regions in southern Chile as shown in Fig. 2. These regions cover an area of 98,885.4 square kilometres [41]. Only the number of dairy cows and the geographical coordinates of the farms were considered.

Fig. 2
figure 2

Farm locations according to SAG database [40]

3.4 Parameters

We assume an animal weight of 600 kg and a daily manure production of 10% of body weight, with 4 h of confinement per day [42]. A project life cycle of 20 years is considered, with an accelerated depreciation of 3 years, and a percentage for contingencies of 15% of the initial investment; working and investment capital of 20%, and income tax at 20%. Percentage of transmission cost over income from the sale of electric power: 5%; maintenance and repair costs of equipment: 60,000 USD/yr; salaries and social security contributions: 20,000 USD/yr; other costs: 5000 USD/yr per plant/yr [36]. Sale values per MWh are assessed according to references [43, 44]. The land required for the projects is 4 hectares within the farm, regardless of the size of the plant, in order to facilitate the change of land use; the area can therefore be used for larger plants [23]. The average value of the land is 40,667 USD/plant [45]. It is estimated that the transport cost per ton kilometre is 0.3 USD [46] In each iteration, we consider an economic analysis calculating NPV according to reference [35]. As indicated in [36], the following percentages were considered: total solids amount to 24.5% of the cow manure; the volume of biogas generated is considered 55.0% methane and 45.0% carbon dioxide (this assumption is also made by [28]); 90.0% days per year that energy is generated; 15.0% energy demanded by the plant; molecular weight of methane, 16; and of carbon dioxide, 44; methane calorific value of 9.96 kWh/m3. It is considered an estimated production of 88.2 m3 of biogas, equivalent to 112.6 kg and around 483 kWh.

The sale of caloric energy was not considered due to the high cost of transportation lines and logistics. The commercialization of bioslurry was not included either, since the absorption capacity of the soils varies among farms, and its inclusion is better left as a future work.

The minimum investment cost was set to 1,050,166 USD with a power of 500 kW, an investment growth factor of 2,100.332 USD per unit of additional power (kW) was considered, according to data from biogas plants equipped with post-digesters shown in [35, 36], the cost of the whole facility, including the storage tank, is included in this cost.

The relationship between the efficiency coefficient and the generator size was obtained from [36], and a logarithmic regression was applied to obtain a continuous function, which retrieves an efficiency of 0.422 for a 500 kW generator and 0.455 for a 3000 kW generator.

Energy sale prices were considered constant for each scenario analysed, since calculating the precise sale tariff offered by the PMGD scheme would require a complex analysis for each location and plant characteristics, specified in [33].

The values of the parameters in the mass balances of waste were considered fixed, which could be achieved operationally by installing equalizing ponds in the plants in order to improve performance.

3.5 Scenarios

To find the location, power generation and NPV of combinations of biogas facilities, we consider scenarios with biomass availability between 40 and 80%, energy sale prices between 90 and 100 USD/MWh, and transport costs of 0.3 and 0.4 USD/tkm. These are outlined in Table 1.

Table 1 Parameters that were altered across the different scenarios considered. The algorithm was run once for each combination of these values

4 Results

We run two set of experiments to validate the algorithm. In Sect. 4.1, a comparison is made with ArcGIS Network Analyst for a specific set of operational conditions. Then, in Sect. 4.2, we apply the algorithm to the different scenarios mentioned previously.

4.1 Benchmark results

For comparison, the Minimize Facilities function of the ArcGIS Network Analyst [47] (NA) was used for selecting the plant farms, establishing the cover radius parameter at 10 km, 19 km, 25 km, and 50 km according to [21]; the resulting facilities were evaluated using our model. The plants that, without collisions, resulted in a negative NPV were always discarded. Even so, some configurations resulted in a negative NPV when in the combination, as they lost some farms to other plant farms.

Table 2 shows a comparison of the results obtained by both the Network Analyst and our algorithm in the most profitable scenario tested (80% biomass, 0.3 USD/tkm transport cost, and 100 USD/MWh). The TPF column shows the resulting value of the combination, while the TPF (only NPV>0) column shows the same value but discarding the configurations that have negative NPV within the combination.

Table 2 Comparison of results on the most profitable scenario

Figure 3 shows the best combination obtained using our algorithm in the most profitable scenario. Farms included in the configurations are shown as green dots and are connected to their assigned plant farm using blue lines.

Figure 4 shows the combination obtained using the ArcGIS NA with a cover radius of 25 km, which gave the most profitable results for this approach. The farms of the configurations that resulted in a negative NPV are shown in red. Figure 5 shows the resulting combinations when the cover radius is set to 50 km.

Fig. 3
figure 3

Plant locations according to our algorithm, in the most profitable scenario

Fig. 4
figure 4

Plant locations according ArcGIS Network Analyst with a maximum radius of up to 25 km, in the most profitable scenario

Fig. 5
figure 5

Plant locations according ArcGIS Network Analyst with a maximum radius of up to 50 km, in the most profitable scenario

4.2 Biogas plant network design for different scenarios

Table 3 shows the details of the best combination of facilities obtained by our algorithm for each of the scenarios tested. Each row represents one scenario and the best combination of plant farms found for that scenario. Among these, 18 farms were consistently selected to be plant farms, so, one column is used for each one of them. The inner cells show the power produced by that plant farm in that scenario, when it is present.

The left hand columns show the percentage of available biomass (%BIO), the selling price per MWh (USD/MWh) and the transport cost for each tkm (USD/tkm), for each scenario. The right-hand columns show the number plant farms (n.plants), the total power (Total KW) and the NPV (NPV USD) of the best combination found. Scenarios in which no plant was profitable were omitted from the table.

Table 3 NPVs and power generation per plant farm in different scenarios of biomass availability and transport cost

Figures 6, 7, 11, 8, 12, 9, 13, 10, and 14 show the geographic distributions of the combinations shown in Table 3. Each figure shows the best combination of one or more scenarios with the same percentage of available biomass and transport cost, but increasing the energy prices in order of reading, from top to bottom and from left to right.

In the figures that show more than one scenario, namely Figs. 6, 7, 8, 9, 10, 12, 13, and 14, it can be seen that a higher energy price allows to open more facilities, increasing the coverage of the network.

Fig. 6
figure 6

Location of the configurations of the best combination, with 40% biomass availability scenario, transport cost of 0.3 USD/tkm and energy price of 98 (left) and 100 (right) USD/MWh

Fig. 7
figure 7

Location of the configurations of the best combination found, with 50% biomass availability scenario, transport cost of 0.3 USD/tkm and energy price of 94, 96, 98, and 100 USD/MWh, in order of reading

Fig. 8
figure 8

Location of the configurations of the best combination found, with 60% biomass availability scenario, transport cost of 0.3 USD/tkm, and energy price of 90, 92, 94, 96, 98 and 100 USD/MWh, in order of reading

Fig. 9
figure 9

Location of the configurations of the best combination found, with 70% biomass availability scenario, transport cost of 0.3 USD/tkm, and energy price of 90, 92, 94, 96, 98 and 100 USD/MWh, in order of reading

Fig. 10
figure 10

Location of the configurations of the best combination found, with 80% biomass availability scenario, transport cost of 0.3 USD/tkm, and energy price of 90, 92, 94, 96, 98 and 100 USD/MWh, in order of reading

Fig. 11
figure 11

Location of the configurations of the best combination found, with 50% biomass availability scenario, transport cost of 0.4 USD/tkm and energy price of 100 USD/MWh

Fig. 12
figure 12

Location of the configurations of the best combination found, with 60% biomass availability scenario, transport cost of 0.4 USD/tkm, and energy price of 96, 98 and 100 USD/MWh, in order of reading

Fig. 13
figure 13

Location of the configurations of the best combination found, with 70% biomass availability scenario, transport cost of 0.4 USD/tkm, and energy price of 92, 94, 96, 98, and 100 USD/MWh, in order of reading

Fig. 14
figure 14

Location of the configurations of the best combination found, with 80% biomass availability scenario, transport cost of 0.4 USD/tkm, and energy price of 90, 92, 94, 96, 98 and 100 USD/MWh, in order of reading

5 Discussion

The presented algorithm allows us to obtain the location of plants and the assignment of farms to them such that the profit of each group is positive while the overall profitability is maximized. This method also allows us to identify those farms whose production level, distance to plants and cost structure do not justify their inclusion in the network. Potentially, the method could enable us to determine the threshold for them to become profitable.

As expected, the expansion of the network in terms of number of plants, farms, cows and average distance (coverage radius) is heavily influenced by the economic and operational conditions of the system in terms of energy price, transport and operational cost, and biomass availability. Although our algorithm retrieves up to 100 solutions sorted in decreasing TPF for each scenario, we only analysed the best one obtained. The plant-farm indices of these best combinations were always a subset of 18 recurrent indices (Table 3). In the best-case scenario, the network includes eight plants (Fig. 10), while in the worst-case scenario, that is still profitable, the number falls to only one (Fig. 6).

It can be seen from Table 2 and Figs. 3, 4 and 5 that, in the most profitable scenario, the proposed method allowed us to find a network of plants and farms with up to 70% more profitability than the usual method for assigning biogas plant locations in the literature, which relies on the ArcGIS NA as used by [21], and similarly by [20].

The use of location-allocation models, available in GIS, in the renewable energy literature has tended to be focus on the spatial distribution of demand and potential facility locations are evaluated manly by this factor [48].

Our results prove that the economic efficiency of a biogas project should be included in the model that is being optimized for a more efficient decision making. Although GIS provides accessible optimization tools and techniques, these are often used without understanding the underlying models and methods [49] and require more flexible models [19].

According to the methodology used, the production of biogas for the generation of electric power would be a profitable option in the prevailing situation in Chile, in agreement with [10]; however, high energy sale prices and low transportation costs are required. If these conditions are not met, it would be necessary to install a public policy to stimulate generation of this type of renewable energy. In order to extract the resource efficiently, the allocation of plants should be limited to strategic locations, as proposed in this research.

In a real scenario, the estimated power values should be adapted to the closest values of the engines available for purchase. This model does not consider the complex human interactions that could arise from the fact that it is not possible to impose a certain investment on the farm owner as this action depends on the will of stakeholders involved in the framework of a national cooperation policy. Nor is there any consideration of payment for the purchase of waste or a fee for its removal, since this will be defined by the type of contract between the parties. This can result in a higher or lower profitability than calculated.

In the light of the results, it would be valuable to carry out a study with networks of biogas plants using co-digestion, and to analyse the incorporation of policies oriented towards the support of cooperative networks, in addition to using the algorithm to determine optimal locations of dairy processing plants associated with small producers. We expect to develop these topics in future publications.

6 Conclusion

While GIS are an accessible alternative for location analysis thanks to their capability for modelling and solving classical facility location problems, it is necessary to develop precise models and the specialized algorithms they require—like the one presented in this work—to consider more complex factors and limitations that can appear on real applications. This in order to support decision making in accordance with the reality, and the technical and economic difficulties that may be present in the studied geographic area.

For the conditions of Chile, in the best scenario tested (80% biomass, 100 dollars per MWh and a transport cost of 0.3 USD/tkm), our heuristic method obtained locations that result in a NPV 70% higher than when using location-allocation functions provided in GIS, as do most network analyses in the biogas literature.

In this regard, our model and algorithm represent a contribution to the design of profitable biogas networks. To the authors’ knowledge, this is the first time that the economic gain, including complex factors inherent to biogas generation in the VPN, of a whole network has been optimized.

The production of biogas for the generation of electric power in Chile requires high energy sale prices and low transportation costs. In order to extract the resource efficiently, the allocation of plants should be limited to strategic locations, as proposed in this research.