agx.TopologyIterator¶
- class agx.TopologyIterator(node_counts, graph_type=None, graph_set='rxx', allowed_num_components=1, max_samples=None, graph_directory=None, verbose=True)[source]¶
Bases:
objectIterate over graphs.
Important
Warning: Currently, the order of
node_countshas to have the building block with the most connections first!- Parameters:
node_counts (dict[NodeType, int]) – Dictionary of
agx.NodeTypeand their count in the proposed graphs. Always put the building blocks with more functional groups first. Additionally, only mixtures of three distinct node types (in terms of connection counts) are implemented, and in the case of three components, all nodes connect to the node type with the most connections.graph_type (str | None) – Name of the graph. If you do not need a custom graph, you can leave this as
Noneand it will adhere to the current name convention (seeavailable_graphs), which captures the count of each node type with certain number of connections. Following this name convention will allow you to use saved graphs, if not, you can make your own. Although it can be time consuming.graph_set (str) – Set of graphs to use based on different algorithms or papers. Only the new
rxxset are defined here.allowed_num_components (int) – Allowed number of disconnected graph components. Usually
1to generate complete graphs only.max_samples (int | None) – When constructing graphs, there is some randomness in their order, although that order should be consistent, and only up-to
max_samplesare sampled. For very large numbers of components there is not guarantee all possible graphs will be explored.graph_directory (Path | None) – Directory to check for and save graph jsons.
verbose (bool) – Whether to log outcomes.
Methods
Count completely connected graphs in iteration.
Get the graph type to match the new naming convention.
Get potential node configurations.
Get number of nodes.
Get vertex prototypes.
Return True if the graph is chemically possible.
Get potential node configurations.
Get constructed molecules from iteration.
Attributes