graph.py

openmdao.util.graph.collapse_nodes(graph, node_map, copy=False)[source]
Args:

graph : nx.DiGraph

Graph with nodes we want to collapse.

node_map : dict

A map of existing node names to collapsed names.

copy : bool(False)

If True, copy the graph before collapsing the nodes.

Returns:

nx.DiGraph

The graph with the nodes collapsed.

openmdao.util.graph.plain_bfs(G, source)[source]

A fast BFS node generator

The direction of the edge between nodes is ignored.

For directed graphs only.