#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "GainType.h"
Go to the source code of this file.
Classes | |
struct | Candidate |
struct | Cluster |
struct | Node |
struct | Segment |
struct | SSegment |
struct | SwapRecord |
Macros | |
#define | Fixed(a, b) ((a)->FixedTo1 == (b) || (a)->FixedTo2 == (b)) |
#define | FixedOrCommon(a, b) (Fixed(a, b) || IsCommonEdge(a, b)) |
#define | Follow(b, a) { Link((b)->Pred, (b)->Suc); Link(b, b); Link(b, (a)->Suc); Link(a, b); } |
#define | InBestTour(a, b) ((a)->BestSuc == (b) || (b)->BestSuc == (a)) |
#define | InInitialTour(a, b) ((a)->InitialSuc == (b) || (b)->InitialSuc == (a)) |
#define | InInputTour(a, b) ((a)->InputSuc == (b) || (b)->InputSuc == (a)) |
#define | InNextBestTour(a, b) ((a)->NextBestSuc == (b) || (b)->NextBestSuc == (a)) |
#define | Link(a, b) { ((a)->Suc = (b))->Pred = (a); } |
#define | Near(a, b) ((a)->BestSuc ? InBestTour(a, b) : (a)->Dad == (b) || (b)->Dad == (a)) |
#define | Precede(a, b) { Link((a)->Pred, (a)->Suc); Link(a, a); Link((b)->Pred, a); Link(a, b); } |
#define | SLink(a, b) { (a)->Suc = (b); (b)->Pred = (a); } |
Typedefs | |
typedef struct Candidate | Candidate |
typedef struct Cluster | Cluster |
typedef int(* | CostFunction) (Node *Na, Node *Nb) |
typedef Node *(* | MoveFunction) (Node *t1, Node *t2, GainType *G0, GainType *Gain) |
typedef struct Node | Node |
typedef struct Segment | Segment |
typedef struct SSegment | SSegment |
typedef struct SwapRecord | SwapRecord |
Enumerations | |
enum | CandidateSetTypes { ALPHA, DELAUNAY, NN, QUADRANT } |
enum | CoordTypes { TWOD_COORDS, THREED_COORDS, NO_COORDS } |
enum | EdgeWeightFormats { FUNCTION, FULL_MATRIX, UPPER_ROW, LOWER_ROW, UPPER_DIAG_ROW, LOWER_DIAG_ROW, UPPER_COL, LOWER_COL, UPPER_DIAG_COL, LOWER_DIAG_COL } |
enum | EdgeWeightTypes { EXPLICIT, EUC_2D, EUC_3D, MAX_2D, MAX_3D, MAN_2D, MAN_3D, CEIL_2D, CEIL_3D, GEO, GEOM, GEO_MEEUS, GEOM_MEEUS, ATT, XRAY1, XRAY2, SPECIAL } |
enum | InitialTourAlgorithms { BORUVKA, GREEDY, MOORE, NEAREST_NEIGHBOR, QUICK_BORUVKA, SIERPINSKI, WALK } |
enum | Types { TSP, ATSP, SOP, HCP, CVRP, TOUR, HPP, GTSP, AGTSP } |
Functions | |
void | AllocateStructures (void) |
int | c_ATT (Node *Na, Node *Nb) |
int | c_CEIL_2D (Node *Na, Node *Nb) |
int | c_CEIL_3D (Node *Na, Node *Nb) |
int | c_EUC_2D (Node *Na, Node *Nb) |
int | c_EUC_3D (Node *Na, Node *Nb) |
int | C_EXPLICIT (Node *Na, Node *Nb) |
int | C_FUNCTION (Node *Na, Node *Nb) |
int | c_GEO (Node *Na, Node *Nb) |
int | c_GEO_MEEUS (Node *Na, Node *Nb) |
int | c_GEOM (Node *Na, Node *Nb) |
int | c_GEOM_MEEUS (Node *Na, Node *Nb) |
int | D_EXPLICIT (Node *Na, Node *Nb) |
int | D_FUNCTION (Node *Na, Node *Nb) |
int | Distance_1 (Node *Na, Node *Nb) |
int | Distance_ATSP (Node *Na, Node *Nb) |
int | Distance_ATT (Node *Na, Node *Nb) |
int | Distance_CEIL_2D (Node *Na, Node *Nb) |
int | Distance_CEIL_3D (Node *Na, Node *Nb) |
int | Distance_EUC_2D (Node *Na, Node *Nb) |
int | Distance_EUC_3D (Node *Na, Node *Nb) |
int | Distance_EXPLICIT (Node *Na, Node *Nb) |
int | Distance_GEO (Node *Na, Node *Nb) |
int | Distance_GEO_MEEUS (Node *Na, Node *Nb) |
int | Distance_GEOM (Node *Na, Node *Nb) |
int | Distance_GEOM_MEEUS (Node *Na, Node *Nb) |
int | Distance_MAN_2D (Node *Na, Node *Nb) |
int | Distance_MAN_3D (Node *Na, Node *Nb) |
int | Distance_MAX_2D (Node *Na, Node *Nb) |
int | Distance_MAX_3D (Node *Na, Node *Nb) |
int | Distance_SPECIAL (Node *Na, Node *Nb) |
int | Distance_XRAY1 (Node *Na, Node *Nb) |
int | Distance_XRAY2 (Node *Na, Node *Nb) |
void | eprintf (const char *fmt,...) |
int | fscanint (FILE *f, int *v) |
double | GetTime (void) |
void | InitializeStatistics (void) |
int | IsCandidate (const Node *ta, const Node *tb) |
void | printff (char *fmt,...) |
void | PrintParameters (void) |
void | PrintStatistics (void) |
unsigned | Random (void) |
char * | ReadLine (FILE *InputFile) |
void | ReadParameters (void) |
int | ReadPenalties (void) |
void | ReadProblem (void) |
void | ReadTour (char *FileName, FILE **File) |
void | SRandom (unsigned seed) |
void | UpdateStatistics (GainType Cost, double Time) |
void | WriteCandidates (void) |
void | WriteTour (char *FileName, int *Tour, GainType Cost) |
typedef struct SwapRecord SwapRecord |
enum CandidateSetTypes |
enum CoordTypes |
enum EdgeWeightFormats |
enum EdgeWeightTypes |
void AllocateStructures | ( | void | ) |
Definition at line 9 of file Distance.c.
Definition at line 14 of file Distance.c.
Definition at line 24 of file Distance.c.
Definition at line 30 of file Distance.c.
Definition at line 36 of file Distance.c.
Definition at line 42 of file Distance.c.
Definition at line 48 of file Distance.c.
Definition at line 54 of file Distance.c.
Definition at line 62 of file Distance.c.
Definition at line 167 of file Distance.c.
Definition at line 90 of file Distance.c.
Definition at line 180 of file Distance.c.
Definition at line 104 of file Distance.c.
Definition at line 109 of file Distance.c.
Definition at line 115 of file Distance.c.
Definition at line 122 of file Distance.c.
Definition at line 18 of file Distance_SPECIAL.c.
int fscanint | ( | FILE * | f, |
int * | v | ||
) |
Definition at line 13 of file fscanint.c.
void InitializeStatistics | ( | void | ) |
Definition at line 7 of file Statistics.c.
Definition at line 10 of file IsCandidate.c.
void PrintParameters | ( | void | ) |
Definition at line 8 of file PrintParameters.c.
void PrintStatistics | ( | void | ) |
Definition at line 41 of file Statistics.c.
char* ReadLine | ( | FILE * | InputFile | ) |
Definition at line 23 of file ReadLine.c.
void ReadParameters | ( | void | ) |
Definition at line 354 of file ReadParameters.c.
int ReadPenalties | ( | void | ) |
Definition at line 19 of file ReadPenalties.c.
void ReadProblem | ( | void | ) |
Definition at line 230 of file ReadProblem.c.
void ReadTour | ( | char * | FileName, |
FILE ** | File | ||
) |
Definition at line 1343 of file ReadProblem.c.
void UpdateStatistics | ( | GainType | Cost, |
double | Time | ||
) |
Definition at line 20 of file Statistics.c.
void WriteCandidates | ( | void | ) |
void WriteTour | ( | char * | FileName, |
int * | Tour, | ||
GainType | Cost | ||
) |
Definition at line 16 of file WriteTour.c.
MoveFunction BacktrackMove |
MoveFunction BestMove |
MoveFunction BestSubsequentMove |
CostFunction Distance |
SwapRecord* SwapStack |