Search code examples
performancegraphprogramming-languages

What language would be more efficient to implement a graph library?


Brief Description

I have a college work where I have to implement a graph library (I'll have to give a presentation about this work later)

The basic idea is to write all the code of the data structures and their algorithms from scratch, using the tools provided by some programming language, like C/C++, Java, Python, doesn't really matter which one of them I'll pick at first.

But I should not use any built-in graph libraries in the language: the goal of the work is to make the students learn how these algorithms work. There are some test cases which my program will be later submitted to.

It is not really necessary but, if you wanna take a look, here is the homework assignment: http://pastebin.com/GdtvMTMR (I used Control-C Control-V plus google translate from a LaTeX text, this is why the formatting is poor).

The Question

So, my question is: which programming language would be more time efficient to implement this library?

It doesn't really matter if the language is functional, structured or object oriented. My priority is time efficiency and performance.


Solution

  • The better language is the one you know more.

    But if you're looking for some performance, take a look at compiled languages with optimisations. Keep in mind that the code you write is the major component responsible in final performance, the language itself cant do miracles.

    A more low level language give to you controls but requires deeply knowledge of the language and the machine you're running your code, so it's a tradeoff.

    By a personal choose I would recommend C/C++ to implement a graph library. I've already done this in the past and I used vanilla ANSI C and the performance was awesome.