parent
ad8e20c62b
commit
67ca00a0e0
@ -1,39 +1,10 @@
|
||||
#ifndef __MAIN_H_
|
||||
#define __MAIN_H_
|
||||
|
||||
struct AdjObj
|
||||
{
|
||||
int n;
|
||||
/* index of neighbor node */
|
||||
int e; /* index of adj joining neighbor */
|
||||
};
|
||||
|
||||
struct Node
|
||||
{
|
||||
int deg;
|
||||
struct AdjObj *adj;
|
||||
int mark;
|
||||
};
|
||||
|
||||
struct Graph
|
||||
{
|
||||
int node_count;
|
||||
int edge_count;
|
||||
struct Node *node_list;
|
||||
struct AdjObj *adj_space;
|
||||
};
|
||||
|
||||
void usage(char *f);
|
||||
|
||||
int parseargs(int ac, char **av);
|
||||
|
||||
extern char *fname;
|
||||
extern int seed;
|
||||
extern int geometric_data;
|
||||
extern int ncount_rand;
|
||||
extern int gridsize_rand;
|
||||
extern int use_all_subtours;
|
||||
|
||||
extern double initial_time;
|
||||
#ifndef _PROJECT_MAIN_H_
|
||||
#define _PROJECT_MAIN_H_
|
||||
|
||||
extern char *INPUT_FILENAME;
|
||||
extern unsigned int SEED;
|
||||
extern int GEOMETRIC_DATA;
|
||||
extern int NODE_COUNT_RAND;
|
||||
extern int GRID_SIZE_RAND;
|
||||
|
||||
#endif
|
@ -1,39 +1,48 @@
|
||||
//
|
||||
// Created by isoron on 3/17/15.
|
||||
//
|
||||
|
||||
#ifndef ___TSP_H_
|
||||
#define ___TSP_H_
|
||||
#ifndef _PROJECT_TSP_H_
|
||||
#define _PROJECT_TSP_H_
|
||||
|
||||
#include "lp.h"
|
||||
#include "graph.h"
|
||||
|
||||
int add_all_subtours(int ncount, int ecount, int *elist, struct LP *lp);
|
||||
struct TSPData
|
||||
{
|
||||
int node_count;
|
||||
int edge_count;
|
||||
int *edge_list;
|
||||
int *edge_weights;
|
||||
};
|
||||
|
||||
int TSP_init_data(struct TSPData *data);
|
||||
|
||||
void TSP_free_data(struct TSPData *data);
|
||||
|
||||
int TSP_find_violated_subtour_elimination_cut
|
||||
(int ncount, int ecount, int *elist, struct LP *lp);
|
||||
(struct LP *lp, struct TSPData *data);
|
||||
|
||||
int TSP_is_graph_connected(
|
||||
struct Graph *G, double *x, int *island_count, int *island_sizes,
|
||||
int *island_start, int *island_nodes);
|
||||
struct Graph *G,
|
||||
double *x,
|
||||
int *island_count,
|
||||
int *island_sizes,
|
||||
int *island_start,
|
||||
int *island_nodes);
|
||||
|
||||
int TSP_find_closest_neighbor_tour(
|
||||
int start, int node_count, int edge_count, int *edges, int *elen,
|
||||
int start,
|
||||
int node_count,
|
||||
int edge_count,
|
||||
int *edges,
|
||||
int *elen,
|
||||
int *path_length);
|
||||
|
||||
int TSP_add_subtour_elimination_cut(struct LP *lp, int deltacount, int *delta);
|
||||
int TSP_add_subtour_elimination_cut(struct LP *lp, int delta_length, int *delta);
|
||||
|
||||
int TSP_read_problem(
|
||||
char *filename, int *p_ncount, int *p_ecount, int **p_elist,
|
||||
int **p_elen);
|
||||
int TSP_read_problem(char *filename, struct TSPData *data);
|
||||
|
||||
int TSP_add_cutting_planes(int ncount, int ecount, int *elist, struct LP *lp);
|
||||
int TSP_add_cutting_planes(struct LP *lp, struct TSPData *data);
|
||||
|
||||
int TSP_init_lp(
|
||||
int node_count, struct LP *lp, int edge_count, int *edge_weights,
|
||||
int *edge_list);
|
||||
int TSP_init_lp(struct LP *lp, struct TSPData *data);
|
||||
|
||||
double TSP_find_initial_solution
|
||||
(int *edge_weights, int *edge_list, int node_count, int edge_count);
|
||||
double TSP_find_initial_solution(struct TSPData *data);
|
||||
|
||||
#endif //_PROJECT_TSP_H_
|
||||
#endif
|
||||
|
@ -1,17 +1,18 @@
|
||||
#ifndef __CO759_UTIL_H
|
||||
#define __CO759_UTIL_H
|
||||
#ifndef _PROJECT_UTIL_H_
|
||||
#define _PROJECT_UTIL_H_
|
||||
|
||||
#define ABORT_IF(cond, msg) if(cond) { \
|
||||
fprintf(stderr, msg); rval = 1; goto CLEANUP; }
|
||||
|
||||
double util_get_current_time(void);
|
||||
double get_current_time(void);
|
||||
|
||||
int CO759_build_xy(int ncount, double *xlist, double *ylist, int gridsize);
|
||||
int build_random_2d_points
|
||||
(int node_count, double *x_list, double *y_list, int grid_size);
|
||||
|
||||
double util_get_current_time(void);
|
||||
double get_current_time(void);
|
||||
|
||||
void time_printf(const char *fmt, ...);
|
||||
|
||||
void next_set(int sz, int *Set);
|
||||
void next_set(int sz, int *set);
|
||||
|
||||
#endif /* __CO759_UTIL_H */
|
||||
#endif
|
||||
|
Reference in new issue