# Good programs for drawing graphs ( directed weighted graphs )

Hi, does anyone know of a good program for drawing directed weighted graphs?

Thanks

-
What do you mean by "drawing weighted graphs"? That is, what is the significance of the weights? Edge labels? –  Igor Rivin Feb 12 '11 at 14:46
Question is imprecise: does the OP want a program that will produce an automatically generated pleasing layout of a graph on the screen? Or a program to interactively manipulate a displayed graph? Or a program to create a diagram for inclusion in a published paper when the actual layout is already known? –  Gordon Royle Dec 17 '11 at 2:23
@GordonRoyle Of course, ideally one would like to have a program that would automatically generate a pleasing layout which you can then interactively manipulate and export so you can easily include it in your paper. –  Vít Tuček Oct 8 at 9:24

Try Sage - it's open source and can draw weighted directed graphs. For example:

A = random_matrix(ZZ,6, density=0.5)
G = DiGraph(A, format='weighted_adjacency_matrix')  # graph from matrix
H = G.plot(edge_labels=True, graph_border=True)
H.show()             # display on screen
H.save('graph.pdf')  # save plot to vector pdf for inclusion in a paper
-
By the way, Sage uses NetworkX, which was mentioned in another answer. –  William Stein Feb 12 '11 at 18:43
You can also use NetworkX directly within Sage to have more control over your plotting options. (Sage's Graph class is a wrapper which hides a lot of functionality and is not compatible with the advanced plotting tools.) –  Derrick Stolee Feb 13 '11 at 14:44

Try Graphviz - it's open source and quite flexible as far as usage is concerned.

http://www.graphviz.org/

It's good at automatic layouts etc, where for example Maple would make a mess of things.

-

Check out PGF/tikZ, which is freely available, and interacts extremely well with TeX and LaTeX.

You can find examples here, examples of graphs here, and a nice manual here.

A nice feature of the examples web page is that you can click on each example to get access to the code, which you can then copy-and-paste into your own LaTeX file, and then modify for your own purposes.

-

Mathematica is quite good these days and exports in a bazillion formats.

-
Yup. It makes a great, and often successful, effort at picking an embedding showing relevant features. –  Mariano Suárez-Alvarez Feb 13 '11 at 1:36
As an illustration - the graph in this post, the two-line code is there too. I did not need weights there, but they can be very easily incorporated. –  მამუკა ჯიბლაძე 17 hours ago

To supplement William Stein's useful answer, here is a graph produced by running the code he displays:

-

I love TikZ. It is a very sophisticated LaTeX package from the same author who wrote Beamer. It takes a bit of getting used to, but once you have your collection of examples, it is extremely efficient and produces very clean-looking and portable graphics. See www.hairer.org/Archive.zip for a few examples.

-

Try programming in R for various types of Graphs and Data Analysis. The R Graphs Cookbook is an essential.

You'll find it here.

-

you can use $newgraph-1.1.3$ for drawing and analysis every graphs. It is very good free software.

-

a directed graph example

-

Very simple, and easy to use for small graphs: GraphThing. It is in Ubuntu repositories. Here is home page: http://graph.seul.org/ It even computes some simple parameters.

-

I have used CaGe for some basic planar graphs.

-

https://networkx.lanl.gov/trac has a lot of options

-

Visual Studio has a powerful Directed Graph document (dgml) creator and viewer. It is highly configurable with styles / legend etc. but if you want to generate graphs from a data model it is quite good but there is a bit of a learning curve. I believe (don't quote me on this) that the free versions of Visual Studio do have support for it.

Disclaimer: I work on features for Visual Studio close to this;

-

Paul Gastin (LSV, Cachan), developed a package named GasTeX in order to simplify graphs and automata designing in TeX.

Further informations, documentation and CTAN links on http://www.lsv.ens-cachan.fr/~gastin/gastex/

Hope it will be of any use.

-

GrafEq is light yet usable, it specializes on drawing 'doggy' ones with the lines become really dense. And it's totally free.

-