actionscript 3 - Flex and polygonal.de graph classes in pathfinding? -



actionscript 3 - Flex and polygonal.de graph classes in pathfinding? -

i wondering if have done already, send me right direction..

the issue follow : have 2 dimensional array, on hold integer numbers, if number 0 - item shall not included graph, if 1 - must included. result graph shall used patfinding ( shortest path ) element. how turn 2 dimensional array graph ? ( polygona.de classes if possible ),

i trying polygonal.de classes. suggestions , points right direction more appreciated.

this 2 dimensional structure. reddish cells prohibited walk on, , there must found optimal path "start" "end". 1st things 1st - need turn 2 dimensional construction graph :|

the way see it, 2d array graph. node of graph represented pair (i, j) , may have neighbour nodes such (i + 1, j), (i, j + 1), etc. can write utility function array hides these low-level neighbour definitions , skips cells occupied.

the de.polygonal.ds api graph info construction contains illustration construction of graph:

var graph = new de.polygonal.ds.graph<string>(); var = graph.addnode("a"); var b = graph.addnode("b"); var c = graph.addnode("c"); graph.addsinglearc(a, b, 1.0); graph.addsinglearc(b, a, 1.0); graph.addmutualarc(a, c, 1.0);

adjust illustration build 2d array contains node each free (i, j) of original 2d array. traverse 2d array of nodes , phone call addmutualarc() connect adjacent nodes.

flex actionscript-3 path-finding

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -