Skip to main content

TSPLIB 95

Available on PyPI Continuous Integration Code Coverage Documentation Status

TSPLIB 95 is a library for working with TSPLIB 95 files.

Features

  • read and write TSPLIB95 file format like a boss

  • easily convert problems into networkx.Graph instances

  • supports all fields in the original standard

  • allows completely custom field and problem declarations

It also has a CLI program to print a tabular summary of one or more TSPLIB95 files… no idea why anyone would want that, but there you have it nonetheless.

Credits

See TSPLIB for original details, including file format specification, C++ code, and sample problems.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.7.1 (2020-05-08)

  • Bugfix for StandardProblem.get_nodes ignoring node indices specified in demands

0.7.0 (2020-04-18)

  • Refactored the models to unify the Problem and Solution classes into the new StandardProblem class.

  • 93% test coverage, including distance functions, parsing functions, and rendering functions.

  • You can finally write problems in TSPLIB95 format! Render to text, write to file, or save to filepath.

  • Parsing text, reading files, and loading filepaths are all now supported.

  • Deprecated the old loading utils.

  • Custom problems now supported by allowing you to define your own fields.

  • Library exceptions for parsing and rendering.

  • Numerous bugfixes for the distance functions (ATT, XRAY*, GEO).

  • Improved the CLI to use a pager and proper column tabulation.

  • Made some progress modernizing the FORTRAN code for xray problems.

  • Added codecoverage metrics and badge.

0.6.1 (2020-01-04)

  • Fix bug that caused the parser to ignore the first line of a file

0.6.0 (2019-10-19)

  • Changes to the conversion into a networkx.Graph:

    • Depot, demand, and fixed edge data have been removed from graph metadata. Depot and demand data is now associated with individual nodes like fixed edge data was (and still is).

    • Add a normalized parameter to allow nodes to be renamed as zero-index integers when obtaining a networkx.Graph.

  • Depots, demands, node coordinates, and display data fields now default to empty containers rather than None.

  • Fixed twine/PyPI warning about long description mime type

0.5.0 (2019-10-02)

  • New loaders that take just the text - no file necessary!

  • Invalid keywords now result in a ParsingError

  • Update the CLI to catch and gracefully handle ParsingError

  • Fixed a bug when trying to amend an exception with line information

0.4.0 (2019-09-21)

  • All expected parsing errors are now raised as ParsingError rather than the base Exception type.

  • Fix name of distance paramter to distances.geographical. Previously it was “diameter” but was used as a radius. It is now “radius”.

  • Relax restriction on networkx version (now ~=2.1)

  • Add documentation for each problem field

  • Other minor documentation changes

  • Add offical 3.7 support

  • Add missing history entry for v0.3.3

  • Remove some dead code

0.3.3 (2019-03-24)

  • Fix parsing bug for key-value lines whose value itself contains colons

0.3.2 (2018-10-07)

  • Fix bug in Problem.is_complete that produced a TypeError when run

  • Fix bug in Problem.is_depictable that produced a TypeError when run

  • Fix bug in Problem.get_display that produced an AttributeError when run

  • Added some unit tests for the Problem class

  • Added some unit tests for the parser module

0.3.1 (2018-10-03)

  • Fix bug in Problem.is_weighted that caused problems with defined nodes coords to use the unit distance function

0.3.0 (2018-08-12)

  • Added XRAY1 and XRAY2 implementations

  • Simplified some of the matrix code

0.2.0 (2018-08-12)

  • Implement column-wise matrices

  • Add a utiltiy for loading an unknown file

  • Fix bug in the ATT distance function

  • Update the CLI to use the models

  • Document a bunch-o-stuff

  • Switch to RTD sphinx theme

  • Move most utilties into utils

0.1.0 (2018-08-12)

  • First release on PyPI.

Metadata

Release files for tsplib95 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tsplib95 0.7.1
File Size Uploaded
tsplib95-0.7.1.tar.gz 512.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tsplib95 0.7.1
File Interpreter ABI Platform
tsplib95-0.7.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 537.6 kB

Release files / tsplib95-0.7.1.tar.gz

Download URL tsplib95-0.7.1.tar.gz
Size 512.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3da80175dfb0478b967b87c508f75def47371188b6401b719441f2cedc817e00
BLAKE2b-256 checksum
How to use checksums
c68147396cc0c5879d64525dc652966dcf32360a838c5c1f7b38676c9919593b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / tsplib95-0.7.1-py2.py3-none-any.whl

Download URL tsplib95-0.7.1-py2.py3-none-any.whl
Size 25.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c481638e293baaa62134b491477aa5b2681e552e4dc28a6106ca1e157ae59184
BLAKE2b-256 checksum
How to use checksums
a02bb1932d3674758ec5f49afa72d4519334a5ac2aac4d96cfd416eb872a1959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page