every once in a while walk every flag/road and for each flag build a list of all flags it connects to, and update a hash/map of every flag in the realm with a count of how many other flags connect to it to get back to the castle/nearest stock, and use this to determine main arterial roads, then use that information to optimize road, including having spiderweb roads function use this knowledge to minimize the number of connections it creates. This should also allow easy detection of roads that are disconnected from the main road system