227 Open Daily games
2 Open Realtime games
    Pages:   1   (1 in total)
  1. #1 / 13
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    I'm thinking about using the python NetworkX library to calculate statistics about the networks that wargear maps represent.  So for example, it could tell you which territories are most valuable from a network perspective.

     

    Primarily I want to do this as a map maker to identify balanced and unbalanced areas in my map.  For example, the "Australia Problem".  I am redoing the random mazes map, and I'm thinking I can run some network statistics, identify problem areas, and adjust.

     

    So my question is what statistics do you think would be most interesting?  Right now I'm thinking:

    closeness centrality and betweeness centrality.

     

    I'll be willing to run this on other map makers maps if they want.  If there is enough demand, I might build a web interface to make it easy for anyone to run.

     

    Here is a list of supported alogrithms:

    https://networkx.github.io/documentation/networkx-1.9.1/reference/algorithms.html

     

    See anything else on this list worth pursuing?

     

    I've just started looking into this, and this type of math is way outside my expertise, so any advice is welcome!

     

     


  2. #2 / 13
    Prime Amidon37
    Rank
    General
    Rank Posn
    #3
    Join Date
    Feb 10
    Location
    Posts
    1869

    I know a teeny weeny bit about network theory - in that I have a pretty good idea of what most of those words mean - but am certainly am not in much of a position to offer constructive advice.

    Here is one article I found -

    http://suehpro.blogspot.com/2014/01/network-analysis-of-risk-board-game-map.html


  3. #3 / 13
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Interesting article.  I wish it had more details.  Most of these metrics have wikipedia pages.

    Here are some pretty pictures:

    https://en.wikipedia.org/wiki/Centrality#/media/File:6_centrality_measures.png

    https://en.wikipedia.org/wiki/File:Graph_betweenness.svg

    https://en.wikipedia.org/wiki/File:Srep17095-f1.jpg

     

    I still have to add all the bits about loading the nodes & vertices from the territories and borders in the wargear xml and then I'd like to use the X,Y coordinates of the territories to generate png images of the metrics like the pictures above.

    Probably going to take me a while to finish the above work, and then I'll start trying out some different metrics, so feel free to make suggestions if anyone is interested.

     

    Eventually I'd like to be able to do some sort of weighting based upon continent values, but that is way down the road.

    Edited Tue 2nd Feb 23:56 [history]

  4. #4 / 13
    Standard Member Johasi Vidad
    Rank
    Major
    Rank Posn
    #181
    Join Date
    Feb 15
    Location
    Posts
    593

    I've worked with problems like centrality and betweenness for my GIS studies and could probably recreate the maps in my software and then run geoprocessing tools on them

    I might give that a try and would love to hear anything you come up with

    Board Rating Party - http://www.wargear.net/forum/showthread/4289/Board_Rating_Party

    Board Revival Group - http://www.wargear.net/forum/showthread/4082p1/Board_Revival_Group

  5. #5 / 13
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    I worked on it a bit last night.  It went surprisingly quickly.  I have been able to turn wargear maps into directed graphs, apply metrics to them and put out a rough image.  Still probably need another hour or so of work to get the images looking nicer.

    >could probably recreate the maps in my software and then run geoprocessing tools on them

     

    If you run python (or linux where python comes default), and you want to give me the expected format for your GIS stuff, I might be able to write a python script to convert wargear XML to your expected format.


  6. #6 / 13
    Prime Amidon37
    Rank
    General
    Rank Posn
    #3
    Join Date
    Feb 10
    Location
    Posts
    1869

    Fun.  I did not think of taking the wargear xml and using that to generate the network.  Certainly makes sense though.

     

    What's obvious is boards like your Maze Maze Maze and Chutes and Ladders where all continent bonuses are defined the same but the continents themselves have varying borders there will be some more desirable to own because they are easier to defend.  Australia gets its prestige because not only does it have a single border to protect no one is trying to get Asia.  I am sure there is a measure that show Australia as being "off the beaten path".

    I love in the Pearl Harbor board the island continent with the large bonus - that continent deserves a high bonus because of its "centrality" to the board.


  7. #7 / 13
    Standard Member Johasi Vidad
    Rank
    Major
    Rank Posn
    #181
    Join Date
    Feb 15
    Location
    Posts
    593

    Ozyman wrote:

    >could probably recreate the maps in my software and then run geoprocessing tools on them

     

    If you run python (or linux where python comes default), and you want to give me the expected format for your GIS stuff, I might be able to write a python script to convert wargear XML to your expected format.

    I think,  I actually should be able convert an XML within ArcMap to a variety formats I can use, but I don't code much so the API didn't make a lot of sense for getting the data.

    All I really would want to start with would be the country points, names, and borders for one of the more simple maps, and then progress from there.

    I could PM my email if you could get me something like that to try.

    Also pretty busy with school and stuff so I might be a bit slow, but this is something I've thought about doing for awhile since I already work with maps.

    Board Rating Party - http://www.wargear.net/forum/showthread/4289/Board_Rating_Party

    Board Revival Group - http://www.wargear.net/forum/showthread/4082p1/Board_Revival_Group

  8. #8 / 13
    Standard Member Coop
    Rank
    Major General
    Rank Posn
    #23
    Join Date
    Jan 12
    Location
    Posts
    13

    Post to Github.

    It's an interesting experiment and the measures for social network analysis seem reasonable but are notoriously difficult to interpret in a way that is meaningful.  Closeness is unlikely to give us anything other than nodes that are generally easy to get to, not ones that are valuable.

    The first thought that came to my mind would be one of the min-cut algorithms which separates a connected graph into disjoint graphs with the removal of a minimum # of edges, which might best identify choke points and valuable territories between continents (which I believe you were going for with the betweeness measure).

    For analysis it might be helpful to not use individual nodes, but rather composite nodes that include every node in a continent as a single node, that might identify the "australia problem."


  9. #9 / 13
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    Coop wrote:

    Post to Github.

    You want to see the code or the output?  The code is kind of ugly...

     

    It's an interesting experiment and the measures for social network analysis seem reasonable but are notoriously difficult to interpret in a way that is meaningful.  Closeness is unlikely to give us anything other than nodes that are generally easy to get to, not ones that are valuable.

    The first thought that came to my mind would be one of the min-cut algorithms which separates a connected graph into disjoint graphs with the removal of a minimum # of edges, which might best identify choke points and valuable territories between continents (which I believe you were going for with the betweeness measure).

    Yeah - I read a bit about min-cut.  I will need to write some more code for things like that, because right now I can only generate images if I get a value for each node.

     

    For analysis it might be helpful to not use individual nodes, but rather composite nodes that include every node in a continent as a single node, that might identify the "australia problem."

    I think this is what is missing.  Somehow I need to capture the ideas of continents, but I'm not sure how. 

    I found these slides that had some good examples, but haven't worked my way through all of them yet:

    http://mlg.ucd.ie/files/summer/tutorial.pdf

     

     

     


  10. #10 / 13
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    I threw up a bunch of images:

    http://prestopnik.com/wargear/networkx/

     

    No pretty web page, just a raw directory of images, but if anyone feels like digging through there, let me know what you think. 

     

    I'm thinking of having my code generate some more in the way of an actual web page to make it easier to browse the images, but honestly I'm not sure if there is much worth in the network analysis, so I'm not sure if I'll bother.

     

    A note on the colors in the image.  If all values of all nodes are between 0 & 1, then it forces blue to zero and red to 1, and hues in between are in between.  If some values are outside of 0 & 1, then it uses the min for blue and the max for red.   

    Edited Wed 10th Feb 00:50 [history]

  11. #11 / 13
    Prime Amidon37
    Rank
    General
    Rank Posn
    #3
    Join Date
    Feb 10
    Location
    Posts
    1869

    I don't see much in the tutorial that will help you do what you want.  Though slide 23 helps some - we would identify node h there as a choke-point, which we know is usually a desirable feature in maps.

    What coop says about making each continent a node could also be helpful - Australia is more valuable than South America because it has 1 border coming out of it.  Same idea with North America vs. Europe.  

     


  12. #12 / 13
    Prime Amidon37
    Rank
    General
    Rank Posn
    #3
    Join Date
    Feb 10
    Location
    Posts
    1869

    I am not sure how far you got with this but this cool story reminded me of it -  

    http://qz.com/650796/mathematicians-mapped-out-every-game-of-thrones-relationship-to-find-the-main-character/?utm_source=atlfb

    What may be the mathematical research thing to do for WG would be to not only create the network of territories/borders but then to bring in data from a bunch of games and create a weighted graph with how many times an attack happened across that border.


  13. #13 / 13
    Standard Member Xrayjay
    Rank
    Sergeant
    Rank Posn
    #407
    Join Date
    Jun 11
    Location
    Posts
    180

    This makes me think of Sabermetrics/Moneyball...we have over 100 thousand WGWF games played ranging from 2-16 player games....I wonder for each of those sets of data, how many bonus armies on average does Australia, or Africa provide vs. how many armies on average are lost either in attack/defence/occupying those continents over the course of a game. I am guessing the data would show that Asia is essentially worthless and Australia very valuable? Australia being even more valuable in games with less players too I'd think...but is there a tipping point, say in 10 player games where it becomes more costly to hold than its worth?

    Edited Tue 5th Apr 22:06 [history]

You need to log in to reply to this thread   Login | Join
 
Pages:   1   (1 in total)