« Android - Placing random game configurations - part 2 | Main | Android - Application »

Android - Placing random game configurations!

In a combinatorial game design to be played by users, one basic step is to generate random configurations and place them on the board. I thought it would be not so difficult to handle that, since I know how to generate random configurations of those games and output the numbers to signify or if you will, map the output set to a specific game configuration...

In first attempt, I was trying to generate random tree edges using some published source code. Since my past life ( 20 or so years ago ), I was dealing mainly with graphs and networks, I can still use the knowledge to bootstrap the process, and as expected I was able to generate random graph with specific properties that each instance is a tree. There is no forest, and no cycles.

Now when I tried to place ( or rather draw it on computer's drawing surface ) using program modules that I wrote, I found that it is a complex problem to place even a tree with 20 nodes without crossing edges, and without having a visually unpleasant outcome...  Though I had the feeling that I would be in trouble, since it is a powerful geometric problem, and once again my whatever little computational geometry background telling me that I'm about to face a huge problem placing random tree on a drawing canvas.

Though there are variations of this problem declared as NP-HARD, the problem I was trying to deal with seems to have a O(n) solution. It's an old problem, and has history by itself. Currently I'm trying to absorb the article and the algorithm written by John Q. Walker II. It was published in Dr. Dobb's journal.

Once I write this algorithm using Java, and get the graph placement working I will start analyzing the mathematical properties of those games, well of course, using some of the books written on them.

 

Posted on Thursday, October 1, 2009 at 10:35AM by Registered CommenterProkash Sinha | CommentsPost a Comment

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.