Giter Club home page Giter Club logo

tsplib-python-parser's Introduction

TSPLIB-python-parser

This is a parser to read tsplib problems data into python list and dict so from a file like

NAME: ulysses16.tsp TYPE: TSP COMMENT: Odyssey of Ulysses (Groetschel/Padberg) DIMENSION: 16 EDGE_WEIGHT_TYPE: GEO DISPLAY_DATA_TYPE: COORD_DISPLAY NODE_COORD_SECTION 1 38.24 20.42 2 39.57 26.15 3 40.56 25.32 4 36.26 23.12 5 33.48 10.54 6 37.56 12.19 7 38.42 13.11 8 37.52 20.44 9 41.23 9.10 10 41.17 13.05 11 36.08 -5.21 12 38.47 15.13 13 38.15 15.35 14 37.51 15.17 15 35.49 14.32 16 39.36 19.56 EOF

you will end up having a dict like

[(1, ('38.24', '20.42')), (2, ('39.57', '26.15')), (3, ('40.56', '25.32')), (4, ('36.26', '23.12')), (5, ('33.48', '10.54')), (6, ('37.56', '12.19')), (7, ('38.42', '13.11')), (8, ('37.52', '20.44')), (9, ('41.23', '9.10')), (10, ('41.17', '13.05')), (11, ('36.08', '-5.21')), (12, ('38.47', '15.13')), (13, ('38.15', '15.35')), (14, ('37.51', '15.17')), (15, ('35.49', '14.32')), (16, ('39.36', '19.56'))]

As an addon you plot the cities with matplotlib and the current rout

tsplib-python-parser's People

Contributors

tsartsaris avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.