GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
defs/neta.h
Go to the documentation of this file.
1 #ifndef GRASS_NETADEFS_H
2 #define GRASS_NETADEFS_H
3 
4 /*bridge.c */
5 int NetA_compute_bridges(dglGraph_s * graph, struct ilist *bridge_list);
7  struct ilist *articulation_list);
8 
9 /*components.c */
10 int NetA_weakly_connected_components(dglGraph_s * graph, int *component);
11 int NetA_strongly_connected_components(dglGraph_s * graph, int *component);
12 
13 /*spanningtree.c */
14 int NetA_spanning_tree(dglGraph_s * graph, struct ilist *tree_list);
15 
16 /*neta_flow.c */
17 int NetA_flow(dglGraph_s * graph, struct ilist *source_list,
18  struct ilist *sink_list, int *flow);
19 int NetA_min_cut(dglGraph_s * graph, struct ilist *source_list,
20  struct ilist *sink_list, int *flow, struct ilist *cut);
21 int NetA_split_vertices(dglGraph_s * in, dglGraph_s * out, int *node_costs);
22 
23 /*utils.c */
24 void NetA_add_point_on_node(struct Map_info *In, struct Map_info *Out, int node,
25  struct line_cats *Cats);
26 void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list);
27 int NetA_get_node_costs(struct Map_info *In, int layer, char *column,
28  int *node_costs);
29 void NetA_varray_to_nodes(struct Map_info *map, struct varray * varray,
30  struct ilist *nodes, int *nodes_to_features);
31 int NetA_initialise_varray(struct Map_info *In, int layer, int mask_type,
32  char *where, char *cat, struct varray ** varray);
33 /*centrality.c */
34 void NetA_degree_centrality(dglGraph_s * graph, double *degree);
35 int NetA_eigenvector_centrality(dglGraph_s * graph, int iterations,
36  double error, double *eigenvector);
37 int NetA_betweenness_closeness(dglGraph_s * graph, double *betweenness,
38  double *closeness);
39 
40 /*path.c */
41 int NetA_distance_from_points(dglGraph_s * graph, struct ilist *from, int *dst,
42  dglInt32_t ** prev);
43 int NetA_distance_to_points(dglGraph_s * graph, struct ilist *to, int *dst,
44  dglInt32_t ** nxt);
45 int NetA_find_path(dglGraph_s * graph, int from, int to, int *edges,
46  struct ilist *list);
47 
48 /*timetables.c */
49 
50 /*Structure containing all information about a timetable.
51  * Everything in indexed from 0.
52  */
53 typedef struct
54 {
55  int routes; /*Number of different routes. Two routes are different even if they differ only in time. */
56  int *route_length; /*Length of each route, i.e., number of stops */
57  int **route_stops; /*list of stops on each route in order (time increases) */
58  int **route_times; /*stop arrival times on overy route. Stops are given in the same order as above */
59  int stops; /*number of stops */
60  int *stop_length; /*Number of routes stopping at each stop */
61  int **stop_routes; /*List of routes for each stop. Routes are in increasing order */
62  int **stop_times; /*arrival times of routes for each stop. Routes are given in the same order as above */
63  int *walk_length; /*number of stops with "walking connection" for each stop */
64  int **walk_stops; /*list of stops within walking distance for each stop */
65  int **walk_times; /*walking times between stops as given above */
67 
68 typedef struct
69 {
70  int **dst;
71  int **prev_stop;
72  int **prev_route;
73  int **prev_conn;
74  int rows, routes;
76 int NetA_init_timetable_from_db(struct Map_info *In, int route_layer,
77  int walk_layer, char *route_id, char *times,
78  char *to_stop, char *walk_length,
79  neta_timetable * timetable, int **route_ids,
80  int **stop_ids);
81 int NetA_timetable_shortest_path(neta_timetable * timetable, int from_stop,
82  int to_stop, int start_time, int min_change,
83  int max_changes, int walking_change,
84  neta_timetable_result * result);
85 int NetA_timetable_get_route_time(neta_timetable * timetable, int stop,
86  int route);
88 
89 #endif
int NetA_min_cut(dglGraph_s *graph, struct ilist *source_list, struct ilist *sink_list, int *flow, struct ilist *cut)
Calculates minimum cut between source(s) and sink(s).
Definition: flow.c:177
int ** route_times
Definition: defs/neta.h:58
int ** stop_routes
Definition: defs/neta.h:61
int ** walk_stops
Definition: defs/neta.h:64
int NetA_initialise_varray(struct Map_info *In, int layer, int mask_type, char *where, char *cat, struct varray **varray)
Initialize varray.
Definition: utils.c:229
int * stop_length
Definition: defs/neta.h:60
int NetA_split_vertices(dglGraph_s *in, dglGraph_s *out, int *node_costs)
Splits each vertex of in graph into two vertices.
Definition: flow.c:270
int NetA_weakly_connected_components(dglGraph_s *graph, int *component)
Computes weakly connected components.
Definition: components.c:52
char * dst
Definition: lz4.h:599
void NetA_degree_centrality(dglGraph_s *graph, double *degree)
Computes degree centrality measure.
Definition: centrality.c:32
void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list)
Finds node.
Definition: utils.c:73
Vector array.
Definition: dig_structs.h:1779
int NetA_distance_from_points(dglGraph_s *graph, struct ilist *from, int *dst, dglInt32_t **prev)
Computes shortest paths to every node from nodes in "from".
Feature category info.
Definition: dig_structs.h:1702
int ** route_stops
Definition: defs/neta.h:57
int NetA_distance_to_points(dglGraph_s *graph, struct ilist *to, int *dst, dglInt32_t **nxt)
Computes shortest paths from every node to nodes in "to".
int * route_length
Definition: defs/neta.h:56
int ** stop_times
Definition: defs/neta.h:62
int NetA_spanning_tree(dglGraph_s *graph, struct ilist *tree_list)
Get number of edges in the spanning forest.
Definition: spanningtree.c:91
int NetA_compute_bridges(dglGraph_s *graph, struct ilist *bridge_list)
Get number of bridges in the graph.
Definition: bridge.c:33
long dglInt32_t
Definition: type.h:37
void NetA_add_point_on_node(struct Map_info *In, struct Map_info *Out, int node, struct line_cats *Cats)
Writes point.
Definition: utils.c:35
int * walk_length
Definition: defs/neta.h:63
Vector map info.
Definition: dig_structs.h:1259
int NetA_eigenvector_centrality(dglGraph_s *graph, int iterations, double error, double *eigenvector)
Computes eigenvector centrality using edge costs as weights.
Definition: centrality.c:54
void NetA_varray_to_nodes(struct Map_info *map, struct varray *varray, struct ilist *nodes, int *nodes_to_features)
Get list of nodes from varray.
Definition: utils.c:174
int NetA_flow(dglGraph_s *graph, struct ilist *source_list, struct ilist *sink_list, int *flow)
Get max flow from source to sink.
Definition: flow.c:47
int NetA_find_path(dglGraph_s *graph, int from, int to, int *edges, struct ilist *list)
Find a path (minimum number of edges) from 'from' to 'to' using only edges flagged as valid in 'edges...
int NetA_betweenness_closeness(dglGraph_s *graph, double *betweenness, double *closeness)
Computes betweenness and closeness centrality measure using Brandes algorithm.
Definition: centrality.c:126
int NetA_init_timetable_from_db(struct Map_info *In, int route_layer, int walk_layer, char *route_id, char *times, char *to_stop, char *walk_length, neta_timetable *timetable, int **route_ids, int **stop_ids)
Initialises timetable from a database.
Definition: timetables.c:113
Definition: manage.h:4
int NetA_strongly_connected_components(dglGraph_s *graph, int *component)
Computes strongly connected components with Kosaraju's two-pass algorithm.
Definition: components.c:154
List of integers.
Definition: gis.h:689
void NetA_timetable_result_release(neta_timetable_result *result)
Free neta_timetable_result structure.
Definition: timetables.c:550
int NetA_get_node_costs(struct Map_info *In, int layer, char *column, int *node_costs)
Get node cost.
Definition: utils.c:105
int ** walk_times
Definition: defs/neta.h:65
int NetA_articulation_points(dglGraph_s *graph, struct ilist *articulation_list)
Get number of articulation points in the graph.
int NetA_timetable_get_route_time(neta_timetable *timetable, int stop, int route)
Get time.
Definition: timetables.c:534
int NetA_timetable_shortest_path(neta_timetable *timetable, int from_stop, int to_stop, int start_time, int min_change, int max_changes, int walking_change, neta_timetable_result *result)
Computes the earliest arrival time.
Definition: timetables.c:392