/usr/share/doc/postgresql-9.5-pgrouting-doc/html/en/_sources/src/apsp_warshall/doc/index.txt is in postgresql-9.5-pgrouting-doc 2.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ..
****************************************************************************
pgRouting Manual
Copyright(c) pgRouting Contributors
This documentation is licensed under a Creative Commons Attribution-Share
Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
****************************************************************************
.. _pgr_apsp_warshall:
pgr_apspWarshall - All Pairs Shortest Path, Floyd-Warshall Algorithm
===============================================================================
.. index::
single: pgr_apspWarshall(text, boolean, boolean)
module: apsp
Name
-------------------------------------------------------------------------------
``pgr_apspWarshall`` - Returns all costs for each pair of nodes in the graph.
Synopsis
-------------------------------------------------------------------------------
The Floyd-Warshall algorithm (also known as Floyd's algorithm and other names) is a graph analysis algorithm for finding the shortest paths between all pairs of nodes in a weighted graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows for every pair of nodes in the graph.
.. code-block:: sql
pgr_costResult[] pgr_apspWarshall(sql text, directed boolean, reverse_cost boolean);
Description
-------------------------------------------------------------------------------
:sql: a SQL query that should return the edges for the graph that will be analyzed:
.. code-block:: sql
SELECT id, source, target, cost FROM edge_table;
:id: ``int4`` identifier of the edge
:source: ``int4`` identifier of the source vertex for this edge
:target: ``int4`` identifier of the target vertex for this edge
:cost: ``float8`` a positive value for the cost to traverse this edge
:directed: ``true`` if the graph is directed
:reverse_cost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
Returns set of :ref:`type_cost_result`:
:seq: row sequence
:id1: source node ID
:id2: target node ID
:cost: cost to traverse from ``id1`` to ``id2``
.. rubric:: History
* New in version 2.0.0
Examples
-------------------------------------------------------------------------------
.. code-block:: sql
SELECT seq, id1 AS from, id2 AS to, cost
FROM pgr_apspWarshall(
'SELECT id, source, target, cost FROM edge_table',
false, false
);
seq | from | to | cost
-----+------+----+------
0 | 1 | 1 | 0
1 | 1 | 2 | 1
2 | 1 | 3 | 0
3 | 1 | 4 | -1
[...]
The query uses the :ref:`sampledata` network.
See Also
-------------------------------------------------------------------------------
* :ref:`type_cost_result`
* :ref:`pgr_apsp_johnson`
* http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
|