GIMP Chat
http://gimpchat.com/

The Traveling Salesman problem.
http://gimpchat.com/viewtopic.php?f=22&t=1128
Page 2 of 4

Author:  lylejk [ Fri Feb 11, 2011 4:48 pm ]
Post subject:  Re: The Traveling Salesman problem.

Delaunay Triangulation


Just a variant of the Traveling Salesman problem. Outputted this from Concorde and used G'MIC's Skeleton preset to thin out the lines more (maybe didn't have too, but decided too). Now you all know I'm officially on a binge (a TSP binge). lol

:)

ref: http://www.fontplay.com/freephotos/seve ... 107-03.jpg

Attachments:
fp021107-03.png
fp021107-03.png [ 254.16 KiB | Viewed 1952 times ]

Author:  mahvin [ Fri Feb 11, 2011 4:53 pm ]
Post subject:  Re: The Traveling Salesman problem.

How are you running the triangulation via TSP? I didnt see it offered on the TSP website.

Author:  lylejk [ Fri Feb 11, 2011 5:02 pm ]
Post subject:  Re: The Traveling Salesman problem.

Under the edges menu Mahvin. :)

Attachments:
underedges.png
underedges.png [ 105.71 KiB | Viewed 1950 times ]

Author:  mahvin [ Fri Feb 11, 2011 5:11 pm ]
Post subject:  Re: The Traveling Salesman problem.

Oh I see, you're running it via Windows. Not sure how to get there via terminal, I'll check.

Author:  mahvin [ Fri Feb 11, 2011 5:44 pm ]
Post subject:  Re: The Traveling Salesman problem.

Lyle, how are you generating your tsp files? Just curious, because I can't seem to find the documentation on it.

Author:  lylejk [ Fri Feb 11, 2011 5:59 pm ]
Post subject:  Re: The Traveling Salesman problem.

The python program generates this Mahvin. I put a # (ignore) where it would be deleted so it won't get deleted. Here's that part of the code.

# Remove the temporary TSPLIB file
# os.unlink(tspfile)


Here's the drag and drop batch file that I created; when I drag the pbm file on to it (a shortcut on my desktop; the batch file itself is located where the python scripts are located) the TSP file automatically shows up on my desktop; how cool is that. :)

tspart.py %1

Author:  mahvin [ Fri Feb 11, 2011 6:01 pm ]
Post subject:  Re: The Traveling Salesman problem.

Ahhhhh, that helps. Thanks for the tip! :)

Author:  mahvin [ Fri Feb 11, 2011 6:22 pm ]
Post subject:  Re: The Traveling Salesman problem.

Where is it storing the tsp file on your system, I can't seem to find where its storing the temp file, not even in temp folder? Hmmmm... not on my desktop, reading the tspart.py (must be an OS thing).

Author:  lylejk [ Fri Feb 11, 2011 6:24 pm ]
Post subject:  Re: The Traveling Salesman problem.

Before the drag and drop, when I ran it at the command prompt itself, it stored the file in my user\AppData\Local\Temp directory. Again, since I started using the batch file, it stores it on my desktop (much better place for it imo). :)

Author:  mahvin [ Fri Feb 11, 2011 6:43 pm ]
Post subject:  Re: The Traveling Salesman problem.

Found them at root /tmp. <Smacks head> Was looking in the wrong place...

Author:  mahvin [ Fri Feb 11, 2011 6:51 pm ]
Post subject:  Re: The Traveling Salesman problem.

It never ends, lol. All my output files are empty. Man, solve one thing, another pops up, oh joy!

Author:  lylejk [ Fri Feb 11, 2011 6:52 pm ]
Post subject:  Re: The Traveling Salesman problem.

Strange; did you put the # in the right place? They shouldn't be empty. At least you are able to port SVG result. lol

:)

Author:  mahvin [ Fri Feb 11, 2011 6:56 pm ]
Post subject:  Re: The Traveling Salesman problem.

No, different problem. I found the temp tsp files in root /tmp, they open fine, but when I perform new computations on them in concorde, whatever output I save them to, they open empty in both Inkscape and GIMP.

Rephrase: when attempting to open the files saved from Concorde, GIMP and Inkscape throws an error saying files are blank.

Author:  lylejk [ Fri Feb 11, 2011 7:25 pm ]
Post subject:  Re: The Traveling Salesman problem.

the tsp file is just a text file; I have no idea why it's empty for you Mahvin. Might be an Ubuntu thing. Oh well; win some/loose some. Now it's your challenge to figure it out. lol

Now you can get some sleep first. ;)

:)

Author:  mahvin [ Fri Feb 11, 2011 8:01 pm ]
Post subject:  Re: The Traveling Salesman problem.

Like you said, it's text. But not in the format where GIMP or Inkscape can read them. Makes no difference what image extension you give them. Apparently I wasn't understanding how the files were being output (I thought they were being graphically recalculated), but the reality it was Concorde was just pointing out the new nodes/placement in text format. I have a lot to learn.

Author:  lylejk [ Fri Feb 11, 2011 8:28 pm ]
Post subject:  Re: The Traveling Salesman problem.

Yeah; TSP is proprietary to Concorde. You should be able to install Windows Concorde via Wine, but I have to admit I have not tried this. :)

Author:  mahvin [ Fri Feb 11, 2011 8:32 pm ]
Post subject:  Re: The Traveling Salesman problem.

I just did, works ok, but the output still is just raw text. I was hoping for a more detailed image output that I can work with. The viewer within Concorde isn't suitable for taking screenshots, unless you want to combine several images into one.

Author:  lylejk [ Fri Feb 11, 2011 8:42 pm ]
Post subject:  Re: The Traveling Salesman problem.

lol; you got that right unfortunately. It's the only way I can do this currently, but not hard to use Potrace to clean things up. You use what you can. Not sure if the command version is able to use the edge option, but it should be. :)

Author:  mahvin [ Fri Feb 11, 2011 8:44 pm ]
Post subject:  Re: The Traveling Salesman problem.

Yes, it has that option, but I don't see the command for using it the "correct" way. Still reading, and more reading.

Author:  mahvin [ Fri Feb 11, 2011 10:49 pm ]
Post subject:  Re: The Traveling Salesman problem.

My Delauney Triangulation...

Image

Page 2 of 4 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/