Skip to content

Commit

Permalink
[centrality] created docqueries/metrics and the centrality files
Browse files Browse the repository at this point in the history
  • Loading branch information
bedupako12mas committed Jun 2, 2024
1 parent d73da3c commit 72e9372
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docqueries/metrics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Do not use extensions
SET(LOCAL_FILES
doc-floydWarshall
doc-johnson
)

foreach (f ${LOCAL_FILES})
configure_file("${f}.result" "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries")
list(APPEND LOCAL_DOC_FILES "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries")
endforeach()

set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE)
29 changes: 29 additions & 0 deletions docqueries/metrics/doc-centrality.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BEGIN;
BEGIN
SET client_min_messages TO NOTICE;
SET
/* -- q1 */
SELECT * FROM pgr_floydWarshall(
'SELECT id, source, target, cost, reverse_cost
FROM edges where id < 5'
) ORDER BY start_vid, end_vid;
start_vid | end_vid | agg_cost
-----------+---------+----------
5 | 6 | 1
5 | 7 | 2
6 | 5 | 1
6 | 7 | 1
7 | 5 | 2
7 | 6 | 1
10 | 5 | 2
10 | 6 | 1
10 | 7 | 2
15 | 5 | 3
15 | 6 | 2
15 | 7 | 3
15 | 10 | 1
(13 rows)

/* -- q2 */
ROLLBACK;
ROLLBACK
8 changes: 8 additions & 0 deletions docqueries/metrics/doc-centrality.test.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CopyRight(c) pgRouting developers
-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/
/* -- q1 */
SELECT * FROM pgr_floydWarshall(
'SELECT id, source, target, cost, reverse_cost
FROM edges where id < 5'
) ORDER BY start_vid, end_vid;
/* -- q2 */
25 changes: 25 additions & 0 deletions docqueries/metrics/test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/perl -w

%main::tests = (
'any' => {
'comment' => 'All pairs tests.',
'data' => [''],
'tests' => [qw(
doc-johnson
doc-floydWarshall
)],

'documentation' => [qw(
doc-johnson
doc-floydWarshall
)]
},
# I don't know what this are for or how to use them.
# TODO ask Steve
# 'vpg-vpgis' => {}, # for version specific tests
# '8-1' => {}, # for pg 8.x and postgis 1.x
# '9.2-2.1' => {}, # for pg 9.2 and postgis 2.1

);

1;

0 comments on commit 72e9372

Please sign in to comment.