PostgreSQL Source Code git master
Loading...
Searching...
No Matches
geqo_recombination.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * geqo_recombination.h
4 * prototypes for recombination in the genetic query optimizer
5 *
6 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/optimizer/geqo_recombination.h
10 *
11 *-------------------------------------------------------------------------
12 */
13
14/*
15 * contributed by:
16 * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
17 * * Martin Utesch * Institute of Automatic Control *
18 * = = University of Mining and Technology =
19 * * utesch@aut.tu-freiberg.de * Freiberg, Germany *
20 * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
21 */
22
23/* -- parts of this are adapted from D. Whitley's Genitor algorithm -- */
24
25#ifndef GEQO_RECOMBINATION_H
26#define GEQO_RECOMBINATION_H
27
28#include "optimizer/geqo.h"
29
30
31extern void init_tour(PlannerInfo *root, Gene *tour, int num_gene);
32
33
34/* edge recombination crossover [ERX] */
35
36typedef struct Edge
37{
38 Gene edge_list[4]; /* list of edges */
42
45
48
50 int num_gene);
51
52
53/* partially matched crossover [PMX] */
54
55#define DAD 1 /* indicator for gene from dad */
56#define MOM 0 /* indicator for gene from mom */
57
58extern void pmx(PlannerInfo *root,
60 Gene *offspring, int num_gene);
61
62
63typedef struct City
64{
67 int used;
70
73
74/* cycle crossover [CX] */
77
78/* position crossover [PX] */
80 int num_gene, City * city_table);
81
82/* order crossover [OX1] according to Davis */
84 int num_gene, City * city_table);
85
86/* order crossover [OX2] according to Syswerda */
88 int num_gene, City * city_table);
89
90#endif /* GEQO_RECOMBINATION_H */
int Gene
Definition geqo_gene.h:33
void free_city_table(PlannerInfo *root, City *city_table)
Edge * alloc_edge_table(PlannerInfo *root, int num_gene)
Definition geqo_erx.c:58
void pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene)
City * alloc_city_table(PlannerInfo *root, int num_gene)
void ox1(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
float gimme_edge_table(PlannerInfo *root, Gene *tour1, Gene *tour2, int num_gene, Edge *edge_table)
Definition geqo_erx.c:99
void free_edge_table(PlannerInfo *root, Edge *edge_table)
Definition geqo_erx.c:79
int cx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
int gimme_tour(PlannerInfo *root, Edge *edge_table, Gene *new_gene, int num_gene)
Definition geqo_erx.c:202
void px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
void init_tour(PlannerInfo *root, Gene *tour, int num_gene)
void ox2(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
int tour2_position
int tour1_position
Gene edge_list[4]