Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::TsplibXmlParser Class Reference

Parses tsplib files in xml format. More...

#include <ogdf/fileformats/TsplibXmlParser.h>

Public Member Functions

 TsplibXmlParser (std::istream &in)
 
 ~TsplibXmlParser ()=default
 
bool read (Graph &G)
 
bool read (Graph &G, GraphAttributes &GA)
 

Private Member Functions

bool load (std::istream &in, std::string &error)
 
bool read (Graph &G, GraphAttributes *GA)
 

Private Attributes

pugi::xml_node m_graphTag
 
bool m_hasError
 
pugi::xml_document m_xml
 

Detailed Description

Parses tsplib files in xml format.

See http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/XML-TSPLIB/Description.pdf

Notes:

  • Node indices will be set to the indices of the instance, so all nodes will have indices from 0 to n-1.
  • Selfloops will be skipped

Definition at line 54 of file TsplibXmlParser.h.

Constructor & Destructor Documentation

◆ TsplibXmlParser()

ogdf::TsplibXmlParser::TsplibXmlParser ( std::istream &  in)
explicit

◆ ~TsplibXmlParser()

ogdf::TsplibXmlParser::~TsplibXmlParser ( )
default

Member Function Documentation

◆ load()

bool ogdf::TsplibXmlParser::load ( std::istream &  in,
std::string &  error 
)
private

◆ read() [1/3]

bool ogdf::TsplibXmlParser::read ( Graph G)

◆ read() [2/3]

bool ogdf::TsplibXmlParser::read ( Graph G,
GraphAttributes GA 
)

◆ read() [3/3]

bool ogdf::TsplibXmlParser::read ( Graph G,
GraphAttributes GA 
)
private

Member Data Documentation

◆ m_graphTag

pugi::xml_node ogdf::TsplibXmlParser::m_graphTag
private

Definition at line 57 of file TsplibXmlParser.h.

◆ m_hasError

bool ogdf::TsplibXmlParser::m_hasError
private

Definition at line 59 of file TsplibXmlParser.h.

◆ m_xml

pugi::xml_document ogdf::TsplibXmlParser::m_xml
private

Definition at line 56 of file TsplibXmlParser.h.


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