|
| 1 | +.. |
| 2 | + **************************************************************************** |
| 3 | + pgRouting Manual |
| 4 | + Copyright(c) pgRouting Contributors |
| 5 | +
|
| 6 | + This documentation is licensed under a Creative Commons Attribution-Share |
| 7 | + |
| 8 | + Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/ |
| 9 | + **************************************************************************** |
| 10 | + |
| 11 | +.. index:: |
| 12 | + single: Ordering Family ; pgr_sloanOrdering |
| 13 | + single: pgr_sloanOrdering - Experimental on v4.0 |
| 14 | + |
| 15 | +| |
| 16 | +
|
| 17 | +``pgr_sloanOrdering`` - Experimental |
| 18 | +=============================================================================== |
| 19 | + |
| 20 | +``pgr_sloanOrdering`` — Returns the sloan ordering of an undirected |
| 21 | +graph |
| 22 | + |
| 23 | +.. include:: experimental.rst |
| 24 | + :start-after: warning-begin |
| 25 | + :end-before: end-warning |
| 26 | + |
| 27 | +.. rubric:: Availability |
| 28 | + |
| 29 | +.. rubric:: Version 4.0.0 |
| 30 | + |
| 31 | +* New experimental function. |
| 32 | + |
| 33 | + |
| 34 | +Description |
| 35 | +------------------------------------------------------------------------------- |
| 36 | + |
| 37 | +The Sloan ordering algorithm reorders the vertices of a graph to reduce |
| 38 | +bandwidth, profile, and wavefront properties, which is particularly useful for |
| 39 | +sparse matrix computations and finite element analysis. |
| 40 | + |
| 41 | +* Finds a pseudoperipheral vertex pair to determine good starting points |
| 42 | +* Uses a priority-based algorithm that balances vertex degree and distance from the start vertex. |
| 43 | +* Aims to mininimize bandwidth (maximum difference between connected vertex indices. |
| 44 | +* The implementation is for undirected graphs |
| 45 | +* Typically produces better orderings than simple breadth-first approaches. |
| 46 | +* Run time is 0.115846 seconds. |
| 47 | + |
| 48 | +|Boost| Boost Graph inside |
| 49 | + |
| 50 | +Signatures |
| 51 | +------------------------------------------------------------------------------ |
| 52 | +..rubric::Summary |
| 53 | + |
| 54 | +.. index:: |
| 55 | + single: sloanOrdering - Experimental on v4.0 |
| 56 | + |
| 57 | +.. admonition:: \ \ |
| 58 | + :class: signatures |
| 59 | + |
| 60 | + | pgr_sloanOrdering(`Edges SQL`_) |
| 61 | +
|
| 62 | + | Returns set of |result_node_order| |
| 63 | + | OR EMPTY SET |
| 64 | +
|
| 65 | +:Example : Sloan ordering without specifying start vertex |
| 66 | + |
| 67 | +.. literalinclude:: sloanOrdering.queries |
| 68 | + :start-after: -- q1 |
| 69 | + :end-before: -- q2 |
| 70 | + |
| 71 | +.. Parameters, Inner Queries & result columns |
| 72 | +
|
| 73 | +Parameters |
| 74 | +------------------------------------------------------------------------------- |
| 75 | + |
| 76 | +.. include:: pgRouting-concepts.rst |
| 77 | + :start-after: only_edge_param_start |
| 78 | + :end-before: only_edge_param_end |
| 79 | + |
| 80 | +Inner Queries |
| 81 | +------------------------------------------------------------------------------- |
| 82 | + |
| 83 | +Edges SQL |
| 84 | +............................................................................... |
| 85 | + |
| 86 | +.. include:: pgRouting-concepts.rst |
| 87 | + :start-after: basic_edges_sql_start |
| 88 | + :end-before: basic_edges_sql_end |
| 89 | + |
| 90 | +Result columns |
| 91 | +------------------------------------------------------------------------------- |
| 92 | + |
| 93 | +Returns set of ``(seq, node)`` |
| 94 | + |
| 95 | +=============== =========== ====================================== |
| 96 | +Column Type Description |
| 97 | +=============== =========== ====================================== |
| 98 | +``seq`` ``BIGINT`` Sequence of the order starting from 1. |
| 99 | +``node`` ``BIGINT`` New sloan ordering order. |
| 100 | +=============== =========== ====================================== |
| 101 | + |
| 102 | +Additional Examples |
| 103 | + |
| 104 | +:Example: Sloan ordering of Original graph from Boost example (vertices 0-9). |
| 105 | + |
| 106 | +..graphviz:: |
| 107 | + |
| 108 | +graph G{ |
| 109 | +node[shape=circle, style=filled, fillcolor=lightblue, color=black, fontcolor=black, fontsize=12]; |
| 110 | +edge[color=black, penwidth=1.5]; |
| 111 | + |
| 112 | +0 -- 3; |
| 113 | +0 -- 5; |
| 114 | +1 -- 2; |
| 115 | +1 -- 4; |
| 116 | +1 -- 6; |
| 117 | +1 -- 9; |
| 118 | +2 -- 3; |
| 119 | +2 -- 4; |
| 120 | +3 -- 5; |
| 121 | +3 -- 8; |
| 122 | +4 -- 6; |
| 123 | +5 -- 6; |
| 124 | +5 -- 7; |
| 125 | +6 -- 7; |
| 126 | + |
| 127 | +{rank=same; 0; 8;} |
| 128 | +{rank=same; 3; 5; 7;} |
| 129 | +{rank=same; 2; 4; 6;} |
| 130 | +{rank=same; 1; 9;} |
| 131 | + |
| 132 | +} |
| 133 | + |
| 134 | +..literalinclude::sloanOrdering.queries |
| 135 | + :start-after: --q3 |
| 136 | + :end-before: --q4 |
| 137 | + |
| 138 | + |
| 139 | +See Also |
| 140 | +------------------------------------------------------------------------------- |
| 141 | + |
| 142 | +* :doc:`sampledata` |
| 143 | +* `Boost: Sloan Ordering |
| 144 | + <https://www.boost.org/libs/graph/doc/sloan_ordering.html>`__ |
| 145 | + |
| 146 | +.. rubric:: Indices and tables |
| 147 | + |
| 148 | +* :ref:`genindex` |
| 149 | +* :ref:`search` |
0 commit comments