Skip to content

Commit

Permalink
[centrality] added edge_cases.pg and added license
Browse files Browse the repository at this point in the history
  • Loading branch information
bedupako12mas committed Jul 28, 2024
1 parent 28ddaae commit d77799a
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions pgtap/metrics/betweennessCentrality/edge_cases.pg
Original file line number Diff line number Diff line change
@@ -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;
*/

0 comments on commit d77799a

Please sign in to comment.