Agent Based Modelling for Water Resource Allocation in the Transboundary Nile river

: Water resource allocation is a process of assessing and determining a mechanism on how water should be distributed among different regions, sectors and users. Over the recent decades, optimal solution for water resource allocation has been explored both in centralised and decentralised mechanisms. Conventional approaches are under central planner suggesting a solution which maximises total welfare to the users. Moving towards the decentralised modelling, the techniques consider individuals as if they act selﬁshly in their own favour. While central planner provides an efﬁcient solution, it may not be acceptable for some selﬁsh agents. The contrary is true as well in decentralised solution, where the solution lacks efﬁciency leading to an inefﬁcient usage of provided resources. This paper develops a parallel evolutionary search algorithm to introduce a mechanism in re-distributing the central planner revenue value among the competing agents based on their contribution to the central solution. The result maintains the efﬁciency and is used as an incentive for calculating a fair revenue for each agent. The framework is demonstrated and discussed to allocate water resources along the Nile river basin, where there exist eleven competing users represented as agents in various sectors with upstream-downstream relationship and different water demands and availability.


Introduction
Water scarcity, population growth and lack of proper resource allocation mechanisms tend to cause regional instability [1].A typical example concerns the northern African countries within Nile basin located in the most arid region of the world, where an unfair distribution of water resources has been present for a long time.Introducing a fair mechanism for water allocation can help the region's economy and political stability.So far, the centralised system by a central planner (CP) has been a standard water management approach, by which the whole water basin is modelled as a centralised system and then water is distributed for maximising the total benefit of users.Centralised system techniques assume that all agents will allocate the water among each other such that their aggregate welfare is maximised [2][3][4].In this mechanism, the water is allocated to achieve the equal marginal return for all the users.This leads to an ambiguous interpretation of the aggregated problem.In [5], it is argued that the aggregated problem (i.e., CP) carries strong institutional assumptions, presupposing either central planning or perfectly functioning of the water market.In fact, the aggregated formulation (a) does not recognise the asymmetric accessibility of the water to users (e.g., from upstream to downstream); (b) ignores the selfishness of competing water users; and (c) assumes the best solution to the system would be accepted completely by all the participants.Therefore, the standard aggregated approach (i.e., CP) is not practical when it is used to deal with sharing the water resource.To overcome the above issues, decentralised planning (DC) is introduced.In [6] a priority based sequential algorithm for upstream-downstream water reallocation is implemented.Once the upstream user maximises its benefit, its decision (solution) is imposed to its immediate downstream user as predefined status; this continues until all the individual problems are solved in sequence.The applicability of multi-agent systems have also been investigated in the field of environmental and natural resource management as reported in [7,8].In this type of approach, each user is autonomous by itself and exchange information with its neighbour users within a system.An example of using a multi-agent system is developed in [9], and is further extended in allocation of water in the Yellow river basin [10] and is used to compare administrative and market based water allocation [11].This approach considers all users as individual agents making decisions by interacting with each other and a coordinator who resolves the users' conflict in later stages.The method implements the modified penalty-based nonlinear programme with a two-step problem.The first step finds a solution to agents individually with a possibility of constraint infeasibility and the second step is an optimisation model which reduces the constraint violation at the system level.In application, constraint infeasibility is explained as either the deficit or as an agent behavioural adjustment indicator for reducing the constraint violation [9].From a game theoretical perspective, non-cooperative approaches have been examined in the systems in which users involve in a game to increase their pay-off, knowing that their decisions affect those of the other users.The approach provides insights for understanding water conflicts and is often implemented for the games with qualitative information about the users' payoffs [12].Another approach to the above problems is developed in [5].They use the multiple complementarity problems to express spatial externalities resulting from asymmetric access to water use for water right pricing.The individual optimisation problem is formulated for each user with the inflow quantity given as exogenous value to each problem as opposed to being a decision variable in the centralised formulation, i.e., aggregated welfare maximisation.The price of the demanded water is used to clear the output market and the uniform wage rate is used to clear the labour market formulated as complementary constraints to the problem.To this framework, introducing extra coupling constraints changes the formulation to a more general problem framework namely, quasi variational inequality problem (i.e., a complementarity problem with shared constraints amongst the users [13]).The convergence of the algorithm is guaranteed upon the convexity assumption and continuously differentiable functions with diagonally dominant Jacobians [14].

Fair Resource Allocation
Although the above decentralised tools and techniques satisfy the selfishness of each agent in maximising its utility function to achieve higher revenue, they lead to an inefficient solution from CP perspective.That is, it is possible within a water basin that the most inefficient agents located upstream use water up to their operating capacity, and leave very limited units of water to the most efficient firms located downstream; a situation explained in [5,15].Therefore, it is desirable to allocate the water based on the efficient CP solution, but to re-distribute the achieved revenue to the agents in a fair way-considering, of course, that the revenue is transferable between agents.Different allocation approaches in the literature considers different ways to address the fairness [16].The distance based methods, namely, least square solution, maximin (minimax) and compromise programming are some mathematical methods which generally evaluate the performance of solutions based on their distance from ideal solution.These are some reliable indicators to be used to quantify the dissatisfaction level of a user within a shared system.To account for fairness, in this paper, a notion of fairness based on each agent's contribution on achieving the CP solution is defined.A unique solution is calculated with some favourable properties which guarantees the cooperation maintenance.To find the agent's impact on CP solution, as will be discussed in the next sections, the best response of each agent on the action of the other group of agents and vice versa should be known, simultaneously.Therefore, as a major contribution of this paper, an evolutionary algorithm is developed solving interrelated optimisation problems in parallel guiding the search towards a feasible solution in a distributed manner so that the impact of agents on CP solution is realised.This will guarantee that the contribution of each agent is properly captured for fair revenue distribution considering the conflicts within such a shared resource system.

Problem Identification: Nile River Basin
Over the recent decades, decrease in exploitable freshwater resources and poorly performing water resources management policies have escalated the water competition among river basin countries.The accessibility to water becomes a growing concern in many water basins, especially in Middle East and North Africa, where the water scarcity problems are almost the most severe around the world [16].In this region, the Nile basin, one of the most important water basins, is ensuring the basic livelihood of people living along the river.It is the main vital water artery and the home to more than 160 million people in the North Eastern region of Africa shared by eleven countries [17].The Nile is 6853 kilometres in length and total area of its basin is over 3 million kilometres, covering about 10 percent of the African continent [18].There are two main tributaries: the White Nile and the Blue Nile, which are joined in the Sudan (Figure 1).The White Nile originates in the Kagera River in Burundi, passing through Lake Victoria and Lake Kyoga successively.The Blue Nile that consists of numerous tributaries starts from Ethiopia, flowing northwards and merging the White Nile into a single River.Rainfall is characterised by a highly uneven spatial distribution over the basin.The reliability and volume of precipitation generally declines moving northwards, with the arid regions in Egypt and the northern region of the Sudan receiving insignificant annual rainfall.Therefore, the water contribution to the river varies greatly; from Ethiopia, which contributes the most water, to Egypt, which has no contribution to Nile water [19].However, as the lower reaches of the Nile basin are mostly arid or semiarid regions, some countries such as Egypt and Sudan show a strong dependency upon the Nile River [20] (Table 1).The unbalance between the insignificant water availability and excessive water extraction cause harmful consequences to basin stability and regional development.Hence, an adequate water supply is often considered as a question of national survival for many Nile riparian states [21].In addition, water use in the Nile basin causes a potential source of conflict that overshadows many other types of collaboration.The allocation of Nile water resource is complicated due to the combination of riparian's less rainfall and political inequality.As the most powerful countries, Egypt and Sudan hold absolute rights to use 100 percent of the river's water under agreements reached in 1929 between Egypt and Britain and in 1959 between Egypt and Sudan [18].This apportions most of the water to Egypt and the former Sudan, which makes other riparian states hardly meet their water demand, leading to series of conflicts and issues about the water resource negotiation.With the changes of regional policies, competition and conflicts over water development and utilisation between downstream and upstream countries are increasingly aggravated since 1980s [17].Specifically, the upstream countries represented by Ethiopia are strongly disappointed with the condition that the large amount of water is extracted by the two downstream countries, Sudan and Egypt.Since the late 1990s, the Nile riparian countries initiated Nile River basin management cooperation, which launched a series of basin wide dialogue and relevant joint activities, mobilised the process of negotiating and singing of the Nile River Basin Cooperative Framework Agreement [20].However, the political and economic factors as well as dependency to water for downstream countries hinder the negotiating progress.The dependency to water resources shown in Table 1 is the degree to which the supply of a country's water resources is dependent on sources external to its political boundaries and can be calculated using the relation (ARWR − IRWR)/ARWR × 100 [17].As shown in Table 1, Sudan and Egypt rely on the external water resources to a great extent, in which over 95% of water stems from external sources.Overall, the water allocation within the basin is still unfair and unacceptable to many of states along the Nile River, specially to those upstream contributing the most to the sources.

Preliminaries and Definitions for Fair Resource Allocation
In this study, a fair and an efficient resource allocation approach based on evolutionary algorithm (EA) is proposed.To retain the efficient centralised solution whilst the achieved revenue is fairly re-distributed among the agents, the impact each agent has on the whole system should be identified.In order to know the best response of each agent on the coalition of others, a parallel evolutionary algorithm is developed by [15,24], enabling the agents to solve their local optimisation problem while interacting with the others.To elaborate some key concepts mathematically, the preliminaries are as follows.

Preliminary and Definitions
Let I = {1 . . .n} denotes a set of agents.Assume that each agent i controls vector x i ∈ R n i .Let x −i be a vector containing the strategies (allocation) of all agents excluding that of the agent i.Each agent by receiving allocation x i maximises his revenue via its utility function u i .The utility u i of the strategy profile x = (x 1 , . . ., The followings are defined.

Definition: (Central Planner Welfare Maximisation (CP))
A solution is a social welfare maximisation or a central planner (CP) approach if it is derived by the following optimisation problem, where summation is over all the utilities of the agents.This leads to a solution from an outside observer as if he/she is responsible for the values of all agents.

Definition: (Contribution to Cooperation)
Define U * = ∑ j∈I u j (x * ).Further, assume that agent i decides to leave the cooperation and act as a singleton (or in isolation) and let U * −i = ∑ j =i u j (x * −i ) be the summation of all other agent's revenue when i leaves them.Agent i's impact on CP solution is defined as, u i measures how much agent i contributes to CP solution.In other words, u i is the impact of agent i leaving the cooperation.

Definition: (Fairness)
A revenue re-distribution mechanism is fair if the revenue for each agent i follows the following equation: where, This means that each agent gets an allocation based on his contribution to the CP solution.This definition makes sense and has two indirect properties; (a) it is budget balanced; that is, the sum of all u r i equals the whole CP revenue value U * , which in other words conveys that the mechanism collects and disburses the same amount of money from and to the agents; and, (b) it is rational; that is, no agent ever loses by participation (the revenue to each user is greater than zero).The above explains that the more contribution one agent has, the higher its revenue is.In this case, agents are encouraged to abide by the decision derived by CP problem (x * ) if they are given a revenue following u r i values.U * −i implies that agent i, which left the set of all agents, independently compete on the resources with agents {1, 2, . . ., i − 1, i + 1, . . ., n}.If agent i knew the others' strategies, his strategic problem would become simple; he would be left with the single-agent problem of choosing a utility-maximising problem.However, the two problems formed by agent i and agents {1, 2, . . ., i − 1, i + 1, . . ., n} should be solved, simultaneously.This is because of the fact that agent i's best strategy depends on the interaction with the group he has left and which should not be ignored when finding U * −i values.Therefore, U * −i depends on the solution of two interrelated maximisation problems formed by agent {i}'s utility, u i , and agents' {1, 2, . . ., i − 1, i + 1, . . ., n} aggregated utilities, ∑ j =i j∈I u j (x −i ) which should be solved at the same time.A parallel evolutionary technique is defined next to deal with this two distributed problems.

Parallel Search Algorithm
Here, a general class of interrelated problems is formulated in which their optimisation problems are simultaneously solved in parallel while interacting with each other.In a most general case and where n agents are solving their problems individually, each agent solves one optimisation problem and seeks its own optimal strategies while interacting with the others.More precisely, given U : R n → R n representing all n agents' utilities, x = (x 1 , . . ., x n ) ∈ R n + is found by simultaneously solving the following n problems: where each agent i controls vector x i ∈ R n i to optimise the utility (objective) function u i subject to the constraints set X i containing x ∈ R n + .The interrelation is explained as the objective function and the constraints in P i depend on other agents' decisions.
To solve the n agent problems P i , i = 1, ..., n simultaneously, each problem P i is dedicated to one agent i.Since there is interconnection between each problem due to vector x, each problem is solved whilst it communicates with the other problems by sharing information.Call P the problem formed by all P i s.Parallel genetic algorithm [25] developed in [24] and the idea of co-evolution [26] are implemented to solve P. The idea is extended such that each (sub-)problem P i has its own objective function.This concept is used in [27] to gain faster convergence to Pareto solution in multiobjective optimisation problem.Let x −i be a vector containing the decision variables of all agents involved in problem P i excluding that of the agent i.The search algorithm is described by n different search trajectories performing in parallel through the following mapping H: where H shows the interconnection between the agents.H acts as a synchronization map for agent i to optimise problem P i given the decisions of other interacting agents in its neighbourhood remain fixed shown by x t −i .H describes that x i value is updated by a search on problem P i at generation t linking decisions x i and x −i .Due to problem P i , each agent knows its own problem components and hence by communicating with other neighbouring agents through H, it has local activity for exploring the search space.In what follows, Algorithm 1 gives details of the search algorithm to solve the agents problems.
Each agent i has a devoted search trajectory formed by a population of size m (Line 1).pop i is a m × ne i matrix and is populated randomly.ne i is the number of interacting agents given by the cardinal of the set neighbours i (Line 2).In other words, ne i equals the number of neighbouring agents affecting the decision of agent i plus one.All individuals p k = (x 1 , ..., x ne i ) in each population i undergoes a reproduction in each generation t of parallel searches (Line 8).p b is reproduced from two other distinct individuals within the population.If its objective value is better than that of the p k , it remains in the population otherwise it is discarded (Line 9 and 10).At the end of each generation t, the neighbouring agents (j ∈ neighbours i ) share their best individuals to form the updated population for next generation t + 1 (Line 12).
Figure 2 explains the algorithm where two agents are involved in the system.As explained in the figure, each agent deals with problem P i optimising for x i .At the end of each generation t, pop * i , the best individual in pop i based on its objective value, is obtained.pop * i migrates to the population of the neighbours and remain fixed for the next generation t + 1.This makes each agent at the end of each generation to be informed of the decisions of the other neighbouring agents involved in its own problem.Due to n different search trajectories, the algorithm allows independent search for agents by relying only on locally available information.This procedure leads to the evolution of separate populations over successive generations, and the convergence is assumed when the agents cannot further improve their objective function values f i (readers may refer to ([24] Section 3.2) for an illustrative example of Algorithm 1).

Resource Allocation Context
As stated earlier, to find the contribution u i of each agent i to the CP solution, it should be assured that the solution to agent i's utility maximisation is the best response to the solution of sum of utilities of the other agents and vice versa.To do so, the set I is split by removing one agent at a time from I to form two problems P 1 and P 2 for each instances.Specifically, problem P 1 is the utility maximisation for agent i (u i ) and problem P 2 is the aggregated utility maximisation for agents 1, 2, . . ., i − 1, i + 1, . . ., n (∑ j =i j∈I u j (x −i )).Problem P 1 and P 2 are then solved in parallel for each agent i using Algorithm 1.The illustrative procedure summarises the steps to obtain a fair resource allocation to different self-interested agents.For each agent i, problem P 1 and P 2 are solved in parallel in line 2 and 3.The contribution of each agent to the system then is calculated in line 4 and based on the fairness definition, the revenue is re-distributed in line 6.

2: Illustrative procedure:
Steps to redistribute utilities amongst self-interested agents 1 Find U * ; 2 for i = 1 to n do 3 Solve problem P 1 and P 2 using Algorithm 1; 4 For each agent i, calculate u i , α i ; 5 u r i ← α i × U * ; 6 Distribute to each agent u r i ;

Nile River Basin Water Sharing Mechanism
Considering the major water utilisation of riparian and their geographic positions (Figure 1), the water users located in the Nile riparian states are modelled as agents within a distribution network.In this paper, economic concepts is used to translate the demand for water to an economic value.Water demands are usually represented in hydroeconomic models using exogenously generated linear or quadratic equations relating water application to economic benefits [4].In some cases, complex crop yield functions are explicitly included in the model as well [28].A detailed introduction of the economics of water resources can be found in [29,30].A water demand curve shows the user's willingness to pay for demanded water.The xand y-axis are the water quantity available to be abstracted and the unit price or marginal willingness to pay, respectively.The gross economic benefits of water abstraction is calculated by integrating the demand curve [4].While any complex economic model could be exploited, without loss of generality, in the modelling presented in this paper, the economic objective function is a quadratic function shown by a i x i − b i x 2 i and calculated by integrating the linear water demand functions for each agent [15] (for details, the reader is referred to [2,3,31]).This function can be modified to closely represent the case study specific assumptions, for example, to consider that the marginal utility in arid countries is not likely to reach zero.All agents follow the upstream-downstream relationship, interconnecting with neighbours using the mass balance equations.The CP model aims at the maximisation of total benefit, and is formulated as a single optimisation problem with summation of all benefit functions as in Equation CP.Following Section 3.3, for the decentralised model, agent i is separated from the rest of the agents and its own economic function is maximised concurrently as the rest try to maximise their group revenue using Algorithm 1.

Water Availability
The mean annual flow of Nile River in 2015 is 84 billion cubic metre (BCM) per year [32].In this case-specific modelling, the minor water inflows and evaporative losses are not considered.If such information exists, the inflows can be adjusted accordingly and a parameter can be included in the model to account for water loss due to evaporation.Specific to the two tributaries, hydrological data at Mogren dam is chosen to represent average annual runoff of the White Nile (Q 1 ) and Khartoum monitors data of the Blue Nile (Q 2 ) [22].In experimental set-up, therefore, Q 1 = 24.0BCM and, Q 2 = 60.0BCM based on the average hydrological data regulated at these stations [33].

Population and Demand Values
The objective function is the benefit function that quantifies the total benefit generated by water extractors from water use.In order to set a reasonable value for the parameters a i and b i in an objective function, the water demand curves should be estimated primarily according to the water demand and price, and then total benefit functions are calculated by integrating the demand functions.Following [2], the point expansion method is used to estimate the linear demand curve for various sectors.The original point expansion is based on the total water consumption and the water price.For simplicity, the marginal value of water is referenced as water price.Water consumption is obtained using: Water demand = total water usage × % o f population within the basin.
Table 2 exhibits the factors determining the total water demand in the basin amongst agents.The population within the basin, water usage for utilisation and their marginal values are the main benchmarks when determining the water demand curves, which are indirectly reflected on parameters setting in objective functions [17].Based on Table 2, the values of a i and b i are tabulated in Table 3.

Results and Discussion
In both CP and decentralised solution procedure, MaxGen = 100 in Algorithm 1, population size for each agent is set as m = 50 and cross over and mutation is set as 0.5 and 0.7 for reproduction, respectively.Accounting for reliability, all the instances are run for 30 times and their average value is reported.

Centralised Solution
In CP model, the fitness function is the aggregated benefit of all countries and, therefore, the problem is to search the maximum value of system revenue .The revenue of the whole system is reported as 3575.94B. The benefits of each agent i in CP solution are shown in Table 4 along with the amount of water abstracted.

Re-Allocation Solution
After finding the decentralised solution, from the perspective of fairness, the system revenue is reallocated based on the results derived from CP solution (Table 4).Figure 3 shows the contributions of each agent.The difference between the CP value and the group value of the rest in decentralised model embodies the impact one agent has on the whole system.Hence, the contribution is calculated, which provides the basis for revenue re-distribution.The incentive of agents in a cooperation game is determined by their location.The downstream users with high water dependency usually have higher incentive to join the cooperation.Figure 4 compares the decentralised solution with the CP distribution.For example, agent C contributes more than its upstream user B since it has less access to the water resource yet it requires more water resources.It can be seen that upstream location is beneficial to agents compared with the CP solution.Agent A, Burundi, who has the independent water resource as the upstream of White Nile tributary (Q 1 ), could increase its final obtainable benefit greatly from 4.9 to 61.16 in million pounds.This is the same for the other upstream users, while, on the contrary, the two main downstream water abstractors, agent G and K, are apportioned with less water after re-distribution.Through the rearrangement of water allocation, the upstream-downstream water disputes has the potential to be reduced.In addition, the distribution tends to be more evenly among agents than that in CP solution, which could be explained as the reflection of fairness to some extent.

Conclusions
This paper introduces a methodological framework to address the Nile River water allocation problem through a revenue re-distribution mechanism.The proposed framework leads to a fairly allocated revenue for each user, which is proportional to its contribution to the basin.In a centralised solution, aggregated benefits of all water users are used to search the optimal system revenue and in a decentralised solution, a parallel evolutionary approach is developed to find the contribution of each user to the whole system.The evolutionary algorithm is a parallel search where each user solves his/her own problem while in contact with the others.Re-allocation of revenue in this framework guarantees a fair and an efficient allocation of water to all users.Geographical location of users as well as their sector they are involved in (manifested via different marginal values) are the main factors affecting the final available revenue for water users, which, in turn, determine their contributions.Compared with the centralised solution, the results have taken into account the selfishness of individuals, providing a fairer distribution of water to those with greater accessibility to the water.The revenue distribution mechanism introduced in this paper is a fair and unique approach, but its stability requires further investigation.In addition, the algorithmic characteristics of the proposed framework still needs to be explored.Future research can analyse the technique for feasibility assurance and possibly faster convergence by using different operators and heuristics.The limitation of the approach with many agents within a system should also be explored.However, since n instances of problems are independent from each other, a parallelisation scheme can be implemented to remedy the shortcomings.

Figure 1 .
Figure 1.Nile River basin, its location and tributaries.

Figure 3 .
Figure 3. Percentages of contribution in cooperation.

Figure 4 .
Figure 4. Revenue allocation results in central planner (CP) solution and reallocation solution.

1: Algorithm 1:
Parallel search algorithm 1 Randomly initialise n populations of size m (pop i ); 2 Define neighbours i and set nei i = |neighbours i |; 3 Set MaxGen; 4 while Not MaxGen do Corresponding to p k , randomly pick mutually distinct p s1 and p s2 from pop i ; Exchanging the best individual values within the the neighbouring populations at the end of each generation for ne i = 2. x * i is fixed in pop i+1 and x * i+1 is fixed in pop i in each generation.
12For any pair of (i, j) such that i = j and j ∈ neighbours i , let pop i ← pop * j ;

Table 3 .
The parameters defining each agent's economic objective function.

Table 5 .
Water resource allocation results.