コード例 #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
コード例 #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
コード例 #3
0
ファイル: reachability.py プロジェクト: rohitshukla92/zenlib
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])
コード例 #4
0
ファイル: reachability.py プロジェクト: Atomised/zenlib
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])