It is currently Tue Jul 02, 2024 1:39 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 4:48 pm  (#21) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
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 1936 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 4:53 pm  (#22) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
How are you running the triangulation via TSP? I didnt see it offered on the TSP website.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 5:02 pm  (#23) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
Under the edges menu Mahvin. :)


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

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 5:11 pm  (#24) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Oh I see, you're running it via Windows. Not sure how to get there via terminal, I'll check.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 5:44 pm  (#25) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Lyle, how are you generating your tsp files? Just curious, because I can't seem to find the documentation on it.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 5:59 pm  (#26) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
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

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:01 pm  (#27) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Ahhhhh, that helps. Thanks for the tip! :)

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:22 pm  (#28) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
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).

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Last edited by mahvin on Fri Feb 11, 2011 6:26 pm, edited 1 time in total.

Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:24 pm  (#29) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
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). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:43 pm  (#30) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Found them at root /tmp. <Smacks head> Was looking in the wrong place...

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:51 pm  (#31) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
It never ends, lol. All my output files are empty. Man, solve one thing, another pops up, oh joy!

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:52 pm  (#32) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
Strange; did you put the # in the right place? They shouldn't be empty. At least you are able to port SVG result. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 6:56 pm  (#33) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
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.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 7:25 pm  (#34) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
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. ;)

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 8:01 pm  (#35) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
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.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 8:28 pm  (#36) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
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. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 8:32 pm  (#37) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
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.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 8:42 pm  (#38) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
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. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 8:44 pm  (#39) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Yes, it has that option, but I don't see the command for using it the "correct" way. Still reading, and more reading.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Fri Feb 11, 2011 10:49 pm  (#40) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
My Delauney Triangulation...

Image

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) The Traveling Salesman revisited.

4



* Login  



Powered by phpBB3 © phpBB Group