KOpt class.
More...
KOpt class.
Implements the 2-Opt and 3-Opt algorithms
- Author
- Sparsity Technologies http://www.sparsity-technologies.com
Creates a new instance.
- Parameters
-
session | [in] Session to get the graph from and perform algorithm. |
tour | [in] Initial tour that needs to be improved. |
Creates a new instance.
- Parameters
-
session | [in] Session to get the graph from and perform algorithm. |
Allows for traversing all edge types of the graph.
- Parameters
-
Allows for traversing edges of the given type.
If the edge type was already added, the existing direction is overwritten
- Parameters
-
type | [in] Edge type. |
dir | [in] Edge direction. |
- Exceptions
-
System.ApplicationException | null |
void com.sparsity.sparksee.algorithms.KOpt.AddNodeType |
( |
int |
type | ) |
throws System.ApplicationException |
Allows for traversing nodes of the given type.
sparksee::gdb::Error
- Parameters
-
- Exceptions
-
System.ApplicationException | null |
void com.sparsity.sparksee.algorithms.KOpt.Close |
( |
| ) |
|
Closes the KOpt instance.
It must be called to ensure the integrity of all data.
boolean com.sparsity.sparksee.algorithms.KOpt.IsClosed |
( |
| ) |
|
Gets if KOpt instance has been closed or not.
- See Also
- Close()
- Returns
- TRUE if the KOpt instance has been closed, FALSE otherwise.
Sets current tour as a list of nodes.
- Parameters
-
tour | [in] Initial tour that needs to be improved. |
void com.sparsity.sparksee.algorithms.KOpt.SetEdgeWeightAttributeType |
( |
int |
attr | ) |
throws System.ApplicationException |
Sets the attribute to use as edge weight.
If the multiple edge are set for traversal, this attribute must be of type GLOBAL_TYPE or EDGES_TYPE. Additionally, the attribute must be of type Double.
sparksee::gdb::Error
- Parameters
-
attr | [in] The attribute type to use as a weight. Default: InvalidAttribute |
- Exceptions
-
System.ApplicationException | null |
void com.sparsity.sparksee.algorithms.KOpt.SetMaxIterations |
( |
long |
maxIterations | ) |
|
Sets maximum number of iterations.
By default the algorithm will run until no improvement can be made in the current tour.
- Parameters
-
maxIterations | [in] Maximum number of iterations |
void com.sparsity.sparksee.algorithms.KOpt.SetTimeLimit |
( |
long |
maxTime | ) |
|
Limits execution time.
- Parameters
-
maxTime | [in] Time limit in miliseconds |