It is currently Tue Jul 02, 2024 1:35 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 11:31 pm  (#41) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
If you did this using the command utility, care to share your settings Mahvin? Glad you got it to work. Might try to compile concorde Ubuntu this weekend. We shall see. Then again, I might try to track down the code for Organic Laborynths, but don't think I will have any luck on this arena. Hate to leave things alone (might have figured it out; lol). I also haven't really found a program to do Jigsaw Image Mosaics either and the University guys who created this don't seem to want to share their code; just their results. Bummer for me. Can just about fake it using Rob's random density map filter but still not quite there. :)

_________________
Lyle

Psalm 109:8

Image


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

Joined: Oct 06, 2010
Posts: 4050
Those are screenshots put together. I couldn't find the help for Concorde, it doesn't come up with the --help syntax, so...

In the UI, the command for triangulation is "d", I tried using that option as a flag in terminal, wasn't recognized.

_________________
"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 11:57 pm  (#43) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
lol; you do what I do. Yeah; the biggest one that I did required 4 screenshots (posted on another forum). It isn't hard to do though as you figured out. Still, your image makes for a good model for these effects. Not sure if you are using the stipple program from a few days ago. I think it's cool that you can resize all the points down to a 1X1 dot and keeper there center position the same in Inkscape. Still the light grey dither technique is good too and that's what these guys who shared the python scripts used for the samples shown, but they did mention advance techniques (didn't actually click, but assume they are using Secord's Stipple algorithm to do them. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 12:16 am  (#44) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
We're on the same wavelength, because I thought the same thing. I can create tsp files with linkern and open them in Concorde (I know you already know this, just showing how the workflow dead-ends, for other readers out there) and manipulate them in Concorde but can't output (x,y) or image graphics (which is a shame, really). I can do pbm files in GIMP and create SVG files using the same with the Concorde command line but can't use the Concorde UI (Windows version) to do the same with pbm files, weird heh? Somewhere I was reading that perhaps saving in DAT would give you a more accurate file, but outside of Concorde, what opens DAT files?

Then to really put a damper on things, the SVG files created by Concorde and opened in Inkscape have some sort of issue with the number of nodes (paths) within the file and won't allow you to copy/paste/import paths into GIMP (only parts of a group). A little bit of reading suggested using a smaller pbm file with fewer nodes, to see if that helped. I haven't done that yet, though.

So, yeah, you just learn to work with the tools you have, when you can't find your way via the programs. Hopefully these bright students who find time to work with/create these programs will allow us in more and more as they develop the code. I'm still kicking myself for shunning the larger math portions of my CIS education. As it appears now, it is far more interesting to work with.

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 12:33 am  (#45) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
I remember the college course that at the time thought was a waste (I was to be an Electrical Engineer, not a social worker; lol), but as I got older, I became more appreciative that I had taken some of those courses. So, I guess there was a method to those college professors madness. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 12:54 am  (#46) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Math makes BEAUTIFUL art! :)

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 3:28 am  (#47) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
Hey Mahvin. Concorde can export a tour file. I copied the TPS file and the Tour files into Excel and created xy cells where the x and y comes from the TPS file and the index comes from the Tour file. Now I can graph too without the stupid dots. lol

Of course I chose the smooth curve chart option. Anyway, I'm sure the Open Office spreedsheet program can do this too, so now you can use the Windows Concorde program and a spreedsheet to get the vector output that you want. Notice the open ends (entry and exit of curve) that I did not close up. :)


Attachments:
scurve.png
scurve.png [ 295.6 KiB | Viewed 1797 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 2:32 pm  (#48) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Lyle, do you mind sharing your Excel file. For some reason, indexing in OO Calc isn't working like it does in Excel. The (x, y) graph works, superbly, but the indexing results in an odd, inconsistent shape. I want to see how your Excel file will behave in OO Calc. If you don't mind.

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 5:29 pm  (#49) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
Just got back from my Bro's house (going to play Army for a few months; he should retire imo). Anyway, take a look at the xls file (does not include the graph; just the cell equations under x and y). :)


Attachments:
flower.zip [34.09 KiB]
Downloaded 138 times

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 5:38 pm  (#50) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Works just fine. Thanks, Lyle.

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 6:46 pm  (#51) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
By the way, I was able to (not the version that I showed earlier; used Irfanview as the serrogate then) paste the plot directly into Inkscape, ungroup, delete the background stuff and then save. Very cool indeed. Excel smoothing scatter plot option is definitely the bomb. Just did this baby doing just this (third version down; had to scale down since the original had the equivalent of 4000px wide; lol). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 6:52 pm  (#52) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Oh wow, that turned out really good. Can you give a step by step that process in a quick list? I don't have Ifranview, but was wondering how that would work out in XnView. I'll grab Irfanview if it comes right down to it.

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 6:52 pm  (#53) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
your baby is very cute Lyle, same hair do too........ :mrgreen:

_________________
Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 6:58 pm  (#54) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
mahvin wrote:
Oh wow, that turned out really good. Can you give a step by step that process in a quick list? I don't have Ifranview, but was wondering how that would work out in XnView. I'll grab Irfanview if it comes right down to it.


Irfanview can automatically turn vector content to bitmap with copy/paste. I just copy the graph, paste it into Irfanview, then copy it from Irfanview and Paste it into GIMP and do the cleanup in GIMP. I still prefer the vector route (using Inkscape). Copy and paste into Inkscape, set the pagesize to equal the image (Image size will be much bigger; trust me), ungroup and removed the junk (I do most of this in Excel but still the background and border has to be removed) and then save the SVG file and open it up in GIMP. Either way will work though. I'm now almost a Geek. lol

Yeah Molly; my hairs going fast (especially trying to figure all this stuff out the last few days; lol). Glad you liked the result too. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 8:46 pm  (#55) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Wow, 14k+ dots, and Open Office Calc is like all wonky (acting like it wants to crash). Guess I better lose some dots.

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Feb 12, 2011 8:59 pm  (#56) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
Sometimes you can go just too dotty Mahvin. So loose the dots already. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 21, 2011 12:17 am  (#57) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
The error in the Python script (tspart.py) was looking me in the eye and I just now figured this one out. If you are a Windows user, this will fix the script (and now the SVG file will be created; yea). Just go to this part of the code and change the path with the double slash (why python needs this is anyone's guess, but seen this with GIMP python scripts already and should have known; lol). Now you need to point the path to your Cygwin>Linkern file correctly; mine is as shown in the code example. Again, the trick is with the double slash (for Windows users of course). To be honest, I sort of like the Excel technique result better so I sort of am glad that the original script had the error. I remmed out the tps and tour deletion so now I have it all without having to run the Windows TPS program to create the tour so now I can also just use the TPS and Tour files and create the graphic in Excel. Man, pretty soon I will be a geek. lol

:)

# Path to the linkern executable
if sys.platform.lower() == 'win32':
   LINKERN = 'C:\\cygwin\\bin\\linkern.exe'

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 21, 2011 12:29 am  (#58) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
If I had a Gold Star sticker I would place it on your post for "Job Well Done". I've fixed Windows python files for Linux and vice-versa, many times in the past, but since I sort of left Windows for good, I don't bother to think of the different needs of each system, anymore.

Open Office Calc and Excel don't behave the same when graphing out the TSP. You can get very good results with smaller images, but larger ones tend to make OO Calc hang to the point of crashing.

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


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 21, 2011 1:37 pm  (#59) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
How much memory do you have Mahvin? My system has 6GBytes (64-bit Win7 OS). I've yet to have an issue using it, but the biggest file I've done was 15000 points (and the result wasn't worth it; lol). I definitely use the Voronoi Stippler/Inkscape technique outlined earlier for maximum quality with smaller point samples. I noticed that Open Office recently (like a few days ago) released 3.1. I've not re-installed OO since I upgraded my PC over a year ago. Heard of some good things about Libre Open Office, but haven't really thought about installing either since I do have Office 2003 (to me the last good Microsoft Office product; 2007 really does have issues imo and I'm not really a fan of ribbons. I've used a few programs like Wordpad that uses the ribbon interface idea; can't stand it. Anyway, sorry for deviating (tend to do that don't I. lol). I still wish I could get the gpu think to work with the stippler program (better to get Secord's ImagemagicK program to work, but he said he has no plans to update it and I'm no programmer). I'm not sure if I really will buy a video card come my b'day (feel better off just to hoard the cash right now) but hopefully, if I do get the card, that I will be able to use the GPU more. I know there was a SOC for GIMP that involved GPU acceleration, but it went no where. The GPU acceleration (Pixel Bender) for PS is buggy with my PC; stand-alone Pixel Bender (free by the way; was using it since CS2 didn't support Pixel Bender; anyone can use the stand-a-lone too which is cool) is buggy too. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Sep 24, 2011 12:29 am  (#60) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
4 gig in Office computer. Getting upgraded to 8 gig this week. Sorry I didn't reply to this 7 months ago! My laptop is maxed at 2 gig, so no changes there, unless I buy a new one. The GPU would be so much better, I agree. I went from OO to Libre, (still the same, btw). I'm looking forward to trying your new approach on the TSP.

The other two computers are both at 2 gig, but I only use them for testing new releases of Ubuntu. I'm getting an itch to try other distros, though.

_________________
"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