Revision 128, 1.3 KB
(checked in by anton, 3 years ago)
|
Debugging branch added
|
Line | |
---|
1 | /* |
---|
2 | * Shortest path algorithm for PostgreSQL |
---|
3 | * |
---|
4 | * Copyright (c) 2005 Sylvain Pasche |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 2 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | * |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef _DIJKSTRA_H |
---|
23 | #define _DIJKSTRA_H |
---|
24 | |
---|
25 | #include "postgres.h" |
---|
26 | |
---|
27 | typedef struct edge |
---|
28 | { |
---|
29 | int id; |
---|
30 | int source; |
---|
31 | int target; |
---|
32 | float8 cost; |
---|
33 | float8 reverse_cost; |
---|
34 | } edge_t; |
---|
35 | |
---|
36 | typedef struct path_element |
---|
37 | { |
---|
38 | int vertex_id; |
---|
39 | int edge_id; |
---|
40 | float8 cost; |
---|
41 | } path_element_t; |
---|
42 | |
---|
43 | #ifdef __cplusplus |
---|
44 | extern "C" |
---|
45 | #endif |
---|
46 | int boost_dijkstra(edge_t *edges, unsigned int count, int start_vertex, int end_vertex, |
---|
47 | bool directed, bool has_reverse_cost, |
---|
48 | path_element_t **path, int *path_count, char **err_msg); |
---|
49 | |
---|
50 | #endif |
---|