valdirunars / held-karp Goto Github PK
View Code? Open in Web Editor NEWThis project forked from carlekerot/held-karp
A pure-Python Held-Karp implementation
License: MIT License
This project forked from carlekerot/held-karp
A pure-Python Held-Karp implementation
License: MIT License
Held-Karp ========= Implementation of [Held-Karp](https://en.wikipedia.org/wiki/Held-Karp_algorithm), an algorithm that solves the Traveling Salesman Problem using dynamic programming with memoization. Held-Karp solves the problem by calculating lowest cost on subsets of the larger problem, and re-uses the intermediate results. Its runtime is O(n^2 * 2^n), and it requires O(2^n * n) space. Usage ----- The implementation comes with a distance matrix generator taking an input size: $ python held-karp.py 5 0 49 34 96 74 49 0 10 94 43 34 10 0 21 6 96 94 21 0 70 74 43 6 70 0 (215, [0, 3, 2, 4, 1]) It is also possible to supply a distance matrix in a CSV format: $ python held-karp.py ex.csv 0 2 9 10 1 0 6 4 15 7 0 8 6 3 12 0 (21, [0, 2, 3, 1])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.