schrodinger.thirdparty.networkx_algos module¶
- schrodinger.thirdparty.networkx_algos.get_subgraphs(g: networkx.classes.multigraph.MultiGraph, root, *, node_weight_map=None, max_weight: float = inf) Iterable[networkx.classes.multigraph.MultiGraph]¶
Return a generator over all subgraphs of
gweighing at mostmax_weightand with rootrootFor every iteration of this generator, a
nx.MultiGraphwill be yielded that is a subgraph ofg. The samenx.MultiGraphis used for every iteration so if you need to save the state of the subgraph, make a copy of it (subgraph.copy()).All nodes are given a default weight of 1. If
node_weight_mapis supplied, weights of nodes are determined by looking them up in the map. If they are not found in the map, the default of 1 is used.
- schrodinger.thirdparty.networkx_algos.get_subtrees(g: networkx.classes.multigraph.MultiGraph, root, *, node_weight_map=None, max_weight: float = inf) Iterable[networkx.classes.multigraph.MultiGraph]¶
Return a generator over all subtrees of
gweighing at mostmax_weightand with rootrootFor every iteration of this generator, a
nx.MultiGraphwill be yielded that is a subtree ofg. The samenx.MultiGraphis used for every iteration so if you need to save the state of the subtree, make a copy of it (subtree.copy()).All nodes are given a default weight of 1. If
node_weight_mapis supplied, weights of nodes are determined by looking them up in the map. If they are not found in the map, the default of 1 is used.