tomhoward is correct. It's called "virtual interlining". I started the team that built it at Hopper (started working on it in Fall 2020 and we launched our first version in Fall 2021). They're called Mix & Match fares on the Hopper app. It's a really hard problem. So hard that we didn't even try to solve the "best" flight. We used a bunch of heuristics to find what we believed would be "better" flights. We measured what we called "beat rate" which was the rate that a VI flight was the cheapest on our flight list. When I left the team, our beat rate was around 0.5 (so a VI flight was the cheapest half the time).