Maximum Entropy Analysis of Flow Networks with Nonlinear Constraints

The concept of a flow network – a set of nodes connected by flow paths – encompasses many different disciplines, including electrical, pipe flow, transportation, chemical reaction, ecological, epidemiological, economic and human social networks. Over the past two years, we have developed a maximum entropy (MaxEnt) method to infer the state of a flow network, subject to “observable” constraints on expectations of various parameters, “physical” constraints such as conservation (Kirchhoff’s) laws and frictional properties, and “graphical” constraints due to uncertainty in the network structure itself. The method enables the probabilistic prediction of physical parameters and (if necessary) the graphical properties of the network, when there is insufficient information to obtain a closed-form solution. A number of analytical, semi-analytical and numerical tools have been developed for the handling of nonlinear constraints, and for extracting analytical and/or numerical solutions. The method is demonstrated by application to the analysis of real pipe flow and electrical power networks.


Introduction
A "flow network" can be defined as a set of nodes connected by various edges, upon which one or more quantities (usually, conserved quantities) can flow.This concept provides a framework which unites many different disciplines, including electrical, pipe flow, transportation, chemical reaction, ecological, epidemiological, economic and human social networks.Traditionally, flow networks have been analysed by deterministic methods, involving the solution of conservation (Kirchhoff's) laws and specified flow rates on particular edges and/or entire flow paths [1].In the past few decades, new methods for network analysis have been developed using dynamical simulation, optimisation and genetic programming.Apart from applications in the field of transport modelling [2,3], the analysis of flow networks using the maximum entropy (MaxEnt) method of Jaynes [4,5] is much less developed.In this method, an entropy function -defined using a probability which expresses the total uncertainty in the network -is maximised subject to constraints, to infer the stationary state of the network.In statistical physics, MaxEnt methods have become quite popular for the analysis of network structures (graph ensembles) subject to various configurational constraints [6,7], but mostly without consideration of flows or potentials on the network.
We here present a generalised MaxEnt method to infer the stationary state of a flow network, subject to "observable" constraints on expectations of various parameters, "physical" constraints such as conservation laws and frictional properties, and "graphical" constraints arising from uncertainty in the network structure itself.The method invokes a relative entropy defined over all uncertainties within the system, which necessarily must include all stochastic parameters (random variables).The method enables the probabilistic prediction of physical parameters and (if necessary) the graphical properties of the network, when there is insufficient information to obtain a closed-form solution.A number of analytical, semi-analytical and numerical tools are developed for the handling of nonlinear constraints, and for extracting analytical and/or numerical solutions.The method is demonstrated by application to several example systems, including a 327-node urban electrical power distribution system in Campbell, Australian Capital Territory, which contains distributed power sources.This study builds upon previous MaxEnt analyses of the steady state of flow and dissipative systems [8][9][10][11][12][13] and flow networks [14][15][16][17][18][19].

Network and Physical Parameters
Consider a generalised undirected or directed graph network with flow rates and potential differences.This can be represented by the following properties: (1) N nodes, denoted with index i or j; (2) M edges, defined by an adjacency matrix A with elements A ij ∈ {N ∪ 0}, equal to the number of connections from node i to node j.For simple graphs without self-loops or multiple connections, A ii = 0, ∀i and A ij ∈ {0, 1}, ∀i, j.For undirected graphs, A ij expresses the existence of an edge, while for directed graphs, A ij indicates a connection in the direction from node i to j.More general forms are possible, including networks with multiple or weighted connections, but for simplicity these are not examined here.
(3) A set of M internal flow rates, expressed by a flow rate matrix Q with elements Q ij ∈ R, indicating the flow rate on each ijth edge from node i to j.
(4) A set of P external flow rates with 0 ≤ P ≤ N , expressed by the external flow rate vector Θ with elements Θ i ∈ R, defined positive for an inwards flow rate into node i.It is possible to consider networks with multiple flows into or out of each node, but for simplicity, these are amalgamated here into one external flow to each node.
(5) A set of N potentials, expressed by the potential vector E with elements E i ∈ R, indicating the potential at each node i.These give rise to the tensor of potential differences ∆ → E with elements indicating the potential drop along the ijth edge from node i to j.
(6) A set of M resistance functions, represented by a resistance matrix R with elements R ij : R → R for the resistance function on the ijth edge.These functions give the relationship between the flow rate and potential difference, using the local form: Examples include linear electrical resistances, quadratic or nonlinear pipe flow resistances, nonlinear chemical kinetic laws (such as power-law functions), and various nonlinear functions used in transport network analysis.More complicated resistance functions, including nonlocal interactions represented by ∆ → E = R(Q), are also possible but are not examined here.
Note that the above variables are not independent.In particular, the potentials E and potential differences ∆ → E are connected by ∆ → E = E 1 − 1 E , where 1 is an N × 1 column vector of 1s.The information contained in E is therefore fully represented by that in ∆ → E, provided that one reference potential is known.Furthermore, in undirected graphs we have so the first matrix is symmetric and the other two are antisymmetric.Finally, any non-existent internal or external flow rate in the above vectors and tensors can simply be assigned to zero, while the potential differences and resistance functions can be left undefined.

Probability Space and Entropy
We consider a general flow network in which there is uncertainty in the physical properties Q, Θ and ∆ → E (or E), and also possibly in the network properties N, M, P and A. We thus consider the joint probability over all unknowns, given by: where p(...) is a joint probability mass function (pmf) with respect to N , M , P and A, and a joint probability density function (pdf) with respect to Q, Θ and ∆ → E. Furthermore, Υ χ is the random variable for parameter χ, dχ = k dχ k based on each element χ k ∈ χ, and I represents the background knowledge to the problem, including its constraints.Philosophically, the above probability can be interpreted in two different ways.If the parameter uncertainties can be considered to express observable variabilities -i.e. the random variable is drawn from some ensemble by an ergodic process -then the resulting distribution (2) can be interpreted as a joint measurable frequency.Alternatively, if the uncertainties express the state of knowledge or degree of belief in the parameter values, then the distribution (2) can be interpreted as a joint Bayesian probability.In the latter case, the distribution inferred by MaxEnt will not necessarily be observable, but will still represent the "best' inference of the state of the system given what is known.Indeed, both the frequentist and Bayesian interpretations can sit side by side within the same inferential analysis.
The distribution (2) leads to the following relative entropy function: where q(N, M, P, A, Q, Θ, ∆ → E|I) is the joint prior pdf-pmf, while Ω χ is the domain of parameter χ.
For brevity it is convenient to combine the uncertain parameters in (2) into the composite parameter X, from which the probability (2) can be written as: The relative entropy becomes: where q(X|I) is the joint prior and Ω X is the overall domain of X.

Constraints
We now specify the constraints on p(X|I).
(1) Normalisation: (2) Observable constraints: These are specified as mean values of any physical parameters, which could include any of the internal flow rate(s), external flow rate(s) and/or potential difference(s), here defined based on the global moments: Θ i spec = ...
These can be assembled into the tensor or vector forms: ∆ → E spec = ...
where the parameters which are not constrained can be left unspecified.Note that the above constrained parameters should not be in contradiction, lest the problem become overdetermined.
(3) Resistance functions: These are here applied in the mean, using local functions of the form (1): ...
These can be assembled into the matrix form: ...
(4) Kirchhoff's first laws, which impose conservation of flow rates at each node, here applied in the mean.In undirected networks this gives: while for directed networks: These can be assembled into the matrix equation: where 1 and 0 are N -dimensional column vectors of 1s or 0s, denotes the transpose, and parameter = 1 2 for an undirected graph and 1 for a directed graph.In integral form this gives the constraint: (5) Kirchhoff's second laws for the conservation of energy, again imposed in the mean, which can be formulated by the statement that the mean potential difference around any flow loop (cycle) on the network must vanish.For each loop on a simple undirected or directed graph, this gives: where L is the total number of independent loops.Each such loop can be expressed by its loop adjacency matrix M ( ) , l ∈ {1, ..., L} with elements M ( ) ij ∈ {−1, 0, 1}, indicating whether the ijth edge is within the loop and, if so, its orientation compared to the loop.Eq. ( 19) can then be rewritten in the form: where u : v = N i=1 N j=1 u ij v ij is the tensor scalar product [20].In integral form: (6) Graphical constraints, which express any functional relationship applying to the network structure.These are represented here by the general form: where g k (...) is the kth discrete-valued function, with in total K such functions.Eqs. ( 22) is here assumed to contain linear functions of the moments g k (N, M, P, A) rather than nonlinear functions g k ( N , M , P , A ). Eqs. ( 22) can be assembled into the vector form: For example, we could consider functional constraints on the adjacency matrix A, drawn from a graph ensemble of specified N (or a range of N ), from which, for simple graphs, M can be calculated by

MaxEnt Analysis
The maximum entropy (MaxEnt) algorithm of Jaynes always proceeds in the same manner: after defining the probability space, entropy and constraints, we maximise the entropy subject to the constraints, to determine the most probable (or least informative) state of the system.Using the moment shorthand • and dropping the functional dependencies, the entropy (5) subject to the constraints ( 6), ( 10)-( 12), ( 14), ( 18), ( 21) and ( 23) can be combined into the Lagrangian: where a•b = a b = N i=1 a i b i is the vector scalar product, and κ, λ, µ, ν, ρ, α, β and γ are Lagrangian multipliers of appropriate scalar, vector or matrix form.Again, if any term within any constraint is not specified, its corresponding multiplier can be set to zero.Combining integrals and simplification gives: in which we use the identity α • Q1 = α1 : Q.The total variation of the Lagrangian is given by δL = 0 = ∂L/∂p δp, which gives ∂L/∂p = 0 for all p.One difficulty is presented by the nonlinear resistance function in (25), which must be handled carefully using the chain rule: where u v is the element-wise tensor (Hadamard) product, in which [20].The inferred distribution becomes: Defining the partition function Z = e 1+κ , this gives the Boltzmann equation: This solved in conjunction with the eight sets of constraints ( 6), ( 10)-( 12), ( 14), ( 18), ( 21) and ( 23) to calculate the partition function Z and multipliers λ, µ, ν, ρ, α, β and γ.Any other moment, for example of the quantity F (X), can then be calculated directly:

Prior Probabilities
To this point, the form of the prior q(X|I) has not yet been discussed.In the MaxEnt framework, this prior expresses the joint distribution of the parameters within X, in the absence of the constraints.The prior therefore should encapsulate the mathematical domain Ω X , as well as any mathematical symmetries or preferential occupation of any part of this domain.For example, the prior for each flow rate p(Q ij ) or p(Θ i ) should encode the fact that these variables are centrally distributed, with vanishing occupancy (or probability) as Q ij , Θ i → ±∞.Similar, but not necessarily symmetric, considerations apply to the potential differences ∆ → E ij .In the authors' experience, priors drawn from multidimensional Gaussian distributions have served well in the imposition of such limits, with the additional advantage of mathematical tractability [16][17][18][19].For directed graph networks, the authors have successfully applied combinations of uniform, exponential or Gaussian priors, each of which exhibits some advantages and limitations [19].
Furthermore, the prior for the graphical variables must be representative of the graphical ensemble from which they are drawn.Imposing a mean constraint on the adjacency matrix A , for example, requires the inclusion of any prior knowledge of the matrix domain Ω A , which incorporates the number of nodes N (or their range) and any restrictions on absent, single or multiple edges.If these are not specified within the prior (or otherwise within the domain or other specifications), the analysis could invoke a large or infinite graphical ensemble which is heavily weighted towards infinite numbers of edges, leading to flawed inferences by the MaxEnt algorithm.

Analytical-Numerical Solution
Due to the presence of nonlinear constraints, the solution of the inferred distribution (28) in conjunction with the partition function Z and multipliers λ, µ, ν, ρ, α, β and γ will in most cases require an iterative numerical scheme.Further details of the scheme adopted by the authors for the analysis of pipe flow networks are provided elsewhere [16][17][18][19].

Applications
Over the past two years, the authors have applied the foregoing framework to the analysis of several case study systems: (i) A 1123-node, 1140-pipe urban water distribution network from the suburb of Torrens in the Australian Capital Territory, Australia [19].
(ii) A 327-node urban electrical power network from the suburb of Campbell in the Australian Capital Territory, Australia, which includes distributed power sources.
(iii) Research is also in progress on the analysis of road transport networks based on directed graph structures, which require some additional considerations for the handling of origin-destination (path-based) flows.
These studies demonstrate the ability of the MaxEnt method to infer the (probabilistic) state of a variety of underdetermined physical networks, including networks of considerable size, for which there is insufficient information to obtain a closed-form solution.Furthermore, the MaxEnt method also converges to the deterministic solution when these networks become fully constrained.The network specifications, MaxEnt framework, numerical solution method and results of these studies have been or will be presented elsewhere [19,21].These examples will be discussed in the conference presentation associated with this manuscript.

Conclusions
A MaxEnt framework is presented to infer the (probabilistic) state of an underdetermined flow network, for which there is insufficient information to obtain a closed-form solution.The MaxEnt framework is general in application, and incorporates "observable" constraints on expectations of various parameters, "physical" constraints such as conservation (Kirchhoff's) laws and frictional properties, and "graphical" constraints due to uncertainty in the network structure itself.The current framework can be applied broadly to any type of flow network, including electrical, pipe flow, transportation, chemical reaction, ecological, epidemiological, economic and human social networks.In the current study, the handling of the nonlinear resistance function within the MaxEnt formulation is carefully examined, as well as the choice of prior probability and the incorporation of graphical moment constraints.The method is demonstrated by application to the analysis of real pipe flow and electrical power networks.