I want to print a board for Scotland Yard, a graph-based board game with 200 nodes and many edges (each edge can be of 3 different colors). The board looks like this:

enter image description here

If I want to programmatically draw a board for this game, I'll need the following features:

  • Colors, nodes should be able to be multiple colors (e.g. orange circle inside teal rectangle)
  • Ability to make edges and nodes very bold / thick
  • Deals well with clutter (maybe I could set via a parameter how spaced-out the nodes would be in the rendering)
  • Library in one of C, C++, Python, or Java
  • Free as in beer

All signs are pointing to graphviz as the most popular such library, my questions for someone who has used graphviz are:

  1. Does graphviz support the features I want?
  2. Which programming language has the easiest graphviz libraries to use?
  3. What other graph-drawing libraries meet these requirements?
  • 1
    The one requirement that is difficult to do in graphviz is one that you don't mention - edges should follow the not necessarily straight road markings on the underlying street map image - unless you are generating that programmatically also. Jan 6 '15 at 5:54
  • 1
    Right, I'm willing to waive that requirement if I can get the other stuff working. It might actually be less visually confusing (though not as pretty) if the buses and underground don't follow the same roads the taxis take. Jan 7 '15 at 19:53
  • Did you ever find a solution? Jul 30 '19 at 11:53
  • 1
    @mawg It turns out to be too many nodes and edges for graphviz to handle gracefully (i.e. it looks bad), but it did reveal some interesting things about which areas have more connectivity than others... Jul 30 '19 at 13:22
  • 1
    Played around with some code here: bitbucket.org/turbulencetoo/stomp-the-yard/src/master Jul 30 '19 at 13:24

I have written something similar to this in Java using a HashMap where essentialy the key is a Place and the value is an ArrayList of Places so it makes a kind of graph structure. Probably not the most efficient way of doing things but defiently works when trying to make a quick and easy to use

  • 1
    Ok, but to make your software usable, you would need to provide a link to it.
    – peterh
    Jan 1 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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