1 | <!-- This comment will put IE 6, 7 and 8 in quirks mode --> |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
---|
6 | <title>TSPSG: TSP Solver and Generator: CTSPSolver Class Reference</title> |
---|
7 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
---|
8 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
---|
9 | <script type="text/javaScript" src="search/search.js"></script> |
---|
10 | <link href="doxygen.css" rel="stylesheet" type="text/css"/> |
---|
11 | </head> |
---|
12 | <body onload='searchBox.OnSelectItem(0);'> |
---|
13 | <!-- Generated by Doxygen 1.6.1 --> |
---|
14 | <script type="text/javascript"><!-- |
---|
15 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
---|
16 | --></script> |
---|
17 | <script type="text/javascript"> |
---|
18 | <!-- |
---|
19 | function changeDisplayState (e){ |
---|
20 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
21 | var button=this.firstChild; |
---|
22 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
23 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
24 | sectionDiv.style.display='block'; |
---|
25 | button.src='open.gif'; |
---|
26 | }else{ |
---|
27 | sectionDiv.style.display='none'; |
---|
28 | button.src='closed.gif'; |
---|
29 | } |
---|
30 | } |
---|
31 | function initDynSections(){ |
---|
32 | var divs=document.getElementsByTagName('div'); |
---|
33 | var sectionCounter=1; |
---|
34 | for(var i=0;i<divs.length-1;i++){ |
---|
35 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
36 | var header=divs[i]; |
---|
37 | var section=divs[i+1]; |
---|
38 | var button=header.firstChild; |
---|
39 | if (button!='IMG'){ |
---|
40 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
41 | button=document.createElement('img'); |
---|
42 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
43 | } |
---|
44 | header.style.cursor='pointer'; |
---|
45 | header.onclick=changeDisplayState; |
---|
46 | header.id='dynheader'+sectionCounter; |
---|
47 | button.src='closed.gif'; |
---|
48 | section.id='dynsection'+sectionCounter; |
---|
49 | section.style.display='none'; |
---|
50 | section.style.marginLeft='14px'; |
---|
51 | sectionCounter++; |
---|
52 | } |
---|
53 | } |
---|
54 | } |
---|
55 | window.onload = initDynSections; |
---|
56 | --> |
---|
57 | </script> |
---|
58 | <div class="navigation" id="top"> |
---|
59 | <div class="tabs"> |
---|
60 | <ul> |
---|
61 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
62 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
63 | <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
64 | <li><a href="files.html"><span>Files</span></a></li> |
---|
65 | <li> |
---|
66 | <div id="MSearchBox" class="MSearchBoxInactive"> |
---|
67 | <img id="MSearchSelect" src="search/search.png" |
---|
68 | onmouseover="return searchBox.OnSearchSelectShow()" |
---|
69 | onmouseout="return searchBox.OnSearchSelectHide()" |
---|
70 | alt=""/> |
---|
71 | <input type="text" id="MSearchField" value="Search" accesskey="S" |
---|
72 | onfocus="searchBox.OnSearchFieldFocus(true)" |
---|
73 | onblur="searchBox.OnSearchFieldFocus(false)" |
---|
74 | onkeyup="searchBox.OnSearchFieldChange(event)"/> |
---|
75 | <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
---|
76 | </div> |
---|
77 | </li> |
---|
78 | </ul> |
---|
79 | </div> |
---|
80 | <div class="tabs"> |
---|
81 | <ul> |
---|
82 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
83 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
84 | </ul> |
---|
85 | </div> |
---|
86 | </div> |
---|
87 | <div class="contents"> |
---|
88 | <h1>CTSPSolver Class Reference</h1><!-- doxytag: class="CTSPSolver" --> |
---|
89 | <p>This class solves Travelling Salesman Problem task. |
---|
90 | <a href="#_details">More...</a></p> |
---|
91 | |
---|
92 | <p><code>#include <<a class="el" href="tspsolver_8h_source.html">tspsolver.h</a>></code></p> |
---|
93 | <div class="dynheader"> |
---|
94 | Collaboration diagram for CTSPSolver:</div> |
---|
95 | <div class="dynsection"> |
---|
96 | <div class="center"><img src="class_c_t_s_p_solver__coll__graph.png" border="0" usemap="#_c_t_s_p_solver_coll__map" alt="Collaboration graph"/></div> |
---|
97 | <map name="_c_t_s_p_solver_coll__map" id="_c_t_s_p_solver_coll__map"> |
---|
98 | <area shape="rect" id="node2" href="structs_step.html" title="This structure represents one step of solving." alt="" coords="23,7,79,35"/> |
---|
99 | </map> |
---|
100 | <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> |
---|
101 | |
---|
102 | <p><a href="class_c_t_s_p_solver-members.html">List of all members.</a></p> |
---|
103 | <table border="0" cellpadding="0" cellspacing="0"> |
---|
104 | <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> |
---|
105 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa5e45813d8f5e1c039b1bb9746d367bd"></a><!-- doxytag: member="CTSPSolver::CTSPSolver" ref="aa5e45813d8f5e1c039b1bb9746d367bd" args="()" --> |
---|
106 | </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_solver.html#aa5e45813d8f5e1c039b1bb9746d367bd">CTSPSolver</a> ()</td></tr> |
---|
107 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Class constructor. <br/></td></tr> |
---|
108 | <tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_solver.html#a57556c971a25e3556c4aa3cc1fd2d3d0">getSortedPath</a> () const </td></tr> |
---|
109 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the sorted optimal path, starting from City 1. <a href="#a57556c971a25e3556c4aa3cc1fd2d3d0"></a><br/></td></tr> |
---|
110 | <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_solver.html#a28d546e840cf53c639b45c0f26419f7a">isOptimal</a> () const </td></tr> |
---|
111 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether or not the solution is definitely optimal. <a href="#a28d546e840cf53c639b45c0f26419f7a"></a><br/></td></tr> |
---|
112 | <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structs_step.html">sStep</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_solver.html#a9dab2bba56c384663fb21f5e4d1f2743">solve</a> (int, <a class="el" href="tspsolver_8h.html#a96b95c574161e5013286210c96c581ba">tMatrix</a>, QWidget *parent=0)</td></tr> |
---|
113 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Solves the given task. <a href="#a9dab2bba56c384663fb21f5e4d1f2743"></a><br/></td></tr> |
---|
114 | <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> |
---|
115 | <tr><td class="memItemLeft" align="right" valign="top">static QString </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_solver.html#a677a878c4c8a06316a5d8d5a4fc8ab65">getVersionId</a> ()</td></tr> |
---|
116 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns CTSPSolver's version ID. <a href="#a677a878c4c8a06316a5d8d5a4fc8ab65"></a><br/></td></tr> |
---|
117 | </table> |
---|
118 | <hr/><a name="_details"></a><h2>Detailed Description</h2> |
---|
119 | <p>This class solves Travelling Salesman Problem task. </p> |
---|
120 | <dl class="author"><dt><b>Author:</b></dt><dd>Copyright © 2007-2009 Lёppa <contacts[at]oleksii[dot]name></dd></dl> |
---|
121 | <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>TODO: Deletion of solution tree on destroy and cleanup. </dd></dl> |
---|
122 | <hr/><h2>Member Function Documentation</h2> |
---|
123 | <a class="anchor" id="a57556c971a25e3556c4aa3cc1fd2d3d0"></a><!-- doxytag: member="CTSPSolver::getSortedPath" ref="a57556c971a25e3556c4aa3cc1fd2d3d0" args="() const " --> |
---|
124 | <div class="memitem"> |
---|
125 | <div class="memproto"> |
---|
126 | <table class="memname"> |
---|
127 | <tr> |
---|
128 | <td class="memname">QString CTSPSolver::getSortedPath </td> |
---|
129 | <td>(</td> |
---|
130 | <td class="paramname"></td> |
---|
131 | <td> ) </td> |
---|
132 | <td> const</td> |
---|
133 | </tr> |
---|
134 | </table> |
---|
135 | </div> |
---|
136 | <div class="memdoc"> |
---|
137 | |
---|
138 | <p>Returns the sorted optimal path, starting from City 1. </p> |
---|
139 | <dl class="return"><dt><b>Returns:</b></dt><dd>A string, containing sorted optimal path. </dd></dl> |
---|
140 | |
---|
141 | </div> |
---|
142 | </div> |
---|
143 | <a class="anchor" id="a677a878c4c8a06316a5d8d5a4fc8ab65"></a><!-- doxytag: member="CTSPSolver::getVersionId" ref="a677a878c4c8a06316a5d8d5a4fc8ab65" args="()" --> |
---|
144 | <div class="memitem"> |
---|
145 | <div class="memproto"> |
---|
146 | <table class="memname"> |
---|
147 | <tr> |
---|
148 | <td class="memname">QString CTSPSolver::getVersionId </td> |
---|
149 | <td>(</td> |
---|
150 | <td class="paramname"></td> |
---|
151 | <td> ) </td> |
---|
152 | <td><code> [static]</code></td> |
---|
153 | </tr> |
---|
154 | </table> |
---|
155 | </div> |
---|
156 | <div class="memdoc"> |
---|
157 | |
---|
158 | <p>Returns CTSPSolver's version ID. </p> |
---|
159 | <dl class="return"><dt><b>Returns:</b></dt><dd>A string: <b>$Id: tspsolver.cpp 66 2009-10-21 12:48:49Z laleppa $</b>. </dd></dl> |
---|
160 | |
---|
161 | </div> |
---|
162 | </div> |
---|
163 | <a class="anchor" id="a28d546e840cf53c639b45c0f26419f7a"></a><!-- doxytag: member="CTSPSolver::isOptimal" ref="a28d546e840cf53c639b45c0f26419f7a" args="() const " --> |
---|
164 | <div class="memitem"> |
---|
165 | <div class="memproto"> |
---|
166 | <table class="memname"> |
---|
167 | <tr> |
---|
168 | <td class="memname">bool CTSPSolver::isOptimal </td> |
---|
169 | <td>(</td> |
---|
170 | <td class="paramname"></td> |
---|
171 | <td> ) </td> |
---|
172 | <td> const</td> |
---|
173 | </tr> |
---|
174 | </table> |
---|
175 | </div> |
---|
176 | <div class="memdoc"> |
---|
177 | |
---|
178 | <p>Returns whether or not the solution is definitely optimal. </p> |
---|
179 | <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if solution is definitely optimal, otherwise <code>false</code>.</dd></dl> |
---|
180 | <p>The solution may need some further interations to determine whether it is optimal. In such cases this function returns <code>false</code>. </p> |
---|
181 | |
---|
182 | </div> |
---|
183 | </div> |
---|
184 | <a class="anchor" id="a9dab2bba56c384663fb21f5e4d1f2743"></a><!-- doxytag: member="CTSPSolver::solve" ref="a9dab2bba56c384663fb21f5e4d1f2743" args="(int, tMatrix, QWidget *parent=0)" --> |
---|
185 | <div class="memitem"> |
---|
186 | <div class="memproto"> |
---|
187 | <table class="memname"> |
---|
188 | <tr> |
---|
189 | <td class="memname"><a class="el" href="structs_step.html">sStep</a> * CTSPSolver::solve </td> |
---|
190 | <td>(</td> |
---|
191 | <td class="paramtype">int </td> |
---|
192 | <td class="paramname"> <em>numCities</em>, </td> |
---|
193 | </tr> |
---|
194 | <tr> |
---|
195 | <td class="paramkey"></td> |
---|
196 | <td></td> |
---|
197 | <td class="paramtype"><a class="el" href="tspsolver_8h.html#a96b95c574161e5013286210c96c581ba">tMatrix</a> </td> |
---|
198 | <td class="paramname"> <em>task</em>, </td> |
---|
199 | </tr> |
---|
200 | <tr> |
---|
201 | <td class="paramkey"></td> |
---|
202 | <td></td> |
---|
203 | <td class="paramtype">QWidget * </td> |
---|
204 | <td class="paramname"> <em>parent</em> = <code>0</code></td><td> </td> |
---|
205 | </tr> |
---|
206 | <tr> |
---|
207 | <td></td> |
---|
208 | <td>)</td> |
---|
209 | <td></td><td></td><td></td> |
---|
210 | </tr> |
---|
211 | </table> |
---|
212 | </div> |
---|
213 | <div class="memdoc"> |
---|
214 | |
---|
215 | <p>Solves the given task. </p> |
---|
216 | <dl><dt><b>Parameters:</b></dt><dd> |
---|
217 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
218 | <tr><td valign="top"></td><td valign="top"><em>numCities</em> </td><td>Number of cities in the task. </td></tr> |
---|
219 | <tr><td valign="top"></td><td valign="top"><em>task</em> </td><td>The matrix of city-to-city travel costs. </td></tr> |
---|
220 | <tr><td valign="top"></td><td valign="top"><em>parent</em> </td><td>The parent widget for displaying messages and dialogs. </td></tr> |
---|
221 | </table> |
---|
222 | </dd> |
---|
223 | </dl> |
---|
224 | <dl class="return"><dt><b>Returns:</b></dt><dd>Pointer to the root of the solution tree.</dd></dl> |
---|
225 | <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000002">Todo:</a></b></dt><dd>TODO: Comment the algorithm. </dd></dl> |
---|
226 | |
---|
227 | </div> |
---|
228 | </div> |
---|
229 | <hr/>The documentation for this class was generated from the following files:<ul> |
---|
230 | <li>src/<a class="el" href="tspsolver_8h_source.html">tspsolver.h</a></li> |
---|
231 | <li>src/tspsolver.cpp</li> |
---|
232 | </ul> |
---|
233 | </div> |
---|
234 | <!--- window showing the filter options --> |
---|
235 | <div id="MSearchSelectWindow" |
---|
236 | onmouseover="return searchBox.OnSearchSelectShow()" |
---|
237 | onmouseout="return searchBox.OnSearchSelectHide()" |
---|
238 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
---|
239 | <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Defines</a></div> |
---|
240 | |
---|
241 | <!-- iframe showing the search results (closed by default) --> |
---|
242 | <div id="MSearchResultsWindow"> |
---|
243 | <iframe src="" frameborder="0" |
---|
244 | name="MSearchResults" id="MSearchResults"> |
---|
245 | </iframe> |
---|
246 | </div> |
---|
247 | |
---|
248 | <hr size="1"/><address style="text-align: right;"><small>Generated on Sat Oct 24 16:33:19 2009 for TSPSG: TSP Solver and Generator by |
---|
249 | <a href="http://www.doxygen.org/index.html"> |
---|
250 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> |
---|
251 | </body> |
---|
252 | </html> |
---|