Switch to full style
Open source and other free graphics applications
Post a reply

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 4:48 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 4:53 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 5:02 pm

Under the edges menu Mahvin. :)

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 5:11 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 5:44 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 5:59 pm

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.

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. :)

Code:
tspart.py %1

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:01 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:22 pm

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).

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:24 pm

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). :)

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:43 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:51 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:52 pm

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

:)

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 6:56 pm

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.

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 7:25 pm

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. ;)

:)

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 8:01 pm

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.

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 8:28 pm

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. :)

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 8:32 pm

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.

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 8:42 pm

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. :)

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 8:44 pm

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

Re: The Traveling Salesman problem.

Fri Feb 11, 2011 10:49 pm

My Delauney Triangulation...

Image
Post a reply