Skip to content

Commit

Permalink
Updated TSP documentation, fixed matrix example #123
Browse files Browse the repository at this point in the history
  • Loading branch information
dkastl committed Jun 18, 2013
1 parent 9193863 commit 73905d4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0.0-alpha-97-g63ff357 develop
v2.0.0-alpha-97-g9193863 develop
24 changes: 19 additions & 5 deletions src/tsp/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,35 @@ Examples

.. code-block:: sql
SELECT * FROM pgr_tsp('SELECT id AS source_id, x, y FROM vertex_table','2,7,11',7);
SELECT * FROM pgr_tsp('SELECT id AS source_id, x, y FROM vertex_table','2,7,11,9',7);
* Using distance matrix
* Using distance matrix (Points 2,7,11 and 9, starting from 7)

.. code-block:: sql
SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,3,2},{2,3,0,4},{3,2,4,0}}',2);
SELECT seq, id FROM pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',1);
seq | id
-----+----
0 | 2
0 | 1
1 | 3
2 | 2
3 | 0
(4 rows)
* Using distance matrix (Points 2,7,11 and 9, starting from 7, returning to 11)

.. code-block:: sql
SELECT seq, id FROM pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',1,2);
seq | id
-----+----
0 | 3
1 | 0
2 | 1
3 | 3
3 | 2
(4 rows)
The queries use the :ref:`sampledata` network.
Expand Down

0 comments on commit 73905d4

Please sign in to comment.