it isn't hard to implement, but it can become very data intensive...
the problem is that one needs to know the routing mechanics and have a sufficiently robust datamodel for the systems.
assume for example, a simple data structure for a world, within a limit of 8 sectors across by 6 tall:
Struct simpleWorld{
char x;
char y;
char upp[12]; //incl tppg
char name[33];
char alg[2];
char stelldata[12];// allows for 4 compressed stars codes
char bases[3];
struct simpleWorld* nextPtr;
}
64 bytes per system.
for ease of cycling through, we'll add a nextPtr and assume only 2 bytes.
Adding some linking data; limiting to 30 serviced worlds , adds 2 bytes each allowed link, or 60 more bytes, assuming no data about link type. (based upon few worlds having more than 6 long links aka xboat routes and courier service is limited to J2 and thus no more than 3x6=18 systems, and then adding a6 system buffer jst in case...)
adding some speed efficiency, we add 1 byte for the char holding the number of links used.
we add an unsigned int (2bytes) for each of date data arrived and for hop count.
so we've added 60 + 1 + 4 = 65 bytes, and doubled the data structure's size.
loop a:
_ sort through the systems, examining for date present.
_ if date found, add one to hop count, and 8 to arrival
date, and gosub loop b
_ next system search for date.
loop b:
_ lookup target x/y
_ gosub loop c
_ when count equals number of links, return from sub.
loop c:
_ search systme list for match to current target
_ optional: adjust arrival date by + or - 1 day for this system
_ on finding target, if date less than extant date, or date is null, then replace date and hop-count. with valid values.
_ return from sub.
We're talking 8 systems per kb. that is large files; in an average sector with some 400 worlds, that's 50 kb plus sector overhead.
time overhead is reduceable (drastically) if current system is a static pointer in loop c, and all the x/y lists are ordered the same way....
other limits can be built in; hop-count limits, date limits, aligience limits, sector limits, etc. Date limits and hop-count limits get checked in loop a.
the program code isn't terribly long to write to mine the data; but by doubling the struct (plus the padding out that occurs in structs in many systems) we increase memory useage AND data-file sizes. Assuming the simple struct generates at load time from a GEnie archive format (80 col space delimited text...) that's 80B per system compressing in memory to 64B... or expanding into part of a 129B (132 with typical padding) struct.
Upon opeing a GEnie file, we'll need to generate the links. We can either assume news will flow along any trade link with weekly flows of a given route minimum, or we can assume a coordinated postal effort, and thus find route per the CT Xboat methodology. Each A port looks for all other A ports at range 3 or 4. if fewer than 1, look for B ports in same, and A ports at 2. All worlds within two get Type S weekly service from an XBoat port. If there is no xboat port within 2 PC, service will be from the nearest B or C port that does have Type S service.
the other issue is "Just how ^&*(* many type S's and XBoats are there out there?"
in order to use the above calculations, which don't account for portential misjumps, we have to assume each route has 16 ships (8 day cycle, 1 each way per day), or a capital investment of about 352 MCR per scout/courier link, and about 3x that per xboat link., plus upkeep.
Realistically, we need a larger data structure which also lists type of link for each link, with several of the following types:
daily xboat (rougly 3 GCr in capital, at 17 XB plus 2 tenders )
weekly xboat (roughly 1GCR in capital, 4 Type XB, 1 tender)
daily scout/courier (roughly 350 MCr in capital; 16 type S)
weekly scout/courier (roughly 90 MCr in capital, 4 type S)
biweekly scout/courier (roughly 50 MCr in capital, 2 tpe S and 2 ground stations)
monthly single scout route (roughly 25 MCr in captial, type S and two ground stations.)
each of these has a different calc for departure (and thus arrival) dates.
if we instead try to figure out using GT:FT, we run into even more problems with the calculations, as we need the trade route value, and to make an valid estimate of ships/week, etc... and then to figure if the tdata is xboated, couriered, or sent via merchant...
the real problem is that the baseline assumptions of transmission are all debatelable variales.
IMTU, all xboat routes on the map in the imperium are daily. all couriers leave on wonday, arriving on sixday, senday, or oneday. high pops, or B or C ports have weekly runs; D and E ports or low pops get biweekly service (one each way on 1st and 15th day of month). D and E ports whch are also low pop might get monthly service(to on 1st, back on 15th of month). real news flows also via civil shipping.
Since the stats for the Type S are an artifact of the CT design sequences, I've no problem with even cheaper mail-router craft built under HG/MT/FF&S/T4/T20: J2, 1G, 1bis, 2 staterooms, no hardpoint, no carried craft. Usually steamlined. Type S are used where gravitic sistuations require it; either due to jump masking or local gravity.