Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SO I have made this program dealing with cities and the roads linking them, and I am wondering if anyone could point me towards a way to represent this "network" graphically (in 3 or 2Ds).

Could be either a specific programming friendly file format (which I could easily generate an instance of programatically), or a specific language's api or library for such representation.

My current work is in Java, but if there's a solution in an other language it's not a problem.

share|improve this question
C# has diagramming libraries like Nevron that you could use for this, though it's pricey and using it programmatically is a bit painful. There are probably some free libraries, too, but nothing very good last time I looked (which was about a year ago). – Adam Lear May 28 '11 at 16:03

Graphviz. It's free, open source and provides all the relevent theoretical background (mathematical underpinnings for sort order).

share|improve this answer
+1 graphviz is awesome – Gary Rowe May 29 '11 at 15:08

There are many graph formats available. For example, graph6.

Also, there are many softwares and algorithms available for drawing graphs. Graph drawing is one of the currently active research areas.

GraphViz, NetworkX(Python) are the ones I have tried myself and are very good.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.