You may also consult the Project Page and the Interactive Session Tutorial.
TSP_PictureMaker
is a module library for converting a picture to a a depiction created by an approximate solution
to the Travelling Salesman Problem (TSP). As an example, the code in example.py
takes the following picture of a tiger's head:
and converts it to the following picture
The process to make the final picture are as follows:
An example of using the functions to convert tigerHeadResize.png into a TSP picture.
The name of the package is tsp_draw
. It contains the following modules:
Class and functions for applying dithering to an image.
Functions for plotting results, saving images, and preprocessing of input images.
Functions for dealing with running batches of the annealing steps for different types of annealers.
Contains annealer that uses k-nearest neighbors as vertex pool.
Functions for getting the vertices from the dithered image and for preprocessing them, including the initial greedy guess.
Contains annealer that uses a vertex pool based on a lower bound of the distance to the either of the vertex's initial neighbors in the initial cycle.
For a discussion of how the process works, please see this blog post by Matthew McGonagle.