Network-Based Controllability and Observability Analysis in PythonThe nocad toolbox

Chapter 7
Measures for system characterization

Comparing systems requires numbers. The second module of the NOCAD toolbox computes about fifty measures from the state-space matrices of a system: network-level values, node centralities, control and observe centrality, the types of the driver and sensor nodes, and similarity measures of drivers, sensors and edges built on reachability. This chapter defines them, states what they measure in terms of controllability and observability, and shows how nocad returns them as tables.

7.1 Problem and idea

The NOCAD papers relate the structure of a system to the effort of controlling and observing it [1, 2]: how many inputs and outputs it needs, how far the states are from them, and how evenly the inputs share the work. Measures of complex networks answer part of these questions, provided that they are computed on the right network (the network of the state variables, 𝐖= 𝐀𝖳) and interpreted with the direction of the edges in mind. The toolbox therefore organizes its measures in four groups, from the whole system down to single edges, and returns them in a form that can be compared across systems (fig. 7.1).

Figure 7.1

Figure 7.1. The four groups of measures of the system characterization module; measures_tables returns the system values, the node values and the edge values as three tables.

7.2 Theory

7.2.1 System-level measures

With diin and diout the in- and out-degrees of xi without self-loops and di=diin+diout, the toolbox computes:

7.2.2 Node centralities

Besides the degrees and Scott’s normalized degree di∕(2(N−1)), the toolbox computes three classical centralities on the directed network. The closeness of xi is corrected for the nodes it cannot reach,

Ciout=|Riout| N−1⋅|Riout| ∑j∈Rioutℓij,(7.1)

where Riout is the set of nodes reachable from xi; in-closeness uses the nodes that reach xi [56]. The betweenness of a node counts the shortest paths through it [59], and PageRank [60] is the stationary distribution of a random walk with teleportation, reported in percent as in the MATLAB code. Out-closeness and betweenness measure how quickly and how centrally a node distributes the effect of an input, in-closeness how quickly it collects the information a sensor needs.

7.2.3 Control and observe centrality

Liu, Slotine and Barabási [61] defined the control centrality of a node as the dimension of the subspace that an input acting on it alone can control, the generic rank of [𝐛i,𝐀𝐛i,…,𝐀N−1𝐛i] with 𝐛i the i-th unit vector. Hosoe’s theorem [27] gives it a graph meaning: the generic dimension of the controllable subspace is the largest number of edges in a subgraph made of a stem from the input and of disjoint cycles that the input reaches. Observe centrality is the same quantity on the reversed network. nocad computes both from random realizations of the pattern with the orthogonal Krylov iteration of algorithm 2.1, which returns the generic value with probability one.

Proposition 7.1. The control centrality of xi is at most the number |Riout| of nodes that xi reaches (itself included), with equality if every node has a self-loop.

Proof. States that the input cannot reach are not influenced by it, which gives the bound. If every node has a self-loop, the path from xi to itself is a stem of length zero and every other reachable node carries a cycle of its own, its self-loop, reached by the input; this subgraph covers all reachable nodes, so by Hosoe’s theorem the generic dimension is |Riout|. □

Without self-loops the gap between reach and control centrality measures the dilations on the way: in a tree only one root-to-leaf path can be a stem, so the root controls as many dimensions as the longest path has nodes, however many nodes it reaches. The MATLAB toolbox computed the structural rank of the numerically formed Kalman matrix; that value is an upper bound of the generic rank and can exceed it (method="sprank" reproduces it): for the NOCAD example without x8 and with the input at x4, the structural rank of the Kalman matrix is eight, the generic dimension seven.

7.2.4 Similarity of drivers, sensors and edges

The NOCAD toolbox introduced three similarity measures built on reachability and the Jaccard index J(X,Y)=|X∩Y|∕|X∪Y|[62]. Let Xa be the set of states that driver node da influences and ℓia+1 the number of derivations after which its input appears in xi. The driver similarity of two driver nodes is

s(da,db)=J(Xa,Xb)⋅(1−∑i∈Xa∩Xb|ℓia−ℓib| |Xa∩Xb|ℓmax),(7.2)

the overlap of what they control, weighted by the agreement of the delays; two driver nodes with similarity close to one duplicate each other’s work. Sensor similarity is the same on the reversed network. The endpoint similarity of an edge xj→xi is the product J(Rjout,Riout)J(Rjin,Riin); it is one for edges inside a strongly connected component, whose endpoints reach and are reached by the same nodes, and low for edges at which what can be reached, or what reaches, changes much. The edge similarity of two edges multiplies the Jaccard indices of the four corresponding sets of their endpoints; groups of similar edges mark redundant parts of a network, dissimilar edges the bridges that carry a unique share of the influence. The controlling and observing matrices list the number of derivations ℓ+1 between every driver (sensor) node and every state.

In a nutshell: Measures

  • System: density, diameter, degree variance and centralization, four assortativities, shares of self-loops and symmetric edges, relative degree of the configuration.
  • Nodes: degrees, closeness corrected for reachability, betweenness, PageRank, control and observe centrality, driver and sensor types.
  • Control centrality is bounded by the reach of the node and equals it when every node has a self-loop; it is computed as a generic rank, not as the structural rank of a numerical Kalman matrix.
  • Similarities: Jaccard indices of reachable sets, weighted by delays for drivers and sensors; endpoint and edge similarities for edges.

7.3 Using it in nocad

nocad.measures

measures_tables(A, B, C, D, labels, config) returns system, nodes and edges tables; system_measures returns the same values in the nested structure of the MATLAB function matricesToStruct; get_config(**flags) switches individual measures off. Single measures: density, degree_in, degree_out, degree, degree_scott, degree_variance, degree_freeman, pearson_dir, percent_loop_sym, closeness_centrality, node_betweenness, edge_betweenness, pagerank, reachability, driver_similarity, sensor_similarity, endpoint_similarity, edge_similarity; nocad.control_centrality(A, nodes, method) and nocad.observe_centrality.

The tables of the NOCAD example:

A, B, C, D = nocad.generate_matrices(adj) 
tables = measures_tables(A, B, C, D) 
print(tables.system) 
print(tables.nodes[["degree", "closeness", "betweenness", "pagerank", "control", "observe"]].round(3))
   

Control centrality against reach:

A = tree.T 
cc = nocad.control_centrality(A) 
reach = reach_c(A).sum(axis=1) 
print("control centrality:", cc) 
print("reachable nodes:   ", reach)
   

The similarity measures:

ds = driver_similarity(A, B) 
ss = sensor_similarity(A, C) 
S, edges = edge_similarity(adj) 
es = endpoint_similarity(adj)
   

7.4 Examples

7.4.1 Network and node measures

The nine-state example has 15 edges, density 15∕81≈0.185, diameter four, degree variance 2.67, Freeman centralization 0.43 and 40% symmetric edges, the values printed in the NOCAD manual; its relative degree is four (the sensor x1 is four edges from the driver x8). The node table (fig. 7.2) shows x4 as the most central node by degree and closeness and, with x2, by betweenness, whereas PageRank, which accumulates along the edges, favors the sink cycle {x1,x2,x3}. The control centrality of the driver x8 is nine, the observe centralities of the sensors x1 and x9 are seven and six. For Erdős–Rényi networks (fig. 7.3) the diameter peaks near mean degree 1.5, where the long chains of the emerging giant component appear, and falls afterward.

Figure 7.2

Figure 7.2. Normalized node centralities of the NOCAD example: Scott’s degree, closeness, betweenness and PageRank.

Open in ColabExample plot_01_network_measures.py in the gallery

Figure 7.3

Figure 7.3. Density, diameter and Freeman centralization of Erdős–Rényi networks with 100 nodes against the mean degree.

7.4.2 Control centrality

In the binary tree of seven nodes, the root reaches all seven nodes but controls only three dimensions, the nodes of one root-to-leaf path; each inner node reaches three and controls two. On a random network with 80 nodes (fig. 7.4) control centrality equals reach for only 36% of the nodes and stays far below it for the nodes that reach most (at most 17 controlled dimensions against up to 47 reached nodes). With a self-loop on every node the two coincide for every node, as proposition 7.1 states. The single driver of the heat exchanger network has control centrality 22, the full state dimension.

Figure 7.4

Figure 7.4. Control centrality against the number of reachable nodes for a random network with 80 nodes, without (left) and with (right) self-loops on every node; the dashed line is equality.

Open in ColabExample plot_02_control_centrality.py in the gallery

7.4.3 Similarities

With the drivers x4, x6 and x8, the first two are the most similar pair (0.81; fig. 7.5): x4 and x6 lie on the same cycle and reach the same states with similar delays, whereas x8 reaches the same states one step later. The edge similarity matrix groups the edges of each cycle into blocks. The endpoint similarities (fig. 7.6) are one on the edges of the two cycles and lowest on the edges into x7 (0.20), into x2 (0.21) and from the source x8 (0.22), the places where reachability changes most.

Figure 7.5

Figure 7.5. Driver similarity of the drivers x4, x6, x8 (left) and edge similarity of all edges of the NOCAD example (right).

Open in ColabExample plot_03_similarity.py in the gallery

Figure 7.6

Figure 7.6. Endpoint similarity of the edges of the NOCAD example (color and width).

7.5 Further reading

The measures and their use in the NOCAD studies are described in [2, 3]. Centralities are due to Freeman [56, 59] and Brin and Page [60], assortativity to Newman [57]; Barabási’s textbook [63] covers these measures in the context of network science. Control centrality is from [61], its graph characterization from Hosoe [27].