Skip to content

Commit

Permalink
Merge pull request #393 from bedupako12mas/centrality-week7
Browse files Browse the repository at this point in the history
Centrality: Week 7
  • Loading branch information
bedupako12mas authored Jul 22, 2024
2 parents 511653c + 6178853 commit d3dfdb8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/metrics/pgr_betweennessCentrality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Signatures
.. TODO: Fix this when docqueries are made
:Example: For a directed subgraph with edges :math:`\{1, 2, 3, 4\}`.

.. literalinclude:: floydWarshall.queries
.. literalinclude:: betweennessCentrality.queries
:start-after: -- q1
:end-before: -- q2
:end-before: Implicit Cases (directed)

Parameters
-------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions docqueries/metrics/betweennessCentrality.pg
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
-- CopyRight(c) pgRouting developers
-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/

/* -- 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
Expand Down
14 changes: 14 additions & 0 deletions docqueries/metrics/betweennessCentrality.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ BEGIN;
BEGIN
SET client_min_messages TO NOTICE;
SET
/* -- q1 */
SELECT * FROM pgr_betweennessCentrality(
'SELECT id, source, target, cost, reverse_cost
FROM edges where id < 5'
) ORDER BY vid;
vid | centrality
-----+------------
5 | 0
6 | 0.5
7 | 0
10 | 0.25
15 | 0
(5 rows)

/* Implicit Cases (directed) */
SELECT * FROM pgr_betweennessCentrality(
'SELECT id, source, target, cost, reverse_cost
Expand Down

0 comments on commit d3dfdb8

Please sign in to comment.