There was talk about Minimum Spanning Tree where is was diced that a MST is probably not what we want. #280
I think what we want is the tree that has the shortest average of the short path from every node to the root then from the root to every other node.
let distances = Vec::new();
for node_a in nodes {
let to_route = distance_to_route(node_a);
for node_b in nodes{
paths.push(to_root + distance_to_route(node_b));
}
}
let value_we_want_to_minimize = distances.iter().sum() / distances.len();
which I think can be approximated be just finding the centroid of the graph.
Now there could be more than one centroid, but I think for a node's locator just choose the closest centroid with the largest ID then having special routing for the root ball that logical all the centroids have a virtual root as their parent.
You could just choose one of the centroids as the official root for locators, and all locators would by from that root to the centroid the node is rooted to.
I'm not sure if you would need to change the distance metric but a node could use information about the rootball to find a shortcut to the centroid the destination locator is rooted on.
kinda like the old UUCP bang paths where you would give how to reach your system from a commonly known system.
There was talk about Minimum Spanning Tree where is was diced that a MST is probably not what we want. #280
I think what we want is the tree that has the shortest average of the short path from every node to the root then from the root to every other node.
which I think can be approximated be just finding the centroid of the graph.
Now there could be more than one centroid, but I think for a node's locator just choose the closest centroid with the largest ID then having special routing for the root ball that logical all the centroids have a virtual root as their parent.
You could just choose one of the centroids as the official root for locators, and all locators would by from that root to the centroid the node is rooted to.
I'm not sure if you would need to change the distance metric but a node could use information about the rootball to find a shortcut to the centroid the destination locator is rooted on.
kinda like the old UUCP bang paths where you would give how to reach your system from a commonly known system.