All Projects → rellermeyer → 99tsp

rellermeyer / 99tsp

Licence: bsd-3-clause
The 99 Traveling Salespeople Project

Labels

Projects that are alternatives of or similar to 99tsp

Fftdemo
A demonstration showing how several components can be compsed to build a simulated spectrogram
Stars: ✭ 23 (+9.52%)
Mutual labels:  verilog
Sha512
Verilog implementation of the SHA-512 hash function.
Stars: ✭ 10 (-52.38%)
Mutual labels:  verilog
Arty Glitcher
FPGA-based glitcher for the Digilent Arty FPGA development board.
Stars: ✭ 14 (-33.33%)
Mutual labels:  verilog
Ocpi
Semi-private RTL development upstream of OpenCPI - this is *not* the OpenCPI repo!
Stars: ✭ 24 (+14.29%)
Mutual labels:  verilog
Wb sdram ctrl
SDRAM controller with multiple wishbone slave ports
Stars: ✭ 9 (-57.14%)
Mutual labels:  verilog
Oberwolfach Explorations
collaboration on work in progress
Stars: ✭ 10 (-52.38%)
Mutual labels:  verilog
Tf530
tf530
Stars: ✭ 22 (+4.76%)
Mutual labels:  verilog
Can
CAN Protocol Controller
Stars: ✭ 20 (-4.76%)
Mutual labels:  verilog
Four Color Theorem Maintenance
Fixed FCT proof for latest coq and ssreflect
Stars: ✭ 9 (-57.14%)
Mutual labels:  verilog
Galaksija
Galaksija computer for FPGA
Stars: ✭ 13 (-38.1%)
Mutual labels:  verilog
Amiga2000 Gfxcard
MNT VA2000, an Open Source Amiga 2/3/4000 Graphics Card (Zorro II/III), written in Verilog
Stars: ✭ 942 (+4385.71%)
Mutual labels:  verilog
Indirectly Indexed 2d Ternary Content Addressable Memory Tcam
Modular SRAM-based indirectly-indexed 2D hierarchical-search Ternary Content Addressable Memory (II-2D-TCAM)
Stars: ✭ 9 (-57.14%)
Mutual labels:  verilog
G729 code
G.729 Encoder
Stars: ✭ 10 (-52.38%)
Mutual labels:  verilog
Aoocs
The OpenCores aoOCS SoC is a Wishbone compatible implementation of most of the Amiga Original Chip Set (OCS) and computer functionality. aoOCS is not related in any way with Minimig - it is a new and independent Amiga OCS implementation.
Stars: ✭ 23 (+9.52%)
Mutual labels:  verilog
Pitchshifter
Change the pitch of your voice in real-time!
Stars: ✭ 15 (-28.57%)
Mutual labels:  verilog
Cgragenerator
Stars: ✭ 22 (+4.76%)
Mutual labels:  verilog
80211scrambler
Tools for working with the 802.11B scrambler when writing Packet-in-Packet exploits.
Stars: ✭ 10 (-52.38%)
Mutual labels:  verilog
Verilog Osx
Barerbones OSX based Verilog simulation toolchain.
Stars: ✭ 21 (+0%)
Mutual labels:  verilog
Cs231n Project
CNN accelerator
Stars: ✭ 15 (-28.57%)
Mutual labels:  verilog
Ipxactexamplelib
Contains examples to start with Kactus2.
Stars: ✭ 12 (-42.86%)
Mutual labels:  verilog

The 99 Traveling Salespeople Project

The 99 Traveling Salespeople project is a project that aims to collect implementations of the Traveling Salesman from different programming languages that exist, practical or esoteric. The purpose of the collection is to illustrate the many differences among programming languages when implementing the same algorithm, in this case, the traveling salesman.

What is the Traveling Salesman Problem?

(adapted from Wikipedia)

You have a bunch of cities and a list of distances between the cities (if a path between the 2 exists). The task is to find a route that will do the following:

  • Visit every city exactly once
  • Returns to the city you started from
  • Returns the shortest possible route

The problem is NP-hard, basically meaning there isn't a polynomial time algorithm currently known that can produce a correct answer.

Algorithms

The following variations of the Traveling Salesman problem are currently available in this repository.

  • Greedy (greedy)
  • Linear Programming (lp)
  • Simulated Annealing (sa)
  • Genetic (gen)
  • Neural Network (neural)
  • 2-Opt (2opt)
  • Dynamic Programming

If more implementations are added, this list will be added to as well. Below are short descriptions of each implementation method. Note that the implementations contained in this repository may differ from these descriptions.

Greedy

A greedy solution, in general, is one that picks the "best" choice at every step in program execution in hope that it will produce the best (or a good) result at the end of execution.

A greedy implementation will simply grab the nearest neighbor from the current city at every step until all cities have been visited. The last city on the tour is the starting city, so the last step isn't necessarily greedy.

Linear Programming

The technique of linear programming to solve problems involves constructing linear equations that represent constraints on a problem and attempting to find the best answer possible under these constraints.

There exist a set of requirements that can be constructed for the traveling salesman problem that will result in an answer.

See Wikipedia for more information: https://en.wikipedia.org/wiki/Travelling_salesman_problem#Integer_linear_programming_formulation

Simulated Annealing

Simulated annealing will do "hill climbing" in that it will randomly make changes to the tour and accept the change if the change results in a better solution. If the change doesn't result in a better solution, then there is still a possibility that the change will be accepted for the next step. The probability of it being accepted is controlled by the current "temperature": the higher it is, the more of a chance it has to accept a "bad" change. Bad changes are accepted as they might let the program escape local optima in search of a global optima. The temperature of the program decreases as time passes, and when it reaches a specified point, execution stops and the solution is returned.

In terms of the traveling salesman, the random change would be to swap cities of an already existing tour in hope that it will produce a better tour.

Good Source (Please do not copy the Java source): http://www.theprojectspot.com/tutorial-post/simulated-annealing-algorithm-for-beginners/6

Genetic

A genetic algorithm has the concepts of a population with traits that can be "mutated" and/or "bred/crossover'd" in order to produce a new population. The members of a population are the solutions to the problem one is trying to solve. By selectively mutating and crossing over members with strong "fitness" (i.e. a good solution), the hope is to create populations that progressively get better and better until a good solution is found. In general, the more generations one has an algorithm run for, the better the results will be.

For the traveling salesman problem, the members of the populations would be tours, and one could do mutation/crossing over of good tours to produce new (and potentially better) tours as generations pass.

Good Source (Please do not copy the Java source): http://www.theprojectspot.com/tutorial-post/applying-a-genetic-algorithm-to-the-travelling-salesman-problem/5

Neural Network

Neural networks take some input and, depending on the weights on the edges of the network and other things one might add to it, an output is produced that usually corresponds to some desired result.

TODO

2-Opt

According to Wikipedia, 2-Opt was created specifically for the traveling salesman problem. The idea is to rearrange your path so that there is no "crossover", and this is done by reversing particular sections of your tour. This continues until you do not get a better path.

A complete 2-opt search will try all possible swaps for a particular tour, so the algorithm can potentially be extremely inefficient.

More details can be found here: https://en.wikipedia.org/wiki/2-opt

Dynamic Programming

TODO

Last update: November 30, 2016

Languages

The following languages and implementations are currently available on the repository.

Bolded languages are pending implementation/examination (Fall 2016).

  • C
    • Greedy
    • Simulated Annealing
  • C++
    • Greedy
    • Simulated Annealing
  • Clingo
    • Greedy
  • Go
    • Greedy
    • Simulated Annealing
  • Groovy
    • Greedy
  • Haskell
    • Greedy
  • Java
    • Greedy
    • Simulated Annealing
    • Dynamic Programming
  • Javascript
    • Greedy
    • Genetic
  • Julia
    • Greedy
  • Kotlin
    • Greedy
  • Lisp
    • Greedy
  • Matlab
    • Linear (Integer) Programming
    • Greedy
  • Objective C
    • Greedy
  • Perl
    • Greedy
  • Prolog
    • Simulated Annealing
  • Python
    • Greedy
    • Genetic
    • Simulated Annealing
    • Neural
    • 2-Opt
    • Dynamic Programming
  • R
    • Greedy
  • Ruby
    • Greedy
  • Rust
    • 2-Opt
  • Scala
    • Greedy
    • Genetic
  • Swift
    • Genetic
  • Verilog
    • Simulated Annealing
  • Visual Basic
    • Greedy

Last update: January 2, 2017

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].