dimanche 22 octobre 2017

MST from an array of 2D triangles, but with a little twist

After a bit of specialized placement & processing of rects on a 2D plane, we start out with multiple, pseudo-randomly plotted vertices (rect centers). We then use delaunay triangulation to create a network between each vertex. This leaves us with an array of Triangle structs, each containing 3 Edge variables.

At this point, I would like to use this data to form a Minimum Spanning Tree, but there's a slight catch...

Somewhere in the graph (likely near the center, but not always) will be a node that requires between 3-5 connections to it from other unique nodes. This complicates things, since every other node should only contain a single connection, and the data structures being used make it difficult to determine "what's connected to what" in a solid, traversable format.

So, given an array of triangles in the above format, and a random vertex to use as the "root node", how could I properly traverse the network to create an MST where there are at least 3 connections to our "central node", but no more than 5 connections to it? Is this possible?

Aucun commentaire:

Enregistrer un commentaire