nocad.matching.node_roles#
- nocad.matching.node_roles(adj, matching=None)[source]#
Role of every node across all maximum matchings (Jia et al. 2013).
- Parameters:
- adjarray_like or
sparse,shape(N,N) - matching
Matching,optional A maximum matching; computed if omitted.
- adjarray_like or
- Returns:
Notes
With a perfect matching one driver node suffices and any node may be it, so all nodes are intermittent. A node with an incoming edge \(x_j\to x_i\) can always be matched (if it is unmatched, swap the matched edge of \(x_j^+\) for \(x_j\to x_i\)), so the critical nodes are exactly the nodes with zero in-degree. A node is unmatched in some maximum matching iff it can be reached from an unmatched node by an even alternating path \(x_u^- - x_j^+ = x_v^-\); the breadth-first search over these steps runs in \(O(|\mathcal{E}|)\).
References
[1]T. Jia, Y.-Y. Liu, E. Csóka, M. Pósfai, J.-J. Slotine, A.-L. Barabási, “Emergence of bimodality in controlling complex networks”, Nature Communications 4 (2013) 2002.
Examples
>>> node_roles([[0, 1, 1], [0, 0, 0], [0, 0, 0]]) array(['critical', 'intermittent', 'intermittent'], dtype='<U12')