title: Undirected graph conversion to tree
body: <p>Given an <a href="http://en.wikipedia.org/wiki/Undirected_graph#Undirected_graph" rel="noreferrer">undirected graph</a> in which each node has a Cartesian coordinate in space that has the general shape of a tree, is there an algorithm to convert the graph into a tree, and find the appropriate root node?</p>
  
  <p>Note that our definition of a "tree" requires that branches do not diverge from parent nodes at acute angles.</p>
  
  <p>See the example graphs below. How do we find the red node?</p>
  
  <p><img src="https://i.stack.imgur.com/s9wGx.png" alt="Example input graph">
  <img src="https://i.stack.imgur.com/yFYb6.png" alt="Example output tree"></p>