Tech Talk

Linux, Python, E51, Scripting…

Posts Tagged ‘Graph

From python to C(pp)

with 2 comments

A directed graph.

Image via Wikipedia

Yesterday was big disappointment. My python code was taking just too long to process a graph of about 30000 nodes and 80000 edges. Actually, it was taking more than an hour to just construct it. After that I have a bunch of algorithms to run on it. And this graph is generated from a sample graph of about 1024 nodes and edges. But in reality I need to run the whole thing against an initial graph of 20000 nodes. The whole thing just doesn’t sound to work. There are two possibilities: First is my code could be dirty; Or python does not do my kind of work very well. I can’t say anything about python until I have cleared my code to be the best. But I don’t have the time to invest here, since all this is just paths to my actual work, and my work is elsewhere!

So, the other choice is to code the whole thing in C/C++. Actually it should be C, because I am not a particular fan on C++. But given the time constraints, I just may have to go with C++. The reason is simple. I want something like STL to hasten my job and not worry about performance. I simply don’t see any such library for C. There are some ways to use STL with C, I guess. So, C++ it is. I should probably spend some time and write STL like library for C or at least spend some time to see if somebody is already doing the job. Anybody knows some good library for C, please leave a comment. Yeah, and don’t bother asking why I am not a fan of C++. I wouldn’t bother to reply.

Zemanta Pixie

Written by abiya

June 13, 2008 at 4:11 am

Posted in c, python, technical

Tagged with ,