nocad.design.driver_nodes#

nocad.design.driver_nodes(adj, method='path_finding')[source]#

Driver nodes of a network (nodes that receive an input signal).

Parameters:
adjarray_like or sparse, shape (N, N)
method{“path_finding”, “signal_sharing”, “minimum”, “matching”}
Returns:
driversndarray of int (sorted), including the nodes of shared signals.

Examples

>>> adj = [[0, 1, 0, 0], [1, 0, 1, 0], [0, 0, 0, 1], [0, 0, 0, 0]]  # x1 <-> x2 -> x3 -> x4
>>> driver_nodes(adj), driver_nodes(adj, "signal_sharing")
(array([0]), array([0, 2]))