Sparksee  6.0.2
STSKOpt Class Reference

KOpt class. More...

Inheritance diagram for STSKOpt:
Inheritance graph
Collaboration diagram for STSKOpt:
Collaboration graph

Instance Methods

(id) - initWithSession:
 Creates a new instance. More...
 
(void) - addNodeType:
 Allows for traversing nodes of the given type. More...
 
(void) - addAllNodeTypes
 Allows for traversing all node types of the graph.
 
(void) - addEdgeType:dir:
 Allows for traversing edges of the given type. More...
 
(void) - addAllEdgeTypes:
 Allows for traversing all edge types of the graph. More...
 
(void) - setEdgeWeightAttributeType:
 Sets the attribute to use as edge weight. More...
 
(double) - getCurrentCost
 Returns tour cost.
 
(STSOidList *) - getCurrentTour
 Returns tour as a list of nodes.
 
(void) - setCurrentTour:
 Sets current tour as a list of nodes. More...
 
(void) - setMaxIterations:
 Sets maximum number of iterations. More...
 
(void) - setTimeLimit:
 Limits execution time. More...
 
(void) - runTwoOpt
 Runs 2-Opt local search.
 
(void) - runThreeOpt
 Runs 3-Opt local search.
 
(void) - close
 Closes the KOpt instance. More...
 
(BOOL) - isClosed
 Check if the KOpt instance is closed.
 

Detailed Description

KOpt class.

Implements the 2-Opt and 3-Opt algorithms

Author
Sparsity Technologies http://www.sparsity-technologies.com

Method Documentation

- (void) addAllEdgeTypes: (enum STSEdgesDirection)  dir

Allows for traversing all edge types of the graph.

Parameters
dir[in] Edge direction.
- (void) addEdgeType: (int)  type
dir: (enum STSEdgesDirection)  dir 

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.ApplicationExceptionnull
- (void) addNodeType: (int)  type

Allows for traversing nodes of the given type.

sparksee::gdb::Error

Parameters
type[in] Node type.
Exceptions
System.ApplicationExceptionnull
- (void) close

Closes the KOpt instance.

It must be called to ensure the integrity of all data.

- (id) initWithSession: (STSSession *)  session

Creates a new instance.

Parameters
session[in] Session to get the graph from and perform algorithm.
- (void) setCurrentTour: (STSOidList *)  tour

Sets current tour as a list of nodes.

Parameters
tour[in] Initial tour that needs to be improved.
- (void) setEdgeWeightAttributeType: (int)  attr

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.ApplicationExceptionnull
- (void) setMaxIterations: (long 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) setTimeLimit: (long long)  maxTime

Limits execution time.

Parameters
maxTime[in] Time limit in miliseconds

The documentation for this class was generated from the following file: