rostok.graph_grammar.crossovers

Module Attributes

CALLBACK_NEIGHBORS_TYPE

If node is available for replacement, returns true Args: 1 List[Node]: in nodes (predecessors) 2 List[Node]: out nodes (successors) 3 Node: Replacer

Functions

add_subtree_using_rule(graph_1, id_1, subtree)

available_node_ids_based_on_neighbors(...)

Returns a list of ids for which the check_neighbors condition is true. check_neighbors iterate over all nodes and their neighbors Args: replacer_node (Node): _description_ graph (rostok_graph.GraphGrammar): _description_ check_neighbors (CALLBACK_NEIGHBORS_TYPE): _description_.

available_node_ids_both_directions(graph_1, ...)

Search for available replacement IDs.

check_neighbours(predecessors, successors, ...)

check_neighbours_joint(predecessors)

check_neighbours_transform(predecessors)

get_subtree_graph(graph, id)

remove_subtree_without_root(graph_1, id_1)

subtree_crossover(graph_1, graph_2[, ...])

Swap random subtrees from graphs

subtree_crossover_select(graph_1, graph_2, ...)

Swaps two subtrees selected by id