I'm pretty new to working with graphs but I'm looking at using them to create the world map for our game (a text mud with rooms/nodes and paths/edges between rooms). There are a number of interesting small-world generators, for example Watts-Strogatz (http://en.wikipedia.org/wiki/Watts_and_Strogatz_model) that I'd like to combine.

My question is how to combine different generators. All the rooms will have coordinates in an XY plane (the rooms themselves won't have real dimensions). I can easily generate a graph, and then laying it out I can work out the XY coordinates of its nodes. But then I'd like to generate a new graph and connect at least one of its nodes to a node on the previous graph.

My first idea is to figure out the XY bounding box of a graph, and use that to place it in the larger XY plane next to the previous graph (kind of tiling the graphs). Are there other methods I should be aware of?

  • More detail please? You can trivially join two graphs by sticking an edge between a random nodes from each. I assume you're looking for something more complex, but I don't understand what it is. – Anko Feb 21 '15 at 11:13
  • Maybe I should rephrase the question as 'How to combine embedded graphs in a finite XY plane'? So I have a fixed size 2D map and I'm generating graphs and embedding them there. – georgek Feb 22 '15 at 21:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.