From d77799a045805e45565ca6386dc47ad94f282bcf Mon Sep 17 00:00:00 2001 From: Arun Thakur Date: Sun, 28 Jul 2024 07:30:22 +0530 Subject: [PATCH] [centrality] added edge_cases.pg and added license --- .../betweennessCentrality/edge_cases.pg | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 pgtap/metrics/betweennessCentrality/edge_cases.pg diff --git a/pgtap/metrics/betweennessCentrality/edge_cases.pg b/pgtap/metrics/betweennessCentrality/edge_cases.pg new file mode 100644 index 0000000000..2f7ce12c5c --- /dev/null +++ b/pgtap/metrics/betweennessCentrality/edge_cases.pg @@ -0,0 +1,94 @@ +/*PGR-GNU***************************************************************** + +Copyright (c) 2018 pgRouting developers +Mail: project@pgrouting.org + +------ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + ********************************************************************PGR-GNU*/ +BEGIN; + + + +SELECT finish(); +ROLLBACK; + +/* +/* -- q1 */ +SELECT * FROM pgr_betweennessCentrality( +'SELECT id, source, target, cost, reverse_cost +FROM edges where id < 5' +) ORDER BY vid; +/* Implicit Cases (directed) */ +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 2' +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 3' +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 4' +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 5' +) ORDER BY vid; + +/* Explicit Cases (undirected) */ +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 2', directed => false +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 3', directed => false +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 4', directed => false +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 5', directed => false +) ORDER BY vid; + +/* Explicit Cases (directed) */ +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 2', directed => true +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 3', directed => true +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 4', directed => true +) ORDER BY vid; + +SELECT * FROM pgr_betweennessCentrality( + 'SELECT id, source, target, cost, reverse_cost + FROM edges where id < 5', directed => true +) ORDER BY vid; +*/