Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python.announce > #3197
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | "Robert Grant" <rhgrant10@gmail.com> |
| Newsgroups | comp.lang.python.announce |
| Subject | tsplib95 v0.4.0 |
| Date | Mon, 23 Sep 2019 00:25:32 -0000 |
| Lines | 59 |
| Approved | python-announce-list@python.org |
| Message-ID | <156919833221.7290.15347002846613920338@mail.python.org> (permalink) |
| Reply-To | python-list@python.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de bLJ96sQ2EwuVSHe0APRysAJPXOwxzNOmD/rfEk51SQug== |
| User-Agent | HyperKitty on https://mail.python.org/ |
| X-MailFrom | rhgrant10@gmail.com |
| X-Mailman-Rule-Hits | emergency |
| X-Mailman-Rule-Misses | dmarc-mitigation; no-senders; approved |
| Message-ID-Hash | EMSTYTTFPC325RQOMUUAKS5OCTFNLCLC |
| X-Message-ID-Hash | EMSTYTTFPC325RQOMUUAKS5OCTFNLCLC |
| X-Mailman-Approved-At | Sun, 22 Sep 2019 20:34:48 -0400 |
| X-Mailman-Version | 3.3.1 |
| Precedence | list |
| List-Id | Announcement-only list for the Python programming language <python-announce-list.python.org> |
| Archived-At | <https://mail.python.org/archives/list/python-announce-list@python.org/message/EMSTYTTFPC325RQOMUUAKS5OCTFNLCLC/> |
| List-Archive | <https://mail.python.org/archives/list/python-announce-list@python.org/> |
| List-Help | <mailto:python-announce-list-request@python.org?subject=help> |
| List-Post | <mailto:python-announce-list@python.org> |
| List-Subscribe | <mailto:python-announce-list-join@python.org> |
| List-Unsubscribe | <mailto:python-announce-list-leave@python.org> |
| Xref | csiph.com comp.lang.python.announce:3197 |
Show key headers only | View raw
I'm pleased to announce the release of tsplib95 v0.4.0!
What's New?
-----------
* parser now raises ``ParserError`` instead of ``Exception``
* problem fields are now documented
* added explicit support for python 3.7
* corrected a parameter name in ``distances.geographical``
What is tsplib95?
-----------------
tsplib95 is a library for reading TSPLIB95 problems and solutions.
It supports the entire file format specification and automatically
converts problems into ``networkx.Graph`` instances.
License: Apache Software License 2.0
* Read the **docs**: https://tsplib95.readthedocs.io/
* Install from **PyPI**: https://pypi.org/project/tsplib95/0.4.0/
* Contribute **source**: https://github.com/rhgrant10/tsplib95
Example
-------
.. code-block:: python
>>> import tsplib95
>>> import networkx as nx
>>> # read problem files
>>> problem = tsplib95.load_problem('path/to/att48.tsp')
>>> problem.name
>>> problem.comment
'48 capitals of the US (Padberg/Rinaldi)'
>>> problem.dimension
48
>>> problem.type
'TSP'
>>> # auto-generated weight function for any two nodes
>>> problem.wfunc(2, 6)
6977
>>> # convert to networkx
>>> G = problem.get_graph()
>>> if problem.is_symmteric():
... assert issubclass(G, nx.Graph)
... else:
... assert issubclass(G, nx.DiGraph)
>>> if problem.is_depictable():
... nx.draw(G)
...
Enjoy!
Robert Grant
Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread
tsplib95 v0.4.0 "Robert Grant" <rhgrant10@gmail.com> - 2019-09-23 00:25 +0000
csiph-web