[Freeciv-Dev] Re: (PR#7282) connect as orders
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7282 >
ue80@xxxxxxxxxxxxxxxxxxxxx wrote:
> So you get a spanning tree of cities when you want to make a railroad
> network?
Indeed. It will not necessarily be a minimal spanning tree, though.
Algorithm for a minimal spanning tree:
1 Pick a node (city). This is your initial tree.
2 While there are unconnected nodes:
3 Pick the node that is closest to your existing tree.
4 Connect to that node from the closest point on the tree.
Connect skips step 3.
jason
|
|