Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::TspLibTourParser Class Referencefinal

Class parsing tour (solution) data in TSLIB95 format. More...

#include <tsplib_parser.h>

Public Member Functions

 TspLibTourParser ()
 
bool LoadFile (const std::string &file_name)
 Loads and parses a given tour file.
 
const std::vector< int > & tour () const
 Returns a vector corresponding to the sequence of nodes of the tour.
 
int size () const
 Returns the size of the tour.
 
const std::string & comments () const
 Returns the comments attached to the data.
 

Detailed Description

Class parsing tour (solution) data in TSLIB95 format.

Definition at line 196 of file tsplib_parser.h.

Constructor & Destructor Documentation

◆ TspLibTourParser()

operations_research::TspLibTourParser::TspLibTourParser ( )

Definition at line 746 of file tsplib_parser.cc.

Member Function Documentation

◆ comments()

const std::string & operations_research::TspLibTourParser::comments ( ) const
inline

Returns the comments attached to the data.

Definition at line 206 of file tsplib_parser.h.

◆ LoadFile()

bool operations_research::TspLibTourParser::LoadFile ( const std::string & file_name)

Loads and parses a given tour file.

Todo
(user): Return false when issues were encountered while parsing the file.

Definition at line 750 of file tsplib_parser.cc.

◆ size()

int operations_research::TspLibTourParser::size ( ) const
inline

Returns the size of the tour.

Definition at line 204 of file tsplib_parser.h.

◆ tour()

const std::vector< int > & operations_research::TspLibTourParser::tour ( ) const
inline

Returns a vector corresponding to the sequence of nodes of the tour.

Definition at line 202 of file tsplib_parser.h.


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