This repository was archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheur.h
More file actions
58 lines (39 loc) · 1.97 KB
/
heur.h
File metadata and controls
58 lines (39 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __HEUR_H__
#define __HEUR_H__
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "defs.h"
#include "matrix.h"
struct solution {
size_t order;
size_t pos;
int cost;
bool valid;
bool updated;
int *data;
};
struct solution * solution_new (size_t order);
void solution_init (struct solution * solution);
void solution_free (struct solution * solution);
struct solution * solution_new_shuffle (struct matrix * matrix);
void solution_print (struct solution * solution);
void solution_path_print (struct solution * solution,
struct matrix * matrix);
void solution_shuffle (struct solution * solution,
size_t n);
int solution_get (struct solution * solution,
size_t n);
void solution_update (struct solution * solution,
struct matrix * matrix);
int solution_cost (struct solution * solution);
void solution_swap (struct solution * solution,
size_t a,
size_t b);
void solution_copy (struct solution * src,
struct solution * dst);
struct solution * solution_dup (struct solution * src);
struct solution * solution_new_like (struct solution * src);
void solution_random_neighbor (struct solution * dst,
struct solution * src);
#endif /* __HEUR_H__ */