Well the overcrowded flag was introduced to reduce the number of traveling passengers. If they were just rerouted, it would defy this purpose.
I understand that the original intention of the overcrowded flag is to help a player to understand why the routing doesn't work. However, please take a step back and look at the situation again : if the main route [as calculated by suche_route()] plus the parallel route(s) have a sufficient enough combined capacity to avoid overcrowding, but ends up only the main route is utilized, this overcrowded flag is actually raised as a
consequence of such deterministic, non-oscillating route search, and does not correctly reflect the real situation. The overcrowded flag is founded on a flawed assumption -- that overcrowding cannot be circumvented by taking an alternative route.
Edit : If there are too many pax, we should fix the problem in pax generation code instead.
But on another note, I see your argument. Especially the multiplayer argument is very valid, and such a behaviour may be even needed for competition. (Although it should be configurable, since it changes between cooperative gaming with public transfer hubs and competitive gaming with parallel networks.)
IMHO cooperative gaming does not require deterministic, non-oscillating routing any more than a single player game. If two players choose to use public interchanges, those interchanges will become the only connection points between their respective networks and routes must go via those interchanges anyway. The routing mechanism is essentially the mechanism of how Simutrans citizens choose their routes; I fail to see why they should evaluate routes differently just because of different game modes (single vs multi player).
As to the original problem of this thread, one problem is that the next transfer is cached and do not change if it becomes overcrowded. This can be solved by checking overcrowdedness of next transfer while loading the pax/mail/goods, and recalculate the route where necessary.
Drawing from the experience of EXP, I would consider the following as desirable changes to the routing mechanism :
1> a criterion on search which encompasses factors like number of transfers, number of stops, convoy/line nominal speed, nominal waiting time
-> cached as the basis of route comparison, to be used in route searching and for comparison in <4> below
2> cache the best line/convoy
-> used in <4> to determine distribution of pax/mail/goods loading
3> route search with multiple start halts
-> this is essential to allowing fair competition; this can be done with a single search
4> proportional distribution of pax/mail/goods during loading at stops
-> this avoids all-or-nothing distribution and allows room for survival of the weaker competitors
It would also be a good idea to consider the following at the same time :
5> journey tolerance
-> calculated with a simple formula, for capping the search and preventing unreasonable detour
6> preference for local/nearer destinations
-> more reasonable distribution of pax destinations; Z9999 seems to have a patch on this
Of course, I am not suggesting to implement these in the same way as EXP does, or copying its code. We just borrow the concepts, and we implement it in a way suitable to Standard.