:py:mod:`ragraph.analysis.sequence._genetic` ============================================ .. py:module:: ragraph.analysis.sequence._genetic .. autoapi-nested-parse:: Genetic algorithms for sequencing purposes. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: ragraph.analysis.sequence._genetic.genetic ragraph.analysis.sequence._genetic.genetic_sequencing Attributes ~~~~~~~~~~ .. autoapisummary:: ragraph.analysis.sequence._genetic.params ragraph.analysis.sequence._genetic.genetic_analysis .. py:data:: params .. py:data:: genetic_analysis .. py:function:: genetic(graph: ragraph.graph.Graph, root: Optional[Union[str, ragraph.graph.Node]] = None, nodes: Optional[Union[List[str], List[ragraph.graph.Node]]] = None, evaluator: Optional[str] = params['evaluator'].default, n_chromosomes: Optional[int] = params['n_chromosomes'].default, n_generations: Optional[int] = params['n_generations'].default, p_crossover: Optional[float] = params['p_crossover'].default, p_mutation: Optional[float] = params['p_mutation'].default, p_swap: Optional[float] = params['p_swap'].default, inherit: bool = True, edge_weights: Optional[List[str]] = None, loops: bool = False, inplace: bool = True, names: bool = False, safe: bool = True, **kwargs) -> Tuple[ragraph.graph.Graph, List[ragraph.graph.Node]] .. py:function:: genetic_sequencing(graph: ragraph.graph.Graph, nodes: List[ragraph.graph.Node], n_chromosomes: int, n_generations: int, n_hall_of_fame: int, p_crossover: float, p_mutation: float, p_swap: float, evaluator: str = 'feedback_distance', n_records: Optional[int] = None, inherit: bool = True, edge_weights: Optional[List[str]] = None) -> ratio_genetic_py.Lineage Genetic sequencing of nodes in a graph. :param graph: Graph holding data. :param nodes: Nodes to sequence. :param evaluator: Evaluation method to use. One of "feedback_distance", "feedback_marks", or "lower_left_distance". :param n_chromosomes: Number of chromosomes in each generation. :param n_generations: Number of generations to simulate. :param n_hall_of_fame: Hall of Fame size of best performing chromosomes. :param p_crossover: Probability for a pair to be subjected to crossover. :param p_mutation: Probability for each chromosome to be subjected to mutation. :param p_swap: Probability for each gene to be swapped with another during mutation. :param n_records: Number of generation records to keep. :param inherit: Whether to inherit edges between children when getting the adjacency matrix. :param edge_weights: Edge weights to consider when getting the adjacency matrix. :returns: Lineage object containing generations of chromosomes, generation records and a hall of fame of best performing chromosomes.