It would be simple enough, but I think to make it useful you'd need routeing data also.
Obviously the incredible complexity between differing restrictions, stopping patterns, and so on, is what makes it hard to generalise. E.g., a direct train from A- B at 9:30am requires an Anytime Day Single, but you can travel on that route from C-D at that time using an Off-Peak Day Single, which is cheaper than the SDS A-B, even though the comparable SDS tickets are cheaper....