1 Introduction

In general, the proper allocation/distribution of limited resources is a traditional problem to be solved with various application fields. The importance of this issue is obvious, since at philosophical level every resource on Earth is limited. (Even the so-called renewable resources available for a given time period are limited.) From the managerial point of view, the task is to allocate some limited resource among several users while it should be also often decided which one of the users’ preferences can be satisfied (without breaking the constraints/conditions pertaining to the particular task) and which one cannot.

Since the allocation problem is generally not trivial and has various particular kinds, permanent research activity is needed to develop the required solutions.

This section contains a general literature overview in connection with the topic of the present work. Furthermore, it emphasizes the contributions and gives the later organization of the paper.

1.1 Literature review

In the mathematical formulation, the general allocation task often lead to optimization problems (with optimal solutions) (see e.g. (Zelinka et al., 2013)) or, due to the conflict of interests, multi-objective or game-theoretical problems (with equilibrium solutions/strategies) (see e.g. (Forgó et al., 1999)). One of the particular but extremely important application fields of the resource allocation task is (fresh, thermal etc.) water resource management (Kicsiny & Varga, 2019; Kicsiny et al., 2021; Madani, 2010). Biology and project management are further important application fields. For example, in (Sharma & Steuer, 2019), certain enzymes form the limited resource to be allocated. In project management, the problem may be the optimal allocation of human resources. A wide range survey on this field is e.g. (Bouajaja & Dridi, 2017). A general overview on continuous nonlinear resource allocation problems is (Patriksson, 2008). The present paper advances the results of the field (reviewed in the latter survey) with solving a kind of problems under quadratic constraints.

Generally speaking, mathematical resource allocation problems are endowed with one or more objective functions to be maximized (or minimized) and constraints determining the set of feasible solutions (feasible set in short), from which the (nearly) optimal or (nearly) equilibrium one should be selected. Basically, our work deals with the derivation of the feasible set for certain cases.

Multi-objective problems are often handled with game-theoretical tools. In (Liu et al., 2019), a leader–follower (or Stackelberg) game is used to model how to allocate limited security resources (like security budget) to protect a large number of targets (servers) in a network. The players are constrained with natural inequality constraints. One of the main goals, similarly as in the present work, is to find a feasible set, from which a satisfactory trade-off between protecting the targets and consuming the resources by the defender (one of the players) can be formed. Another multi-objective optimization model can be found in (Xu et al., 2020), where the so-called dynamic vehicle routing problem is considered with respect to the refined oil allocation task. Certain time, routing and parameter constraints determine the feasible set in the problem. Pareto optimality (Forgó et al., 1999) is a frequent solution approach for multi-objective tasks. In the studies of Goel et al. (2010) and Kranich (2020), Pareto optimal or nearly Pareto optimal solutions are applied to solve different constrained resource allocation problems.

The optimization problem, including the determination of the feasible set satisfying the constraints, often remains challenging in the classical case as well, when only one objective function has to be considered. Klein et al. (1994) deal with optimization problems applied for resource allocation tasks, where each term in the objective function is a continuous, strictly decreasing function of a single variable, and the constraints are linear. In (Wang et al., 2021), a mixed integer programming model based on time cost (included in the objective function) under uncertainty is proposed, which helps to solve the emergency warehouse location and allocation problem. Different aspects are built in the constraints like location and transportation limitations. Milano and Lombardi (2014) address problems where decisions to be taken affect and are affected by complex systems. One of the suggested methods to support decision-making is machine learning. It starts with generating an (approximately) optimal solution of the so-called master problem. If the corresponding decision scenario is found feasible (satisfying the given constraints), and the estimated quality (based on objective function values) is confirmed, the iteration stops, and the result is considered optimal. Otherwise, a new iteration is generated with refreshed decision values. This is an example for the (frequent) cases when the proper determination/handling of the feasible set immediately leads to solutions that can be accepted as (nearly) optimal ones for a problem.

Our results can be applied to the analytical handling of the feasible set in various resource allocation tasks (possibly in optimization or game-theoretical contexts) or in other problems (cf. Sect. 5) under quadratic (nonlinear) constraints if the sum of the nonnegative variables (possibly control variables or strategies) is either fixed (see Sect. 4) or not.

Many times the feasible set of a resource allocation problem is more difficult to determine than to find the optimal or equilibrium solution itself (see e.g. (Kicsiny, 2017)). Alternatively, the already known feasible set often makes it easier to select the optimal/equilibrium solution of the problem. Consider the classical case of a convex objective function over the n-dimensional Euclidean space with a convex polyhedron as the feasible set (described with linear inequality constraints). It is known in advance that the optimal (maximal) solution is one of the extremal points of the polyhedron, which makes the problem much easier to solve. (Generally, the cardinality of the set of the extremal points remains exponential but finite and known linear programming methods can be effectively applied for the solution. In favourable/simplified cases, even the simple comparison of the finitely many feasible points/solutions may practically lead to an optimal one.) In some other cases, any feasible solutions are essentially the same satisfactory, additional optimization is not needed (for example, see Example 5.1a, 5.1b and 5.2 in Sect. 5). Accordingly, the main or even the only task in many resource allocation problems is to determine the feasible set itself. The kind of problems and the proposed solution algorithm in this paper also fit this case.

Similarly, an algorithm for finding a large feasible n-dimensional interval for constrained global optimization is presented in (Csendes et al., 1995). The n-dimensional interval is iteratively increased about an initial point while maintaining feasibility. The resulted feasible interval is constrained to lie within a certain level set ensuring that it remains close to the optimum. Sharma and Steuer (2019) demonstrate the potential of biochemical resource (amount of certain enzymes) allocation models of microbial growth to advance ecosystem simulations and parametrization. One of the models is a linear programming model, the solution of which is discussed as that of a feasibility problem for a given specific growth rate function determining one of the constraints. In (Nattaf et al., 2015), a scheduling problem of tasks is addressed in case of a cumulative continuous resource and energy constraints. The instantaneous resource usage of a task is limited with a minimum and a maximum requirement. The problem is to find a feasible schedule of the tasks satisfying all the constraints. The solution space is searched via a hybrid method using mixed integer linear programming. Friedkin et al. (2019) report that implicit mathematical structures (instead of explicit ones) can be relevant for group decision-making in resource allocation distributions under conditions of uncertainty, which disallow formal optimization. The group’s initial distribution preferences set up a geometric feasible set (decision space) as a certain polytope of possible resource distributions. An optimal or at least satisfactory solution can be selected from this set.

The main differences between the present paper and the (cited) literature are constituted in the following: 1. the kind of the particular (quadratic) constraints, 2. the explicit determination of the free/independent variables (portions of the resource to be allocated) and the dependent ones, along with their values.

1.2 Contributions and organization of the paper

Apart from the heat management problem with political requirements in Example 5.1a, 5.1b or the feeding problem of conservation biology in Example 5.2, our results can be applied to find feasible solutions or check the feasibility of solutions in resource allocation problems if the sum of the nonnegative problem variables is either fixed or not and there are further quadratic constraints. Even more generally, the results can be applied in case of any (not only resource allocation) problems which can be described with the basic system of constraints (1a), (1b) and (1c) or (26) (see Sect. 2 and 4 and Example 5.3). The contributions of the present paper are the following in more detail:

  1. (a)

    A new theorem (Theorem 2.1) is proved for the explicit expression of properly assigned (dependent) variables by means of the other (independent) variables in a system of inequality and quadratic equality constraints (1a), (1b), (1c). The sum of the (nonnegative) variables can be either prefixed (with Eq. (26)) or not. The solved system (1a), (1b) and (1c) or (26) has comprehensive applications, mainly in the field of allocating (limited) resources.

  2. (b)

    Two new lemmas (Lemmas A1 and A2) are proved for supporting the proof of Theorem 2.1, nevertheless, they can be considered also as independent results, which can be hopefully applied in future works (as a part of future mathematical derivations).

  3. (c)

    A practical algorithm is derived, supported by the new Lemma A3, on how to assign in a feasible way the independent variables, to which (possibly limited but otherwise) arbitrary nonnegative values can be prescribed, and with which the remaining dependent variables can be expressed explicitly. From the managerial point of view, the algorithm helps in the decision making process of allocating limited resources among several users. This help includes the support in deciding which one of the users’ preferences can be satisfied (without breaking the constraints) and which one cannot.

The organization of the paper is the following: Sect. 2 presents the mathematical model of the system of constraints along with the proved theorem on the explicit expression of certain variables. In Sect. 3, the algorithm for assigning the independent and dependent variables is proposed. In Sect. 4, the direct applicability for limited resources is discussed in detail (here the sum of the variables is prefixed). Section 5 presents practical examples from various application fields, which hopefully help the Readers in utilizing the results. Section 6 serves with conclusions and a future research proposal. The Appendix contains the supporting Lemmas A1, A2 and A3 and Fig. 1 on the algorithm.

Fig. 1
figure 1

Unfeasible a) and feasible b) assignments of the free portions from the heat resource

2 Mathematical model

Let us take the following system of quadratic equalities:

$${m}_{k,i}{m}_{1,j}+\dots +{m}_{k,i}{m}_{n,j}={m}_{k,j}{m}_{1,i}+\dots +{m}_{k,j}{m}_{n,i}$$
(1a)
$$ \left( {k = 1, \ldots ,n; i = 1, \ldots ,m; j = 1, \ldots ,m; i \ne j} \right), $$

where

$${0\le m}_{\mathrm{1,1}}{, \dots ,m}_{n,1},\dots ,{m}_{1,m},\dots ,{m}_{n,m},$$
(1b)
$${0<m}_{\mathrm{1,1}}{+\dots +m}_{n,1}+\dots +{m}_{1,m}+\dots +{m}_{n,m}.$$
(1c)

In the present work, \(n, m\in {\mathbb{N}}\) and \(n,m\ge 2\) always hold.

Remark 2.1

It comes after the fulfilment of Eqs. (1a) for \(k=1,\dots ,n-1\) that (1a) holds for \(k=n\) as well.

Theorem 2.1

System (1a)-(1c) entails the following:

$$ m_{k,i} = \frac{{m_{k,q} m_{p,i} }}{{m_{p,q} }} $$
(2)
$$\begin{aligned} &\big(k = 1, \ldots ,p - 1,p + 1, \ldots ,n; i = 1, \ldots ,q - 1,q + 1, \ldots ,m;\\ &p = 1, \ldots ,n; q = 1, \ldots ,m; m_{p,q} > 0). \end{aligned}\big.$$

Proof

Ineqs. (1b) and (1c) imply that the variable \({m}_{p,q}>0\) for some indices \(p\in \left\{1,\dots ,n\right\}\) and \(q\in \left\{1,\dots ,m\right\}\). Without loss of generality, \(p=n\) and \(q=m\) can be assumed, since the indices of the variables (and the equalities) in Eqs. (1a) can be always renamed and reordered if needed to fulfil this assumption. That is, \({m}_{n,m}>0\) can be assumed.

Then Eqs. (1a) are equivalent to the following:

$${m}_{k,i}\left({m}_{1,m}+\dots +{m}_{n,m}\right)={m}_{k,m}\left({m}_{1,i}+\dots +{m}_{n,i}\right)$$
(3)
$$ \left( {k = 1, \ldots ,n - 1; i = 1, \ldots ,m - 1} \right). $$

The terms \(m_{k,i} m_{k,m}\) \(\left( {k = 1, \ldots ,n - 1; i = 1, \ldots ,m - 1} \right)\) can be eliminated from system (3). Utilizing (1b) and the assumption that \(m_{n,m} > 0\), after expanding and regrouping the terms of Eqs. (3), system of equalities (4.1)-(4.m-1) is gained. (Here it is needless to consider the case \(k = n\), since the corresponding relation is fulfilled automatically in accordance with Remark 2.1.)

$$\left.\begin{array}{c}{m}_{\mathrm{1,1}}=\frac{{m}_{1,m}\left({m}_{\mathrm{2,1}}+\dots +{m}_{n,1}\right)}{{m}_{2,m}+\dots +{m}_{n,m}},\\ {m}_{\mathrm{2,1}}=\frac{{m}_{2,m}\left({m}_{\mathrm{1,1}}+{m}_{\mathrm{3,1}}+{m}_{\mathrm{4,1}}+\dots +{m}_{n,1}\right)}{{m}_{1,m}+{m}_{3,m}+{m}_{4,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{n-1,m}\left({m}_{\mathrm{1,1}}+\dots +{m}_{n-\mathrm{2,1}}{+m}_{n,1}\right)}{{m}_{1,m}+\dots +{m}_{n-2,m}+{m}_{n,m}},\end{array}\right\}$$
(4.1)
$$\left.\begin{array}{c}{m}_{\mathrm{1,2}}=\frac{{m}_{1,m}\left({m}_{\mathrm{2,2}}+\dots +{m}_{n,2}\right)}{{m}_{2,m}+\dots +{m}_{n,m}},\\ {m}_{\mathrm{2,2}}=\frac{{m}_{2,m}\left({m}_{\mathrm{1,2}}+{m}_{\mathrm{3,2}}+{m}_{\mathrm{4,2}}+\dots +{m}_{n,2}\right)}{{m}_{1,m}+{m}_{3,m}+{m}_{4,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{1,2}}=\frac{{m}_{n-1,m}\left({m}_{\mathrm{1,2}}+\dots +{m}_{n-\mathrm{2,2}}{+m}_{n,2}\right)}{{m}_{1,m}+\dots +{m}_{n-2,m}+{m}_{n,m}},\end{array}\right\}$$
(4.2)
$$\vdots $$
$$\left.\begin{array}{c}{m}_{1,m-1}=\frac{{m}_{1,m}\left({m}_{2,m-1}+\dots +{m}_{n,m-1}\right)}{{m}_{2,m}+\dots +{m}_{n,m}},\\ {m}_{2,m-1}=\frac{{m}_{2,m}\left({m}_{1,m-1}+{m}_{3,m-1}+{m}_{4,m-1}+\dots +{m}_{n,m-1}\right)}{{m}_{1,m}+{m}_{3,m}+{m}_{4,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-1,m-1}=\frac{{m}_{n-1,m}\left({m}_{1,m-1}+\dots +{m}_{n-2,m-1}{+m}_{n,m-1}\right)}{{m}_{1,m}+\dots +{m}_{n-2,m}+{m}_{n,m}}\end{array}\right\}$$
(4.m-1)

Let us express the n-1 variables \({m}_{\mathrm{1,1}}\),\({m}_{\mathrm{2,1}}\), …, \({m}_{n-\mathrm{1,1}}\) with the other ones based on the system of n-1 equalities (4.1).

First of all, substitute the expression of \({m}_{\mathrm{1,1}}\) into that of \({m}_{\mathrm{2,1}}\), where

$${m}_{\mathrm{1,1}}=\frac{{m}_{1,m}\left({m}_{\mathrm{2,1}}+{m}_{\mathrm{3,1}}+\dots +{m}_{n,1}\right)}{{m}_{2,m}+{m}_{3,m}+\dots +{m}_{n,m}},$$
(5a)
$${m}_{\mathrm{2,1}}=\frac{{m}_{2,m}\left({m}_{\mathrm{1,1}}+{m}_{\mathrm{3,1}}+{m}_{\mathrm{4,1}}+\dots +{m}_{n,1}\right)}{{m}_{1,m}+{m}_{3,m}+{m}_{4,m}+\dots +{m}_{n,m}}.$$
(5b)

This case is in accordance with the conditions of Lemma A1 in the Appendix (considering (1b) and \({m}_{n,m}>0\)) with the following correspondences: (5a) corresponds to (A1a), (5b) corresponds to (A1b) if \({m}_{i,j}={m}_{\mathrm{1,1}}\), \({m}_{a,b}={m}_{1,m}\), \({m}_{k,l}={m}_{\mathrm{2,1}}\), \(A={m}_{\mathrm{3,1}}+\dots +{m}_{n,1}\), \({m}_{c,d}={m}_{2,m}\), \(B={m}_{3,m}+\dots +{m}_{n,m}\). Then Eq. (6) corresponds to (A2) in Lemma A1:

$${m}_{\mathrm{2,1}}=\frac{{m}_{2,m}\left({m}_{\mathrm{3,1}}+\dots +{m}_{n,1}\right)}{{m}_{3,m}+\dots +{m}_{n,m}}.$$
(6)

Substituting \({m}_{\mathrm{1,1}}\) into\({m}_{\mathrm{3,1}}\), …,\({m}_{n-\mathrm{1,1}}\), it is resulted similarly that

$$\left.\begin{array}{c}{m}_{\mathrm{3,1}}=\frac{{m}_{3,m}\left({m}_{\mathrm{2,1}}+{m}_{\mathrm{4,1}}+{m}_{\mathrm{5,1}}+\dots +{m}_{n,1}\right)}{{m}_{2,m}+{m}_{4,m}+{m}_{5,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{n-1,m}\left({m}_{\mathrm{2,1}}+\dots +{m}_{n-\mathrm{2,1}}{+m}_{n,1}\right)}{{m}_{2,m}+\dots +{m}_{n-2,m}+{m}_{n,m}}.\end{array}\right\}$$
(7)

Accordingly, we have replaced Eqs. (4.1) to Eqs. (6)-(7), which contain one less equalities and two less variables (\({m}_{\mathrm{1,1}}\) and \({m}_{1,m}\) are not contained in (6)-(7)). The structure of Eqs. (6)-(7) is very similar to that of Eqs. (4.1), but the numerators and the denominators in (6)-(7) contain one less terms, so the problem has been simplified.

Now substitute the expression of \({m}_{\mathrm{2,1}}\) (instead of\({m}_{\mathrm{1,1}}\)) into those of\({m}_{\mathrm{3,1}}\), …,\({m}_{n-\mathrm{1,1}}\). These substitutions are also in accordance with the conditions of Lemma A1. Let us see the case of substituting \({m}_{\mathrm{2,1}}\) into \({m}_{\mathrm{3,1}}\) in more detail:

$${m}_{\mathrm{2,1}}=\frac{{m}_{2,m}\left({m}_{\mathrm{3,1}}+{m}_{\mathrm{4,1}}+\dots +{m}_{n,1}\right)}{{m}_{3,m}+{m}_{4,m}+\dots +{m}_{n,m}},$$
(8a)
$${m}_{\mathrm{3,1}}=\frac{{m}_{3,m}\left({m}_{\mathrm{2,1}}+{m}_{\mathrm{4,1}}+{m}_{\mathrm{5,1}}+\dots +{m}_{n,1}\right)}{{m}_{2,m}+{m}_{4,m}+{m}_{5,m}+\dots +{m}_{n,m}}.$$
(8b)

(8a) corresponds to (A1a), (8b) corresponds to (A1b) if \({m}_{i,j}={m}_{\mathrm{2,1}}\), \({m}_{a,b}={m}_{2,m}\), \({m}_{k,l}={m}_{\mathrm{3,1}}\), \(A={m}_{\mathrm{4,1}}+\dots +{m}_{n,1}\), \({m}_{c,d}={m}_{3,m}\), \(B={m}_{4,m}+\dots +{m}_{n,m}\). Then Eq. (9) corresponds to (A2):

$${m}_{\mathrm{3,1}}=\frac{{m}_{3,m}\left({m}_{\mathrm{4,1}}+\dots +{m}_{n,1}\right)}{{m}_{4,m}+\dots +{m}_{n,m}}.$$
(9)

Substituting \({m}_{\mathrm{2,1}}\) into the other variables (\({m}_{\mathrm{4,1}}\), …,\({m}_{n-\mathrm{1,1}}\)), it is resulted similarly that

$$\left.\begin{array}{c}{m}_{\mathrm{4,1}}=\frac{{m}_{4,m}\left({m}_{\mathrm{3,1}}+{m}_{\mathrm{5,1}}+{m}_{\mathrm{6,1}}+\dots +{m}_{n,1}\right)}{{m}_{3,m}+{m}_{5,m}+{m}_{6,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{n-1,m}\left({m}_{\mathrm{3,1}}+\dots +{m}_{n-\mathrm{2,1}}{+m}_{n,1}\right)}{{m}_{3,m}+\dots +{m}_{n-2,m}+{m}_{n,m}}.\end{array}\right\}$$
(10)

Eqs. (9)-(10) contain one less equalities and two less variables than Eqs. (6)-(7) (\({m}_{\mathrm{2,1}}\) and \({m}_{2,m}\) are not contained in (9)-(10)). In addition, the numerators and the denominators in (9)-(10) contain one less terms than in (6)-(7), so the problem has been simplified further.

Then the expression of \({m}_{\mathrm{3,1}}\) can be substituted into those of the remaining ones (into Eqs. (10)), and so on. Finally, such a system of equalities is resulted, where Eq. (5a) stands for\({m}_{\mathrm{1,1}}\), (6) stands for\({m}_{\mathrm{2,1}}\), (9) stands for\({m}_{\mathrm{3,1}}\), and similar relations stand for the variables\({m}_{\mathrm{4,1}}\), …, \({m}_{n-\mathrm{1,1}}\) with decreasing numbers of terms in their numerators and denominators. In particular, Eqs. (11) are gained:

$$\left.\begin{array}{c}{m}_{\mathrm{1,1}}=\frac{{m}_{1,m}\left({m}_{\mathrm{2,1}}+\dots +{m}_{n,1}\right)}{{m}_{2,m}+\dots +{m}_{n,m}},\\ {m}_{\mathrm{2,1}}=\frac{{m}_{2,m}\left({m}_{\mathrm{3,1}}+\dots +{m}_{n,1}\right)}{{m}_{3,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{3,1}}=\frac{{m}_{n-3,m}\left({m}_{n-\mathrm{2,1}}+{m}_{n-\mathrm{1,1}}{+m}_{n,1}\right)}{{m}_{n-2,m}+{m}_{n-1,m}+{m}_{n,m}},\\ {m}_{n-\mathrm{2,1}}=\frac{{m}_{n-2,m}\left({m}_{n-\mathrm{1,1}}{+m}_{n,1}\right)}{{m}_{n-1,m}+{m}_{n,m}},\\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{n-1,m}{m}_{n,1}}{{m}_{n,m}}.\end{array}\right\}$$
(11)

Now substitute the expression of \({m}_{n-\mathrm{1,1}}\) into that of \({m}_{n-\mathrm{2,1}}\) (see Eqs. (11)). This case is in accordance with the conditions of Lemma A2 in the Appendix (considering (1b) and \({m}_{n,m}>0\)) with the following correspondences: The expression of \({m}_{n-\mathrm{2,1}}\) in (11) corresponds to (A3a), the expression of \({m}_{n-\mathrm{1,1}}\) in (11) corresponds to (A3b) if \({m}_{i,j}={m}_{n-\mathrm{2,1}}\), \({m}_{a,b}={m}_{n-2,m}\), \({m}_{k,l}={m}_{n-\mathrm{1,1}}\), \(A={m}_{n,1}\), \({m}_{c,d}={m}_{n-1,m}\), \(B={m}_{n,m}\). Then Eq. (12) corresponds to (A4) in Lemma A2:

$${m}_{n-\mathrm{2,1}}=\frac{{m}_{n-2,m}{m}_{n,1}}{{m}_{n,m}}.$$
(12)

It comes after this that

$${m}_{n-\mathrm{1,1}}+{m}_{n-\mathrm{2,1}}=\frac{\left({{m}_{n-1,m}+m}_{n-2,m}\right){m}_{n,1}}{{m}_{n,m}}.$$
(13)

In the next step, substitute the above expression of \({m}_{n-\mathrm{1,1}}+{m}_{n-\mathrm{2,1}}\) into that of \({m}_{n-\mathrm{3,1}}\) (see Eqs. (11)). This case is also in accordance with the conditions of Lemma A2 with the following correspondences: \({m}_{i,j}={m}_{n-\mathrm{3,1}}\), \({m}_{a,b}={m}_{n-3,m}\), \({m}_{k,l}={m}_{n-\mathrm{1,1}}+{m}_{n-\mathrm{2,1}}\), \(A={m}_{n,1}\), \({m}_{c,d}={m}_{n-1,m}+{m}_{n-2,m}\), \(B={m}_{n,m}\). Then Eq. (14) corresponds to (A4) in Lemma A2:

$${m}_{n-\mathrm{3,1}}=\frac{{m}_{n-3,m}{m}_{n,1}}{{m}_{n,m}}.$$
(14)

Now substitute the expression

$${m}_{n-\mathrm{1,1}}+{m}_{n-\mathrm{2,1}}+{m}_{n-\mathrm{3,1}}=\frac{\left({{m}_{n-1,m}+m}_{n-2,m}+{m}_{n-3,m}\right){m}_{n,1}}{{m}_{n,m}}$$
(15)

into that of \({m}_{n-\mathrm{4,1}}\) (see Eqs. (11)), and so on. All substitutions are in accordance with the conditions of Lemma A2, and finally, similarly simple equalities are gained for all corresponding variables (\({m}_{n-\mathrm{1,1}}\),\({m}_{n-\mathrm{2,1}}\), …,\({m}_{\mathrm{1,1}}\)):

$$\left.\begin{array}{c}{m}_{n-\mathrm{1,1}}=\frac{{m}_{n-1,m}{m}_{n,1}}{{m}_{n,m}},\\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{n-2,m}{m}_{n,1}}{{m}_{n,m}},\\ \vdots \\ {m}_{\mathrm{2,1}}=\frac{{m}_{2,m}{m}_{n,1}}{{m}_{n,m}},\\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{1,m}{m}_{n,1}}{{m}_{n,m}}.\end{array}\right\}$$
(16)

Then let us handle and simplify Eqs. (4.2) in the same way as we did with Eqs. (4.1) above, expressing the n-1 variables\({m}_{\mathrm{1,2}}\),\({m}_{\mathrm{2,2}}\), …,\({m}_{n-\mathrm{1,2}}\) (with the other relevant ones). Similarly, express proper variables from Eqs. (4.3), …, (4.m-1). Finally, the following system of equalities (including Eqs. (16) and similar ones) is resulted:

$$\left.\begin{array}{c}{m}_{\mathrm{1,1}}=\frac{{m}_{1,m}{m}_{n,1}}{{m}_{n,m}},\\ {m}_{\mathrm{2,1}}=\frac{{m}_{2,m}{m}_{n,1}}{{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{1,1}}=\frac{{m}_{n-1,m}{m}_{n,1}}{{m}_{n,m}},\end{array}\right\}$$
(17.1)
$$\left.\begin{array}{c}{m}_{\mathrm{1,2}}=\frac{{m}_{1,m}{m}_{n,2}}{{m}_{n,m}},\\ {m}_{\mathrm{2,2}}=\frac{{m}_{2,m}{m}_{n,2}}{{m}_{1,m}+{m}_{3,m}+{m}_{4,m}+\dots +{m}_{n,m}},\\ \vdots \\ {m}_{n-\mathrm{1,2}}=\frac{{m}_{n-1,m}{m}_{n,2}}{{m}_{n,m}},\end{array}\right\}$$
(17.2)
$$\vdots $$
$$\left.\begin{array}{c}{m}_{1,m-1}=\frac{{m}_{1,m}{m}_{n,m-1}}{{m}_{n,m}},\\ {m}_{2,m-1}=\frac{{m}_{2,m}{m}_{n,m-1}}{{m}_{n,m}},\\ \vdots \\ {m}_{n-1,m-1}=\frac{{m}_{n-1,m}{m}_{n,m-1}}{{m}_{1,m}+\dots +{m}_{n-2,m}+{m}_{n,m}}.\end{array}\right\}$$
(17.m-1)

Eqs. (18) give the concise form of Eqs. (17.1)-(17.m-1):

$${m}_{k,i}=\frac{{m}_{k,m}{m}_{n,i}}{{m}_{n,m}}$$
(18)
$$ \left( {k = 1, \ldots ,n - 1; i = 1, \ldots ,m - 1; m_{n,m} > 0} \right). $$

As it has been mentioned above (before Eqs. (3)), the indices of the variables of Eqs. (1a) can be always renamed in order that \({m}_{n,m}>0\) holds. Accordingly (without renaming the original indices), the more general form of Eqs. (18) is the set of Eqs. (2).

Theorem 2.1 has been proved.

3 Algorithm for assigning independent and dependent variables

Let us arrange the \(nm\) variables of Eqs. (1a) according to Table 1.

Table 1 Arrangement of the variables of Eqs. (1a)

The question is arisen whether the values of which variables (called independent variables) in Eqs. (1a) (or in Table 1) can be set freely such that the values of the remaining variables (called dependent variables) are uniquely (completely and without contradiction) determined by them. Parts 13 below give the answer along with the related selection process.


Part 1

Firstly, fix and place in a set L those indices \(l\) (\(l\in \left\{1,\dots ,m\right\}\)) for which the equality \({m}_{1,l}+\dots +{m}_{n,l}=0\) (equivalently \({m}_{1,l}=\dots ={m}_{n,l}=0\)) is required (because of any specific reasons). According to the form of Table 1, it means that the value of each variable in the l-th column of the table is set zero. That is, \(L:=\left\{l\in \left\{1,\dots ,m\right\}|{m}_{1,l}+\dots +{m}_{n,l}=0\right\}\). \( \left| L \right| \cdot n\) variables have been fixed in this way.

Without loss of generality, it can be assumed that \(L=\varnothing \) or L contains just some of the last indices (from the second ones), that is, \(L=\left\{l\in \left\{1,\dots ,m\right\}|r<l\le m; r\in \left\{1,\dots ,m-1\right\}\right\}\). (It is considered here that there is at least one index \(i\) (\(i\in \left\{1,\dots ,m\right\}\)) for which \({m}_{1,i}+\dots +{m}_{n,i}\ne 0\) according to (1c).) Otherwise, the variables can be reindexed (reordered and renamed) properly to fulfil this requirement. (Such a reindexing corresponds to changing the proper columns in Table 1.) From now on, let r denote the biggest (second) index \(i\) (\(i\in \left\{1,\dots ,m\right\}\)) for which \({m}_{1,i}+\dots +{m}_{n,i}\ne 0\) holds. That is, \(1\le r\le m\) is as follows:

$$r:=max\left\{i\in \left\{1,\dots ,m\right\}|{m}_{1,i}+\dots +{m}_{n,i}\ne 0\right\}.$$
(19)

Eqs. (20) give the restricted version of Eqs. (1a) containing the not yet fixed variables:

$${m}_{k,i}\left({m}_{1,j}+\dots +{m}_{n,j}\right)={m}_{k,j}\left({m}_{1,i}+\dots +{m}_{n,i}\right)$$
(20)
$$ \left( {k = 1, \ldots ,n; i = 1, \ldots ,r; j = 1, \ldots ,r; i \ne j} \right) $$

Remark 3.1

Eqs. (1a) hold trivially for indices \(l\in L\) for any (other) index \(\left(i=1,\dots ,m; i\ne l\right)\), that is,

$${m}_{k,i}\left({m}_{1,l}+\dots +{m}_{n,l}\right)={m}_{k,l}\left({m}_{1,i}+\dots +{m}_{n,i}\right)$$
(21)
$$ \left( {k = 1, \ldots ,n; i = 1, \ldots ,m; l \in L; i \ne l} \right). $$

Then Eqs. (20) can be rewritten in the form of Eqs. (22) without the risk of dividing by zero:

$$ \frac{{m_{k,i} }}{{m_{1,i} + \ldots + m_{n,i} }} = \frac{{m_{k,j} }}{{m_{1,j} + \ldots + m_{n,j} }} $$
(22)
$$ \left( {k = 1, \ldots ,n; i = 1, \ldots ,r; j = 1, \ldots ,r; i \ne j} \right). $$

Part 2

Now arrange the \(nr\) variables of Eqs. (22) according to Table 2.

Table 2 Arrangement of the variables of Eqs. (22)

Let us fix and place in a set S those (first) indices \(s\) (\(s\in \left\{1,\dots ,n\right\}\)) from Eqs. (22) (or from Table 2) for which the equality \({m}_{s,i}=0\) is required for some (second) index \(i\) (\(i\in \left\{1,\dots ,r\right\}\)) (because of any specific reasons). Based on (22), \({m}_{s,1}=\dots ={m}_{s,r}=0\) follows if \({m}_{s,i}=0\) (\(i\in \left\{1,\dots ,r\right\}\)). Equivalently, zero is set as the value of all variables in the \(s\)-th row (\(s\in \left\{1,\dots ,n\right\}\)) of Table 2. That is, \(S:=\left\{s\in \left\{1,\dots ,n\right\}|{m}_{s,i}=0; i\in \left\{1,\dots ,r\right\}\right\}\). Further \( \left| S \right| \cdot r \) variables have been fixed in this way.

Similarly as above, it can be assumed without loss of generality that can be assumed that \(S=\varnothing \) or S contains just some of the last indices (from the first ones), that is, \(S=\left\{s\in \left\{1,\dots ,n\right\}|t<s\le n; t\in \left\{1,\dots ,n-1\right\}\right\}\). (It is considered here that there is at least one index \(k\) (\(k\in \left\{1,\dots ,n\right\}\)) for which \({m}_{k,i}\ne 0\) for some index \(i\) (\(i\in \left\{1,\dots ,r\right\}\)) according to (1c).) Otherwise, the variables can be reindexed properly to fulfil this requirement. (Such a reindexing corresponds to changing the proper rows in Table 2.) From now on, let t denote the biggest (first) index \(k\) (\(k\in \left\{1,\dots ,n\right\}\)) for which \({m}_{k,i}\ne 0\) holds. That is, \(1\le t\le n\) is as follows:

$$t:=max\left\{k\in \left\{1,\dots ,n\right\}|{m}_{k,i}\ne 0; i=1,\dots ,r\right\}.$$
(23)

Eqs. (24) consist of those equalities of Eqs. (22) where the numerators are not equal to zero:

$$\frac{{m}_{k,i}}{{m}_{1,i}+\dots +{m}_{t,i}}=\frac{{m}_{k,j}}{{m}_{1,j}+\dots +{m}_{t,j}}$$
(24)
$$ \left( {k = 1, \ldots ,t; i = 1, \ldots ,r; j = 1, \ldots ,r; i \ne j} \right). $$

Part 3

Now arrange the \(tr\) variables of Eqs. (24) in accordance with Table 3.

Table 3 Arrangement of the variables of Eqs. (24)

Eqs. (24) (or Table 3) contain \(tr\) variables and \(t(r-1)\) equalities, among which \((t-1)(r-1)\) are independent (equalities). Accordingly, \(tr-\left(t-1\right)\left(r-1\right)=t+r-1\) variables can be considered independent, that is, the (positive) values of so many ones can be set freely (after selecting the variables with zero value in Parts 1 and 2 above). Now the task is to assign these (independent) variables such that the values of the remaining (dependent) variables are uniquely determined by them.

Based on (24), the following holds for all indices \({k}_{1}=1,\dots ,t; {i}_{1}=1,\dots ,r; {k}_{2}=1,\dots ,t; {i}_{2}=1,\dots ,r; {k}_{1}\ne {k}_{2}; {i}_{1}\ne {i}_{2}\):

$$\frac{{m}_{{k}_{1},{i}_{1}}}{{m}_{{k}_{2},{i}_{1}}}=\frac{{m}_{{k}_{1},{i}_{2}}}{{m}_{{k}_{2},{i}_{2}}}.$$
(25)

Accordingly, if we fix the values of more than one variables in the \({i}_{1}\)-st column (\({i}_{1}\in \left\{1,\dots ,r\right\}\)) of Table 3, then we also fix the ratios of the values in the corresponding rows in all columns of the table. For this reason, in the course of selecting the independent variables, more than one variables can be selected in any column only in such a way that they are not contained in such rows the ratios of which (the ratios of the variables in which) have been already fixed (in a direct or indirect way) during our former selections (corresponding to other columns). (If we select only one variable in a given column, it can be in any row since the already fixed ratios among the rows cannot be violated by fixing the value of a single variable.)

Remark 3.2

In fixing the ratios of two rows in a direct way, we mean that the corresponding rows (that is, the variables in them) are selected in the same column. In fixing the ratios of two rows in an indirect way, we mean that although the corresponding two rows are selected in different columns, there is a (finite) sequence of different columns in the following way: One of the (above two) rows is selected in the first column, the other one is selected in the last column, and for any neighbouring two columns in the sequence (not necessarily neighbouring in Table 3) it holds that among the selected rows in the neighbouring two columns exactly one row is the same in the two columns.

As for an example, assume that Table 3 has at least three rows and at least two columns. Select the first and second rows (variables) in the first column, through which the ratio of the first and second rows is (directly) fixed. Select the second and third rows (variables) in the second column, through which the ratio of the second and third rows is (directly) fixed. In addition, the ratio of the first and third rows is also fixed (indirectly) with these selections since the ratio of the first and second and the ratio of the second and third rows together determine this ratio as well.

In sum, the values of the corresponding variables of (1a)-(1c) can be set (freely) in the below way of Steps 13 (in accordance with the process given above in Parts 13).


Step 1

\({0}\leq \left|L\right|\cdot n={(m-r)n}\leq{ (m-1)n}\) Variables are selected in Table 1 such that they cover whole columns. The values of these variables are set zero. Then Table 2 is formed from Table 1 by means of deleting the concerned columns.


Step 2

\({0}\leq \left|S\right|\cdot r={(n-t)r}\leq {(n-1)r}\) Variables are selected in Table 2 such that they cover whole rows. The values of these variables are set zero. Then Table 3 is formed from Table 2 by means of deleting the concerned rows.


Step 3

\(t+r-1\) Variables are selected in Table 3 such that the selected variables in any column are contained in such rows the ratios of which (the ratios of the variables in which) are not fixed (in a direct or indirect manner) by the selected variables in the other columns. Then the values of these variables are set arbitrary positive numbers.

That is, arbitrary positive values have to be assigned to exactly \(t+r-1\) (independent) variables in the above Step 3 such that it does not lead to contradiction with respect to the value of any other (dependent) variable. The below process of Steps 3.0–3.r (as the detailed description of Step 3) is suggested for this purpose.


Step 3.0

Place the indices of the rows of Table 3 (in other words, the first indices of the variables) in separate sets. Namely, form sets \(\left\{1\right\}\), \(\left\{2\right\}\), …, \(\left\{t\right\}\). Place them in a further set \(I\), that is, \(I{ \sim } = \left\{ {\left\{ 1 \right\}, \left\{ 2 \right\}, \ldots , \left\{ t \right\}} \right\}\).


Step 3.1

\({n}_{1}\) (\({1\le n}_{1}\le t\)) variables (rows) as independent variables from the first column of Table 3. It is equivalent to that \({n}_{1}\) elements (sets) are selected from set \(I\). The ratios of the selected \({n}_{1}\) rows (that is, the variables in the selected rows) are fixed in this way in all columns of the table likewise. Then delete the selected sets from set \(I\), and place the union of the deleted sets in \(I\) as a new element. (If, for example, we select the second and third variables in the first column of Table 3, by which the ratio of the second and third rows are fixed throughout the table, then sets \(\left\{2\right\}\) and \(\left\{3\right\}\) are deleted but \(\left\{2, 3\right\}\) is added in \(I\). Thus set \(I\) has become \(I=\left\{\left\{1\right\}, \left\{\mathrm{2,3}\right\}, \left\{4\right\}, \dots , \left\{t\right\}\right\}\).) In this way, set \(I\) has \({n}_{1}-1\) less elements than at the end of Step 3.0 (namely it has already \({t-(n}_{1}-1)\) elements).

In the remaining part of the process, \(t+r-1-{n}_{1}\) variables have to be still selected in Table 3.


Step 3.2

Select \({n}_{2}\) (\({1\le n}_{2}\le t-({n}_{1}-1)\)) variables (rows) as independent variables from the second column of Table 3 such that at most one element (one index of rows) is selected from each element (which is also a set) of \(I\). In this way, the ratios of those rows are fixed in the whole table the indices of which are contained in any of the sets concerned with the selection. Then delete the sets concerned with the selection from set \(I\), and place the union of the deleted sets in \(I\) as a new element. (If, for example, \(I=\left\{\left\{1\right\}, \left\{\mathrm{2,3}\right\}, \left\{4\right\}, \dots , \left\{t\right\}\right\}\) at the end of Step 3.1, and now we select the third and fourth variables in the second column of Table 3, then sets \(\left\{\mathrm{2,3}\right\}\) and \(\left\{4\right\}\) are deleted but \(\left\{2, 3, 4\right\}\) is added in \(I\). Thus set \(I\) has become \(I=\left\{\left\{1\right\}, \left\{\mathrm{2,3}, 4\right\}, \left\{5\right\}, \dots , \left\{t\right\}\right\}\). Here set \(\left\{2, 3, 4\right\}\) indicates that the ratios of the second, third and fourth rows are already fixed throughout Table 3 (see also Remark 3.2). In this way, set \(I\) has \({n}_{2}-1\) less elements than at the end of Step 3.1 (namely it has already \({t-(n}_{1}-1)-({n}_{2}-1)\) elements).

In the remaining part of the process, \(t+r-1-{n}_{1}-{n}_{2}\) variables have to be still selected in Table 3.

.

.

.


Step 3.i

\({n}_{i}\) (\({1\le n}_{i}\le t-\left({n}_{1}-1\right)-\left({n}_{2}-1\right)-\dots -({n}_{i-1}-1)\)) variables (rows) as independent variables from the \(i\)-th column of Table 3 such that at most one element (one index of rows) is selected from each element of \(I\). In this way, the ratios of those rows are fixed in the whole table the indices of which are contained in any of the sets concerned with the selection. Then delete the sets concerned with the selection from set \(I\), and place the union of the deleted sets in \(I\) as a new element. In this way, set \(I\) has \({n}_{i}-1\) less elements than at the end of Step 3.i-1 (namely it has already \({t-(n}_{1}-1)-({n}_{2}-1)-\dots -({n}_{i}-1)\) elements).

In the remaining part of the process, \(t+r-1-{n}_{1}-{n}_{2}-\dots -{n}_{i}\) variables have to be still selected in Table 3.

.

.

.


Step 3.r

Now select (the maximally possible) \({n}_{r}\) (\({1\le n}_{r}=t-\left({n}_{1}-1\right)-\left({n}_{2}-1\right)-\dots -({n}_{r-1}-1)\)) variables (rows) as independent variables from the \(r\)-th (last) column of Table 3 in such a way that at most one element (one index of rows) is selected from each element of \(I\). In this way, the ratios of all rows are fixed in the whole table.

Finally, assign arbitrary positive values to the (independent) variables selected above in Steps 3.1–3.r.

Remark 3.3

  1. 1.

    It can be proved that at least one variable (row) has to be selected in all Steps 3.1–3.r above in order that the required \(t+r-1\) positive independent variables are fixed entirely (see Lemma A3 in the Appendix). Therefore we have assumed well above that \({1\le n}_{1}{, n}_{2},\dots ,{n}_{r}\). It can be also seen from the above process that \(t+r-1-{n}_{1}-{n}_{2}-\dots -{n}_{r-1}\) variables have to be still selected in the \(r\)-th (last) step, where \({n}_{r}=t-\left({n}_{1}-1\right)-\left({n}_{2}-1\right)-\dots -\left({n}_{r-1}-1\right)\). These two values are equal, so the process provides just as many (\(t+r-1\)) positive independent variables as needed. In assigning the variables (in Steps 1–3), altogether \(\left(m-r\right)n+\left(n-t\right)r+t+r-1\) (\(1\le r\le m, 1\le t\le n\)) (independent) variables have taken their (zero or arbitrary positive) values. Now we can determine the values of the remaining (dependent) variables (remained from the all \(nm\) ones) with Eqs. (2), which is a rather simple thus practically usable formula.

  1. 2.

    Figure 2 in the serves with the visual representation of the above algorithm of assigning/determining the values of all variables.

    Fig. 2
    figure 2

    Proposed algorithm for assigning the values of the variables

4 Application for limited resources

Assume that system (1a1b) is completed with the condition of

$${m}_{\mathrm{1,1}}{+\dots +m}_{n,1}+\dots +{m}_{1,m}+\dots +{m}_{n,m}=R$$
(26)

for some prefixed positive number\(R\). (From (26), (1c) follows.) It is a rather natural requirement if \(R\) represents the available amount of some limited resource (fresh water, food, financial support etc.), and\({m}_{\mathrm{1,1}}\), …,\({m}_{n,1}\), …,\({m}_{1,m}\), …, \({m}_{n,m}\) represent its parts provided for some agents/stakeholders.

For assuring the fulfilment of Eq. (26) when assigning the values of the variables in the course of Steps 1–3 above, we can proceed as follows: The (basically arbitrary) positive values fixed in Steps 3.1–3.r cannot be considered as the final values of the independent variables only fixed proportional numbers among them. That is, only (final) proportions can be allocated among the corresponding variables not final values in Steps 3.1–3.r. After fixing these proportions for the independent variables, let us determine the proportions for the dependent ones by means of Eqs. (2). Then denote the fixed/gained proportions with \({\widetilde{m}}_{\mathrm{1,1}}\), …,\({\widetilde{m}}_{n,1}\), …,\({\widetilde{m}}_{1,m}\), …, \({\widetilde{m}}_{n,m}\) with respect to the variables \( {m}_{\mathrm{1,1}}\), …,\({m}_{n,1}\), …,\({m}_{1,m}\), …,\({m}_{n,m}\), respectively. (If, for example, \({\widetilde{m}}_{\mathrm{1,1}}=1\) and \({\widetilde{m}}_{\mathrm{2,3}}=2\) are resulted in this process, it means that the ratio between the (still to be determined) final values of \({m}_{\mathrm{1,1}}\) and \({m}_{\mathrm{2,3}}\) will be 1:2.)

Now let us form the ratio

$$K:=\frac{R}{{\widetilde{m}}_{\mathrm{1,1}}{+\dots +\widetilde{m}}_{n,1}+\dots +{\widetilde{m}}_{1,m}+\dots +{\widetilde{m}}_{n,m}}.$$
(27)

Finally, the values of\({m}_{\mathrm{1,1}}\), …,\({m}_{n,1}\), …,\({m}_{1,m}\), …, \({m}_{n,m}\) satisfying (26) are gained as follows:

$$ m_{1,1} = K\tilde{m}_{1,1} , \ldots ,m_{n,1} = K\tilde{m}_{n,1} , \ldots ,m_{1,m} = K\tilde{m}_{1,m} , \ldots ,m_{n,m} = K\tilde{m}_{n,m}.$$
(28)

To our knowledge, besides the here proposed method (with the algorithm of Sect. 3 and Eqs. (2) in Theorem 2.1), there is no similarly direct and fast way (with similarly low computational demand) to assign (or check) the independent/free variables (without generating contradiction) and set their values in case of resource allocation problems under the constraints (1a), (1b) and (1c) or (26). Without this method, the feasibility of any (suggested) assignment of the variables could be checked only with the direct substitutions into system (1a) of \(n-1\) equalities. Furthermore, the determination of the values of the dependent variables would require to solve the same system of (nonlinear) Eqs. (1a) completed with (26), instead of some simple substitutions into Eqs. (2), (27) and (28).

In sum, compared to the known (ordinary) way, the method proposed in the present paper decreases considerably the computational demand (number of calculations/operations to be executed) of both assigning/checking the free variables and setting the values of the variables, in case of the studied kind of resource allocation problems.

5 Practical examples

In this section, practical examples are presented on how to utilize the above worked out mathematical process in various application fields mostly for allocating limited resources. Nevertheless, in Example 5.3, it is shown that the results can be applied not only for allocation problems but more generally for any problems which can be described with the basic system (1a), (1b) and (1c) or (26).

Example 5.1a

Let us have three towns (Town 1, Town 2 and Town 3) in a region. Each town runs four operating sectors. Sector 1 is the public service sector (which includes the medical institutions, kindergartens, schools etc.), Sector 2 is the civil sector (including the citizens’ houses, flats etc.), Sector 3 is the industry (with factories, warehouses etc.) and Sector 4 is the agriculture (including greenhouses, storing and service buildings). Assume that the three towns have similar working profile, that is, the importance of any sector (compared to the other ones) is about the same in all towns.

In the region, utilizable geothermal heat is available in the form of thermal water, which is allocated among the sectors of the towns in the heating season (winter) by means of the hydraulic network maintained by the regional government. After the usage, the cooled down water is pumped back deeply in the soil, in order to make the hot water utilization completely renewable and not to charge the surface waters at all (GEOSZ, 2014; Nagygál & Tóth, 2017.). As the (yearly) amount of the thermal water (\(R\) in (26)) is limited, each town has to appoint (independently of the other towns) those two sectors, along with their heat demand, the heating with thermal water (which is free of charge for the town) is the most important for it. Since the still missing heat (in any sector) has to be supplied at the expense of the corresponding town, each town should appoint those two sectors the heating of which would be the most expensive for it. These sectors may be different in different towns. For example, the industry of a certain town may produce enough waste heat to meet its own heat demand while in another town, the private buildings may have better thermal insulation and/or more solar building heating systems, which brings about a negligible cost with respect to the heating of Sector 2, etc.

It is assumed that the regional government allocates the thermal water provided for a given town among the different sectors according to the same proportions in all towns for maintaining the overall political balance. In this way, the stakeholders of neither sector should feel suffering from any negative discrimination (compared to the other sectors) more in any town than in any other one. It is assumed as well that all sectors of all towns are supplied with a positive (not zero) quantity of thermal water (also for avoiding the dissatisfactions).

Under the above circumstances, the problem is in accordance with system (1a), (1b), (26) with the following definition of the variables: Let the amount of the supplied thermal water for Sectors 1, 2, 3, 4 in Town 1 be denoted with \({m}_{\mathrm{1,1}}\), \({m}_{\mathrm{2,1}}\), \({m}_{\mathrm{3,1}}\), \({m}_{\mathrm{4,1}}\), respectively, for Sectors 1, 2, 3, 4 in Town 2 be denoted with \({m}_{\mathrm{1,2}}\), \({m}_{\mathrm{2,2}}\), \({m}_{\mathrm{3,2}}\), \({m}_{\mathrm{4,2}}\), respectively and for Sectors 1, 2, 3, 4 in Town 3 be denoted with \({m}_{\mathrm{1,3}}\), \({m}_{\mathrm{2,3}}\), \({m}_{\mathrm{3,3}}\), \({m}_{\mathrm{4,3}}\), respectively. The variables determine Table 3 of Sect. 3 directly, the size of which is 4 × 3 in this case (that is, \(t=4\), \(r=3\), number of independent variables is \(t+r-1=6\), number of dependent variables is \(t\cdot r-\left(t+r-1\right)=6\), see Sect. 3).

Assume that Town 1 prefers the heating of Sectors 1 and 2, Town 2 prefers the heating of Sectors 1 and 3 and Town 3 prefers the heating of Sectors 2 and 3 with the thermal water, see part a) of Fig. 1. Furthermore, if it were possible, Town 3 would appoint Sector 4 in the third place. The towns also specify their particular heat demands (that is, thermal water quantities), from which not only variables \({m}_{\mathrm{1,1}}\), \({m}_{\mathrm{2,1}}\), \({m}_{\mathrm{1,2}}\), \({m}_{\mathrm{3,2}}\), \({m}_{\mathrm{2,3}}\) and \({m}_{\mathrm{3,3}}\) (as independent variables) themselves but also their values are fixed. The fixing of \({m}_{\mathrm{1,1}}\) and \({m}_{\mathrm{2,1}}\) can be considered such that the first and second elements in the first column of Table 3 are selected in Step 3.1 (that is, \({n}_{1}=2\), see Sect. 3), from which set \(I=\left\{\left\{1, 2\right\}, \left\{3\right\}, \left\{4\right\}\right\}\) is resulted. In the next step (in Step 3.2), the elements from the second column should be selected in such a way that at most one element is selected from each element of this set \(I\) (that is from sets \(\left\{1, 2\right\}\), \(\left\{3\right\}\) and \(\left\{4\right\}\)). The fixing of variables \({m}_{\mathrm{1,2}}\) and \({m}_{\mathrm{3,2}}\) satisfies this requirement since they are the first and third elements in the second column, that is, only element 1 is selected from set \(\left\{1, 2\right\}\), and element 3 is selected from set \(\left\{3\right\}\). From these selections, set \(I\) is modified to the following: \(I=\left\{\left\{1, 2, 3\right\}, \left\{4\right\}\right\}\). In the last step (in Step 3.3), the second and third variables are selected from the third column (which are \({m}_{\mathrm{2,3}}\) and \({m}_{\mathrm{3,3}}\), respectively), that is, indices 2 and 3 are selected in the elements of set \(I\). However it is not a feasible selection as both of 2 and 3 belong to the same element of set \(I\) (namely, to set \(\left\{1, 2, 3\right\}\)).

Therefore the appointed demands of the Towns cannot be met such that the political balance is assured, that is, such that (1a), (1b), (26) hold.

One of the solutions of the problem can be the following: If the cost of heating Sector 3 in Town 3 were decreased enough (for example, by means of the improvement of the thermal insulation of the industrial buildings possibly with governmental support), then heating Sector 3 could become less expensive than heating Sector 4. In this case, Town 3 would specify the required values of variables \({m}_{\mathrm{2,3}}\) and \({m}_{\mathrm{4,3}}\) (instead of \({m}_{\mathrm{3,3}}\)) to the regional government, see part b) of Fig. 1. In Step 3.3 above, this requirement can be already satisfied while maintaining the political balance, because the fixing of variables \({m}_{\mathrm{2,3}}\) and \({m}_{\mathrm{4,3}}\) means the selection of only one index from each element of set \(I\) (in a feasible way). Namely, indices 2 and 4 are selected from set \(\left\{1, 2, 3\right\}\) and \(\left\{4\right\}\), respectively. Then the values of the remaining six (dependent) variables \({m}_{\mathrm{3,1}}\), \({m}_{\mathrm{4,1}}\), \({m}_{\mathrm{2,2}}\), \({m}_{\mathrm{4,2}}\), \({m}_{\mathrm{1,3}}\) and \({m}_{\mathrm{4,3}}\) can be determined with Eqs. (2). If the resulted overall quantity of the needed thermal water is more than the (yearly) available amount \(R\) (basically, this case is assumed), then the values of the variables can be decreased proportionally in accordance with the process given in Sect. 4.

Example 5.1b

The previous example was solved by hand. For large-scale problems, the proposed method should be fed into a proper computer software. Then it can be applied conveniently. For example, the Matlab computational tool (Etter et al., 2004) can be used to solve the following extension of Example 5.1a of size 11 × 10. (This size is already too large to solve by hand easily but still easy to look through here. Much larger problems can be handled similarly, of course.)

Let us have 10 towns and 11 sectors (\(t=11\), \(r=10\) in the current version of Table 3). The meaning of the variables \({m}_{\mathrm{1,1}}\), \({m}_{\mathrm{2,1}}\),…, \({m}_{\mathrm{11,1}}\), \({m}_{\mathrm{1,2}}\), \({m}_{\mathrm{2,2}}\),…, \({m}_{\mathrm{11,2}}\),…, \({m}_{\mathrm{1,10}}\), \({m}_{\mathrm{2,10}}\),…, \({m}_{\mathrm{11,10}}\) is in accordance with Example 5.1a.

Now there are \(t+r-1=20\) independent variables. Accordingly, let each town have the possibility of assigning two sectors (along with their heat demands) as per its preferences. In particular, assume that (originally) \({m}_{\mathrm{3,1}}\), \({m}_{\mathrm{7,1}}\), \({m}_{\mathrm{2,2}}\), \({m}_{\mathrm{8,2}}\), \({m}_{\mathrm{3,3}}\), \({m}_{\mathrm{6,3}}\), \({m}_{\mathrm{5,4}}\), \({m}_{\mathrm{10,4}}\), \({m}_{\mathrm{1,5}}\), \({m}_{\mathrm{7,5}}\), \({m}_{3.6}\), \({m}_{\mathrm{4,6}}\), \({m}_{\mathrm{4,7}}\), \({m}_{\mathrm{11,7}}\), \({m}_{\mathrm{1,8}}\), \({m}_{\mathrm{11,8}}\), \({m}_{\mathrm{5,9}}\), \({m}_{\mathrm{8,9}}\), \({m}_{2.10}\), \({m}_{\mathrm{7,10}}\) are assigned as the (desired) independent variables (that is, Town 1 prefers the heating of Sectors 3 and 7, Town 2 prefers Sectors 2 and 8,…, Town 8 prefers Sectors 1 and 11,…).

Running the algorithm of Sect. 3 in the computer, it gets stuck in step 8 (Step 3.8), after step 7 (Step 3.7), when the current form of set \(I\) is \(I=\left\{\left\{1, 3, 4, 6, 7, 11\right\}, \left\{2, 8\right\}, \left\{5, 10\right\}, \left\{9\right\}\right\}\). The here (in step 8) intended assignment of \({m}_{\mathrm{1,8}}\) and \({m}_{\mathrm{11,8}}\), as independent variables, is not feasible since the corresponding indices 1 and 11 are in the same element \(\left\{1, 3, 4, 6, 7, 11\right\}\) of set \(I\).

We could (temporarily) solve the problem if, for example, we (Town 8) selected Sector 10 instead of Sector 11 (that is, \({m}_{\mathrm{10,8}}\) instead of \({m}_{\mathrm{11,8}}\)). It is possible if the heat demand of Sector 11 can be decreased (by means of better insulation) or satisfied from another (renewable) heat resource. Nevertheless, the algorithm gets stuck again after step 9, when \(I=\left\{\left\{1, 2, 3, 4, 5, 6, 7, 8, 10, 11\right\}, \left\{9\right\}\right\}\) and Town 10 would like to assign Sectors 2 and 7 (that is, \({m}_{\mathrm{2,10}}\) and \({m}_{\mathrm{7,10}}\)). It is not feasible since the corresponding indices 2 and 7 are from the same element of set \(I\). We could completely solve the problem if, for example, we could make Town 8 (in step 8) select Sector 9 instead of Sector 11 or 10 (that is, \({m}_{\mathrm{9,8}}\) instead of \({m}_{\mathrm{11,8}}\) or \({m}_{\mathrm{10,8}}\)).

Finally, the values of the remaining \(tr-\left(t+r-1\right)=90\) (dependent) variables can be determined with Eqs. (2), conveniently, by means of the used computer program. If the overall quantity of the needed thermal water is more than the available amount \(R\), then the values of the variables can be decreased proportionally according to the process given in Sect. 4.

Example 5.2

Let us have a country region (a village near a wetland) with three artificially made nests for white storks (Ciconia ciconia (Linnaeus 1758)) relatively far from one another in order that any of them does not disturb the others directly. A clutch size of storks is observed in each nest continuously. It is assumed that (on the average) four nestlings per year hatch out in each one of the three different nests. In order to maintain the population size and the genetic variability of the species, it is desired that all four nestlings reach the adult age (in an average year) in the nest the (permanent) male parent (Vergara et al., 2006) in which has the more advantageous/rare genetic feature (let it be called Nest 1). It is also desired (for the same purpose) that in the other two nests, called Nest 2 and Nest 3, at least three and at least two nestlings reach the adult age. It can be assumed (based on (Kwieciński et al., 2006)) that a nestling needs minimum 40 kg feed (in the form of large insects, mice, lizards, frogs etc.) to grow up during the whole feeding period (5–6 weeks).

It is assumed that the given region can maintain at most three couples of parents along with their nests in its present form. Furthermore, the couples (at least the male parents) return to the same nest every year. The (yearly average) carrying capacity of the whole region, that is, the overall feed amount available for the nestlings is known. The feed is assured partly in natural way by the region itself and partly from (continuous) additional feed provided for each nest separately (similarly as in (Moritzi et al., 2001)). The overall quantity of the additional feed is fixed, but its ratios allocated among the particular nests can be changed.

Based on observations, the parents provide different proportions of the available feed for the nestlings. Accordingly, the earlier hatching means an advantage in this respect as well as a higher capability of living (Tortosa & Redondo, 1992). It can be also assumed that these proportions are the same in the different nests. Furthermore, it has been assessed that Nest 1 receives 220 kg feed (in a year on average) while Nest 2 and Nest 3 receive 176 kg and 152 kg, respectively, according to the present allocation of the overall feed.

Our task is to check whether the required number of nestlings in each nest reach (expectedly) the adult age in case of the present allocation of the feed. If not, it should be examined if the feed (its artificially provided part) can be reallocated such that this requirement is already fulfilled.

Let us denote the feed amount consumed by the first, second, third and fourth (according to the hatching order) of nestlings in Nest 1 with \(m_{1,1}\), \(m_{2,1}\), \(m_{3,1}\), \(m_{4,1}\), respectively, the feed amount consumed by the first, second, third and fourth nestlings in Nest 2 with \(m_{1,2}\), \(m_{2,2}\), \(m_{3,2}\), \(m_{4,2}\), respectively, and the amount consumed by the first, second, third and fourth nestlings in Nest 3 with \(m_{1,3}\), \(m_{2,3}\), \(m_{3,3}\), \(m_{4,3}\), respectively. These variables fulfil system of conditions (1a), (1b), (26) (where \(R = 220 + 176 + 152 = 548\) (kg)). Assuming further that neither nestling gets zero amount, the variables determine Table 3 (see Sect. 3), the size of which is 4 × 3 in this case.

For discovering the consumed feed amounts corresponding to the hatching order, the feed consumed by each nestling in Nest 1 is observed (measured) in a particular year. Assume that these observed values are \(m_{1,1} := 70.8\) (kg), \(m_{2,1} := 58.8\), \(m_{3,1} := 49.2\) and \(m_{4,1} := 41.2\) (in sum 220 (kg)). It can be considered such that all elements in the first column of Table 3 are selected in Step 3.1 (that is, \(n_{1} = t = 4\), see Sect. 3), from which set \(I = \left\{ {\left\{ {1, 2, 3, 4} \right\}} \right\}\) is resulted.

Since we can select variables (rows) in each step only in such a way that at most one index is selected from each element (as a set) of set \(I\), exactly one arbitrary variable should be selected from each one of the second and third rows (in Steps 3.2 and 3.3). As it is desired that at least two and three nestlings grow up in Nests 2 and 3, let us assign the corresponding minimal value (40 kg) for the third nestling of Nest 2 and for the second nestling of Nest 3, considering that Nest 2 possesses basically more feed (176 kg) than Nest 3 (152 kg) (according to the present allocation), that is, \(m_{3,2} = 40\), \(m_{2,3} = 40\).

In this way, we have fixed the values of all (six) independent variables. Now the values of the remaining (dependent) variables can be determined with Eqs. (2). The following is resulted with respect to Nest 2:

$$ m_{1,2} = \frac{{m_{1,1} m_{3,2} }}{{m_{3,1} }} = \frac{70.8 \cdot 40}{{49.2}} = 57.6,m_{2,2} = \frac{{m_{2,1} m_{3,2} }}{{m_{3,1} }} = 48,\left( {m_{3,2} = 40} \right),m_{4,2} = \frac{{m_{4,1} m_{3,2} }}{{m_{3,1} }} = 33.6, $$

the sum of which is 179.2 > 176 (kg). Thus Nest 2 has not got the needed feed amount.

Let us examine now if the overall amount can be reallocated in such a way that the required number of nestlings grow up in all nests. Let us prescribe for this aim that the critical nestlings (the third one in Nest 2 and the second one in Nest 3) are supplied just with the needed minimal feed amount, that is, \(m_{4,1} := 40\), \(m_{3,2} := 40\) and \(m_{2,3} := 40\). Furthermore, \(m_{1,1} := 69.2\), \(m_{2,1} := 57.6\) and \(m_{3,1} := 48\) for assuring the (already known) proportions with respect to the hatching order. (In this way, the sum amount for Nest 1 is 214.8 kg.) These values determine the values of the other (dependent) variables. As we have already calculated, \(m_{1,2} := 57.6\), \(m_{2,2} := 48\) (\(m_{3,2} := 40\)) and \(m_{4,2} := 33.6\) (in sum 179.2 kg). The values regarding Nest 3 are the following:

$$ m_{1,3} = \frac{{m_{1,1} m_{2,3} }}{{m_{2,1} }} = \frac{69.2 \cdot 40}{{57.6}} = 48.1,\left( {m_{2,3} = 40} \right), $$
$$ m_{3,3} = \frac{{m_{3,1} m_{2,3} }}{{m_{2,1} }} = 33.3,m_{4,3} = \frac{{m_{4,1} m_{2,3} }}{{m_{2,1} }} = 27.8 $$

(in sum 149.2 kg). From these numbers, the overall required feed amount is resulted as \(m_{1,1} + \ldots + m_{4,1} + \ldots + m_{1,3} + \ldots + m_{4,3} = 543.2\) (kg), which is less than the whole available feed amount of the region, that is, \(R = 548\) (kg).

Therefore the feed (more precisely, its additionally provided part) can be redistributed such that the required number of nestlings reach the adult age in all nests. It has to be assured only that after the reallocation at least 214.8, 179.2 and 148.8 kg feed fall to the share of Nests 1, 2 and 3, respectively.

Example 5.3

In the stubble-field of a plough-land, the spatial distribution of four weed species is studied. More particularly, it is examined if there is any scale dependency (if yes, to what extent) of the relative coverage of the different species, that is, the size of the relative area covered by the different species (measured in m2/m2). (Similar problems on scale dependency, regarding especially the biodiversity, can be found e.g. in (Tóthmérész, 1995a, 1995b). Scale dependency can be inferred from that the values of the relative coverage of a given species are not the same for the different quadrat sizes (see below). If no scale dependency is experienced in case of a given species, it is considered that the spatial distribution of that species is homogeneous. The studied species are the red-root amaranth (Amaranthus retroflexus L.) (Species 1), the knotgrass (Polygonum aviculare L.) (Species 2), the ragweed (Ambrosia artemisiifolia L.) (Species 3) and the goosefoot (Chenopodium album L.) (Species 4). (These particular species have considerable international importance, see e.g. (Makra et al., 2015).)

Three sizes of square quadrates (10 m × 10 m, 5 m × 5 m, 1 m × 1 m) are applied, that is, square areas of sizes 10 m × 10 m (= 100 m2), 5 m × 5 m (= 25 m2) and 1 m × 1 m (= 1 m2) are assigned randomly in the plough-land, and the surfaces covered by all weed species are measured in them. Finally, the measured values are divided by the area of the corresponding quadrates. More particularly, five quadrates are assigned randomly in each size, and the average of the values measured in them is considered as the corresponding (measured) value for the given quadrate (with respect to each species separately). (Similar examinations of weeds with quadrates are widely used in the field of agriculture and nature protection, see e.g. (Pinke & Pál, 2008).)

Let us introduce the following variables: \({m}_{\mathrm{1,1}}\), \({m}_{\mathrm{2,1}}\), \({m}_{\mathrm{3,1}}\), \({m}_{\mathrm{4,1}}\) denote the relative coverage (in m2/m2) of Species 1, 2, 3, 4, respectively, in case of the 100 m2 quadrate size, \({m}_{\mathrm{1,2}}\), \({m}_{\mathrm{2,2}}\), \({m}_{\mathrm{3,2}}\), \({m}_{\mathrm{4,2}}\) denote the relative coverage of Species 1, 2, 3, 4, respectively, in case of the 25 m2 quadrate size, and \({m}_{\mathrm{1,3}}\), \({m}_{\mathrm{2,3}}\), \({m}_{\mathrm{3,3}}\), \({m}_{\mathrm{4,3}}\) denote the relative coverage of Species 1, 2, 3, 4, respectively, in case of the 1 m2 quadrate size. With these definitions, the variables satisfy system of conditions (1a)-(1c), if the spatial distributions of all four species are homogeneous.

Assume that we have the following measured data: For the biggest quadrate size, the relative coverage of Species 1, 3 and 4 are \(m_{1,1} := 40\) (m2/m2), \(m_{3,1} := 10\) and \(m_{4,1} := 5\). For the 25 m2 size, the relative coverage of Species 2 and 4 are \(m_{2,2} := 5\) and \(m_{4,2} := 1.25\). For the 1 m2 size, the relative coverage of Species 1 is \(m_{1,3} := 0.4\). The fixing of these (positive) values can be considered as selecting all (six) independent variables in Table 3 (of Sect. 3) in a feasible way. In particular, the first, third and fourth variables are selected in the first column, from which set \(I = \left\{ {\left\{ {1, 3, 4} \right\}, \left\{ 2 \right\}} \right\}\) is resulted. In the second column only one element is selected from each of the sets \(\left\{ {1, 3, 4} \right\}\) and \(\left\{ 2 \right\}\) (in accordance with the prescription of Sect. 3). Finally, only one variable is selected from the last column, which cannot be a problem.

The remaining (dependent) variables can be (uniquely) determined with Eqs. (2), if the mentioned homogeneity holds for all species. However, assume that there is one more measured data: For the 1 m2 quadrate size, let the relative coverage of Species 2 be \(m_{2,3} = 0.5\) (m2/m2). This value is not in accordance with the one that can be calculated (in two steps) with Eqs. (2), which is

$${m}_{\mathrm{2,3}}=\frac{{m}_{\mathrm{2,2}}{m}_{\mathrm{1,3}}}{{m}_{\mathrm{1,2}}}=\frac{5\cdot 0.4}{10}=0.2 (\mathrm{m}2/\mathrm{m}2)$$

based on

$${m}_{\mathrm{1,2}}=\frac{{m}_{\mathrm{1,1}}{m}_{\mathrm{4,2}}}{{m}_{\mathrm{4,1}}}=\frac{40\cdot 1.25}{5}=10 (\mathrm{m}2/\mathrm{m}2).$$

Thus it has been resulted that the spatial distributions of the species are not homogeneous. More precisely, Species 2 presents a considerably higher value (0.5 m2/m2) than that corresponding to the homogeneity (0.2 m2/m2) in case of small quadrate size. It suggests that Species 2 has (relatively large) clonal patches, from where the other species are obviously excluded. However, the sizes of such spots are limited since the anomaly takes place in the smallest quadrate size (if the cardinality of the (measured) sample is relatively low).

Remark 5.1

  1. 1.

    Extended versions of Example 5.2, 5.3 which could be solved practically only with a computer, could be provided similarly to the extended version of Example 5.1a (which is Example 5.1b).

  2. 2.

    Similar flow charts to the one in Fig. 1 could be attached to Example 5.1b, 5.2 and 5.3 as well.

6 Conclusion

The proper allocation/distribution of limited resources is a traditional problem with various applications. From the managerial point of view, the task is to allocate some limited resource among several users while it should be also often decided which one of the users’ preferences can be satisfied and which one cannot.

Mathematical resource allocation problems are usually endowed with constraints determining the feasible set, from which the (nearly) optimal or equilibrium solution should be selected. Often the main task is to determine the feasible solutions. Then their knowledge makes it much easier to select the (nearly) optimal or equilibrium solution of the problem. In some cases, any feasible solution is the same acceptable and the task is “only” to check the feasibility of particular/desired allocations.

In the paper, a practical algorithm is proposed based on a new theorem and supporting lemmas on the feasible allocation of a limited resource among several users under quadratic constraints. In more detail, the free/independent variables (portions of the resource) are assigned first then their values determine directly those of the other, dependent variables. In this way, feasible solutions can be produced or the feasibility of a given/desired allocation can be checked.

Without our proposed method, the feasibility of any (suggested) allocation of the resource could be checked only with direct substitutions into the system of equations expressing the (nonlinear) constraints. This would imply a much higher computational demand.

From the managerial point of view, the proposed algorithm helps in deciding which one of several users’ preferences can be satisfied (without breaking the constraints/conditions of a given task) and which one cannot, while allocating some limited resource among the users. The sum of the variables, that is the overall amount of the resource, can be either prefixed or not.

Practical examples have been also presented from various application fields, which hopefully help the Readers in utilizing the results.

Future researches may deal with the possibility of extending the results for modified or less strict constraints. In particular, the values of the variables in Eqs. (1a) might be any real numbers (not only nonnegative ones). Although this case would not go well with real resource allocation problems (where negative values are not realistic), on the whole the field of applications could be increased.