Example #1
0
def get_controlled_nodes(G):
	matched_edges = zen.maximum_matching_(G)
	nodes = G.nodes_()
	for eidx in matched_edges:
		if G.tgt_(eidx) in nodes:
			nodes = np.delete(nodes, np.where(nodes==G.tgt_(eidx)))
	return nodes, matched_edges
Example #2
0
def get_controlled_nodes(G):
    matched_edges = zen.maximum_matching_(G)
    nodes = G.nodes_()
    for eidx in matched_edges:
        if G.tgt_(eidx) in nodes:
            nodes = np.delete(nodes, np.where(nodes == G.tgt_(eidx)))
    return nodes, matched_edges
Example #3
0
def num_min_controls(G):
    """
	Return the smallest number of controls that are required to control the graph ``G``
	assuming structural controllability conditions.
	"""
    type_check(G, DiGraph)

    matched_edges = None

    matched_edges = maximum_matching_(G)

    return max([len(G) - len(matched_edges), 1])
Example #4
0
def num_min_controls(G):
	"""
	Return the smallest number of controls that are required to control the graph ``G``
	assuming structural controllability conditions.
	"""
	type_check(G,DiGraph)
	
	matched_edges = None
	
	matched_edges = maximum_matching_(G)
	
	return max([len(G) - len(matched_edges),1])