nocad.matching.Matching#

class nocad.matching.Matching(matched_by)[source]#

Bases: object

A matching of a directed network.

Attributes:
matched_byndarray of shape (N,)

matched_by[i] = j if the edge \(x_j\to x_i\) is in the matching, -1 if \(x_i\) is unmatched (MATLAB matchedBy minus one).

property edges#

Matched edges as an (|M|, 2) array of (start, end) pairs.

property matched#

Nodes with an incoming matched edge.

property matches#

matches[j] = i if \(x_j\to x_i\) is matched, else -1 (out-copy view).

property size#

Number of matched edges \(|\mathcal{M}|\).

property unmatched#

Nodes without an incoming matched edge (driver candidates).