traveling salesman problem – THE HYPERTEXT http://www.thehypertext.com Thu, 10 Dec 2015 06:10:15 +0000 en-US hourly 1 https://wordpress.org/?v=5.0.4 Traveler’s Lamp, Part II http://www.thehypertext.com/2015/05/08/travelers-lamp-part-ii/ http://www.thehypertext.com/2015/05/08/travelers-lamp-part-ii/#comments Fri, 08 May 2015 22:51:42 +0000 http://www.thehypertext.com/?p=560 Last week, Joanna Wrzaszczyk and I completed the first version of our dynamic light sculpture, inspired by Italo Calvino's Invisible Cities and the Traveling Salesman Problem.

Read More...

]]>
Click Here for Part I



Last week, Joanna Wrzaszczyk and I completed the first version of our dynamic light sculpture, inspired by Italo Calvino’s Invisible Cities and the Traveling Salesman Problem. We have decided to call it the Traveler’s Lamp.

Here is the midterm presentation that Joanna and I delivered in March:

Screen Shot 2015-05-08 at 6.26.53 PM

We received a lot of feedback after that presentation, which resulted in a number of revisions to the lamp’s overall design. Here are some sketches I made during that process:

2111_20150508_doc_1800px

2112_20150508_doc_1800px

2113_20150508_doc_1800px

2114_20150508_doc_1800px

2115_20150508_doc_1800px

2116_20150508_doc_1800px

2120_20150508_doc_1800px

2121_20150508_doc_1800px

Since that presentation, Joanna and I successfully designed and printed ten city-nodes for the lamp. Here is the deck from our final presentation, which contains renderings of all the city-nodes:

Screen Shot 2015-05-08 at 6.27.46 PM

We built the structure from laser-cut acrylic, fishing line, and 38-gauge wire. The top and base plates of the acrylic scaffolding are laser etched with the first and last page, respectively, from Invisible Cities. We fabricated the wood base on ITP’s CNC router from 3/4″ plywood.

Here are some photos of the assembled lamp:

5865_20150507_lamp_2400px

5846_20150507_lamp_2400px

5870_20150507_lamp_2400px

5877_20150507_lamp_2400px

5885_20150507_lamp_2400px

5887_20150507_lamp_2400px

5899_20150507_lamp_2400px

5901_20150507_lamp_2400px

5902_20150507_lamp_2400px

5920_20150507_lamp_2400px

5929_20150507_lamp_2400px

5965_20150507_lamp_2400px

5961_20150507_lamp_2400px

5947_20150507_lamp_2400px

5941_20150507_lamp_2400px

5931_20150507_lamp_2400px

Here’s a sketch, by Joanna, of the x-y-z coordinate plot that we fed into the computer program:

2122_20150508_doc_1800px

And finally, here’s some of the Python code that’s running on the Raspberry Pi:

def tsp():
    startingPin = random.choice(pins)
    pins.remove(startingPin)
    GPIO.output(startingPin, True)
    sleep(0.5)
    distances = []
    for i in range(pins):
        for p in pins:
            dist = distance(locDict[startingPin], locDict[p])
            distances.append((dist, p))
            GPIO.output(p, True)
            sleep(0.5)
            GPIO.output(p, False)
        distances = sorted(distances, key=lambda x: x[0])
        nextPin = distances[0][1]
        GPIO.output(nextPin, True)
        sleep(0.5)
        pins.remove(nextPin)
        startingPin = nextPin

]]>
http://www.thehypertext.com/2015/05/08/travelers-lamp-part-ii/feed/ 1
Traveler’s Lamp http://www.thehypertext.com/2015/02/21/invisible-salesman/ http://www.thehypertext.com/2015/02/21/invisible-salesman/#comments Sat, 21 Feb 2015 20:40:39 +0000 http://www.thehypertext.com/?p=452 For my primary project in Sculpting Data into Everyday Objects with Esther Cheung and Scott Leinweber, Joanna Wrzaszczyk and I will be creating a lamp to visualize the traveling salesman problem between a set of cities that Italo Calvino described in Invisible Cities.

Read More...

]]>
For my primary project in Sculpting Data into Everyday Objects with Esther Cheung and Scott Leinweber, Joanna Wrzaszczyk and I will be creating a lamp to visualize the traveling salesman problem between a set of cities that Italo Calvino described in Invisible Cities.

This project began with a personal fascination I have with graph data. A graph is a mathematical diagram of connections between various vertices (a.k.a. nodes) and edges (a.k.a.). They can be directed (meaning the edges point in specific directions) or undirected, and generally look like this:

credit: mathinsight.org

credit: mathinsight.org

Graphs are widely applicable data structures, relevant to a broad range of fields. The traveling salesman problem (TSP), in its classical form, involves a set of cities along with data comprising the distance from each city to every other city. Given a salesman who starts in any given city, what is the optimal path for the salesman to take in order to visit every city once and return to the city from which s/he began?

The lamp Joanna and I are designing will be a three-dimensional set of vertices, each a 3D printed city designed according to the specifications of one of Calvino’s Invisible Cities. The cities/vertices will be connected with light pipe, connected to LEDs, that will visualize a computer algorithm (likely running on an Arduino or Raspberry Pi) solving the traveling salesman problem in real time between the cities.

We plan to print our cities on the Connex500 printer at NYU AMS as intricate white or black structures embedded inside clear plastic. The Connex500 can make prints like this:

credit: 3ders.org

credit: 3ders.org

We plan to make our cities inside spheres. I designed the first one based on the first city in the book, described here:

Leaving there and proceeding for three days toward

the east, you reach Diomira, a city with sixty silver

domes, bronze statues of all the gods, streets paved

with lead, a crystal theater, a golden cock that crows

each morning on a tower. All these beauties will already

be familiar to the visitor, who has seen them

also in other cities. But the special quality of this

city for the man who arrives there on a September

evening, when the days are growing shorter and the

multicolored lamps are lighted all at once at the

doors of the food stalls and from a terrace a woman’s

voice cries ooh!, is that he feels envy toward those

who now believe they have once before lived an evening

identical to this and who think they were

happy, that time.

 

I focused on the description of “sixty silver domes” and made this in Rhino:

Screen Shot 2015-02-20 at 11.47.38 PM Screen Shot 2015-02-20 at 11.46.17 PM Screen Shot 2015-02-20 at 11.45.50 PM Screen Shot 2015-02-20 at 11.45.39 PM Screen Shot 2015-02-20 at 11.45.01 PM

The model of a 4cm-diameter sphere contains two holes: one on the top for an LED or light pipe connection, and one going all the way through to hang the city inside a clear outer enclosure.

Before creating the city above, I created another object in Rhino, representative of what I hope we can achieve with the lamp as a whole:

Screen Shot 2015-02-11 at 11.33.04 PM Screen Shot 2015-02-11 at 11.32.58 PM Screen Shot 2015-02-11 at 11.32.51 PM

 


 

Click Here for Part II

]]>
http://www.thehypertext.com/2015/02/21/invisible-salesman/feed/ 1