Currently, routes relations are analyzed in the first round.
Second round, route_masters are analyzed. If they don't match (no from/to), the code checks whether a member (child) route relation matched. In this case, also the route_master (parent) matches.
Enhancement: with the route_masters, check for their route relation members (children) and if 'ref' and 'type' match, the route relation will also match.
So, having found at least one matching route relation, all sister/brother route relations will also match provided that 'ref' and 'type' do fit.
Currently, routes relations are analyzed in the first round. Second round, route_masters are analyzed. If they don't match (no from/to), the code checks whether a member (child) route relation matched. In this case, also the route_master (parent) matches.
Enhancement: with the route_masters, check for their route relation members (children) and if 'ref' and 'type' match, the route relation will also match. So, having found at least one matching route relation, all sister/brother route relations will also match provided that 'ref' and 'type' do fit.
Take care for the correct sorting.