@@ -105,21 +105,35 @@ Examples
105105
106106.. code-block :: sql
107107
108- SELECT * FROM pgr_tsp('SELECT id AS source_id, x, y FROM vertex_table','2,7,11',7);
108+ SELECT * FROM pgr_tsp('SELECT id AS source_id, x, y FROM vertex_table','2,7,11,9 ',7);
109109
110110
111- * Using distance matrix
111+ * Using distance matrix (Points 2,7,11 and 9, starting from 7)
112112
113113.. code-block :: sql
114114
115- SELECT seq, id FROM pgr_tsp('{{0,1,2 ,3},{1,0,3 ,2},{2,3,0,4 },{3,2,4 ,0}}',2 );
115+ SELECT seq, id FROM pgr_tsp('{{0,1,3 ,3},{1,0,2 ,2},{3,2,0,2 },{3,2,2 ,0}}',1 );
116116
117117 seq | id
118118 -----+----
119- 0 | 2
119+ 0 | 1
120+ 1 | 3
121+ 2 | 2
122+ 3 | 0
123+ (4 rows)
124+
125+ * Using distance matrix (Points 2,7,11 and 9, starting from 7, returning to 11)
126+
127+ .. code-block :: sql
128+
129+ SELECT seq, id FROM pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',1,2);
130+
131+ seq | id
132+ -----+----
133+ 0 | 3
120134 1 | 0
121135 2 | 1
122- 3 | 3
136+ 3 | 2
123137 (4 rows)
124138
125139 The queries use the :ref: `sampledata ` network.
0 commit comments