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/* contributed by:
15 =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
16 * Martin Utesch * Institute of Automatic Control *
17 = = University of Mining and Technology =
18 * utesch@aut.tu-freiberg.de * Freiberg, Germany *
19 =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
20 */
21
22/* -- parts of this are adapted from D. Whitley's Genitor algorithm -- */
23
24#ifndef GEQO_RECOMBINATION_H
25#define GEQO_RECOMBINATION_H
26
27#include "optimizer/geqo.h"
28
29
30extern void init_tour(PlannerInfo *root, Gene *tour, int num_gene);
31
32
33/* edge recombination crossover [ERX] */
34
35typedef struct Edge
36{
37 Gene edge_list[4]; /* list of edges */
41
44
47
49 int num_gene);
50
51
52/* partially matched crossover [PMX] */
53
54#define DAD 1 /* indicator for gene from dad */
55#define MOM 0 /* indicator for gene from mom */
56
57extern void pmx(PlannerInfo *root,
59 Gene *offspring, int num_gene);
60
61
62typedef struct City
63{
66 int used;
69
72
73/* cycle crossover [CX] */
76
77/* position crossover [PX] */
79 int num_gene, City * city_table);
80
81/* order crossover [OX1] according to Davis */
83 int num_gene, City * city_table);
84
85/* order crossover [OX2] according to Syswerda */
87 int num_gene, City * city_table);
88
89#endif /* GEQO_RECOMBINATION_H */
int Gene
Definition geqo_gene.h:30
void free_city_table(PlannerInfo *root, City *city_table)
Edge * alloc_edge_table(PlannerInfo *root, int num_gene)
Definition geqo_erx.c:56
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:95
void free_edge_table(PlannerInfo *root, Edge *edge_table)
Definition geqo_erx.c:76
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:196
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]