-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
66 lines (40 loc) · 1.57 KB
/
graph.h
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
59
60
61
62
63
64
65
66
#ifndef GRAPH_H
#define GRAPH_H
#include "zergmap.h"
#include "map.h"
#include "priority-queue.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <math.h>
#include <errno.h>
typedef struct graph_ graph;
graph *graph_create();
graph *graph_clone(graph * g);
bool graph_add_vertex(graph * g, struct zerg_header *zerg);
bool graph_update_coord(graph * g, uint16_t id, struct zerg_header *zerg);
bool graph_contains(const graph * g, uint16_t data);
size_t zerg_count(graph * g);
bool graph_mark_remove(graph * g, uint16_t data);
bool graph_is_marked(graph * g, uint16_t data);
bool low_health(graph * g, uint16_t data, double percent);
void graph_remove_vertex(graph * g, uint16_t data);
bool graph_add_edge(graph * g, const uint16_t src, const uint16_t dst,
double dist);
double haversine(double lat1, double lon1, double lat2, double lon2);
double graph_edge_distance(const graph * g, const uint16_t src,
const uint16_t dst);
bool change_edge_distance(const graph * g, const uint16_t src,
const uint16_t dst, double dist);
void graph_remove_edge(graph * g, const uint16_t src, const uint16_t dst);
void graph_iterate_vertices(graph * g, void (*func)(uint16_t id));
// Returns the number of neighbors of vertex
size_t graph_neighbors(graph * g, const uint16_t vertex,
void (*func)(double distance, uint16_t dst));
pqueue *check_connectivity(graph * g);
void recommend_removal(graph * g, pqueue * pq, size_t zerg_count);
void show_low_health_zerg(graph * g);
void show_no_gps(graph * g);
void graph_print(graph * g);
void graph_destroy(graph * g);
#endif