Take the 2-minute tour ×

Does C language have to automatic generate some weight graph library? and can automatic list in array or some data structure? Just like the JAVA's jgrapht library http://www.jgrapht.org/

share|improve this question

closed as not a real question by Let_Me_Be, Paul R, jman, Jeff Mercado, mauris Dec 12 '11 at 13:34


You are looking for a C library implementing some graph-theoretical algorithms; but it is a library, the standard C language don't provide them... (it only provides standard C library functions like malloc and printf). –  Basile Starynkevitch Dec 11 '11 at 17:56
Please rewrite your question into proper sentences. It is hard to determine what you are asking. –  Let_Me_Be Dec 11 '11 at 17:57
sorry,i am looking for some library for "standard C language" that provide to generate some unweight graph (maybe 50~100) then i can do some calculate(shortest path...etc) and i know the JAVA has provide this kind of library(jgrapht.org/),but i can't find that in C –  user1092518 Dec 11 '11 at 18:06
The "standard c language" is a very small, very simple thing. It does not provide the wealth of rich behavior provided by java or python (or indeed most more recent languages). What you are looking for is a library written in or for c that provides support for graphs. These exist (for instance What are some quality graph libraries for C? ), but you will get a better response if you edit you question (edit, not just comment!) to use more standard language. –  dmckee Dec 11 '11 at 21:54
add comment

2 Answers

While this answer may seem pedantic, it is quite important, and understanding it will make you understand the difference between 'layers' of software, which manifest themselves in f.i. kernel-space, user-space, interpretation-space.. understanding these layers will make you an immensely better programmer:

There is nothing in standard C that says anything about graphs. C does not specify how you implement graphs, so it does not specify how any libraries should implement them (i.e; what primitive datatypes could be used to model graphs with). The same counts for Java really.

Try the igraph or cgraph libraries, they are fairly well known and cross-platform.

share|improve this answer
Indeed it is pedantic, the lack of precision you see in the question is probably just a language problem. In such a case it would be more appropriate to first clarifying this with the OP and then to edit his question eventually. –  Jens Gustedt Dec 11 '11 at 19:24
add comment

Have a look in the section "C Libraries" on Graphviz

share|improve this answer
add comment
