It is currently Thu Mar 28, 2024 7:02 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: Sat Feb 12, 2011 6:46 pm  (#51) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12513
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: 4039
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: 12513
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: 4039
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: 12513
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: 12513
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: 4039
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: 12513
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: 4039
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 subject: Re: The Traveling Salesman problem.
PostPosted: Sat Sep 24, 2011 12:44 am  (#61) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12513
Just remember on the burn layer to lower to opacity as well to 10 or 20; don't wan't the black to be too dark. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Sat Sep 24, 2011 8:42 am  (#62) 
Offline
GimpChat Member
User avatar

Joined: Oct 29, 2010
Posts: 711
Location: Netherlands
Try Gentoo mahvin.
http://www.gentoo.org/
It'll teach you more about Linux than any other distro.
Installing is a lot more work than a "pointy clicky" distro though.
Gerard.

_________________
Gentoo Linux always up-to-date.
Kernel-3.17.4 Python-2.7.8/3.3.5
Gimp-2.8.14

I use Linux only.
And Virtualbox with Win 7


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 4:25 pm  (#63) 
Offline
New Member

Joined: Feb 27, 2012
Posts: 3
Hi guys,

Great info in this thread. Sorry to revive such an old thread (1 year old exactly)! I'm having a problem getting all of this to work on my Win XP machine.

I installed Concorde and that runs fine. I installed Cygwin and then downloaded Linkern.exe from Concorde's site. I keep getting an error when I try to run Linkern.exe

I don't know much about Linkern.exe, but I assume it relies on Cygwin. I installed the latest version of Cygwin and receive the error. Is anyone else receiving this same error? Is there a way to install an older version of Cygwin or something, to get this to work?

I did the code hacks that Lyle mentioned, and even with the errors, I can still get an outputted TSP file. I can use that file within Concorde at least. I'm just trying to get Linkern.exe to at least work.


Attachments:
File comment: Linkern.exe error
linkern.JPG
linkern.JPG [ 34.83 KiB | Viewed 1819 times ]
Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 4:50 pm  (#64) 
Offline
New Member

Joined: Feb 27, 2012
Posts: 3
The above screenshot is when I just try to run Linkern.exe directly.

Here is the screenshot I get when I try to run tspart.py. As you can see, it never generates a tour file, so I never get an SVG output.

I can take the TSP file and dump that into Concorde and get something to work with, but it's not as quick and easy.

Does anyone have any suggestions for getting Linkern.exe to work on my Win XP machine? Any idea what version Cygwin I may need or any other ideas?

Thank you


Attachments:
linkern2.JPG
linkern2.JPG [ 52.61 KiB | Viewed 1817 times ]
Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 5:37 pm  (#65) 
Offline
GimpChat Member
User avatar

Joined: Apr 27, 2010
Posts: 1453
Location: Sweden
Image
From XKCD. Couldn't resist. :D
.
Griatch

_________________


Last edited by Griatch on Mon Feb 27, 2012 6:23 pm, edited 1 time in total.

Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 5:43 pm  (#66) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
cute

_________________
Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 6:16 pm  (#67) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
lol nice griatch

_________________
Image
I'm back I think


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 7:19 pm  (#68) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12513
lol; way too funny Griatch.

I have no way to address your issue SnyperBob since I'm no coder. just remember that you have to create your file paths using the 2 bars instead of one {see the example below}. :)

LINKERN = 'C:\\cygwin\\bin\\linkern.exe'

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 11:21 pm  (#69) 
Offline
New Member

Joined: Feb 27, 2012
Posts: 3
Hi Lyle,

Thank you soooo much for your reply! I knew to use the \\ in the path....BUT

I had linkern.exe located here: C:\\linkern.exe

My PY file was set to this location but it would just not work. I moved linkern.exe instead to here:
C:\\cygwin\\bin\\linkern.exe
After updating the PY files to the new path, it now works great!

I don't know why it doesn't work outside of the bin location. I'm guessing this is some programming thing that is obvious to someone that knows Cygwin or programming.

Any way, I wanted to thank you for indirectly pointing me in the right path! Now I can generate SVG files from the simple scripts. Awesome. Thanks again


Top
 Post subject: Re: The Traveling Salesman problem.
PostPosted: Mon Feb 27, 2012 11:38 pm  (#70) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12513
Now I envy you since I can't upload files right now (other then type messages and figlets; lol). Now show us some of your stuff. :)

_________________
Lyle

Psalm 109:8

Image


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