GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
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, double error,
36  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  int routes; /*Number of different routes. Two routes are different even if
55  they differ only in time. */
56  int *route_length; /*Length of each route, i.e., number of stops */
57  int *
58  *route_stops; /*list of stops on each route in order (time increases) */
59  int **route_times; /*stop arrival times on overy route. Stops are given in
60  the same order as above */
61  int stops; /*number of stops */
62  int *stop_length; /*Number of routes stopping at each stop */
63  int **stop_routes; /*List of routes for each stop. Routes are in increasing
64  order */
65  int **stop_times; /*arrival times of routes for each stop. Routes are given
66  in the same order as above */
67  int *walk_length; /*number of stops with "walking connection" for each stop
68  */
69  int **walk_stops; /*list of stops within walking distance for each stop */
70  int **walk_times; /*walking times between stops as given above */
72 
73 typedef struct {
74  int **dst;
75  int **prev_stop;
76  int **prev_route;
77  int **prev_conn;
78  int rows, routes;
80 int NetA_init_timetable_from_db(struct Map_info *In, int route_layer,
81  int walk_layer, char *route_id, char *times,
82  char *to_stop, char *walk_length,
83  neta_timetable *timetable, int **route_ids,
84  int **stop_ids);
85 int NetA_timetable_shortest_path(neta_timetable *timetable, int from_stop,
86  int to_stop, int start_time, int min_change,
87  int max_changes, int walking_change,
88  neta_timetable_result *result);
89 int NetA_timetable_get_route_time(neta_timetable *timetable, int stop,
90  int route);
92 
93 #endif
int NetA_min_cut(dglGraph_s *graph, struct ilist *source_list, struct ilist *sink_list, int *flow, struct ilist *cut)
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:116
void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list)
Finds node.
Definition: utils.c:73
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
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_compute_bridges(dglGraph_s *graph, struct ilist *bridge_list)
Get number of bridges in the graph.
Definition: bridge.c:33
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:34
int NetA_articulation_points(dglGraph_s *graph, struct ilist *articulation_list)
Get number of articulation points in the graph.
void NetA_degree_centrality(dglGraph_s *graph, double *degree)
Computes degree centrality measure.
Definition: centrality.c:32
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:183
int NetA_strongly_connected_components(dglGraph_s *graph, int *component)
Computes strongly connected components with Kosaraju's two-pass algorithm.
Definition: components.c:159
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 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".
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_initialise_varray(struct Map_info *In, int layer, int mask_type, char *where, char *cat, struct varray **varray)
Initialize varray.
Definition: utils.c:239
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:269
int NetA_spanning_tree(dglGraph_s *graph, struct ilist *tree_list)
Get number of edges in the spanning forest.
Definition: spanningtree.c:90
void NetA_timetable_result_release(neta_timetable_result *result)
Free neta_timetable_result structure.
Definition: timetables.c:546
int NetA_betweenness_closeness(dglGraph_s *graph, double *betweenness, double *closeness)
Computes betweenness and closeness centrality measure using Brandes algorithm.
Definition: centrality.c:125
int NetA_get_node_costs(struct Map_info *In, int layer, char *column, int *node_costs)
Get node cost.
Definition: utils.c:106
int NetA_timetable_get_route_time(neta_timetable *timetable, int stop, int route)
Get time.
Definition: timetables.c:530
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:388
int NetA_weakly_connected_components(dglGraph_s *graph, int *component)
Computes weakly connected components.
Definition: components.c:52
char * dst
Definition: lz4.h:981
Vector map info.
Definition: dig_structs.h:1243
List of integers.
Definition: gis.h:709
Feature category info.
Definition: dig_structs.h:1677
Definition: manage.h:4
int ** route_times
Definition: defs/neta.h:59
int * route_length
Definition: defs/neta.h:56
int ** walk_times
Definition: defs/neta.h:70
int ** stop_times
Definition: defs/neta.h:65
int ** walk_stops
Definition: defs/neta.h:69
int ** stop_routes
Definition: defs/neta.h:63
int * stop_length
Definition: defs/neta.h:62
int * walk_length
Definition: defs/neta.h:67
int ** route_stops
Definition: defs/neta.h:58
Vector array.
Definition: dig_structs.h:1751
long dglInt32_t
Definition: type.h:36