Network-Based Controllability and Observability Analysis in PythonThe nocad toolbox

Chapter 5
Node roles, control profiles and robustness

A network usually has many maximum matchings, so a design is one choice among many. This chapter asks what all the choices have in common: which nodes are driver nodes in every minimum design, which in none, and which edges every design needs. The answers come from alternating paths in the bipartite graph and take linear time. Two further questions follow: why a network needs its driver nodes at all (the control profile and the driver types of a design), and what happens to a design when a state variable fails (node-removal robustness).

5.1 Problem and idea

The four-node example of fig. 3.3 has two maximum matchings with different driver nodes. In general the number of maximum matchings grows exponentially with the size of the network, and enumerating them is out of the question beyond toy examples [48]. All maximum matchings are, however, connected by simple exchanges. If xu is unmatched and an edge xj→xu leaves a node xj that is matched to xv, then replacing xj→xv by xj→xu gives another maximum matching in which xv is unmatched instead of xu (fig. 5.1). Repeating the exchange walks along an alternating path xu−,xj+,xv−,… that uses non-matching and matching edges in turn. The symmetric difference of two maximum matchings consists of exactly such even alternating paths and of alternating cycles [28], so a single maximum matching and a search for alternating paths reveal every node that can be unmatched and every edge that can be matched.

Figure 5.1

Figure 5.1. Exchanging a matched edge moves the driver node. (a) xj is matched to xv and also points to the unmatched node xu. (b) Exchanging the two edges keeps the size of the matching and frees xv. (c) The same step in the bipartite representation is an even alternating path from the free in-copy xu−.

The same exchanges explain which edges matter. An edge that lies in every maximum matching cannot be lost without losing a matched node: it is critical for controllability. An edge that lies in no maximum matching can be removed without any consequence for the minimum number of inputs. The reasons for driver nodes are a different matter: a node without parents needs an input whatever else happens, whereas a dilation (more children than parents) can be cured by adding connections. Finally, a design that is minimal in the number of inputs is usually fragile: losing one state variable on a stem can disconnect the rest of the stem from its input.

5.2 Theory

5.2.1 Node roles

Following Jia et al. [49], a node is critical if it is unmatched in every maximum matching (a driver node of every minimum design), redundant if it is matched in every maximum matching, and intermittent otherwise.

Proposition 5.1. Let M be a maximum matching of 𝒢 that is not perfect. (a) A node is critical iff it has no incoming edge. (b) A node is unmatched in some maximum matching iff it is unmatched in M or can be reached from an unmatched node of M by an even alternating path xu−,xj1+,xv1−,xj2+,xv2−,… in B(𝒢), in which the steps x−→x+ follow non-matching edges and the steps x+→x− matching edges.

Proof. (a) A node without incoming edges can never be matched. If xi has a parent xj and is unmatched, either xj+ is free, and xj→xi can be added, contradicting maximality, or xj is matched to some xv, and the exchange of fig. 5.1 gives a maximum matching in which xi is matched. (b) Exchanging along an even alternating path from a free in-copy frees its last in-copy and keeps the size, which proves sufficiency. Conversely, if xv is unmatched in a maximum matching M′ and matched in M, the component of M⊕M′ that contains xv− is an even alternating path that ends at xv− and starts at an in-copy that is free in M [28]. □

The search of (b) is a breadth-first search over the in-copies and takes O(|E|) time; with a perfect matching a single driver node suffices and, by the convention ND=max(N−|M|,1), every node may be it, so all nodes are intermittent. Jia et al. observed that networks of the same density can be controlled in two modes [49]: a centralized mode, in which most nodes are redundant and the few driver nodes are almost fixed, and a distributed mode, in which most nodes are intermittent and the driver nodes can be chosen almost freely.

5.2.2 Edge classes

Liu, Slotine and Barabási classified the edges in the same way [10]: an edge is critical if it belongs to every maximum matching (its removal increases the number of driver nodes), redundant if it belongs to none (its removal never changes the minimum driver sets), and ordinary otherwise. Orient the bipartite graph so that non-matching edges point from out-copies to in-copies, xj+→xi−, and matching edges from in-copies to out-copies. Tassa [50] showed that an edge lies in some maximum matching iff it is matched, or both its ends lie in one strongly connected component of the oriented graph (an alternating cycle), or it lies on an even alternating path from a free vertex; a matched edge is missing from some maximum matching under the same conditions. One strongly connected components computation and two reachability searches therefore classify all edges in O(N+|E|) time (algorithm 5.1).

Algorithm\special {t4ht^+}

5.2.3 Why driver nodes are needed: control profiles and driver types

Ruths and Ruths [51] attributed the driver nodes of a network to three structures: source nodes, which have no parents; external dilations, a surplus of sink nodes (no children) over source nodes, which cannot all be matched to distinct parents; and internal dilations, which account for the rest. With Ns source and Nt sink nodes,

Ne=max(0,Nt−Ns),Ni=ND−Ns−Ne,(ηs,ηe,ηi)=(Ns,Ne,Ni) ND,(5.1)

and the control profile (ηs,ηe,ηi) places every network in a triangle. Networks in the source corner need inputs because nothing influences parts of them; networks in the dilation corners need them because of bottlenecks, which additional connections can remove. Ruths and Ruths found that networks from the same domain tend to have similar profiles and that common random network models do not produce profiles dominated by external dilations [51].

The MATLAB toolbox classifies the driver nodes of a particular design in the same spirit [19]: a driver node is of type source if it has no incoming edge, external if it has no outgoing edge, internal if it belongs to an internal dilation, and inaccessible otherwise. To test for an internal dilation, the MATLAB code grows the parents P of the driver node and their children Q alternately (children of the parents, parents of the children) until they no longer change; the closure is the connected component of the driver’s in-copy in B(𝒢), and |Q|>|P| means that it has more in-copies than out-copies, a dilation. A component can, however, be balanced as a whole and still contain a dilation, so nocad also classifies a driver node as internal if some maximum matching leaves it unmatched: by Kőnig’s theorem it then belongs to a set of states with fewer parents than members. The remaining type collects the driver nodes that exist for accessibility only, such as those that path finding places in source components that are cycles. Sensor types are the driver types of the reversed network.

5.2.4 Robustness against the loss of a state variable

A sensor can fail, a valve can stick, a unit can be taken off line: in the network, a node disappears with its edges and with the input or output attached to it. A configuration is robust against the loss of xv if the damaged system, with the remaining driver nodes, is still structurally controllable; its robustness is the share of the N single-node removals it survives, and the nodes whose removal destroys controllability are its critical nodes (the robust function of the MATLAB toolbox). Each test is one application of Lin’s theorem, so the full evaluation takes N matchings, O(N|E|N) time. Losing a node on a stem cuts the stem, and the nodes behind the cut must then be reached in another way; a minimal design, in which every stem is the only route to its nodes, is typically fragile, and every additional driver node can create an alternative route. Edge removal is evaluated in the same way.

In a nutshell: Roles, profiles and robustness

  • Critical nodes (driver nodes of every minimum design) are exactly the nodes without parents; intermittent nodes are found from one maximum matching by an even-alternating-path search; all nodes are intermittent if the matching is perfect.
  • Edge classes follow from the strongly connected components of the oriented bipartite graph (Tassa): critical edges are in every maximum matching, redundant edges in none.
  • The control profile splits ND into source nodes, external and internal dilations; driver types explain the driver nodes of a given design.
  • Robustness is the share of single-node removals after which Lin’s conditions still hold; extra driver nodes create alternative routes.

5.3 Using it in nocad

roles, profiles and robustness

node_roles(adj) returns an array of "critical", "intermittent", "redundant"; edge_classes(adj) a dictionary from (start, end) to "critical", "ordinary", "redundant"; all_maximum_matchings(adj) enumerates the matchings of small networks for checking; control_profile(adj) and observation_profile(adj) return ηs,ηe,ηi and the counts; driver_types(A, B) and sensor_types(A, C) return boolean masks per type; node_removal_robustness(adj, drivers, sensors) returns controllable, control_robustness, control_critical and their observability counterparts; edge_removal_robustness and robustness_table complete the set.

maps in nocad.viz

plot_node_roles, plot_edge_classes, plot_control_profiles(profiles, groups) (ternary diagram), plot_robustness_map(adj, result, drivers).

Roles from one maximum matching:

roles = nocad.node_roles(net) 
print({r: int((roles == r).sum()) for r in ("critical", "intermittent", "redundant")}) 
print("driver nodes of one maximum matching:", nocad.maximum_matching(net).unmatched + 1)
   

Control profiles of the bundled networks:

profiles, groups = {}, {} 
for name in list_networks("I") + list_networks("II") + ["build", "cdplayer", "heatcont", "iss", "pde", "tline"]: 
    net = load_network(name) 
    profiles[name] = nocad.control_profile(net.adj) 
    groups[name] = f"Set {net.group}"
   

Driver and sensor types of a design:

    A, B, C, D = nocad.generate_matrices(adj) 
    dt = nocad.driver_types(A, B) 
    st = nocad.sensor_types(A, C) 
    
   

Robustness of two configurations of the NOCAD example:

for drivers in ([7], [3, 7]): 
    r = nocad.node_removal_robustness(adj, drivers=drivers) 
    print(f"drivers {np.add(drivers, 1)}: robustness {r.control_robustness:.3f}, critical {r.control_critical + 1}")
   

5.4 Examples

5.4.1 Node roles and the two control modes

A random network with 30 nodes and mean degree 1.8 needs six driver nodes (fig. 5.2). Three of them are critical, the nodes without parents; five further nodes are intermittent, and any three of them complete a minimum design; the remaining 22 nodes are redundant and never need an input. One maximum matching chooses x1, x4, x7, x18, x25 and x26.

Figure 5.2

Figure 5.2. Node roles of a random network with 30 nodes: critical nodes (vermilion) need an input in every minimum design, intermittent nodes (blue) in some, redundant nodes (gray) in none.

Open in ColabExample plot_01_node_roles.py in the gallery

Figure 5.3 repeats the classification for Erdős–Rényi networks with 300 nodes, eight networks per density. Sparse networks have many critical nodes and a moderate share of redundant ones. Between mean degrees of about 3.5 and 6 the networks of the same density split into the two modes of Jia et al.: in some almost all nodes are redundant (centralized), in others almost none (distributed). The densest networks have a perfect matching and are all distributed.

Figure 5.3

Figure 5.3. Shares of redundant and critical nodes of Erdős–Rényi networks (300 nodes, one dot per network) against the mean degree: the bimodality of the redundant share.

5.4.2 Control profiles

The bundled networks of the NOCAD study occupy different parts of the triangle (fig. 5.4). The E. coli transcription network is controlled through its sources (ηs=0.99, 314 driver nodes), the neural networks of C. elegans and of the macaque cortex mainly through sources as well. The yeast network and the food webs grass and ythan are dominated by external dilations (ηe=0.82 and 0.74), the electronic circuits s208, s420 and s838 by internal dilations (ηi≈0.7). The dolphin network is stored with one direction per tie and therefore has many source nodes. The state matrices of the dynamical benchmarks of Set III have non-zero diagonals and a perfect matching; their single driver node counts as an internal dilation by the convention ND=max(N−|M|,1), which puts them all in the internal corner.

Figure 5.4

Figure 5.4. Control profiles of the bundled networks in the triangle of source nodes, external and internal dilations.

Open in ColabExample plot_02_control_profiles.py in the gallery

Random networks move from the source corner toward the internal corner as the density grows (fig. 5.5): Erdős–Rényi networks with mean degree 0.8 have ηs=0.86, with mean degree 3 still 0.68, and with mean degree 6 they have a perfect matching. Their external share is zero, because sources and sinks are equally frequent; heterogeneous (scale-free) networks of mean degree 6 develop a small external share (ηe=0.13), but neither model reaches the external corner of the food webs, in line with the observation of Ruths and Ruths.

Figure 5.5

Figure 5.5. Control profiles of Erdős–Rényi and scale-free networks with 300 nodes; labels give the mean degree.

5.4.3 Driver types of a design

The single driver node x8 of the NOCAD example is a source. A path-finding design of a random network with 60 nodes and mean degree 1.5 has 14 driver nodes: eight sources, four external ones (three of them isolated nodes, which are sources as well) and five internal ones. Figure 5.6 shows how the types change with the density: source drivers dominate at every density, external drivers matter only in very sparse networks, and internal ones peak near mean degree 1.5. No driver of the inaccessible type appears, because source components that are cycles are rare in Erdős–Rényi networks; in the heat exchanger network of chapter 9, by contrast, the single driver node exists for accessibility only.

Figure 5.6

Figure 5.6. Driver types of path-finding designs of Erdős–Rényi networks (200 nodes, three networks per point) against the mean degree, relative to N; isolated nodes count as source and external.

Open in ColabExample plot_03_driver_types.py in the gallery

5.4.4 Robustness

With the single driver x8, the NOCAD example survives the loss of only three of its nine states (fig. 5.7, left): x1, x2, x4, x6, x7 and x8 are critical. Adding the driver x4, the improvement proposed in the NOCAD manual, raises the robustness to five of nine; x2, x4, x7 and x8 remain critical. On the heat exchanger network (fig. 5.8) the drivers added by GDFCMSA to lower the largest control depth from seven to one also raise the robustness, from 36% with one driver to 73–77% with seven or eight additional drivers. The increase is not monotone: the placement optimizes the depth, not the robustness, and the two criteria agree only on average.

Figure 5.7

Figure 5.7. Robustness maps of the NOCAD example with the driver x8 (left) and the drivers x4, x8 (right): nodes whose loss destroys controllability (critical nodes) are vermilion, nodes whose loss is tolerated green; driver nodes are ringed.

Open in ColabExample plot_04_robustness.py in the gallery

Figure 5.8

Figure 5.8. Heat exchanger network: share of tolerated node removals and largest control depth against the number of drivers added by GDFCMSA.

5.5 Further reading

Node roles and the bimodality of control are due to Jia et al. [49], edge classes to Liu, Slotine and Barabási [10]; Tassa [50] gives the linear-time characterization of the edges that belong to some maximum matching, and Uno [48] an algorithm that enumerates all maximum matchings. Control profiles are from Ruths and Ruths [51]; the review of Liu and Barabási [12] surveys these and many related results, and Pósfai et al. [52] study how degree correlations change the number of driver nodes. The driver and sensor types and the robustness test come from the NOCAD MATLAB toolbox [3, 19].