-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
45 lines (35 loc) · 1.04 KB
/
main.c
File metadata and controls
45 lines (35 loc) · 1.04 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
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <omp.h>
#include <time.h>
#include "graphs.h"
#include "network.h"
#include "utils.h"
#define GRAPH_SIZE 2000
#define MEAN_SPARSITY_MIN 0.01
#define MEAN_SPARSITY_MAX 0.99
#define MEAN_SPARSITY_INC 0.01
#define GRAPHS_PER_SPARSITY 1
#define TRIALS_PER_GRAPH 40
#define END_TIME 10.0
#define STEPS 100000
#define PUMP_RATE 0.9
#define COUPLING_COEFFICIENT 0.1
#define NOISE 0.01
int main(int argc, char ** argv) {
omp_set_num_threads(64);
Graph* graph;
Network* network;
graph = construct_graph(GRAPH_SIZE);
graph = random_mean_sparsity_graph(graph, 0.5);
// max_cut_for_graph = max_cut(*graph);
network = construct_network_from_graph(PUMP_RATE, COUPLING_COEFFICIENT, NOISE, graph, &kraymer_moyal, &euler_maruyama);
network_run(network, graph, END_TIME, STEPS);
network_get_partition_array(network);
int cut = evaluate_cut(*graph, network -> partition_array);
printf("%d\n", cut);
destruct_graph(graph);
destruct_network(network);
}